From d827c398f00e965f5b57447c7d730f96442e1173 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 8 Oct 2024 11:36:46 -0500 Subject: try to rename as gowebd put the HTML assets raw in the binary also I'm how old and still committed a binary. squashed Signed-off-by: Jeff Carr --- repoHTML.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'repoHTML.go') diff --git a/repoHTML.go b/repoHTML.go index a00897b..9985e19 100644 --- a/repoHTML.go +++ b/repoHTML.go @@ -64,11 +64,19 @@ func findkey(url string) (string, string) { } func readconfigfile() { + var pfile []byte + var err error repoMap = make(map[string]string) - pfile, err := resources.ReadFile("resources/repomap") + + pfile, err = os.ReadFile("/etc/gowebd/repomap") if err != nil { - log.Error(err, "missing repomap in the binary") - return + log.Error(err, "no repository map file found in /etc/gowebd/") + log.Error(err, "falling back to the repository map file built into the gowebd binary") + pfile, err = resources.ReadFile("resources/repomap") + if err != nil { + log.Error(err, "missing repomap in the binary") + return + } } configfile = strings.Split(string(pfile), "\n") for _, line := range configfile { -- cgit v1.2.3