From 674bae36579a3b273c4802519178e90e5572c9ab Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 26 Jan 2026 15:51:17 +0100 Subject: add configurable admin password --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a8d897d..f7e2078 100644 --- a/main.go +++ b/main.go @@ -147,7 +147,7 @@ func pageHandler(w http.ResponseWriter, r *http.Request) { Open uint64 Done uint64 IsAdmin bool - }{open.Load(), done.Load() + 1, r.URL.Query().Has("admin")} + }{open.Load(), done.Load() + 1, r.URL.Query().Has(*passwd)} if err := pageTemplate.Execute(w, tempData); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) @@ -172,7 +172,8 @@ func doneHandler(w http.ResponseWriter, r *http.Request) { } } -var port = flag.Int("p", 8080, "the port to use") +var port = flag.Int("port", 8080, "the port to use") +var passwd = flag.String("password", "admin", "the admin password") func main() { flag.Parse() -- cgit v1.2.3