Files
computer-playbook/roles/web-app-penpot/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

71 lines
2.8 KiB
Django/Jinja

{% include 'roles/sys-svc-container/templates/env.j2' %}
PENPOT_FLAGS={{ PENPOT_FLAGS | trim }}
PENPOT_PUBLIC_URI={{ PENPOT_PUBLIC_URI }}
PENPOT_SECRET_KEY={{ PENPOT_SECRET_KEY | dotenv_quote }}
PENPOT_TELEMETRY_ENABLED=false
PENPOT_BACKEND_URI={{ PENPOT_BACKEND_URI }}
PENPOT_EXPORTER_URI={{ PENPOT_EXPORTER_URI }}
PENPOT_DATABASE_URI={{ PENPOT_DATABASE_URI }}
PENPOT_DATABASE_USERNAME={{ PENPOT_DATABASE_USERNAME }}
PENPOT_DATABASE_PASSWORD={{ PENPOT_DATABASE_PASSWORD | dotenv_quote }}
PENPOT_DATABASE_MAX_POOL_SIZE={{ PENPOT_DATABASE_MAX_POOL_SIZE }}
PENPOT_REDIS_URI={{ PENPOT_REDIS_URI }}
{% if lookup('objstore', application_id, 'enabled') | bool %}
PENPOT_ASSETS_STORAGE_BACKEND=assets-s3
PENPOT_STORAGE_ASSETS_S3_ENDPOINT={{ lookup('objstore', application_id, 'url') }}
PENPOT_STORAGE_ASSETS_S3_REGION={{ lookup('objstore', application_id, 'region') }}
PENPOT_STORAGE_ASSETS_S3_BUCKET={{ lookup('objstore', application_id, 'bucket') }}
AWS_ACCESS_KEY_ID={{ lookup('objstore', application_id, 'access_key') }}
AWS_SECRET_ACCESS_KEY={{ lookup('objstore', application_id, 'secret_key') }}
{% else %}
PENPOT_ASSETS_STORAGE_BACKEND=assets-fs
PENPOT_STORAGE_ASSETS_FS_DIRECTORY={{ PENPOT_ASSETS_FS_DIRECTORY }}
{% endif %}
{% set email = lookup('email', application_id) %}
{% if email.enabled | bool %}
PENPOT_SMTP_ENABLED={{ email.enabled | string | lower }}
PENPOT_SMTP_DEFAULT_FROM={{ email.from }}
PENPOT_SMTP_DEFAULT_REPLY_TO={{ email.from }}
PENPOT_SMTP_HOST={{ email.host }}
PENPOT_SMTP_PORT={{ email.port }}
PENPOT_SMTP_USERNAME={{ email.username }}
PENPOT_SMTP_PASSWORD={{ email.password | dotenv_quote }}
PENPOT_SMTP_TLS={{ email.tls | lower }}
PENPOT_SMTP_SSL={{ email.ssl | default(false) | lower }}
{% endif %}
{% if PENPOT_SSO_ENABLED | bool %}
PENPOT_OIDC_CLIENT_ID={{ PENPOT_OIDC_CLIENT_ID }}
PENPOT_OIDC_CLIENT_SECRET={{ PENPOT_OIDC_CLIENT_SECRET | dotenv_quote }}
PENPOT_OIDC_BASE_URI={{ PENPOT_OIDC_BASE_URI }}
PENPOT_OIDC_AUTH_URI={{ PENPOT_OIDC_AUTH_URI }}
PENPOT_OIDC_TOKEN_URI={{ PENPOT_OIDC_TOKEN_URI }}
PENPOT_OIDC_USER_URI={{ PENPOT_OIDC_USER_URI }}
PENPOT_OIDC_SCOPES={{ PENPOT_OIDC_SCOPES }}
PENPOT_OIDC_EMAIL_ATTR=email
PENPOT_OIDC_NAME_ATTR=name
PENPOT_SSRF_ALLOWED_HOSTS={{ PENPOT_SSRF_ALLOWED_HOSTS }}
{% endif %}
{% if PENPOT_LDAP_ENABLED | bool %}
PENPOT_LDAP_HOST={{ PENPOT_LDAP_HOST }}
PENPOT_LDAP_PORT={{ PENPOT_LDAP_PORT }}
PENPOT_LDAP_SSL={{ ((LDAP.SERVER.SECURITY | upper) == 'SSL') | string | lower }}
PENPOT_LDAP_STARTTLS={{ ((LDAP.SERVER.SECURITY | upper) == 'TLS') | string | lower }}
PENPOT_LDAP_BASE_DN={{ PENPOT_LDAP_BASE_DN }}
PENPOT_LDAP_BIND_DN={{ PENPOT_LDAP_BIND_DN }}
PENPOT_LDAP_BIND_PASSWORD={{ PENPOT_LDAP_BIND_PASSWORD | dotenv_quote }}
PENPOT_LDAP_ATTRS_USERNAME={{ PENPOT_LDAP_ATTRS_USERNAME }}
PENPOT_LDAP_ATTRS_EMAIL={{ PENPOT_LDAP_ATTRS_EMAIL }}
PENPOT_LDAP_ATTRS_FULLNAME={{ PENPOT_LDAP_ATTRS_FULLNAME }}
{% endif %}