diff --git a/cmd/userpanel/main.go b/cmd/userpanel/main.go index 8e1b021..0ac07df 100644 --- a/cmd/userpanel/main.go +++ b/cmd/userpanel/main.go @@ -1,18 +1,21 @@ package main import ( - "flag" "fmt" "net/http" + "os" + + "github.com/namsral/flag" "git.lattuga.net/boyska/feedpanel/panelui" "github.com/urfave/negroni" ) func main() { - allowedName := flag.String("allowed-name", "", "Name allowed to forward auth") - addr := flag.String("listen-addr", ":8000", "Address to listen on") - flag.Parse() + fs := flag.NewFlagSetWithEnvPrefix(os.Args[0], "PANEL", 0) + allowedName := fs.String("allowed-name", "", "Name allowed to forward auth") + addr := fs.String("listen-addr", ":8000", "Address to listen on") + fs.Parse(os.Args[1:]) var allowedNames []string if *allowedName != "" { diff --git a/panelui/main.go b/panelui/main.go index 0bfd1a9..9db0c7c 100644 --- a/panelui/main.go +++ b/panelui/main.go @@ -24,6 +24,6 @@ func GetMux() *http.ServeMux { templateExecute(w, r, "home.html", templates, map[string]interface{}{"User": user}) }) - mux.Handle("/static", http.FileServer(static.HTTPBox())) + mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(static.HTTPBox()))) return mux }