parent
fface98131
commit
b283823ffe
7
Makefile
7
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!"
|
||||
|
|
|
@ -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
|
||||
|
|
8
main.go
8
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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue