|
| 1 | +# π Production Readiness Checklist |
| 2 | + |
| 3 | +## β
Deployment Status |
| 4 | + |
| 5 | +### Infrastructure |
| 6 | +- [x] CI/CD Pipeline configured with GitHub Actions |
| 7 | +- [x] Automated deployment to derail.me on main branch push |
| 8 | +- [x] Health monitoring every 15 minutes |
| 9 | +- [x] SSL certificate automation with Let's Encrypt |
| 10 | +- [x] Nginx reverse proxy configuration |
| 11 | +- [x] PM2 process management |
| 12 | +- [x] PostgreSQL database setup |
| 13 | +- [x] Docker containerization |
| 14 | + |
| 15 | +### Security |
| 16 | +- [x] JWT authentication implemented |
| 17 | +- [x] Password hashing with bcrypt |
| 18 | +- [x] Role-based access control (owner/admin/viewer/guest) |
| 19 | +- [x] One-time shareable links with revocation |
| 20 | +- [x] CORS protection configured |
| 21 | +- [x] Security headers in Nginx |
| 22 | +- [x] Environment variables for secrets |
| 23 | +- [x] HTTPS enforced with SSL redirect |
| 24 | + |
| 25 | +### Features |
| 26 | +- [x] Live RTSP to WebSocket streaming |
| 27 | +- [x] HLS.js fallback for compatibility |
| 28 | +- [x] Real-time chat via WebSocket |
| 29 | +- [x] Camera PTZ control support |
| 30 | +- [x] Recording request workflow |
| 31 | +- [x] Guest session management |
| 32 | +- [x] User layout preferences |
| 33 | +- [x] Google Drive integration ready |
| 34 | + |
| 35 | +### Monitoring & Logging |
| 36 | +- [x] Health check endpoints (/api/health, /api/ready, /api/live) |
| 37 | +- [x] Performance monitoring in health checks |
| 38 | +- [x] SSL certificate expiry monitoring |
| 39 | +- [x] Database connectivity checks |
| 40 | +- [x] Slack webhook notifications |
| 41 | +- [x] GitHub Actions status tracking |
| 42 | +- [x] PM2 log management |
| 43 | +- [x] Nginx access/error logs |
| 44 | + |
| 45 | +## π Required Configuration |
| 46 | + |
| 47 | +### GitHub Secrets (Required) |
| 48 | +```bash |
| 49 | +PRODUCTION_HOST=derail.me |
| 50 | +PRODUCTION_USER=deploy |
| 51 | +PRODUCTION_PORT=22 |
| 52 | +PRODUCTION_SSH_KEY=[Your SSH Private Key] |
| 53 | +JWT_SECRET=[Generated Secret] |
| 54 | +SESSION_SECRET=[Generated Secret] |
| 55 | +DATABASE_URL=postgresql://streamlink:password@localhost:5432/chittypro_streamlink |
| 56 | +ALLOWED_ORIGINS=https://derail.me,https://www.derail.me |
| 57 | +``` |
| 58 | + |
| 59 | +### Server Requirements |
| 60 | +- Ubuntu/Debian Linux |
| 61 | +- Node.js 20.x |
| 62 | +- PostgreSQL 14+ |
| 63 | +- Nginx |
| 64 | +- PM2 |
| 65 | +- FFmpeg (for streaming) |
| 66 | +- 2GB+ RAM recommended |
| 67 | +- 20GB+ storage for recordings |
| 68 | + |
| 69 | +## π§ Deployment Commands |
| 70 | + |
| 71 | +### Initial Server Setup |
| 72 | +```bash |
| 73 | +# Run on your server |
| 74 | +scp scripts/setup-server.sh deploy@derail.me:~/ |
| 75 | +ssh deploy@derail.me |
| 76 | +./setup-server.sh |
| 77 | +``` |
| 78 | + |
| 79 | +### Configure GitHub Secrets |
| 80 | +```bash |
| 81 | +# Run locally |
| 82 | +./scripts/configure-github-secrets.sh |
| 83 | +``` |
| 84 | + |
| 85 | +### Deploy to Production |
| 86 | +```bash |
| 87 | +# Automatic on push |
| 88 | +git push origin main |
| 89 | + |
| 90 | +# Manual deployment |
| 91 | +gh workflow run deploy-production.yml |
| 92 | +``` |
| 93 | + |
| 94 | +### Monitor Deployment |
| 95 | +```bash |
| 96 | +# Dashboard |
| 97 | +./scripts/deployment-dashboard.sh |
| 98 | + |
| 99 | +# Verify deployment |
| 100 | +./scripts/verify-deployment.sh derail.me |
| 101 | + |
| 102 | +# Watch GitHub Actions |
| 103 | +gh run watch -R chitcommit/chittypro-streamlink |
| 104 | +``` |
| 105 | + |
| 106 | +### Server Management |
| 107 | +```bash |
| 108 | +# View logs |
| 109 | +ssh deploy@derail.me 'pm2 logs chittypro-streamlink' |
| 110 | + |
| 111 | +# Restart application |
| 112 | +ssh deploy@derail.me 'pm2 restart chittypro-streamlink' |
| 113 | + |
| 114 | +# Check status |
| 115 | +ssh deploy@derail.me 'pm2 status' |
| 116 | + |
| 117 | +# Database backup |
| 118 | +ssh deploy@derail.me 'pg_dump chittypro_streamlink > backup.sql' |
| 119 | +``` |
| 120 | + |
| 121 | +## π― Performance Targets |
| 122 | + |
| 123 | +- Homepage load: < 2 seconds |
| 124 | +- API response: < 500ms |
| 125 | +- WebSocket latency: < 100ms |
| 126 | +- Health check: < 1 second |
| 127 | +- SSL handshake: < 200ms |
| 128 | +- Database queries: < 50ms |
| 129 | + |
| 130 | +## π Security Checklist |
| 131 | + |
| 132 | +- [ ] Change default admin password |
| 133 | +- [ ] Configure firewall rules (ufw) |
| 134 | +- [ ] Set up fail2ban for SSH |
| 135 | +- [ ] Enable unattended-upgrades |
| 136 | +- [ ] Configure database backups |
| 137 | +- [ ] Test restore procedures |
| 138 | +- [ ] Review Nginx security headers |
| 139 | +- [ ] Audit npm packages regularly |
| 140 | + |
| 141 | +## π Monitoring URLs |
| 142 | + |
| 143 | +- **Application**: https://derail.me |
| 144 | +- **Health Check**: https://derail.me/api/health |
| 145 | +- **GitHub Actions**: https://github.com/chitcommit/chittypro-streamlink/actions |
| 146 | +- **SSL Status**: https://www.ssllabs.com/ssltest/analyze.html?d=derail.me |
| 147 | + |
| 148 | +## π¨ Incident Response |
| 149 | + |
| 150 | +### Application Down |
| 151 | +1. Check health endpoint: `curl https://derail.me/api/health` |
| 152 | +2. SSH to server: `ssh deploy@derail.me` |
| 153 | +3. Check PM2 status: `pm2 status` |
| 154 | +4. Check logs: `pm2 logs chittypro-streamlink` |
| 155 | +5. Restart if needed: `pm2 restart chittypro-streamlink` |
| 156 | + |
| 157 | +### Database Issues |
| 158 | +1. Check PostgreSQL: `sudo systemctl status postgresql` |
| 159 | +2. Check connections: `sudo -u postgres psql -c "SELECT count(*) FROM pg_stat_activity;"` |
| 160 | +3. Review logs: `sudo tail -f /var/log/postgresql/*.log` |
| 161 | +4. Restart if needed: `sudo systemctl restart postgresql` |
| 162 | + |
| 163 | +### High Load |
| 164 | +1. Check server resources: `htop` |
| 165 | +2. Check PM2 cluster: `pm2 status` |
| 166 | +3. Scale workers: `pm2 scale chittypro-streamlink 4` |
| 167 | +4. Check Nginx: `sudo nginx -t && sudo systemctl reload nginx` |
| 168 | + |
| 169 | +### SSL Certificate Issues |
| 170 | +1. Check expiry: `sudo certbot certificates` |
| 171 | +2. Renew manually: `sudo certbot renew` |
| 172 | +3. Restart Nginx: `sudo systemctl restart nginx` |
| 173 | + |
| 174 | +## π Scaling Options |
| 175 | + |
| 176 | +### Vertical Scaling |
| 177 | +- Upgrade server RAM/CPU |
| 178 | +- Increase PostgreSQL connections |
| 179 | +- Add PM2 cluster workers |
| 180 | + |
| 181 | +### Horizontal Scaling |
| 182 | +- Add load balancer (HAProxy/Nginx) |
| 183 | +- Database read replicas |
| 184 | +- CDN for static assets (Cloudflare) |
| 185 | +- Separate streaming servers |
| 186 | + |
| 187 | +### Storage Scaling |
| 188 | +- Google Drive integration (configured) |
| 189 | +- S3-compatible object storage |
| 190 | +- Network-attached storage (NAS) |
| 191 | +- Automated cleanup policies |
| 192 | + |
| 193 | +## β
Final Checks |
| 194 | + |
| 195 | +Before going live: |
| 196 | +1. [ ] Test all user roles (admin/viewer/guest) |
| 197 | +2. [ ] Verify camera streaming works |
| 198 | +3. [ ] Test one-time share links |
| 199 | +4. [ ] Confirm recording storage |
| 200 | +5. [ ] Check mobile responsiveness |
| 201 | +6. [ ] Test WebSocket reconnection |
| 202 | +7. [ ] Verify SSL certificate |
| 203 | +8. [ ] Review security headers |
| 204 | +9. [ ] Test backup/restore |
| 205 | +10. [ ] Document admin credentials |
| 206 | + |
| 207 | +## π Launch! |
| 208 | + |
| 209 | +Your ChittyPro Streamlink is production-ready! |
| 210 | + |
| 211 | +Monitor at: https://github.com/chitcommit/chittypro-streamlink/actions |
| 212 | +Access at: https://derail.me |
0 commit comments