Repository navigation
feat(tunnels): named cloudflared tunnel via CLOUDFLARED_CONFIG - #11561
Merged
diegosouzapw merged 1 commit intoAug 26, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
Adds an opt-in named/persistent tunnel mode to the cloudflared integration, alongside the existing ephemeral quick tunnel. When CLOUDFLARED_CONFIG points at a locally-managed cloudflared config.yml (tunnel / credentials-file / ingress), OmniRoute runs `cloudflared tunnel --no-autoupdate --config <path> run` to expose a stable, named hostname instead of a random *.trycloudflare.com URL. No Zero Trust dashboard token is required. - Readiness is detected from cloudflared's "Registered tunnel connection" log line, since named tunnels emit no public URL to scrape. - publicUrl/apiUrl are reported from CLOUDFLARED_HOSTNAME, or auto-read from the config's first ingress hostname when the override is unset. - Default quick-tunnel behavior is unchanged: the mode is selected purely by whether CLOUDFLARED_CONFIG is set. - Fails fast with a clear error when the config path is missing, instead of a 30s readiness timeout. Validated against a real cloudflared 2026.8.2 setup: the binary accepts the flag ordering, the readiness regex matches real tunnel logs, and the hostname parser extracts the configured ingress host. Unit + behavioral tests exercise the full start state machine via a fake child process. Docs: TUNNELS_GUIDE.md (named-tunnel setup), .env.example, ENVIRONMENT.md.
diegosouzapw
merged commit Aug 26, 2026
c63e519
into
diegosouzapw:release/v3.8.51
10 of 16 checks passed
diegosouzapw
added a commit
that referenced
this pull request
Aug 26, 2026
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…IG (diegosouzapw#11561) Merged via /merge-batch (lote 2026-08-26, v3.8.51). Boarded no worktree combinado junto com outras ~30 PRs; validação única: typecheck/complexity/cognitive-complexity/changelog-integrity verdes, file-size rebaseado onde necessário (crescimento legítimo), lint com os mesmos 228 achados pré-existentes confirmados via sonda contra o tip puro (não introduzidos por este lote), e ~370 testes focados (unit + vitest) passando. Obrigado pela contribuição.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…apw#11495/diegosouzapw#11561 growth (diegosouzapw#11630) Merged via /merge-batch (lote 2026-08-26, v3.8.51). check:file-size confirmado OK após o rebaseline.
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
Adds an opt-in named/persistent Cloudflare tunnel mode to the
cloudflaredintegration, so operators can expose OmniRoute on a stable, named hostname
(e.g.
ai.example.com) instead of the ephemeral*.trycloudflare.comURL thatchanges on every restart.
This targets the locally-managed cloudflared flow (
cloudflared tunnel login→
create→route dns→ a~/.cloudflared/config.ymlwithtunnel:,credentials-file:,ingress:) — no Zero Trust dashboard / connector token isrequired.
How it works
CLOUDFLARED_CONFIG=/path/to/config.ymlto switch into named-tunnel mode.OmniRoute then runs
cloudflared tunnel --no-autoupdate --config <path> run.runreads credentials from the config's absolutecredentials-filepath, soit works even with OmniRoute's isolated
HOMEand needs nocert.pem.cloudflared's
Registered tunnel connectionlog line.publicUrl/apiUrlare reported fromCLOUDFLARED_HOSTNAME, or — when thatoverride is unset — auto-read from the config's first
ingresshostname.whether
CLOUDFLARED_CONFIGis set. With it unset, the code path is byte-for-bytethe previous quick-tunnel path.
readiness timeout).
Also documents the previously-undocumented
CLOUDFLARED_PROTOCOL.Files
src/lib/cloudflaredTunnel.ts— named-tunnel config resolution, config-fileargs, ingress-hostname parser, connection-ready detection, start wiring.
tests/unit/cloudflaredTunnel.test.ts— pure-function unit tests (arg builder,config resolution, hostname normalizer, ingress parser, readiness matcher).
tests/unit/cloudflaredTunnel-extended.test.ts— behavioral test driving thereal
startCloudflaredTunnelstate machine via a fake child that emits aregistered-connection log line; asserts args,
publicUrl/apiUrl, state..env.example,docs/ops/TUNNELS_GUIDE.md,docs/reference/ENVIRONMENT.md.Testing
node --import tsx/esm --test tests/unit/cloudflaredTunnel.test.ts tests/unit/cloudflaredTunnel-extended.test.ts→ 33/33 pass.cloudflared 2026.8.2:tunnel --no-autoupdate --config <path> run(failure was on config content, not flag parsing).Registered tunnel connection connIndex=… protocol=quic).config.yml.npm run lint,npm run typecheck:core(my files),check:env-doc-sync, and Prettier are clean on the changed files.Notes
open-sse/services/compression/omniglyph*(an
omniglyphpackage API/version mismatch) exist on the base tip and areunrelated to this change — no files under
open-sse/are touched here.