games_app/deploy/vps-hardening/PREDEPLOY-CHECKLIST.md
Your Name 5ce6a6811a
Some checks failed
CI / test-and-build (push) Failing after 25s
Add Gitea CI/CD stack, tloto-deploy, and tagged Compose images
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-17 19:56:39 +02:00

66 lines
2.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Checklist pre-deploy Tloto (après harden-vps.sh)
À cocher **avant** `npm run phase-b:init` ou `phase-b:init:https` sur le VPS durci.
## Accès & OS
- [ ] `ssh deploy@<IP>` fonctionne **sans** mot de passe
- [ ] `sudo -n true` OK pour `deploy`
- [ ] `PermitRootLogin no` / `PasswordAuthentication no` (fichier `/etc/ssh/sshd_config.d/99-tloto.conf`)
- [ ] `sudo ufw status` : allow seulement `22/tcp` (OpenSSH), `9080/tcp`, `9443/tcp`
- [ ] `fail2ban-client status sshd` actif
- [ ] `docker --version` et `docker compose version` OK
- [ ] Postgres écoute localhost : `ss -tlnp | grep 5432` → `127.0.0.1` / `::1` seulement
## Secrets (générer une fois, backup offline, jamais git)
```bash
# Sur le VPS ou en local, coller uniquement dans .env (chmod 600)
openssl rand -hex 32 # ENCRYPTION_KEY
openssl rand -base64 48 # JWT_SECRET / REDIS_PASSWORD / tokens
# PLATFORM_MNEMONIC : 24 mots BIP39 (outil dédié / procédure DEPLOY-VPS)
```
- [ ] `.env` à la racine du clone, `chmod 600`
- [ ] `ENCRYPTION_KEY`, `JWT_SECRET`, `REDIS_PASSWORD`, `INITIAL_SETUP_TOKEN`, `BREAK_GLASS_TOKEN`, `PLATFORM_MNEMONIC`
- [ ] `POSTGRES_*` / `DATABASE_URL` cohérents avec Postgres hôte
- [ ] Après première mise en service : enregistrer `encryption_key_rotated_at` (évite spam admin « Encryption key rotation due »)
## URLs & CORS (prod HTTPS)
- [ ] DNS **A** du domaine → IP du VPS (ex. `191.215.41.53`)
- [ ] `APP_PUBLIC_URL=https://<domaine>:9443` (ou 443 via gateway)
- [ ] `CORS_ORIGINS` = **même origine** que le front (liste blanche stricte)
- [ ] `VITE_API_BASE_URL` aligné sur `APP_PUBLIC_URL` (rebuild web après changement)
- [ ] `VITE_WS_URL=wss://…/ws/v1/games/candle-predict`
- [ ] `CERTBOT_EMAIL` / `CERTBOT_DOMAIN1` pour Let’s Encrypt
## Sécurité produit (flags initiaux)
- [ ] `ALLOW_WITHDRAWALS=false` jusqu’à validation dépôts
- [ ] `SWEEP_ENABLED=false` jusqu’au test cold
- [ ] Turnstile : `TURNSTILE_SITE_KEY` + `TURNSTILE_SECRET_KEY` (web) ; mobile = math via `X-Tloto-Platform`
- [ ] SMTP vérifié : `npm run phase-b:verify-smtp` (après clone)
## Première mise en route
```bash
cd ~/games_app # ou chemin du clone
sudo npm run phase-b:init:https # ou phase-b:init en HTTP test
curl -fsS https://<domaine>:9443/health
# puis /setup avec INITIAL_SETUP_TOKEN
```
- [ ] Super Admin créé + 2FA + recovery codes offline
- [ ] 2ᵉ admin recommandé
- [ ] Hot wallets seed **une fois** ; ne plus changer `ENCRYPTION_KEY` / `PLATFORM_MNEMONIC` sans runbook rotation
- [ ] Backup Postgres chiffré **hors VPS** avant argent réel
## Références
- **Cutover fresh-install vers nouveau VPS :** [MIGRATE-TO-NEW-VPS.md](./MIGRATE-TO-NEW-VPS.md)
- [docs/DEPLOY-VPS.md](../../docs/DEPLOY-VPS.md)
- [deploy/ENCRYPTION_KEY_ROTATION.md](../ENCRYPTION_KEY_ROTATION.md)
- [deploy/PRODUCTION_SENTRY_CLAMAV.md](../PRODUCTION_SENTRY_CLAMAV.md)
- [deploy/SECURITY_CSRF.md](../SECURITY_CSRF.md)