add Authelia Authentification
This commit is contained in:
parent
ff5d88f8ab
commit
6c88377d76
2 changed files with 7 additions and 2 deletions
|
@ -8,6 +8,7 @@ container_traefik_san_domains:
|
||||||
- "example.org"
|
- "example.org"
|
||||||
container_traefik_cloudflare_mail: "your-email@example.com"
|
container_traefik_cloudflare_mail: "your-email@example.com"
|
||||||
container_traefik_cloudflare_token: "your-cloudflare-token"
|
container_traefik_cloudflare_token: "your-cloudflare-token"
|
||||||
|
container_traefik_auth: 'basic' # basic or sso
|
||||||
container_traefik_basicauth_user: "admin"
|
container_traefik_basicauth_user: "admin"
|
||||||
container_traefik_basicauth_password: "yourpassword"
|
container_traefik_basicauth_password: "yourpassword"
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,6 @@ services:
|
||||||
- "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https"
|
- "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https"
|
||||||
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
|
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
|
||||||
- "traefik.http.routers.traefik-secure.entrypoints=https"
|
- "traefik.http.routers.traefik-secure.entrypoints=https"
|
||||||
- "traefik.http.middlewares.basic-auth.basicauth.users=${TRAEFIK_BASICAUTH_USER}:${TRAEFIK_BASICAUTH_PASSWORD}"
|
|
||||||
- "traefik.http.routers.traefik-secure.middlewares=basic-auth"
|
|
||||||
- "traefik.http.routers.traefik-secure.rule=Host(`${TRAEFIK_DOMAIN}`)"
|
- "traefik.http.routers.traefik-secure.rule=Host(`${TRAEFIK_DOMAIN}`)"
|
||||||
- "traefik.http.routers.traefik-secure.tls=true"
|
- "traefik.http.routers.traefik-secure.tls=true"
|
||||||
- "traefik.http.routers.traefik-secure.tls.certresolver=cloudflare"
|
- "traefik.http.routers.traefik-secure.tls.certresolver=cloudflare"
|
||||||
|
@ -38,6 +36,12 @@ services:
|
||||||
- "traefik.http.routers.traefik-secure.tls.domains[{{ loop.index0 }}].sans=*.{{ domain }}"
|
- "traefik.http.routers.traefik-secure.tls.domains[{{ loop.index0 }}].sans=*.{{ domain }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
- "traefik.http.routers.traefik-secure.service=api@internal"
|
- "traefik.http.routers.traefik-secure.service=api@internal"
|
||||||
|
{% if container_traefik_auth == 'sso' %}
|
||||||
|
- "traefik.http.routers.traefik-secure.middlewares=authelia@docker"
|
||||||
|
{% elif container_traefik_auth == 'basic' or container_traefik_auth is not defined %}
|
||||||
|
- "traefik.http.routers.traefik-secure.middlewares=basic-auth"
|
||||||
|
- "traefik.http.middlewares.basic-auth.basicauth.users=${TRAEFIK_BASICAUTH_USER}:${TRAEFIK_BASICAUTH_PASSWORD}"
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
traefik:
|
traefik:
|
||||||
|
|
Loading…
Add table
Reference in a new issue