celld for Homeflare
A fork of denoland/celld with the patches Homeflare's runtimes need. Upstream stopped at v0.6.3 when celld began merging into workerd, so fixes for gaps Homeflare apps hit land here.
Branches
main is upstream's v0.6.3 plus the patches below, one commit each, so a patch
can be dropped once the merged workerd covers it. Rebase onto upstream when it
moves:
git remote add upstream https://github.com/denoland/celld.git
git fetch upstream && git rebase upstream/main
Patches
| Patch | Why |
|---|---|
node:net isIP / isIPv4 / isIPv6; node:dns and node:dns/promises lookup() | Fedify checks a URL's host with both before fetching it, so palm's remote lookups failed with node:net.isIP is not implemented in celld. lookup() uses the node's resolver through a new __dns_lookup op, with connect()'s egress rules. |
Response.clone() on a streaming body | celld threw Cannot clone a streaming response before consumption; workerd tees the body, as celld's Request.clone() already did. palm's media proxy returns a fetched image and caches response.clone(). |
node:url (all but the legacy parse / resolve) | celld had no node:url; Fedify's WebFinger handler calls domainToASCII and domainToUnicode. Both run Node's own steps (the input set as a ws://x hostname) through new host ops on the url crate. |
node:process as the global process | The module was the throwing stub while globalThis.process existed, so Fedify's User-Agent (Node.js/${process.versions.node}, taken when the global has a Node version) threw on every outgoing request. Found by listing palm's bundle imports. |
Building
Homeflare builds this repo into its runtime image: set
HOMEFLARE_CELLD_SOURCE=https://github.com/jason-s13r/celld.git in
homeflare.env (see Homeflare's README). By hand, with Podman:
podman build -t localhost/homeflare-celld:dev \
--build-arg CELLD_COMMIT="$(git rev-parse HEAD)" .
The Dockerfile is upstream's: the image builds only if cargo test and
cargo clippy -D warnings pass. --build-arg CELLD_PROFILE=lab swaps fat LTO
for thin, which builds much faster.
Smoke tests
Each folder in homeflare/smoke/ is a Worker whose GET / reports its checks
as JSON; a paths.txt beside it adds requests that must answer 200 with the given text. With a built celld and esbuild on PATH:
cargo build -p celld
homeflare/smoke/run.sh # target/debug/celld