touches
sophuwu sophie@skisiel.com
Thu, 11 Apr 2024 12:56:03 +0000
2 files changed,
11 insertions(+),
5 deletions(-)
M
index.html
→
index.html
@@ -1,7 +1,8 @@
-<html> +<!DOCTYPE html> +<html lang="en"> <head> <meta charset="utf-8"> - <title>{{ title }}</title> + <title>{{ title }}@{{ hostname }}</title> <link rel="stylesheet" type="text/css" href="/style.css"> </head> <body>
M
main.go
→
main.go
@@ -27,13 +27,18 @@ Mandoc string
} func GetCFG() { - CFG.Hostname, _ = os.Hostname() + CFG.Hostname = os.Getenv("HOSTNAME") index = strings.ReplaceAll(index, "{{ hostname }}", CFG.Hostname) b, e := exec.Command("which", "mandoc").Output() if e != nil || len(b) == 0 { - log.Fatal("Fatal: no mandoc `apt-get install mandoc`") + CFG.Mandoc=os.Getenv("MANDOCPATH") + if CFG.Mandoc == "" { + log.Fatal("Fatal: no mandoc `apt-get install mandoc`") + } + } else { + CFG.Mandoc=string(b) } - CFG.Mandoc = strings.TrimSpace(string(b)) + //CFG.Mandoc = "/home/sophie/.local/bin/mandoc" CFG.Addr = os.Getenv("ListenPort") if CFG.Addr == "" { CFG.Addr = "8082"