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 @@ | ||
| 58 | 58 | - **Keep it running on celld**, the open-source Workers runtime |
| 59 | 59 | (`apps/diffinery/docs/self-hosting/celld.md`). Make a binding celld lacks optional (and list it in |
| 60 | 60 | `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 | |
| 62 | 62 | `Response` from a Durable Object RPC method: stream through its `fetch()`. `test/unit/celld.test.ts` checks it. |
| 63 | 63 | - **D1 migrations** live in `apps/diffinery/migrations`. Use the next free number and never |
| 64 | 64 | edit a migration that has shipped. |
modifiedapps/diffinery/docs/self-hosting/celld.md+1−1View file
| @@ -55,7 +55,7 @@ | ||
| 55 | 55 | pnpm -r build |
| 56 | 56 | ``` |
| 57 | 57 | |
| 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. | |
| 59 | 59 | |
| 60 | 60 | ```sh |
| 61 | 61 | export MASTER_KEY="$(openssl rand -base64 32)" |
modifiedapps/diffinery/test/unit/celld.test.ts+1−1View file
| @@ -56,7 +56,7 @@ | ||
| 56 | 56 | }); |
| 57 | 57 | |
| 58 | 58 | /** 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}`)]); | |
| 60 | 60 | |
| 61 | 61 | function sources(dir: string): string[] { |
| 62 | 62 | return readdirSync(dir).flatMap((f) => { |
modifiedcontainers/runner/test/job.test.ts+2−1View file
| @@ -954,7 +954,8 @@ | ||
| 954 | 954 | expect(api.logText()).toContain("Runner: image diffinery-runner:abc123, in fra06, EEUR, container d0"); |
| 955 | 955 | // A hosted runner also names its host's processor and, at the end, the share of its vCPUs' time the host took. |
| 956 | 956 | 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$/, "")}`); | |
| 958 | 959 | expect(api.logText()).toMatch(/Host: \d+% of the vCPUs' time went to other work on the host \(steal\)/); |
| 959 | 960 | } |
| 960 | 961 | expect(api.completion).toMatchObject({ conclusion: "failure", failure: { step: 0 } }); |
modifiedscripts/celld-config.mjs+1−1View file
| @@ -51,7 +51,7 @@ | ||
| 51 | 51 | const CONTAINER_KEYS = ["class_name", "image", "name", "instance_type", "max_instances", "runtime"]; |
| 52 | 52 | |
| 53 | 53 | /** 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"]; | |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * wrangler.jsonc as celld takes it. Returns the config and the bindings left out (`absent`), which |