-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
James Turland
committed
Sep 20, 2023
0 parents
commit 6e00e0a
Showing
77 changed files
with
6,752 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,49 @@ | ||
version: '3' | ||
|
||
services: | ||
authelia: | ||
image: authelia/authelia | ||
container_name: authelia | ||
volumes: | ||
- /home/ubuntu/docker/authelia/config:/config | ||
networks: | ||
- proxy | ||
security_opt: | ||
- no-new-privileges:true | ||
labels: | ||
- 'traefik.enable=true' | ||
- 'traefik.http.routers.authelia.rule=Host(`auth.jimsgarage.co.uk`)' | ||
- 'traefik.http.routers.authelia.entrypoints=https' | ||
- 'traefik.http.routers.authelia.tls=true' | ||
- 'traefik.http.middlewares.authelia.forwardAuth.address=http://authelia:9091/api/verify?rd=https://auth.jimsgarage.co.uk' | ||
- '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:9091/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' | ||
- 'traefik.http.services.authelia.loadbalancer.server.port=9091' | ||
ports: | ||
- 9091:9091 | ||
restart: unless-stopped | ||
environment: | ||
- TZ=Europe/London | ||
healthcheck: | ||
disable: true | ||
|
||
redis: | ||
image: redis:alpine | ||
container_name: redis | ||
volumes: | ||
- /home/ubuntu/docker/redis:/data | ||
networks: | ||
- proxy | ||
expose: | ||
- 6379 | ||
restart: unless-stopped | ||
environment: | ||
- TZ=Europe/London | ||
|
||
|
||
networks: | ||
proxy: | ||
external: true |
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,19 @@ | ||
--- | ||
############################################################### | ||
# Users Database # | ||
############################################################### | ||
|
||
# This file can be used if you do not have an LDAP set up. | ||
|
||
# List of users | ||
users: | ||
authelia: | ||
disabled: false | ||
displayname: "Authelia User" | ||
# Password is authelia | ||
password: "$6$rounds=50000$BpLnfgDsc2WD8F2q$Zis.ixdg9s/UOJYrs56b5QEZFiZECu0qZVNsIYxBaNJ7ucIL.nlxVCT5tqh8KHG8X4tlwCFm5r6NTOZZ5qRFN/" # yamllint disable-line rule:line-length | ||
email: [email protected] | ||
groups: | ||
- admins | ||
- dev | ||
... |
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,31 @@ | ||
version: "3.9" | ||
services: | ||
web: | ||
image: nginx | ||
container_name: nginx | ||
volumes: | ||
- /home/ubuntu/docker/nginx:/etc/nginx/templates | ||
environment: | ||
- NGINX_HOST=nginx.jimsgarage.co.uk | ||
- NGINX_PORT=80 | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.nginx.entrypoints=http" | ||
- "traefik.http.routers.nginx.rule=Host(`nginx.jimsgarage.co.uk`)" | ||
- "traefik.http.middlewares.nginx-https-redirect.redirectscheme.scheme=https" | ||
- "traefik.http.routers.nginx.middlewares=nginx-https-redirect" | ||
- "traefik.http.routers.nginx-secure.entrypoints=https" | ||
- "traefik.http.routers.nginx-secure.rule=Host(`nginx.jimsgarage.co.uk`)" | ||
- "traefik.http.routers.nginx-secure.tls=true" | ||
- "traefik.http.routers.nginx-secure.service=nginx" | ||
- "traefik.http.services.nginx.loadbalancer.server.port=80" | ||
- "traefik.http.routers.nginx-secure.middlewares=authelia@docker" | ||
- "traefik.docker.network=proxy" | ||
networks: | ||
proxy: | ||
security_opt: | ||
- no-new-privileges:true | ||
|
||
networks: | ||
proxy: | ||
external: true |
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,47 @@ | ||
version: '3.5' | ||
|
||
services: | ||
traefik: | ||
image: traefik:latest | ||
container_name: traefik | ||
restart: unless-stopped | ||
security_opt: | ||
- no-new-privileges:true | ||
networks: | ||
proxy: | ||
ports: | ||
- 80:80 | ||
- 443:443 | ||
environment: | ||
- [email protected] | ||
- CF_DNS_API_TOKEN=your-api-key | ||
# - CF_API_KEY=YOU_API_KEY | ||
volumes: | ||
- /etc/localtime:/etc/localtime:ro | ||
- /var/run/docker.sock:/var/run/docker.sock:ro | ||
- /home/ubuntu/docker/traefik/traefik.yml:/traefik.yml:ro | ||
- /home/ubuntu/docker/traefik/acme.json:/acme.json | ||
- /home/ubuntu/docker/traefik/config.yml:/config.yml:ro | ||
- /home/ubuntu/docker/traefik/logs:/var/log/traefik | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.traefik.entrypoints=http" | ||
- "traefik.http.routers.traefik.rule=Host(`traefik-dashboard.yourdomain.co.uk`)" | ||
- "traefik.http.middlewares.traefik-auth.basicauth.users=YOUR_USERNAME_PASSWORD" | ||
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https" | ||
- "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https" | ||
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect" | ||
- "traefik.http.routers.traefik-secure.entrypoints=https" | ||
- "traefik.http.routers.traefik-secure.rule=Host(`traefik-dashboard.yourdomain.co.uk`)" | ||
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth" | ||
- "traefik.http.routers.traefik-secure.tls=true" | ||
- "traefik.http.routers.traefik-secure.tls.certresolver=cloudflare" | ||
- "traefik.http.routers.traefik-secure.tls.domains[0].main=yourdomain.co.uk" | ||
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.yourdomain.co.uk" | ||
- "traefik.http.routers.traefik-secure.service=api@internal" | ||
- "traefik.http.routers.api.middlewares=authelia@docker | ||
networks: | ||
proxy: | ||
name: proxy |
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,17 @@ | ||
PG_PASS=password | ||
AUTHENTIK_SECRET_KEY=password" | ||
COMPOSE_PORT_HTTPS=1443 | ||
COMPOSE_PORT_HTTP=7000 | ||
# SMTP Host Emails are sent to | ||
AUTHENTIK_EMAIL__HOST=localhost | ||
AUTHENTIK_EMAIL__PORT=25 | ||
# Optionally authenticate (don't add quotation marks to your password) | ||
AUTHENTIK_EMAIL__USERNAME=[email protected] | ||
AUTHENTIK_EMAIL__PASSWORD=password | ||
# Use StartTLS | ||
AUTHENTIK_EMAIL__USE_TLS=false | ||
# Use SSL | ||
AUTHENTIK_EMAIL__USE_SSL=false | ||
AUTHENTIK_EMAIL__TIMEOUT=10 | ||
# Email address authentik will send from, should have a correct @domain | ||
AUTHENTIK_EMAIL__FROM=authentik@localhost |
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,109 @@ | ||
--- | ||
version: "3.4" | ||
|
||
services: | ||
postgresql: | ||
image: docker.io/library/postgres:12-alpine | ||
restart: unless-stopped | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"] | ||
start_period: 20s | ||
interval: 30s | ||
retries: 5 | ||
timeout: 5s | ||
volumes: | ||
- database:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_PASSWORD: ${PG_PASS:?database password required} | ||
POSTGRES_USER: ${PG_USER:-authentik} | ||
POSTGRES_DB: ${PG_DB:-authentik} | ||
env_file: | ||
- .env | ||
networks: | ||
proxy: | ||
redis: | ||
image: docker.io/library/redis:alpine | ||
command: --save 60 1 --loglevel warning | ||
restart: unless-stopped | ||
healthcheck: | ||
test: ["CMD-SHELL", "redis-cli ping | grep PONG"] | ||
start_period: 20s | ||
interval: 30s | ||
retries: 5 | ||
timeout: 3s | ||
volumes: | ||
- redis:/data | ||
networks: | ||
proxy: | ||
server: | ||
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2023.8.3} | ||
container_name: authentik_server | ||
restart: unless-stopped | ||
command: server | ||
environment: | ||
AUTHENTIK_REDIS__HOST: redis | ||
AUTHENTIK_POSTGRESQL__HOST: postgresql | ||
AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik} | ||
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik} | ||
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS} | ||
volumes: | ||
- ./media:/media | ||
- ./custom-templates:/templates | ||
env_file: | ||
- .env | ||
depends_on: | ||
- postgresql | ||
- redis | ||
networks: | ||
proxy: | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.authentik.entrypoints=http" | ||
- "traefik.http.routers.authentik.rule=Host(`authentik.yourdomain.com`)" | ||
- "traefik.http.middlewares.authentik-https-redirect.redirectscheme.scheme=https" | ||
- "traefik.http.routers.authentik.middlewares=authentik-https-redirect" | ||
- "traefik.http.routers.authentik-secure.entrypoints=https" | ||
- "traefik.http.routers.authentik-secure.rule=Host(`authentik.yourdomain.com`)" | ||
- "traefik.http.routers.authentik-secure.tls=true" | ||
- "traefik.http.routers.authentik-secure.service=authentik" | ||
- "traefik.http.services.authentik.loadbalancer.server.port=9000" | ||
- "traefik.docker.network=proxy" | ||
worker: | ||
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2023.8.3} | ||
restart: unless-stopped | ||
command: worker | ||
environment: | ||
AUTHENTIK_REDIS__HOST: redis | ||
AUTHENTIK_POSTGRESQL__HOST: postgresql | ||
AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik} | ||
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik} | ||
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS} | ||
# `user: root` and the docker socket volume are optional. | ||
# See more for the docker socket integration here: | ||
# https://goauthentik.io/docs/outposts/integrations/docker | ||
# Removing `user: root` also prevents the worker from fixing the permissions | ||
# on the mounted folders, so when removing this make sure the folders have the correct UID/GID | ||
# (1000:1000 by default) | ||
user: root | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- ./media:/media | ||
- ./certs:/certs | ||
- ./custom-templates:/templates | ||
env_file: | ||
- .env | ||
depends_on: | ||
- postgresql | ||
- redis | ||
networks: | ||
proxy: | ||
|
||
volumes: | ||
database: | ||
driver: local | ||
redis: | ||
driver: local | ||
|
||
networks: | ||
proxy: | ||
external: true |
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,32 @@ | ||
version: "3.9" | ||
services: | ||
web: | ||
image: nginx | ||
container_name: jimsgarage | ||
volumes: | ||
- /home/ubuntu/docker/nginx/templates:/etc/nginx/templates | ||
- /home/ubuntu/docker/nginx/web:/usr/share/nginx/html | ||
environment: | ||
- NGINX_HOST=nginx.jimsgarage.co.uk | ||
- NGINX_PORT=80 | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.nginx.entrypoints=http" | ||
- "traefik.http.routers.nginx.rule=Host(`nginx.jimsgarage.co.uk`)" | ||
- "traefik.http.middlewares.nginx-https-redirect.redirectscheme.scheme=https" | ||
- "traefik.http.routers.nginx.middlewares=nginx-https-redirect" | ||
- "traefik.http.routers.nginx-secure.entrypoints=https" | ||
- "traefik.http.routers.nginx-secure.rule=Host(`nginx.jimsgarage.co.uk`)" | ||
- "traefik.http.routers.nginx-secure.tls=true" | ||
- "traefik.http.routers.nginx-secure.service=nginx" | ||
- "traefik.http.services.nginx.loadbalancer.server.port=80" | ||
- "traefik.http.routers.nginx-secure.middlewares=middlewares-authentik@file" #add this to any container you want to use the Authentik web proxy | ||
- "traefik.docker.network=proxy" | ||
networks: | ||
proxy: | ||
security_opt: | ||
- no-new-privileges:true | ||
|
||
networks: | ||
proxy: | ||
external: true |
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,23 @@ | ||
http: | ||
middlewares: | ||
crowdsec-bouncer: | ||
forwardauth: | ||
address: http://bouncer-traefik:8080/api/v1/forwardAuth | ||
trustForwardHeader: true | ||
# https://github.com/goauthentik/authentik/issues/2366 | ||
middlewares-authentik: | ||
forwardAuth: | ||
address: "http://authentik_server:9000/outpost.goauthentik.io/auth/traefik" | ||
trustForwardHeader: true | ||
authResponseHeaders: | ||
- X-authentik-username | ||
- X-authentik-groups | ||
- X-authentik-email | ||
- X-authentik-name | ||
- X-authentik-uid | ||
- X-authentik-jwt | ||
- X-authentik-meta-jwks | ||
- X-authentik-meta-outpost | ||
- X-authentik-meta-provider | ||
- X-authentik-meta-app | ||
- X-authentik-meta-version |
Oops, something went wrong.