Configuration
Manager uses YAML-based configuration with environment variable overrides for flexible deployment across different environments.
Configuration Loading
Configuration is loaded in the following priority order:
config.local.yml- Local overrides (gitignored)config.yml- Fallback configuration (can be committed)- Environment variables -
PFY_prefixed variables
Configuration File
Basic Structure
env: development # Environment: development, production
run_mode: both # Run mode: api, executor, both
port: 8080 # API server port
health_port: 8081 # Health check endpoint port
frontend_dir: ../frontend/dist
proxy_target: http://frontend:5173
db:
host: localhost
port: 5432
user: postgres
password: password
name: productify
sslmode: disable
maxopen: 25
maxidle: 10
maxlifetime: 5m
pocket_id:
host: http://pocketid.localhost
api_key: your-api-key
cron:
backend_heartbeat_timeout: 1m
trigger_check_interval: 1s
dev_user_override:
enabled: true
id: ca53cb60-e72b-47b5-a7a3-9fa48dda681c
email: user@productify.dev
name: Test User
username: testConfiguration Options
Server
| Option | Type | Default | Description |
|---|---|---|---|
env | string | development | Environment mode (development, production) |
run_mode | string | both | Run mode: api, executor, or both |
port | int | 8080 | Main API server port |
health_port | int | 8081 | Health check endpoint port |
frontend_dir | string | - | Path to frontend build directory |
proxy_target | string | - | Development proxy target for frontend |
Database
| Option | Type | Default | Description |
|---|---|---|---|
db.host | string | localhost | Database host |
db.port | int | 5432 | Database port |
db.user | string | postgres | Database user |
db.password | string | postgres | Database password |
db.name | string | postgres | Database name |
db.sslmode | string | disable | SSL mode (disable, require, verify-full) |
db.maxopen | int | 1000 | Maximum open connections |
db.maxidle | int | 100 | Maximum idle connections |
db.maxlifetime | duration | 1h | Connection maximum lifetime |
PocketID Integration
| Option | Type | Default | Description |
|---|---|---|---|
pocket_id.host | string | - | PocketID host URL |
pocket_id.api_key | string | - | PocketID API key |
Cron / Trigger System
| Option | Type | Default | Description |
|---|---|---|---|
cron.backend_heartbeat_timeout | duration | 1m | Backend heartbeat timeout |
cron.trigger_check_interval | duration | 1s | Trigger check interval |
cron.metrics_port | int | 9090 | Prometheus metrics port (executor mode only) |
Executor Metrics
When running in executor mode, Prometheus metrics are exposed on the configured metrics_port (default: 9090) at the /metrics endpoint. These metrics include per-application queue statistics, processing times, and backend dispatch results for autoscaler integration.
Development Overrides
| Option | Type | Default | Description |
|---|---|---|---|
dev_user_override.enabled | bool | false | Enable dev user override |
dev_user_override.id | string | - | User ID |
dev_user_override.email | string | - | User email |
dev_user_override.name | string | - | User name |
dev_user_override.username | string | - | Username |
Development Only
The dev_user_override feature bypasses authentication and should never be enabled in production.
Environment Variables
All configuration options can be overridden using environment variables with the PFY_ prefix:
Examples
# Server
export PFY_ENV=production
export PFY_RUN_MODE=api
export PFY_PORT=8080
export PFY_HEALTH_PORT=8081
# Database
export PFY_DB_HOST=db.example.com
export PFY_DB_PORT=5432
export PFY_DB_USER=dbuser
export PFY_DB_PASSWORD=secret
export PFY_DB_NAME=productify
export PFY_DB_SSLMODE=require
export PFY_DB_MAXOPEN=100
export PFY_DB_MAXIDLE=25
# PocketID
export PFY_POCKET_ID_HOST=https://auth.example.com
export PFY_POCKET_ID_API_KEY=your-api-key
# Cron
export PFY_CRON_BACKEND_HEARTBEAT_TIMEOUT=2m
export PFY_CRON_TRIGGER_CHECK_INTERVAL=1s
export PFY_CRON_METRICS_PORT=9090Naming Convention
Environment variables follow this pattern:
- Prefix:
PFY_ - Uppercase with underscores
- Nested keys separated by
_
Example: pocket_id.api_key → PFY_POCKET_ID_API_KEY
Run Modes
Manager supports three run modes for flexible deployment:
both (Default)
Runs both API server and trigger executor in a single process. Ideal for development and small deployments.
run_mode: bothapi
Runs only the API server without the trigger executor. Use for horizontal scaling of API instances.
run_mode: apiexecutor
Runs only the trigger executor without the API server. Use for dedicated cron job processing.
run_mode: executorConfiguration Examples
Development
env: development
run_mode: both
port: 8080
db:
host: localhost
port: 5432
user: postgres
password: password
dbname: productify
dev_user_override:
enabled: true
email: dev@localhostProduction (API Instance)
env: production
run_mode: api
port: 8080
db:
host: db.prod.internal
port: 5432
user: manager_api
password: ${DB_PASSWORD}
dbname: productify
sslmode: verify-full
max_open_conns: 50
pocket_id:
host: https://auth.company.com
api_key: ${POCKET_ID_KEY}Production (Executor Instance)
env: production
run_mode: executor
db:
host: db.prod.internal
port: 5432
user: manager_executor
password: ${DB_PASSWORD}
dbname: productify
sslmode: verify-full
cron:
backend_heartbeat_timeout: 2m
trigger_check_interval: 1s
metrics_port: 9090Accessing Metrics:
# Prometheus metrics for autoscaler
curl http://executor-host:9090/metricsSecurity Best Practices
- Never commit
config.local.yml- It's gitignored for a reason - Use environment variables for sensitive data in production
- Enable SSL for database connections in production (
sslmode: verify-full) - Disable dev_user_override in production
- Use strong passwords and rotate credentials regularly
- Limit database connections based on your infrastructure
See Also
- Production Deployment - Production deployment guide
- Docker Compose Deployment - Development setup
- Manager Deployment - Complete deployment reference