diff --git a/core/authelia.yml b/core/authelia.yml index 21fe9fe..1ff41eb 100644 --- a/core/authelia.yml +++ b/core/authelia.yml @@ -13,7 +13,7 @@ default_2fa_method: "" server: host: 0.0.0.0 - port: 9091 + port: {{ env "NOMAD_PORT_main" }} disable_healthcheck: false log: diff --git a/core/main.tf b/core/main.tf index 396e90d..d786854 100644 --- a/core/main.tf +++ b/core/main.tf @@ -63,7 +63,7 @@ module "authelia" { image = "authelia/authelia:latest" args = ["--config", "$${NOMAD_TASK_DIR}/authelia.yml"] ingress = true - service_port = 9091 + service_port = 9999 service_port_static = true # metrics_port = 9959 @@ -88,10 +88,10 @@ module "authelia" { service_tags = [ # Configure traefik to add this middleware - "traefik.http.middlewares.authelia.forwardAuth.address=http://authelia.nomad:9091/api/verify?rd=https%3A%2F%2Fauthelia.thefij.rocks%2F", + "traefik.http.middlewares.authelia.forwardAuth.address=http://authelia.nomad:$${NOMAD_PORT_main}/api/verify?rd=https%3A%2F%2Fauthelia.thefij.rocks%2F", "traefik.http.middlewares.authelia.forwardAuth.trustForwardHeader=true", "traefik.http.middlewares.authelia.forwardAuth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email", - "traefik.http.middlewares.authelia-basic.forwardAuth.address=http://authelia.nomad:9091/api/verify?auth=basic", + "traefik.http.middlewares.authelia-basic.forwardAuth.address=http://authelia.nomad:$${NOMAD_PORT_main}/api/verify?auth=basic", "traefik.http.middlewares.authelia-basic.forwardAuth.trustForwardHeader=true", "traefik.http.middlewares.authelia-basic.forwardAuth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email", ]