feat(tunnel): simplify tunnel setup#645
Merged
Merged
Conversation
8f0e620 to
c838cc1
Compare
614ca7a to
5e81a42
Compare
Contributor
Diagram-based review: how this improves the stackThe PR’s main win is that permanent tunnel setup no longer asks the CLI to hold broad Cloudflare authority. It moves the default path to a single-tunnel connector token, with Cloudflare-side hostname/DNS setup done explicitly in the dashboard. flowchart LR
subgraph Before["Before: API-token provisioning"]
U1["User"] --> CLI1["obol tunnel provision / setup"]
CLI1 --> API["Cloudflare API token"]
API --> CF1["CLI creates tunnel"]
API --> DNS1["CLI mutates DNS / ingress"]
CLI1 --> K1["cloudflared runs in cluster"]
end
subgraph After["After: connector-token setup"]
U2["User creates tunnel + public hostname in Cloudflare dashboard"]
U2 --> TOK["Single tunnel connector token"]
TOK --> CLI2["obol tunnel setup <token>"]
CLI2 --> SEC["K8s Secret: TUNNEL_TOKEN"]
CLI2 --> CM["management_mode=remote"]
SEC --> K2["cloudflared runs in cluster"]
CM --> K2
end
flowchart TD
Setup["obol tunnel setup"] --> Extract["Accept bare token, --token, positional arg, or full cloudflared command"]
Extract --> Validate["Decode connector token: account tag + tunnel UUID + secret"]
Validate --> Store["Persist token locally and as K8s Secret"]
Store --> Helm["Helm upgrade cloudflared into remote-managed mode"]
Helm --> Sync["Sync AGENT_BASE_URL + frontend tunnel ConfigMap"]
Sync --> URL["Permanent public URL: https://<hostname>"]
What gets better
flowchart LR
Status["obol tunnel status"] --> Kube["Deployment / pod readiness"]
Status --> Ready["cloudflared :2000 /ready"]
Status --> Metrics["cloudflared :2000 /metrics"]
Status --> Public["Public URL HTTP probe"]
Kube --> Report["Concise active / degraded / starting report"]
Ready --> Report
Metrics --> Report
Public --> Report
Findings I’m following with fixes
I’m following this review comment with a small patch for both issues and focused test evidence. |
Contributor
|
Follow-up fixes pushed in
Verification: go test ./cmd/obol ./internal/tunnel ./internal/hermes ./internal/helmcmd -count=1
git diff --checkBoth pass locally from the PR worktree. |
Contributor
|
Live smoke for the Hermes ownership fix passed on an isolated k3d stack using the PR binary at Smoke shape: OBOL_DEVELOPMENT=true \
OBOL_CONFIG_DIR=/tmp/obol-pr-645-review/.workspace/config \
OBOL_BIN_DIR=/tmp/obol-pr-645-review/.workspace/bin \
OBOL_DATA_DIR=/tmp/obol-pr-645-review/.workspace/data \
obol stack init --backend k3d --force
obol stack up
obol agent sync obol-agent
obol kubectl rollout restart deployment/hermes -n hermes-obol-agent
obol kubectl rollout status deployment/hermes -n hermes-obol-agent --timeout=180sEvidence:
|
bussyjd
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
obol tunnel cleanup + obol domain UX, with two
reliability fixes
Reworks the Cloudflare tunnel commands around a
least-privilege connector token as the default and
only remote path, brings obol domain into line with
that model, and fixes two bugs surfaced while testing
the flow end-to-end.
obol tunnel
path. Removed the account-wide API-token provisioning
path entirely (tunnel provision, and setup
--api-token/--account-id/--zone-id/--register-domain
are gone). DNS/ingress are configured by the user in
the Cloudflare dashboard (route Public Hostname →
http://traefik.traefik.svc.cluster.local:80).
takes the token positionally or via --token; accepts
the bare eyJ… value or the whole cloudflared tunnel
run --token … line (prefix stripped). On a TTY with no
token, it walks the user through the dashboard steps
and prompts.
runs the connector in-cluster.
cloudflared's in-cluster /ready + /metrics (port 2000,
--api-token/--account-id/--zone-id/--register-domain are gone). DNS/ingress are
configured by the user in the Cloudflare dashboard (route Public Hostname →
http://traefik.traefik.svc.cluster.local:80).
via --token; accepts the bare eyJ… value or the whole cloudflared tunnel run
--token … line (prefix stripped). On a TTY with no token, it walks the user through
the dashboard steps and prompts.
in-cluster.
--verbose adds replicas/pods; --no-probe stays offline. Shows a clear
temporary-vs-permanent mode.
tunnel login) for users who'd rather not use the dashboard.
obol domain
natural "do I have a domain for the tunnel?" check).
collided with tunnel setup -t (a different credential — connector token).
URL), mirroring the tunnel flow; clear actionable error otherwise.
next step; search/check suggest register.
method + registrant contacts on action_required. Framed throughout as an optional
convenience over doing it in the dashboard.
Reliability fixes (surfaced during testing)
to the host UID for host-side writes but never handed ownership back to the
container UID, so the next non-root pod restart died with mkdir: cannot create
directory '/data/.hermes': Permission denied. Added the fixRuntimeVolumeOwnership
bookend + regression test.
--force-conflicts (avoids the /openapi/v2 EOF flake); SyncAgentBaseURL appends
SyncFlagsForVersion so Helm 4 gets --force-conflicts on the AGENT_BASE_URL sync.
Tests & docs
guard, the domain API-token resolver, ListRegistrarDomains, and the hermes
ownership bookend.
▎ Companion docs live in the obol-gitbook repo (rewritten "Set up a permanent URL"
▎ guide + screenshots) ObolNetwork/obol-gitbook#152 and skills (version bump) — separate PRs.