sophuwu.site > manhttpd
touches
sophuwu sophie@skisiel.com
Thu, 11 Apr 2024 12:56:03 +0000
commit

0d587097bcf265a34a39c2ebcfd59c353a28201c

parent

82be4696e3ff092882679fb8fb7c0725f93f2aba

2 files changed, 11 insertions(+), 5 deletions(-)

jump to
M index.htmlindex.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.gomain.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"