summaryrefslogtreecommitdiff
path: root/repoHTML.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-08 11:36:46 -0500
committerJeff Carr <[email protected]>2024-10-11 17:15:57 -0500
commitd827c398f00e965f5b57447c7d730f96442e1173 (patch)
tree0b89a8c17918ecdbb28887e4b228ab746517939c /repoHTML.go
parentc6be85e92f00b527ccd2e7bf55f804f9a1619e88 (diff)
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 <[email protected]>
Diffstat (limited to 'repoHTML.go')
-rw-r--r--repoHTML.go14
1 files changed, 11 insertions, 3 deletions
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 {