diff --git a/install.sh b/install.sh index cef049e..604b334 100755 --- a/install.sh +++ b/install.sh @@ -13,6 +13,7 @@ CHECK_ONLY=false UPDATE_MODE=false UPDATE_ONLY=false UPDATE_AVAILABLE=false +RC_MULTIROOM="false" # ─── Language packs ───────────────────────────────────────── declare -A T @@ -38,6 +39,7 @@ load_lang() { [enter_botuser]="Bot Username (the bot account on the Rocket.Chat server)" [enter_botpass]="Bot Password" [enter_channel]="Home Channel (name or room ID, e.g. #ki-assistent or 69f4e…)" + [multiroom_ask]="Enable multi-room agent? (y/N)" [current_val]=" Current: %s" [new_val]=" → " [summary]="📋 Configuration Summary:" @@ -94,6 +96,7 @@ load_lang() { [enter_botuser]="Bot Username (der Bot-Account auf dem Rocket.Chat Server)" [enter_botpass]="Bot Passwort" [enter_channel]="Home Channel (Name oder Raum-ID, z.B. #ki-assistent oder 69f4e…)" + [multiroom_ask]="Multi-Room-Agent aktivieren? (y/N)" [current_val]=" Aktuell: %s" [new_val]=" → " [summary]="📋 Zusammenfassung der Konfiguration:" @@ -684,6 +687,7 @@ if $NONINTERACTIVE; then RC_BOT_USER="${RC_BOT_USER:-${ROCKETCHAT_USER:-}}" RC_BOT_PASS="${RC_BOT_PASS:-${ROCKETCHAT_PASSWORD:-}}" RC_HOME_CHANNEL="${RC_HOME_CHANNEL:-${ROCKETCHAT_ROOM_NAME:-}}" + RC_MULTIROOM="${RC_MULTIROOM:-false}" if [ -z "$RC_URL" ] || [ -z "$RC_BOT_USER" ] || [ -z "$RC_BOT_PASS" ] || [ -z "$RC_HOME_CHANNEL" ]; then msg env_required; exit 1 fi @@ -699,11 +703,20 @@ else confirm_or_edit RC_BOT_PASS enter_botpass "" confirm_or_edit RC_HOME_CHANNEL enter_channel "$RC_HOME_CHANNEL" + # Multi-Room-Agent: default N (Single-Room, community-tauglich) + printf "%s" "${T[multiroom_ask]} " + read -r multiroom_input + case "${multiroom_input:-}" in + y|Y|yes|ja|Yes|Ja|YES|JA) RC_MULTIROOM="true" ;; + *) RC_MULTIROOM="false" ;; + esac + echo msg summary echo " URL: $RC_URL" echo " Bot User: $RC_BOT_USER" echo " Home Channel: $RC_HOME_CHANNEL" + echo " Multi-Room: $RC_MULTIROOM" echo fi @@ -723,9 +736,10 @@ ROCKETCHAT_ALLOW_ALL_USERS=true GATEWAY_ALLOW_ALL_USERS=true ROCKETCHAT_PING_SEC=8 ROCKETCHAT_IDLE_SEC=900 +RC_MULTIROOM=PLACEHOLDER_RC_MULTIROOM EOF # Ersetze Platzhalter mit python3 (sicher für $-Zeichen im Passwort) -export RC_URL RC_BOT_USER RC_BOT_PASS RC_HOME_CHANNEL +export RC_URL RC_BOT_USER RC_BOT_PASS RC_HOME_CHANNEL RC_MULTIROOM export ENV_FILE python3 -c " import os @@ -736,6 +750,7 @@ content = content.replace('PLACEHOLDER_RC_URL', os.environ.get('RC_URL', '')) content = content.replace('PLACEHOLDER_RC_USER', os.environ.get('RC_BOT_USER', '')) content = content.replace('PLACEHOLDER_RC_PASS', os.environ.get('RC_BOT_PASS', '')) content = content.replace('PLACEHOLDER_RC_CHANNEL', os.environ.get('RC_HOME_CHANNEL', '')) +content = content.replace('PLACEHOLDER_RC_MULTIROOM', os.environ.get('RC_MULTIROOM', 'false')) with open(env_file, 'w') as f: f.write(content) " @@ -882,6 +897,17 @@ fi # Install / refresh systemd user service $PYTHON -m hermes_cli.main gateway install 2>/dev/null || true +# ─── Fix: overwrite generated unit to use "gateway run" ──── +# hermes_cli.main gateway install creates a unit with run_agent.py gateway +# (AI-agent only, no platform adapter). For Rocket.Chat we NEED the full +# gateway run (hermes_cli.main gateway run) which loads platform plugins. +UNIT_FILE="$HOME/.config/systemd/user/hermes-gateway.service" +if [ -f "$UNIT_FILE" ]; then + # Replace ExecStart to use "gateway run" instead of "run_agent.py gateway" + sed -i 's|ExecStart=.*|ExecStart='"$PYTHON"' -m hermes_cli.main gateway run|' "$UNIT_FILE" + systemctl --user daemon-reload 2>/dev/null || true +fi + # ─── Fix #10: systemd EnvironmentFile drop-in ───────────── # Gateway needs rocketchat.env + .env — hermes gateway install # does not wire them automatically.