System
Configuration
Use .env.example as the configuration reference. The values below describe host-run Bun processes with the supplied local Docker services.
Process connections
| Variable | Purpose / local default |
|---|---|
DATABASE_URL | Primary PostgreSQL on 127.0.0.1:15432/webhook_platform. |
REDIS_URL | redis://localhost:6379 for limits and circuits. |
AWS_REGION | Region containing your SQS queue and S3 bucket. |
SQS_QUEUE_URL | Your real queue URL; replace the example account placeholder. |
S3_BUCKET_NAME | Your configured payload/archive bucket. |
API_PORT | 3000 by default. |
RECEIVER_URL | One destination for the worker; local default is http://127.0.0.1:4000/webhook. |
RECEIVER_PORT | 4000 for the included test receiver. |
RECEIVER_TENANT_ID / RECEIVER_HMAC_SECRET | Trusted tenant and matching signing secret for the test receiver. |
Configure AWS credentials server-side. Do not expose database URLs, AWS credentials or signing secrets through NEXT_PUBLIC_* variables.
Physical read replica
bun run setup:replicaThe setup starts the optional PostgreSQL replica on port 15433 and creates a dedicated reader. Configure the host connection:
READ_REPLICA_DATABASE_URL=postgresql://waybill_reader:local-reader-only@127.0.0.1:15433/webhook_platformThe helper verifies pg_is_in_recovery() inside a read-only transaction and rejects a primary. Container networking uses different hostnames from host-run Bun processes. A managed hosted replica remains deployment work.
Worker and rate defaults
| Variable | Default |
|---|---|
MAX_DELIVERY_ATTEMPTS | 8 attempts. |
SQS_MAX_MESSAGE_BYTES | 262144 payload bytes before S3 claim-check. |
INGESTION_RATE_LIMIT_CAPACITY / DELIVERY_RATE_LIMIT_CAPACITY | 10 tokens each. |
INGESTION_RATE_LIMIT_REFILL_PER_SECOND / DELIVERY_RATE_LIMIT_REFILL_PER_SECOND | 10 tokens per second each. |
The environment template also lists CIRCUIT_BREAKER_FAILURE_THRESHOLD and CIRCUIT_BREAKER_COOLDOWN_MS. The current worker does not read those variables: its circuit module uses defaults of 5 failures and 30000 ms.