From 320903cc013d9fa0b01be952ce360dca7e8e03e7 Mon Sep 17 00:00:00 2001 From: Simon Martens Date: Tue, 30 Sep 2025 12:38:01 +0200 Subject: [PATCH] -unused img path --- app/kgpz.go | 11 ----------- providers/config.go | 6 ------ 2 files changed, 17 deletions(-) diff --git a/app/kgpz.go b/app/kgpz.go index 838eda6..5c5f288 100644 --- a/app/kgpz.go +++ b/app/kgpz.go @@ -25,7 +25,6 @@ import ( // It is meant to be constructed once and then used as a singleton. const ( - IMG_PREFIX = "/img/" PICTURES_PREFIX = "/static/pictures/" EDITION_URL = "/edition/" @@ -89,16 +88,6 @@ func NewKGPZ(config *providers.ConfigProvider) (*KGPZ, error) { } func (k *KGPZ) Pre(srv *fiber.App) error { - // Check if folder exists and if yes, serve image files from it - if _, err := os.Stat(k.Config.Config.ImgPath); err == nil { - fs := os.DirFS(k.Config.Config.ImgPath) - srv.Use(IMG_PREFIX, compress.New(compress.Config{ - Level: compress.LevelBestSpeed, - }), etag.New(), helpers.StaticHandler(&fs)) - } else { - logging.Info("Image folder not found. Skipping image serving.") - } - // Serve newspaper pictures from pictures directory picturesPath := k.Config.Config.PicturesPath if _, err := os.Stat(picturesPath); err == nil { diff --git a/providers/config.go b/providers/config.go index b76646d..be40632 100644 --- a/providers/config.go +++ b/providers/config.go @@ -19,7 +19,6 @@ const ( DEFAULT_GND_CACHE_DIR = "gnd" DEFAULT_GEO_CACHE_DIR = "geo" DEFAULT_SEARCH_CACHE_DIR = "search" - DEFAULT_IMG_DIR = "data_bilder" DEFAULT_PICTURES_DIR = "pictures" DEFAULT_PORT = "8080" @@ -43,7 +42,6 @@ type Config struct { GNDPath string `json:"gnd_path" envconfig:"GND_PATH"` GeoPath string `json:"geo_path" envconfig:"GEO_PATH"` SearchPath string `json:"search_path" envconfig:"SEARCH_PATH"` - ImgPath string `json:"img_path" envconfig:"IMG_PATH"` PicturesPath string `json:"pictures_path" envconfig:"PICTURES_PATH"` WebHookEndpoint string `json:"webhook_endpoint" envconfig:"WEBHOOK_ENDPOINT"` WebHookSecret string `json:"webhook_secret" envconfig:"WEBHOOK_SECRET"` @@ -130,10 +128,6 @@ func readDefaults(cfg *Config) *Config { cfg.Port = DEFAULT_PORT } - if strings.TrimSpace(cfg.ImgPath) == "" { - cfg.ImgPath = DEFAULT_IMG_DIR - } - if strings.TrimSpace(cfg.SearchPath) == "" { cfg.SearchPath = DEFAULT_SEARCH_CACHE_DIR }