diff --git a/ct/hermesagent.sh b/ct/hermesagent.sh index 33c25a7f..cdf3d87d 100644 --- a/ct/hermesagent.sh +++ b/ct/hermesagent.sh @@ -66,8 +66,8 @@ description msg_ok "Completed successfully!\n" echo -e "${CREATING}${GN}Hermes Agent setup has been successfully initialized!${CL}" -echo -e "${INFO}${YW} Configure your model provider and gateway server inside the container:${CL}" -echo -e "${TAB}${BGN}su - hermes${CL}" -echo -e "${TAB}${BGN}hermes setup${CL}" -echo -e "${INFO}${YW}Key for Hermes API Server stored in:${CL}" +echo -e "${INFO}${YW} Configure your model provider and gateway server:${CL}" +echo -e "${TAB}${BGN}hermes-setup${CL}" +echo -e "${INFO} When prompted to install the gateway service, choose 'user service'.${CL}" +echo -e "${INFO}${YW} Key for Hermes API Server stored in:${CL}" echo -e "${TAB}${BGN}/home/hermes/.hermes/.env${CL}" diff --git a/install/hermesagent-install.sh b/install/hermesagent-install.sh index 28f6f85e..0707f2f2 100644 --- a/install/hermesagent-install.sh +++ b/install/hermesagent-install.sh @@ -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" diff --git a/json/hermesagent.json b/json/hermesagent.json index 6e5ccb1d..3bb3cbec 100644 --- a/json/hermesagent.json +++ b/json/hermesagent.json @@ -42,7 +42,7 @@ "type": "warning" }, { - "text": "After container startup, login, switch to the hermes user (su - hermes) and run 'hermes setup' to configure your model provider and gateway server.", + "text": "After container startup, login as root and run 'hermes-setup' to configure your model provider and gateway server. When prompted to install the gateway service, install it as a user service (not a system service).", "type": "info" }, {