Etebase: Add etebase-server.ini template.

Some environment variables set in docker compose file (TIME_ZONE,
ALLOWED_HOSTS) are used only if
the etebase-server.ini file doesn't exist, which can be misleading.

If we change these variables after the etebase-server.ini file has been
generated, the settings won't be updated in the config file.

Templating this file allows changing these settings after the first run.
This commit is contained in:
Viyurz 2024-02-23 12:41:39 +01:00
parent 0460ac0840
commit 6a4dd7cd2b
Signed by: Viyurz
SSH key fingerprint: SHA256:IskOHTmhHSJIvAt04N6aaxd5SZCVWW1Guf9tEcxIMj8
3 changed files with 26 additions and 2 deletions

View file

@ -11,6 +11,14 @@
group: "{{ ansible_env['USER'] }}"
mode: '640'
- name: Template etebase-server.ini to project directory
template:
src: etebase-server.ini
dest: "{{ etebase_project_dir }}/etebase-server.ini"
owner: "{{ ansible_env['USER'] }}"
group: "{{ ansible_env['USER'] }}"
mode: '644'
- name: "Create directory {{ volumes['etebase_datadir'] }} with correct permissions"
file:
path: "{{ volumes['etebase_datadir'] }}"

View file

@ -6,10 +6,9 @@ services:
user: {{ users['etebase'] }}:{{ users['etebase'] }}
environment:
SERVER: http
ALLOWED_HOSTS: etebase.{{ domain }}
AUTO_UPDATE: 'true'
TIME_ZONE: {{ timezone }}
ports:
- 127.0.0.1:{{ ports['etebase'] }}:3735
volumes:
- {{ volumes['etebase_datadir'] }}:/data
- ./etebase-server.ini:/data/etebase-server.ini

View file

@ -0,0 +1,17 @@
[global]
secret_file = /data/secret.txt
debug = false
static_root = /srv/etebase/static
static_url = /static/
media_root = /data/media
media_url = /user-media/
language_code = en-us
time_zone = {{ timezone }}
[allowed_hosts]
allowed_host1 = etebase.{{ domain }}
[database]
engine = django.db.backends.sqlite3
name = /data/db.sqlite3