diff --git a/README.md b/README.md index 18fc9f7..f4e168f 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ docker compose up ### Identity Providers / Single Sign On (SSO) / 2FA - [Authelia](examples/authelia) - Authelia is an open-source authentication and authorization server providing two-factor authentication and single sign-on (SSO) for your applications via a web portal. It acts as a companion for reverse proxies by allowing, denying, or redirecting requests. Recommended to combine with [Traefik](examples/traefik). - [lldap](examples/lldap) - lldap is a lightweight authentication server that provides an opinionated, simplified LDAP interface for authentication. It integrates with many backends, from KeyCloak to Authelia to Nextcloud and more. -- ~~[Authentik](https://goauthentik.io/docs/providers/proxy/forward_auth#traefik)~~ - authentik is an open-source Identity Provider focused on flexibility and versatility. You can use authentik in an existing environment to add support for new protocols. authentik is also a great solution for implementing signup/recovery/etc in your application, so you don't have to deal with it. +- [Authentik](examples/authentik) - Authentik is an open-source Identity Provider focused on flexibility and versatility. - ~~[Keycloak](https://github.com/keycloak/keycloak)~~ - Keycloak is an open-source Identity and Access Management (IAM) solution for modern applications and services. ### Virtual Private Network (VPN) diff --git a/examples/authentik/README.md b/examples/authentik/README.md new file mode 100644 index 0000000..593901e --- /dev/null +++ b/examples/authentik/README.md @@ -0,0 +1,3 @@ +# References + +- https://goauthentik.io/docs/installation/ diff --git a/examples/authentik/docker-compose.yml b/examples/authentik/docker-compose.yml new file mode 100644 index 0000000..fbdbb3d --- /dev/null +++ b/examples/authentik/docker-compose.yml @@ -0,0 +1,97 @@ +version: "3.4" + +services: + + postgresql: + image: docker.io/library/postgres:12-alpine + container_name: authentik-psql + 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: + - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/psql:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: ${PG_PASS:-authentik} + POSTGRES_USER: ${PG_USER:-authentik} + POSTGRES_DB: ${PG_DB:-authentik} + networks: + - authentik-internal + + redis: + image: docker.io/library/redis:alpine + container_name: authentik-redis + 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: + - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/redis:/data + networks: + - authentik-internal + + authentik-proxy: + image: ghcr.io/goauthentik/server:latest + container_name: authentik + 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:-authentik} + AUTHENTIK_SECRET_KEY: urgent-briskness-dispense-happy-charity + volumes: + - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/media:/media + - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/custom-templates:/templates + expose: + - 9000 + - 9443 + depends_on: + - postgresql + - redis + networks: + - proxy + - authentik-internal + labels: + - traefik.enable=true + - traefik.http.routers.authentik.rule=Host(`authentik.example.com`) || HostRegexp(`{subdomain:[A-Za-z0-9](?:[A-Za-z0-9\-]{0,61}[A-Za-z0-9])?}.example.com`) && PathPrefix(`/outpost.goauthentik.io/`) + - traefik.http.services.authentik.loadbalancer.server.port=9000 + - traefik.docker.network=proxy + - traefik.http.middlewares.authentik.forwardauth.address=http://authentik-proxy:9000/outpost.goauthentik.io/auth/traefik + - traefik.http.middlewares.authentik.forwardauth.trustForwardHeader=true + - traefik.http.middlewares.authentik.forwardauth.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 + + worker: + image: ghcr.io/goauthentik/server:latest + container_name: authentik-worker + restart: unless-stopped + command: worker + user: root + 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:-authentik} + AUTHENTIK_SECRET_KEY: urgent-briskness-dispense-happy-charity + volumes: + - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/certs:/certs + - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/media:/media + - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/authentik/custom-templates:/templates + networks: + - authentik-internal + +networks: + proxy: + external: true + authentik-internal: + external: true