This commit is contained in:
ponzischeme89
2026-08-28 23:00:02 +12:00
parent 3e89036f7b
commit d5632e844a
66 changed files with 2870 additions and 689 deletions
+7 -1
View File
@@ -31,7 +31,13 @@ func (s *Server) recordLogin(r *http.Request, event store.LoginEvent) {
return
}
if event.IPAddress == "" {
event.IPAddress = requestClientIP(r)
origin := s.resolveClientIP(r)
event.IPAddress = origin.String()
// One line per sign-in attempt, so an operator can see which header the address
// came from when a reverse proxy is in front of the gateway. Debug keeps it out
// of the ordinary log while still being there when the question is asked.
s.log.Debug("resolved login client ip",
"ip", origin.String(), "via", origin.Via, "device_id", event.DeviceID)
}
if event.ClientVersion == "" {
event.ClientVersion = clientVersion(r)