Ship prebuilt binaries and a --tunnel flag for easy local runs#19
Open
aterga wants to merge 3 commits into
Open
Ship prebuilt binaries and a --tunnel flag for easy local runs#19aterga wants to merge 3 commits into
aterga wants to merge 3 commits into
Conversation
Make the server downloadable-and-runnable without a Rust toolchain or the manual cloudflared dance. - release.yml: on each v* tag, natively build a self-contained binary for linux x86_64/arm64 and macOS x86_64/arm64 and attach a tarball per platform to a draft GitHub Release. Built natively per target because the rustls crypto backend (aws-lc-sys) needs cmake/clang and resists cross/musl builds. The binary already bundles all assets via include_str!, so each asset is just one executable. - --tunnel flag: the server spawns cloudflared, scrapes the https://<name>.trycloudflare.com URL it prints, and sets PUBLIC_URL from it before anything reads PUBLIC_URL — collapsing "run cloudflared, copy the URL, restart with PUBLIC_URL set" into one command. cloudflared is kept alive (kill_on_drop) for the server's lifetime; a missing binary yields a clear install hint. Adds --help/--version too. - README: document the download-a-binary flow and the --tunnel one-liner. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Toatr3FXLddEs5y37QXXE8
There was a problem hiding this comment.
Pull request overview
Adds a smoother “download-and-run” story for the server by (1) publishing prebuilt release binaries and (2) introducing a --tunnel flag that auto-provisions a Cloudflare quick tunnel and derives PUBLIC_URL during startup.
Changes:
- Add
--tunnel,--help, and--versionCLI handling; implement Cloudflare quick-tunnel spawning + URL scraping. - Add a GitHub Actions release workflow that builds and packages per-platform tarballs + SHA256 files for GitHub Releases.
- Update README to document the prebuilt-binary flow and the
--tunnelone-liner; expand Tokio features needed for process IO/timeouts.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/tunnel.rs |
New module to spawn cloudflared, drain logs, and extract the trycloudflare.com URL with tests. |
src/main.rs |
Adds basic CLI parsing and wires --tunnel into startup before PUBLIC_URL is read. |
README.md |
Documents downloading release tarballs and using --tunnel for a public URL. |
Cargo.toml |
Expands Tokio feature set to support tokio::process, IO, timeouts, and channels. |
.github/workflows/release.yml |
New workflow to build/package/upload per-platform release artifacts and create/update a draft GitHub Release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Pin actions/upload-artifact and actions/download-artifact to commit SHAs
(with version comments), matching the repo's supply-chain hardening
convention already applied to actions/checkout.
- Build with an explicit --target ${{ matrix.target }} (each runner's native
triple) and package from target/<triple>/release, making the per-platform
intent explicit and the output path deterministic; matrix.target is no
longer unused.
- README: include the .tar.gz suffix in the example asset names so they
match the documented naming and copy/paste cleanly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Toatr3FXLddEs5y37QXXE8
The help text said "./oauth-clients.json" while auth.rs defaults to "oauth-clients.json" (no ./). Make the documented default verbatim so it greps cleanly against the code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Toatr3FXLddEs5y37QXXE8
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.
What & why
Makes the server downloadable and runnable with as few dependencies and as little compile time as possible — collapsing this:
into this:
No clone, no Rust toolchain, no compile, no copy-paste, no restart.
Changes
1. Prebuilt binaries via GitHub Releases (
.github/workflows/release.yml)v*tag, builds a self-contained binary for linux x86_64/arm64 and macOS x86_64/arm64, packages each asimcp-<uname -s>-<uname -m>.tar.gz+.sha256, and attaches them to a draft release for review. Also runs onworkflow_dispatch(artifacts only, no release).include_str!, so each asset is just one executable.aws-lc-sys) needs cmake/clang and resists cross/musl builds, so native runners are the reliable path. Linux gnu binaries target glibc 2.35+ (Ubuntu 22.04 runner); theDockerfileremains the option for older distros.2.
--tunnelflag (src/tunnel.rs,src/main.rs)cloudflared tunnel --url http://localhost:<port>, scrapes thehttps://<name>.trycloudflare.comURL from its output, and setsPUBLIC_URLfrom it before anything readsPUBLIC_URL(allowed_hosts()andauth::base_url()).cloudflaredis kept alive (kill_on_drop) for the server's lifetime; its stderr is drained so the tunnel never stalls. A missing binary produces a clear install hint instead of a stack trace. IfPUBLIC_URLis already set,--tunnelis a no-op.--help/--versionwhile wiring up arg parsing.3. README
--tunnelone-liner.Testing
cargo check --locked --all-targetsandcargo build --locked— clean (only the pre-existingtool_routerdead-code warning).cargo test tunnel::— 5 URL-extraction unit tests pass.--help,--version, unknown-flag (exit 2), and--tunnelwithcloudflaredabsent (clean install-hint error) all verified.🤖 Generated with Claude Code
Generated by Claude Code