cb26c37eba
- Full mode shows Thinking blocks with expand/collapse - Full mode shows all assistant messages including tool-only - Full mode expands tool calls by default with results (2000 char limit) - Session delete with confirm - Improved deploy script generates service files dynamically
74 lines
1.9 KiB
Bash
74 lines
1.9 KiB
Bash
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
SYSTEMD_DIR="$HOME/.config/systemd/user"
|
|
PORT="${1:-3100}"
|
|
|
|
export PATH="$HOME/.hermes/node/bin:$PATH"
|
|
|
|
echo "→ Building..."
|
|
cd "$PROJECT_DIR"
|
|
HERMES_BACKEND_URL=http://127.0.0.1:8643 npx next build
|
|
|
|
echo "→ Copying static assets..."
|
|
cp -r .next/static .next/standalone/.next/static
|
|
cp -r public .next/standalone/public
|
|
|
|
echo "→ Installing services..."
|
|
mkdir -p "$SYSTEMD_DIR"
|
|
|
|
cat > "$SYSTEMD_DIR/hermes-os.service" << EOF
|
|
[Unit]
|
|
Description=Hermes OS — Mobile dashboard
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
WorkingDirectory=$PROJECT_DIR
|
|
Environment=PATH=$HOME/.hermes/node/bin:/usr/local/bin:/usr/bin:/bin
|
|
Environment=HERMES_BACKEND_URL=http://127.0.0.1:8643
|
|
Environment=HERMES_GATEWAY_URL=http://127.0.0.1:8642
|
|
Environment=HERMES_SOUL_PATH=$HOME/.hermes/SOUL.md
|
|
Environment=NODE_ENV=production
|
|
Environment=PORT=$PORT
|
|
Environment=HOSTNAME=0.0.0.0
|
|
ExecStart=$HOME/.hermes/node/bin/node $PROJECT_DIR/.next/standalone/server.js
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
|
|
[Install]
|
|
WantedBy=default.target
|
|
EOF
|
|
|
|
cat > "$SYSTEMD_DIR/hermes-webapi.service" << EOF
|
|
[Unit]
|
|
Description=Hermes WebAPI (FastAPI)
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
WorkingDirectory=$HOME/.hermes/hermes-agent
|
|
Environment=HERMES_WEBAPI_HOST=0.0.0.0
|
|
Environment=HERMES_CORS_ORIGINS=*
|
|
ExecStart=$HOME/.hermes/hermes-agent/venv/bin/python -m webapi
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
|
|
[Install]
|
|
WantedBy=default.target
|
|
EOF
|
|
|
|
systemctl --user daemon-reload
|
|
systemctl --user enable hermes-os hermes-webapi
|
|
systemctl --user restart hermes-os
|
|
|
|
sleep 3
|
|
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:$PORT" 2>/dev/null || echo "000")
|
|
if [ "$STATUS" = "200" ]; then
|
|
echo "✅ Hermes OS running on http://0.0.0.0:$PORT"
|
|
else
|
|
echo "⚠️ Health check returned $STATUS"
|
|
systemctl --user status hermes-os --no-pager | head -10
|
|
fi
|