Updated settings

This commit is contained in:
Kevin Veen-Birkenbach 2025-04-23 18:41:22 +02:00
parent f892a5b54d
commit c9ab0cd7cc
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
2 changed files with 31 additions and 29 deletions

View File

@ -50,38 +50,18 @@
"client_secret": oidc.client.secret
} | to_json }}
- name: Apply OIDC settings via Docker + here-doc
- name: Apply all Listmonk settings
shell: |
docker exec -i {{ database_host }} psql \
-U {{ database_username }} \
-d {{ database_name }} <<'EOSQL'
-d {{ database_name }} << 'EOSQL'
UPDATE settings
SET value = '{{ oidc_settings_json }}'::jsonb
WHERE key = 'security.oidc';
EOSQL
args:
executable: /bin/bash
when: applications[application_id].features.oidc | bool
- name: Enable hCaptcha and configure keys in Listmonk database
shell: |
docker exec -i {{ database_host }} psql \
-U {{ database_username }} \
-d {{ database_name }} <<'EOSQL'
-- enable captcha (boolean true)
UPDATE settings
SET value = 'true'::jsonb
WHERE key = 'security.enable_captcha';
-- set site key (JSON string)
UPDATE settings
SET value = '"{{ applications[application_id].credentials.hcaptcha.site_key }}"'::jsonb
WHERE key = 'security.captcha_key';
-- set secret (JSON string)
UPDATE settings
SET value = '"{{ applications[application_id].credentials.hcaptcha.secret }}"'::jsonb
WHERE key = 'security.captcha_secret';
SET value = '{{ item.value }}'::jsonb
WHERE key = '{{ item.key }}';
EOSQL
args:
executable: /bin/bash
loop: "{{ listmonk_settings }}"
loop_control:
label: "{{ item.key }}"
when: item.when is not defined or item.when

View File

@ -1,3 +1,25 @@
application_id: "listmonk"
database_password: "{{applications[application_id].credentials.database.password}}"
database_type: "postgres"
listmonk_settings:
- key: "app.root_url"
value: '"https://{{ domains[application_id] }}"'
# OIDC integration (conditional)
- key: "security.oidc"
value: >-
{{ {
"enabled": True,
"client_id": oidc.client.id,
"provider_url": oidc.client.issuer_url,
"client_secret": oidc.client.secret
} | to_json }}
when: applications[application_id].features.oidc | bool
# hCaptcha toggles and credentials\ n - key: "security.enable_captcha"
value: "true"
- key: "security.captcha_key"
value: '"{{ applications[application_id].credentials.hcaptcha.site_key }}"'
- key: "security.captcha_secret"
value: '"{{ applications[application_id].credentials.hcaptcha.secret }}"'