videogen/docs/runbooks/deploy-credentials.md
caelum0x d56639a594
Some checks are pending
build-images / api (push) Waiting to run
build-images / worker-gpu (push) Waiting to run
build-images / web (push) Waiting to run
codeql / Analyze (javascript-typescript) (push) Waiting to run
codeql / Analyze (python) (push) Waiting to run
perf / API hot-path micro-smoke (budgeted) (push) Waiting to run
perf / Desktop engine crates (release build check) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Waiting to run
vision2026-ci / API phase modules (ruff + pytest) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Waiting to run
vision2026-ci / Python SDK resource tests (push) Waiting to run
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Waiting to run
vision2026-ci / Alembic upgrade + drift check (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Waiting to run
Menivor — open source release (MIT), free to use and fork
Paid, hosted product at menivor.com, now retired as a company project.
Fresh squashed history of the cleaned working tree (secret-scanned,
no .env, no customer data, no outreach logs). Built on
MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
2026-12-04 02:10:26 +03:00

81 lines
4.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.

# Runbook — Deploy Credentials (menivor)
Companion to [`deploy.md`](./deploy.md). That runbook covers the CI/CD mechanics;
this one lists **every secret the running system needs** and where to get it. Var
names are extracted from `.env.reelforge.example`, `.env.full.example`,
`apps/web/.env.example`, and `apps/mobile/.env.example`.
Deploy is gated by **operator credentials, not code** — the app is built and tested.
Work top-down: Phase 0 gets a running read-only pilot; each later phase flips one
launch flag once its secrets are in.
---
## Phase 0 — Infra (provision, then paste connection strings)
| Group | Vars | Where to get it |
|---|---|---|
| **Neon Postgres** | `DATABASE_URL`, `DATABASE_URL_UNPOOLED`, `REELFORGE_DATABASE_URL`, `NEON_DATABASE_URL` | One Neon project → pooled + unpooled conn strings. All four point at the same DB. |
| **Redis** | `REDIS_HOST`, `REDIS_PORT`, `REDIS_DB`, `REDIS_PASSWORD` | Upstash or Redis Cloud instance (Celery broker + result backend). |
| **Cloudflare R2** | `R2_ACCOUNT_ID`, `R2_ACCESS_KEY_ID`, `R2_SECRET_ACCESS_KEY`, `R2_BUCKET_NAME`, `REELFORGE_R2_BUCKET_NAME`, `R2_S3_ENDPOINT`, `R2_PUBLIC_BASE_URL` | CF dash → R2 → create bucket + API token. Endpoint is `https://<account>.r2.cloudflarestorage.com`. |
| **CORS** | `CORS_ALLOWED_ORIGINS` | Set to `https://menivor.com,https://www.menivor.com`. |
| **Sentry** | `SENTRY_DSN`, `SENTRY_ENVIRONMENT` | sentry.io → project DSN (`https://<key>@<org>.ingest.sentry.io/<proj>`). **Required by the production release gate** (`apps/api/tools/ops/preflight.py --production`); empty = monitoring NO-OP but the gate rejects it. |
> **Redis var-name drift (infra vs app):** the app reads the **`REDIS_HOST` / `REDIS_PORT` / `REDIS_DB` / `REDIS_PASSWORD`** family (`app/config/config.py`, `celery_app.py::_redis_url`), but the k8s manifests + Terraform provide a single **`REDIS_URL`** (`infra/terraform/modules/secrets`, KEDA `addressFromEnv: REDIS_URL`). When provisioning, populate **both**: the `REDIS_HOST` family for the API/worker and `REDIS_URL` for KEDA autoscaling. (Alternatively set `CELERY_BROKER_URL=$REDIS_URL`, but that does not cover the API rate-limit / OAuth-state Redis client, which still reads `REDIS_HOST`.)
## Phase 1 — Render pipeline (needed for the first real render)
| Group | Vars | Where |
|---|---|---|
| **Claude (scripts)** | `ANTHROPIC_API_KEY` | console.anthropic.com |
| **ElevenLabs (TTS — timing authority)** | `ELEVENLABS_API_KEY` | elevenlabs.io |
| **HeyGen (avatar)** | `HEYGEN_API_KEY` | heygen.com. *Optional at launch:* self-host LatentSync/RunPod (Tier B) instead. |
| **ComfyUI (optional providers)** | `COMFYUI_BASE_URL`, `COMFYUI_API_KEY`, `COMFYUI_DEPLOYMENT_ID`, `COMFYUI_DEPLOYMENT_ID_I2V` | Skip at launch — only for the extended provider marketplace. |
## Phase 2 — Auth (web + app)
| Group | Vars | Where |
|---|---|---|
| **Clerk** | `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`, `CLERK_SECRET_KEY` (+ `NEXT_PUBLIC_CLERK_SIGN_IN_URL` / `SIGN_UP_URL` / fallback redirects) | Clerk dash. Domain `clerk.menivor.com` already provisioned per product doc. |
## Phase 3 — Payments (flip `REELFORGE_CHECKOUT_ENABLED=true` only after these)
Payment adapters are coded + tested against mocks; never run against live rails.
Turkey-based seller → prefer **Creem / DodoPay (MoR)**; see the portfolio payment note.
- Web/pro billing: Creem (and/or Stripe, iyzico, Polar — adapters exist).
- Mobile subs: RevenueCat — `EXPO_PUBLIC_REVENUECAT_IOS_API_KEY`,
`EXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY`, `EXPO_PUBLIC_REVENUECAT_WEB_API_KEY`,
`EXPO_PUBLIC_REVENUECAT_PRO_ENTITLEMENT_ID`.
- Wire webhooks to live keys, then run **one real paid webhook + one real settlement**
before flipping the flag.
## Phase 4 — Direct publish (flip `REELFORGE_PUBLISHING_ENABLED=true` after)
OAuth apps approved for TikTok / Instagram / YouTube Shorts. Tokens are Fernet-encrypted
at rest — set the Fernet key alongside.
---
## Launch flags (operator-owned, flip stage-by-stage)
Defaults today (`.env.reelforge.example`) are the safe pilot posture:
```
REELFORGE_LAUNCH_MODE=internal_pilot # → public when Phase 0–2 verified
REELFORGE_PUBLIC_LAUNCH_APPROVED=false
REELFORGE_SIGNUP_ENABLED=false # → true after Phase 2 (auth live)
REELFORGE_CHECKOUT_ENABLED=false # → true after Phase 3 (one real webhook)
REELFORGE_PUBLISHING_ENABLED=false # → true after Phase 4 (OAuth approved)
```
**Go-live sequence:** Phase 0+1 → run one golden end-to-end render on the deployed
stack → Phase 2 + `SIGNUP_ENABLED=true` (public read/create pilot) → Phase 3 +
`CHECKOUT_ENABLED=true` after one real paid webhook + settlement → Phase 4 publishing.
## What is NOT blocked (code work proceeding in parallel)
- Programmatic SEO surface (comparison / alternative-to / free-tool pages) — closes the
2-URL-sitemap gap. No credentials needed; starts after deploy is underway.
- Mobile AdMob wiring uses Google **test** IDs until real IDs arrive.