Record the first droplet deployment; align deploy files with what ran

Documentation and deployment examples only; no application code changed.
The systemd unit and Caddyfile now match what is running on the droplet,
and docs/evidence/droplet/2026-11-21.md records the changes made and the
checks performed. No device or phone evidence.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-21 12:02:44 -08:00
co-authored by Claude Fable 5.2
parent f02715fb64
commit 98c7b03aa7
4 changed files with 112 additions and 17 deletions
+14 -8
View File
@@ -1,8 +1,8 @@
# Running the bridge on a DigitalOcean droplet
**Status: written, not run.** These steps have not been executed on a droplet. The bridge, the
built-in speech model and the Hermes adapter have only been run on the development desktop.
Creating the droplet, pointing DNS at it and starting services are Dan's actions.
**Status: run once, on 2026-11-21**, on the existing Hermes droplet rather than a new one. What
was actually done, including where it differed from the steps below, is recorded in
`docs/evidence/droplet/2026-11-21.md`. The steps below have been corrected to match.
## What runs where
@@ -61,15 +61,19 @@ accurate) and run `fetch-model` again.
the bridge refuses to start and leaves the directory exactly as it found it, even if its
mode is already 0700. If the owner is right but the mode is looser, the bridge sets it to
0700. So `-o hermeven` in the command above matters as much as `-m 0700`.
4. **Code.** Clone the repository into `/opt/hermeven`, then `npm ci`. (The dev dependencies are
needed: the bridge runs through `tsx`.)
4. **Code.** Put the repository at `/opt/hermeven/app` (a clone, or `git archive <sha> | tar -x`),
then run `npm ci` there as the unprivileged `hermeven` user and hand the tree back to root
afterwards (`chown -R root:root /opt/hermeven/app`), so package install scripts never run as
root and the running service cannot modify its own code. (The dev dependencies are needed:
the bridge runs through `tsx`.) Node.js is expected at `/opt/node/bin/node`.
5. **Configuration.** Copy `deploy/bridge.env.example` to `/etc/hermeven/bridge.env`, fill it
in, `chmod 600`, `chown hermeven`.
5a. **Speech model.** As root (not the service user), fetch and verify the pinned model into a
directory the service can read but not write:
```sh
HERMEVEN_ENV_FILE=/etc/hermeven/bridge.env npm --prefix /opt/hermeven run bridge:cli -- fetch-model
HERMEVEN_ENV_FILE=/etc/hermeven/bridge.env npm --prefix /opt/hermeven run bridge:cli -- verify-model
cd /opt/hermeven/app/services/bridge
HERMEVEN_ENV_FILE=/etc/hermeven/bridge.env /opt/node/bin/node --import tsx src/cli.ts fetch-model
HERMEVEN_ENV_FILE=/etc/hermeven/bridge.env /opt/node/bin/node --import tsx src/cli.ts verify-model
```
Every file is checked against the SHA-256 committed in `services/bridge/models/`. The running
service never downloads anything: it re-verifies these files each time it loads the model and
@@ -87,7 +91,9 @@ accurate) and run `fetch-model` again.
`HERMEVEN_BRIDGE_ORIGIN=https://bridge.example.com npm run -w @hermeven/even-client pack`.
10. **Pair.** On the droplet, as the service user with the same environment:
```sh
sudo -u hermeven HERMEVEN_ENV_FILE=/etc/hermeven/bridge.env npm --prefix /opt/hermeven run bridge:cli -- pair
cd /opt/hermeven/app/services/bridge
runuser -u hermeven -- env HOME=/var/lib/hermeven HERMEVEN_ENV_FILE=/etc/hermeven/bridge.env \
/opt/node/bin/node --import tsx src/cli.ts pair
```
11. **Origin.** Open the phone page, read Diagnostics, "Page origin", put it in
`HERMEVEN_ALLOWED_ORIGINS`, restart the service.