What you need to do by hand before / right after a launch. Most of the platform is automated, but these touch credentials or system services that require root or external dashboards.
Without this, the Convex backup timer (and any other --user
service) stops the moment your SSH session closes.
sudo loginctl enable-linger halfVerify:
loginctl show-user half --property=Linger # → Linger=yes
systemctl --user list-timers codebase-convex-backup.timerSentry is currently disabled because the DSN env var is unset.
The platform logs "Sentry disabled" constantly until you fix this.
Get the DSN from sentry.io → your project → Settings → Client Keys (or create a project at https://sentry.io). Then:
# Edit and dotenvx-encrypt the new value
cd web
npx dotenvx set NEXT_PUBLIC_SENTRY_DSN "https://<key>@<host>/<project>" -f .env.production --encrypt
# Verify it decrypts back to the right value when DOTENV_PRIVATE_KEY_PRODUCTION is set
DOTENV_PRIVATE_KEY_PRODUCTION=<your-key> npx dotenvx run -f .env.production -- node -e \
"console.log(process.env.NEXT_PUBLIC_SENTRY_DSN)"
# Redeploy so the new env is baked into the Next.js bundle
bash ../scripts/deploy-web.shAfter redeploy, hit any unhandled error in prod and confirm it shows up on the Sentry dashboard.
Cloudflare is currently in Flexible mode, meaning the Cloudflare-to-origin hop is plaintext HTTP. Anyone between Cloudflare and the VM (datacenter network, ISP, etc.) sees session cookies and POST bodies in the clear.
Steps:
-
Cloudflare dashboard → SSL/TLS → Origin Server → Create Certificate. Default options (RSA 2048, 15 years). Copy both the cert and private key.
-
SSH to the box and place them:
sudo mkdir -p /etc/ssl/codebase sudo nano /etc/ssl/codebase/origin.crt # paste cert sudo nano /etc/ssl/codebase/origin.key # paste key sudo chmod 600 /etc/ssl/codebase/origin.key
-
Update both nginx server blocks to point at the new files:
sudo nano /etc/nginx/sites-enabled/codebase-foundation # ssl_certificate /etc/ssl/codebase/origin.crt; # ssl_certificate_key /etc/ssl/codebase/origin.key; sudo nginx -t && sudo systemctl reload nginx
-
Cloudflare dashboard → SSL/TLS → Overview → set to Full (strict). Tests every connection to origin with cert verification. Watch the site stays up for a minute, then verify with
curl --resolve codebase.design:443:<origin-ip> https://codebase.design. -
(Optional but recommended) SSL/TLS → Edge Certificates → Always Use HTTPS = ON, Minimum TLS Version = 1.2, HSTS = enable.
bash ~/polyvibe-poc/scripts/backup-convex.sh
# → /home/half/backups/convex/db-<ISO-UTC>.sqlite3.gzBackups also run automatically every 6 hours via the systemd timer.
See scripts/backup-convex.README.md for restore steps.
Once you have an rclone remote configured:
sudo apt-get install rclone
rclone config # set up your B2/S3/R2/Wasabi remote
BACKUP_REMOTE=b2:codebase-backups bash scripts/backup-convex-offsite.shFor automated off-site shipping, add a systemd timer that fires
after the local backup cron and exports BACKUP_REMOTE. The
script refuses to run without it so a misconfigured cron can't
silently no-op.
bash scripts/vacuum-convex.sh
# → in-place VACUUM, reclaims fragmented spacesystemd timer fires Sunday 04:00 (10-min jitter). Verify with:
systemctl --user list-timers codebase-convex-vacuum.timerpm2 restart all
docker compose -f web/convex-docker/docker-compose.yml restart convex-backendcd ~/polyvibe-poc
git pull
bash scripts/deploy-web.shThe sidecar build writes to .next.new/, atomically swaps into
.next/ on success, reloads PM2, smoke-tests /, and rolls back
if health check fails. Production stays serving the old build
during the ~14-minute compile.
# Frontend
curl -sI -o /dev/null -w "%{http_code}\n" http://127.0.0.1:3002/
# Backend
curl -sI -o /dev/null -w "%{http_code}\n" http://127.0.0.1:3001/cli/published
# Convex
curl -sI -o /dev/null -w "%{http_code}\n" http://127.0.0.1:3210/version
# PM2 process states
pm2 listpm2 logs codebase-frontend --lines 50
pm2 logs codebase-backend --lines 50PM2 logs auto-rotate at 50 MB / 14 days (configured via pm2-logrotate).
-
loginctl show-user half --property=Linger→Linger=yes -
NEXT_PUBLIC_SENTRY_DSNis set and Sentry events arriving - Cloudflare SSL mode = Full (strict), origin cert installed
-
ss -lntpshows Convex ports 3210/3211/6791 + Redis 6379 only on127.0.0.1 -
pm2 listshows both processes online with restart count < 10 in last hour - Recent
db-*.sqlite3.gzexists in/home/half/backups/convex/ - At least one off-host backup destination configured
-
.env.productionis dotenvx-encrypted (git show HEAD:web/.env.production | grep encrypted:returns lines) - OAuth flow works end-to-end on a fresh browser session (
codebase auth loginfrom CLI works) -
curl https://codebase.design/returns 200 from outside the LAN