Files
kevinveenbirkenbachandClaude Opus 4.8 7f6ff017c8 fix(akaunting): install via mode-symmetric one-shot instead of a persistent env flag
AKAUNTING_SETUP=true in the rendered env re-ran the installer on every container recreation between deploys (restore drill, repair restart) and crash-looped against the installed database. The flag is gone from the env entirely: compose now installs like swarm through an ephemeral one-shot (stop, compose run --rm -e AKAUNTING_SETUP=true akaunting --no-start, up --force-recreate), included mode-agnostically from tasks/setup/{{ DEPLOYMENT_MODE }}.yml with the swarm job renamed into the same folder. The first-run gate reads the marker stat directly instead of a set_fact indirection.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 14:44:35 +02:00

63 lines
2.3 KiB
Django/Jinja

{% include 'roles/sys-svc-container/templates/env.j2' %}
APP_URL={{ AKAUNTING_URL }}
LOCALE={{ HOST_LL }}
TIMEZONE={{ HOST_TIMEZONE }}
APP_DEBUG={{ MODE_DEBUG | lower }}
APP_ENV={{ ENVIRONMENT }}
DB_HOST={{ lookup('database', application_id, 'host') }}
DB_NAME={{ lookup('database', application_id, 'name') }}
DB_USERNAME={{ lookup('database', application_id, 'username') }}
DB_PASSWORD={{ lookup('database', application_id, 'password') | dotenv_quote }}
DB_PORT={{ lookup('database', application_id, 'port') }}
DB_CONNECTION=mysql
DB_PREFIX=asd_
TRUSTED_PROXIES=*
TRUSTED_HEADERS=X_FORWARDED_FOR,X_FORWARDED_HOST,X_FORWARDED_PORT,X_FORWARDED_PROTO
COMPANY_NAME={{ AKAUNTING_COMPANY_NAME }}
COMPANY_EMAIL={{ AKAUNTING_COMPANY_EMAIL }}
APP_KEY={{ AKAUNTING_APP_KEY }}
ADMIN_EMAIL={{ AKAUNTING_ADMIN_EMAIL }}
ADMIN_PASSWORD={{ AKAUNTING_ADMIN_PASSWORD | dotenv_quote }}
CACHE_DRIVER={{ AKAUNTING_CACHE_DRIVER }}
SESSION_DRIVER={{ 'redis' if AKAUNTING_CACHE_DRIVER == 'redis' else 'database' }}
QUEUE_CONNECTION={{ 'sync' if AKAUNTING_CACHE_DRIVER == 'file' else AKAUNTING_CACHE_DRIVER }}
{% if AKAUNTING_CACHE_DRIVER == 'redis' %}
REDIS_CLIENT=phpredis
REDIS_HOST={{ lookup('engine', 'redis', application_id, 'host') }}
REDIS_PASSWORD={{ lookup('engine', 'redis', application_id, 'password') | dotenv_quote }}
REDIS_PORT={{ lookup('engine', 'redis', application_id, 'port') }}
{% endif %}
{% if lookup('objstore', application_id, 'enabled') | bool %}
FILESYSTEM_DISK=s3
FILESYSTEM_CLOUD=s3
MEDIABLE_DEFAULT_DISK=s3
AWS_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') }}
AWS_DEFAULT_REGION={{ lookup('objstore', application_id, 'region') }}
AWS_ENDPOINT={{ lookup('objstore', application_id, 'url') }}
AWS_USE_PATH_STYLE_ENDPOINT=true
{% endif %}
{% set email = lookup('email', application_id) %}
{% if email.enabled | bool %}
MAIL_MAILER={{ 'smtp' if email.smtp else 'sendmail' }}
MAIL_HOST={{ email.host }}
MAIL_PORT={{ email.port }}
MAIL_USERNAME={{ email.username }}
MAIL_PASSWORD={{ email.password | dotenv_quote }}
MAIL_ENCRYPTION={{ email.tls | ternary("tls","null") }}
MAIL_FROM_ADDRESS={{ AKAUNTING_COMPANY_EMAIL }}
MAIL_FROM_NAME={{ AKAUNTING_COMPANY_NAME }}
{% endif %}