Session 48e: CRITICAL checkout fix - persistent .env + deploy verification

This commit is contained in:
Hoid 2026-02-17 11:56:04 +00:00
parent dae4355951
commit 0c3b694829

View file

@ -1135,3 +1135,14 @@
- Kept: Stripe `customer.updated` webhook for Pro email sync, `updateEmailByCustomer()` in keys.ts
- Commit f5cea97 deployed, verified: /change-email returns 404, zero references in HTML
- Free tier users can create new key with new email; Pro users get email synced from Stripe
## Session 48e — 2026-02-17 11:49 UTC (CRITICAL: Checkout Fix + Systemic Root Cause)
- **CRITICAL BUG: Stripe checkout broken after deploy — FIXED**
- Root cause: No `.env` file on server. docker-compose.yml used `${STRIPE_SECRET_KEY}` variable substitution but nothing provided values. Env vars were never persisted — only worked when manually exported in a shell session.
- Fix: Created persistent `/root/docfast/.env` with STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, DATABASE_PASSWORD
- `.env` already in .gitignore
- Created `scripts/verify-deploy.sh` — checks health + Stripe checkout after every deploy
- Added verify script to CI/CD pipeline (.forgejo/workflows/deploy.yml)
- Container restarted, verification passed: health OK, Stripe checkout returns valid URL
- Commit 73fba68 deployed
- **This was the systemic root cause of recurring checkout failures.** Every `docker compose up -d --build` in a new shell lost the Stripe credentials. Now permanently fixed with `.env` file + CI/CD verification.