-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in traefik-forwardauth (pull request #46)
Traefik forwardauth * Allow vouch to forward to authentication for a traefik forwardauth scheme * Clean up code, fix API url * Docs and cleanup * Vouch and session tests * Vouch docs * Test userid header * fix image
- Loading branch information
Showing
10 changed files
with
251 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
version: '3.3' | ||
services: | ||
|
||
# Traefik listening on port 88 (in case 80 conflicts with something...) | ||
traefik: | ||
image: traefik:v2.3 | ||
command: | ||
- "--api.insecure=true" | ||
- "--providers.docker=true" | ||
- "--providers.docker.exposedbydefault=false" | ||
- "--entrypoints.web.address=:88" | ||
ports: | ||
- "88:88" | ||
- "8090:8080" | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock:ro" | ||
|
||
# Simpleauth | ||
simpleauth: | ||
image: zix99/simple-auth:latest | ||
environment: | ||
SA_WEB_LOGIN_COOKIE_JWT_SIGNINGKEY: a-unqiue-signing-key # CHANGE ME!! | ||
SA_VERBOSE: 'true' | ||
SA_WEB_LOGIN_SETTINGS_ROUTEONLOGIN: "http://${DOMAIN}:88" | ||
# Allow login to send user back to any subdomain | ||
SA_WEB_LOGIN_SETTINGS_ALLOWEDCONTINUEURLS: 'https?://.*${DOMAIN}(:\d+)?/.*' | ||
SA_WEB_LOGIN_COOKIE_DOMAIN: ${DOMAIN} # IMPORTANT: Higher-level domain | ||
SA_WEB_BASEURL: http://auth.${DOMAIN}:88 | ||
SA_AUTHENTICATORS_VOUCH_ENABLED: 'true' | ||
# The vouch endpoint will put the user's UUID on this header to be forwarded | ||
SA_AUTHENTICATORS_VOUCH_USERHEADER: 'X-User-Id' | ||
volumes: | ||
- sadb:/var/lib/simple-auth | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.simpleauth.rule=Host(`auth.${DOMAIN}`)" # Fill in with your own domain | ||
- "traefik.http.routers.simpleauth.entrypoints=web" | ||
# Set up middleware, needs to be the internal URL of the service so that the continue URL is created correctly | ||
# Will be used by other services | ||
- "traefik.http.middlewares.simple-auth.forwardauth.address=http://simpleauth/api/v1/auth/vouch?forward=1" | ||
- "traefik.http.middlewares.simple-auth.forwardauth.authResponseHeaders=X-User-Id" # Forward this header to the end service | ||
|
||
# testapp is a small nodejs app that will verify your token and only let you in if you have a valid token | ||
testapp: | ||
image: nginx:latest | ||
labels: | ||
- "traefik.enable=true" | ||
# App settings | ||
- "traefik.http.routers.testapp.rule=Host(`${DOMAIN}`)" # Fill in with your own domain | ||
- "traefik.http.routers.testapp.entrypoints=web" | ||
# Attach to the simple-auth middleware defined in simple-auth | ||
- "traefik.http.routers.testapp.middlewares=simple-auth" | ||
|
||
|
||
volumes: | ||
sadb: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.