docs: document headless NAS deployment (#710)

* docs: document headless NAS deployment

* docs: keep NAS gateway private during setup
This commit is contained in:
Yibo Xi
2026-10-04 02:37:42 +08:00
committed by GitHub
parent be832ff01b
commit 22b1ed5b7a
+45
View File
@@ -800,6 +800,51 @@ the container as healthy (Compose: `depends_on: condition: service_healthy`)
with no curl in the image. Bind-mounting a folder at `/config` in place of a
named volume works too; it has to be writable by uid 65532.
#### NAS with agents on other machines
Magpie can run on a headless NAS as a shared gateway even when the agents that
use it (Claude Code, Codex, OpenCode, and so on) run on other computers. The
container does not discover agent installations on the NAS host or on remote
machines: configure those agents to use the NAS address and an enabled gateway
key. See [Connecting anything else](#connecting-anything-else) for the
protocol-specific base URLs. Keep `3425` behind a firewall or VPN and do not
expose it publicly without gateway-key authentication.
For a bind-mounted configuration directory, the directory must be writable by
the non-root container user (uid 65532):
```sh
sudo chown -R 65532:65532 /volume1/docker/magpie/config
```
An example Docker Compose project is:
```yaml
services:
magpie:
image: ghcr.io/yetone/magpie:latest
restart: unless-stopped
ports:
# Keep both ports on loopback until LAN sharing and a gateway key exist.
- "127.0.0.1:3425:3425"
- "127.0.0.1:3430:3430"
environment:
MAGPIE_ADDR: 0.0.0.0:3425
MAGPIE_PUBLIC_URL: http://<nas-address>:3425
MAGPIE_WEB_KEY: <random-key>
volumes:
- ./config:/config
command: [web, --addr, 0.0.0.0:3430, --no-open]
```
Open `http://127.0.0.1:3430/?k=<random-key>` through an SSH tunnel to
configure providers. Turn on *Share on local network*, then create a gateway
key for each remote agent host. After that, change the gateway mapping to
`3425:3425` (or bind it only to the NAS interface or VPN address) and recreate
the container so remote agents can reach it. For Internet access, prefer a
VPN such as Tailscale or WireGuard; if a reverse proxy is used, it must
authenticate clients itself when it forwards to Magpie over loopback.
### Developing
```sh