20 Commits

Author SHA1 Message Date
Stephen Chin
b1185c088b fix(hermesagent): hint to use 'su - hermes' with dash to source .profile 2026-05-26 00:34:12 -07:00
Stephen Chin
5f0200032e fix(hermesagent): enable gateway user service after hermes-setup
If hermes setup created a user service for the gateway, enable and
start it as the hermes user. Linger is pre-enabled so the service
survives without an interactive session.
2026-05-24 16:04:14 -07:00
Stephen Chin
965d0ff1d4 fix(hermesagent): remove redundant guards from hermes-setup; restore completion message wording 2026-05-24 13:18:43 -07:00
Stephen Chin
c80dbaa5e6 feat(hermesagent): add hermes-setup helper script for first-time setup
- Add /usr/bin/hermes-setup that runs hermes setup as root, allowing
  optional components (TTS engines, browsers, etc.) to be installed,
  then restores ownership and permissions on /home/hermes
- Update login hint to reference hermes-setup
- Update completion message to guide users to hermes-setup and note
  that the gateway service should be installed as a user service
- Update JSON note to reflect new setup flow
2026-05-24 11:58:58 -07:00
Stephen Chin
285870baa9 fix(hermes-agent): remove redundant redact_secrets workarounds
hermes-agent v2026.5.7 (PR #21193, merged 2026-05-07) flipped
HERMES_REDACT_SECRETS and DEFAULT_CONFIG security.redact_secrets to
true by default. The explicit HERMES_REDACT_SECRETS=true in .env and
the config.yaml creation block added in commit 1420682e are now
redundant — Hermes writes the same values itself on a fresh install.

Verified on CT 900 (v2026.5.7): _REDACT_ENABLED=True with no env
override; Hermes self-writes redact_secrets: true to config.yaml.

Ref: NousResearch/hermes-agent#17691
2026-05-10 21:36:22 -07:00
Stephen Chin
91104fe71c set security.redact_secrets: true in config.yaml on install 2026-05-10 20:34:02 -07:00
Stephen Chin
84f20e8b15 fix(hermesagent): clean up footer, login hint, JSON notes and config_path 2026-05-10 17:14:48 -07:00
Stephen Chin
0c4678c0b4 fix(hermesagent): remove redundant web dashboard pip install; upstream installer includes web,pty extras in .[all] 2026-05-10 15:44:39 -07:00
Stephen Chin
46746538a0 fix(hermesagent): source /etc/default/hermes via setsid; drop inline env vars and HERMES_HOME 2026-05-10 15:39:22 -07:00
Stephen Chin
c685754144 fix(hermesagent): restore setsid to suppress installer TUI; remove redundant EnvironmentFile for .env 2026-05-10 15:30:20 -07:00
Stephen Chin
b3faacb5e1 fix(hermesagent): split env into /etc/default/hermes and .env; use NODE_OPTIONS from setup_nodejs 2026-05-10 15:18:31 -07:00
Stephen Chin
43cc3c83d2 fix(hermesagent): set XDG_RUNTIME_DIR in hermes .profile for SSH access 2026-05-10 14:10:53 -07:00
Stephen Chin
6a4c88c4cc fix(hermesagent): slim down login hint to su and dashboard tunnel only 2026-05-10 14:10:26 -07:00
Stephen Chin
1671917bab fix(hermesagent): move systemd env vars to EnvironmentFile 2026-05-10 14:10:09 -07:00
Stephen Chin
0b11ce1681 fix(hermesagent): add external script warning and remove redundant check
Adds third-party script warning with user confirmation before running
the upstream installer (install) and updater (update), matching the
kasm/pihole pattern. Removes redundant binary existence check per
reviewer feedback. Adds corresponding JSON warning note.
2026-05-09 11:50:57 -07:00
Stephen Chin
67d49e0b8a fix(hermesagent): single-line apt install for single dependency 2026-05-09 10:30:59 -07:00
Stephen Chin
434e170ee3 fix(hermesagent): move service details from CT footer to MOTD
Trims the verbose 12-line CT footer to the standard pattern plus
essential first-run setup steps. API server, API key, and dashboard
SSH tunnel details are now displayed on every SSH login via
/etc/profile.d/hermes-hint.sh instead.

Addresses PR feedback from CrazyWolf13.
2026-05-09 10:27:37 -07:00
Stephen Chin
a0bffe7a4f feat(hermesagent): replace shim+system-unit pattern with hermes-native user services
The previous approach used a /usr/bin/hermes shim to proxy commands from root
to the hermes user, and a hand-crafted system-level systemd unit for the
gateway. This worked for the default profile but broke down for named profiles:

- hermes profile create <name> generates an alias script in
  ~/.local/bin/<name> that calls hermes with -p <name>. These aliases live
  in the hermes user's PATH, not root's, so root could not invoke them.
- Maintaining parity would require per-profile shims, a watcher daemon to
  create/remove them, and system-unit mirrors for each profile gateway — all
  of which would need to stay in sync with hermes internals across updates.

New approach — work with hermes, not around it:

- loginctl enable-linger hermes: ensures the hermes user's systemd session
  starts at boot and persists without login. All user-unit gateways (default
  and per-profile) now survive reboots automatically.
- Gateway service management delegated entirely to hermes: 'hermes gateway
  install' / 'hermes setup' create and enable the user unit natively.
  The install script no longer pre-installs the gateway; hermes prompts the
  user to do so at the end of 'hermes setup'.
- hermes-dashboard.service remains a system unit (no native install command
  exists for it). Its After= no longer references hermes-gateway.service
  since there is no system-unit gateway to depend on.
- /usr/bin/hermes shim removed. Root is guided to 'su - hermes' via a two-
  line /etc/profile.d/hermes-hint.sh message on login, with a one-liner to
  make the switch automatic. Once logged in as hermes, all hermes commands,
  profile aliases, and gateway management work natively.
- update_script simplified: only hermes-dashboard (our unit) is stopped and
  restarted. hermes update --yes handles gateway service lifecycle itself.
2026-05-03 15:22:11 -07:00
Stephen Chin
8afb182095 fix(hermesagent): shim handles hermes user invocation
runuser requires root. When the hermes user calls the shim directly
(e.g. via su - hermes), exec the binary directly instead.
2026-05-02 12:30:34 -07:00
Stephen Chin
06d9c62e54 fix(hermes-agent): rename files to match NSAPP derivation
APP='Hermes Agent' produces NSAPP='hermesagent' via build.func's
lowercase+strip-spaces logic. Rename ct/, install/, json/, and
header files to match.
2026-05-02 09:45:59 -07:00