Documentation
¶
Overview ¶
Package share provides private branch sharing via a token-gated reverse proxy fronting a cloudflared tunnel, or via Tailscale Serve for tailnet-only access. Tokens are ephemeral — generated per session and invalidated when the tunnel shuts down.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateToken ¶
func GenerateToken() string
GenerateToken returns a cryptographically random 32-character hex token.
func NewTokenHandler ¶
NewTokenHandler returns an http.Handler that gates access behind a secret token path. First visit to /s/<token> sets an auth cookie and redirects to /. Subsequent requests are authenticated via the cookie.
func Run ¶
Run starts a private share session: token proxy + cloudflared tunnel. If tunnelName and domain are non-empty, uses a named tunnel with a random subdomain; otherwise falls back to a quick tunnel. Blocks until signal.
func RunTailscale ¶
RunTailscale exposes a local port on the tailnet via tailscale serve. No token proxy needed — Tailscale handles identity-based auth. Only people on the tailnet can reach the URL. Blocks until SIGINT/SIGTERM.
Types ¶
This section is empty.