teqo-backup/.env.example
Francisco Solla dabc00f46c ops(OPS52): migra a media de produção do Vercel Blob para o Garage S3
- payload.config.ts: vercelBlobStorage -> s3Storage (@payloadcms/storage-s3)
  com endpoint Garage (forcePathStyle, region garage); bucket privado — o
  staticHandler do plugin streama os objetos em /api/media/file/<filename>,
  mantendo o contrato de URL relativa das 40 rows pré-existentes
- src/utilities/mediaStorage.ts: resolveS3StorageEnv fail-closed (S3_* parcial
  -> throw no boot com a lista exata; nenhuma -> storage local dev/test)
- seed-posts: remove pre-delete do @vercel/blob (S3 sobrescreve nativamente)
- worktree-env.mjs: s3EnvCopiedLines all-or-nothing (unit-testada)
- envs S3_BUCKET/S3_ENDPOINT/S3_REGION/S3_ACCESS_KEY_ID/S3_SECRET_ACCESS_KEY
  no .env.example/.env.test; cloud-setup.sh sem o sed morto do blob
- deps: -storage-vercel-blob -@vercel/blob +storage-s3; importMap regenerado
- docs: impl plan (revisão A->B: Garage v2 sem acesso anônimo na API S3),
  AGENTS.md, changelog 2026-08-18-ops52
2026-08-17 22:36:34 -03:00

67 lines
3.7 KiB
Text

# Copy this file to `.env.local` for local development.
#
# For LOCAL DEVELOPMENT, DATABASE_URL must point at the local Postgres started by
# docker-compose (`pnpm db:start`). `pnpm dev` will REFUSE to start against a
# non-local host (e.g. the production Neon database) unless you explicitly set
# ALLOW_REMOTE_DB=true — this is intentional, to protect production data.
DATABASE_URL=postgresql://teqo:teqo@localhost:5432/teqo
PAYLOAD_SECRET=YOUR_SECRET_HERE
# Media storage (OPS52) — Garage S3 (homeserver). When ANY of the four required
# envs (S3_BUCKET, S3_ENDPOINT, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY) is set,
# ALL of them must be: a partial config aborts the boot with the exact missing
# names (fail-closed). When none is set, Payload falls back to local disk storage
# (dev/test). The bucket stays PRIVATE: the app proxies the files through its
# /media/file route (the plugin streams each object from Garage), so no public
# bucket/DNS is needed. Production: S3_BUCKET=teqo-media,
# S3_ENDPOINT=http://100.119.220.31:3900 (tailnet do homeserver). Dev may use its
# own bucket — never share the production bucket across environments.
S3_BUCKET=
S3_ENDPOINT=
S3_REGION=garage
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
# Canonical public origin used in absolute campaign invite links. In production
# this must be an exact HTTPS non-local origin: no credentials, path other than
# `/`, query, or fragment. Production ignores request headers and invite
# creation fails closed when this value is invalid. Development/test accepts
# request-derived origins only for exact localhost, 127.0.0.1, or ::1 hosts and
# normalizes them to HTTP; otherwise this configured origin is the only fallback.
NEXT_PUBLIC_SITE_URL=http://localhost:3000
# Shared secret guarding POST /api/revalidate, which busts ISR cache tags on demand.
# Needed after direct-DB writes (e.g. `pnpm db:seed:posts`, Onda 0 migrations) since those
# bypass the deployed Payload hooks. Default tag is `posts`; allowlisted tags also include
# `global_privacy-policy` for /privacidade. MUST be set in the Vercel project env for production. Generate with e.g. `openssl rand -hex 32`.
REVALIDATE_SECRET=YOUR_REVALIDATE_SECRET_HERE
# Web Push (D2 — /campanha notifications). Generate VAPID keys with: npx web-push generate-vapid-keys
VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=
VAPID_SUBJECT=mailto:campanha@jorgesolla.com.br
NEXT_PUBLIC_VAPID_PUBLIC_KEY=
# Campaign password reset emails (Resend). Required in production for forgot-password.
RESEND_API_KEY=YOUR_RESEND_API_KEY_HERE
CAMPAIGN_EMAIL_FROM=campanha@jorgesolla.com.br
CAMPAIGN_EMAIL_FROM_NAME=Campanha Jorge Solla
# Note: the automated test suite ignores this file and reads .env.test instead,
# and only ever runs against a database whose name ends with "_test".
# DeepSeek API key for the AI chat feature (Sollinha) — the LLM talks directly
# to api.deepseek.com (cache-hit input is ~6x cheaper than via Deep Infra).
# Get one at https://platform.deepseek.com/api_keys
DEEPSEEK_API_KEY=YOUR_DEEPSEEK_API_KEY_HERE
# Deep Infra API key for the Sollinha voice transcription (STT, Whisper large-v3)
# — cheapest speech-to-text around ($0.00045/audio min). Get one at https://deepinfra.com
DEEPINFRA_API_KEY=YOUR_DEEPINFRA_API_KEY_HERE
# C114 — Google Calendar mirror (Agenda da Campanha): base64 of the Google Cloud
# service-account JSON key (cat key.json | base64 -w0). The service account must
# be granted "make changes to events" on the campaign's public calendar; the
# calendar ID itself is configured by an admin in the `googleCalendarSync`
# collection. Absent/malformed → the agenda shows "não configurado" and the
# mirror stays off — the Teqo agenda never depends on this.
GOOGLE_CALENDAR_SERVICE_ACCOUNT_KEY=