aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2026-01-26 15:51:17 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2026-01-26 15:51:17 +0100
commit674bae36579a3b273c4802519178e90e5572c9ab (patch)
tree3262552c8b815581f4555f9c10f7ae81ec6e4d3f /main.go
parentf1d501e90d67613952d5dc4639f2d52b51e5076c (diff)
downloadticket-counter-674bae36579a3b273c4802519178e90e5572c9ab.tar.gz
ticket-counter-674bae36579a3b273c4802519178e90e5572c9ab.zip
add configurable admin password
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files 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()