diff --git a/Makefile b/Makefile index 6075cdc..33c308d 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,13 @@ all: @echo "make run # will build and run the daemon here" @echo "make debian # will build a debian package" +log: + @#systemctl status gowebd.service + @journalctl -f -xeu gowebd.service + +start: + su -c "systemctl start gowebd.service" + run: git pull echo "build it!" diff --git a/dumpClient.go b/dumpClient.go index ba9b79a..6c5c1af 100644 --- a/dumpClient.go +++ b/dumpClient.go @@ -10,7 +10,7 @@ import ( "go.wit.com/log" ) -func dumpClient(r *http.Request) { +func dumpClient(accessf, clientf *os.File, r *http.Request) { var host, url, proto, addr, agent string host = r.Host diff --git a/main.go b/main.go index 2f594f4..1bd3aa2 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ import ( //go:embed resources/* var resources embed.FS -var accessf, clientf *os.File +// var accessf, clientf *os.File var repoMap map[string]string var versionMap map[string]string @@ -28,7 +28,7 @@ func cleanURL(url string) string { } func okHandler(w http.ResponseWriter, r *http.Request) { - dumpClient(r) + // dumpClient(accessf, clientf, r) var tmp string // tmp = r.URL.String() tmp = cleanURL(r.URL.Path) @@ -133,8 +133,8 @@ func writeFile(w http.ResponseWriter, filename string) { } func main() { - accessf, _ = os.OpenFile("/home/jcarr/accessclient.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) - clientf, _ = os.OpenFile("/home/jcarr/httpclient.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) + // accessf, _ = os.OpenFile("/home/jcarr/accessclient.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) + // clientf, _ = os.OpenFile("/home/jcarr/httpclient.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) readconfigfile() readVersionFile()