forked from coop-cloud/authentik
Compare commits
31 Commits
1.1.1+2022
...
3.0.0+2023
Author | SHA1 | Date | |
---|---|---|---|
4ce032cac2 | |||
8b8fddf1e4 | |||
deb953a94f | |||
d738d95909 | |||
055299c56b | |||
7127566e04 | |||
5f3dce967f | |||
c0e6f6be3c | |||
12b28932b2 | |||
783392bc36 | |||
41396da668 | |||
2d732e243b | |||
2f231fb22e | |||
c9f0db95dd | |||
be0d41d9cd | |||
0548a00902 | |||
312d8f786d | |||
b10fe24031 | |||
390043cf71 | |||
0c54677f57 | |||
34cf7e3f65 | |||
bf6d25d9f7 | |||
99a90147ac | |||
26d02d51dd | |||
4bab09a1cf | |||
b7df357395 | |||
9273fbcb1a | |||
a01559d61a | |||
40afba88ae | |||
3512cbe394 | |||
1dc2ba18d4 |
45
.drone.yml
Normal file
45
.drone.yml
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: deploy to swarm-test.autonomic.zone
|
||||||
|
steps:
|
||||||
|
- name: deployment
|
||||||
|
image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest
|
||||||
|
settings:
|
||||||
|
host: swarm-test.autonomic.zone
|
||||||
|
stack: authentik
|
||||||
|
generate_secrets: true
|
||||||
|
purge: true
|
||||||
|
deploy_key:
|
||||||
|
from_secret: drone_ssh_swarm_test
|
||||||
|
networks:
|
||||||
|
- proxy
|
||||||
|
environment:
|
||||||
|
DOMAIN: authentik.swarm-test.autonomic.zone
|
||||||
|
STACK_NAME: authentik
|
||||||
|
LETS_ENCRYPT_ENV: production
|
||||||
|
CUSTOM_CSS_VERSION: v1
|
||||||
|
CUSTOM_FLOWS_VERSION: v1
|
||||||
|
SECRET_SECRET_KEY_VERSION: v1
|
||||||
|
SECRET_DB_PASSWORD_VERSION: v1
|
||||||
|
SECRET_ADMIN_TOKEN_VERSION: v1
|
||||||
|
SECRET_ADMIN_PASS_VERSION: v1
|
||||||
|
SECRET_EMAIL_PASS_VERSION: v1
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: generate recipe catalogue
|
||||||
|
steps:
|
||||||
|
- name: release a new version
|
||||||
|
image: plugins/downstream
|
||||||
|
settings:
|
||||||
|
server: https://build.coopcloud.tech
|
||||||
|
token:
|
||||||
|
from_secret: drone_abra-bot_token
|
||||||
|
fork: true
|
||||||
|
repositories:
|
||||||
|
- coop-cloud/auto-recipes-catalogue-json
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event: tag
|
36
.env.sample
36
.env.sample
@ -2,24 +2,23 @@ TYPE=authentik
|
|||||||
LETS_ENCRYPT_ENV=production
|
LETS_ENCRYPT_ENV=production
|
||||||
|
|
||||||
DOMAIN=authentik.example.com
|
DOMAIN=authentik.example.com
|
||||||
AUTHENTIK_POSTGRESQL__USER=authentik
|
COMPOSE_FILE="compose.yml"
|
||||||
AUTHENTIK_POSTGRESQL__NAME=authentik
|
|
||||||
AUTHENTIK_POSTGRESQL__HOST=db
|
|
||||||
AUTHENTIK_REDIS__HOST=redis
|
|
||||||
AUTHENTIK_ERROR_REPORTING__ENABLED=true
|
AUTHENTIK_ERROR_REPORTING__ENABLED=true
|
||||||
|
AUTHENTIK_LOG_LEVEL=info
|
||||||
|
# AUTHENTIK_IMPERSONATION=true
|
||||||
|
# AUTHENTIK_FOOTER_LINKS='[{"name": "My Organization","href":"https://example.com"}]'
|
||||||
# WORKERS=1
|
# WORKERS=1
|
||||||
|
|
||||||
# EMAIL
|
## EMAIL
|
||||||
AUTHENTIK_EMAIL__HOST=smtp
|
AUTHENTIK_EMAIL__HOST=smtp
|
||||||
AUTHENTIK_EMAIL__PORT=25
|
AUTHENTIK_EMAIL__PORT=587
|
||||||
# AUTHENTIK_EMAIL__USERNAME=""
|
AUTHENTIK_EMAIL__USERNAME="noreply@example.com"
|
||||||
AUTHENTIK_EMAIL__USE_TLS=false
|
AUTHENTIK_EMAIL__USE_TLS=true
|
||||||
AUTHENTIK_EMAIL__USE_SSL=false
|
AUTHENTIK_EMAIL__USE_SSL=false
|
||||||
AUTHENTIK_EMAIL__TIMEOUT=10
|
AUTHENTIK_EMAIL__TIMEOUT=10
|
||||||
AUTHENTIK_EMAIL__FROM=noreply@example.com
|
AUTHENTIK_EMAIL__FROM=noreply@example.com
|
||||||
AUTHENTIK_LOG_LEVEL=info
|
|
||||||
|
|
||||||
# Secret Versions
|
## Secret Versions
|
||||||
SECRET_SECRET_KEY_VERSION=v1
|
SECRET_SECRET_KEY_VERSION=v1
|
||||||
SECRET_DB_PASSWORD_VERSION=v1
|
SECRET_DB_PASSWORD_VERSION=v1
|
||||||
SECRET_ADMIN_TOKEN_VERSION=v1
|
SECRET_ADMIN_TOKEN_VERSION=v1
|
||||||
@ -30,6 +29,17 @@ SECRET_EMAIL_PASS_VERSION=v1
|
|||||||
AUTHENTIK_COLOR_BACKGROUND_LIGHT=#1c1e21
|
AUTHENTIK_COLOR_BACKGROUND_LIGHT=#1c1e21
|
||||||
|
|
||||||
## FLOW OPTIONS
|
## FLOW OPTIONS
|
||||||
WELCOME_MESSAGE="Welcome to Authentik"
|
# WELCOME_MESSAGE="Welcome to Authentik"
|
||||||
DEFAULT_LANGUAGE=en
|
# DEFAULT_LANGUAGE=en
|
||||||
AUTHENTIK_FOOTER_LINKS='[{"name": "My Organization","href":"https://example.com"}]'
|
# LOGOUT_REDIRECT="https://$DOMAIN"
|
||||||
|
# EMAIL_SUBJECT="Account Recovery"
|
||||||
|
# EMAIL_TOKEN_EXPIRY_MINUTES=30
|
||||||
|
|
||||||
|
COPY_ASSETS="flow_background.jpg|app:/web/dist/assets/images/"
|
||||||
|
COPY_ASSETS="$COPY_ASSETS icon_left_brand.svg|app:/web/dist/assets/icons/"
|
||||||
|
COPY_ASSETS="$COPY_ASSETS icon.png|app:/web/dist/assets/icons/"
|
||||||
|
|
||||||
|
# COMPOSE_FILE="$COMPOSE_FILE:compose.nextcloud.yml"
|
||||||
|
# NEXTCLOUD_DOMAIN=nextcloud.example.com
|
||||||
|
# SECRET_NEXTCLOUD_ID_VERSION=v1
|
||||||
|
# SECRET_NEXTCLOUD_SECRET_VERSION=v1
|
||||||
|
68
README.md
68
README.md
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
* **Category**: Apps
|
* **Category**: Apps
|
||||||
* **Status**: 0, work-in-progress
|
* **Status**: 0, work-in-progress
|
||||||
* **Image**: [ghcr/goauthentik/server](https://ghcr.io/goauthentik/server)
|
* **Image**: [ghcr/goauthentik/server](https://ghcr.io/goauthentik/server), 4, upstream
|
||||||
* **Healthcheck**: Yes
|
* **Healthcheck**: Yes
|
||||||
* **Backups**: Yes
|
* **Backups**: Yes
|
||||||
* **Email**: Yes
|
* **Email**: Yes
|
||||||
@ -20,15 +20,18 @@
|
|||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|
||||||
* `abra app new authentik --secrets`
|
* `abra app new authentik`
|
||||||
* `abra app config <app-name>`
|
* `abra app config <app-name>`
|
||||||
* `abra app secret insert <app_name> email_pass v1 <password>`
|
* `abra app secret insert <app_name> email_pass v1 <password>`
|
||||||
* `abra app secret generate -a <app_name>
|
* `abra app secret generate -a <app_name>`
|
||||||
* `abra app deploy <app-name>`
|
* `abra app deploy <app-name>`
|
||||||
* `abra app cmd <app_name> app set_admin_pass`
|
* `abra app cmd <app_name> app set_admin_pass`
|
||||||
|
* `abra app cmd <app_name> worker apply_blueprints`
|
||||||
|
|
||||||
## Rotate Secrets
|
## Rotate Secrets
|
||||||
|
|
||||||
|
Increment the secret versions using `abra app config <app_name>`
|
||||||
|
|
||||||
```
|
```
|
||||||
abra app secret generate -a <app_name>
|
abra app secret generate -a <app_name>
|
||||||
abra app undeploy <app_name>
|
abra app undeploy <app_name>
|
||||||
@ -39,14 +42,65 @@ abra app cmd <app_name> app set_admin_pass
|
|||||||
|
|
||||||
## Customization
|
## Customization
|
||||||
|
|
||||||
|
Place the files you want to overwrite in a directory `<assets_path>`.
|
||||||
|
Run `abra app config <app_name>` and define the env variable `COPY_ASSETS` in the following format:
|
||||||
|
|
||||||
|
```
|
||||||
|
"<source_file1>|<service>:<target_directory1> <source_file2>|<service>:<target_directory2> ...
|
||||||
|
```
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```
|
||||||
|
COPY_ASSETS="flow_background.jpg|app:/web/dist/assets/images/"
|
||||||
|
COPY_ASSETS="$COPY_ASSETS icon_left_brand.svg|app:/web/dist/assets/icons/
|
||||||
|
COPY_ASSETS="$COPY_ASSETS icon.png|app:/web/dist/assets/icons/"
|
||||||
|
```
|
||||||
|
|
||||||
Run this command after every deploy/upgrade:
|
Run this command after every deploy/upgrade:
|
||||||
|
|
||||||
`abra app command --local <app-name> customize <assets_path>`
|
`abra app command --local <app-name> customize <assets_path>`
|
||||||
|
|
||||||
This command replaces the background image, the logo and the favicon with the following files placed in the `<assets_path>` directory:
|
## Blueprints
|
||||||
* `flow_background.jpg`
|
|
||||||
* `icon_left_brand.svg`
|
Blueprint Dependency Requirements:
|
||||||
* `icon.png`
|
|
||||||
|
- Recovery with email verification
|
||||||
|
- Default - Password change flow
|
||||||
|
- Default - Authentication flow
|
||||||
|
- Custom Authentication Flow
|
||||||
|
- Default - Authentication flow
|
||||||
|
- Recovery with email verification
|
||||||
|
- Invitation Enrollment Flow
|
||||||
|
- Default - User settings flow
|
||||||
|
- Default - Authentication flow
|
||||||
|
- Default - Source enrollment flow
|
||||||
|
- Custom Invalidation Flow
|
||||||
|
- Default - Invalidation flow
|
||||||
|
- Flow Translations
|
||||||
|
- Recovery with email verification
|
||||||
|
- Default - Password change flow
|
||||||
|
- Default - User settings flow
|
||||||
|
- Default - Source enrollment flow
|
||||||
|
- Custom System Tenant
|
||||||
|
- Default - Tenant
|
||||||
|
- Recovery with email verification
|
||||||
|
|
||||||
|
|
||||||
|
Blueprint Dependency Graph:
|
||||||
|
|
||||||
|
5. Custom System Tenant
|
||||||
|
- Default - Tenant
|
||||||
|
4. Invitation Enrollment Flow
|
||||||
|
3. Flow Translations
|
||||||
|
- Default - User settings flow
|
||||||
|
- Default - Source enrollment flow
|
||||||
|
2. Custom Authentication Flow
|
||||||
|
1. Recovery with email verification
|
||||||
|
- Default - Authentication flow
|
||||||
|
- Default - Password change flow
|
||||||
|
6. Custom Invalidation Flow
|
||||||
|
- Default - Invalidation flow
|
||||||
|
|
||||||
|
|
||||||
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).
|
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).
|
||||||
|
85
abra.sh
85
abra.sh
@ -1,5 +1,11 @@
|
|||||||
export CUSTOM_CSS_VERSION=v2
|
export CUSTOM_CSS_VERSION=v2
|
||||||
export CUSTOM_FLOWS_VERSION=v2
|
export FLOW_AUTHENTICATION_VERSION=v1
|
||||||
|
export FLOW_INVITATION_VERSION=v1
|
||||||
|
export FLOW_INVALIDATION_VERSION=v1
|
||||||
|
export FLOW_RECOVERY_VERSION=v1
|
||||||
|
export FLOW_TRANSLATION_VERSION=v1
|
||||||
|
export SYSTEM_TENANT_VERSION=v1
|
||||||
|
export NEXTCLOUD_CONFIG_VERSION=v1
|
||||||
|
|
||||||
customize() {
|
customize() {
|
||||||
if [ -z "$1" ]
|
if [ -z "$1" ]
|
||||||
@ -7,22 +13,13 @@ customize() {
|
|||||||
echo "Usage: ... customize <assets_path>"
|
echo "Usage: ... customize <assets_path>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# TODO: use env to specify source and target files
|
asset_dir=$1
|
||||||
if [ -e $1/flow_background.jpg ]
|
for asset in $COPY_ASSETS; do
|
||||||
then
|
source=$(echo $asset | cut -d "|" -f1)
|
||||||
echo copy flow_background.jpg
|
target=$(echo $asset | cut -d "|" -f2)
|
||||||
abra app cp $APP_NAME $1/flow_background.jpg app:/web/dist/assets/images/
|
echo copy $source to $target
|
||||||
fi
|
abra app cp $APP_NAME $asset_dir/$source $target
|
||||||
if [ -e $1/icon_left_brand.svg ]
|
done
|
||||||
then
|
|
||||||
echo copy icon_left_brand.svg
|
|
||||||
abra app cp $APP_NAME $1/icon_left_brand.svg app:/web/dist/assets/icons/
|
|
||||||
fi
|
|
||||||
if [ -e $1/icon.png ]
|
|
||||||
then
|
|
||||||
echo copy icon.png
|
|
||||||
abra app cp $APP_NAME $1/icon.png app:/web/dist/assets/icons/
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set_admin_pass() {
|
set_admin_pass() {
|
||||||
@ -56,3 +53,57 @@ rotate_db_pass() {
|
|||||||
db_password=$(cat /run/secrets/db_password)
|
db_password=$(cat /run/secrets/db_password)
|
||||||
psql -U authentik -c """ALTER USER authentik WITH PASSWORD '$db_password';"""
|
psql -U authentik -c """ALTER USER authentik WITH PASSWORD '$db_password';"""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply_blueprints() {
|
||||||
|
enable_blueprint default/flow-default-authentication-flow.yaml
|
||||||
|
enable_blueprint default/flow-default-user-settings-flow.yaml
|
||||||
|
enable_blueprint default/flow-password-change.yaml
|
||||||
|
ak apply_blueprint 6_flow_invalidation.yaml
|
||||||
|
ak apply_blueprint 5_system_tenant.yaml
|
||||||
|
disable_blueprint default/flow-default-authentication-flow.yaml
|
||||||
|
disable_blueprint default/flow-default-user-settings-flow.yaml
|
||||||
|
disable_blueprint default/flow-password-change.yaml
|
||||||
|
}
|
||||||
|
|
||||||
|
disable_blueprint() {
|
||||||
|
blueprint_state False $@
|
||||||
|
}
|
||||||
|
|
||||||
|
enable_blueprint() {
|
||||||
|
blueprint_state True $@
|
||||||
|
}
|
||||||
|
|
||||||
|
blueprint_state() {
|
||||||
|
TOKEN=$(cat /run/secrets/admin_token)
|
||||||
|
python -c """
|
||||||
|
import requests
|
||||||
|
session = requests.Session()
|
||||||
|
my_token='$TOKEN'
|
||||||
|
blueprint_state=$1
|
||||||
|
blueprint_path='$2'
|
||||||
|
resp = session.get(f'https://$DOMAIN/api/v3/managed/blueprints/?path={blueprint_path}', headers={'Authorization':f'Bearer {my_token}'})
|
||||||
|
if not resp.ok:
|
||||||
|
print(f'Error fetching blueprint: {resp.content}')
|
||||||
|
exit()
|
||||||
|
auth_flow_uuid = resp.json()['results'][0]['pk']
|
||||||
|
blueprint_name = resp.json()['results'][0]['name']
|
||||||
|
params = {'name': blueprint_name,'path': blueprint_path,'context':{},'enabled': blueprint_state}
|
||||||
|
resp = session.put(f'https://$DOMAIN/api/v3/managed/blueprints/{auth_flow_uuid}/', json=params, headers={'Authorization':f'Bearer {my_token}'})
|
||||||
|
if resp.ok:
|
||||||
|
print(f'{blueprint_name} enabled: {blueprint_state}')
|
||||||
|
else:
|
||||||
|
print(f'Error changing blueprint state: {resp.content}')
|
||||||
|
"""
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
blueprint_cleanup() {
|
||||||
|
/manage.py shell -c """
|
||||||
|
delete_flows = ['default-recovery-flow' , 'custom-authentication-flow' , 'invitation-enrollment-flow' , 'initial-setup']
|
||||||
|
Flow.objects.filter(slug__in=delete_flows).delete()
|
||||||
|
Stage.objects.filter(flow=None).delete()
|
||||||
|
Prompt.objects.filter(promptstage=None).delete()
|
||||||
|
Tenant.objects.filter(default=True).delete()
|
||||||
|
"""
|
||||||
|
apply_blueprints
|
||||||
|
}
|
||||||
|
26
compose.nextcloud.yml
Normal file
26
compose.nextcloud.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
version: "3.8"
|
||||||
|
services:
|
||||||
|
worker:
|
||||||
|
secrets:
|
||||||
|
- nextcloud_id
|
||||||
|
- nextcloud_secret
|
||||||
|
environment:
|
||||||
|
- NEXTCLOUD_DOMAIN
|
||||||
|
configs:
|
||||||
|
- source: nextcloud
|
||||||
|
target: /blueprints/nextcloud.yaml
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
nextcloud_id:
|
||||||
|
external: true
|
||||||
|
name: ${STACK_NAME}_nextcloud_id_${SECRET_NEXTCLOUD_ID_VERSION}
|
||||||
|
nextcloud_secret:
|
||||||
|
external: true
|
||||||
|
name: ${STACK_NAME}_nextcloud_secret_${SECRET_NEXTCLOUD_SECRET_VERSION}
|
||||||
|
|
||||||
|
|
||||||
|
configs:
|
||||||
|
nextcloud:
|
||||||
|
name: ${STACK_NAME}_nextcloud_${NEXTCLOUD_CONFIG_VERSION}
|
||||||
|
file: nextcloud.yaml.tmpl
|
||||||
|
template_driver: golang
|
70
compose.yml
70
compose.yml
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
x-env: &env
|
x-env: &env
|
||||||
- AUTHENTIK_POSTGRESQL__PASSWORD=file:///run/secrets/db_password
|
- AUTHENTIK_POSTGRESQL__PASSWORD=file:///run/secrets/db_password
|
||||||
- AUTHENTIK_POSTGRESQL__USER
|
- AUTHENTIK_POSTGRESQL__USER=authentik
|
||||||
- AUTHENTIK_POSTGRESQL__NAME
|
- AUTHENTIK_POSTGRESQL__NAME=authentik
|
||||||
- AUTHENTIK_POSTGRESQL__HOST
|
- AUTHENTIK_POSTGRESQL__HOST=db
|
||||||
- AUTHENTIK_REDIS__HOST
|
- AUTHENTIK_REDIS__HOST=redis
|
||||||
- AUTHENTIK_ERROR_REPORTING__ENABLED
|
- AUTHENTIK_ERROR_REPORTING__ENABLED
|
||||||
- AUTHENTIK_SECRET_KEY=file:///run/secrets/secret_key
|
- AUTHENTIK_SECRET_KEY=file:///run/secrets/secret_key
|
||||||
- AUTHENTIK_EMAIL__HOST
|
- AUTHENTIK_EMAIL__HOST
|
||||||
@ -20,14 +20,18 @@ x-env: &env
|
|||||||
- AUTHENTIK_SETTINGS__THEME__BACKGROUND
|
- AUTHENTIK_SETTINGS__THEME__BACKGROUND
|
||||||
- AUTHENTIK_COLOR_BACKGROUND_LIGHT
|
- AUTHENTIK_COLOR_BACKGROUND_LIGHT
|
||||||
- AUTHENTIK_FOOTER_LINKS
|
- AUTHENTIK_FOOTER_LINKS
|
||||||
|
- AUTHENTIK_IMPERSONATION
|
||||||
- WELCOME_MESSAGE
|
- WELCOME_MESSAGE
|
||||||
- DEFAULT_LANGUAGE
|
- DEFAULT_LANGUAGE
|
||||||
|
- EMAIL_SUBJECT
|
||||||
|
- EMAIL_TOKEN_EXPIRY_MINUTES
|
||||||
- DOMAIN
|
- DOMAIN
|
||||||
|
- LOGOUT_REDIRECT
|
||||||
|
|
||||||
version: '3.8'
|
version: '3.8'
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: ghcr.io/goauthentik/server:2022.11.1
|
image: ghcr.io/goauthentik/server:2023.2.3
|
||||||
command: server
|
command: server
|
||||||
secrets:
|
secrets:
|
||||||
- db_password
|
- db_password
|
||||||
@ -67,10 +71,10 @@ services:
|
|||||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
||||||
- "traefik.http.middlewares.${STACK_NAME}-frameOptions.headers.customFrameOptionsValue=SAMEORIGIN"
|
- "traefik.http.middlewares.${STACK_NAME}-frameOptions.headers.customFrameOptionsValue=SAMEORIGIN"
|
||||||
- "traefik.http.middlewares.${STACK_NAME}-frameOptions.headers.contentSecurityPolicy=frame-ancestors ${X_FRAME_OPTIONS_ALLOW_FROM}"
|
- "traefik.http.middlewares.${STACK_NAME}-frameOptions.headers.contentSecurityPolicy=frame-ancestors ${X_FRAME_OPTIONS_ALLOW_FROM}"
|
||||||
- "coop-cloud.${STACK_NAME}.version=1.1.1+2022.11.1"
|
- "coop-cloud.${STACK_NAME}.version=3.0.0+2023.2.3"
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
image: ghcr.io/goauthentik/server:2022.11.1
|
image: ghcr.io/goauthentik/server:2023.2.3
|
||||||
command: worker
|
command: worker
|
||||||
secrets:
|
secrets:
|
||||||
- db_password
|
- db_password
|
||||||
@ -87,14 +91,24 @@ services:
|
|||||||
- media:/media
|
- media:/media
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
- custom-templates:/templates
|
- custom-templates:/templates
|
||||||
- /dev/null:/blueprints/default/10-flow-default-authentication-flow.yaml
|
- /dev/null:/blueprints/default/flow-oobe.yaml
|
||||||
configs:
|
configs:
|
||||||
- source: custom_flows
|
- source: flow_recovery
|
||||||
target: /blueprints/custom_flows.yaml
|
target: /blueprints/1_flow_recovery.yaml
|
||||||
|
- source: flow_authentication
|
||||||
|
target: /blueprints/2_flow_authentication.yaml
|
||||||
|
- source: flow_translation
|
||||||
|
target: /blueprints/3_flow_translation.yaml
|
||||||
|
- source: flow_invitation
|
||||||
|
target: /blueprints/4_flow_invitation.yaml
|
||||||
|
- source: system_tenant
|
||||||
|
target: /blueprints/5_system_tenant.yaml
|
||||||
|
- source: flow_invalidation
|
||||||
|
target: /blueprints/6_flow_invalidation.yaml
|
||||||
environment: *env
|
environment: *env
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:12.13-alpine
|
image: postgres:12.14-alpine
|
||||||
secrets:
|
secrets:
|
||||||
- db_password
|
- db_password
|
||||||
volumes:
|
volumes:
|
||||||
@ -109,17 +123,17 @@ services:
|
|||||||
start_period: 1m
|
start_period: 1m
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
|
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
|
||||||
- POSTGRES_USER=${AUTHENTIK_POSTGRESQL__USER}
|
- POSTGRES_USER=authentik
|
||||||
- POSTGRES_DB=${AUTHENTIK_POSTGRESQL__NAME}
|
- POSTGRES_DB=authentik
|
||||||
deploy:
|
deploy:
|
||||||
labels:
|
labels:
|
||||||
backupbot.backup: "true"
|
backupbot.backup: "true"
|
||||||
backupbot.backup.pre-hook: "mkdir -p /tmp/backup/ && PGPASSWORD=$(cat /run/secrets/db_password) pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} > /tmp/backup/backup.sql"
|
backupbot.backup.pre-hook: "mkdir -p /tmp/backup/ && PGPASSWORD=$$(cat /run/secrets/db_password) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /tmp/backup/backup.sql"
|
||||||
backupbot.backup.post-hook: "rm -rf /tmp/backup"
|
backupbot.backup.post-hook: "rm -rf /tmp/backup"
|
||||||
backupbot.backup.path: "/tmp/backup/"
|
backupbot.backup.path: "/tmp/backup/"
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7.0.5-alpine
|
image: redis:7.0.9-alpine
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
healthcheck:
|
healthcheck:
|
||||||
@ -162,7 +176,27 @@ configs:
|
|||||||
name: ${STACK_NAME}_custom_css_${CUSTOM_CSS_VERSION}
|
name: ${STACK_NAME}_custom_css_${CUSTOM_CSS_VERSION}
|
||||||
file: custom.css.tmpl
|
file: custom.css.tmpl
|
||||||
template_driver: golang
|
template_driver: golang
|
||||||
custom_flows:
|
flow_authentication:
|
||||||
name: ${STACK_NAME}_custom_flows_${CUSTOM_FLOWS_VERSION}
|
name: ${STACK_NAME}_flow_authentication_${FLOW_AUTHENTICATION_VERSION}
|
||||||
file: custom_flows.yaml.tmpl
|
file: flow_authentication.yaml.tmpl
|
||||||
|
template_driver: golang
|
||||||
|
flow_invitation:
|
||||||
|
name: ${STACK_NAME}_flow_invitation_${FLOW_INVITATION_VERSION}
|
||||||
|
file: flow_invitation.yaml.tmpl
|
||||||
|
template_driver: golang
|
||||||
|
flow_invalidation:
|
||||||
|
name: ${STACK_NAME}_flow_invalidation_${FLOW_INVALIDATION_VERSION}
|
||||||
|
file: flow_invalidation.yaml.tmpl
|
||||||
|
template_driver: golang
|
||||||
|
flow_recovery:
|
||||||
|
name: ${STACK_NAME}_flow_recovery_${FLOW_RECOVERY_VERSION}
|
||||||
|
file: flow_recovery.yaml.tmpl
|
||||||
|
template_driver: golang
|
||||||
|
flow_translation:
|
||||||
|
name: ${STACK_NAME}_flow_translation_${FLOW_TRANSLATION_VERSION}
|
||||||
|
file: flow_translation.yaml.tmpl
|
||||||
|
template_driver: golang
|
||||||
|
system_tenant:
|
||||||
|
name: ${STACK_NAME}_system_tenant_${SYSTEM_TENANT_VERSION}
|
||||||
|
file: system_tenant.yaml.tmpl
|
||||||
template_driver: golang
|
template_driver: golang
|
||||||
|
@ -4,12 +4,13 @@ metadata:
|
|||||||
blueprints.goauthentik.io/instantiate: "true"
|
blueprints.goauthentik.io/instantiate: "true"
|
||||||
name: Custom - Flows
|
name: Custom - Flows
|
||||||
context:
|
context:
|
||||||
|
welcome_message: {{ if eq (env "WELCOME_MESSAGE") "" }} "Welcome to authentik!" {{ else }} {{ env "WELCOME_MESSAGE" }} {{ end }}
|
||||||
####### Translations ########
|
####### Translations ########
|
||||||
transl_recovery: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} Passwort Zurücksetzen {{ else }} Reset your password {{ end }}
|
transl_recovery: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Passwort Zurücksetzen" {{ else }} "Reset your password" {{ end }}
|
||||||
transl_password: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} Passwort {{ else }} Password {{ end }}
|
transl_password: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Passwort" {{ else }} "Password" {{ end }}
|
||||||
transl_password_repeat: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} Passwort (wiederholen) {{ else }} Password (repeat) {{ end }}
|
transl_password_repeat: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Passwort (wiederholen)" {{ else }} "Password (repeat)" {{ end }}
|
||||||
transl_username: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} Benutzername {{ else }} Username {{ end }}
|
transl_username: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Benutzername" {{ else }} "Username" {{ end }}
|
||||||
transl_name: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} Vor- und Nachname {{ else }} Full name {{ end }}
|
transl_name: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Vor- und Nachname" {{ else }} "Full name" {{ end }}
|
||||||
|
|
||||||
entries:
|
entries:
|
||||||
######## Email Recovery Flow ########
|
######## Email Recovery Flow ########
|
||||||
@ -25,10 +26,10 @@ entries:
|
|||||||
### PROMPTS
|
### PROMPTS
|
||||||
- identifiers:
|
- identifiers:
|
||||||
field_key: password
|
field_key: password
|
||||||
label: !Context transl_password
|
|
||||||
id: prompt-field-password
|
id: prompt-field-password
|
||||||
model: authentik_stages_prompt.prompt
|
model: authentik_stages_prompt.prompt
|
||||||
attrs:
|
attrs:
|
||||||
|
label: !Context transl_password
|
||||||
type: password
|
type: password
|
||||||
required: true
|
required: true
|
||||||
placeholder: !Context transl_password
|
placeholder: !Context transl_password
|
||||||
@ -36,10 +37,10 @@ entries:
|
|||||||
placeholder_expression: false
|
placeholder_expression: false
|
||||||
- identifiers:
|
- identifiers:
|
||||||
field_key: password_repeat
|
field_key: password_repeat
|
||||||
label: !Context transl_password_repeat
|
|
||||||
id: prompt-field-password-repeat
|
id: prompt-field-password-repeat
|
||||||
model: authentik_stages_prompt.prompt
|
model: authentik_stages_prompt.prompt
|
||||||
attrs:
|
attrs:
|
||||||
|
label: !Context transl_password_repeat
|
||||||
type: password
|
type: password
|
||||||
required: true
|
required: true
|
||||||
placeholder: !Context transl_password_repeat
|
placeholder: !Context transl_password_repeat
|
||||||
@ -54,8 +55,8 @@ entries:
|
|||||||
model: authentik_stages_email.emailstage
|
model: authentik_stages_email.emailstage
|
||||||
attrs:
|
attrs:
|
||||||
use_global_settings: true
|
use_global_settings: true
|
||||||
token_expiry: 30
|
token_expiry: {{ if eq (env "EMAIL_TOKEN_EXPIRY_MINUTES") "" }} 30 {{ else }} {{ env "EMAIL_TOKEN_EXPIRY_MINUTES" }} {{ end }}
|
||||||
subject: authentik
|
subject: {{ if eq (env "EMAIL_SUBJECT") "" }} "Account Recovery" {{ else }} "{{ env "EMAIL_SUBJECT" }}" {{ end }}
|
||||||
template: email/password_reset.html
|
template: email/password_reset.html
|
||||||
activate_user_on_success: true
|
activate_user_on_success: true
|
||||||
- identifiers:
|
- identifiers:
|
||||||
@ -178,7 +179,7 @@ entries:
|
|||||||
- attrs:
|
- attrs:
|
||||||
designation: authentication
|
designation: authentication
|
||||||
name: custom-authentication-flow
|
name: custom-authentication-flow
|
||||||
title: {{ env "WELCOME_MESSAGE" }}
|
title: !Context welcome_message
|
||||||
identifiers:
|
identifiers:
|
||||||
slug: custom-authentication-flow
|
slug: custom-authentication-flow
|
||||||
id: authentication_flow
|
id: authentication_flow
|
||||||
@ -240,7 +241,7 @@ entries:
|
|||||||
- attrs:
|
- attrs:
|
||||||
designation: enrollment
|
designation: enrollment
|
||||||
name: invitation-enrollment-flow
|
name: invitation-enrollment-flow
|
||||||
title: {{ env "WELCOME_MESSAGE" }}
|
title: !Context welcome_message
|
||||||
identifiers:
|
identifiers:
|
||||||
slug: invitation-enrollment-flow
|
slug: invitation-enrollment-flow
|
||||||
id: invitation-enrollment-flow
|
id: invitation-enrollment-flow
|
||||||
@ -249,10 +250,10 @@ entries:
|
|||||||
### PROMPTS
|
### PROMPTS
|
||||||
- identifiers:
|
- identifiers:
|
||||||
field_key: username
|
field_key: username
|
||||||
label: !Context transl_username
|
|
||||||
id: prompt-field-username
|
id: prompt-field-username
|
||||||
model: authentik_stages_prompt.prompt
|
model: authentik_stages_prompt.prompt
|
||||||
attrs:
|
attrs:
|
||||||
|
label: !Context transl_username
|
||||||
type: username
|
type: username
|
||||||
required: true
|
required: true
|
||||||
placeholder: !Context transl_username
|
placeholder: !Context transl_username
|
||||||
@ -260,10 +261,10 @@ entries:
|
|||||||
placeholder_expression: false
|
placeholder_expression: false
|
||||||
- identifiers:
|
- identifiers:
|
||||||
field_key: name
|
field_key: name
|
||||||
label: !Context transl_name
|
|
||||||
id: prompt-field-name
|
id: prompt-field-name
|
||||||
model: authentik_stages_prompt.prompt
|
model: authentik_stages_prompt.prompt
|
||||||
attrs:
|
attrs:
|
||||||
|
label: !Context transl_name
|
||||||
type: text
|
type: text
|
||||||
required: true
|
required: true
|
||||||
placeholder: !Context transl_name
|
placeholder: !Context transl_name
|
||||||
@ -334,11 +335,60 @@ entries:
|
|||||||
target: !KeyOf invitation-enrollment-flow
|
target: !KeyOf invitation-enrollment-flow
|
||||||
model: authentik_flows.flowstagebinding
|
model: authentik_flows.flowstagebinding
|
||||||
|
|
||||||
|
######## Invalidation Flow ########
|
||||||
|
- identifiers:
|
||||||
|
slug: logout-flow
|
||||||
|
id: logout-flow
|
||||||
|
model: authentik_flows.flow
|
||||||
|
attrs:
|
||||||
|
name: Logout
|
||||||
|
title: Logout Flow
|
||||||
|
designation: invalidation
|
||||||
|
|
||||||
|
### STAGES
|
||||||
|
|
||||||
|
- id: logout-stage
|
||||||
|
identifiers:
|
||||||
|
name: logout-stage
|
||||||
|
model: authentik_stages_user_logout.userlogoutstage
|
||||||
|
|
||||||
|
### STAGE BINDINGS
|
||||||
|
|
||||||
|
- identifiers:
|
||||||
|
order: 0
|
||||||
|
stage: !KeyOf logout-stage
|
||||||
|
target: !KeyOf logout-flow
|
||||||
|
model: authentik_flows.flowstagebinding
|
||||||
|
attrs:
|
||||||
|
re_evaluate_policies: true
|
||||||
|
id: logout-stage-binding
|
||||||
|
|
||||||
|
### POLICIES
|
||||||
|
- attrs:
|
||||||
|
execution_logging: true
|
||||||
|
expression: 'context[''flow_plan''].context[''redirect''] = ''{{ env "LOGOUT_REDIRECT" }}''
|
||||||
|
|
||||||
|
return True'
|
||||||
|
identifiers:
|
||||||
|
name: redirect-policy
|
||||||
|
id: redirect-policy
|
||||||
|
model: authentik_policies_expression.expressionpolicy
|
||||||
|
|
||||||
|
### POLICY BINDINGS
|
||||||
|
- identifiers:
|
||||||
|
policy: !KeyOf redirect-policy
|
||||||
|
target: !KeyOf logout-stage-binding
|
||||||
|
order: 0
|
||||||
|
model: authentik_policies.policybinding
|
||||||
|
attrs:
|
||||||
|
enabled: {{ if eq (env "LOGOUT_REDIRECT") "" }} false {{ else }} true {{ end }}
|
||||||
|
timeout: 30
|
||||||
|
|
||||||
######## System Tenant ##########
|
######## System Tenant ##########
|
||||||
- attrs:
|
- attrs:
|
||||||
attributes:
|
attributes:
|
||||||
settings:
|
settings:
|
||||||
locale: {{ env "DEFAULT_LANGUAGE" }}
|
locale: {{ if eq (env "DEFAULT_LANGUAGE") "" }} en {{ else }} {{ env "DEFAULT_LANGUAGE" }} {{ end }}
|
||||||
# branding_favicon: /static/dist/assets/icons/icon.png
|
# branding_favicon: /static/dist/assets/icons/icon.png
|
||||||
# branding_logo: /static/dist/assets/icons/icon_left_brand.svg
|
# branding_logo: /static/dist/assets/icons/icon_left_brand.svg
|
||||||
# branding_title: Authentik
|
# branding_title: Authentik
|
||||||
@ -347,7 +397,7 @@ entries:
|
|||||||
# event_retention: days=365
|
# event_retention: days=365
|
||||||
flow_authentication: !KeyOf authentication_flow
|
flow_authentication: !KeyOf authentication_flow
|
||||||
flow_recovery: !KeyOf recovery_flow
|
flow_recovery: !KeyOf recovery_flow
|
||||||
flow_invalidation: !Find [authentik_flows.flow, [slug, default-invalidation-flow]]
|
flow_invalidation: !KeyOf logout-flow
|
||||||
flow_user_settings: !Find [authentik_flows.flow, [slug, default-user-settings-flow]]
|
flow_user_settings: !Find [authentik_flows.flow, [slug, default-user-settings-flow]]
|
||||||
identifiers:
|
identifiers:
|
||||||
pk: 047cce25-aae2-4b02-9f96-078e155f803d
|
pk: 047cce25-aae2-4b02-9f96-078e155f803d
|
||||||
|
45
flow_authentication.yaml.tmpl
Normal file
45
flow_authentication.yaml.tmpl
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
version: 1
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
blueprints.goauthentik.io/instantiate: "true"
|
||||||
|
name: Custom Authentication Flow
|
||||||
|
context:
|
||||||
|
welcome_message: {{ if eq (env "WELCOME_MESSAGE") "" }} "Welcome to authentik!" {{ else }} {{ env "WELCOME_MESSAGE" }} {{ end }}
|
||||||
|
|
||||||
|
entries:
|
||||||
|
### DEPENDENCIES
|
||||||
|
- model: authentik_blueprints.metaapplyblueprint
|
||||||
|
attrs:
|
||||||
|
identifiers:
|
||||||
|
name: Recovery with email verification
|
||||||
|
required: true
|
||||||
|
|
||||||
|
### FLOW
|
||||||
|
- model: authentik_flows.flow
|
||||||
|
identifiers:
|
||||||
|
slug: default-authentication-flow
|
||||||
|
id: flow
|
||||||
|
attrs:
|
||||||
|
name: !Context welcome_message
|
||||||
|
title: !Context welcome_message
|
||||||
|
|
||||||
|
### STAGES
|
||||||
|
- identifiers:
|
||||||
|
name: default-authentication-identification
|
||||||
|
model: authentik_stages_identification.identificationstage
|
||||||
|
attrs:
|
||||||
|
password_stage: !Find [authentik_stages_password.passwordstage, [name, default-authentication-password]]
|
||||||
|
recovery_flow: !Find [authentik_flows.flow, [slug, default-recovery-flow]]
|
||||||
|
|
||||||
|
- identifiers:
|
||||||
|
name: default-authentication-login
|
||||||
|
model: authentik_stages_user_login.userloginstage
|
||||||
|
attrs:
|
||||||
|
session_duration: seconds=0
|
||||||
|
|
||||||
|
- identifiers:
|
||||||
|
order: 20
|
||||||
|
stage: !Find [authentik_stages_password.passwordstage, [name, default-authentication-password]]
|
||||||
|
target: !KeyOf flow
|
||||||
|
model: authentik_flows.flowstagebinding
|
||||||
|
state: absent
|
44
flow_invalidation.yaml.tmpl
Normal file
44
flow_invalidation.yaml.tmpl
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
version: 1
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
blueprints.goauthentik.io/instantiate: "true"
|
||||||
|
name: Custom Invalidation Flow
|
||||||
|
entries:
|
||||||
|
### DEPENDENCIES
|
||||||
|
- model: authentik_blueprints.metaapplyblueprint
|
||||||
|
attrs:
|
||||||
|
identifiers:
|
||||||
|
name: Default - Invalidation flow
|
||||||
|
required: true
|
||||||
|
|
||||||
|
### STAGE BINDINGS
|
||||||
|
|
||||||
|
- identifiers:
|
||||||
|
order: 0
|
||||||
|
stage: !Find [authentik_stages_user_logout.userlogoutstage, [name, default-invalidation-logout]]
|
||||||
|
target: !Find [authentik_flows.flow, [slug, default-invalidation-flow]]
|
||||||
|
model: authentik_flows.flowstagebinding
|
||||||
|
attrs:
|
||||||
|
re_evaluate_policies: true
|
||||||
|
id: logout-stage-binding
|
||||||
|
|
||||||
|
### POLICIES
|
||||||
|
- attrs:
|
||||||
|
execution_logging: true
|
||||||
|
expression: 'context[''flow_plan''].context[''redirect''] = ''{{ env "LOGOUT_REDIRECT" }}''
|
||||||
|
|
||||||
|
return True'
|
||||||
|
identifiers:
|
||||||
|
name: redirect-policy
|
||||||
|
id: redirect-policy
|
||||||
|
model: authentik_policies_expression.expressionpolicy
|
||||||
|
|
||||||
|
### POLICY BINDINGS
|
||||||
|
- identifiers:
|
||||||
|
policy: !KeyOf redirect-policy
|
||||||
|
target: !KeyOf logout-stage-binding
|
||||||
|
order: 0
|
||||||
|
model: authentik_policies.policybinding
|
||||||
|
attrs:
|
||||||
|
enabled: {{ if eq (env "LOGOUT_REDIRECT") "" }} false {{ else }} true {{ end }}
|
||||||
|
timeout: 30
|
65
flow_invitation.yaml.tmpl
Normal file
65
flow_invitation.yaml.tmpl
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
version: 1
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
blueprints.goauthentik.io/instantiate: "true"
|
||||||
|
name: Invitation Enrollment Flow
|
||||||
|
context:
|
||||||
|
welcome_message: {{ if eq (env "WELCOME_MESSAGE") "" }} "Welcome to authentik!" {{ else }} {{ env "WELCOME_MESSAGE" }} {{ end }}
|
||||||
|
|
||||||
|
entries:
|
||||||
|
### DEPENDENCIES
|
||||||
|
- model: authentik_blueprints.metaapplyblueprint
|
||||||
|
attrs:
|
||||||
|
identifiers:
|
||||||
|
name: Flow Translations
|
||||||
|
required: true
|
||||||
|
|
||||||
|
### FLOW
|
||||||
|
- attrs:
|
||||||
|
designation: enrollment
|
||||||
|
name: invitation-enrollment-flow
|
||||||
|
title: !Context welcome_message
|
||||||
|
identifiers:
|
||||||
|
slug: invitation-enrollment-flow
|
||||||
|
id: invitation-enrollment-flow
|
||||||
|
model: authentik_flows.flow
|
||||||
|
|
||||||
|
### STAGES
|
||||||
|
- identifiers:
|
||||||
|
name: invitation-stage
|
||||||
|
id: invitation-stage
|
||||||
|
model: authentik_stages_invitation.invitationstage
|
||||||
|
|
||||||
|
- identifiers:
|
||||||
|
name: enrollment-prompt-userdata
|
||||||
|
id: enrollment-prompt-userdata
|
||||||
|
model: authentik_stages_prompt.promptstage
|
||||||
|
attrs:
|
||||||
|
fields:
|
||||||
|
- !Find [authentik_stages_prompt.prompt, [name, default-source-enrollment-field-username]]
|
||||||
|
- !Find [authentik_stages_prompt.prompt, [name, default-user-settings-field-name]]
|
||||||
|
- !Find [authentik_stages_prompt.prompt, [name, default-user-settings-field-email]]
|
||||||
|
- !Find [authentik_stages_prompt.prompt, [name, default-password-change-field-password]]
|
||||||
|
- !Find [authentik_stages_prompt.prompt, [name, default-password-change-field-password-repeat]]
|
||||||
|
|
||||||
|
### STAGE BINDINGS
|
||||||
|
- identifiers:
|
||||||
|
order: 1
|
||||||
|
stage: !KeyOf invitation-stage
|
||||||
|
target: !KeyOf invitation-enrollment-flow
|
||||||
|
model: authentik_flows.flowstagebinding
|
||||||
|
- identifiers:
|
||||||
|
order: 10
|
||||||
|
stage: !KeyOf enrollment-prompt-userdata
|
||||||
|
target: !KeyOf invitation-enrollment-flow
|
||||||
|
model: authentik_flows.flowstagebinding
|
||||||
|
- identifiers:
|
||||||
|
order: 20
|
||||||
|
stage: !Find [authentik_stages_user_write.userwritestage, [name, default-source-enrollment-write]]
|
||||||
|
target: !KeyOf invitation-enrollment-flow
|
||||||
|
model: authentik_flows.flowstagebinding
|
||||||
|
- identifiers:
|
||||||
|
order: 100
|
||||||
|
stage: !Find [authentik_stages_user_login.userloginstage, [name, default-authentication-login]]
|
||||||
|
target: !KeyOf invitation-enrollment-flow
|
||||||
|
model: authentik_flows.flowstagebinding
|
128
flow_recovery.yaml.tmpl
Normal file
128
flow_recovery.yaml.tmpl
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
version: 1
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
blueprints.goauthentik.io/instantiate: "true"
|
||||||
|
name: Recovery with email verification
|
||||||
|
context:
|
||||||
|
token_expiry: {{ if eq (env "EMAIL_TOKEN_EXPIRY_MINUTES") "" }} 30 {{ else }} {{ env "EMAIL_TOKEN_EXPIRY_MINUTES" }} {{ end }}
|
||||||
|
subject: {{ if eq (env "EMAIL_SUBJECT") "" }} Account Recovery {{ else }} {{ env "EMAIL_SUBJECT" }} {{ end }}
|
||||||
|
entries:
|
||||||
|
### DEPENDENCIES
|
||||||
|
- model: authentik_blueprints.metaapplyblueprint
|
||||||
|
attrs:
|
||||||
|
identifiers:
|
||||||
|
name: Default - Authentication flow
|
||||||
|
required: true
|
||||||
|
|
||||||
|
### FLOW
|
||||||
|
- identifiers:
|
||||||
|
slug: default-recovery-flow
|
||||||
|
model: authentik_flows.flow
|
||||||
|
state: created
|
||||||
|
attrs:
|
||||||
|
name: Default recovery flow
|
||||||
|
title: Reset your password
|
||||||
|
designation: recovery
|
||||||
|
authentication: require_unauthenticated
|
||||||
|
|
||||||
|
### STAGES
|
||||||
|
- identifiers:
|
||||||
|
name: default-recovery-email
|
||||||
|
id: default-recovery-email
|
||||||
|
model: authentik_stages_email.emailstage
|
||||||
|
attrs:
|
||||||
|
use_global_settings: true
|
||||||
|
token_expiry: !Context token_expiry
|
||||||
|
subject: !Context subject
|
||||||
|
template: email/password_reset.html
|
||||||
|
activate_user_on_success: true
|
||||||
|
- identifiers:
|
||||||
|
name: default-recovery-identification
|
||||||
|
id: default-recovery-identification
|
||||||
|
model: authentik_stages_identification.identificationstage
|
||||||
|
attrs:
|
||||||
|
user_fields:
|
||||||
|
- email
|
||||||
|
- username
|
||||||
|
|
||||||
|
### STAGE BINDINGS
|
||||||
|
- identifiers:
|
||||||
|
target: !Find [authentik_flows.flow, [slug, default-recovery-flow]]
|
||||||
|
stage: !KeyOf default-recovery-identification
|
||||||
|
order: 10
|
||||||
|
model: authentik_flows.flowstagebinding
|
||||||
|
id: flow-binding-identification
|
||||||
|
attrs:
|
||||||
|
evaluate_on_plan: true
|
||||||
|
re_evaluate_policies: true
|
||||||
|
policy_engine_mode: any
|
||||||
|
invalid_response_action: retry
|
||||||
|
- identifiers:
|
||||||
|
target: !Find [authentik_flows.flow, [slug, default-recovery-flow]]
|
||||||
|
stage: !KeyOf default-recovery-email
|
||||||
|
order: 20
|
||||||
|
model: authentik_flows.flowstagebinding
|
||||||
|
id: flow-binding-email
|
||||||
|
attrs:
|
||||||
|
evaluate_on_plan: true
|
||||||
|
re_evaluate_policies: true
|
||||||
|
policy_engine_mode: any
|
||||||
|
invalid_response_action: retry
|
||||||
|
- identifiers:
|
||||||
|
target: !Find [authentik_flows.flow, [slug, default-recovery-flow]]
|
||||||
|
stage: !Find [authentik_stages_prompt.promptstage, [name, default-password-change-prompt]]
|
||||||
|
order: 30
|
||||||
|
model: authentik_flows.flowstagebinding
|
||||||
|
attrs:
|
||||||
|
evaluate_on_plan: true
|
||||||
|
re_evaluate_policies: false
|
||||||
|
policy_engine_mode: any
|
||||||
|
invalid_response_action: retry
|
||||||
|
- identifiers:
|
||||||
|
target: !Find [authentik_flows.flow, [slug, default-recovery-flow]]
|
||||||
|
stage: !Find [authentik_stages_user_write.userwritestage, [name, default-password-change-write]]
|
||||||
|
order: 40
|
||||||
|
model: authentik_flows.flowstagebinding
|
||||||
|
attrs:
|
||||||
|
evaluate_on_plan: true
|
||||||
|
re_evaluate_policies: false
|
||||||
|
policy_engine_mode: any
|
||||||
|
invalid_response_action: retry
|
||||||
|
- identifiers:
|
||||||
|
target: !Find [authentik_flows.flow, [slug, default-recovery-flow]]
|
||||||
|
stage: !Find [authentik_stages_user_login.userloginstage, [name, default-authentication-login]]
|
||||||
|
order: 100
|
||||||
|
model: authentik_flows.flowstagebinding
|
||||||
|
attrs:
|
||||||
|
evaluate_on_plan: true
|
||||||
|
re_evaluate_policies: false
|
||||||
|
policy_engine_mode: any
|
||||||
|
invalid_response_action: retry
|
||||||
|
|
||||||
|
### POLICIES
|
||||||
|
- identifiers:
|
||||||
|
name: default-recovery-skip-if-restored
|
||||||
|
id: default-recovery-skip-if-restored
|
||||||
|
model: authentik_policies_expression.expressionpolicy
|
||||||
|
attrs:
|
||||||
|
expression: |
|
||||||
|
return request.context.get('is_restored', False)
|
||||||
|
- identifiers:
|
||||||
|
policy: !KeyOf default-recovery-skip-if-restored
|
||||||
|
target: !KeyOf flow-binding-identification
|
||||||
|
order: 0
|
||||||
|
model: authentik_policies.policybinding
|
||||||
|
attrs:
|
||||||
|
negate: false
|
||||||
|
enabled: false # TODO: why does this doesn't work?
|
||||||
|
timeout: 30
|
||||||
|
- identifiers:
|
||||||
|
policy: !KeyOf default-recovery-skip-if-restored
|
||||||
|
target: !KeyOf flow-binding-email
|
||||||
|
order: 0
|
||||||
|
state: absent
|
||||||
|
model: authentik_policies.policybinding
|
||||||
|
attrs:
|
||||||
|
negate: false
|
||||||
|
enabled: true
|
||||||
|
timeout: 30
|
71
flow_translation.yaml.tmpl
Normal file
71
flow_translation.yaml.tmpl
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
version: 1
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
blueprints.goauthentik.io/instantiate: "true"
|
||||||
|
name: Flow Translations
|
||||||
|
context:
|
||||||
|
transl_recovery: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Passwort Zurücksetzen" {{ else }} "Reset your password" {{ end }}
|
||||||
|
transl_password: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Passwort" {{ else }} "Password" {{ end }}
|
||||||
|
transl_password_repeat: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Passwort (wiederholen)" {{ else }} "Password (repeat)" {{ end }}
|
||||||
|
transl_username: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Benutzername" {{ else }} "Username" {{ end }}
|
||||||
|
transl_name: {{ if eq (env "DEFAULT_LANGUAGE") "de" }} "Vor- und Nachname" {{ else }} "Full name" {{ end }}
|
||||||
|
|
||||||
|
entries:
|
||||||
|
### DEPENDENCIES
|
||||||
|
- model: authentik_blueprints.metaapplyblueprint
|
||||||
|
attrs:
|
||||||
|
identifiers:
|
||||||
|
name: Custom Authentication Flow
|
||||||
|
required: true
|
||||||
|
- model: authentik_blueprints.metaapplyblueprint
|
||||||
|
attrs:
|
||||||
|
identifiers:
|
||||||
|
name: Default - User settings flow
|
||||||
|
required: true
|
||||||
|
- model: authentik_blueprints.metaapplyblueprint
|
||||||
|
attrs:
|
||||||
|
identifiers:
|
||||||
|
name: Default - Source enrollment flow
|
||||||
|
required: true
|
||||||
|
|
||||||
|
### FLOWS
|
||||||
|
- model: authentik_flows.flow
|
||||||
|
identifiers:
|
||||||
|
slug: default-recovery-flow
|
||||||
|
id: recovery_flow
|
||||||
|
model: authentik_flows.flow
|
||||||
|
attrs:
|
||||||
|
name: Default recovery flow
|
||||||
|
title: !Context transl_recovery
|
||||||
|
designation: recovery
|
||||||
|
|
||||||
|
|
||||||
|
### PROMPTS
|
||||||
|
- model: authentik_stages_prompt.prompt
|
||||||
|
identifiers:
|
||||||
|
name: default-password-change-field-password
|
||||||
|
attrs:
|
||||||
|
label: !Context transl_password
|
||||||
|
placeholder: !Context transl_password
|
||||||
|
- model: authentik_stages_prompt.prompt
|
||||||
|
identifiers:
|
||||||
|
name: default-password-change-field-password-repeat
|
||||||
|
attrs:
|
||||||
|
label: !Context transl_password_repeat
|
||||||
|
placeholder: !Context transl_password_repeat
|
||||||
|
- model: authentik_stages_prompt.prompt
|
||||||
|
identifiers:
|
||||||
|
name: default-user-settings-field-username
|
||||||
|
attrs:
|
||||||
|
label: !Context transl_username
|
||||||
|
- model: authentik_stages_prompt.prompt
|
||||||
|
identifiers:
|
||||||
|
name: default-user-settings-field-name
|
||||||
|
attrs:
|
||||||
|
label: !Context transl_name
|
||||||
|
- model: authentik_stages_prompt.prompt
|
||||||
|
identifiers:
|
||||||
|
name: default-source-enrollment-field-username
|
||||||
|
attrs:
|
||||||
|
label: !Context transl_username
|
||||||
|
placeholder: !Context transl_username
|
56
nextcloud.yaml.tmpl
Normal file
56
nextcloud.yaml.tmpl
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
version: 1
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
blueprints.goauthentik.io/instantiate: "true"
|
||||||
|
name: Nextcloud
|
||||||
|
|
||||||
|
entries:
|
||||||
|
- attrs:
|
||||||
|
description: nextcloud
|
||||||
|
expression: 'return { "nextcloud_groups": [{"gid": group.name, "displayName":
|
||||||
|
group.name} for group in request.user.ak_groups.all()], }'
|
||||||
|
managed: null
|
||||||
|
scope_name: nextcloud
|
||||||
|
conditions: []
|
||||||
|
id: nextcloud_group_mapping
|
||||||
|
identifiers:
|
||||||
|
name: nextcloud
|
||||||
|
model: authentik_providers_oauth2.scopemapping
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- attrs:
|
||||||
|
access_code_validity: minutes=1
|
||||||
|
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
|
||||||
|
client_id: {{ secret "nextcloud_id" }}
|
||||||
|
client_secret: {{ secret "nextcloud_secret" }}
|
||||||
|
client_type: confidential
|
||||||
|
include_claims_in_id_token: true
|
||||||
|
issuer_mode: per_provider
|
||||||
|
name: Nextcloud
|
||||||
|
property_mappings:
|
||||||
|
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, openid]]
|
||||||
|
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, email]]
|
||||||
|
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, profile]]
|
||||||
|
- !KeyOf nextcloud_group_mapping
|
||||||
|
signing_key: !Find [authentik_crypto.certificatekeypair, [name, authentik Self-signed Certificate]]
|
||||||
|
sub_mode: user_username
|
||||||
|
token_validity: days=30
|
||||||
|
conditions: []
|
||||||
|
id: nextcloud_provider
|
||||||
|
identifiers:
|
||||||
|
pk: 9999
|
||||||
|
model: authentik_providers_oauth2.oauth2provider
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- attrs:
|
||||||
|
meta_launch_url: https://{{ env "NEXTCLOUD_DOMAIN" }}
|
||||||
|
open_in_new_tab: true
|
||||||
|
policy_engine_mode: any
|
||||||
|
provider: !KeyOf nextcloud_provider
|
||||||
|
slug: nextcloud
|
||||||
|
conditions: []
|
||||||
|
id: nextcloud_application
|
||||||
|
identifiers:
|
||||||
|
name: Nextcloud
|
||||||
|
model: authentik_core.application
|
||||||
|
state: present
|
@ -1,53 +0,0 @@
|
|||||||
{% extends "email/base.html" %}
|
|
||||||
|
|
||||||
{% load i18n %}
|
|
||||||
{% load humanize %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<tr>
|
|
||||||
<td class="alert alert-success">
|
|
||||||
{% blocktrans with username=user.username %}
|
|
||||||
Herzlich Willkommen {{ username }},
|
|
||||||
{% endblocktrans %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="content-wrap">
|
|
||||||
<table width="100%" cellpadding="0" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
<td class="content-block">
|
|
||||||
{% blocktrans %}
|
|
||||||
Klicke auf folgenden Link um ein Passwort für deinen Account zu erstellen:
|
|
||||||
{% endblocktrans %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="content-block">
|
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="btn btn-primary">
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td align="center">
|
|
||||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td> <a id="confirm" href="{{ url }}" rel="noopener noreferrer" target="_blank">Passwort Erstellen</a> </td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="content-block">
|
|
||||||
{% blocktrans with expires=expires|naturaltime %}
|
|
||||||
Falls du diese E-Mail fälschlicherweise erhalten hast, ignoriere sie bitte. Der obige Link ist gültig für: {{ expires }}.
|
|
||||||
{% endblocktrans %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endblock %}
|
|
2
release/2.0.0+2023.2.3
Normal file
2
release/2.0.0+2023.2.3
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Logout URL changes from `https://login.example.org/if/flow/default-invalidation-flow/` to `https://login.example.org/if/flow/logout-flow/`
|
||||||
|
Replace it in any app that uses this logout url.
|
16
release/3.0.0+2023.2.3
Normal file
16
release/3.0.0+2023.2.3
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
Run `abra app cmd <app_name> worker blueprint_cleanup` to apply the new blueprint configuration and delete the old configuration.
|
||||||
|
|
||||||
|
If the nextcloud provider should be managed by abra add the following to the env:
|
||||||
|
|
||||||
|
COMPOSE_FILE="compose.yml:compose.nextcloud.yml"
|
||||||
|
NEXTCLOUD_DOMAIN=nextcloud.example.com
|
||||||
|
SECRET_NEXTCLOUD_ID_VERSION=v1
|
||||||
|
SECRET_NEXTCLOUD_SECRET_VERSION=v1
|
||||||
|
|
||||||
|
and generate the secrets:
|
||||||
|
|
||||||
|
abra app secret generate -a <app_name>
|
||||||
|
|
||||||
|
Eventuelly you need to manually remove the old nextcloud provider and application
|
||||||
|
|
||||||
|
Don't forget to update the nextcloud config for authentik as well.
|
35
system_tenant.yaml.tmpl
Normal file
35
system_tenant.yaml.tmpl
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
version: 1
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
blueprints.goauthentik.io/instantiate: "true"
|
||||||
|
name: Custom System Tenant
|
||||||
|
entries:
|
||||||
|
### DEPENDENCIES
|
||||||
|
- model: authentik_blueprints.metaapplyblueprint
|
||||||
|
attrs:
|
||||||
|
identifiers:
|
||||||
|
name: Default - Tenant
|
||||||
|
required: true
|
||||||
|
- model: authentik_blueprints.metaapplyblueprint
|
||||||
|
attrs:
|
||||||
|
identifiers:
|
||||||
|
name: Invitation Enrollment Flow
|
||||||
|
required: true
|
||||||
|
|
||||||
|
|
||||||
|
### SYSTEM TENANT
|
||||||
|
# remove custom tenant from old recipe
|
||||||
|
- identifiers:
|
||||||
|
domain: {{ env "DOMAIN" }}
|
||||||
|
model: authentik_tenants.tenant
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- attrs:
|
||||||
|
attributes:
|
||||||
|
settings:
|
||||||
|
locale: {{ if eq (env "DEFAULT_LANGUAGE") "" }} en {{ else }} {{ env "DEFAULT_LANGUAGE" }} {{ end }}
|
||||||
|
flow_recovery: !Find [authentik_flows.flow, [slug, default-recovery-flow]]
|
||||||
|
identifiers:
|
||||||
|
default: true
|
||||||
|
domain: authentik-default
|
||||||
|
model: authentik_tenants.tenant
|
Reference in New Issue
Block a user