update go packages version, add ip proxy and real ip headers to config.

This commit is contained in:
2026-04-23 06:00:03 +00:00
parent 563062368f
commit 3c70cb99a3
6 changed files with 196 additions and 135 deletions
+5
View File
@@ -32,6 +32,11 @@ func New(cfg *config.Config) *Server {
}
router := gin.Default()
// Configure trusted proxies and real IP headers
_ = router.SetTrustedProxies(cfg.TrustedProxies)
if len(cfg.RealIPHeaders) > 0 {
router.RemoteIPHeaders = cfg.RealIPHeaders
}
store := sessions.NewCookieStore([]byte(cfg.SecretKey))
// Initialize auth service (panic on error during startup)