Repository navigation
cfex v2: Go on cloudflared, instant + durable, agent skill, releases - #1
Open
muthuishere wants to merge 2 commits into
Open
muthuishere wants to merge 2 commits into
muthuishere wants to merge 2 commits into
Conversation
…tor/import Keeps every v1 command and flag working (cfex host:port, cfex host port, --https, --verify-cert, list, delete). Adds cfex add (one tunnel owned by cfex, additive ingress merge, launchd/systemd service), list of everything on the machine with live HTTP status, stop/start, status, doctor, import. Protected and client tunnels come from the user's config; the API token comes from the environment or an optional token_cmd. The bash script stays in bin/ until the Go binary ships.
…kill, uninstall, releases main becomes v2 only; the bash version lives on as the v1.0.0 release. - cloudflared does the tunnel work (create, route dns, list, delete, run); the API token is optional and only adds DNS ownership checks, DNS deletion, remote ingress and zone validation - instant mode (cfex host:port) removes its tunnel and DNS record on exit; --keep makes it durable - delete asks y/N on a terminal, --yes for scripts, dry run without a terminal - cfex skill install, cfex uninstall, troubleshoot - GoReleaser config, release workflow, install.sh that verifies checksums
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.
cfex v2 (Go, on cloudflared)
mainbecomes v2 only. The bash version is preserved as the v1.0.0 release (legacy, withbin/cfexandinstall.shattached). cloudflared does the tunnel work (create,route dns,list,delete,run); the Cloudflare API is optional and only adds what cloudflared cannot do (DNS ownership comments, deleting DNS records, remote ingress, zone validation).v2 features
cfex <domain>:<port>instant mode (foreground, Ctrl+C removes the tunnel and the DNS record it created,--keepmakes it durable) ·cfex adddurable routes (launchd/systemd) ·listof everything on the machine ·stop/start·delete(y/N on a terminal) ·status/doctor/troubleshoot·import·skill install|uninstall·uninstall· GoReleaser releases + checksum-verifyinginstall.sh.Parity with v1 (every v1 item)
cfex <domain>:<port>TestInstantParsecfex <domain> <port>(original syntax)TestInstantParse--httpsTestInstantParse,TestInstantConfig--verify-certTestInstantConfiglocalhost:<port>, switches to HTTPS modeTestDetectHTTPSTestInstantParseroute dns, runTestInstantCtrlCRemovesDNSRecordAndTunnelTestInstantReusesALeftoverTunnelTestInstantFailedRouteStillRemovesTheTunnelItCreatedinstant.go)--keepto keep)TestInstantCtrlCRemovesDNSRecordAndTunnel,TestInstantWithoutTokenSaysDNSIsLeftcfex doctorcloudflared tunnel loginguided flow whencert.pemis missing (4 steps, success/failure message)ensureLogin(needs a browser; manual)cfex doctorwhen no token, same stepscfex doctorCLOUDFLARE_API_KEYrequiredCLOUDFLARE_API_TOKENor the oldCLOUDFLARE_API_KEYboth workTestTokenFromEnvOnlyvalidateZonejqandcurlprerequisitesinstall.shstill needscurl,tar,cloudflaredroute dnsnever overwrites; an existing record is reportedTestInstantFailedRouteStillRemovesTheTunnelItCreatedcfex listcfex list(superset: all tunnels, ingress, launchd, live HTTP status; uses cloudflared, API optional)TestClassify; live checkcfex delete <d1> [d2 ...], one confirmation for all, "(not found)", "Skipping"--yesfor scripts, dry run without a terminalTestConfirmDeleteDefaultsToNo,TestDeleteNeedsConfirmationOnTTYAndDryRunsWithoutOnedelete -f, then DNS removal, waits up to 60 s for eachTestWaitUntilTimesOutAndConfirmsTestConfirmDeleteDefaultsToNo-h/--help(usage, options, examples, notes)TestUsageCoversEveryCommand-v/--versioncfex troubleshootand READMETestUsageCoversEveryCommand.goreleaser.yaml(snapshot build verified)install.sh(sudo handling, dependency checks, /usr/local/bin)/usr/local/bin(sudo) or~/.local/bin, installs the skillbash -n; end-to-end after the release existsuninstall.sh(remove binary; optional removal of~/.cloudflared)cfex uninstall/uninstall.sh: binary + skill; service, cfex config and~/.cloudflaredare opt-in prompts (default no) or flagsTestUninstallRemovesBinaryAndSkillButNotCloudflaredFilesItems that changed on purpose (OWNER APPROVED: "cfex: yes to the six")
package.json(npmbin) removed: it only pointed at the bash script and the package was never published.listoutput: v1 printed a flatdomain idlist; v2 prints a richer table (a superset). Instant tunnels show their domain.tunnel_<domain>+~/.cloudflared/<domain>_config.yml; v2cfex-instant-<domain>+ state under~/.local/share/cfex/. A leftover v1 tunnel is not auto-recognised (list it withcfex list, delete it withcloudflared tunnel delete).--keepkeeps it.uninstall.shno longer offersrm -rf ~/.cloudflaredwithout the explicit opt-in.Tests
make testpasses (go vet;cmd/cfex,internal/cfd,internal/cfg,internal/ingress). The suite refuses to run unlessCFEX_CONFIGpoints under the temp dir.goreleaser checkand a snapshot build for darwin/linux amd64+arm64 succeed.gitleaksis clean.Not yet verified live: the cloudflared-driven paths (
create,route dns,list, instant cleanup) needcloudflared tunnel loginon a machine with a Cloudflare domain; the unit tests use fakes for them. The API-only parts were verified earlier against a real zone.Release plan
After review: merge, tag
v2.0.0, thereleaseworkflow publishes the binaries +checksums.txt+install.sh. A Homebrew tap is a proposal only.