# Workspace domain migration

The Workspace's production origin is `https://heavyhaulagent.com`. This replaces
`https://heavyhaulgbt.com`; dated audit and task notes describe the previous host.
The canonical metadata, sitemap, support addresses, and email sender defaults
already use the new domain through `src/lib/app-url.ts` and the email policy.

## Deployment

1. Configure DNS, HTTPS, and the hosting virtual host for `heavyhaulagent.com` to
   serve this Workspace. If that host still serves the Brain/API backend, move
   that service to `brain.heavyhaulagent.com` and update its callers first. Keep
   email DNS records intact.
2. Set `NEXT_PUBLIC_APP_URL=https://heavyhaulagent.com` in the production app
   environment **before building**. Update any separately configured
   `WORKSPACE_URL` used by Synchron import jobs. The ignored local `.env` has
   been updated; it does not update the server's environment. Local development
   can override the origin with `http://localhost:3000` in `.env.local`.
3. Update Supabase Auth's production Site URL and allow
   `https://heavyhaulagent.com/api/auth/google/callback*` in Redirect URLs. Keep
   the Supabase-hosted Google provider callback. See `GOOGLE_AUTH_SETUP.md`.
   Authorize `heavyhaulagent.com` for the production reCAPTCHA key and any
   configured Turnstile widget.
4. Update external integrations to call the new Workspace origin, including:

   - Synchron: `https://heavyhaulagent.com/api/webhooks/synchron`.
   - ZeptoMail transactional: `https://heavyhaulagent.com/api/webhooks/zeptomail/transactional`.
   - ZeptoMail updates: `https://heavyhaulagent.com/api/webhooks/zeptomail/updates`.
   - Legacy pilot email webhook, if enabled: `https://heavyhaulagent.com/api/pilot/email-webhook`.

   Keep the existing webhook authentication secrets and headers.
5. Rebuild and restart the app using the project's deployment flow. The existing
   PM2 identifier `heavyhaulgbt-app` is retained so `deploy.sh` restarts the same
   process. It is a process name, not a public URL.
6. Verify login (including Google), a generated invitation link, webhook
   delivery, and `/sitemap.xml` on the new host. Configure the old host to
   redirect permanently to the new origin while preserving paths and query
   strings. Point webhook senders directly at the new URL rather than relying
   on redirects. Users may need to sign in again because session cookies belong
   to the domain where they were issued.
