From 965af4fbaa0de16acd93b13fa2c7308cd1bdee55 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 22 Apr 2025 16:01:47 +0200 Subject: [PATCH] Added auto admin creation and oidc draft for listmonk --- roles/docker-listmonk/templates/env.j2 | 18 +++++++++++++++++- templates/vars/applications.yml.j2 | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/roles/docker-listmonk/templates/env.j2 b/roles/docker-listmonk/templates/env.j2 index 2a2aefb7..f0a6ff69 100644 --- a/roles/docker-listmonk/templates/env.j2 +++ b/roles/docker-listmonk/templates/env.j2 @@ -1 +1,17 @@ -TZ=Etc/UTC \ No newline at end of file +TZ=Etc/UTC + +# Administrator setup + +LISTMONK_ADMIN_USER={{users.administrator.username}} +LISTMONK_ADMIN_PASSWORD={{users.administrator.password}} + +{% if applications[application_id].features.oidc | bool %} +################################### +# OpenID Connect settings +################################### + +LISTMONK_security__oidc__enabled=true +LISTMONK_security__oidc__provider_url={{ oidc.client.discovery_document }} +LISTMONK_security__oidc__client_id={{oidc.client.id}} +LISTMONK_security__oidc__client_secret={{oidc.client.secret}} +{% endif %} \ No newline at end of file diff --git a/templates/vars/applications.yml.j2 b/templates/vars/applications.yml.j2 index 8ba3488a..1233dde4 100644 --- a/templates/vars/applications.yml.j2 +++ b/templates/vars/applications.yml.j2 @@ -272,6 +272,7 @@ defaults_applications: users: administrator: username: "{{users.administrator.username}}" # Listmonk administrator account username + password: "{{users.administrator.password}}" # Password to initialized Listmonk administrator with public_api_activated: False # Security hole. Can be used for spaming version: "latest" # Docker Image version setup: false # Set true in inventory file to execute the setup and initializing procedures @@ -280,6 +281,7 @@ defaults_applications: 'css': true, 'iframe': true, 'database': true, + 'oidc': true, }) }}{% raw %} mailu: