Add Unraid-managed persistent Hermes SSH desktop sandbox
This commit is contained in:
1 parent
74fe2ecc47
commit
245a1a01d4
7 files changed
+167
No files matched your search
@@ -59,3 +59,10 @@ binds used host /opt/data instead of the actual persistent appdata path.
|
||||
Verified local backend, absent socket, all 19 MCP entries retained, dashboard
|
||||
HTTP 200, and absence of host /opt/data. Temporary old containers removed.
|
||||
This supersedes the socket-enabled state above. No SSH workspace installed.
|
||||
|
||||
## Final state: fixed SSH workspace
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,14 @@
|
||||
ARG BASE_IMAGE=nousresearch/hermes-sandbox:desktop
|
||||
FROM ${BASE_IMAGE}
|
||||
USER root
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends openssh-server \
|
||||
&& rm -rf /var/lib/apt/lists/* /etc/ssh/ssh_host_* \
|
||||
&& sed -i '/pam_loginuid.so/d' /etc/pam.d/sshd \
|
||||
&& mkdir -p /run/sshd /config/hostkeys /workspace \
|
||||
&& chown pn:pn /workspace
|
||||
COPY sshd_config /etc/ssh/sshd_config
|
||||
COPY start.sh /usr/local/bin/hermes-sandbox-ssh
|
||||
RUN chmod 755 /usr/local/bin/hermes-sandbox-ssh
|
||||
EXPOSE 22
|
||||
ENTRYPOINT ["/usr/local/bin/hermes-sandbox-ssh"]
|
||||
CMD []
|
||||
@@ -0,0 +1,92 @@
|
||||
# Fixed Hermes SSH sandbox — installed 2026-10-16
|
||||
|
||||
Container: Hermes-Sandbox. Image: hermes-sandbox-ssh:local, derived from the
|
||||
published official Nous desktop sandbox. Exact upstream digest: base-image.txt.
|
||||
The derivative adds OpenSSH, key-only login for existing user pn (UID/GID 1000),
|
||||
persistent SSH host keys and an entrypoint. The base's desktop/browser tools and
|
||||
sudo policy for pn remain. No Docker socket, host root, or broad appdata mount
|
||||
is given to this sandbox. Root SSH and password authentication are disabled.
|
||||
|
||||
Unraid-managed label: net.unraid.docker.managed=dockerman; official Hermes icon.
|
||||
Template: my-Hermes-Sandbox.xml in dockerMan/templates-user. Standard bridge,
|
||||
restart unless-stopped, not privileged. Live port mapping is 192.168.1.2:2224 to
|
||||
22. The generic Unraid template exposes host port 2224; review interface binding
|
||||
if recreating through GUI (Docker defaults to all interfaces).
|
||||
|
||||
## Exactly three persistent mounts
|
||||
|
||||
Under /mnt/nvme-storage/appdata/Hermes-Sandbox:
|
||||
|
||||
- config -> /config: authorized public client key and private server host keys.
|
||||
- home -> /home/pn: user tools, settings, virtual environments.
|
||||
- workspace -> /workspace: projects and results.
|
||||
|
||||
No /opt/data paths on the Unraid root filesystem. /opt/data inside Hermes-Agent
|
||||
still correctly refers to that agent's existing persistent appdata mount.
|
||||
Server config directory 0755; authorized_keys owned pn mode 0600; private host
|
||||
key directory 0700/root. Entry point reapplies these modes. Removed PAM loginuid
|
||||
session requirement only inside derivative: Unraid container could authenticate
|
||||
but pam_open_session failed. Other PAM authentication/session rules remain.
|
||||
|
||||
Hermes config.yaml terminal fields:
|
||||
|
||||
```yaml
|
||||
backend: ssh
|
||||
ssh_host: 192.168.1.2
|
||||
ssh_user: pn
|
||||
ssh_port: 2224
|
||||
ssh_key: /opt/data/ssh/id_ed25519_sandbox
|
||||
cwd: /workspace
|
||||
```
|
||||
|
||||
Dedicated key generated privately in Hermes appdata/ssh; never put in Git.
|
||||
Private pre-switch config backup: Hermes appdata/backups/ssh-sandbox-20261016.
|
||||
19 MCP configurations and unrelated settings preserved. Hermes restarted once
|
||||
for activation, not Deck/OpenCode or other production containers.
|
||||
|
||||
## Verification
|
||||
|
||||
- Actual Hermes SSHEnvironment initialized with file synchronization enabled;
|
||||
synthetic execute returned 0 with /workspace, Python 3.13.16 and Node 26.11.1.
|
||||
- SCP uploaded an artificial file, Python appended known text remotely, downloaded
|
||||
result matched exactly; temporary files removed.
|
||||
- Synthetic home/workspace markers survived sandbox restart and were removed.
|
||||
- Final actual terminal_tool call using saved configuration returned exit_code 0,
|
||||
user pn and cwd /workspace. No model inference needed.
|
||||
- Hermes dashboard HTTP 200, all 19 MCP entries retained, socket absent.
|
||||
- All three bind sources and Unraid managed label inspected.
|
||||
- Full computer-use/interactive desktop/browser workflow and model-driven
|
||||
attachment exchange were NOT tested. Mere presence of desktop tools is not
|
||||
an end-to-end GUI verification. Fresh-host restore was not performed.
|
||||
|
||||
## Build, update, restore
|
||||
|
||||
Public Dockerfile, sshd_config, start.sh and Unraid template are in this directory.
|
||||
Copies of the build files are also in sandbox appdata/build. Rebuild on Unraid:
|
||||
|
||||
```sh
|
||||
docker build --build-arg BASE_IMAGE="$(cat base-image.txt)" \
|
||||
-t hermes-sandbox-ssh:local .
|
||||
```
|
||||
|
||||
Use the recorded upstream digest for reconstruction. To update deliberately,
|
||||
review/pull a new upstream desktop image, record its digest, rebuild this small
|
||||
SSH derivative, then recreate only Hermes-Sandbox through the saved Unraid
|
||||
configuration. Existing host keys, home and workspace must remain bound.
|
||||
A generic registry update of the local tag cannot rebuild this derivative;
|
||||
Unraid may report version availability unknown. This does not change its managed
|
||||
status. Runtime apt installs outside mounts do NOT survive image recreation;
|
||||
put fixed system dependencies in this Dockerfile and user venvs under home.
|
||||
|
||||
Back up complete Hermes-Agent and Hermes-Sandbox appdata with the Unraid appdata
|
||||
backup, including agent client key/config and sandbox server host keys. Treat as
|
||||
private credentials; encrypt backup and never add these files to Git. Athena's
|
||||
separate host backup does not automatically cover Unraid. Restore appdata first,
|
||||
build derivative, restore template, preserve uid/gid 1000 for home/workspace,
|
||||
start sandbox, then validate key-only SSH and file roundtrip before Hermes use.
|
||||
|
||||
For a future native Debian Athena installation this remains an optional Unraid
|
||||
client worker, not an implicit native Deck dependency. On a different worker
|
||||
host provision Docker/OpenSSH explicitly, configure its actual address/storage
|
||||
root and backup, and repeat the tests; do not copy Unraid-specific absolute paths
|
||||
blindly. No native Debian fresh-host restore is claimed by this container test.
|
||||
@@ -0,0 +1 @@
|
||||
nousresearch/hermes-sandbox:desktop@sha256:c7d8607d076f26a64e0bd6828f74e1764af43fe3281368188459bb693bfa7567
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Container version="2">
|
||||
<Name>Hermes-Sandbox</Name>
|
||||
<Repository>hermes-sandbox-ssh:local</Repository>
|
||||
<Registry>https://hub.docker.com/r/nousresearch/hermes-sandbox</Registry>
|
||||
<Network>bridge</Network>
|
||||
<Shell>bash</Shell>
|
||||
<Privileged>false</Privileged>
|
||||
<Support>https://github.com/NousResearch/hermes-agent</Support>
|
||||
<Overview>Fixed Hermes SSH workspace. Official Nous desktop sandbox plus OpenSSH. Projects and home persist in appdata. Local image must be rebuilt for updates; no Docker socket.</Overview>
|
||||
<Icon>https://raw.githubusercontent.com/NousResearch/hermes-agent/main/apps/desktop/public/apple-touch-icon.png</Icon>
|
||||
<ExtraParams>--restart unless-stopped</ExtraParams>
|
||||
<WebUI/>
|
||||
<Config Name="SSH Port" Target="22" Default="2224" Mode="tcp" Type="Port" Display="always" Required="true" Mask="false">2224</Config>
|
||||
<Config Name="SSH configuration" Target="/config" Default="/mnt/nvme-storage/appdata/Hermes-Sandbox/config" Mode="rw" Type="Path" Display="always" Required="true" Mask="false">/mnt/nvme-storage/appdata/Hermes-Sandbox/config</Config>
|
||||
<Config Name="Persistent home" Target="/home/pn" Default="/mnt/nvme-storage/appdata/Hermes-Sandbox/home" Mode="rw" Type="Path" Display="always" Required="true" Mask="false">/mnt/nvme-storage/appdata/Hermes-Sandbox/home</Config>
|
||||
<Config Name="Workspace" Target="/workspace" Default="/mnt/nvme-storage/appdata/Hermes-Sandbox/workspace" Mode="rw" Type="Path" Display="always" Required="true" Mask="false">/mnt/nvme-storage/appdata/Hermes-Sandbox/workspace</Config>
|
||||
</Container>
|
||||
@@ -0,0 +1,20 @@
|
||||
Port 22
|
||||
ListenAddress 0.0.0.0
|
||||
HostKey /config/hostkeys/ssh_host_ed25519_key
|
||||
HostKey /config/hostkeys/ssh_host_rsa_key
|
||||
PermitRootLogin no
|
||||
PubkeyAuthentication yes
|
||||
PasswordAuthentication no
|
||||
KbdInteractiveAuthentication no
|
||||
PermitEmptyPasswords no
|
||||
UsePAM yes
|
||||
AllowUsers pn
|
||||
AuthorizedKeysFile /config/authorized_keys
|
||||
StrictModes yes
|
||||
X11Forwarding no
|
||||
AllowAgentForwarding no
|
||||
AllowTcpForwarding yes
|
||||
Subsystem sftp internal-sftp
|
||||
AcceptEnv LANG LC_* PLAYWRIGHT_BROWSERS_PATH XDG_RUNTIME_DIR
|
||||
PidFile /run/sshd/sshd.pid
|
||||
LogLevel ERROR
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
mkdir -p /run/sshd /config/hostkeys /workspace /home/pn /tmp/hermes-runtime
|
||||
chown pn:pn /home/pn /workspace /tmp/hermes-runtime
|
||||
chmod 700 /tmp/hermes-runtime
|
||||
for kind in ed25519 rsa; do
|
||||
key="/config/hostkeys/ssh_host_${kind}_key"
|
||||
if [[ ! -f "$key" ]]; then ssh-keygen -q -t "$kind" -N '' -f "$key"; fi
|
||||
done
|
||||
chmod 755 /config
|
||||
chmod 700 /config/hostkeys
|
||||
chown pn:pn /config/authorized_keys
|
||||
chmod 600 /config/authorized_keys /config/hostkeys/*_key
|
||||
/usr/sbin/sshd -t
|
||||
exec /usr/sbin/sshd -D -e
|
||||
Reference in new issue
Block a user