Skip to main content

Configuration

Two files, two roles​

File (on the server)Read byEffect of a change
~/pch-sig/.env.prodDocker Compose, injected into the container environmentdocker compose -f … up -d --no-deps backend
~/pch-sig/backend/.envcopied into the image (/app/.env), Symfony defaultsimage rebuild required

Precedence rule: a variable present in the container environment wins over /app/.env, even when empty. Check the value actually in use:

docker exec pch_backend php bin/console debug:dotenv

None of these files is in the Git repository. Secrets live in the secrets manager; their rotation is described in docs/ROTATION_SECRETS.md.

Main variables​

VariableWhereRole
APP_ENV, APP_DEBUGcomposeprod, 0
APP_SECRET.env.prodSymfony secret
POSTGRES_USER, POSTGRES_PASSWORD.env.prodpch_sig database
JWT_PASSPHRASE.env.prodJWT key passphrase (backend/config/jwt/, server-specific)
MAILER_USER, MAILER_PASSWORD.env.prodOVH SMTP account noreply@ucp-pch.org; the DSN used is smtp://…@ssl0.ovh.net:587
MAILER_SENDERcomposenoreply@ucp-pch.org
MESSENGER_TRANSPORT_DSNcomposedoctrine://default: queue for e-mails and asynchronous jobs
REDIS_URLcomposeredis://redis:6379
FRONTEND_URL, DEFAULT_URIcomposehttps://bemba.ucp-pch.org (links in e-mails, with /#/)
CORS_ALLOW_ORIGINcomposeallowed domains
ANTHROPIC_API_KEY, CLAUDE_MODELbackend/.envBemba assistant (default model set in services.yaml)
COHERE_API_KEYbackend/.envassistant semantic search, grievance clustering
DOCUMENTATION_BUILD_DIR, DOCUMENTATION_URLcomposeassistant document base (Docusaurus build mounted read-only)
KOBO_API_URL, KOBO_API_TOKENcompose / .env.prodKoboToolbox (per-project accounts can also be set in the application)
SENTRY_DSN.env.proderror reporting
Survey Solutions

The SUSO_* variables are not used: the Survey Solutions connection is read from the survey_solutions_config table, editable from the application.

Frontend​

FileUsed byContent
frontend/.env.development.localnpm startREACT_APP_API_URL=http://localhost:8000/api, "LOCAL" badge
frontend/.env.productionnpm run buildREACT_APP_API_URL=/api, REACT_APP_DOCS_URL=https://docubemba.ucp-pch.org

REACT_APP_* variables are fixed at build time: changing a value means rebuilding and redeploying the frontend.

Frontend Nginx​

~/pch-sig/nginx/frontend.conf is mounted in pch_frontend. It serves the React build (HashRouter, every route returns index.html), caches versioned assets and applies the Content Security Policy (CSP): connect-src limited to the domain, KoboToolbox and Sentry. Any third-party service called from the browser must be added to the CSP.

Configuration inside the application​

Much of the setup is done under Settings, without redeploying: roles and permissions, institutions and assignments, projects and programmes, PMT methods, identifier nomenclature, grievance workflows and deadlines (Workflow & SLA), teams, Kobo and Survey Solutions accounts per project, public website content.

E-mails​

All e-mails are sent asynchronously (Messenger): a request never contacts the SMTP server. Failed messages go to the failed queue:

docker exec pch_backend php bin/console messenger:failed:show
docker exec pch_backend php bin/console messenger:failed:retry # production only

In pre-production, sending fails on purpose (SMTP unreachable): do not retry the failed queue.

Logging​

Monolog writes to the container's standard error; Promtail collects these logs and ships them to Loki (one-year retention). See Logs.