diff --git a/.env.sample b/.env.sample index 3108b8c..2537db2 100644 --- a/.env.sample +++ b/.env.sample @@ -193,6 +193,15 @@ COPY_ASSETS="$COPY_ASSETS icon.png|app:/web/dist/assets/icons/" # MILA_APPDESCRIPTION=Mila # MILA_GROUP='mv_admin' +# COMPOSE_FILE="$COMPOSE_FILE:compose.hopps.yml" +# HOPPS_DOMAIN=hopps.example.com +# SECRET_HOPPS_ID_VERSION=v1 +# SECRET_HOPPS_SECRET_VERSION=v1 +# APP_ICONS="$APP_ICONS hopps:~/.abra/recipes/authentik/icons/hopps.svg" +# HOPPS_APPGROUP="" +# HOPPS_APPNAME=Accounting +# HOPPS_APPDESCRIPTION=Hopps + # COMPOSE_FILE="$COMPOSE_FILE:compose.writefreely.yml" # WRITEFREELY_DOMAIN=writefreely.example.com # SECRET_WRITEFREELY_ID_VERSION=v1 diff --git a/abra.sh b/abra.sh index c3da16f..84575f6 100644 --- a/abra.sh +++ b/abra.sh @@ -21,6 +21,7 @@ export MILA_VERSION=v4 export DB_ENTRYPOINT_VERSION=v1 export PG_BACKUP_VERSION=v2 export ENTRYPOINT_CSS_VERSION=v2 +export HOPPS_VERSION=v1 customize() { if [ -z "$1" ]; then @@ -239,7 +240,7 @@ for app_name, details in applications.items(): if name := details.get('name'): app.name = name else: - app.name = app_name + app.name = app_name app.slug = slug app.meta_launch_url = url if group := details.get('group'): diff --git a/alaconnect.yml b/alaconnect.yml index c36af10..9ab56e9 100644 --- a/alaconnect.yml +++ b/alaconnect.yml @@ -70,7 +70,7 @@ outline: secrets: outline_id: outline rallly: - uncomment: + uncomment: - compose.rallly.yml - RALLLY_DOMAIN - SECRET_RALLLY_ID_VERSION @@ -79,7 +79,7 @@ rallly: secrets: rallly_id: rallly hedgedoc: - uncomment: + uncomment: - compose.hedgedoc.yml - HEDGEDOC_DOMAIN - SECRET_HEDGEDOC_ID_VERSION @@ -96,3 +96,12 @@ mila: - mila.svg secrets: mila_id: mila +hopps: + uncomment: + - compose.hopps.yml + - HOPPS_DOMAIN + - SECRET_HOPPS_ID_VERSION + - SECRET_HOPPS_SECRET_VERSION + - hopps.svg + secrets: + hopps_id: hopps diff --git a/compose.hopps.yml b/compose.hopps.yml new file mode 100644 index 0000000..2afd4f6 --- /dev/null +++ b/compose.hopps.yml @@ -0,0 +1,30 @@ +version: "3.8" +services: + worker: + secrets: + - hopps_id + - hopps_secret + environment: + - HOPPS_DOMAIN + - HOPPS_GROUP + - HOPPS_APPNAME + - HOPPS_APPDESCRIPTION + configs: + - source: hopps + target: /blueprints/hopps.yaml + +secrets: + hopps_id: + external: true + name: ${STACK_NAME}_hopps_id_${SECRET_HOPPS_ID_VERSION} + hopps_secret: + external: true + name: ${STACK_NAME}_hopps_secret_${SECRET_HOPPS_SECRET_VERSION} + + +configs: + hopps: + name: ${STACK_NAME}_hopps_${HOPPS_VERSION} + file: hopps.yaml.tmpl + template_driver: golang + diff --git a/hopps.yaml.tmpl b/hopps.yaml.tmpl new file mode 100644 index 0000000..979d84a --- /dev/null +++ b/hopps.yaml.tmpl @@ -0,0 +1,54 @@ +version: 1 +metadata: + labels: + blueprints.goauthentik.io/instantiate: "true" + name: hopps + +entries: + +- attrs: + access_code_validity: minutes=1 + authentication_flow: !Find [authentik_flows.flow, [slug, default-authentication-flow]] + authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]] + invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]] + client_id: {{ secret "hopps_id" }} + client_secret: {{ secret "hopps_secret" }} + client_type: public + include_claims_in_id_token: true + issuer_mode: per_provider + redirect_uris: + - matching_mode: strict + url: https://{{ env "HOPPS_DOMAIN" }}/ + name: Hopps + 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]] + - !Find [authentik_providers_oauth2.scopemapping, [scope_name, offline_access]] + signing_key: !Find [authentik_crypto.certificatekeypair, [name, authentik Self-signed Certificate]] + sub_mode: user_uuid + token_validity: days=30 + grant_types: + - authorization_code + - refresh_token + conditions: [] + id: hopps_provider + identifiers: + pk: 9986 + model: authentik_providers_oauth2.oauth2provider + state: present + +- attrs: + meta_description: "{{ env "HOPPS_APPDESCRIPTION" }}" + meta_launch_url: https://{{ env "HOPPS_DOMAIN" }} + name: "{{ if eq (env "HOPPS_APPNAME") "" }}Hopps{{ else }}{{ env "HOPPS_APPNAME" }}{{ end }}" + open_in_new_tab: true + policy_engine_mode: any + provider: !KeyOf hopps_provider + conditions: [] + id: hopps_application + identifiers: + slug: hopps + model: authentik_core.application + state: present + diff --git a/icons/hopps.svg b/icons/hopps.svg new file mode 100644 index 0000000..5848665 --- /dev/null +++ b/icons/hopps.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + +