# Deploying brentwooddev → dev.brentwood.ca

The live dev site **https://dev.brentwood.ca** is a DigitalOcean droplet (`dev-wp`,
TOR1, Ubuntu 24.04). We develop here on mosiah (`/srv/apps/brentwooddev`) and **push**
to the droplet when we want the dev URL updated. mosiah is the source of truth.

## Push the latest changes (one command)

```bash
push-brentwood-dev
# or, if the symlink isn't installed:
bash /srv/apps/brentwooddev/deploy/push-to-dev.sh
```

Runnable by anyone in the `brentwooddev-dev` group (rian, adi) — and you can just ask
Claude to "push to dev." Takes ~50s. It:
1. dumps the brentwooddev DB from the shared MariaDB (over the network — no docker needed),
2. imports it into the droplet,
3. rsyncs `wp-content` (incremental),
4. rewrites URLs `brentwooddev.demoing.info → dev.brentwood.ca` and flushes rewrites.

**It OVERWRITES the droplet with mosiah's current state** — don't edit the droplet
directly; treat it as a deploy target only.

## Accessing the dev site

The site is behind a password gate (so it's not public — Google can't index it):

- URL: https://dev.brentwood.ca
- Gate user: `brentwood`
- Gate password: `showmethesite`  (change via `/opt/brentwood-wp/.env` + Caddyfile on the droplet)
- WP admin: https://dev.brentwood.ca/wp-admin/ → pass the gate, then the normal WP login.

## Droplet facts (for debugging)

- Droplet `dev-wp`, DO id `578441989`, primary IP `68.183.201.76`, Reserved IP `159.203.50.215`.
- Stack dir on droplet: `/opt/brentwood-wp` (docker compose: `wordpress` + `db` mariadb:10.11 + `caddy`).
- TLS: Let's Encrypt (auto-renew). Firewall: ufw 22/80/443.
- SSH from mosiah: `ssh -i /srv/apps/brentwooddev/deploy/deploy_key root@68.183.201.76`
  (the deploy key is group-readable by `brentwooddev-dev`; the push script copies it to a
  private temp because ssh refuses group-readable keys).

## Old dev droplet (backup)

The previous Laravel dev droplet (DO id `287742004`) is still running, untouched, as a
recovery option, plus the snapshot `dev.brentwood.ca-pre-wordpress-snapshot`. Decommission
only once fully confident.
