Production checklist
Go through this list before the first deploy, and again when you add instances, Redis, S3 or mail. Each item links to the page that explains it.
Environment and keys
- [ ]
APP_ENV=production(also the default):db:seed,migrate:refreshandmigrate:freshthen need--force.migrate:rollbackhas no such guard: it runs in production as it does elsewhere. - [ ]
APP_DEBUG=false. WithAPP_ENV=localit shows internal errors' details to clients on the same machine (the debug page); in production the framework ignores it andservelogs a warning, but your own code may read it. - [ ]
APP_KEYgenerated once (key:generate --show), stored as a secret, never committed. Rotating it signs every admin out and ends every JWT sign-in (API tokens stay valid). Keep the old key inAPP_PREVIOUS_KEYSand runkey:reencrypt, then check thatkey:reencrypt --dry-runexits successfully before removing the old key, or secret settings and encrypted columns become unreadable (Rotating APP_KEY). - [ ] Secrets come from the environment or from files (
APP_KEY_FILE,DATABASE_URL_FILE, …: secrets from files), not fromconfig/*.tomlin the repository. - [ ]
APP_URLis the public https URL. It makes session cookiesSecureand is the default allowed origin of the admin panel. - [ ]
auth.secure_cookiesis unset ortrue. Never force it tofalsebehind https.
Admin panel and sign-in
- [ ]
auth.admin_originslists every origin serving the admin panel, nothing else (CSRF). - [ ]
http.trusted_proxieslists only your load balancers, so throttling and the audit log see real client IPs (Client IP and proxies). - [ ]
auth.jwt.enabled = falsewhen no client uses JWT sign-ins. - [ ]
auth.password_reset = trueonly with a mail driver configured: boot fails otherwise (Mail). - [ ] First super admin created with
make:user --super-admin;permission:syncrun after each deploy. - [ ]
settings.mail.update(SMTP settings, test mails) only for administrators;queue.manage(retry, forget, cancel jobs) andschedules.manage(run a schedule now) only for operators. - [ ] Runtime branding: the brand name and logo are public (the sign-in page shows them); only operators may change them; you know the recovery switch (
RUSTCMS_ADMIN__BRANDING=static, then restart) if a branding makes the panel unusable.
Database
- [ ] Migrations run once per deploy (
migrate, thenpermission:sync), with a backup taken first; you know how to go back:migrate:rollbackwith the new binary for your migrations, or the old binary withmigrate --allow-newer(Upgrading). - [ ] MySQL: the database, its tables and
sql_modepass the startup check (MySQL). - [ ]
database.max_connections(10 per process) fits the server's connection limit for every instance and worker process together. - [ ] Database backups include
sessionsonly if you want sessions to survive restores (Backup and restore). - [ ]
audit.retention_daysset to what you must keep, no longer: the audit log holds personal data (IP addresses, emails typed in failed sign-ins), and so do backups that include it. Restrict who can readaudit_logs; ship it elsewhere if it must be tamper-proof.audit.sign_in_failures_per_minute(600) bounds how many failed sign-ins are recorded one by one.
HTTP
- [ ] TLS terminates before the app; HTTP redirects to HTTPS at the proxy.
- [ ]
http.body_limit(1 MiB) andhttp.timeout_secs(30) suit your API; the proxy's request body limit is at leaststorage.max_upload_bytes(10 MiB) plus 64 KiB (the media upload route accepts that much, for the multipart framing). - [ ] WebSocket routes (realtime): the proxy passes
Upgradeand allows long-lived connections, and its access and APM logs drop theSec-WebSocket-Protocolrequest header (it carries the session's CSRF token). The[realtime]limits (open streams per instance and per user, opens per minute, message size) suit your traffic (Configuration). - [ ]
log.json = truewhen a log shipper reads the output.
Several instances and workers
- [ ] Several instances: build with the
redisfeature and set[redis] url(one standalone Redis, oneredis.prefixper deployment) so rate limits are shared; the permission cache, the queue and the schedules need nothing (they follow the database). Media storage must be shared (S3, or one volume mounted by every instance). Without Redis, run one instance (Several instances). - [ ] API mode instances (
serve --api-only) behind the load balancer: the admin path goes to afullinstance; every instance has the sameAPP_URL, key, storage andtrusted_proxies; the pools together fit the database's connection limit. - [ ] Password-hashing and upload concurrency limits are per instance (each bounds its own CPU and disk).
- [ ] Queue workers: decide where they run (
serve, orqueue:workprocesses withqueue.enabled = falseon web instances); clocks synchronized (NTP);queue:failedwatched; job payloads and error messages carry no secrets (Queues). - [ ] The clean-ups of sessions, sign-ins, links and old audit entries (
rustcms.auth-prune), of media (rustcms.media-prune.<disk>) and of exports (rustcms.exports-prune.<disk>) run only inservewith[schedule] enabled: keep the scheduler on at least one instance, or cron them (Data retention).
Storage
- [ ] S3 storage: a private bucket, credentials limited to it, an abort incomplete multipart uploads lifecycle rule,
storage.rootwritable by the app only (uploads are staged there) (File storage).