Files
Sauci/infra/backend/.env.production.example
T
jjbrunton 5c973c4ac5 perf(api): bound worker pools and add telemetry
Share one configured PostgreSQL pool across worker repositories and make API and worker connection budgets explicit.

Add privacy-safe aggregate request, query, pool, sync, and outbox telemetry, a loopback-only representative load fixture, bounded worker shutdown, and focused regression and integration coverage.

Document the database-wide budget formula and defer pg_stat_statements activation to a reviewed migration and planned restart.
2026-08-29 22:43:27 +01:00

40 lines
1.8 KiB
Bash

# Copy these names into Dokploy's environment configuration. Do not commit values.
POSTGRES_DB=sauci
POSTGRES_USER=sauci
POSTGRES_PASSWORD=generate-a-long-random-password
DATABASE_URL=postgresql://sauci:URL_ENCODED_PASSWORD@postgres:5432/sauci
# Keep this total below PostgreSQL max_connections:
# (API replicas * API_DATABASE_POOL_MAX) + (worker replicas * WORKER_DATABASE_POOL_MAX) + migration/admin headroom.
API_DATABASE_POOL_MAX=10
WORKER_DATABASE_POOL_MAX=4
DATABASE_POOL_IDLE_TIMEOUT_MS=30000
DATABASE_POOL_CONNECTION_TIMEOUT_MS=10000
# Hosted Supabase Auth only. The service-role key is used solely by the
# server-side Auth Admin endpoint for account deletion and admin identity
# enrichment. It belongs on the API only, never the worker, MCP, or a client.
SUPABASE_AUTH_URL=https://your-project.supabase.co
SUPABASE_AUTH_AUDIENCE=authenticated
SUPABASE_AUTH_SERVICE_ROLE_KEY=set-a-server-only-auth-admin-key
# Opaque standalone admin API credential. Configure both values together.
# The UUID must identify an active least-privilege admin_users row. MCP receives
# the same token as SAUCI_ADMIN_API_TOKEN, not this user ID and no Supabase key.
ADMIN_API_SERVICE_TOKEN=generate-at-least-32-random-characters
ADMIN_API_SERVICE_USER_ID=set-to-an-active-migrated-admin-profile-uuid
REVENUECAT_API_KEY=set-the-secret-revenuecat-api-key
REVENUECAT_ENTITLEMENT_ID=Sauci Pro
REVENUECAT_WEBHOOK_SECRET=generate-a-long-random-webhook-secret
MEDIA_SIGNING_SECRET=generate-at-least-32-random-characters
MEDIA_PUBLIC_BASE_URL=https://api.example.com
# Operations worker. Discord is optional.
CLASSIFIER_ENABLED=true
OPENROUTER_API_KEY=set-the-secret-openrouter-key
CLASSIFIER_MODEL=openai/gpt-4o
ADMIN_PRIVATE_KEY_JWK=set-the-private-jwk-json-used-for-message-moderation
DISCORD_WEBHOOK_URL=
WORKER_POLL_INTERVAL_MS=30000
WORKER_BATCH_SIZE=25