Production Guide
Use this checklist before exposing a GoForge service to production traffic.
Security & Configuration Checklist
| Setting | Production Value | Why |
|---|---|---|
APP_KEY | Unique 32-byte base64 secret (goforge gen:key) | Validated via constant-time compare; serve fails closed if empty. |
APP_DEBUG | false | Enables gin.ReleaseMode and disables unauthenticated /api/docs* bypass. |
CORS_ALLOWED_ORIGINS | Exact origins (e.g. https://app.example.com) | Prevents wildcard *; enables Access-Control-Allow-Credentials: true safely. |
TRUSTED_PROXIES | Explicit reverse-proxy CIDRs (e.g. 10.0.0.0/8) | Empty trusts no X-Forwarded-For headers, preventing IP spoofing on rate limits. |
TLS_ENABLED / GRPC_TLS_ENABLED | true (or terminate TLS at LB) | Enforces TLS 1.2+ on HTTP and TLS credentials on gRPC. |
RATE_LIMIT_PER_MINUTE | e.g. 120 | Bounded per-IP token bucket (10k cap, 3m idle TTL). |
DB_SSL_MODE | require / verify-full (Postgres) | Encrypts database traffic. |
DB_MAX_OPEN_CONNS / IDLE | Tuned to DB capacity (defaults 25 / 5) | Prevents connection exhaustion. |
LOG_FORMAT / LOG_COLOR | json / never + --no-tui | Structured logs for log aggregators; disables TUI & ANSI escapes. |
Kubernetes Probes & Graceful Shutdown
Configure liveness, readiness, and termination grace period to align with GoForge's 10s server stop + 30s EventBus/Database drain:
yaml
livenessProbe:
httpGet:
path: /health
port: 3000
initialDelaySeconds: 5
periodSeconds: 15
readinessProbe:
httpGet:
path: /ready
port: 3000
initialDelaySeconds: 5
periodSeconds: 10
terminationGracePeriodSeconds: 45For gRPC workloads, use the built-in grpc_health_v1 health service (SERVING / NOT_SERVING).
