@@ -18,12 +18,12 @@ import (
1818)
1919
2020func main () {
21- // build metadata - set via ldflags during build/release
22- var (
23- version = "dev"
24- commit = "none"
25- buildDate = "unknown"
26- )
21+ // build metadata - set via ldflags during build/release
22+ var (
23+ version = "dev"
24+ commit = "none"
25+ buildDate = "unknown"
26+ )
2727 // Parse flags (moved into config package to centralize flag parsing)
2828 _ = godotenv .Load (".env" )
2929 addrVal , dbVal , cfgVal , setFlags := config .ParseCommandFlags ()
@@ -108,27 +108,27 @@ func main() {
108108 if _ , err := config .Load (cfgPath ); err == nil {
109109 srcs = append (srcs , "config" )
110110 }
111- // Include version/commit info in the startup banner when present.
112- verStr := version
113- if commit != "none" {
114- verStr = verStr + " (" + commit + ")"
115- }
116- if buildDate != "unknown" {
117- verStr = verStr + " @ " + buildDate
118- }
119- banner .Print (addr , dbPath , strings .Join (srcs , ", " ), verStr )
111+ // Include version/commit info in the startup banner when present.
112+ verStr := version
113+ if commit != "none" {
114+ verStr = verStr + " (" + commit + ")"
115+ }
116+ if buildDate != "unknown" {
117+ verStr = verStr + " @ " + buildDate
118+ }
119+ banner .Print (addr , dbPath , strings .Join (srcs , ", " ), verStr )
120120
121121 mux := http .NewServeMux ()
122122
123- // Serve the web viewer at /viewer/
124- mux .Handle ("/viewer/" , http .StripPrefix ("/viewer/" , http .FileServer (http .Dir ("./viewer" ))))
123+ // Serve the web viewer at /viewer/
124+ mux .Handle ("/viewer/" , http .StripPrefix ("/viewer/" , http .FileServer (http .Dir ("./viewer" ))))
125125
126- // Liveness probe used by deployment systems and CI
127- mux .HandleFunc ("/healthz" , func (w http.ResponseWriter , r * http.Request ) {
128- w .Header ().Set ("Content-Type" , "application/json" )
129- w .WriteHeader (http .StatusOK )
130- _ , _ = w .Write ([]byte ("{\" status\" :\" ok\" }" ))
131- })
126+ // Liveness probe used by deployment systems and CI
127+ mux .HandleFunc ("/healthz" , func (w http.ResponseWriter , r * http.Request ) {
128+ w .Header ().Set ("Content-Type" , "application/json" )
129+ w .WriteHeader (http .StatusOK )
130+ _ , _ = w .Write ([]byte ("{\" status\" :\" ok\" }" ))
131+ })
132132
133133 // API handler (catch-all under /)
134134 mux .Handle ("/" , api .Handler ())
@@ -182,7 +182,7 @@ func main() {
182182 }
183183 config .SetRuntime (rc )
184184
185- wrapped := security .NewMiddleware (secCfg )(mux )
185+ wrapped := security .AuthenticateRequestMiddleware (secCfg )(mux )
186186
187187 // TLS support: use values from effective cfg
188188 cert := cfg .Server .TLS .CertFile
0 commit comments