Skip to content

Commit f3da381

Browse files
feat: minimal container sandbox + server tokens + toy UI (anomalyco#494)
* feat(server): add scoped tokens, inbox/outbox, toy UI, and auth hardening - TokenService with file-based persistence (tokens.json) - /tokens CRUD (host auth), /whoami (client auth) - Bearer token auth accepting OPENWORK_TOKEN or scoped tokens - POST /workspace/:id/inbox (multipart upload) - GET /workspace/:id/artifacts, /workspace/:id/artifacts/:id - Toy UI at /ui with SSE, prompt send, inbox upload, outbox download - Extended GET /capabilities with schemaVersion, serverVersion, approvals info - Updated README with all new endpoints and auth model * feat(headless): add sandbox runtime with Docker and Apple container backends - --sandbox none|auto|docker|container CLI flag - --sandbox-image, --sandbox-persist-dir, --sandbox-mount options - Mount security: allowlist, blocked patterns, symlink resolution - Docker backend: workspace/persist volumes, sidecar staging, entrypoint - Apple container backend: --mount type=bind for ro mounts - Sandbox mode proxies all OpenCode access through openwork-server - Proxy health check (waitForHealthyViaProxy) avoids SDK auth issues - Sandbox-specific check suite (runSandboxChecks) for --check mode - Non-fatal verifyOpenworkServer in sandbox mode for version mismatches - Updated README with sandbox docs and mount security * feat(packaging): add Docker/docker-compose PaaS packaging - Dockerfile (node:22-bookworm-slim, installs openwrk via npm) - docker-compose.yml with workspace and data volumes - README with usage instructions * fix(headless): define sandbox owpenbot internal health port
1 parent cba77fa commit f3da381

10 files changed

Lines changed: 2986 additions & 188 deletions

File tree

‎packages/headless/README.md‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,45 @@ The command prints pairing details (OpenWork server URL + token, OpenCode URL +
5050
Use `--detach` to keep services running and exit the dashboard. The detach summary includes the
5151
OpenWork URL, tokens, and the `opencode attach` command.
5252

53+
## Sandbox mode (Docker / Apple container)
54+
55+
`openwrk` can run the sidecars inside a Linux container boundary while still mounting your workspace
56+
from the host.
57+
58+
```bash
59+
# Auto-pick sandbox backend (prefers Apple container on supported Macs)
60+
openwrk start --sandbox auto --workspace /path/to/workspace --approval auto
61+
62+
# Explicit backends
63+
openwrk start --sandbox docker --workspace /path/to/workspace --approval auto
64+
openwrk start --sandbox container --workspace /path/to/workspace --approval auto
65+
```
66+
67+
Notes:
68+
69+
- `--sandbox auto` prefers Apple `container` on supported Macs (arm64), otherwise Docker.
70+
- Docker backend requires `docker` on your PATH.
71+
- Apple container backend requires the `container` CLI (https://github.com/apple/container).
72+
- In sandbox mode, sidecars are resolved for a Linux target (and `--sidecar-source` / `--opencode-source`
73+
are effectively `downloaded`).
74+
- Custom `--*-bin` overrides are not supported in sandbox mode yet.
75+
- Use `--sandbox-image` to pick an image with the toolchain you want available to OpenCode.
76+
- Use `--sandbox-persist-dir` to control the host directory mounted at `/persist` inside the container.
77+
78+
### Extra mounts (allowlisted)
79+
80+
You can add explicit, validated mounts into `/workspace/extra/*`:
81+
82+
```bash
83+
openwrk start --sandbox auto --sandbox-mount "/path/on/host:datasets:ro" --workspace /path/to/workspace
84+
```
85+
86+
Additional mounts are blocked unless you create an allowlist at:
87+
88+
- `~/.config/openwork/sandbox-mount-allowlist.json`
89+
90+
Override with `OPENWRK_SANDBOX_MOUNT_ALLOWLIST`.
91+
5392
## Logging
5493

5594
`openwrk` emits a unified log stream from OpenCode, OpenWork server, and Owpenbot. Use JSON format for

0 commit comments

Comments
 (0)