Skip to main content

Controller Configuration

The controller requires a PostgreSQL database and a few secrets configured on first startup.

Required Variables

VariableDescription
DATABASE_URLPostgreSQL connection string (e.g. postgresql://user:pass@host:5432/watchwarden)
ADMIN_PASSWORDDashboard login password. Stored as bcrypt hash on first startup. Min 8 characters.
JWT_SECRETJWT signing secret. Stored in DB on first startup. Min 32 characters. Rejects weak values.
ENCRYPTION_KEYAES-256 key for encrypting registry credentials and notification configs. Required on every startup. Min 16 characters.
VariableDefaultDescription
ENCRYPTION_SALTauto-generatedSalt for scrypt key derivation. Set a unique value per deployment. Changing this invalidates all encrypted data.
CORS_ORIGINhttp://localhost:8080Allowed CORS origin. Required when NODE_ENV=production.

Optional Variables

VariableDefaultDescription
PORT3000HTTP/WebSocket server port
HOST0.0.0.0Bind address
NODE_ENVdevelopmentSet to production for secure cookies and CORS enforcement
LOCAL_AGENT_TOKENAuto-register a local agent with this pre-shared token

Quick Setup

Generate all required secrets:

export POSTGRES_PASSWORD=$(openssl rand -base64 32)
export ADMIN_PASSWORD=$(openssl rand -base64 16)
export JWT_SECRET=$(openssl rand -base64 32)
export ENCRYPTION_KEY=$(openssl rand -base64 32)

The controller validates all secrets at startup and refuses to start with weak or missing values.

Prometheus Metrics

The controller exposes a /metrics endpoint in standard Prometheus exposition format. No authentication required (standard for Prometheus scraping).

Available metrics:

MetricTypeDescription
watchwarden_agents_totalgaugeTotal registered agents
watchwarden_agents_onlinegaugeCurrently online agents
watchwarden_containers_totalgaugeTotal monitored containers
watchwarden_containers_updates_availablegaugeContainers with pending updates
watchwarden_containers_excludedgaugeExcluded containers
watchwarden_updates_total{status}counterUpdates by status (success/failed/rolled_back)

Prometheus scrape config example:

scrape_configs:
- job_name: watchwarden
scrape_interval: 30s
static_configs:
- targets: ["controller:3000"]