Skip to content

fix(tunnel): extract cloudflared from .tgz on macOS#118

Merged
luthermonson merged 1 commit into
mainfrom
fix/cloudflared-darwin-download
Jul 15, 2026
Merged

fix(tunnel): extract cloudflared from .tgz on macOS#118
luthermonson merged 1 commit into
mainfrom
fix/cloudflared-darwin-download

Conversation

@luthermonson

Copy link
Copy Markdown
Contributor

Summary

Ephemerd's cloudflared downloader 404s on macOS, so the managed webhook tunnel never starts on Mac hosts (caught live enrolling a Mac mini runner).

Root cause: the downloader builds cloudflared-<os>-<arch> and expects a bare binary. That holds for Linux, but Cloudflare ships macOS as cloudflared-darwin-<arch>.tgz — a gzip tar containing the cloudflared binary. The darwin URL had no .tgz suffix (404), and even with it the file needs extraction, not a straight chmod.

Change

  • cloudflaredAsset(version) returns the correct URL + an isTgz flag per GOOS: darwin → .tgz, windows → .exe, else bare binary.
  • The darwin path gunzip/untars the cloudflared entry into <data-dir>/cloudflared/bin/cloudflared; other platforms keep the existing chmod+rename.

Test plan

  • TestCloudflaredAsset — per-GOOS URL shape + isTgz
  • TestExtractCloudflaredTgz / ...MissingEntry — round-trip a synthesized archive; error when no cloudflared entry
  • cross-builds clean for linux / windows / darwin-arm64
  • verified live: hand-placing the .tgz-extracted binary on the Mac mini let ephemerd's tunnel connect (this makes that automatic)

The cloudflared downloader assumed every platform ships a bare binary at
cloudflared-<os>-<arch>. That's true for Linux, but Cloudflare publishes
macOS as cloudflared-darwin-<arch>.tgz (a gzip tar containing the
binary). On darwin the old URL 404'd, so ephemerd could never start its
managed cloudflared subprocess — webhook-tunnel startup failed on every
Mac host.

cloudflaredAsset now returns the correct URL + an isTgz flag per GOOS
(darwin => .tgz, windows => .exe, else bare), and the darwin path
gunzip/untars the `cloudflared` entry instead of chmod-ing the archive.
@luthermonson
luthermonson merged commit 3a8f2d0 into main Jul 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant