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
This commit is contained in:
Stephen Chin
2026-05-24 11:58:58 -07:00
parent 9a2657ebc9
commit c80dbaa5e6
3 changed files with 27 additions and 6 deletions

View File

@@ -93,10 +93,31 @@ EOF
systemctl enable -q --now hermes-dashboard
msg_ok "Created Dashboard Service"
msg_info "Creating Setup Helper"
cat <<'SETUP' >/usr/bin/hermes-setup
#!/usr/bin/env bash
if [[ "$(id -u)" -ne 0 ]]; then
echo "Error: hermes-setup must be run as root." >&2
exit 1
fi
if [[ ! -x /home/hermes/.local/bin/hermes ]]; then
echo "Error: Hermes Agent is not installed." >&2
exit 1
fi
set -a; source /etc/default/hermes; set +a
/home/hermes/.local/bin/hermes setup
chown -R hermes:hermes /home/hermes
chmod 750 /home/hermes
chmod 700 /home/hermes/.hermes
echo "Hermes setup complete. File permissions restored."
SETUP
chmod +x /usr/bin/hermes-setup
msg_ok "Created Setup Helper"
msg_info "Configuring Login Hints"
cat <<'HINT' >/etc/profile.d/hermes-hint.sh
if [[ "$(id -u)" -eq 0 ]]; then
echo " Use 'su - hermes' to switch to the hermes user for running Hermes Agent."
echo " Run 'hermes-setup' to configure your model provider and gateway server."
fi
HINT
msg_ok "Configured Login Hints"