Skip to content

Production Checklist

This checklist is ordered the way you should do it: make traffic arrive safely, make data recoverable, then wire up observability and operations. Every item maps to a real file in the repository.

#ItemDone when
1TLSHTTPS everywhere, HTTP 301s to it
2SecretsADMIN_PASSWORD and POSTGRES_PASSWORD set and strong
3CookiesMASTER_COOKIE_SECURE=true, only over HTTPS
4IsolationPostgres and NATS are not reachable from the internet
5BackupsNightly database dump plus uploads sync, and one restore drill
6ObservabilityPrometheus scrapes 9091, logs shipped, alerts wired
7Site URLsite_url set; sitemap, canonical, and OG use it
8AccountsAdmin password changed, MFA enabled, test accounts removed
9Moderationmoderation_mode, register_mode, and gate rules match policy
10UpgradesYou know how to back up, roll back, and recompute XP

The backend and frontend listen only on internal ports; nginx is the only entry point. The bundled deploy/nginx/nginx.conf already handles the easy-to-miss cases. When writing your own, match these:

PathMust go toWhy
/api/v1/Backend 8080Application API
~ ^/api/v1/(notifications|realtime)/stream$Backend, proxy_buffering off, proxy_read_timeout 3600sSSE; the default 60s read timeout kills idle streams
/swagger/BackendRuntime API docs
= /mcpBackend, proxy_read_timeout 120sJSON-RPC endpoint, not under /api/v1
= /sitemap.xml (six paths)BackendCrawler files are generated by the backend only
/Frontend 3000SSR pages and assets
/healthnginx itselfLoad balancer probe, no upstream

Two more things to set explicitly:

# Uploads: the bundled config does not set this; nginx defaults to 1 MiB and
# would reject requests before the backend sees them.
client_max_body_size 10m; # >= upload_max_size (default 10485760)
# Propagate the correlation id so nginx access logs match backend traces.
proxy_set_header X-Request-ID $request_id;
ItemAction
ADMIN_PASSWORDSet before the first boot; a random value is printed once and easy to lose
POSTGRES_PASSWORD / POSTGRES_USERDo not keep the defaults
MASTER_COOKIE_SECUREKeep true; only plain-HTTP debugging sets false
MFAEnable mfa_totp_enabled under /admin/settings?tab=user and enrol TOTP
SessionsPassword, role, and ban changes revoke sessions; use /admin/sessions when debugging
API keysOff by default (api_key_enabled=false); grant the narrowest scope
Test accountsSeed users are created in dev only
DataWhereBackup
Business dataPostgres (volume feedchamber_pg)Nightly pg_dump, kept 7–30 days
UploadsLocal volume or S3Volume snapshots or object versioning
NATS JetStreamVolume feedchamber_natsRebuildable; losing it drops caches and unconsumed events
终端窗口
docker compose -f deploy/docker-compose.yml exec -T postgres \
pg_dump -U "$POSTGRES_USER" "$POSTGRES_DB" | gzip > "/backup/fc-$(date +%F).sql.gz"

The admin panel can also create backups (/admin/backups); retention follows backup_retention_days (default 30). A backup is only real after a restore: import it into a scratch database quarterly and confirm the site boots, sign-in works, and posts are there.

ItemSetting
MetricsMETRICS_ENABLED=true, METRICS_PORT=9091; never publish it
Prometheusdeploy/prometheus.yml works as-is; rules in deploy/prometheus/rules/
LogsLOG_FORMAT=json, LOG_OUTPUT=stderr, shipped by the container runtime
Correlationtrace_id, span_id, route, latency_ms; inbound traceparent is reused
Health/api/v1/health (non-2xx when dependencies fail), nginx /health
Suggested alerts5xx rate, p95 latency, feedchamber_db_pool_wait_count_total, feedchamber_ratelimit_rejections_total, feedchamber_nats_connected

The full metric catalogue is in Observability.

  1. Set https://your-domain in the admin site settings (or SITE_URL as a fallback)
  2. Confirm /sitemap.xml emits absolute URLs, not localhost:8080
  3. Submit the sitemap to Google Search Console and Baidu, filling in the verification codes
  4. Keep user_profile_indexable=false unless profiles should be indexed
  5. Set og_image; otherwise the logo is used

Without site_url, the site works but the sitemap advertises unreachable URLs — traffic looks fine and nothing gets indexed.

SettingRecommendation
register_modeall or email for public sites; invite for closed groups; approve when every account needs review
moderation_modeasync by default; manual for high risk; external when an external service is wired
Gate rules/admin/gates: build rules for new-user links, TL0 posting, etc.; simulate before enabling
Rate limitingrate_limit_enabled is off by default; enable the global per-IP ceiling for public sites
MCPmcp_enabled is off by default; enable it only for trusted clients and turn on write tools individually
  • The backend is stateless (sessions live in the database plus NATS KV): add replicas without sticky sessions
  • Uploads must be on shared storage or S3, otherwise replicas serve different images
  • Upgrade: backup, pull, up -d --build; AutoMigrate only adds, so rolling back the image is safe
  • Destructive changes and manual migrations: Upgrades and migrations
终端窗口
curl -sI https://your-domain/ | head -1 # 200
curl -s https://your-domain/api/v1/health # code: 0
curl -s https://your-domain/sitemap.xml | head -c 200 # absolute URLs
curl -sI https://your-domain/api/v1/notifications/stream # 200, stays open

Then walk through: register → sign in → post → comment → notification arrives → approve in the admin panel → sign out. All six, and you are live.