feat(postgres): add split_postgres_connections filter and average pool fact

Compute POSTGRES_ALLOWED_AVG_CONNECTIONS once and propagate to app roles (gitlab, mastodon, listmonk, matrix, pretix, mobilizon, openproject, discourse). Fix docker-compose postgres command (-c flags split). Add unit tests. Minor env/locale tweaks and includes.

Conversation: https://chatgpt.com/share/68b48e72-cc28-800f-9c21-270cbc17d82a
This commit is contained in:
2025-08-31 20:04:14 +02:00
parent b3dfb8bf22
commit 5f66c1a622
18 changed files with 249 additions and 34 deletions

View File

@@ -6,15 +6,18 @@
# Please refer to our documentation to see all possible variables:
# https://www.openproject.org/docs/installation-and-operations/configuration/environment/
#
OPENPROJECT_HTTPS=true
OPENPROJECT_HTTPS={{ WEB_PORT == 433 | string | lower }}
OPENPROJECT_HOST__NAME={{ domains | get_domain(application_id) }}
OPENPROJECT_RAILS__RELATIVE__URL__ROOT=
IMAP_ENABLED=false
POSTGRES_PASSWORD="{{ database_password }}"
DATABASE_URL="{{ database_url_full }}?pool=20&encoding=unicode&reconnect=true"
RAILS_MIN_THREADS=4
RAILS_MAX_THREADS=16
OPENPROJECT_HSTS=true
OPENPROJECT_HSTS={{ WEB_PORT == 433 | string | lower }}
RAILS_CACHE_STORE: "memcache"
OPENPROJECT_CACHE__MEMCACHE__SERVER: "cache:11211"
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: ""
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: ""
# Database
POSTGRES_PASSWORD="{{ database_password }}"
DATABASE_URL="{{ database_url_full }}?pool=20&encoding=unicode&reconnect=true"
DB_POOL="{{ POSTGRES_ALLOWED_AVG_CONNECTIONS }}"
RAILS_MAX_THREADS="{{ POSTGRES_ALLOWED_AVG_CONNECTIONS }}"
RAILS_MIN_THREADS=4