Advertisement
Guest User

Untitled

a guest
Mar 8th, 2021
512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 6.92 KB | None | 0 0
  1. #traefik docker-compose
  2. version: '3'
  3.  
  4. services:
  5.         traefik:
  6.                 image: traefik:v2.4.5
  7.                 container_name: traefik
  8.                 restart: unless-stopped
  9.                 security_opt:
  10.                        - no-new-privileges:true
  11.                 networks:
  12.                        - t2_proxy
  13.                 ports:
  14.                        - 80:80
  15.                         - 443:443
  16.                 volumes:
  17.                        - /etc/localtime:/etc/localtime:ro
  18.                         - /var/run/docker.sock:/var/run/docker.sock:ro
  19.                         - ./data/usersfile:/usersfile:ro
  20.                         - ./data/traefik.yml:/traefik.yml:ro
  21.                         - ./data/acme.json:/acme.json
  22.                         - /var/log:/var/log
  23.  
  24.                 labels:
  25.                        - "traefik.enable=true"
  26.                         - "traefik.http.routers.traefik.entrypoints=web"
  27.                         - "traefik.http.routers.traefik-secure.entrypoints=websecure"
  28.                         - "traefik.http.routers.traefik-secure.tls.certresolver=http"
  29.                           #Authelia forward auth
  30.                         - "traefik.http.middlewares.authelia.forwardauth.address=http://authelia:9091/api/verify?rd=https://example.com/#/"
  31.                         - "traefik.http.middlewares.authelia.forwardauth.trustforwardheader=true"
  32.                         - "traefik.http.middlewares.authelia.forwardauth.authresponseheaders=Remote-User, Remote-Groups"
  33.  
  34.                           #Use authelia to authenticate
  35.                         - "traefik.http.routers.traefik-secure.middlewares=authelia@docker"
  36.                           #- "traefik.http.routers.traefik.middlewares=authelia@docker"
  37.  
  38.                           #Dashboard disabled
  39.                         - "traefik.http.routers.traefik-secure.service=api@internal"
  40.                         - "traefik.http.routers.traefik-secure.rule=Host(`example.com`) && (PathPrefix(`/traefik/api`) || PathPrefix(`/traefik/dashboard`))"
  41.                         - "traefik.http.middlewares.traefik-stripprefix.stripprefix.prefixes=/traefik"
  42.                         - "traefik.http.middlewares.traefik-stripprefix.stripprefix.forceSlash=false"
  43.                         - "traefik.http.routers.traefik-secure.middlewares=authelia@docker,traefik-stripprefix"
  44.                           #
  45.                           #No longer needed configurations
  46.                           #- "traefik.http.middlewares.traefik-auth.basicauth.usersfile=usersfile"
  47.                           #- "traefik.http.routers.traefik-secure.tls=true" no longer needed, static config
  48.  
  49.  
  50. networks:
  51.         t2_proxy:
  52.                 external: true
  53.                
  54. #traefik config
  55.  
  56. api:
  57.         dashboard: true
  58.  
  59. entryPoints:
  60.         web:
  61.                 address: ":80"
  62.                 http:
  63.                         redirections:
  64.                                 entrypoint:
  65.                                         to: websecure
  66.                                         scheme: https
  67.         websecure:
  68.                 address: ":443"
  69.                 http:
  70.                         tls: {}
  71.  
  72. providers:
  73.         docker:
  74.                 endpoint: "unix:///var/run/docker.sock"
  75.                 exposedByDefault: false
  76.         file:
  77.                 directory: "rules/"
  78.  
  79. certificatesResolvers:
  80.         http:
  81.                 acme:
  82.                         email: [email protected]
  83.                         storage: acme.json
  84.                         httpChallenge:
  85.                                 entrypoint: web
  86.  
  87. log:
  88.         filePath: "/var/log/traefik.log"
  89.         level: WARN
  90. accessLog:
  91.         filePath: "var/log/access.log"
  92.         filters:
  93.                 statusCodes:
  94.                        - "400-499"
  95.                 retryAttempts: true
  96.  
  97.  
  98. #authelia docker-compose
  99. version: "2.4"
  100.  
  101. services:
  102.         authelia:
  103.                 image: authelia/authelia:4.21.0
  104.                 container_name: authelia
  105.                 environment:
  106.                        - TZ=America/Chicago
  107.                 volumes:
  108.                        - ./authelia:/config
  109.                         - ./authelia/secrets:/config/secrets:ro
  110.                 restart: unless-stopped
  111.                 networks:
  112.                        - t2_proxy
  113.                 environment:
  114.                        - AUTHELIA_JWT_SECRET_FILE=/config/secrets/jwt
  115.                         - AUTHELIA_SESSION_SECRET_FILE=/config/secrets/session
  116.                         - AUTHELIA_NOTIFIER_SMTP_PASSWORD_FILE=/config/secrets/email
  117.                 labels:
  118.                        - "traefik.enable=true"
  119.                         - "traefik.http.routers.authelia-https.rule=Host(`example.com`)"
  120.                         - "traefik.http.routers.authelia-https.entrypoints=websecure"
  121.                         - "traefik.http.routers.authelia-https.tls.certresolver=http"
  122.                         - "traefik.http.routers.authelia-https.service=authelia"
  123.                         - "traefik.http.services.authelia.loadbalancer.server.port=9091"
  124.  
  125.  
  126. networks:
  127.         t2_proxy:
  128.                 external: true
  129.                
  130. #authelia config
  131. host: 0.0.0.0
  132. port: 9091
  133. log_level: trace
  134. #jwt_secret:
  135. default_redirection_url: https://example.com/filebot/
  136.  
  137. ### TOTP Settings
  138. totp:
  139.         issuer: example.com
  140.         period: 30
  141.         skew: 1
  142.  
  143. authentication_backend:
  144.         disable_reset_password: false
  145.         file:
  146.                 path: /config/users_database.yml
  147.                 password:
  148.                         algorithm: argon2id
  149.                         iterations: 1
  150.                         key_length: 32
  151.                         salt_length: 16
  152.                         memory: 512
  153.                         parallelism: 8
  154.  
  155. access_control:
  156.         default_policy: deny
  157.         rules:
  158.                #                - domain:
  159.                 #       - example.com
  160.                 #       - "*.example.com"
  161.                 #  policy: bypass
  162.                 #  networks:
  163.                 #          - 192.168.0.0/16
  164.                 #          - 172.16.0.0/12
  165.                 #          - 10.0.0.0/8
  166.                 - domain:
  167.                        - example.com
  168.                         - "*.example.com"
  169.                   policy: two_factor
  170.                   #server:
  171.                   #        path: authelia
  172.  
  173. session:
  174.         name: authelia_session
  175.         #  secret:
  176.         expiration: 1h
  177.         inactivity: 5m
  178.         remember_me_duration: 1M
  179.         domain: example.com
  180. regulation:
  181.         max_retries: 3
  182.         find_time: 2m
  183.         ban_time: 1h
  184.  
  185. storage:
  186.         local:
  187.                 path: /config/db.sqlite3
  188. notifier:
  189.         disable_startup_check: false
  190.         smtp:
  191.                 username: [email protected]
  192.                 #password:  set in environment
  193.                 host: smtp.office365.com
  194.                 port: 587
  195.                 sender: [email protected]
  196.                 subject: "[Authelia] {Login Setup}"
  197.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement