From 03ed4cf7b17e353f7b34a129c6e0740c7c86748a Mon Sep 17 00:00:00 2001 From: groot Date: Wed, 18 Jun 2025 09:12:08 +0000 Subject: [PATCH] main.go aktualisiert --- main.go | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 3c290cb..ea56513 100644 --- a/main.go +++ b/main.go @@ -598,12 +598,31 @@ const ( // main // ────────────────────────────────────────────────────────────────────────────── func main() { - serveonly := flag.String("serveonly", "1", "no download just serve") - delay := flag.Duration("delay", defaultDelay, "delay between downloads (e.g. 5s, 1m)") - outDir := flag.String("out", "./lists/", "target directory") + //serveonly := flag.String("serveonly", "1", "no download just serve") + serveonly := os.Getenv("SERVEONLY") + if serveonly == "" { + serveonly = "1" + } + + //delay := flag.Duration("delay", defaultDelay, "delay between downloads (e.g. 5s, 1m)") + delay := os.Getenv("DELAY") + if delay == "" { + delay = defaultDelay + } + + //outDir := flag.String("out", "./lists/", "target directory") + outDir := os.Getenv("OUTDIR") + if outDir == "" { + outDir = "/lists/" + } + listFile := flag.String("list", "", "optional text file with URLs or Name|URL pairs (overrides built-in map)") listenAddr := flag.String("listen", ":8080", "HTTP listen address (e.g. :8080 or 127.0.0.1:8000)") - listenPrefix := flag.String("prefix", "http://importer:8080", "HTTP prefix for url in /lists.json") + //listenPrefix := flag.String("prefix", "http://importer:8080", "HTTP prefix for url in /lists.json") + listenPrefix := os.Getenv("PREFIX") + if listenPrefix == "" { + listenPrefix = "http://flodimporter:8080" + } flag.Parse() if *serveonly != "1" {