diff --git a/.gitattributes b/.gitattributes index 8e1fcf5679d6..149a7c2ba9a6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,3 +9,5 @@ packages/client/src/effect/generated/** linguist-generated packages/client/src/effect/api/** linguist-generated packages/core/src/**/*.txt text eol=lf packages/httpapi-codegen/test/generated/*.ts text eol=lf +# The site tests compare source text and humans.txt byte for byte, so Windows checkouts keep LF. +services/site/** text=auto eol=lf diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index cceccb784c09..a3f533d5cb31 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,11 +1,3 @@ -# web + desktop packages -packages/app/ @Hona @Brendonovich -packages/desktop/ @Hona @Brendonovich - -# GUI plugin SDK -# changes here must be meticulous - pls chat first :) -packages/plugin/src/gui/ @Hona - # CI and releases. Release jobs that hold secrets run only .github/workflows/release.yml and .github/release/, -# which makes this path the release security boundary. -/.github/ @anomalyco/releasers +# which makes this path the release security boundary. It is the only path that needs a code owner review. +/.github/ @thdxr diff --git a/.github/actions/setup-git-committer/action.yml b/.github/actions/setup-git-committer/action.yml deleted file mode 100644 index 65c974c6ab48..000000000000 --- a/.github/actions/setup-git-committer/action.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: "Setup Git Committer" -description: "Create app token and configure git user" -inputs: - opencode-app-id: - description: "OpenCode GitHub App ID" - required: true - opencode-app-secret: - description: "OpenCode GitHub App private key" - required: true -outputs: - token: - description: "GitHub App token" - value: ${{ steps.apptoken.outputs.token }} - app-slug: - description: "GitHub App slug" - value: ${{ steps.apptoken.outputs.app-slug }} -runs: - using: "composite" - steps: - - name: Create app token - id: apptoken - uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2.2.2 - with: - app-id: ${{ inputs.opencode-app-id }} - private-key: ${{ inputs.opencode-app-secret }} - owner: ${{ github.repository_owner }} - - - name: Configure git user - run: | - slug="${{ steps.apptoken.outputs.app-slug }}" - git config --global user.name "${slug}[bot]" - git config --global user.email "${slug}[bot]@users.noreply.github.com" - shell: bash - - - name: Clear checkout auth - run: | - git config --local --unset-all http.https://github.com/.extraheader || true - shell: bash - - - name: Configure git remote - run: | - git remote set-url origin https://x-access-token:${{ steps.apptoken.outputs.token }}@github.com/${{ github.repository }} - shell: bash diff --git a/packages/console/app/src/asset/logo-ornate-dark.svg b/.github/assets/logo-ornate-dark.svg similarity index 100% rename from packages/console/app/src/asset/logo-ornate-dark.svg rename to .github/assets/logo-ornate-dark.svg diff --git a/packages/console/app/src/asset/logo-ornate-light.svg b/.github/assets/logo-ornate-light.svg similarity index 100% rename from packages/console/app/src/asset/logo-ornate-light.svg rename to .github/assets/logo-ornate-light.svg diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a323ca5a6b33..393bf90518e9 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -17,13 +17,6 @@ Please provide a description of the issue, the changes you made to fix it, and w ### How did you verify your code works? -### Visual - -_Optional, for user-facing changes: a small looping animated SVG (240×72) of the change, shown in the desktop app's "What's new in beta". Replace the block below or delete this section._ - -```svg -``` - ### Screenshots / recordings _If this is a UI change, please include a screenshot or recording._ diff --git a/.github/release/README.md b/.github/release/README.md new file mode 100644 index 000000000000..e923a3a7c259 --- /dev/null +++ b/.github/release/README.md @@ -0,0 +1,61 @@ +# Deploy boundary + +The deploy workflows (`deploy.yml`, `deploy-site.yml`, `deploy-files.yml`, +`deploy-update.yml`) split every service in two: + +- **build** runs repository code (`bun install`, `cf build`, `bun script/build.ts`, + `wrangler deploy --dry-run`) with no environment, no secrets, and no OIDC + token. It uploads the deploy-ready output with a `SHA256SUMS` and reports that + manifest's digest as a job output. +- **deploy** runs in the `dev` or `production` environment, assumes the stage's + AWS role, mints a short-lived Cloudflare token from the token issuer + (`cloudflare-token.sh`), and checks out only `.github/release/`. It verifies + the artifact against the digest the build job reported, installs the pinned + `cf`/`wrangler` CLI (`npm ci --ignore-scripts`), and runs only a + `deploy-*.sh` script here. + +Repository code outside `.github/` does not need Dax's review, so the deploy job +must never execute it. The scripts treat the artifact as data: Worker code and +assets may change freely, but names, routes, custom domains, crons, Workflow and +export names, and every binding (including service bindings to other Workers) +come from `targets/`. An artifact whose resolved config is not byte-for-byte one +of those pinned targets is refused before the token is used. + +For `cf` services the pinned target is also what `cf` reads: the script copies +the target over the artifact's config after validating it. For `wrangler` +services the artifact is only `index.js`; the complete `wrangler.json` is the +pinned target. + +## Why the token can be account-wide + +Cloudflare has no per-Worker permission for Workflows. The data sync Worker owns +a Workflow, and `PUT /accounts//workflows/` needs account-wide +`Workers Scripts Write`, so `Individual Workers Editor` fails that deploy. + +Dev and production therefore mint a token that can write any Worker on the +account. That is only safe because the code holding it is this directory: one +reviewed script per service, on a verified artifact, with every destination +pinned in `targets/`. Do not move a deploy back into a job that runs repository +code, and do not widen a script's accepted targets without review. + +Production keeps this token only for a Dax-approved fast-forward of `dev`; a +`dev` merge cannot reach the production environment. + +## Production promotion notes + +Moving `dev` to `production` deploys the same pinned targets with the same +scripts, but production holds an account-wide token and a bad deploy is live. + +Before promoting: + +1. Confirm every dev deploy job is green on the commit being promoted + (`deploy`, `deploy-site`, `deploy-files`; `deploy-update` runs on production + only). +2. Diff `.github/release/targets/` against `origin/production`. Any change here + is a change to what production may deploy. +3. Rollback is a fast-forward back to the previous `production` commit, which + redeploys the previous Worker code from the same pinned targets. If a target + itself changed and must be reverted, revert it with the deploy commit. +4. The production deploy job runs only `.github/release/` at `github.sha`; it + does not run repo code. The build job still runs repo code, but with no + secrets and no OIDC token. diff --git a/.github/release/cf/package-lock.json b/.github/release/cf/package-lock.json new file mode 100644 index 000000000000..af6f4e3211a7 --- /dev/null +++ b/.github/release/cf/package-lock.json @@ -0,0 +1,1138 @@ +{ + "name": "cf", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "cf": "1.0.0-beta.12" + } + }, + "node_modules/@cloudflare/build-output-utils": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/@cloudflare/build-output-utils/-/build-output-utils-0.8.5.tgz", + "integrity": "sha512-xnwcDCyBSErZeOj5eUy1gTrmVjwIY51TZ0Pz9W7mZqLGA3IkIckud7dNtFdGhKSXL2szfxBRbGM4R4qFE4SoPA==", + "license": "MIT", + "dependencies": { + "@cloudflare/config": "0.23.0" + } + }, + "node_modules/@cloudflare/codemods": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@cloudflare/codemods/-/codemods-0.4.0.tgz", + "integrity": "sha512-qeRpKNXtvqhTtagx/5cLmDaFx/voBhWJ1S6SdFdBkE3OtgcPVz+Q8MtIG26zltW9Z0Icsu2FGBxV5RFmuHI/Bg==", + "license": "MIT OR Apache-2.0", + "bin": { + "cloudflare-codemods": "dist/bin.mjs" + } + }, + "node_modules/@cloudflare/config": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@cloudflare/config/-/config-0.23.0.tgz", + "integrity": "sha512-oE0S7X54esZmJHr9hhCoqODR+yTxxkSYWCLtRiItQdPs0gQuqYw9a13zChhK+8DmdCUJIFBsMAR6t+mfu8g+9w==", + "license": "MIT", + "dependencies": { + "zod": "4.4.3" + } + }, + "node_modules/@cloudflare/runtime-types": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/@cloudflare/runtime-types/-/runtime-types-0.1.7.tgz", + "integrity": "sha512-avgC1wfTunbVea8HOq4ygiQ0WFQVNxcUHOQvH9TM47+0NTdsVTqB8rPQg6Tb5BfVkcWh/a0RAjk+Elr/h35mtQ==", + "license": "MIT", + "dependencies": { + "miniflare": "5.20261001.0-alpha", + "workerd": "1.20261001.1" + } + }, + "node_modules/@cloudflare/runtime-types/node_modules/miniflare": { + "version": "5.20261001.0-alpha", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20261001.0-alpha.tgz", + "integrity": "sha512-GaimS5mSIOMyvd16ga+e1/QkI8cmp3z35QPHFex0DktqNQf2RVZQwMPQXdyoUreUiFP/0Gpe2MoQInTyMAD5xA==", + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "0.8.1", + "sharp": "0.35.4", + "undici": "7.29.1", + "workerd": "1.20261001.1", + "ws": "8.21.0", + "youch": "4.1.0-beta.10" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20261001.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20261001.1.tgz", + "integrity": "sha512-4cgSgDf28JSw/P5Dj5GCS59hzVqS5XnmGAWNkvYHLI6ODU9idGaMMNEuhJXDkEG/lsABmlVlnCgsdh2VbKWepw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20261001.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20261001.1.tgz", + "integrity": "sha512-8ulAWruEVouNmEIsQsy9WSSCS9zkLu93W2MTwp5esiFyoPp05BNSVFIFsYSPi1pkFmBBd7fsnwMpbLkaJLaVPQ==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20261001.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20261001.1.tgz", + "integrity": "sha512-kZbTZJGrhsMOdqZ2BIybjaBRLZjYsRLWj7mcNw/6Y3hodOhp5MrNzcz4iWGwNVWwyIV+7Pl+/LX5VcgnRqdHOg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20261001.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20261001.1.tgz", + "integrity": "sha512-oOk3Zj6k/8oP0FJgZBWDn7+BqbsqIMEMaV95pulHPVbwVu4wYoLfQq2hp0vkbCNsCFLqZb7cqixXdrwD54ZIow==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20261001.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20261001.1.tgz", + "integrity": "sha512-uRxm5W4VyBkoSaoP1BfOuH0873tE+vxsknF4sab6/5YIRvIAufChq3QDp+zlAn67PuGPGcn7W8QraA0t4ucmOQ==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz", + "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.4.tgz", + "integrity": "sha512-Uhfl4V4lhP2nbUVF9+hyH1+luj86f1gUFeo8ALYxFoULoU+G87D43BfeMP8XHsk9boxAnCY/bf2EHwhA7MuGsA==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.3.3" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.4.tgz", + "integrity": "sha512-hWniXY3bG5qKpkKrAwPe4y+VTPmf086YQAnkxWh7uA1YrlRouWGa0M0Mxj3ZjnXFkv7/TD1bTy9lGUK26vRvWw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.3.3" + } + }, + "node_modules/@img/sharp-freebsd-wasm32": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.4.tgz", + "integrity": "sha512-lIsKw/BU+kjB4eZjxrYrZmwOJYi3Ajrv66iAlBmUPyKc3HpnloevB1g3wxGD9P/5BbQ1brBGl65VRRrCvQDEqA==", + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "dependencies": { + "@img/sharp-wasm32": "0.35.4" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.3.tgz", + "integrity": "sha512-suTBPTDGrI9WodccaDdwZItTSaBYASlBk1NSfElSHrUfzu3szG6lvIF58+WiFvnfzuK8ZBFS5zE00PxqxnRiPg==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.3.tgz", + "integrity": "sha512-FVJZ5mITMobmXIz/hPDTw0EintTW5H3WfrxwLqEqjiIihlu+hVRyGrFQ60xl0Lxn7Bt3zdpevPaQi0HEzqz9fw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.3.tgz", + "integrity": "sha512-3rbU4vqXXc3hY/OiXdl52xZvT0F1yEngWfvqudtPJg/KkyiaQw2DRsFrNzpmLvfavbwOq3qXn36GP8obHRULQA==", + "cpu": [ + "arm" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.3.tgz", + "integrity": "sha512-0DaL0A6Xu6sQSQFwe4iVCrKWU2cCTItnRsYsCdxAMm9NF6twAA9BKnoqy4hqz4+azQ0JHuA26qiUKsf1XJ/v5A==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.3.tgz", + "integrity": "sha512-cdn1OvUBwsXhbC0zSzJnNzf5MZ/mTrobawDvNXBTxe8VtqKAm0sRuEY2Evzovb/w9JMk4TvRxqt1mekSuJz64w==", + "cpu": [ + "ppc64" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.3.tgz", + "integrity": "sha512-HjPVx7yKz+0lqdhDlTw1tt90wamBoxhiXpvl1XZpJLiHH4RCJ5yDTqH+VlYPv2fwFs89JFw4c1IexYOcQUi4IQ==", + "cpu": [ + "riscv64" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.3.tgz", + "integrity": "sha512-neWLh+3yCNThxnfy3c4BbVBeGgt9aftno+XbT56iK28RgeDs3UOFWviLWlUu0bArYVYJaFDK+RRohbicUNCm8Q==", + "cpu": [ + "s390x" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.3.tgz", + "integrity": "sha512-4vKmvAst9nrowcqquKFAyZJUDolUaIp8uRiN0mWFguJ1IplC9/pitXtlnnlU4aa/eJw3J7i67V+pwUL+wZGdsA==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.3.tgz", + "integrity": "sha512-Y9kQaLMuNoB0bPYOOdcZMaseNrFpPodIWWMrx+CZyydf2xn68j9WYc6sWWRrDwNkzCQjKYfc68L7jKjGlHMibw==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.3.tgz", + "integrity": "sha512-fj8Mv0HHfD1Rr+4I68+3agJynxDWtBFgicTbSOb9Bke6pIwzGcJ+RX/yHjmiEGFMCavY/dxvem7MyNaJF+wDiw==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.4.tgz", + "integrity": "sha512-7OAS8gI0EReKGVN2HssHlM6umJgxF5VI3xN0p9FA91p/YO+ou5hiNghLdZ5BEHztwaaK5+bLKRf8x/o2L2nk9A==", + "cpu": [ + "arm" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.3.3" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.4.tgz", + "integrity": "sha512-De4jpEnAU8Hd5oT0j1G3uL4ZvTuipVMn7YC6vPaJhy6/7EwEae0SVAoBrUMYQbkLGDm85taVWwuPc1a44LTzCQ==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.3.3" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.4.tgz", + "integrity": "sha512-2oYZJeIl4kCcMGk4ouZVjnkCtFrpQFlNEtJ6GbxzhHQchwH0NH/qEb9ykmOl29dqwMq+JhFdZn+1ak2FKhI9fQ==", + "cpu": [ + "ppc64" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.3.3" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.4.tgz", + "integrity": "sha512-cPbNChoRURAWdebDIHSenxRpgEdy7JkPydSnUxRm9VvKD7m0/xVaR/8Fzlu81pk5nHEvHH87UZUA7cTtwnbJSA==", + "cpu": [ + "riscv64" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.3.3" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.4.tgz", + "integrity": "sha512-RY0JFY8Fd6RonCBtHz+DvadaPkXDSI1AUn6yWL9TipqkZ1vY8w8evqdgyDFnkm4/K1ve1TvZiaePP5oSd4+WVQ==", + "cpu": [ + "s390x" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.3.3" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.4.tgz", + "integrity": "sha512-9qvvEAuk8k89TfWUoX2htWjbAMX8p+NxCppjpcg5k6xMsjhBQPTsoIh36h9Qde4WRuGpJeYnOjdosDn/cnv+OA==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.3.3" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.4.tgz", + "integrity": "sha512-KB5jxpfWQTr0nc3xdHtWChdbifHrBGsd2SM62Eyxrl8afikm+f5qGBU75SJIZBT/S1MC8XyacdlXBMSWq6OURA==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.3.3" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.4.tgz", + "integrity": "sha512-f+eZJZIQNEEd26RPSW+76chwOf1XtA2Y/O+5ocVyLliHkeih3e+jhLVBdNTd2rS3IbNXK8+ug93Vf5ZXtF5Lxg==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.3.3" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.4.tgz", + "integrity": "sha512-zQnl4Kwp7Q6NHsENtU2T/00Zi+w3AQNwz3+UaTyVBy2FpXrzXzGjndpK61onhZjRtRpQXxCTeqw19bVyXOh7jA==", + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.11.3" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-webcontainers-wasm32": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.4.tgz", + "integrity": "sha512-ESfNkywmCfPNyaZjxooddJQiQ+l/nTpGEOGthxiLnIHXC/CmcBixnfwUleX9mCz9ovrUUvKMap/pm8RYbzfwaA==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@img/sharp-wasm32": "0.35.4" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.4.tgz", + "integrity": "sha512-iNdlBX9gLVvqe2I3uIJSIKTq6wckP/DYxZtcqxm09x5Gi24DnFBmPAWZmr60ZyYMG0xlzo6goG3670ar+RXvRw==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.4.tgz", + "integrity": "sha512-kqRsbaa5CS6KHlpxnN7WhE6vAAugXyZButpRdvDWetlv6Qv4N9WTcrWzF7tXfB9T7MsoadqdI8hmwLq6UlLvtw==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.4.tgz", + "integrity": "sha512-XtmnYhBcrORsJ4XJngyzr/EWP0hRZLAZRFaApdKuviyqF78+ylxh2y06ZmtULAMOnObJ3ucpN0AcwSWnMowTRg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@poppinss/colors": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz", + "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==", + "license": "MIT", + "dependencies": { + "kleur": "^4.1.5" + } + }, + "node_modules/@poppinss/dumper": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz", + "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==", + "license": "MIT", + "dependencies": { + "@poppinss/colors": "^4.1.5", + "@sindresorhus/is": "^7.0.2", + "supports-color": "^10.0.0" + } + }, + "node_modules/@poppinss/exception": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz", + "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==", + "license": "MIT" + }, + "node_modules/@sindresorhus/is": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.2.0.tgz", + "integrity": "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@speed-highlight/core": { + "version": "1.2.24", + "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.24.tgz", + "integrity": "sha512-qeW2e1l78afw8VhRPfPQ1Gjj+KU5XFQ/OFV5ti6eTa9bruO7mJyZtA4vw0ofqmA3tKCkROE9xLk3VZoeRc98nw==", + "license": "CC0-1.0" + }, + "node_modules/blake3-wasm": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz", + "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==", + "license": "MIT" + }, + "node_modules/cf": { + "version": "1.0.0-beta.12", + "resolved": "https://registry.npmjs.org/cf/-/cf-1.0.0-beta.12.tgz", + "integrity": "sha512-tyQ+Jpnw+4NDwDtl7ZNteXBm7N0TeJ6gYww79kkabpcYoCEXkUUpmt9BlDUKH8ub17tjAeiuyqa9NQzH0vp2Aw==", + "license": "MIT OR Apache-2.0", + "dependencies": { + "@cloudflare/build-output-utils": "0.8.5", + "@cloudflare/codemods": "0.4.0", + "@cloudflare/config": "0.23.0", + "@cloudflare/runtime-types": "0.1.7", + "blake3-wasm": "2.1.5", + "miniflare": "5.20260930.0-alpha", + "minisearch": "7.2.0" + }, + "bin": { + "cf": "bin/cf", + "cloudflare": "bin/cf" + }, + "engines": { + "node": ">=22" + } + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/error-stack-parser-es": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz", + "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/miniflare": { + "version": "5.20260930.0-alpha", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20260930.0-alpha.tgz", + "integrity": "sha512-vZljfRtOEeynbhJtuvYsnCU8t6zF5wIUm9ql4YFHB7zvYw2+F2tpT0BzXjzaa++eiUIml1gsODCf02qShBmJdg==", + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "0.8.1", + "sharp": "0.35.4", + "undici": "7.29.1", + "workerd": "1.20260930.2", + "ws": "8.21.0", + "youch": "4.1.0-beta.10" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/miniflare/node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20260930.2", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260930.2.tgz", + "integrity": "sha512-wxKsfekWeev6xkjHEMx3x7nz6WfWOn1/scQ8geqWQhUm8qRl1ZRZhjnj+rucIMLhLhP9RGSYMZIjEm3AV0zwVQ==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/miniflare/node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20260930.2", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260930.2.tgz", + "integrity": "sha512-cviPpheZGQ2H5X+Ctxd3wfxhksNrdyoNprjSgg3br2+psetKacjdEvK8CILdN/2GF+u1KOExvr45amSL6lgzGA==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/miniflare/node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20260930.2", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260930.2.tgz", + "integrity": "sha512-cwrJAC5y/avPd1OzGyhc5OvUUfPXBFc065TY5CjXp7Hb3dhiTx6JeB5Pc8L3G8L8M44HyAfRHSpoLtRr+SR3cQ==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/miniflare/node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20260930.2", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260930.2.tgz", + "integrity": "sha512-FHucB4gak1IuT+IxLx3KbtMBMapZhcqD9EdhHvBxk1FpHwD2QU5x26MRRVN53jIKG/O25HUmE9yffb3cMANQgw==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/miniflare/node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20260930.2", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260930.2.tgz", + "integrity": "sha512-JHFMdGFMqP+M2QiVzZq1S8Ie66Gvxo7Og5EYz/KtmDvGCqge5L3lK+ksZxAhF3j/tpSLqdvlUvcTKoR9PkwTTQ==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/miniflare/node_modules/workerd": { + "version": "1.20260930.2", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20260930.2.tgz", + "integrity": "sha512-k1lQzEiGyCDqaRsR5+o9PBT5wVU5omtas6hXx3spbEHHMFo8a7tkAixVCMsWFeiT7xhrmg21Hd6a9jLNrkcUMg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20260930.2", + "@cloudflare/workerd-darwin-arm64": "1.20260930.2", + "@cloudflare/workerd-linux-64": "1.20260930.2", + "@cloudflare/workerd-linux-arm64": "1.20260930.2", + "@cloudflare/workerd-windows-64": "1.20260930.2" + } + }, + "node_modules/minisearch": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/minisearch/-/minisearch-7.2.0.tgz", + "integrity": "sha512-dqT2XBYUOZOiC5t2HRnwADjhNS2cecp9u+TJRiJ1Qp/f5qjkeT5APcGPjHw+bz89Ms8Jp+cG4AlE+QZ/QnDglg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sharp": { + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.4.tgz", + "integrity": "sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA==", + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.1.0", + "detect-libc": "^2.1.2", + "semver": "^7.8.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.35.4", + "@img/sharp-darwin-x64": "0.35.4", + "@img/sharp-freebsd-wasm32": "0.35.4", + "@img/sharp-libvips-darwin-arm64": "1.3.3", + "@img/sharp-libvips-darwin-x64": "1.3.3", + "@img/sharp-libvips-linux-arm": "1.3.3", + "@img/sharp-libvips-linux-arm64": "1.3.3", + "@img/sharp-libvips-linux-ppc64": "1.3.3", + "@img/sharp-libvips-linux-riscv64": "1.3.3", + "@img/sharp-libvips-linux-s390x": "1.3.3", + "@img/sharp-libvips-linux-x64": "1.3.3", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.3", + "@img/sharp-libvips-linuxmusl-x64": "1.3.3", + "@img/sharp-linux-arm": "0.35.4", + "@img/sharp-linux-arm64": "0.35.4", + "@img/sharp-linux-ppc64": "0.35.4", + "@img/sharp-linux-riscv64": "0.35.4", + "@img/sharp-linux-s390x": "0.35.4", + "@img/sharp-linux-x64": "0.35.4", + "@img/sharp-linuxmusl-arm64": "0.35.4", + "@img/sharp-linuxmusl-x64": "0.35.4", + "@img/sharp-webcontainers-wasm32": "0.35.4", + "@img/sharp-win32-arm64": "0.35.4", + "@img/sharp-win32-ia32": "0.35.4", + "@img/sharp-win32-x64": "0.35.4" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/supports-color": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz", + "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD", + "optional": true + }, + "node_modules/undici": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.29.1.tgz", + "integrity": "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q==", + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/workerd": { + "version": "1.20261001.1", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20261001.1.tgz", + "integrity": "sha512-d/SIYHFO0PT/wiFZg8in4NpRIxYuFwslX1HdylOtWkBIIUmSpkGFhK820cV84XACFylwJ48xuRoWW/8DWDPsPQ==", + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20261001.1", + "@cloudflare/workerd-darwin-arm64": "1.20261001.1", + "@cloudflare/workerd-linux-64": "1.20261001.1", + "@cloudflare/workerd-linux-arm64": "1.20261001.1", + "@cloudflare/workerd-windows-64": "1.20261001.1" + } + }, + "node_modules/ws": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/youch": { + "version": "4.1.0-beta.10", + "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz", + "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==", + "license": "MIT", + "dependencies": { + "@poppinss/colors": "^4.1.5", + "@poppinss/dumper": "^0.6.4", + "@speed-highlight/core": "^1.2.7", + "cookie": "^1.0.2", + "youch-core": "^0.3.3" + } + }, + "node_modules/youch-core": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz", + "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==", + "license": "MIT", + "dependencies": { + "@poppinss/exception": "^1.2.2", + "error-stack-parser-es": "^1.0.5" + } + }, + "node_modules/zod": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", + "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/.github/release/cf/package.json b/.github/release/cf/package.json new file mode 100644 index 000000000000..fd8f7fa4fa0f --- /dev/null +++ b/.github/release/cf/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "description": "The pinned cf CLI that deploy-site.sh runs; npm ci --ignore-scripts installs exactly package-lock.json.", + "dependencies": { + "cf": "1.0.0-beta.12" + } +} diff --git a/.github/release/cloudflare-token.sh b/.github/release/cloudflare-token.sh new file mode 100755 index 000000000000..478f0599cdf1 --- /dev/null +++ b/.github/release/cloudflare-token.sh @@ -0,0 +1,114 @@ +#!/usr/bin/env bash +# Mints a short-lived Cloudflare token for the current job from the token issuer +# (anomalyco/secrets). Run after aws-actions/configure-aws-credentials has assumed +# arn:aws:iam::604439173067:role/github/opencode- (release, dev or production): the Lambda +# identifies the role from the SigV4 signature and mints only that stage's token. No repo, stage, +# permission or TTL is sent in the request, and the token is pinned to the runner's IP. +# +# Step-scoped by default: the token goes to $GITHUB_OUTPUT and only steps that list +# `CLOUDFLARE_API_TOKEN: ${{ steps..outputs.token }}` in their env receive it. +set -euo pipefail +set +x + +url=${CLOUDFLARE_TOKEN_URL:-https://kjivkui2evldapbok5fhrrl6oy0fctkp.lambda-url.us-east-1.on.aws/} +account=${CLOUDFLARE_ACCOUNT_ID:-15d29c8639fd3733b1b5486a2acfd968} +if [[ $# == 1 ]]; then + . "$(dirname "$0")/lib.sh" + account=$(stage_account "$1") +fi + +# One argv value, never a line in curl's config: a newline in an override must not be able to +# inject curl options or move the AWS credentials into Basic auth. +url_pattern='^https://[a-z0-9]+\.lambda-url\.us-east-1\.on\.aws/$' +if ! [[ "$url" =~ $url_pattern ]]; then + echo "::error::CLOUDFLARE_TOKEN_URL is not the token issuer's function URL." >&2 + exit 1 +fi +case "$account" in + *[!0-9a-f]*|"") + echo "::error::CLOUDFLARE_ACCOUNT_ID must be a 32-character lowercase hex id." >&2 + exit 1 + ;; +esac +if [ ${#account} -ne 32 ]; then + echo "::error::CLOUDFLARE_ACCOUNT_ID must be a 32-character lowercase hex id." >&2 + exit 1 +fi +for name in AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN; do + if [ -z "${!name:-}" ]; then + echo "::error::$name is not set; run aws-actions/configure-aws-credentials first." >&2 + exit 1 + fi +done + +# The response is captured, never streamed: it contains the token. AWS credentials go to curl +# through stdin, not argv, so they stay out of `ps` and any trace of this script. +response=$( + printf 'user = "%s:%s"\nheader = "x-amz-security-token: %s"\n' \ + "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "$AWS_SESSION_TOKEN" | + curl --config - \ + --proto '=https' --proto-redir '=https' \ + --aws-sigv4 "aws:amz:us-east-1:lambda" \ + --request POST --url "$url" \ + --fail-with-body --silent --show-error --max-time 20 +) + +token=$(printf '%s' "$response" | jq -er 'if (.token | type) == "string" then .token else error("token") end' 2>/dev/null) +expires=$(printf '%s' "$response" | jq -er 'if (.expires_on | type) == "string" then .expires_on else error("expires_on") end' 2>/dev/null) + +# Validate before any output. No error below includes the token value. +case "$token" in + ""|*[[:space:]]*) + echo "::error::The token issuer returned an invalid token." >&2 + exit 1 + ;; +esac +if [ ${#token} -lt 8 ] || [ ${#token} -gt 512 ]; then + echo "::error::The token issuer returned an invalid token length." >&2 + exit 1 +fi +case "$expires" in + ""|*[[:space:]]*) + echo "::error::The token issuer returned an invalid expires_on." >&2 + exit 1 + ;; +esac +iso_pattern='^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?Z$' +if ! printf '%s' "$response" | jq -e --arg re "$iso_pattern" '(.expires_on | type) == "string" and (.expires_on | test($re))' > /dev/null; then + echo "::error::The token issuer returned an invalid expires_on." >&2 + exit 1 +fi +if ! [[ "$expires" =~ $iso_pattern ]]; then + echo "::error::The token issuer returned an invalid expires_on." >&2 + exit 1 +fi + +# GitHub masks the exact string everywhere after this, including accidental traces and our own +# error messages. This is the first output that contains it. +printf '::add-mask::%s\n' "$token" + +if [ -n "${GITHUB_OUTPUT:-}" ]; then + { + printf 'token=%s\n' "$token" + printf 'expires_on=%s\n' "$expires" + } >> "$GITHUB_OUTPUT" +elif [ -n "${GITHUB_ENV:-}" ]; then + printf 'CLOUDFLARE_API_TOKEN=%s\n' "$token" >> "$GITHUB_ENV" +fi + +# Verify immediately, with the token on curl's stdin rather than argv. A runner whose Cloudflare +# egress address differs from the address Lambda saw (IPv4 vs IPv6, or a different NAT address) +# fails here instead of part way through an upload. +verify_url="https://api.cloudflare.com/client/v4/accounts/$account/tokens/verify" +if ! verify=$(printf 'header = "Authorization: Bearer %s"\nurl = "%s"\n' "$token" "$verify_url" | + curl --config - --proto '=https' --proto-redir '=https' --silent --show-error --fail-with-body --max-time 20); then + echo "::error::Cloudflare rejected the freshly minted token. The runner's egress IP to Cloudflare may differ from the IP Lambda saw (IPv4 vs IPv6 or a different NAT address). Use a runner with stable egress." >&2 + exit 1 +fi + +if ! printf '%s' "$verify" | jq -e '.success == true and .result.status == "active"' > /dev/null; then + echo "::error::Cloudflare did not report the freshly minted token as active." >&2 + exit 1 +fi + +echo "::notice::Cloudflare token ready; expires $expires" diff --git a/.github/release/deploy-data.sh b/.github/release/deploy-data.sh new file mode 100755 index 000000000000..48a5a6a03d14 --- /dev/null +++ b/.github/release/deploy-data.sh @@ -0,0 +1,86 @@ +#!/usr/bin/env bash +# deploy-data.sh : deploys the data site's +# three Workers (og, sync, default) from one verified Build Output artifact +# (services/data/.cloudflare/output) with the cf CLI pinned in +# cf/package-lock.json. Order matches services/data/script/deploy.ts: the OG +# Worker first because the site binds to it, then sync, then the site. +# +# The build job has no secrets, so the Workers' code and assets are untrusted +# by design: the data site can change freely. The configs may not. All three +# must equal targets/data//*.json exactly, and the pinned copies are what +# cf reads: another Worker name, route, cron, Workflow name, or binding +# (including the OG service binding) is refused before the token is used. +# +# The sync Worker's Workflow PUT needs account-wide Workers Scripts Write; +# Cloudflare has no per-Worker Workflows permission. That is safe only because +# this script (and the other deploy-*.sh) pin every target. +. "$(dirname "$0")/lib.sh" + +mode=$1 +src=$(cd "$2" && pwd) +secrets=$(posix "$3") +release=$(cd "$(dirname "$0")" && pwd) + +case "$mode" in + dev | production) ;; + *) die "Unknown data mode: $mode" ;; +esac +target="$release/targets/data/$mode" +for file in root default og sync; do + [ -f "$target/$file.json" ] || die "No pinned data target $target/$file.json" +done + +: "${CLOUDFLARE_API_TOKEN:?Set CLOUDFLARE_API_TOKEN}" +# Pinned in targets/ and in the token issuer's config (anomalyco/secrets). +CLOUDFLARE_ACCOUNT_ID=$(stage_account "$mode") +export CLOUDFLARE_ACCOUNT_ID + +unexpected=$(cd "$src" && find . ! -type d ! -type f -o -type f ! -path ./SHA256SUMS \ + ! -path ./v0/config.json \ + ! -path ./v0/workers/default/worker.config.json \ + ! -path './v0/workers/default/bundle/*' \ + ! -path './v0/workers/default/assets/*' \ + ! -path ./v0/workers/og/worker.config.json \ + ! -path './v0/workers/og/bundle/*' \ + ! -path ./v0/workers/sync/worker.config.json \ + ! -path './v0/workers/sync/bundle/*') +[ -z "$unexpected" ] || die "Unexpected files in the data artifact: $unexpected" +for dir in default og sync; do + [ -f "$src/v0/workers/$dir/bundle/index.mjs" ] || die "The data artifact has no $dir bundle/index.mjs" +done +[ -d "$src/v0/workers/default/assets" ] || die "The data artifact has no default assets directory" + +expect_json "$src/v0/config.json" "$target/root.json" "The data root config" +expect_json "$src/v0/workers/default/worker.config.json" "$target/default.json" "The data site's Worker config" +expect_json "$src/v0/workers/og/worker.config.json" "$target/og.json" "The OG Worker's config" +expect_json "$src/v0/workers/sync/worker.config.json" "$target/sync.json" "The sync Worker's config" + +jq -e 'keys == ["DATA_DATABASE_HOST", "DATA_DATABASE_PASSWORD", "DATA_DATABASE_USERNAME", "DATA_HIDDEN_MODELS", "R2_SQL_AUTH_TOKEN"] + and all(.[]; type == "string" and length > 0)' "$secrets" > /dev/null || + die "The secrets file does not hold exactly the data Workers' secrets" + +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT +output="$work/.cloudflare/output/v0" +mkdir -p "$output/workers/default" "$output/workers/og" "$output/workers/sync" +cp "$target/root.json" "$output/config.json" +for dir in default og sync; do + cp "$target/$dir.json" "$output/workers/$dir/worker.config.json" + cp -R "$src/v0/workers/$dir/bundle" "$output/workers/$dir/bundle" +done +cp -R "$src/v0/workers/default/assets" "$output/workers/default/assets" + +# Each Worker gets only the secrets its pinned config declares (cf rejects a +# missing one). The files are 0600 in the runner's temp directory and removed +# with the work directory. +umask 077 +jq '{DATA_DATABASE_HOST, DATA_DATABASE_USERNAME, DATA_DATABASE_PASSWORD}' "$secrets" > "$work/default-secrets.json" +cp "$secrets" "$work/sync-secrets.json" + +cf="$release/cf/node_modules/.bin/cf" +[ -x "$cf" ] || die "Install the pinned cf CLI first: npm ci --ignore-scripts in .github/release/cf" + +cd "$work" +"$cf" deploy --prebuilt --mode "$mode" --worker "$(jq -r .name "$target/og.json")" +"$cf" deploy --prebuilt --mode "$mode" --worker "$(jq -r .name "$target/sync.json")" --secrets-file "$work/sync-secrets.json" +"$cf" deploy --prebuilt --mode "$mode" --worker "$(jq -r .name "$target/default.json")" --secrets-file "$work/default-secrets.json" diff --git a/.github/release/deploy-files.sh b/.github/release/deploy-files.sh new file mode 100755 index 000000000000..0215545894ad --- /dev/null +++ b/.github/release/deploy-files.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# deploy-files.sh : deploys the files Worker from a +# verified bundle artifact (index.js built by `wrangler deploy --dry-run`) +# with the wrangler CLI pinned in wrangler/package-lock.json. +# +# The build job has no secrets, so the bundle is untrusted by design: its code +# can change freely. The rest of the Worker does not come from the artifact at +# all: the name, route, R2 bucket, and STAGE var are the complete pinned +# wrangler.json in targets/files//, which is what wrangler reads. The +# token can write every Worker on the account, so nothing in the artifact can +# name another destination. +. "$(dirname "$0")/lib.sh" + +mode=$1 +src=$(cd "$2" && pwd) +release=$(cd "$(dirname "$0")" && pwd) + +case "$mode" in + dev | production) ;; + *) die "Unknown files mode: $mode" ;; +esac +target="$release/targets/files/$mode/wrangler.json" +[ -f "$target" ] || die "No pinned files target for $mode" + +: "${CLOUDFLARE_API_TOKEN:?Set CLOUDFLARE_API_TOKEN}" +# Pinned in targets/ and in the token issuer's config (anomalyco/secrets). +CLOUDFLARE_ACCOUNT_ID=$(stage_account "$mode") +export CLOUDFLARE_ACCOUNT_ID + +unexpected=$(cd "$src" && find . ! -type d ! -type f -o -type f ! -path ./SHA256SUMS ! -path ./index.js) +[ -z "$unexpected" ] || die "Unexpected files in the files artifact: $unexpected" +[ -f "$src/index.js" ] || die "The files artifact has no index.js" + +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT +cp "$src/index.js" "$work/index.js" +cp "$target" "$work/wrangler.json" + +wrangler="$release/wrangler/node_modules/.bin/wrangler" +[ -x "$wrangler" ] || die "Install the pinned wrangler CLI first: npm ci --ignore-scripts in .github/release/wrangler" + +cd "$work" +"$wrangler" deploy --config wrangler.json --no-bundle diff --git a/.github/release/deploy-legacy.sh b/.github/release/deploy-legacy.sh new file mode 100755 index 000000000000..f64a0a46789f --- /dev/null +++ b/.github/release/deploy-legacy.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +# deploy-legacy.sh [production-secrets.json]: deploys the legacy +# Worker from a verified Build Output artifact (services/legacy/.cloudflare/output) +# with the cf CLI pinned in cf/package-lock.json. +# +# The build job has no secrets, so the Worker's code is untrusted by design. +# Its config must equal targets/legacy//*.json exactly, and the pinned +# copy is what cf reads: another Worker name, domain, or binding is refused +# before the token is used. The GitHub App secrets are read from AWS by the +# workflow into and reach cf as a file, never argv. +. "$(dirname "$0")/lib.sh" + +mode=$1 +src=$(cd "$2" && pwd) +release=$(cd "$(dirname "$0")" && pwd) + +case "$mode" in + dev | production) ;; + *) die "Unknown legacy mode: $mode" ;; +esac +target="$release/targets/legacy/$mode" +[ -f "$target/root.json" ] && [ -f "$target/worker.json" ] || die "No pinned legacy targets for $mode" + +: "${CLOUDFLARE_API_TOKEN:?Set CLOUDFLARE_API_TOKEN}" +# Pinned in targets/ and in the token issuer's config (anomalyco/secrets). +CLOUDFLARE_ACCOUNT_ID=$(stage_account "$mode") +export CLOUDFLARE_ACCOUNT_ID + +unexpected=$(cd "$src" && find . ! -type d ! -type f -o -type f ! -path ./SHA256SUMS \ + ! -path ./v0/config.json \ + ! -path ./v0/workers/default/worker.config.json \ + ! -path './v0/workers/default/bundle/*') +[ -z "$unexpected" ] || die "Unexpected files in the legacy artifact: $unexpected" +[ -f "$src/v0/workers/default/bundle/index.js" ] || die "The legacy artifact has no bundle/index.js" + +expect_json "$src/v0/config.json" "$target/root.json" "The legacy Worker's root config" +expect_json "$src/v0/workers/default/worker.config.json" "$target/worker.json" "The legacy Worker's config" + +args=() +if [[ "$mode" == production ]]; then + secrets=$(posix "$3") + jq -e 'keys == ["GITHUB_APP_ID", "GITHUB_APP_PRIVATE_KEY"] and all(.[]; type == "string" and length > 0)' \ + "$secrets" > /dev/null || die "The secrets file does not hold exactly GITHUB_APP_ID and GITHUB_APP_PRIVATE_KEY" + args=(--secrets-file "$secrets") +fi + +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT +output="$work/.cloudflare/output/v0" +mkdir -p "$output/workers/default" +cp "$target/root.json" "$output/config.json" +cp "$target/worker.json" "$output/workers/default/worker.config.json" +cp -R "$src/v0/workers/default/bundle" "$output/workers/default/bundle" + +cf="$release/cf/node_modules/.bin/cf" +[ -x "$cf" ] || die "Install the pinned cf CLI first: npm ci --ignore-scripts in .github/release/cf" + +cd "$work" +"$cf" deploy --prebuilt --mode "$mode" "${args[@]}" diff --git a/.github/release/deploy-site.sh b/.github/release/deploy-site.sh new file mode 100755 index 000000000000..5b6c5ad2d45b --- /dev/null +++ b/.github/release/deploy-site.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +# deploy-site.sh : deploys the site Worker from a verified +# Build Output artifact (services/site/.cloudflare/output) with the cf CLI +# pinned in cf/package-lock.json, which the workflow installs before the token +# is in reach. +# +# The build job has no secrets, so the Worker's code and assets are untrusted +# by design: the site can change freely. Its config may not. The artifact's +# root config and Worker config must equal targets/site//*.json exactly, +# and those pinned copies are what cf reads: another Worker name, route, +# domain, or binding is refused before the token is used. +. "$(dirname "$0")/lib.sh" + +mode=$1 +src=$(cd "$2" && pwd) +release=$(cd "$(dirname "$0")" && pwd) + +case "$mode" in + dev | production) ;; + *) die "Unknown site mode: $mode" ;; +esac +target="$release/targets/site/$mode" +[ -f "$target/root.json" ] && [ -f "$target/worker.json" ] || die "No pinned site targets for $mode" + +: "${CLOUDFLARE_API_TOKEN:?Set CLOUDFLARE_API_TOKEN}" +# Pinned in targets/ and in the token issuer's config (anomalyco/secrets). +CLOUDFLARE_ACCOUNT_ID=$(stage_account "$mode") +export CLOUDFLARE_ACCOUNT_ID + +unexpected=$(cd "$src" && find . ! -type d ! -type f -o -type f ! -path ./SHA256SUMS \ + ! -path ./v0/config.json \ + ! -path ./v0/workers/default/worker.config.json \ + ! -path './v0/workers/default/bundle/*' \ + ! -path './v0/workers/default/assets/*') +[ -z "$unexpected" ] || die "Unexpected files in the site artifact: $unexpected" +[ -f "$src/v0/workers/default/bundle/index.mjs" ] || die "The site artifact has no bundle/index.mjs" +[ -d "$src/v0/workers/default/assets" ] || die "The site artifact has no assets directory" + +expect_json "$src/v0/config.json" "$target/root.json" "The site's root config" +expect_json "$src/v0/workers/default/worker.config.json" "$target/worker.json" "The site's Worker config" + +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT +output="$work/.cloudflare/output/v0" +mkdir -p "$output/workers/default" +cp "$target/root.json" "$output/config.json" +cp "$target/worker.json" "$output/workers/default/worker.config.json" +cp -R "$src/v0/workers/default/bundle" "$output/workers/default/bundle" +cp -R "$src/v0/workers/default/assets" "$output/workers/default/assets" + +cf="$release/cf/node_modules/.bin/cf" +[ -x "$cf" ] || die "Install the pinned cf CLI first: npm ci --ignore-scripts in .github/release/cf" + +cd "$work" +"$cf" deploy --prebuilt --mode "$mode" diff --git a/.github/release/deploy-update.sh b/.github/release/deploy-update.sh new file mode 100755 index 000000000000..0e2435f366ca --- /dev/null +++ b/.github/release/deploy-update.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# deploy-update.sh : deploys the update Worker from a verified +# bundle artifact (index.js built by `wrangler deploy --dry-run`) with the +# wrangler CLI pinned in wrangler/package-lock.json. +# +# The build job has no secrets, so the bundle is untrusted by design: its code +# can change freely. The rest of the Worker does not come from the artifact at +# all: the name, routes, custom domain, D1 database, and Pipelines stream are +# the complete pinned wrangler.json in targets/update/production/, which is what +# wrangler reads. Only production deploys this Worker. +. "$(dirname "$0")/lib.sh" + +mode=$1 +src=$(cd "$2" && pwd) +release=$(cd "$(dirname "$0")" && pwd) + +[ "$mode" = production ] || die "The update Worker deploys only to production, not $mode" +target="$release/targets/update/production/wrangler.json" +[ -f "$target" ] || die "No pinned update target" + +: "${CLOUDFLARE_API_TOKEN:?Set CLOUDFLARE_API_TOKEN}" +# Pinned in targets/ and in the token issuer's config (anomalyco/secrets). +export CLOUDFLARE_ACCOUNT_ID=15d29c8639fd3733b1b5486a2acfd968 + +unexpected=$(cd "$src" && find . ! -type d ! -type f -o -type f ! -path ./SHA256SUMS ! -path ./index.js) +[ -z "$unexpected" ] || die "Unexpected files in the update artifact: $unexpected" +[ -f "$src/index.js" ] || die "The update artifact has no index.js" + +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT +cp "$src/index.js" "$work/index.js" +cp "$target" "$work/wrangler.json" + +wrangler="$release/wrangler/node_modules/.bin/wrangler" +[ -x "$wrangler" ] || die "Install the pinned wrangler CLI first: npm ci --ignore-scripts in .github/release/wrangler" + +cd "$work" +"$wrangler" deploy --config wrangler.json --no-bundle diff --git a/.github/release/download/action.yml b/.github/release/download/action.yml index de159d799b17..e1b80f6a28c4 100644 --- a/.github/release/download/action.yml +++ b/.github/release/download/action.yml @@ -8,6 +8,10 @@ inputs: description: Space-separated name=digest pairs for artifacts made by sign jobs, from their job outputs required: false default: "" + require-digests: + description: Require every artifact to match a reported digest (deploy jobs set this) + required: false + default: "false" runs: using: composite steps: @@ -19,3 +23,4 @@ runs: run: bash "${GITHUB_ACTION_PATH//\\//}/../verify-artifacts.sh" "$RUNNER_TEMP/in" env: OPENCODE_DIGESTS: ${{ inputs.digests }} + OPENCODE_REQUIRE_DIGESTS: ${{ inputs.require-digests }} diff --git a/.github/release/import-certificate.sh b/.github/release/import-certificate.sh new file mode 100644 index 000000000000..dfd2f9caf603 --- /dev/null +++ b/.github/release/import-certificate.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail +umask 077 +cert="$RUNNER_TEMP/cert.p12" +trap 'rm -f "$cert"' EXIT +keychain_password=$(openssl rand -base64 32) +printf '%s' "$APPLE_SIGNING_CERTIFICATE" | base64 --decode > "$cert" +unset APPLE_SIGNING_CERTIFICATE +security create-keychain -p "$keychain_password" build.keychain +security set-keychain-settings -lut 21600 build.keychain +security unlock-keychain -p "$keychain_password" build.keychain +security import "$cert" -k build.keychain -P "" -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productsign +security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$keychain_password" build.keychain > /dev/null +security list-keychains -d user -s build.keychain $(security list-keychains -d user | tr -d '"') diff --git a/.github/release/lib.sh b/.github/release/lib.sh index a85f5ad84404..a7d06fffe9c5 100644 --- a/.github/release/lib.sh +++ b/.github/release/lib.sh @@ -23,6 +23,14 @@ dry_run() { [ "${OPENCODE_DRY_RUN:-false}" = true ] } +stage_account() { + case "$1" in + dev) echo d8e944f537ceef3f06a5bd3aec1d7a53 ;; + production) echo 15d29c8639fd3733b1b5486a2acfd968 ;; + *) die "Unknown Cloudflare stage: $1" ;; + esac +} + sha256() { if command -v sha256sum > /dev/null; then sha256sum "$@"; else shasum -a 256 "$@"; fi } @@ -90,6 +98,8 @@ r2_credentials() { export AWS_ACCESS_KEY_ID="$id" AWS_SECRET_ACCESS_KEY=$(printf '%s' "$CLOUDFLARE_API_TOKEN" | sha256 | cut -c1-64) export AWS_SECRET_ACCESS_KEY + # These are R2's own credentials, so drop the role credentials the job assumed to read Secrets Manager. + unset AWS_SESSION_TOKEN AWS_PROFILE AWS_REGION export AWS_DEFAULT_REGION=auto AWS_REQUEST_CHECKSUM_CALCULATION=when_required AWS_RESPONSE_CHECKSUM_VALIDATION=when_required # Larger parts mean fewer CompleteMultipartUpload parts for the 200-350 MB desktop builds. AWS_CONFIG_FILE=$(mktemp) @@ -132,3 +142,11 @@ push_git() { commit -q -m "$message" git -C "$dir" push -q origin HEAD:master } + +# expect_json