3.5 KiB
3.5 KiB
Deployment Readiness
Production Preflight
Debian 12 app server setup untuk domain sms.bizone.id tersedia di DEBIAN12_APP_SERVER_SETUP.md.
Run this before deploying a production candidate:
npm run typecheck
npm run db:migrate
npm audit
npm run smoke:e2e
npm run deploy:check-env
npm run mqtt:check-acl -- --file /etc/mosquitto/acl
Use npm run smoke:mqtt-real separately after Mosquitto ACL, backend credential, and broker networking are ready.
Use npm run smoke:mqtt-acl with two provisioned device credentials before hardware pilot.
Required Production Controls
- Create production admin users with
npm run admin:create-user -- --email <email> --name <name> --role <role> --password <strong-password>. - Create merchant portal users with
npm run merchant:create-user -- --merchant <merchant-id-or-code> --email <email> --name <name> --role <role> --password <strong-password>. - Set
ADMIN_DEV_LOGIN_ENABLED=false. - Set
ADMIN_AUTH_ALLOW_LEGACY_TOKEN=falseafter admin users and roles are configured. - Set
MERCHANT_DEV_LOGIN_ENABLED=false. - Set
MERCHANT_AUTH_ALLOW_LEGACY_TOKEN=falseafter merchant portal users are configured. - Set
DEVICE_AUTH_ALLOW_LEGACY_TOKEN=falseafter all devices use per-device credentials. - Set
ADMIN_SESSION_SECRET,INTEGRATION_WEBHOOK_SECRET,MQTT_PASSWORD, and database credentials to strong non-default values. - Set
MQTT_PUBLISH_MODE=broker. - Set
MQTT_SUBSCRIBE_ENABLED=truewhen broker uplink observability is needed. - Keep
EXPORT_WORKER_ENABLED=truefor async export processing, or run a dedicated app instance with the worker enabled. - Set
EXPORT_STORAGE_DIRto a backed-up writable directory and setEXPORT_RETENTION_DAYSaccording to finance retention needs. - Use an absolute
EXPORT_STORAGE_DIR; seeEXPORT_STORAGE_READINESS.mdfor single-node vs multi-node notes. - Keep
RATE_LIMIT_ENABLED=trueand tune rate limit env values for expected pilot traffic. - Set
TRUST_PROXY=truewhen behind a reverse proxy/load balancer. - Set
JSON_BODY_LIMITto the smallest practical request body limit. - Set
SETTLEMENT_ADJUSTMENT_REQUIRE_APPROVAL=truefor finance approval control.
Operational Checks
- Confirm
/health,/admin/health, and/admin/mqtt/status. - Confirm
/health/deepand/admin/health/deepfor DB/MQTT readiness. - Confirm
/admin/observability/summaryfor notification failure, settlement mismatch, DB, and MQTT summary. - Confirm async export worker status in
/admin/observability/summary. - Confirm async export job flow with
POST /admin/exports/settlement-adjustments, pollingGET /admin/exports/:jobId, and download. - Confirm export files are written under
EXPORT_STORAGE_DIRand expire after retention. - Run
npm run backup:production -- --dry-runand one real backup before pilot. - Run
npm run restore:plan -- --backup <dump>and perform a restore drill on a disposable database. - After restore drill, run
npm run restore:validateagainst the restored service. - Run staging load profile with
npm run load:test:stagingagainst a production-like environment. - Run
npm run ui:qa. - Set
LOG_FORMAT=jsonand ship stdout/stderr to the production log collector. - Confirm Postgres backup/restore procedure and retention.
- Confirm Mosquitto password file and ACL are backed up.
- Confirm logs include
request_idfor admin, device, and integration paths. - Confirm settlement CSV export format with the target bank/payment rail before live payout operations.
- Keep
OPERATIONAL_RUNBOOK.mdandPILOT_EXECUTION_CHECKLIST.mdavailable to the operator on duty.