Skip to content

Configuration

nitrohook is configured entirely through environment variables.

VariableDefaultDescription
DATABASE_URLpostgres://nitrohook:nitrohook@localhost:5432/nitrohook?sslmode=disablePostgreSQL connection string
REDIS_URLredis://localhost:6379Redis connection string
PORT8080HTTP server port
WORKER_CONCURRENCY4Number of concurrent stream consumers per worker
MAX_RETRIES5Maximum delivery attempts before marking as failed
RETRY_BASE_DELAY5sBase delay for exponential backoff (Go duration format)
DELIVERY_TIMEOUT10sHTTP timeout for outbound webhook requests
POLL_INTERVAL30sHow often the worker polls for missed pending deliveries and retries

The API server loads a .env file from the working directory if present:

Terminal window
DATABASE_URL=postgres://nitrohook:nitrohook@localhost:5432/nitrohook?sslmode=disable
REDIS_URL=redis://localhost:6379
PORT=8080
WORKER_CONCURRENCY=4
MAX_RETRIES=5
RETRY_BASE_DELAY=5s
DELIVERY_TIMEOUT=10s
POLL_INTERVAL=30s

The default docker-compose.yml runs the full stack:

  • postgres — data storage
  • redis — delivery stream queue
  • migrate — runs database migrations on startup
  • api — HTTP server and web UI
  • worker (2 replicas) — fan-out stream consumers
Terminal window
# Start everything
docker compose up -d
# Start only Postgres and Redis (for local Go development)
make docker-up-supporting-svc

Migrations run automatically via the migrate service in Docker Compose. To run them manually:

Terminal window
# Via the API binary
go run ./cmd/api --migrate
# Via the migrate CLI
make migrate-up