From 4e1d53faaff6ca0179957308bef0365ed89b662e Mon Sep 17 00:00:00 2001 From: Elouin Date: Tue, 30 Jul 2024 21:07:46 +0200 Subject: [PATCH] make config templated --- pillar.example | 22 ++++++++++++++++ pretalx-docker/pretalx.cfg.jinja | 44 ++++++++++++-------------------- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/pillar.example b/pillar.example index e69de29..6b30261 100644 --- a/pillar.example +++ b/pillar.example @@ -0,0 +1,22 @@ +pretalx: + filesystem: + data: /var/pretalx/data + static: /var/pretalx/static + site: + debug: False + url: https://pretalx.mydomain.com + database: + backend: postgresql + name: pretalx + user: False + password: ChangeMe + host: localhost + port: 5432 + mail: + from: admin@localhost + host: localhost + port: 25 + user: admin + password: ChangeMe + tls: False + ssl: True diff --git a/pretalx-docker/pretalx.cfg.jinja b/pretalx-docker/pretalx.cfg.jinja index 41746de..1fb167f 100644 --- a/pretalx-docker/pretalx.cfg.jinja +++ b/pretalx-docker/pretalx.cfg.jinja @@ -1,34 +1,24 @@ -# This is an example pretalx configuration file. -# Documentation: https://docs.pretalx.org/administrator/configure.html - [filesystem] -data = /var/pretalx/data -static = /var/pretalx/static +data = {{ salt['pillar.get']('pretalx:filesystem:data', '/var/pretalx/data') }} +static = {{ salt['pillar.get']('pretalx:filesystem:static', '/var/pretalx/static') }} [site] -debug = False -url = https://pretalx.mydomain.com +debug = {{ salt['pillar.get']('pretalx:site:debug', 'False') }} +url = {{ salt['pillar.get']('pretalx:site:url', 'https://pretalx.mydomain.com') }} [database] -# For MySQL, replace with "mysql" -backend = postgresql -name = pretalx -user = pretalx -# For MySQL, enter the user password. For PostgreSQL on the same host, -# we don't need one because we can use peer authentification if our -# PostgreSQL user matches our unix user. -password = Change this in production or you're going to have a bad time -# For MySQL, you can use a local socket, e.g. /var/run/mysqld/mysqld.sock -# For a remote host, supply an IP address -# For local postgres authentication, you can leave the host empty -host = localhost -port = 5432 +backend = {{ salt['pillar.get']('pretalx:database:backend', 'postgresql') }} +name = {{ salt['pillar.get']('pretalx:database:name', 'pretalx') }} +user = {{ salt['pillar.get']('pretalx:database:user', 'False') }} +password = {{ salt['pillar.get']('pretalx:database:password', 'ChangeMe') }} +host = {{ salt['pillar.get']('pretalx:database:host', 'localhost') }} +port = {{ salt['pillar.get']('pretalx:database:port', '5432') }} [mail] -from = admin@localhost -host = localhost -port = 25 -user = admin -password = Change this in production or you're going to have a bad time -tls = False -ssl = True +from = {{ salt['pillar.get']('pretalx:mail:from', 'admin@localhost') }} +host = {{ salt['pillar.get']('pretalx:mail:host', 'localhost') }} +port = {{ salt['pillar.get']('pretalx:mail:port', '25') }} +user = {{ salt['pillar.get']('pretalx:mail:user', 'admin') }} +password = {{ salt['pillar.get']('pretalx:mail:password', 'ChangeMe') }} +tls = {{ salt['pillar.get']('pretalx:mail:tls', 'False') }} +ssl = {{ salt['pillar.get']('pretalx:mail:ssl', 'True') }}