diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..61bcedb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu + +#RUN sudo apt-get update +RUN apt-get update +RUN apt-get install -y ca-certificates +ADD main /main +ADD entrypoint.sh /entrypoint.sh +ADD static /static +WORKDIR / + +EXPOSE 8091 +ENTRYPOINT ["/entrypoint.sh"] + diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..0a72ee1 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +./main + + diff --git a/main b/main index 0b2e3b5..dba2eba 100755 Binary files a/main and b/main differ diff --git a/main.go b/main.go index 01358d6..1968956 100644 --- a/main.go +++ b/main.go @@ -64,7 +64,7 @@ func main() { var oh hand.OauthHandler var logger lg.Logger - logger.LogLevel = lg.AllLevel + logger.LogLevel = lg.OffLevel oh.Log = &logger var cc hand.ClientCreds oh.ClientCreds = &cc @@ -143,6 +143,8 @@ func main() { router.HandleFunc("/login", h.HandleLogin) router.HandleFunc("/logout", h.HandleLogout) + router.HandleFunc("/rs/loglevel", h.SetLogLevel).Methods("POST") + // admin resources router.PathPrefix("/").Handler(http.FileServer(http.Dir("./static/"))) //http.Handle("/js", fs)