feature: Add basic Traefik/Authelia support files

This commit is contained in:
Keith Solomon
2025-12-06 13:41:33 -06:00
parent 43bd37c552
commit b0d760c3ab
5 changed files with 294 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
CLOUDFLARE_API_KEY=your_cloudflare_api_key_here
CLOUDFLARE_EMAIL=your_cloudflare_email_here
# Gebnerate these secrets using openssl rand -hex 64
AUTHELIA_SESSION_SECRET=your_session_secret_here
AUTHELIA_STORAGE_ENCRYPTION_KEY=your_storage_encryption_key_here
AUTHELIA_JWT_SECRET=your_jwt_secret_here
AUTHELIA_NOTIFIER_USERNAME=your_email_here
AUTHELIA_NOTIFIER_PASSWORD=your_email_app_password_here

View File

@@ -0,0 +1,93 @@
services:
traefik:
container_name: Traefik
image: traefik:latest
restart: always
networks:
traefik_macvlan:
ipv4_address: 192.168.2.253 # Traefik's LAN IP
proxy: {}
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik/traefik.yml:/traefik.yml:ro
- ./traefik/config:/traefik_config
- ./traefik/cert:/traefik_cert
- ./traefik/logs:/logs
environment:
- TZ=America/Winnipeg
- CLOUDFLARE_API_KEY=${CLOUDFLARE_API_KEY}
- CLOUDFLARE_EMAIL=${CLOUDFLARE_EMAIL}
labels:
- "traefik.enable=true"
# Dashboard (behind Authelia)
- "traefik.http.routers.traefik.rule=Host(`tfk.yourdomain.com`)"
- "traefik.http.routers.traefik.entrypoints=https"
- "traefik.http.routers.traefik.tls.certresolver=cloudflare"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.middlewares=authelia@docker"
authelia:
container_name: Authelia
restart: always
image: authelia/authelia:latest
networks:
- proxy
volumes:
- ./authelia/config:/config
- ./authelia/secrets:/secrets:ro
- ./authelia/logs:/var/log/authelia
environment:
- TZ=America/Winnipeg
- X_AUTHELIA_CONFIG_FILTERS=template
- AUTHELIA_SESSION_SECRET=${AUTHELIA_SESSION_SECRET}
- AUTHELIA_STORAGE_ENCRYPTION_KEY=${AUTHELIA_STORAGE_ENCRYPTION_KEY}
- AUTHELIA_JWT_SECRET=${AUTHELIA_JWT_SECRET}
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.authelia.rule=Host(`auth.yourdomain.com`)"
- "traefik.http.routers.authelia.entrypoints=https"
- "traefik.http.routers.authelia.tls.certresolver=cloudflare"
- "traefik.http.middlewares.authelia.forwardAuth.address=http://authelia:9091/api/authz/forward-auth"
- "traefik.http.middlewares.authelia.forwardAuth.trustForwardHeader=true"
- "traefik.http.middlewares.authelia.forwardAuth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email"
traefik-gui:
container_name: Traefik-GUI
restart: always
image: ghcr.io/rahn-it/traefik-gui:master
networks:
- proxy
volumes:
- ./traefik-gui/db:/app/db
- ./traefik/config:/app/traefik
environment:
- TZ=America/Winnipeg
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.traefik-gui.rule=Host(`tfk-admin.yourdomain.com`)"
- "traefik.http.routers.traefik-gui.entrypoints=https"
- "traefik.http.routers.traefik-gui.tls.certresolver=cloudflare"
- "traefik.http.routers.traefik-gui.middlewares=authelia@docker"
networks:
traefik_macvlan:
external: true
proxy:
name: proxy
driver: bridge

View File

@@ -0,0 +1,95 @@
global:
# Send anonymous usage data
sendAnonymousUsage: true
checkNewVersion: true
api:
dashboard: true
debug: true
disableDashboardAd: true
log:
filePath: "/logs/logfile.log"
level: INFO
format: common
accessLog:
filePath: "/logs/access.log"
# bufferingSize: 20
fields:
defaultMode: keep
names:
StartUTC: drop
entryPoints:
http:
address: ":80"
http:
redirections:
entryPoint:
to: https
scheme: https
permanent: true
https:
address: ":443"
http:
tls:
# Generate a wildcard domain certificate
certResolver: cloudflare
domains:
- main: '*.yourdomain.com'
forwardedHeaders:
trustedIPs:
- "173.245.48.0/20"
- "103.21.244.0/22"
- "103.22.200.0/22"
- "103.31.4.0/22"
- "141.101.64.0/18"
- "108.162.192.0/18"
- "190.93.240.0/20"
- "188.114.96.0/20"
- "197.234.240.0/22"
- "198.41.128.0/17"
- "162.158.0.0/15"
- "104.16.0.0/13"
- "104.24.0.0/14"
- "172.64.0.0/13"
- "131.0.72.0/22"
- "2400:cb00::/32"
- "2606:4700::/32"
- "2803:f800::/32"
- "2405:b500::/32"
- "2405:8100::/32"
- "2a06:98c0::/29"
- "2c0f:f248::/32"
serversTransport:
insecureSkipVerify: true
providers:
providersThrottleDuration: 2s
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
watch: true
network: proxy
file:
directory: "/traefik_config"
watch: true
certificatesResolvers:
cloudflare:
acme:
email: ksolomon@gmail.com
storage: /traefik_cert/acme.json
dnsChallenge:
provider: cloudflare
resolvers:
- "1.1.1.1:53"
- "1.0.0.1:53"