Skip to content

Add the SSH gateway for session-provider hosts - #15

Merged
czpython merged 1 commit into
mainfrom
gateway
Aug 20, 2026
Merged

Add the SSH gateway for session-provider hosts#15
czpython merged 1 commit into
mainfrom
gateway

Conversation

@czpython

@czpython czpython commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Part of #14 (M1 + M2).

Summary

Sandboxes have no dialable address: the daemon stops them when idle and owns the data plane. The gateway gives their hosts a normal SSH path.

ssh -p 2222 -i <private-key> <host-name>@<gateway-address>

The gateway authenticates the key against the host's stored public key, requires the username to name the same host, and opens an sbx exec session. A stopped sandbox wakes on connect (~6 s) and stays awake while connected. A shell and command execution only; SFTP, scp, and port forwarding are refused.

Changes

  • src/gateway/: the asyncssh server, python -m gateway.server.
  • Gateway providers declare their session process; docker-sbx dials sbx exec, with a local PTY pair when the caller requests a terminal, and a separate error stream in pipe mode.
  • Migration 0003: hosts.public_key stores the public half of the per-host keypair.
  • Session-provider hosts advertise the gateway coordinates; known_hosts pins the gateway's host key.
  • docs/deploy.md: gateway section and settings.

Verification

  • ruff, format, pyright: clean; pytest: 393 pass
  • End to end on a real host, in host mode and containerized: create, exec with exit codes, PTY, sleep/wake, renew, delete, 5 parallel hosts with parallel gateway sessions
  • Playwright conformance (DEFAULT_HOST_PROVIDER=docker-sbx): 9 passed, 1 skipped in both modes

Sandboxes have no dialable address: the daemon stops them when idle and
owns the data plane. The gateway is the SSH path. A caller connects
with the per-host key and the host name as the username; the gateway
opens an sbx exec session, which wakes a stopped sandbox and keeps it
awake while connected. A shell and command execution only.
@czpython
czpython merged commit 34903a7 into main Aug 20, 2026
6 checks passed
@czpython
czpython deleted the gateway branch August 20, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant