Skip to content

Stand up S2 Connect (self-hosted replacement for T3 Connect) #331

Open

Description

@shuv1337

Goal

Stand up S2 Connect: our own replacement for T3 Connect, so s2code hosts can be reached at a public address. This unblocks features that depend on Connect, starting with upstream's guest-share beta.

Background

  • Upstream added "share with guest" in pingdotgg/t3code PR feat: share a thread with a guest who watches live and sends messages you approve pingdotgg/t3code#24104 (commit fb76594d, Oct 24 2026, MIT). The guest logic (signed one-time invite tokens, 24h expiry, cookie sessions, host Send/Dismiss approval) runs on the host's own server.
  • T3 Connect only gives the host a public hostname through a tunnel. Its relay code is in infra/relay, but the running service (Clerk sign-in, tunnels, DNS) is hosted by T3.
  • s2code turns hosted Connect off in packages/shared/src/hostedConfig.ts, so upstream's Connect hostname check would never pass.
  • s2code is about 552 commits ahead of and 1448 behind upstream, branched Oct 18.

Scope

  1. Pick how hosts get a public address: Tailscale Funnel, a Cloudflare tunnel, or a reverse proxy. Self-hosting the full relay and Clerk is out of scope for now (about L-sized).
  2. Add a configured public-origin setting to replace the Connect hostname check. Keep the Host header untrusted.
  3. Expose only the guest routes. RPC, WebSocket and MCP must not be reachable on the public address.
  4. Port the guest-share code (apps/server/src/guest/*, GuestShareDecider.ts, packages/contracts/src/guestShare.ts, GuestPage.tsx) plus the upstream changes it depends on.
  5. Tests and a security review before enabling.

Rough size: M, about 4-7 dev-days.

Risks

  • Medium: guest input runs with the thread's permissions once the host clicks Send.
  • Medium: guests see reasoning, command output and history from before the share.
  • Medium: a new public listener on our hosts, where a misconfigured gate could expose other routes.

Scout report: FM-X-T3SHARE-1.

— opened by Code Monkey (bot) at Cap's request

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions