From f625c9a670fdb46b302d8097636914551417f8bc Mon Sep 17 00:00:00 2001
From: Mikei386 <44135113+Mikei386@users.noreply.github.com>
Date: Fri, 16 Oct 2026 14:28:22 +0200
Subject: [PATCH] Use official LinuxServer package mod for Hermes Webtop
---
.../hermes-unraid/webtop-workspace/AGENTS.md | 5 ++-
.../hermes-unraid/webtop-workspace/README.md | 45 ++++++++++---------
...{install-tools.sh => configure-session.sh} | 31 +------------
...igration-official-packages-2026-10-16.json | 17 +++++++
.../webtop-workspace/my-Hermes-Workspace.xml | 2 +
5 files changed, 47 insertions(+), 53 deletions(-)
rename integrations/hermes-unraid/webtop-workspace/{install-tools.sh => configure-session.sh} (59%)
mode change 100755 => 100644
create mode 100644 integrations/hermes-unraid/webtop-workspace/migration-official-packages-2026-10-16.json
diff --git a/integrations/hermes-unraid/webtop-workspace/AGENTS.md b/integrations/hermes-unraid/webtop-workspace/AGENTS.md
index fba9357..7a33ae4 100644
--- a/integrations/hermes-unraid/webtop-workspace/AGENTS.md
+++ b/integrations/hermes-unraid/webtop-workspace/AGENTS.md
@@ -14,6 +14,7 @@ Verify the actual result after actions. A driver action reported as unverifiable
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.
+Native Debian packages are managed by the official LinuxServer universal-package-install Docker mod.
+The Unraid container variable INSTALL_PACKAGES lists packages separated by |. Change that setting for persistent reinstalls.
+An ad-hoc apt install alone does not survive an image update. Supported portable GUI apps can use official proot-apps.
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
index 6848f7f..f42b50c 100644
--- a/integrations/hermes-unraid/webtop-workspace/README.md
+++ b/integrations/hermes-unraid/webtop-workspace/README.md
@@ -32,30 +32,31 @@ Host `/mnt/nvme-storage/appdata/Hermes-Workspace` 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.
+Native packages now use the official LinuxServer Docker mod:
-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.
+```
+DOCKER_MODS=linuxserver/mods:universal-package-install
+INSTALL_PACKAGES=openssh-server|rsync|python3|python3-venv|python3-pil|nodejs|curl|ca-certificates|xdotool|at-spi2-core|dbus-x11|xauth
+```
-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.
+The variables are stored in the live Unraid template. Packages are reinstalled
+on image recreation; they are not stored in home. The former custom package
+installer and packages.txt have been removed. For supported portable GUI apps,
+LinuxServer recommends proot-apps instead.
+Official reference: https://docs.linuxserver.io/selkies/user-guide/installing-apps/
-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.
+`configure-session.sh` is configuration only, deployed as
+`init/90-hermes-session-config`. It contains no apt, npm, curl, or binary-download
+installation. It configures key-only SSH, desktop environment, symlinks and
+ownership, using LinuxServer's custom init mechanism. `sshd-service.sh` remains
+as `services/sshd`. These Hermes-specific helpers are not vendor-provided
+integrations and remain necessary for the existing SSH/desktop connection.
+
+Existing Cua and agent-browser files remain in the persistent tools mount;
+`webtop-session` and `webtop-browser` live in tools/bin. A fresh restore requires
+this tools directory as well as the home, init and services directories.
+Browser profile is `/config/.hermes-workspace/browser-profile`; work remains
+`/config/workspace`. No user data or keys were removed by the migration.
## Hermes integration
@@ -177,7 +178,7 @@ requires ownership to match its runtime user. Chown of this directory to abc:abc
allowed the existing s6 supervisor to start PulseAudio normally; no audio/streaming
service script was patched and no manual readiness marker was fabricated.
-The same correction is now in install-tools.sh for subsequent image recreations.
+The same correction is now in configure-session.sh for subsequent image recreations.
Confirmed PulseAudio up, readiness PID present, Selkies listening on localhost:8082,
and a real WSS upgrade through published HTTPS port 3021 at /api/websockets. Three
actual server messages were received. Direct browser video-frame rendering is not
diff --git a/integrations/hermes-unraid/webtop-workspace/install-tools.sh b/integrations/hermes-unraid/webtop-workspace/configure-session.sh
old mode 100755
new mode 100644
similarity index 59%
rename from integrations/hermes-unraid/webtop-workspace/install-tools.sh
rename to integrations/hermes-unraid/webtop-workspace/configure-session.sh
index 42bbaf0..69e89da
--- a/integrations/hermes-unraid/webtop-workspace/install-tools.sh
+++ b/integrations/hermes-unraid/webtop-workspace/configure-session.sh
@@ -1,25 +1,6 @@
#!/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
+# Configuration only. Native packages are managed by the official LinuxServer mod.
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
@@ -27,14 +8,6 @@ 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
@@ -64,7 +37,7 @@ ln -sf /opt/hermes-workspace/cua/cua-driver /usr/local/bin/cua-driver
# PulseAudio requires the configuration directory to belong to its runtime user.
# Old Webtop homes can retain the former PUID; retain content and correct ownership.
if test -d /config/.config/pulse; then chown -R abc:abc /config/.config/pulse; fi
-chown abc:abc /config/.hermes-workspace /config/.hermes-workspace/packages.txt
+chown abc:abc /config/.hermes-workspace
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
diff --git a/integrations/hermes-unraid/webtop-workspace/migration-official-packages-2026-10-16.json b/integrations/hermes-unraid/webtop-workspace/migration-official-packages-2026-10-16.json
new file mode 100644
index 0000000..e3dc9a8
--- /dev/null
+++ b/integrations/hermes-unraid/webtop-workspace/migration-official-packages-2026-10-16.json
@@ -0,0 +1,17 @@
+{
+ "package_installation": "linuxserver/mods:universal-package-install",
+ "old_custom_installer_removed": true,
+ "old_packages_list_removed": true,
+ "container_recreated": true,
+ "hermes_uid_99_ssh": true,
+ "mcp_tools_discovered": 64,
+ "mcp_start_session": true,
+ "mcp_desktop_state": true,
+ "data_and_key_mounts_preserved": true,
+ "remaining_custom_components": [
+ "configuration-only init",
+ "sshd service",
+ "desktop/browser session wrappers"
+ ],
+ "note": "No inference test required; actual SSH and MCP transport tested. Safari self-signed certificate limitation unchanged."
+}
diff --git a/integrations/hermes-unraid/webtop-workspace/my-Hermes-Workspace.xml b/integrations/hermes-unraid/webtop-workspace/my-Hermes-Workspace.xml
index 6523c62..fbfaae2 100644
--- a/integrations/hermes-unraid/webtop-workspace/my-Hermes-Workspace.xml
+++ b/integrations/hermes-unraid/webtop-workspace/my-Hermes-Workspace.xml
@@ -23,4 +23,6 @@
Europe/Berlin
Hermes Workspace
de_DE.UTF-8
+ linuxserver/mods:universal-package-install
+ openssh-server|rsync|python3|python3-venv|python3-pil|nodejs|curl|ca-certificates|xdotool|at-spi2-core|dbus-x11|xauth
\ No newline at end of file