Fusion with Authentik

This commit is contained in:
Hubert Cornet 2024-03-31 20:00:07 +02:00
parent 8c3533bd40
commit 181292bffd
5 changed files with 154 additions and 0 deletions

3
Authentik/.env Normal file
View File

@ -0,0 +1,3 @@
PG_PASS=UaXg4bygCAIBx3aIegkYk22LE5bOBWLpAuv60eGk
AUTHENTIK_SECRET_KEY=ThB3GtCJgHxkoFhyorQ4s5jMznqM13nebhHadJvbp5F2E11wA0
AUTHENTIK_ERROR_REPORTING__ENABLED=true

3
Authentik/LICENSE Normal file
View File

@ -0,0 +1,3 @@
Additional permission under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or combining it with [name of library] (or a modified version of that library), containing parts covered by the terms of [name of library's license], the licensors of this Program grant you additional permission to convey the resulting work. Corresponding Source for a non-source form of such a combination shall include the source code for the parts of [name of library] used as well as that of the covered work.

3
Authentik/README.md Normal file
View File

@ -0,0 +1,3 @@
# Template
dépôt Template

View File

@ -0,0 +1,134 @@
---
version: "3.7"
#### networks
networks:
docker-traefik_front_network:
external: true
back_network:
driver: bridge
attachable: true
#### services
services:
postgresql:
container_name: authentik-postgres
hostname: authentik-postgres
image: docker.io/library/postgres:15.6-alpine
restart: unless-stopped
networks:
- back_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
start_period: 20s
interval: 30s
retries: 5
timeout: 5s
volumes:
- ./data:/var/lib/postgresql/data
environment:
PGDATA: /var/lib/postgresql/data/authentik
POSTGRES_PASSWORD: 'P@ssword!Here!123456'
POSTGRES_USER: authentik_user
POSTGRES_DB: authentik_db
env_file:
- .env
redis:
container_name: authentik-redis
hostname: authentik-redis
image: docker.io/library/redis:alpine
command: --save 60 1 --loglevel warning
restart: unless-stopped
networks:
- back_network
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
start_period: 20s
interval: 30s
retries: 5
timeout: 3s
volumes:
- ./redis:/data
server:
container_name: authentik-server
hostname: authentik-server
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2024.2.2}
restart: unless-stopped
networks:
- docker-traefik_front_network
- back_network
command: server
environment:
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__USER: authentik_user
AUTHENTIK_POSTGRESQL__NAME: authentik_db
AUTHENTIK_POSTGRESQL__PASSWORD: 'P@ssword!Here!123456'
volumes:
- ./media:/media
- ./custom-templates:/templates
env_file:
- .env
# ports:
# - "${COMPOSE_PORT_HTTP:-7000}:9000"
# - "${COMPOSE_PORT_HTTPS:-7443}:9443"
depends_on:
- postgresql
- redis
labels:
- "traefik.enable=true"
- "traefik.docker.network=interne"
# HTTP
- "traefik.http.routers.authentik-http.rule=Host(`authentik.10.0.4.29.traefik.me`)"
- "traefik.http.routers.authentik-http.entrypoints=http"
# HTTPS
- "traefik.http.routers.authentik-https.rule=Host(`authentik.10.0.4.29.traefik.me`)"
- "traefik.http.routers.authentik-https.entrypoints=https"
- "traefik.http.routers.authentik-https.service=authentik-service"
# - "traefik.http.routers.authentik-https.middlewares=authentik-addprefix"
- "traefik.http.routers.authentik-https.tls=true"
# Middleware
# - "traefik.http.middlewares.authentik-addprefix.addprefix.prefix=/if/admin"
# Service
- "traefik.http.services.authentik-service.loadbalancer.server.port=9000"
worker:
container_name: authentik-worker
hostname: authentik-worker
image: ${AUTHENTIK_IMAGE:-ghcr.io/goauthentik/server}:${AUTHENTIK_TAG:-2024.2.2}
restart: unless-stopped
networks:
- docker-traefik_front_network
- back_network
command: worker
environment:
AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__USER: authentik_user
AUTHENTIK_POSTGRESQL__NAME: authentik_db
AUTHENTIK_POSTGRESQL__PASSWORD: 'P@ssword!Here!123456'
# `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
#volumes:
# database:
# driver: local
# redis:
# driver: local

11
Authentik/prepare.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
if ! (docker ps >/dev/null 2>&1)
then
echo "Le daemon docker n'est pas en cours d'exécution, sortie !"
exit
fi
echo "Préparation"
mkdir -p ./redis >/dev/null 2>&1
mkdir -p ./data >/dev/null 2>&1