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:
@@ -1,10 +1,28 @@
|
|||||||
# Caddy terminates TLS (certificates are obtained automatically) and forwards to the bridge
|
# Caddy terminates TLS (certificates are obtained automatically), forwards the bridge API to
|
||||||
# on loopback. Replace the hostname. Example only: not yet run on a droplet.
|
# loopback, and serves the built phone page from the same origin. Replace the hostname.
|
||||||
|
# This is the shape running on the first droplet deployment (2026-11-21).
|
||||||
bridge.example.com {
|
bridge.example.com {
|
||||||
encode zstd gzip
|
encode zstd gzip
|
||||||
# Audio uploads are at most about 1 MB at the default 30 s cap.
|
header {
|
||||||
|
Strict-Transport-Security "max-age=31536000"
|
||||||
|
X-Content-Type-Options "nosniff"
|
||||||
|
Referrer-Policy "no-referrer"
|
||||||
|
-Server
|
||||||
|
}
|
||||||
|
|
||||||
|
# Bridge API. Audio uploads are at most about 1 MB at the default 30 s cap.
|
||||||
|
@api path /v1/* /healthz
|
||||||
|
handle @api {
|
||||||
request_body {
|
request_body {
|
||||||
max_size 2MB
|
max_size 2MB
|
||||||
}
|
}
|
||||||
reverse_proxy 127.0.0.1:8787
|
reverse_proxy 127.0.0.1:8787
|
||||||
|
}
|
||||||
|
|
||||||
|
# The built client (apps/even-client/dist). Static files, no secrets. Serving it from the
|
||||||
|
# bridge's own origin means the page needs no CORS allowance.
|
||||||
|
handle {
|
||||||
|
root * /opt/hermeven/www
|
||||||
|
file_server
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# systemd unit for the Hermeven bridge. Example only: it has not been run on a droplet yet.
|
# systemd unit for the Hermeven bridge. This is the unit running on the first droplet
|
||||||
|
# deployment (2026-11-21); see docs/evidence/droplet/2026-11-21.md.
|
||||||
# Install: copy to /etc/systemd/system/, adjust paths, then
|
# Install: copy to /etc/systemd/system/, adjust paths, then
|
||||||
# systemctl daemon-reload && systemctl enable --now hermeven-bridge
|
# systemctl daemon-reload && systemctl enable --now hermeven-bridge
|
||||||
[Unit]
|
[Unit]
|
||||||
@@ -10,10 +11,13 @@ Wants=network-online.target
|
|||||||
Type=simple
|
Type=simple
|
||||||
User=hermeven
|
User=hermeven
|
||||||
Group=hermeven
|
Group=hermeven
|
||||||
WorkingDirectory=/opt/hermeven
|
WorkingDirectory=/opt/hermeven/app/services/bridge
|
||||||
# Secrets live here, mode 600, owned by the service user. Never in the repository.
|
# Secrets live here, mode 600, owned by the service user. Never in the repository.
|
||||||
Environment=HERMEVEN_ENV_FILE=/etc/hermeven/bridge.env
|
Environment=HERMEVEN_ENV_FILE=/etc/hermeven/bridge.env
|
||||||
ExecStart=/usr/bin/npm run --silent bridge
|
# Node is started directly rather than through `npm run`: npm wants a writable home
|
||||||
|
# directory for its logs, and the service's file system is read-only.
|
||||||
|
Environment=HOME=/var/lib/hermeven
|
||||||
|
ExecStart=/opt/node/bin/node --import tsx src/main.ts
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=3
|
RestartSec=3
|
||||||
# In-flight turns are recovered from SQLite on the next start.
|
# In-flight turns are recovered from SQLite on the next start.
|
||||||
|
|||||||
+14
-8
@@ -1,8 +1,8 @@
|
|||||||
# Running the bridge on a DigitalOcean droplet
|
# Running the bridge on a DigitalOcean droplet
|
||||||
|
|
||||||
**Status: written, not run.** These steps have not been executed on a droplet. The bridge, the
|
**Status: run once, on 2026-11-21**, on the existing Hermes droplet rather than a new one. What
|
||||||
built-in speech model and the Hermes adapter have only been run on the development desktop.
|
was actually done, including where it differed from the steps below, is recorded in
|
||||||
Creating the droplet, pointing DNS at it and starting services are Dan's actions.
|
`docs/evidence/droplet/2026-11-21.md`. The steps below have been corrected to match.
|
||||||
|
|
||||||
## What runs where
|
## 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
|
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
|
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`.
|
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
|
4. **Code.** Put the repository at `/opt/hermeven/app` (a clone, or `git archive <sha> | tar -x`),
|
||||||
needed: the bridge runs through `tsx`.)
|
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
|
5. **Configuration.** Copy `deploy/bridge.env.example` to `/etc/hermeven/bridge.env`, fill it
|
||||||
in, `chmod 600`, `chown hermeven`.
|
in, `chmod 600`, `chown hermeven`.
|
||||||
5a. **Speech model.** As root (not the service user), fetch and verify the pinned model into a
|
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:
|
directory the service can read but not write:
|
||||||
```sh
|
```sh
|
||||||
HERMEVEN_ENV_FILE=/etc/hermeven/bridge.env npm --prefix /opt/hermeven run bridge:cli -- fetch-model
|
cd /opt/hermeven/app/services/bridge
|
||||||
HERMEVEN_ENV_FILE=/etc/hermeven/bridge.env npm --prefix /opt/hermeven run bridge:cli -- verify-model
|
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
|
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
|
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`.
|
`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:
|
10. **Pair.** On the droplet, as the service user with the same environment:
|
||||||
```sh
|
```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
|
11. **Origin.** Open the phone page, read Diagnostics, "Page origin", put it in
|
||||||
`HERMEVEN_ALLOWED_ORIGINS`, restart the service.
|
`HERMEVEN_ALLOWED_ORIGINS`, restart the service.
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
# Droplet deployment record, 2026-11-21
|
||||||
|
|
||||||
|
First deployment of the bridge. Done by Claude over SSH with Dan's approval for each kind of
|
||||||
|
change. This is evidence about the server only. **Nothing here involved the glasses or a phone.**
|
||||||
|
|
||||||
|
## Where
|
||||||
|
|
||||||
|
| Item | Value |
|
||||||
|
|---|---|
|
||||||
|
| Host | The existing Hermes droplet (Ubuntu 24.04, 4 vCPU "DO-Premium-AMD", 8 GB RAM), not a new one |
|
||||||
|
| Public name | `hermeven.xylo.gg` |
|
||||||
|
| Deployed commit | `f02715fb6487f4e2ff0adeccfaad2403e1724aa5` (the commit Cody marked SHIP), copied with `git archive` |
|
||||||
|
| Hermes | v0.23.1; profile `default` (Pepper) |
|
||||||
|
|
||||||
|
## What was changed on the server
|
||||||
|
|
||||||
|
| Change | Detail |
|
||||||
|
|---|---|
|
||||||
|
| Retired the unfinished browser-extension service | `hermes-extension-api-v0222` (crash-looping on a missing module) and `hermes-fury-extension-tunnel` (an SSH reverse tunnel of port 8642 to Dan's desktop) stopped and disabled. Unit files left in place. |
|
||||||
|
| Rotated `API_SERVER_KEY` | The old key was also in the retired extension's environment file. New 64-character key. |
|
||||||
|
| Enabled the Hermes API server | `platforms.api_server.enabled: true`, loopback `127.0.0.1:8642`. Gateway restarted once; about 33 s of downtime for `default`, `cody`, `natalie`, `wendy`. |
|
||||||
|
| Backups | The previous `config.yaml` and `.env` are in `~hermes/.hermes/backups/hermeven-20261121T195611Z/` (mode 600). |
|
||||||
|
| Node.js | v22.23.5 from nodejs.org, SHA-256 verified, at `/opt/node`. |
|
||||||
|
| Service user and state | `hermeven` (system user); `/var/lib/hermeven` 0700. |
|
||||||
|
| Bridge | `/opt/hermeven/app`, dependencies installed as `hermeven`, tree owned by root. Service `hermeven-bridge` on `127.0.0.1:8787`. |
|
||||||
|
| Speech model | Pinned `whisper-base` fetched and verified into `/opt/hermeven/models` (root-owned, read-only to the service). |
|
||||||
|
| Caddy | Ubuntu package 2.6.2; Let's Encrypt certificate obtained. Proxies `/v1/*` and `/healthz` to the bridge; serves the built client from `/opt/hermeven/www`. |
|
||||||
|
| Firewall | 80 and 443 opened. 8787 and 8642 are not reachable from outside. |
|
||||||
|
|
||||||
|
## Differences from the written guide (now corrected in it)
|
||||||
|
|
||||||
|
- The service starts Node directly (`node --import tsx src/main.ts`) instead of `npm run`.
|
||||||
|
- The code lives in `/opt/hermeven/app`, not `/opt/hermeven`.
|
||||||
|
- Caddy also serves the built phone page from the bridge's own origin.
|
||||||
|
- The built client was compiled on the desktop with the bridge address preset and uploaded.
|
||||||
|
|
||||||
|
## What was verified, and how
|
||||||
|
|
||||||
|
| Check | Result |
|
||||||
|
|---|---|
|
||||||
|
| Hermes API: `/health` | `{"status":"ok","platform":"hermes-agent","version":"0.23.1"}` |
|
||||||
|
| Hermes API without a key, and with a wrong key | 401, 401 |
|
||||||
|
| Hermes capabilities | runs, status, stop: true; idempotency supported, durable, 86,400 s |
|
||||||
|
| Bridge start | `stt.loading` then `stt.ready` in 2.0 s; 462 MB resident |
|
||||||
|
| State file modes | directory 700; database, WAL, SHM 600; owner `hermeven` |
|
||||||
|
| Transcription of the 11 s speech fixture, three runs | 2.3 s, 2.1 s, 1.8 s; transcript correct. A 4 s clip: 1.3 s |
|
||||||
|
| Typed question through the bridge to Pepper (real model) | "pong", outcome `succeeded`, 5.2 s in the agent |
|
||||||
|
| Follow-up in the same conversation ("what word did you reply with?") | "pong", 1.8 s: Hermes carried the context |
|
||||||
|
| From outside: `https://hermeven.xylo.gg/healthz` | 200 |
|
||||||
|
| From outside: `/v1/device` with no credential | 401 |
|
||||||
|
| From outside: plain HTTP | 308 redirect to HTTPS |
|
||||||
|
| From outside: ports 8787 and 8642 directly | no connection |
|
||||||
|
| The other agents and the n8n webhook after the restart | all five profiles `running`; webhook health ok |
|
||||||
|
|
||||||
|
The test device used for the two questions was revoked afterwards. Those two questions are real
|
||||||
|
turns in Pepper's history, in their own session.
|
||||||
|
|
||||||
|
## Not verified
|
||||||
|
|
||||||
|
- Anything on a phone or the glasses: page load in the Even app, pairing from the phone, the
|
||||||
|
microphone, the display, locked-phone behaviour.
|
||||||
|
- Speech from the glasses' microphone. The transcription timings use a clean archive recording.
|
||||||
|
- A question that makes Pepper use a tool or ask for approval.
|
||||||
|
- Memory and latency under sustained use; behaviour when Whisper and several agents are busy at once.
|
||||||
|
- Backups of `/var/lib/hermeven`, log rotation, monitoring, and an upgrade procedure.
|
||||||
|
- The service was started with these hardening options and loaded the model, but no option was
|
||||||
|
tested by trying to violate it.
|
||||||
Reference in New Issue
Block a user