Files
computer-playbook/roles/web-app-fider/templates/env.j2
kevinveenbirkenbachandClaude Opus 4.8 15e7647d2f refactor(env): central TZ+LANG base included by every role env.j2
New roles/sys-svc-container/templates/env.j2 sets TZ={{ HOST_TIMEZONE }} and LANG=C.UTF-8. Every role env.j2 includes it at the top; it renders via stack_host_template, the same engine that resolves the includes in compose.yml.j2, so it works in both compose and swarm. TZ/LANG are removed from the individual role env.j2 so each value stays single-source.

New lint tests/lint/ansible/test_env_base_include.py verifies every role env.j2 includes the base and never re-sets a base-owned key (keys derived from the base file).

mattermost and gitea meta/volumes.yml drop the /etc/timezone host-path bind: swarm hard-rejects a task whose bind source is missing on the node (Debian-trixie nodes have no /etc/timezone). TZ now comes from the base env. /etc/localtime bind also dropped; the container timezone follows TZ.

Non-directive comments were removed from the touched env.j2 (banners, restatements, reference URLs, narration) so the changed files pass the comment-lint; only tool directives remain.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 22:13:57 +02:00

25 lines
1.3 KiB
Django/Jinja

{% include 'roles/sys-svc-container/templates/env.j2' %}
BASE_URL={{ lookup('tls', application_id, 'url.base') }}
DATABASE_URL=postgresql://{{ lookup('database', application_id, 'username') }}:{{ lookup('database', application_id, 'password') }}@{{ lookup('database', application_id, 'host') }}:{{ lookup('database', application_id, 'port') }}/{{ lookup('database', application_id, 'name') }}?sslmode=disable
JWT_SECRET={{ (application_id ~ lookup('users', 'administrator').password) | hash('sha256') }}
ALLOW_PRIVATE_NETWORK_TARGETS=true
{% if lookup('objstore', application_id, 'enabled') | bool %}
BLOB_STORAGE=s3
BLOB_STORAGE_S3_BUCKET={{ lookup('objstore', application_id, 'bucket') }}
BLOB_STORAGE_S3_ACCESS_KEY_ID={{ lookup('objstore', application_id, 'access_key') }}
BLOB_STORAGE_S3_SECRET_ACCESS_KEY={{ lookup('objstore', application_id, 'secret_key') }}
BLOB_STORAGE_S3_ENDPOINT_URL={{ lookup('objstore', application_id, 'url') }}
BLOB_STORAGE_S3_REGION={{ lookup('objstore', application_id, 'region') }}
{% endif %}
{% set email = lookup('email', application_id) %}
EMAIL_NOREPLY={{ email['from'] }}
EMAIL_SMTP_HOST={{ email.host }}
EMAIL_SMTP_PORT={{ email.port }}
EMAIL_SMTP_USERNAME={{ email.username }}
EMAIL_SMTP_PASSWORD={{ email.password | dotenv_quote }}
EMAIL_SMTP_ENABLE_STARTTLS={{ email.start_tls | lower }}