Diffinery

homeflare/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

diffinery/HOMEFLARE.md
67 lines · 3.1 KBRaw History

Diffinery on Homeflare

A fork of codician-team/diffinery whose deploy scripts also work against Homeflare. main is upstream's main plus a few commits, each one droppable or fit to send upstream on its own:

  • CLOUDFLARE_API_BASE_URL and CLOUDFLARE_CONTAINER_REGISTRY in the scripts, with Cloudflare's API and registry as the defaults.
  • The Homeflare deploy described below, skipping the steps that need Cloudflare itself.
  • scripts/setup.sh reading the /login page before matching it: curl | grep -q fails under pipefail when grep stops early.

Rebase onto upstream when it moves:

git remote add upstream https://github.com/codician-team/diffinery.git
git fetch upstream && git rebase upstream/main

How it works

Homeflare runs Workers on your own machines (celld) behind a Cloudflare-compatible API. These scripts deploy to it when CLOUDFLARE_API_BASE_URL points at that API, which homeflare-wrangler run sets, along with CLOUDFLARE_CONTAINER_REGISTRY (Homeflare's registry) and a docker command on your Podman.

On another API than Cloudflare's, scripts/setup.sh and scripts/bootstrap.sh skip what needs Cloudflare itself:

SkippedWhat it means
Zone checkThe hostname is a Homeflare custom domain, not a route in a Cloudflare zone.
R2 lifecycle rulesLogs, artifacts, archives and exports don't age out by themselves.
Email Sending setup and its event subscriptionOnboard the sending domain in Cloudflare yourself (Homeflare relays email through it with HOMEFLARE_EMAIL=cloudflare). Bounces and complaints don't reach the suppression list.
Turnstile widgetMake one in the Cloudflare dashboard and pass its keys: TURNSTILE_SITE_KEY and TURNSTILE_SECRET. Without them open sign-up and anonymous security reports stay off.
Cloudflare AccessEmail recovery and the /auth/access first sign-in stay off. Passkeys work.

Deploy

Put the settings in a file outside the repository (it holds the Turnstile secret), for example ~/.config/homeflare/diffinery.env, readable by you only:

CLOUDFLARE_ACCOUNT_ID=<Homeflare's account id>
DIFFINERY_DOMAIN=git.homeflare.example.com
MAIL_DOMAIN=example.com
[email protected]
TURNSTILE_SITE_KEY=0x4AAA...
TURNSTILE_SECRET=0x4AAA...

MAIL_DOMAIN is a domain onboarded to Email Sending in your Cloudflare account. Homeflare's account id is in the Dashboard, or from GET /client/v4/accounts. Then, from the repository:

homeflare-wrangler --env-file ~/.config/homeflare/diffinery.env run scripts/setup.sh --yes

homeflare-wrangler reads the Homeflare API token from ~/.config/homeflare/wrangler.env and sets CLOUDFLARE_API_BASE_URL itself. Run it again to update.

The first administrator

Without Access, the first account comes from open sign-up, which needs Turnstile and email. Deploy once with "SIGNUP": "open" under vars in apps/diffinery/wrangler.jsonc, sign up at https://<host>/signup with an address in BOOTSTRAP_ADMINS, add a passkey, then remove SIGNUP and deploy again.