# 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 # systemctl daemon-reload && systemctl enable --now hermeven-bridge [Unit] Description=Hermeven bridge After=network-online.target Wants=network-online.target [Service] Type=simple User=hermeven Group=hermeven WorkingDirectory=/opt/hermeven/app/services/bridge # Secrets live here, mode 600, owned by the service user. Never in the repository. Environment=HERMEVEN_ENV_FILE=/etc/hermeven/bridge.env # 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 RestartSec=3 # In-flight turns are recovered from SQLite on the next start. TimeoutStopSec=20 # Hardening # Everything the service creates is owner-only (database, WAL, SHM). UMask=0077 StateDirectory=hermeven StateDirectoryMode=0700 NoNewPrivileges=true PrivateTmp=true ProtectSystem=strict ProtectHome=true ReadWritePaths=/var/lib/hermeven # The verified speech model is read-only to the service: it lives under /opt (see ProtectSystem). ProtectKernelTunables=true ProtectControlGroups=true RestrictSUIDSGID=true # The speech model needs roughly 0.8 GB resident; leave headroom. MemoryMax=1500M [Install] WantedBy=multi-user.target