Skip to content

share: support a custom domain with Cloudflare Tunnel #1106

Description

@prabowosd

lerd share --cloudflare only starts a quick tunnel, so every run hands out a fresh random trycloudflare.com URL. That is fine for a one-off peek, but as soon as you want to send a client the same link twice, or point a webhook or OAuth callback at the site, the rotating hostname gets in the way.

Cloudflare already solves this with named tunnels: log in once, create a tunnel, route a hostname you own to it, and the URL is stable for as long as you keep the DNS record. lerd could drive that flow itself so sharing on your own domain is one flag instead of four cloudflared invocations.

Proposal: lerd share --domain dev.example.com (implying --cloudflare). If cloudflared has no origin cert yet it runs the interactive login, then it creates or reuses a tunnel named after the site, routes the hostname to it, and serves the site through the same host-rewriting proxy the quick tunnel path already uses. The only requirement on the user's side is that the domain's DNS is managed by Cloudflare.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions