Basic Bilder Integration

This commit is contained in:
Simon Martens
2025-01-18 13:46:42 +01:00
parent 3aa947277a
commit 5715739e92
7 changed files with 93 additions and 8 deletions

View File

@@ -17,6 +17,7 @@ const (
DEFAULT_GIT_DIR = "data_git"
DEFAULT_GND_DIR = "cache_gnd"
DEFAULT_GEO_DIR = "cache_geo"
DEFAULT_IMG_DIR = "data_bilder"
DEFAULT_PORT = "8080"
DEFAULT_ADDR = "localhost"
@@ -37,6 +38,7 @@ type Config struct {
FolderPath string `json:"folder_path" envconfig:"FOLDER_PATH"`
GNDPath string `json:"gnd_path" envconfig:"GND_PATH"`
GeoPath string `json:"geo_path" envconfig:"GEO_PATH"`
ImgPath string `json:"img_path" envconfig:"IMG_PATH"`
WebHookEndpoint string `json:"webhook_endpoint" envconfig:"WEBHOOK_ENDPOINT"`
WebHookSecret string `json:"webhook_secret" envconfig:"WEBHOOK_SECRET"`
Debug bool `json:"debug" envconfig:"DEBUG"`
@@ -110,6 +112,10 @@ func readDefaults(cfg *Config) *Config {
cfg.Port = DEFAULT_PORT
}
if strings.TrimSpace(cfg.ImgPath) == "" {
cfg.ImgPath = DEFAULT_IMG_DIR
}
return cfg
}