Deploy a built static site to Cloudflare Workers static assets, from Rust. No wrangler, no Node.
Every deploy is a new Worker version. edgepub checks the live site against your build, and if anything is wrong it puts the previous version back.
- Uploads only what's new. Files are hashed the way Cloudflare's asset manifest expects, and only the ones Cloudflare doesn't already have are sent.
- Deploys a version.
_headersand_redirectsgo in the version's asset config, so headers and redirects change atomically with the files. - Verifies the live site. It fetches a sample of pages from your domain and checks, for each one:
- the body matches the local file byte for byte (it retries while the new version propagates)
- every stylesheet, script and image the page references loads
- every header
_headerspromises for that path is there with the same value, and headers removed with! Nameare gone
- Rolls back. If verification fails, the version that was live before is redeployed, and edgepub exits 1.
- Keeps workers.dev off unless you turn it on, so your domain is the only address.
cargo install --git https://github.com/botBehavior/edgepub
edgepub plan public --config edgepub.toml # local and read-only: files, hashes, parsed _headers
edgepub deploy public --config edgepub.toml# edgepub.toml
account_id = "…"
worker = "my-site"
token_file = "~/.config/edgepub/token" # chmod 600
workers_dev = false # also serve on <worker>.<subdomain>.workers.dev
verify_url = "https://example.com" # where to verify; defaults to workers.dev when that's on
# compatibility_date = "2026-11-01"
# html_handling = "auto-trailing-slash"
# not_found_handling = "404-page"
# verify_sample = 12 # HTML pages checked per deploy, plus the home page and a few assetsThe token needs one permission: Account › Workers Scripts › Edit, limited to your account. edgepub reads
it from token_file at deploy time and refuses a file that anyone else can read.
Your domain is attached to the Worker once, in the dashboard (Workers › your worker › Domains). After that,
point verify_url at it.
The last line of output is always edgepub: …, and the exit code is 0 only for a verified deploy, so other
tools can drive it. hypomnema uses it as its deploy step.
edgepub reads the subset of _headers that Workers static assets supports: literal paths and a trailing *,
Name: value to set a header, and ! Name to remove one set by an earlier rule. That's enough for a per-page
policy:
/*
Content-Security-Policy: default-src 'self'; script-src 'none'
/posts/islands/*
! Content-Security-Policy
Content-Security-Policy: default-src 'self'; script-src 'self' 'wasm-unsafe-eval'
Syntax it can't model (placeholders, a * mid-path) is refused at plan, not guessed at.
Run against a real account before release:
- an assets-only Worker (no script) is accepted
- a
! Content-Security-Policyoverride replaces the site-wide policy on its path, and other headers still apply - workers.dev can be switched off per Worker
- a redeploy with nothing changed uploads nothing
- a failed verification rolls back to the previous version
- Workers static assets only: no Worker script, bindings or Durable Objects yet. The config is meant to grow to carry them.
- 25 MiB per file, Cloudflare's limit.
- Linux and macOS (the token file permission check is Unix).
reqwest, sha2, tokio, walkdir. Written with Claude Code.
