Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
fix(dev): login endpoint respects admin bypass mode
rcourtman125959e4e05d
diff --git a/internal/api/router.go b/internal/api/router.goindex f9d739c96c..f777051d48 100644--- a/internal/api/router.go+++ b/internal/api/router.go@@ -5086,8 +5086,14 @@ func (r *Router) handleLogin(w http.ResponseWriter, req *http.Request) {return}- // Verify credentials- if constantTimeStringEqual(loginReq.Username, r.config.AuthUser) && auth.CheckPasswordHash(loginReq.Password, r.config.AuthPass) {+ // Verify credentials (or accept any credentials when admin bypass is enabled)+ credentialsValid := constantTimeStringEqual(loginReq.Username, r.config.AuthUser) && auth.CheckPasswordHash(loginReq.Password, r.config.AuthPass)+ effectiveUsername := loginReq.Username+ if adminBypassEnabled() {+ credentialsValid = true+ effectiveUsername = "admin"+ }+ if credentialsValid {// Clear failed login attemptsClearFailedLogins(loginReq.Username)ClearFailedLogins(clientIP)@@ -5109,10 +5115,10 @@ func (r *Router) handleLogin(w http.ResponseWriter, req *http.Request) {if loginReq.RememberMe {sessionDuration = 30 * 24 * time.Hour // 30 days}- GetSessionStore().CreateSession(token, sessionDuration, userAgent, clientIP, loginReq.Username)+ GetSessionStore().CreateSession(token, sessionDuration, userAgent, clientIP, effectiveUsername)// Track session for user (in-memory for fast lookups)- TrackUserSession(loginReq.Username, token)+ TrackUserSession(effectiveUsername, token)// Generate CSRF tokencsrfToken := generateCSRFToken(token)@@ -5145,7 +5151,7 @@ func (r *Router) handleLogin(w http.ResponseWriter, req *http.Request) {})// Audit log successful login- LogAuditEventForTenant(GetOrgID(req.Context()), "login", loginReq.Username, clientIP, req.URL.Path, true, "Successful login")+ LogAuditEventForTenant(GetOrgID(req.Context()), "login", effectiveUsername, clientIP, req.URL.Path, true, "Successful login")// Return successw.Header().Set("Content-Type", "application/json")