diff --git a/.env.sample b/.env.sample index 6bd28c6..1468df1 100644 --- a/.env.sample +++ b/.env.sample @@ -96,6 +96,12 @@ COPY_ASSETS="$COPY_ASSETS icon.png|app:/web/dist/assets/icons/" # SECRET_RALLLY_SECRET_VERSION=v1 # APP_ICONS="$APP_ICONS rallly:~/.abra/recipes/authentik/icons/rallly.png" +# COMPOSE_FILE="$COMPOSE_FILE:compose.hedgedoc.yml" +# HEDGEDOC_DOMAIN=hedgedoc.example.com +# SECRET_HEDGEDOC_ID_VERSION=v1 +# SECRET_HEDGEDOC_SECRET_VERSION=v1 +# APP_ICONS="$APP_ICONS hedgedoc:~/.abra/recipes/authentik/icons/hedgedoc.png" + # APPLICATIONS='{"Calendar": "https://nextcloud.example.com/apps/calendar/", "BBB": "https://nextcloud.example.com/apps/bbb/"}' # APP_ICONS="$APP_ICONS Calendar:~/.abra/recipes/authentik/icons/calendar.svg" # APP_ICONS="$APP_ICONS BBB:~/.abra/recipes/authentik/icons/bbb.jpg" diff --git a/abra.sh b/abra.sh index 838e0b0..86ee41d 100644 --- a/abra.sh +++ b/abra.sh @@ -12,6 +12,7 @@ export WEKAN_CONFIG_VERSION=v3 export VIKUNJA_CONFIG_VERSION=v1 export OUTLINE_CONFIG_VERSION=v1 export RALLLY_CONFIG_VERSION=v1 +export HEDGEDOC_CONFIG_VERSION=v1 export MONITORING_CONFIG_VERSION=v1 export DB_ENTRYPOINT_VERSION=v1 diff --git a/compose.hedgedoc.yml b/compose.hedgedoc.yml new file mode 100644 index 0000000..21f6ae0 --- /dev/null +++ b/compose.hedgedoc.yml @@ -0,0 +1,26 @@ +version: "3.8" +services: + worker: + secrets: + - hedgedoc_id + - hedgedoc_secret + environment: + - HEDGEDOC_DOMAIN + configs: + - source: hedgedoc + target: /blueprints/hedgedoc.yaml + +secrets: + hedgedoc_id: + external: true + name: ${STACK_NAME}_hedgedoc_id_${SECRET_hedgedoc_ID_VERSION} + hedgedoc_secret: + external: true + name: ${STACK_NAME}_hedgedoc_secret_${SECRET_HEDGEDOC_SECRET_VERSION} + + +configs: + hedgedoc: + name: ${STACK_NAME}_hedgedoc_${HEDGEDOC_CONFIG_VERSION} + file: hedgedoc.yaml.tmpl + template_driver: golang diff --git a/hedgedoc.yaml.tmpl b/hedgedoc.yaml.tmpl new file mode 100644 index 0000000..33bf308 --- /dev/null +++ b/hedgedoc.yaml.tmpl @@ -0,0 +1,43 @@ +version: 1 +metadata: + labels: + blueprints.goauthentik.io/instantiate: "true" + name: hedgedoc + +entries: + +- attrs: + access_code_validity: minutes=1 + authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]] + client_id: {{ secret "hedgedoc_id" }} + client_secret: {{ secret "hedgedoc_secret" }} + client_type: confidential + include_claims_in_id_token: true + issuer_mode: per_provider + name: Hedgedoc + 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: hashed_user_id + token_validity: days=30 + conditions: [] + id: hedgedoc_provider + identifiers: + pk: 9992 + model: authentik_providers_oauth2.oauth2provider + state: present + +- attrs: + meta_launch_url: https://{{ env "HEDGEDOC_DOMAIN" }} + open_in_new_tab: true + policy_engine_mode: any + provider: !KeyOf hedgedoc_provider + slug: hedgedoc + conditions: [] + id: hedgedoc_application + identifiers: + name: Hedgedoc + model: authentik_core.application + state: present diff --git a/icons/hedgedoc.png b/icons/hedgedoc.png new file mode 100644 index 0000000..1eedb77 Binary files /dev/null and b/icons/hedgedoc.png differ