Compare commits

..

2 Commits

Author SHA1 Message Date
c644f42ea9 Fixed missing AUTH_HANDLER_URL env issue 2024-07-17 17:52:35 +02:00
941c5fdf92 Fixed missing AUTH_HANDLER_URL env issue 2024-07-17 17:48:24 +02:00
2 changed files with 2 additions and 3 deletions

View File

@@ -3,7 +3,6 @@ package config
import (
"os"
"github.com/gofiber/fiber/v2/log"
"github.com/joho/godotenv"
)
@@ -16,7 +15,7 @@ func init() {
func GetEnv(name string, defVal string) string {
env := os.Getenv(name)
if env == "" {
log.Panicf("Missing %s env variable", name)
return defVal
}
return env

View File

@@ -181,7 +181,7 @@ func (s *Service) getTags() []string {
// "traefik.http.middlewares.auth_" + s.Name + ".forwardauth.trustForwardHeader=true",
// "traefik.http.middlewares.auth_" + s.Name + ".forwardauth.authRequestHeaders=Cookie",
// "traefik.http.middlewares.auth_" + s.Name + ".forwardauth.authResponseHeaders=Set-Cookie, Server",
"traefik.http.middlewares.auth_" + s.Name + ".plugin.auth.handlerURL=" + config.GetEnv("AUTH_HANDLER_URL", ""),
"traefik.http.middlewares.auth_" + s.Name + ".plugin.auth.handlerURL=" + config.GetEnv("AUTH_HANDLER_URL", "http://identity.service.ego.io/api/v1/traefik"),
"traefik.http.middlewares.requestid_" + s.Name + ".plugin.requestid.headerName=X-Request-ID",
"traefik.http.middlewares.stripprefix_" + s.Name + ".stripprefix.prefixes=" + s.pathPrefix,
"traefik.http.routers." + s.Name + ".rule=PathPrefix(`" + s.pathPrefix + "`)",