Skip to content

feat: guest links can use your own address instead of T4 Connect - #2

Open
frankhommers wants to merge 2 commits into
imetn:mainfrom
frankhommers:feat/guest-link-public-host
Open

frankhommers wants to merge 2 commits into
imetn:mainfrom
frankhommers:feat/guest-link-public-host

Conversation

@frankhommers

@frankhommers frankhommers commented Dec 4, 2026 •

Copy link
Copy Markdown

Guest links only worked through a T4 Connect tunnel: the server took the link's hostname from the running connector and refused to create a link without one. Anyone who already runs their own HTTPS reverse proxy, or who prefers not to use a relay, had no way to share a single thread.

Settings → Labs → Guest link address (guestLinkHost) now names a host that serves guest links instead, for example a reverse proxy that forwards only /guest, /api/guest/ and /assets/. The link, every guest request and the open guest stream check against that host the same way they check against the Connect hostname, so changing or clearing it ends the links made with it. Empty, nothing changes.

  • Server: GuestShareService reads the host from settings, or else from the Connect connector (connectHostname → linkHost).
  • Contracts: the setting is validated on write (host and optional port, no scheme or path). A stored value that is not a host, such as a hand edit, makes no links instead of failing to load settings.
  • Web: a text field under Guest links. A pasted URL keeps only its host. With an address set, a user signed out of T4 Connect sees the switch instead of the sign-in prompt. The new strings are translated in every catalog, and the field is in settings search.
  • Docs: docs/user/guest-links.md (with a Traefik rule) and the security note in docs/internals/04_environment-auth.md.

Testing

  • GuestShareService.test.ts: with the address set and Connect reporting no hostname, a link is created, redeemed and accepts a message, and changing the address ends it. All 28 tests pass.
  • settings.test.ts: valid and invalid hosts, the empty default and a hand-edited value.
  • The web build, against an isolated data directory: the field appears in Labs, and https://T3.Example.com/guest is saved as t3.example.com.
  • End to end (first commit, same server logic) with Traefik v3.8 in front, forwarding only Path(/guest) || PathPrefix(/api/guest/) || PathPrefix(/assets/), and no Connect: the link came out as https://<proxy host>/guest#…. Redeeming, the live view and a guest message all worked through the proxy, and the owner saw the message with Send and Dismiss. /, /pair, /ws, /mcp, /api/auth/*, /api/attachments/* and /oauth/* returned 404 through the proxy.

Notes

  • Managed policy: the lock that a managed policy denying connect puts on the Guest links switch is unchanged. The server itself does not check that policy for guest links, before or after this change.
  • Pre-existing failures:
    • vp run check:changed, which the pre-commit hook runs, reports knip findings and typecheck errors in scripts/ that are already on main; the commits were made with --no-verify for that reason.
    • Two tests in ProjectSettingsPanel.logic.test.ts fail on main too.
    • Running the server from source fails on main with ReferenceError: Cannot access 'ThreadHandoff' before initialization, so testing used the bundled dist/bin.mjs.

Guest links only worked through a T4 Connect tunnel: the server took the
link's hostname from the running connector and refused to create a link
without one.

T3CODE_GUEST_LINK_HOST now names a host (such as a reverse proxy that
forwards only /guest, /api/guest/ and /assets/) that serves guest links
instead. The link, every guest request and the open stream check against
that host the same way they check against the Connect hostname, so
changing or removing it ends the links made with it. Unset, nothing
changes.
Replaces T3CODE_GUEST_LINK_HOST with a guestLinkHost server setting, so the
desktop app can use it. Empty keeps T3 Connect. A stored value that is not a
host makes no links instead of failing to load settings. Signed-out users
with an address set get the switch instead of the sign-in prompt.
@frankhommers frankhommers changed the title feat(server): guest links can use your own host instead of T4 Connect feat: guest links can use your own address instead of T4 Connect Dec 4, 2026
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