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.

Merge pull request #11 from codician-team/claude/project-thread-vg14wb

celld: copy SMTP_PASSWORD and allow cloudflare:sockets (fixes red unit tests on main)
altugank authored · GitHub committed 2 parents 735f92a7bbc8b9commit 4bdc4d3631343c0fdf5240915869f12351f01737Browse files
5 files changed+6−5
Files (5)
modifiedAGENTS.md+1−1View file
@@ -58,7 +58,7 @@
5858 - **Keep it running on celld**, the open-source Workers runtime
5959 (`apps/diffinery/docs/self-hosting/celld.md`). Make a binding celld lacks optional (and list it in
6060 `CELLD_ABSENT_BINDINGS`), map any new `wrangler.jsonc` key in `scripts/celld-config.mjs`, and import only
61- `cloudflare:workers`, `cloudflare:workflows` and the `node:` modules celld has. Never return a stream or a
61+ `cloudflare:workers`, `cloudflare:workflows`, `cloudflare:sockets` and the `node:` modules celld has. Never return a stream or a
6262 `Response` from a Durable Object RPC method: stream through its `fetch()`. `test/unit/celld.test.ts` checks it.
6363 - **D1 migrations** live in `apps/diffinery/migrations`. Use the next free number and never
6464 edit a migration that has shipped.
modifiedapps/diffinery/docs/self-hosting/celld.md+1−1View file
@@ -55,7 +55,7 @@
5555 pnpm -r build
5656 ```
5757
58-2. Create the Worker's secrets once and keep them. `celld deploy` has no secret store, so `scripts/celld-config.mjs` copies `MASTER_KEY`, `MASTER_KEY_PREV`, `OIDC_PRIVATE_KEY`, `MAIL_EVENTS_SECRET`, `TURNSTILE_SECRET`, `GITHUB_OAUTH_CLIENT_SECRET`, `SANDBOX_POOL_SECRET`, `GITHUB_APP_CLIENT_SECRET`, `GITHUB_APP_PRIVATE_KEY` and `GITHUB_APP_WEBHOOK_SECRET` from the environment into the Worker's variables. Never change `MASTER_KEY` once it is in use.
58+2. Create the Worker's secrets once and keep them. `celld deploy` has no secret store, so `scripts/celld-config.mjs` copies `MASTER_KEY`, `MASTER_KEY_PREV`, `OIDC_PRIVATE_KEY`, `MAIL_EVENTS_SECRET`, `TURNSTILE_SECRET`, `GITHUB_OAUTH_CLIENT_SECRET`, `SANDBOX_POOL_SECRET`, `GITHUB_APP_CLIENT_SECRET`, `GITHUB_APP_PRIVATE_KEY`, `GITHUB_APP_WEBHOOK_SECRET` and `SMTP_PASSWORD` from the environment into the Worker's variables. Never change `MASTER_KEY` once it is in use.
5959
6060 ```sh
6161 export MASTER_KEY="$(openssl rand -base64 32)"
modifiedapps/diffinery/test/unit/celld.test.ts+1−1View file
@@ -56,7 +56,7 @@
5656 });
5757
5858 /** Built-in modules celld implements (its docs/cloudflare-compat.md); node:crypto and node:zlib only in part. */
59-const CELLD_MODULES = new Set(["cloudflare:workers", "cloudflare:workflows", ...["assert", "async_hooks", "buffer", "crypto", "diagnostics_channel", "events", "fs", "os", "path", "stream", "timers/promises", "util", "zlib"].map((m) => `node:${m}`)]);
59+const CELLD_MODULES = new Set(["cloudflare:workers", "cloudflare:workflows", "cloudflare:sockets", ...["assert", "async_hooks", "buffer", "crypto", "diagnostics_channel", "events", "fs", "os", "path", "stream", "timers/promises", "util", "zlib"].map((m) => `node:${m}`)]);
6060
6161 function sources(dir: string): string[] {
6262 return readdirSync(dir).flatMap((f) => {
modifiedcontainers/runner/test/job.test.ts+2−1View file
@@ -954,7 +954,8 @@
954954 expect(api.logText()).toContain("Runner: image diffinery-runner:abc123, in fra06, EEUR, container d0");
955955 // A hosted runner also names its host's processor and, at the end, the share of its vCPUs' time the host took.
956956 if (existsSync("/proc/cpuinfo")) {
957- expect(api.logText()).toContain(`Host: ${runner.cpu}`);
957+ // The clock speed is read again for the log line, and it moves between reads on a busy host.
958+ expect(api.logText()).toContain(`Host: ${String(runner.cpu).replace(/, \d+ MHz$/, "")}`);
958959 expect(api.logText()).toMatch(/Host: \d+% of the vCPUs' time went to other work on the host \(steal\)/);
959960 }
960961 expect(api.completion).toMatchObject({ conclusion: "failure", failure: { step: 0 } });
modifiedscripts/celld-config.mjs+1−1View file
@@ -51,7 +51,7 @@
5151 const CONTAINER_KEYS = ["class_name", "image", "name", "instance_type", "max_instances", "runtime"];
5252
5353 /** Secrets (`wrangler secret put` on Cloudflare) copied from the environment into `vars`. */
54-export const SECRETS = ["MASTER_KEY", "MASTER_KEY_PREV", "OIDC_PRIVATE_KEY", "MAIL_EVENTS_SECRET", "TURNSTILE_SECRET", "GITHUB_OAUTH_CLIENT_SECRET", "SANDBOX_POOL_SECRET", "GITHUB_APP_CLIENT_SECRET", "GITHUB_APP_PRIVATE_KEY", "GITHUB_APP_WEBHOOK_SECRET"];
54+export const SECRETS = ["MASTER_KEY", "MASTER_KEY_PREV", "OIDC_PRIVATE_KEY", "MAIL_EVENTS_SECRET", "TURNSTILE_SECRET", "GITHUB_OAUTH_CLIENT_SECRET", "SANDBOX_POOL_SECRET", "GITHUB_APP_CLIENT_SECRET", "GITHUB_APP_PRIVATE_KEY", "GITHUB_APP_WEBHOOK_SECRET", "SMTP_PASSWORD"];
5555
5656 /**
5757 * wrangler.jsonc as celld takes it. Returns the config and the bindings left out (`absent`), which