Skip to content

Support tunnel mode for connections#20

Open
kerthcet wants to merge 4 commits into
InftyAI:mainfrom
kerthcet:feat/support-tunnel
Open

Support tunnel mode for connections#20
kerthcet wants to merge 4 commits into
InftyAI:mainfrom
kerthcet:feat/support-tunnel

Conversation

@kerthcet

Copy link
Copy Markdown
Member

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #

Special notes for your reviewer

Does this PR introduce a user-facing change?


kerthcet added 2 commits June 19, 2026 15:04
Signed-off-by: kerthcet <kerthcet@gmail.com>
Signed-off-by: kerthcet <kerthcet@gmail.com>
Copilot AI review requested due to automatic review settings June 19, 2026 13:35
@InftyAI-Agent InftyAI-Agent added needs-triage Indicates an issue or PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. do-not-merge/needs-kind Indicates a PR lacks a label and requires one. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds “tunnel mode” connectivity (via Tailscale/Headscale) for SandD controller and daemon workflows, along with supporting packaging, Docker, and documentation updates.

Changes:

  • Added tunnel-mode support to the Rust controller (PyO3 bindings) and Rust daemon CLI.
  • Introduced TunnelConfig in the Python API and expanded docs/examples for Headscale-based setups.
  • Reorganized E2E Docker assets under hack/docker/ and updated test/build wiring accordingly.

Reviewed changes

Copilot reviewed 19 out of 23 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
server/src/server.rs Tweaks daemon registration log formatting.
server/src/lib.rs Adds TunnelConfig + tunnel-mode setup logic in Rust/PyO3 server constructor.
sandd/src/main.rs Adds daemon CLI tunnel flags and a Tailscale join routine.
README.md Updates install + quickstart docs and introduces tunnel mode section.
python/tests/test_e2e.py Points E2E tests at the relocated compose file.
python/sandd/server.py Exposes connect/tunnel_config options in the Python Server wrapper.
python/sandd/init.py Exports TunnelConfig from the extension module.
pyproject.toml Updates maturin manifest path and packaging excludes.
Makefile Updates E2E docker-compose path usages.
hack/scripts/install.sh Adds a daemon installation script (currently incomplete/broken).
hack/docker/README.md Documents Docker assets and tunnel-capable images.
hack/docker/Dockerfile.tunnel-release Adds release-mode tunnel server image (PyPI-based).
hack/docker/Dockerfile.tunnel Adds source-build tunnel server image (maturin build).
hack/docker/Dockerfile.rocky Adds Rocky-based daemon image for E2E coverage.
hack/docker/Dockerfile.debian Adds Debian-based daemon image for E2E coverage.
hack/docker/Dockerfile.daemon-tunnel-release Adds release-mode tunnel daemon image (GitHub release binary).
hack/docker/Dockerfile.daemon-tunnel Adds source-build tunnel daemon image.
hack/docker/Dockerfile.alpine Adds Alpine-based daemon image for E2E coverage.
hack/docker/docker-compose.e2e.yml Adds new E2E compose definition for multiple daemon images.
examples/tunnel-simple/README.md Adds a step-by-step tunnel example walkthrough.
examples/tunnel-simple/headscale-config.yaml Adds a minimal Headscale config for the example.
examples/tunnel-simple/docker-compose.yml Adds a complete tunnel-mode example compose stack.
docs/TUNNEL.md Adds extensive tunnel-mode documentation and security guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread hack/scripts/install.sh
Comment thread server/src/lib.rs
Comment on lines +67 to +70
verbose: bool,
connect: String,
tunnel_config: Option<TunnelConfig>,
) -> PyResult<Self> {
Comment thread server/src/lib.rs
Comment on lines +101 to +102
let config = tunnel_config.unwrap();

Comment thread server/src/lib.rs
Comment on lines +482 to +485
let tailscale_check = Command::new("which")
.arg("tailscale")
.output();

Comment thread server/src/lib.rs
Comment on lines +495 to +500
// Start tailscaled in background (if not already running)
let _tailscaled = Command::new("tailscaled")
.arg("--tun=userspace-networking")
.arg("--state=/var/lib/tailscale/tailscaled.state")
.spawn();

Comment thread sandd/src/main.rs
Comment on lines +470 to +472
// Check if tailscale is installed
let tailscale_check = Command::new("which").arg("tailscale").output();

Comment thread sandd/src/main.rs
Comment on lines +482 to +487
// Start tailscaled in background (if not already running)
let _tailscaled = Command::new("tailscaled")
.arg("--tun=userspace-networking")
.arg("--state=/var/lib/tailscale/tailscaled.state")
.spawn();

Comment thread README.md
Comment on lines +138 to +140
from sandd import Server

server = Server(connect="tunnel") # Secure tunnel mode
Comment thread pyproject.toml
Comment on lines 41 to 44
exclude = [
"Cargo.toml",
"sandd/**/*",
"/sandd", # Only exclude root sandd/ directory (Rust daemon source)
"target/**/*",
Comment thread python/sandd/server.py
Comment on lines +59 to +65
if connect not in ["direct", "tunnel"]:
raise ValueError(
f"connect must be 'direct' or 'tunnel', got '{connect}'"
)

if connect == "tunnel" and tunnel_config is None:
raise ValueError(
kerthcet added 2 commits June 19, 2026 23:24
Signed-off-by: kerthcet <kerthcet@gmail.com>
Signed-off-by: kerthcet <kerthcet@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/needs-kind Indicates a PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. needs-triage Indicates an issue or PR lacks a label and requires one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants