diff --git a/.env.sample b/.env.sample index 5c9b497..3b8ba28 100644 --- a/.env.sample +++ b/.env.sample @@ -45,9 +45,14 @@ COPY_ASSETS="$COPY_ASSETS icon.png|app:/web/dist/assets/icons/" # SECRET_NEXTCLOUD_SECRET_VERSION=v1 # APP_ICONS="nextcloud:~/.abra/recipes/authentik/icons/nextcloud.png" - # COMPOSE_FILE="$COMPOSE_FILE:compose.wordpress.yml" # WORDPRESS_DOMAIN=wordpress.example.com # SECRET_WORDPRESS_ID_VERSION=v1 # SECRET_WORDPRESS_SECRET_VERSION=v1 # APP_ICONS="$APP_ICONS wordpress:~/.abra/recipes/authentik/icons/wordpress.png" + +# COMPOSE_FILE="$COMPOSE_FILE:compose.matrix.yml" +# ELEMENT_DOMAIN=element.example.com +# SECRET_MATRIX_ID_VERSION=v1 +# SECRET_MATRIX_SECRET_VERSION=v1 +# APP_ICONS="$APP_ICONS matrix:~/.abra/recipes/authentik/icons/matrix.svg" diff --git a/abra.sh b/abra.sh index d489439..4d798e0 100644 --- a/abra.sh +++ b/abra.sh @@ -7,6 +7,7 @@ export FLOW_TRANSLATION_VERSION=v1 export SYSTEM_TENANT_VERSION=v1 export NEXTCLOUD_CONFIG_VERSION=v1 export WORDPRESS_CONFIG_VERSION=v1 +export MATRIX_CONFIG_VERSION=v1 customize() { if [ -z "$1" ] diff --git a/compose.matrix.yml b/compose.matrix.yml new file mode 100644 index 0000000..69dac72 --- /dev/null +++ b/compose.matrix.yml @@ -0,0 +1,26 @@ +version: "3.8" +services: + worker: + secrets: + - matrix_id + - matrix_secret + environment: + - ELEMENT_DOMAIN + configs: + - source: matrix + target: /blueprints/matrix.yaml + +secrets: + matrix_id: + external: true + name: ${STACK_NAME}_matrix_id_${SECRET_MATRIX_ID_VERSION} + matrix_secret: + external: true + name: ${STACK_NAME}_matrix_secret_${SECRET_MATRIX_SECRET_VERSION} + + +configs: + matrix: + name: ${STACK_NAME}_matrix_${MATRIX_CONFIG_VERSION} + file: matrix.yaml.tmpl + template_driver: golang diff --git a/icons/matrix.svg b/icons/matrix.svg new file mode 100644 index 0000000..54a91b7 --- /dev/null +++ b/icons/matrix.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/matrix.yaml.tmpl b/matrix.yaml.tmpl new file mode 100644 index 0000000..5ef8247 --- /dev/null +++ b/matrix.yaml.tmpl @@ -0,0 +1,43 @@ +version: 1 +metadata: + labels: + blueprints.goauthentik.io/instantiate: "true" + name: matrix + +entries: + +- attrs: + access_code_validity: minutes=1 + authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]] + client_id: {{ secret "matrix_id" }} + client_secret: {{ secret "matrix_secret" }} + client_type: confidential + include_claims_in_id_token: true + issuer_mode: per_provider + name: Matrix + 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]] + signing_key: !Find [authentik_crypto.certificatekeypair, [name, authentik Self-signed Certificate]] + sub_mode: user_username + token_validity: days=30 + conditions: [] + id: matrix_provider + identifiers: + pk: 9997 + model: authentik_providers_oauth2.oauth2provider + state: present + +- attrs: + meta_launch_url: https://{{ env "ELEMENT_DOMAIN" }} + open_in_new_tab: true + policy_engine_mode: any + provider: !KeyOf matrix_provider + slug: matrix + conditions: [] + id: matrix_application + identifiers: + name: Matrix + model: authentik_core.application + state: present