Skip to content

Configuration Reference

Self-hosting availability

Self-hosting is available on request. The source repository is not public. Contact hello@wanepia.com to get access.

All services are configured through environment variables. No config files are required.

API service (cmd/api)

Variable Default Description
DATABASE_URL postgres://catalog:catalog@localhost:5432/catalog?sslmode=disable PostgreSQL connection string
NATS_URL nats://localhost:4222 NATS server URL
VALKEY_URL redis://localhost:6379/0 Valkey / Redis URL (session cache)
PORT 8080 HTTP listen port
LOG_LEVEL info Log level: debug, info, warn, error
CORS_ORIGINS http://localhost:3000 Comma-separated list of allowed CORS origins
APP_URL http://localhost:3000 Frontend base URL (used in email links)
RESEND_API_KEY (empty) Resend API key for transactional email
RESEND_FROM_EMAIL noreply@example.com Sender address for emails
RESEND_FROM_NAME Catalog Sender name for emails
BOOTSTRAP_EMAIL (empty) Email for the first tenant on empty DB
BOOTSTRAP_NAME (empty) Name for the bootstrap tenant

Generator service (cmd/generator)

Variable Default Description
DATABASE_URL postgres://catalog:catalog@localhost:5432/catalog?sslmode=disable PostgreSQL connection string
NATS_URL nats://localhost:4222 NATS server URL
LOG_LEVEL info Log level
TICK_INTERVAL_SECONDS 10 How often the generator scans for due checks

Worker service (cmd/worker)

Variable Default Description
DATABASE_URL postgres://catalog:catalog@localhost:5432/catalog?sslmode=disable PostgreSQL connection string
NATS_URL nats://localhost:4222 NATS server URL
LOG_LEVEL info Log level

Notify service (cmd/notify)

Variable Default Description
DATABASE_URL postgres://catalog:catalog@localhost:5432/catalog?sslmode=disable PostgreSQL connection string
NATS_URL nats://localhost:4222 NATS server URL
LOG_LEVEL info Log level

Migrate service (cmd/migrate)

Variable Default Description
DATABASE_URL postgres://catalog:catalog@localhost:5432/catalog?sslmode=disable PostgreSQL connection string
MIGRATIONS_DIR /migrations Path to the SQL migration files
BOOTSTRAP_EMAIL (empty) Email for the first tenant (only used when tenants table is empty)
BOOTSTRAP_NAME (empty) Name for the bootstrap tenant

Production .env example

# Postgres
DATABASE_URL=postgres://catalog:supersecret@postgres:5432/catalog?sslmode=disable

# NATS
NATS_URL=nats://nats:4222

# Valkey / Redis
VALKEY_URL=redis://valkey:6379/0

# API
PORT=8080
CORS_ORIGINS=https://app.example.com
APP_URL=https://app.example.com

# Email (Resend)
RESEND_API_KEY=re_...
RESEND_FROM_EMAIL=noreply@example.com
RESEND_FROM_NAME=Wanepia

# Bootstrap (only matters on first run)
BOOTSTRAP_EMAIL=admin@example.com
BOOTSTRAP_NAME=Acme Corp

Never commit .env

The .env file contains secrets. It is listed in .gitignore — do not override this.

Security notes

  • API keys are stored as SHA-256 hashes; the raw key is never persisted after creation.
  • Passwords (tenant login) are hashed with bcrypt.
  • All tables have tenant_id — every query is scoped to the authenticated tenant's ID.
  • The disabled flag on a tenant blocks both API key auth and password login immediately.