Skip to content

Commit 6c77f17

Browse files
authored
Merge pull request #645 from ObolNetwork/oisin/tunnelcleanup
feat(tunnel): simplify tunnel setup
2 parents d0b51b2 + 21dcc09 commit 6c77f17

20 files changed

Lines changed: 1196 additions & 1384 deletions

CLAUDE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ obol
8787
│ └── skills add, remove, list
8888
├── model setup (has sub: custom), status, token, sync, pull, list, prefer, discover, remove
8989
├── app install, sync, list, delete
90-
├── tunnel status, setup, login, provision, restart, stop, logs
91-
├── domain search, check, register
90+
├── tunnel status, setup, restart, stop, logs (login hidden: browser-managed fallback)
91+
├── domain list, search, check, register
9292
├── kubectl/helm/helmfile/k9s Passthrough (auto KUBECONFIG)
9393
├── update Helm + CLI version check (--json)
9494
├── upgrade Apply chart upgrades (--defaults-only, --pinned, --major)
@@ -102,6 +102,7 @@ obol
102102
- `sell info <name>` prints purchase instructions (URL, model, buy.py command).
103103
- `sell mcp [name]` runs a foreground x402-paid MCP server: forwards buyer JSON args to a backend HTTP service, injecting the seller's own API key (buyer never sees it). Payment rides MCP `_meta` (`internal/x402mcp`).
104104
- `sell resume` replays every persisted sell offer (inference incl. detached host-gateway relaunch; http/agent/demo-agent via the manifest ledger at `$OBOL_CONFIG_DIR/sell-http/`) — run after a host reboot; `obol stack up` runs the same path. `--install-boot-unit` adds a systemd user unit (Linux). `sell mcp` is foreground-only, no offer, not resumed.
105+
- `tunnel setup [<token>]`: the one permanent-URL command. Connector-token based (dashboard-managed) — no host binary, no account-wide API key. Accepts the bare connector token, the `--token` flag, a positional arg, or the whole `cloudflared tunnel run --token …` line (prefix stripped via `extractConnectorToken`). Reuses the remote runtime (`ProvisionWithToken` → `TUNNEL_TOKEN` secret, chart `management_mode=remote`); DNS/ingress are configured by the user in the Cloudflare dashboard (route Public Hostname → `http://traefik.traefik.svc.cluster.local:80`), not via API. The API-token provisioning path was removed (no more `tunnel provision`, no setup `--api-token/--account-id/--zone-id/--register-domain`). `--management local` (alias hidden `tunnel login`) is the browser fallback (needs `cloudflared`). `tunnel status` reads connector health from cloudflared's in-cluster `/ready`+`/metrics` (port 2000, no token) plus a public HTTP probe; concise by default, `--verbose` for replicas/pods, `--no-probe` to stay offline. Domain management lives under `obol domain` (`list`, `search`, `check`, `register`) — an optional CLI wrapper around Cloudflare Registrar; still uses a scoped Cloudflare **API token** (Account → Domain perm, via `--api-token`/`CLOUDFLARE_API_TOKEN`; on a TTY it walks you through token creation and prompts). `--api-token` deliberately has NO `-t` alias to avoid colliding with `tunnel setup -t` (connector token — a different credential). `register` is billable (needs a payment method on the CF account); on success it prints the `obol tunnel setup --hostname …` handoff.
105106
- `hermes` is passthrough to native hermes CLI via `hermes.CLI()` (cmd/obol/hermes.go:27). No Go-level subcommands registered.
106107
- `bootstrap` (cmd/obol/bootstrap.go) is a hidden command for installer use only — not user-facing.
107108

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,20 +234,25 @@ Skills are delivered via host-path PVC injection — no ConfigMap size limits, w
234234

235235
## Public Access (Cloudflare Tunnel)
236236

237-
Expose your stack to the internet via Cloudflare Tunnel:
237+
A tunnel exposes your stack to the public internet so buyers can discover and
238+
pay for the services you sell. You don't need it for local use — set one up once
239+
you're ready to sell, to get a permanent URL.
238240

239241
```bash
240-
# Check tunnel status (quick tunnel mode is the default)
242+
# Check tunnel status (a temporary quick-tunnel URL is the default)
241243
obol tunnel status
242244

243-
# Use a persistent hostname
244-
obol tunnel login --hostname stack.example.com
245-
246-
# Or provision via API
247-
obol tunnel provision --hostname stack.example.com \
248-
--account-id ... --zone-id ... --api-token ...
245+
# Create a permanent URL. Create a tunnel in the Cloudflare dashboard
246+
# (Networks → Tunnels), route its Public Hostname to
247+
# http://traefik.traefik.svc.cluster.local:80, then paste the connector token —
248+
# you can paste the whole `cloudflared tunnel run --token …` line:
249+
obol tunnel setup --hostname stack.example.com <connector-token>
249250
```
250251

252+
This uses a least-privilege, single-tunnel connector token — no account-wide API
253+
key required. (Advanced: `obol tunnel setup --management local` uses a browser
254+
login on this machine instead, which needs `cloudflared` installed.)
255+
251256
## Managing the Stack
252257

253258
```bash

cmd/obol/main.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ COMMANDS:
102102
103103
Tunnel Management:
104104
tunnel status Show tunnel status and public URL
105-
tunnel setup Guided persistent tunnel setup with optional domain registration
106-
tunnel login Authenticate and create persistent tunnel (browser)
107-
tunnel provision Provision persistent tunnel (API token)
105+
tunnel setup Create a permanent public URL with a Cloudflare tunnel
108106
tunnel restart Restart tunnel connector (quick tunnels get new URL)
109107
tunnel stop Stop the tunnel connector
110108
tunnel logs View cloudflared logs

0 commit comments

Comments
 (0)