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:
@@ -66,8 +66,8 @@ description
|
|||||||
|
|
||||||
msg_ok "Completed successfully!\n"
|
msg_ok "Completed successfully!\n"
|
||||||
echo -e "${CREATING}${GN}Hermes Agent setup has been successfully initialized!${CL}"
|
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 "${INFO}${YW} Configure your model provider and gateway server:${CL}"
|
||||||
echo -e "${TAB}${BGN}su - hermes${CL}"
|
echo -e "${TAB}${BGN}hermes-setup${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 "${INFO}${YW} Key for Hermes API Server stored in:${CL}"
|
||||||
echo -e "${TAB}${BGN}/home/hermes/.hermes/.env${CL}"
|
echo -e "${TAB}${BGN}/home/hermes/.hermes/.env${CL}"
|
||||||
|
|||||||
@@ -93,10 +93,31 @@ EOF
|
|||||||
systemctl enable -q --now hermes-dashboard
|
systemctl enable -q --now hermes-dashboard
|
||||||
msg_ok "Created Dashboard Service"
|
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"
|
msg_info "Configuring Login Hints"
|
||||||
cat <<'HINT' >/etc/profile.d/hermes-hint.sh
|
cat <<'HINT' >/etc/profile.d/hermes-hint.sh
|
||||||
if [[ "$(id -u)" -eq 0 ]]; then
|
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
|
fi
|
||||||
HINT
|
HINT
|
||||||
msg_ok "Configured Login Hints"
|
msg_ok "Configured Login Hints"
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
"type": "warning"
|
"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"
|
"type": "info"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user