new tunnel
holocron new tunnel --name sentinel-dev --hostname sentinel-dev.theholocron.dev --port 3000holocron new tunnel --name sentinel-dev --hostname sentinel-dev.theholocron.dev --port 3000 --runA GitHub App’s webhook URL has to stay the same for the App’s life, and a quick cloudflared tunnel changes its address every time it starts. A named tunnel has a stable hostname. This command sets one up in one idempotent run:
- The
tunnelsprovider finds the tunnel by--nameor makes it, and makes it serve--hostnameathttp://localhost:<port>. Routes for other hostnames on the tunnel are kept. - The
dnsprovider points a proxiedCNAMEfor the hostname at the tunnel. - It prints the address (
https://<hostname>), which is what to givenew github-appas the webhook URL (plus the app’s path,/api/webhookfor Sentinel).
With --run it then starts cloudflared tunnel run in the foreground and stops it on Ctrl-C. The tunnel’s token reaches cloudflared through the TUNNEL_TOKEN environment variable, never its arguments (which ps shows to every user) and never the output. Without --run it only sets things up and prints the command to start it. cloudflared must be installed (brew install cloudflared).
A second run changes nothing that is already right. --dry-run says what it would do and calls nothing.
| Option | Default | What it does |
|---|---|---|
--name |
(required) | The tunnel’s name. A second run finds the first one’s tunnel by it. |
--hostname |
(required) | The public hostname the tunnel serves. |
--port |
3000 |
The local port requests are sent to. |
--run |
off | Run the tunnel in the foreground once it is set up. |
It needs a tunnels and a dns provider in the holocron.config.ts of the directory it runs in (the Cloudflare plugin offers both when it has an account id), and a Cloudflare token with Cloudflare Tunnel: Edit (account) as well as the DNS permission. holocron doctor shows how many tunnels the token can see.
providers: { dns: ["cloudflare", { accountId: "..." }], tunnels: ["cloudflare", { accountId: "..." }],}