From 19f58a3f5f965930d8e8943ed2b78c8ee4d94182 Mon Sep 17 00:00:00 2001 From: Mikei386 <44135113+Mikei386@users.noreply.github.com> Date: Fri, 16 Oct 2026 13:53:16 +0200 Subject: [PATCH] Document tested persistent Debian Webtop workspace for Hermes --- .../hermes-unraid/MCP-IMPORT-2026-10-16.md | 13 ++ .../hermes-unraid/webtop-workspace/AGENTS.md | 19 +++ .../hermes-unraid/webtop-workspace/README.md | 128 ++++++++++++++++++ .../webtop-workspace/install-tools.sh | 75 ++++++++++ .../webtop-workspace/my-Hermes-Workspace.xml | 35 +++++ .../webtop-workspace/sshd-service.sh | 2 + .../webtop-workspace/verification.json | 24 ++++ .../webtop-workspace/webtop-browser | 4 + .../webtop-workspace/webtop-session | 15 ++ 9 files changed, 315 insertions(+) create mode 100644 integrations/hermes-unraid/webtop-workspace/AGENTS.md create mode 100644 integrations/hermes-unraid/webtop-workspace/README.md create mode 100755 integrations/hermes-unraid/webtop-workspace/install-tools.sh create mode 100644 integrations/hermes-unraid/webtop-workspace/my-Hermes-Workspace.xml create mode 100755 integrations/hermes-unraid/webtop-workspace/sshd-service.sh create mode 100644 integrations/hermes-unraid/webtop-workspace/verification.json create mode 100755 integrations/hermes-unraid/webtop-workspace/webtop-browser create mode 100755 integrations/hermes-unraid/webtop-workspace/webtop-session diff --git a/integrations/hermes-unraid/MCP-IMPORT-2026-10-16.md b/integrations/hermes-unraid/MCP-IMPORT-2026-10-16.md index c795654..0c0481d 100644 --- a/integrations/hermes-unraid/MCP-IMPORT-2026-10-16.md +++ b/integrations/hermes-unraid/MCP-IMPORT-2026-10-16.md @@ -66,3 +66,16 @@ User authorized a manually managed official Nous desktop sandbox with SSH. Installed Hermes-Sandbox and selected terminal.backend=ssh. See ssh-sandbox/ for complete source, three correct Appdata mounts, Unraid template, tests, update and restore limits. The agent's Docker socket remains absent. + +## Superseding state: persistent Debian Webtop experiment + +The above fixed Nous SSH sandbox was subsequently removed at the user's request, +including its image, Appdata, template and key. User then explicitly authorized +LinuxServer Debian Webtop with persistent additional programs and SSH integration. +Current container is Hermes-Workspace, official lscr.io/linuxserver/webtop:debian-xfce, +not a custom image. Terminal runs over SSH; the existing Webtop display is driven +by official Cua MCP over SSH, not Hermes' separate Bot Screen. No Docker socket. +See [Webtop workspace](webtop-workspace/README.md) for versions, persisted startup +recipes, recreation tests, limitations and restore requirements. Existing 19 MCP +definitions were retained; webtop-desktop adds one (20 total). This section +supersedes both prior sandbox descriptions. diff --git a/integrations/hermes-unraid/webtop-workspace/AGENTS.md b/integrations/hermes-unraid/webtop-workspace/AGENTS.md new file mode 100644 index 0000000..fba9357 --- /dev/null +++ b/integrations/hermes-unraid/webtop-workspace/AGENTS.md @@ -0,0 +1,19 @@ +# Hermes Workspace (Webtop) + +Your terminal backend is SSH into the persistent Hermes-Workspace container, user abc. +Work in /config/workspace. /config is the persistent home. You have no host Docker socket. + +Browser automation: use /opt/hermes-workspace/bin/webtop-browser (agent-browser CLI). +Examples: webtop-browser open URL; webtop-browser snapshot -i; webtop-browser screenshot /config/workspace/page.png. +It uses the visible Webtop Chromium and a persistent browser profile. + +For the existing visible Webtop desktop, discover tools from MCP server webtop-desktop. +Use list_windows/get_window_state to ground actions, then click/type_text/press_key. +Prefer element handles when available; use foreground delivery on this dedicated desktop when background delivery fails. +Verify the actual result after actions. A driver action reported as unverifiable is not proof of success. +Do not use Hermes Bot Screen/computer_use for this desktop: that path creates a separate Xvnc desktop. + +Files, browser profile and tools under /config or /opt/hermes-workspace survive container recreation. +For additional Debian packages, keep one package name per line in /config/.hermes-workspace/packages.txt. +The startup installer restores packages on recreation. An ad-hoc apt install alone does not survive an image update. +Never modify Unraid or other containers to fix a workspace problem. diff --git a/integrations/hermes-unraid/webtop-workspace/README.md b/integrations/hermes-unraid/webtop-workspace/README.md new file mode 100644 index 0000000..5491636 --- /dev/null +++ b/integrations/hermes-unraid/webtop-workspace/README.md @@ -0,0 +1,128 @@ +# Hermes Workspace: Debian Webtop over SSH + +Status: installed and tested on Unraid, 2026-10-16. This supersedes the removed +`Hermes-Sandbox` SSH derivative. User explicitly authorized this Webtop experiment, +including persistent additional packages. No custom Docker image or Hermes code patch. + +## Components and boundaries + +- Community Apps: https://ca.unraid.net/apps/webtop-1mtwder1vw909b +- Image: `lscr.io/linuxserver/webtop:debian-xfce` +- Pulled manifest: `sha256:d925f9c84663fe57735be4defe95a338d32bc37f2e12b9e0f0981e91b6bd0a5d` +- Tested amd64 image ID: `sha256:293999375c3afb3c365aaec873a9d6a6d44b0846cb6376f16b296e2a756e46e5` +- Version: `eb802092-ls217`, vendor build 2026-10-13. +- Cua driver 0.36.0, official release from https://github.com/trycua/cua/releases/tag/cua-driver-rs-v0.36.0 +- Driver SHA256: `d09deb163d5c505493c865c0882ccf261d460c515afe9df1ad1e5d4173f2a4f9` +- agent-browser 0.26.0 from npm; Debian's Chromium from Webtop. +- Container `Hermes-Workspace`, bridge network, UID/GID 1000, no privileged mode, + no Docker socket. Hermes-Agent also has no Docker socket. +- LAN ports: `192.168.1.2:3020` HTTP desktop, `3021` HTTPS desktop, `2224` SSH. + Webtop HTTPS uses its own certificate; a browser may request certificate acceptance. + The persisted Unraid template publishes standard host ports; a GUI recreation may + bind all host interfaces instead of the explicit LAN-IP used by the installation. +- Old never-started Webtop-Debian definition was replaced; its Appdata retained. + Port 3010 belongs to Immich-Kiosk and was not changed. + +## Persistence and update mechanism + +Host `/mnt/nvme-storage/appdata/Webtop-Debian` is `/config` (user home). +Its `init` subdirectory is additionally mounted at `/custom-cont-init.d:ro`; +`services` at `/custom-services.d:ro`; `tools` at `/opt/hermes-workspace`. + +`install-tools.sh` is deployed as `init/10-hermes-tools`; `sshd-service.sh` as +`services/sshd`. `webtop-session` and `webtop-browser` live in `tools/bin`. +These are LinuxServer's documented custom init/service mechanisms: +https://docs.linuxserver.io/general/container-customization/ +LinuxServer does not formally support user-authored extensions themselves. + +The installer restores missing Debian packages from +`/config/.hermes-workspace/packages.txt` when the container is recreated. +Native packages are reinstalled, not magically preserved in the image. Package +repositories/network must therefore be reachable on first boot after recreation. +Node package and Cua binary files live in the persistent tools mount. +Browser profile is `/config/.hermes-workspace/browser-profile`; work is +`/config/workspace`. The boot recipe clears only this browser's stale singleton +locks and own agent-browser runtime socket/PID files before a fresh session starts. + +Additional apt packages must be recorded one per line in packages.txt; an ad-hoc +apt install alone does not survive an image replacement. Other user-installed +software also needs a persistent location or an explicit installation recipe. + +Debian's openssh-server is configured for key-only `abc` login. Host private keys +are under `/config/.hermes-workspace/hostkeys` (root-only); authorized_keys is 0600. +The bootstrap prevents package post-install scripts from starting an unconfigured +sshd. pam_loginuid is removed from this container's SSH PAM chain because container +loginuid cannot be written; neither Unraid PAM nor Hermes binaries are changed. + +## Hermes integration + +Terminal configuration: backend ssh, host 192.168.1.2, port 2224, user abc, +key `/opt/data/ssh/id_ed25519_webtop`, cwd `/config/workspace`. +The dedicated key is generated internally, never printed. MCP pins the host public +key through `/opt/data/ssh/webtop_known_hosts`, obtained directly from the container. +The ordinary SSH backend also has this verified host key in its known_hosts. + +`mcp_servers.webtop-desktop` runs the official Cua MCP driver via SSH: +`/opt/hermes-workspace/bin/webtop-session /opt/hermes-workspace/cua/cua-driver mcp --no-overlay`. +The session helper uses Webtop's existing X11 display `:1` and its current D-Bus +session. This is NOT Hermes' built-in computer_use/Bot Screen path: that path starts +its own separate Xvnc screen. No second Xvnc desktop is installed or started here. + +Browser automation runs through the terminal command +`/opt/hermes-workspace/bin/webtop-browser`, using a headed Chromium with its own +persistent profile. Native Hermes browser tools were not rewritten to point there. +SOUL.md has a short routing instruction; workspace AGENTS.md documents the tools. +Existing instructions were retained and a protected private backup made in +`/opt/data/backups/webtop-20261016`. + +Hermes discovered 66 tools from webtop-desktop. Existing 19 MCP definitions remain +unchanged (20 definitions total). Existing deferred Tool Search behavior remains. +Only Hermes-Agent was restarted to activate its configuration; no Athena, Deck, +OpenCode or other service restart. + +## Verification + +- SSH authenticated as abc with the dedicated key; cwd correct. +- Real Hermes terminal_tool executed commands and opened Example Domain in Chromium. +- Upload/download via scp from Hermes matched exactly. +- Cua MCP captured Webtop's actual 1024x768 desktop and Mousepad window. +- Cua mouse click, foreground keyboard entry and Ctrl+S saved exactly + HERMES_WEBTOP_DESKTOP_OK; verified by independent file read. +- Browser opened a synthetic localhost HTTP fixture, filled a field, clicked its + button and read exactly OK: HERMES_BROWSER_OK. Screenshot visually inspected. +- Public https://example.org navigation and title read passed. +- Actual Hermes MCP discovery/registry registered 66 tools and dispatched list_windows. +- Full container removal/recreation from the same untouched manufacturer image + performed twice. Files, key identity and driver survived; SSH/system packages + were restored by the boot recipe. Final browser/form test passed after recreation. +- Latest image pull reported up-to-date. This tests image recreation, not an + untested future Debian/Python major-version upgrade. +- Final Webtop HTTPS returned 200; Hermes dashboard reachable (302 login redirect). + +Limits: background Cua input is not reliable on every widget. The tested path uses +foreground input on this dedicated desktop. Cua may report `effect: unverifiable`; +verify actual effects independently. Driver emits cursor-overlay warnings despite +--no-overlay; tested capture/input still worked. agent-browser reports that repeated +launch flags are ignored while its already-configured daemon runs; tests passed. +No LLM autonomous multi-step task or broad third-party website compatibility suite +was performed. Tool execution and integration, not model intelligence, were tested. + +## Restore and removal + +This is an optional Unraid integration, not a native Athena Deck dependency. +Back up the entire Webtop-Debian Appdata tree and Hermes-Agent Appdata, including +SSH keys, browser profile, config.yaml and SOUL.md, using an encrypted backup. +Keep the Unraid template `/boot/config/plugins/dockerMan/templates-user/my-Hermes-Workspace.xml`. +No claim that an existing backup job already includes these paths has been made. + +Restore appdata plus template before creating the vendor image. Preserve ownership +and executable bits; root-owned init/service scripts need 0755. Generate a new +SSH key only if the old private backup is unavailable, then replace authorized_keys +internally and re-pin the container host key. Never put keys/cookies/config backups +into Git. On a fresh Debian host Docker plus the documented image/mounts are required; +no dependence on today's Athena CUDA/compiler/model stack. + +For removal: return Hermes terminal to local, remove only webtop-desktop MCP and the +added SOUL section, then remove the Workspace container/template. Preserve user work +unless explicitly asked to delete it. Private pre-change Hermes config backups exist, +but restoring them wholesale later could overwrite newer settings. diff --git a/integrations/hermes-unraid/webtop-workspace/install-tools.sh b/integrations/hermes-unraid/webtop-workspace/install-tools.sh new file mode 100755 index 0000000..ed175aa --- /dev/null +++ b/integrations/hermes-unraid/webtop-workspace/install-tools.sh @@ -0,0 +1,75 @@ +#!/bin/bash +set -euo pipefail +export DEBIAN_FRONTEND=noninteractive +mkdir -p /config/.hermes-workspace /config/.cache/apt/archives/partial +if ! test -f /config/.hermes-workspace/packages.txt; then + printf '%s\n' openssh-server rsync python3 python3-venv python3-pil nodejs curl ca-certificates xdotool at-spi2-core dbus-x11 xauth > /config/.hermes-workspace/packages.txt +fi +packages=() +while IFS= read -r package; do + [[ -z "$package" || "$package" == \#* ]] && continue + [[ "$package" =~ ^[a-z0-9][a-z0-9+.-]*$ ]] || { echo 'Invalid package name'; exit 1; } + dpkg-query -W -f='${Status}' "$package" 2>/dev/null | grep -qx 'install ok installed' || packages+=("$package") +done < /config/.hermes-workspace/packages.txt +if (( ${#packages[@]} )); then + policy_added=0 + if ! test -e /usr/sbin/policy-rc.d; then + printf '#!/bin/sh\nexit 101\n' > /usr/sbin/policy-rc.d; chmod 755 /usr/sbin/policy-rc.d; policy_added=1 + fi + apt-get update + apt-get -o Dir::Cache::archives=/config/.cache/apt/archives install -y --no-install-recommends "${packages[@]}" + if (( policy_added )); then rm /usr/sbin/policy-rc.d; fi +fi +mkdir -p /run/sshd /config/.hermes-workspace/hostkeys /config/workspace /opt/hermes-workspace/bin +chown root:root /config/.hermes-workspace/hostkeys +chmod 700 /config/.hermes-workspace/hostkeys +for kind in ed25519 rsa; do + test -f /config/.hermes-workspace/hostkeys/ssh_host_${kind}_key || ssh-keygen -q -t "$kind" -N '' -f /config/.hermes-workspace/hostkeys/ssh_host_${kind}_key +done +usermod -s /bin/bash abc +if ! test -f /opt/hermes-workspace/cua/version-0.36.0; then + mkdir -p /opt/hermes-workspace/cua + curl -fsSL --retry 3 https://github.com/trycua/cua/releases/download/cua-driver-rs-v0.36.0/cua-driver-rs-0.36.0-linux-x86_64-binary.tar.gz | tar -xz -C /opt/hermes-workspace/cua + touch /opt/hermes-workspace/cua/version-0.36.0 +fi +if ! test -x /opt/hermes-workspace/node/bin/agent-browser; then + npm install -g --prefix /opt/hermes-workspace/node --ignore-scripts --no-audit 'agent-browser@0.26.0' +fi +cat > /etc/ssh/sshd_config.d/hermes-workspace.conf <<'EOF' +Port 22 +HostKey /config/.hermes-workspace/hostkeys/ssh_host_ed25519_key +HostKey /config/.hermes-workspace/hostkeys/ssh_host_rsa_key +PermitRootLogin no +PasswordAuthentication no +KbdInteractiveAuthentication no +PubkeyAuthentication yes +AuthorizedKeysFile /config/.hermes-workspace/authorized_keys +AllowUsers abc +UsePAM yes +AllowTcpForwarding yes +X11Forwarding no +AllowAgentForwarding no +PermitUserEnvironment no +EOF +sed -i '/pam_loginuid.so/d' /etc/pam.d/sshd +cat > /etc/profile.d/hermes-workspace.sh <<'EOF' +export PATH=/opt/hermes-workspace/bin:/opt/hermes-workspace/node/bin:$PATH +export AGENT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium +export AGENT_BROWSER_HEADED=1 +export DISPLAY=:1 +EOF +ln -sf /opt/hermes-workspace/node/bin/agent-browser /usr/local/bin/agent-browser +ln -sf /opt/hermes-workspace/bin/webtop-browser /usr/local/bin/webtop-browser +ln -sf /opt/hermes-workspace/cua/cua-driver /usr/local/bin/cua-driver +chown abc:abc /config/.hermes-workspace /config/.hermes-workspace/packages.txt +chown -R abc:abc /config/workspace /opt/hermes-workspace/node +if test -f /config/.hermes-workspace/authorized_keys; then + chown abc:abc /config/.hermes-workspace/authorized_keys + chmod 600 /config/.hermes-workspace/authorized_keys +fi +if ! pgrep -u "$(id -u abc)" -x chromium >/dev/null; then + rm -f /config/.hermes-workspace/browser-profile/SingletonLock /config/.hermes-workspace/browser-profile/SingletonSocket /config/.hermes-workspace/browser-profile/SingletonCookie + rm -f /config/.agent-browser/hermes-workspace.sock /config/.agent-browser/hermes-workspace.pid /config/.agent-browser/hermes-workspace.engine /config/.agent-browser/hermes-workspace.stream /config/.agent-browser/hermes-workspace.version +fi +chmod +x /config/.local/bin/proot-apps +printf 'ready\n' > /config/.hermes-workspace/setup-ready diff --git a/integrations/hermes-unraid/webtop-workspace/my-Hermes-Workspace.xml b/integrations/hermes-unraid/webtop-workspace/my-Hermes-Workspace.xml new file mode 100644 index 0000000..ea44edf --- /dev/null +++ b/integrations/hermes-unraid/webtop-workspace/my-Hermes-Workspace.xml @@ -0,0 +1,35 @@ + + + Hermes-Workspace + lscr.io/linuxserver/webtop:debian-xfce + https://github.com/orgs/linuxserver/packages/container/package/webtop + bridge + + bash + false + https://github.com/linuxserver/docker-webtop/issues/new/choose + https://github.com/linuxserver/docker-webtop + Webtop(https://github.com/linuxserver/docker-webtop) - Alpine, Ubuntu, Fedora, and Arch based containers containing full desktop environments in officially supported flavors accessible via any modern web browser. + Other: + https://[IP]:[PORT:3001] + https://raw.githubusercontent.com/linuxserver/templates/master/unraid/webtop.xml + https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/webtop-logo.png + --shm-size=1g + + 0 + 1756329008 + Donations + https://www.linuxserver.io/donate + + 3020 + 3021 + + / + Hermes Workspace + /dev/dri + /mnt/nvme-storage/appdata/Webtop-Debian/ + 1000 + 1000 + 022 + +/mnt/nvme-storage/appdata/Webtop-Debian/init/mnt/nvme-storage/appdata/Webtop-Debian/services/mnt/nvme-storage/appdata/Webtop-Debian/tools2224de_DE.UTF-8 diff --git a/integrations/hermes-unraid/webtop-workspace/sshd-service.sh b/integrations/hermes-unraid/webtop-workspace/sshd-service.sh new file mode 100755 index 0000000..5fb6d9a --- /dev/null +++ b/integrations/hermes-unraid/webtop-workspace/sshd-service.sh @@ -0,0 +1,2 @@ +#!/usr/bin/with-contenv bash +exec /usr/sbin/sshd -D -e diff --git a/integrations/hermes-unraid/webtop-workspace/verification.json b/integrations/hermes-unraid/webtop-workspace/verification.json new file mode 100644 index 0000000..98cec89 --- /dev/null +++ b/integrations/hermes-unraid/webtop-workspace/verification.json @@ -0,0 +1,24 @@ +{ + "date": "2026-10-16", + "container": "Hermes-Workspace", + "custom_image": false, + "docker_socket": false, + "privileged": false, + "terminal_backend": "ssh", + "desktop_transport": "cua-driver MCP over SSH on Webtop display :1", + "mcp_tools_discovered": 66, + "existing_mcp_definitions_preserved": 19, + "ssh_auth": "passed", + "hermes_terminal_tool": "passed", + "file_transfer_exact": true, + "desktop_capture": "passed", + "desktop_click_type_save_exact": true, + "gui_input_mode_tested": "foreground", + "browser_local_form_exact": true, + "browser_public_navigation": true, + "browser_screenshot_visually_checked": true, + "container_recreations_tested": 2, + "post_recreation_files_tools_ssh_browser": "passed", + "autonomous_llm_task_tested": false, + "future_image_version_tested": false +} diff --git a/integrations/hermes-unraid/webtop-workspace/webtop-browser b/integrations/hermes-unraid/webtop-workspace/webtop-browser new file mode 100755 index 0000000..5bb40bb --- /dev/null +++ b/integrations/hermes-unraid/webtop-workspace/webtop-browser @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail +mkdir -p /config/.hermes-workspace/browser-profile +exec /opt/hermes-workspace/bin/webtop-session /opt/hermes-workspace/node/bin/agent-browser --session hermes-workspace --profile /config/.hermes-workspace/browser-profile --executable-path /usr/bin/chromium --headed --args '--no-sandbox,--disable-dev-shm-usage' "$@" diff --git a/integrations/hermes-unraid/webtop-workspace/webtop-session b/integrations/hermes-unraid/webtop-workspace/webtop-session new file mode 100755 index 0000000..ddce8c3 --- /dev/null +++ b/integrations/hermes-unraid/webtop-workspace/webtop-session @@ -0,0 +1,15 @@ +#!/bin/bash +set -euo pipefail +export DISPLAY=:1 +export HOME=/config +export PATH=/opt/hermes-workspace/node/bin:/opt/hermes-workspace/bin:/usr/local/bin:/usr/bin:/bin +export AGENT_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium +export AGENT_BROWSER_HEADED=1 +export CUA_DRIVER_RS_TELEMETRY_ENABLED=0 +export RUST_LOG=error +f="/config/.dbus/session-bus/$(cat /etc/machine-id)-1" +if test -f "$f"; then + source "$f" + export DBUS_SESSION_BUS_ADDRESS +fi +exec "$@"