Skip to content

Production Guide ​

Use this checklist before exposing a GoForge service to production traffic.


Security & Configuration Checklist ​

SettingProduction ValueWhy
APP_KEYUnique 32-byte base64 secret (goforge gen:key)Validated via constant-time compare; serve fails closed if empty.
APP_DEBUGfalseEnables gin.ReleaseMode and disables unauthenticated /api/docs* bypass.
CORS_ALLOWED_ORIGINSExact origins (e.g. https://app.example.com)Prevents wildcard *; enables Access-Control-Allow-Credentials: true safely.
TRUSTED_PROXIESExplicit 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_ENABLEDtrue (or terminate TLS at LB)Enforces TLS 1.2+ on HTTP and TLS credentials on gRPC.
RATE_LIMIT_PER_MINUTEe.g. 120Bounded per-IP token bucket (10k cap, 3m idle TTL).
DB_SSL_MODErequire / verify-full (Postgres)Encrypts database traffic.
DB_MAX_OPEN_CONNS / IDLETuned to DB capacity (defaults 25 / 5)Prevents connection exhaustion.
LOG_FORMAT / LOG_COLORjson / never + --no-tuiStructured 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: 45

For gRPC workloads, use the built-in grpc_health_v1 health service (SERVING / NOT_SERVING).

Released under the Apache-2.0 License.