Files
4ventures-client-portal/docs/OPERATOR.md
4Ventures c13001c69d feat: auto-discover Meta and Google Ads accounts for tenants
Agency panel lists accessible ad accounts and matches them to
clients by name, same pattern as Drive folders.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-22 19:24:11 +02:00

2.3 KiB

Operador marketing@4ventures.es

Estado (2026-09-21)

  • Usuario creado en Supabase Auth (role=admin, tenant_id = 4Ventures Central).
  • Password local (gitignored): .ops/marketing-credentials.txt
  • Login verificado en https://app.4ventures.es/login → /dashboard/* y /dashboard/agencia
  • sql/creatives.sql aplicado en prod; RLS activo en tablas de negocio (incl. agent_runs, verificado 2026-09-21)
  • Re-aplicar RLS agent_runs si hace falta: sql/agent_runs_rls.sql (idempotente)
  • Biblioteca de activos (archivos): sql/asset_files.sql + bucket privado tenant-assets (máx. 80 MB/archivo). UI: /dashboard/activos. Apply: python3 scripts/dokploy_apply_asset_files.py
  • Google Drive (agencia): sql/google_drive.sql. OAuth marketing@ → auto-match carpetas por nombre de tenant. Env Dokploy: GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET, NEXT_PUBLIC_APP_URL. Redirect: https://app.4ventures.es/api/admin/drive/callback. UI: Agencia → Conectar Drive.
  • Panel control clientes: sql/agency_control.sql (agency_followed + integrations.enabled). Matriz en Agencia + hub por cliente.
  • Meta/Google Ads discovery: env META_ACCESS_TOKEN, GOOGLE_ADS_DEVELOPER_TOKEN, GOOGLE_ADS_REFRESH_TOKEN, GOOGLE_ADS_CLIENT_ID/SECRET. UI: Agencia → Descubrir y emparejar.

Login

  1. Abre https://app.4ventures.es/login
  2. Email: marketing@4ventures.es
  3. Password: la de .ops/marketing-credentials.txt (o el gestor de la agencia)

Reset / reprovision (si hace falta)

Studio (Kong) o Admin API con service role:

{
  "role": "admin",
  "company": "4Ventures",
  "slug": "4ventures-hub",
  "tenant_id": "0b3c5fc0-6901-4caf-b26a-b6a0201d8541"
}

Rotación de API keys (recomendado)

Settings → API → Regenerate anon y service_role.
Actualizar en Dokploy → Web4Ventures → client-portal → Environment (API application.update).
Nunca pegar keys en PDFs ni .env.example.

Pendiente ops

  • ANTHROPIC_API_KEY en Dokploy env si se quiere el asistente LLM
  • OAuth live Meta / Google Ads / GA4 / GSC (hoy: estado manual por tenant en Agencia)
  • IP allowlist Traefik: mantener IPs oficina actuales en middleware-hardening.yml

Verificación

  • Rol admin → ve /dashboard/agencia
  • Rol client → redirigido fuera de agencia
  • Chat/simulate solo con sesión
  • Health: serviceRoleConfigured: true