diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-01-26 15:51:17 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-01-26 15:51:17 +0100 |
| commit | 674bae36579a3b273c4802519178e90e5572c9ab (patch) | |
| tree | 3262552c8b815581f4555f9c10f7ae81ec6e4d3f | |
| parent | f1d501e90d67613952d5dc4639f2d52b51e5076c (diff) | |
| download | ticket-counter-674bae36579a3b273c4802519178e90e5572c9ab.tar.gz ticket-counter-674bae36579a3b273c4802519178e90e5572c9ab.zip | |
add configurable admin password
| -rw-r--r-- | main.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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() |
