From 4c98ab556d4996bf1d686507efc6134976346180 Mon Sep 17 00:00:00 2001 From: Luis <42945842+ldiaz94@users.noreply.github.com> Date: Mon, 19 Oct 2026 21:27:37 +0000 Subject: [PATCH] Add raz 0.21 CI image and Cloudflare registry setup Build a Debian12 CI environment with verified raz0.21.0, pinned concha and robbie, and source-build tests. Use a verified build-only0.18.0 compiler for Robbie; retain only0.21.0 in the final image. Guard every compressed layer below90MB. Prepare a separate Workers/R2 registry with anonymous pull tokens and authenticated publishing, plus opt-in publication and local Docker roundtrip checks in CI. Document credentials and deployment; no live Cloudflare resources are created. Validated make check (1013 passed), all tool suites, root and nonroot smoke tests,9 image layers,12 registry tests, Wrangler deployment dry-run, actionlint, and authenticated Docker push with anonymous pull/run. --- diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml new file mode 100644 index 0000000..e9dd302 --- /dev/null +++ b/.github/workflows/container.yml @@ -0,0 +1,100 @@ +name: CI image and registry +on: + push: + branches: [main] + paths: + - 'containers/ci/**' + - 'registry/**' + - '.github/workflows/container.yml' + pull_request: + paths: + - 'containers/ci/**' + - 'registry/**' + - '.github/workflows/container.yml' + workflow_dispatch: + inputs: + publish: + description: Push the validated image to the configured Cloudflare registry + type: boolean + default: false +permissions: + contents: read +concurrency: + group: raz-ci-image + cancel-in-progress: false +env: + IMAGE_TAG: 0.21.0-debian12-r1 +jobs: + registry: + runs-on: ubuntu-24.04 + defaults: + run: + working-directory: registry + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '24' + cache: npm + cache-dependency-path: registry/package-lock.json + - run: npm ci + - run: npm test + - run: npm run dry-run + image: + needs: registry + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '24' + cache: npm + cache-dependency-path: registry/package-lock.json + - name: Build the pinned tools and run their tests + run: docker build --platform linux/amd64 -t "raz:$IMAGE_TAG" containers/ci + - name: Check layer sizes against the registry upload limit + run: docker save "raz:$IMAGE_TAG" | python3 containers/ci/check-layers.py + - name: Smoke-test the final image + run: docker run --rm "raz:$IMAGE_TAG" sh /usr/local/share/raz-ci/smoke.sh + - name: Record the exact image contents + run: docker run --rm "raz:$IMAGE_TAG" cat /usr/local/share/raz-ci/versions.txt + - name: Test Docker publishing and anonymous pulling locally + working-directory: registry + run: | + npm ci + npm run test:docker -- "raz:$IMAGE_TAG" + - name: Check the release tag has not been published + if: github.event_name == 'workflow_dispatch' && inputs.publish + env: + REGISTRY: ${{ vars.RAZ_REGISTRY || 'raz-registry.lucelad.workers.dev' }} + run: | + status=$(curl --silent --show-error --head --output /dev/null --write-out '%{http_code}' \ + "https://$REGISTRY/v2/raz/manifests/$IMAGE_TAG") + if [ "$status" != 404 ]; then + echo "Expected an unpublished tag (404); got $status. Refusing to replace a release." + exit 1 + fi + - name: Log in for publishing + if: github.event_name == 'workflow_dispatch' && inputs.publish + uses: docker/login-action@v3 + with: + registry: ${{ vars.RAZ_REGISTRY || 'raz-registry.lucelad.workers.dev' }} + username: publisher + password: ${{ secrets.RAZ_REGISTRY_PASSWORD }} + - name: Publish the validated image + if: github.event_name == 'workflow_dispatch' && inputs.publish + env: + REGISTRY: ${{ vars.RAZ_REGISTRY || 'raz-registry.lucelad.workers.dev' }} + run: | + docker tag "raz:$IMAGE_TAG" "$REGISTRY/raz:$IMAGE_TAG" + docker push "$REGISTRY/raz:$IMAGE_TAG" + - name: Verify an anonymous pull + if: github.event_name == 'workflow_dispatch' && inputs.publish + env: + REGISTRY: ${{ vars.RAZ_REGISTRY || 'raz-registry.lucelad.workers.dev' }} + run: | + docker_config=$(mktemp -d) + docker --config "$docker_config" pull "$REGISTRY/raz:$IMAGE_TAG" + docker --config "$docker_config" run --rm "$REGISTRY/raz:$IMAGE_TAG" \ + sh /usr/local/share/raz-ci/smoke.sh + rm -r "$docker_config" diff --git a/README.md b/README.md index dd62685..f2022e4 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,19 @@ pins the raz it is built with: rmacs, with emacs's keys, and ravite, with vim's. Both colour raz through `tools/Scan.raz`. +## CI image + +`containers/ci/` builds an x86-64 Linux image with released raz 0.21.0, +its library and tools, pinned concha and robbie, and Debian build tools. +Its [README](containers/ci/README.md) gives the build and checks. +The image revision is `0.21.0-debian12-r1`. + +`registry/` prepares a separate Cloudflare Worker and R2 registry for +public Docker pulls and authenticated pushes. Its [README](registry/README.md) +gives deployment and publishing steps. The container workflow validates +the image and registry; publishing is an explicit manual option and +needs a deployed registry and its publisher secret. + ## Versions The compiler says its own version and that of the report it follows: diff --git a/containers/ci/Dockerfile b/containers/ci/Dockerfile new file mode 100644 index 0000000..7789900 --- /dev/null +++ b/containers/ci/Dockerfile @@ -0,0 +1,55 @@ +# syntax=docker/dockerfile:1 +# raz currently targets x86-64 Linux only; build with --platform linux/amd64. +FROM debian:12-slim@sha256:a4672c0cb26fbdde88e38fa2dfb6c681942306680e41e4378b28770b6e79ee91 AS base + +# Optional combined CA bundle for builds behind a TLS-inspecting proxy. It is +# mounted only for networked steps and never becomes part of the image. +RUN --mount=type=secret,id=proxy_ca \ + test "$(dpkg --print-architecture)" = amd64 && \ + if [ -f /run/secrets/proxy_ca ]; then \ + printf 'Acquire::https::CaInfo "/run/secrets/proxy_ca";\n' > /etc/apt/apt.conf.d/99-build-ca; \ + fi && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + bash ca-certificates curl git && \ + rm -rf /var/lib/apt/lists/* /etc/apt/apt.conf.d/99-build-ca + +# Keep each compressed layer below Cloudflare's free-plan upload limit. +RUN --mount=type=secret,id=proxy_ca \ + if [ -f /run/secrets/proxy_ca ]; then \ + printf 'Acquire::https::CaInfo "/run/secrets/proxy_ca";\n' > /etc/apt/apt.conf.d/99-build-ca; \ + fi && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + build-essential pkg-config && \ + rm -rf /var/lib/apt/lists/* /etc/apt/apt.conf.d/99-build-ca + +RUN --mount=type=secret,id=proxy_ca \ + if [ -f /run/secrets/proxy_ca ]; then \ + printf 'Acquire::https::CaInfo "/run/secrets/proxy_ca";\n' > /etc/apt/apt.conf.d/99-build-ca; \ + fi && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + bsdextrautils groff procps python3 tzdata && \ + rm -rf /var/lib/apt/lists/* /etc/apt/apt.conf.d/99-build-ca + +FROM base AS build +COPY build-tools.sh /tmp/build-tools.sh +RUN --mount=type=secret,id=proxy_ca \ + if [ -f /run/secrets/proxy_ca ]; then \ + export CURL_CA_BUNDLE=/run/secrets/proxy_ca GIT_SSL_CAINFO=/run/secrets/proxy_ca; \ + fi; \ + sh /tmp/build-tools.sh + +FROM base AS ci +LABEL org.opencontainers.image.title="raz CI" \ + org.opencontainers.image.description="raz 0.21.0 with concha, robbie and native build tools" \ + org.opencontainers.image.source="https://github.com/ldiaz94/raz" \ + org.opencontainers.image.version="0.21.0-debian12-r1" +COPY --from=build /opt/raz /opt/raz +COPY --from=build /usr/local/ /usr/local/ +COPY --chmod=0644 smoke.sh /usr/local/share/raz-ci/smoke.sh +RUN ln -s /opt/raz/raz /usr/local/bin/raz && \ + sh /usr/local/share/raz-ci/smoke.sh +WORKDIR /workspace +CMD ["bash"] diff --git a/containers/ci/README.md b/containers/ci/README.md new file mode 100644 index 0000000..c924720 --- /dev/null +++ b/containers/ci/README.md @@ -0,0 +1,79 @@ +# raz CI image + +`0.21.0-debian12-r1` is an x86-64 Linux build environment containing the +released raz 0.21.0, concha and robbie. Debian 12 slim provides Bash, the +normal `/bin/sh`, Make, Git, curl, CA certificates, Python 3, C/C++ build +tools, pkg-config, groff, bsdextrautils (including `col`), procps +(including external `kill`) and timezone +data. No entrypoint replaces the +command supplied by CI; the default command is Bash. + +Build from the repository root: + +```sh +docker build --platform linux/amd64 \ + -t raz:0.21.0-debian12-r1 containers/ci +docker run --rm raz:0.21.0-debian12-r1 \ + sh /usr/local/share/raz-ci/smoke.sh +docker save raz:0.21.0-debian12-r1 | python3 containers/ci/check-layers.py +``` + +Behind a TLS-inspecting proxy, supply a combined trusted CA bundle through +BuildKit, without adding it to the image: + +```sh +docker build --platform linux/amd64 \ + --secret id=proxy_ca,src=/path/to/combined-ca-bundle.pem \ + -t raz:0.21.0-debian12-r1 containers/ci +``` + +The build verifies the release archive against the SHA-256 published with +raz's distribution, fetches the exact source commits recorded in +`build-tools.sh`, and runs rzone's checks and concha's and robbie's test +suites before installing the programs. The final image also compiles and +runs static and glibc-linked raz programs, compiles its formatter and +executes both added tools. +`/usr/local/share/raz-ci/versions.txt` records application versions and +`packages.txt` records installed Debian packages. License files and tool +manual pages are included. rzone is compiled into concha and is not +installed as a global source library. + +Robbie's pinned source uses raz 0.18.0's library interfaces. Its latest +commit changes the declared compiler version without porting those calls, +so the build explicitly selects the verified 0.18.0 release and overrides +`RAZVERSION` for robbie's tests and installation. The bootstrap compiler +and its library stay in the build stage. Only raz 0.21.0 is installed in +the final image. `versions.txt` records both archive checksums and the +compiler used to build robbie. + +The compiler, its standard library, source tools and release documentation +live together under `/opt/raz`. `/usr/local/bin/raz` is a symlink to the +actual executable. `RAZ_PATH` is left unset: the 0.21.0 release predates +support for this variable. + +Use the image to build a checked-out project: + +```sh +docker run --rm -v "$PWD:/workspace" raz:0.21.0-debian12-r1 make check +docker run --rm -v "$PWD:/workspace" raz:0.21.0-debian12-r1 robbie check +``` + +The working directory is `/workspace`. Containers run as root by default, +so bind-mounted build outputs are owned by root on Linux. Pass +`--user "$(id -u):$(id -g)"` when the project supports an arbitrary user; +set `HOME` to a writable directory if its build tools need one. + +The base image is pinned by its amd64 manifest digest. Debian packages are +installed from the configured repositories at build time, so rebuilding +may receive package updates. Publish each image revision once and pin the +published image digest in downstream CI for an exact environment. Keep +`0.21.0-debian12-r1` immutable; use `r2` for a changed tool revision, base, +or package refresh. Registry deployment and publishing are documented in +the repository's `registry/` directory. + +The layer check streams the export and measures each layer's gzip size, +without extracting the image. Every layer must stay below 90,000,000 bytes, +leaving room beneath Cloudflare's 100 MB request-body limit. Package +installation is split across layers for this reason. Run the check before +publishing any changed image; a local registry does not enforce the edge +request limit. Downstream projects adding large layers must also respect it. diff --git a/containers/ci/build-tools.sh b/containers/ci/build-tools.sh new file mode 100644 index 0000000..c7f06c1 --- /dev/null +++ b/containers/ci/build-tools.sh @@ -0,0 +1,69 @@ +#!/bin/sh +set -eu + +raz_version=0.21.0 +raz_sha256=a8e2e550e927050d36a7e9731e6de22b094189adea15a984cd921917cbd8d90f +concha_revision=029289644abee68ddc3c06da526d394939846a41 +robbie_revision=3328bcf7060ef663b309e8a7a5e8a528a7962aee +robbie_build_raz=0.18.0 +robbie_build_raz_sha256=d05f2adbfddd52eabbf10db275fa69390102f46e40825ae94adaeade219799aa +rzone_revision=2644afb0827fe5ce1679a386336728183d61db11 + +mkdir -p /opt/raz /tmp/raz-ci /usr/local/share/raz-ci +cd /tmp/raz-ci +curl --fail --location --retry 3 \ + "https://raz.lucelad.workers.dev/download/raz-$raz_version-linux-x86_64.tar.gz" \ + -o raz.tar.gz +printf '%s raz.tar.gz\n' "$raz_sha256" | sha256sum -c - +tar -xzf raz.tar.gz --strip-components=1 -C /opt/raz +export PATH="/opt/raz:$PATH" +raz --version | grep '^raz 0\.21\.0, ' + +fetch() { + git init -q "$1" + git -C "$1" remote add origin "https://github.com/ldiaz94/$1.git" + attempt=1 + until git -C "$1" fetch -q --depth=1 origin "$2"; do + if [ "$attempt" -ge 3 ]; then return 1; fi + attempt=$((attempt + 1)) + sleep 2 + done + git -C "$1" checkout -q --detach FETCH_HEAD + test "$(git -C "$1" rev-parse HEAD)" = "$2" +} + +fetch rzone "$rzone_revision" +fetch concha "$concha_revision" +fetch robbie "$robbie_revision" +make -C rzone check +make -C concha test +# robbie's latest commit changes RAZVERSION alone. Its source still uses +# the 0.18 library's pointer API; use that compiler only in this build stage. +curl --fail --location --retry 3 \ + "https://raz.lucelad.workers.dev/download/raz-$robbie_build_raz-linux-x86_64.tar.gz" \ + -o robbie-raz.tar.gz +printf '%s robbie-raz.tar.gz\n' "$robbie_build_raz_sha256" | sha256sum -c - +mkdir robbie-raz +tar -xzf robbie-raz.tar.gz --strip-components=1 -C robbie-raz +robbie_raz="$PWD/robbie-raz/raz" +"$robbie_raz" --version | grep '^raz 0\.18\.0, ' +make -C robbie test RAZ="$robbie_raz" RAZVERSION="$robbie_build_raz" +make -C concha install PREFIX=/usr/local +make -C robbie install PREFIX=/usr/local RAZ="$robbie_raz" RAZVERSION="$robbie_build_raz" + +cat > /usr/local/share/raz-ci/versions.txt < /usr/local/share/raz-ci/packages.txt +for project in concha robbie rzone; do + if [ -f "$project/LICENSE" ]; then + install -Dm644 "$project/LICENSE" "/usr/local/share/licenses/$project/LICENSE" + fi +done diff --git a/containers/ci/check-layers.py b/containers/ci/check-layers.py new file mode 100644 index 0000000..e19964b --- /dev/null +++ b/containers/ci/check-layers.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +"""Check a docker-save stream against the registry's per-request size budget. + +Docker's classic save format names layers */layer.tar. Newer exports may +put raw tar or already compressed layers under blobs/sha256/. Inspect both +without unpacking the image or retaining layers in memory. +""" + +import argparse +import sys +import tarfile +import zlib + + +def check(stream, limit): + layers = 0 + oversized = False + with tarfile.open(fileobj=stream, mode="r|") as archive: + for member in archive: + if not member.isfile(): + continue + if not (member.name.endswith(".tar") or "/blobs/" in "/" + member.name): + continue + source = archive.extractfile(member) + first = source.read(512) + if first.startswith(b"\x1f\x8b"): + size = member.size + elif member.name.endswith(".tar") or first[257:263] in (b"ustar\0", b"ustar "): + compressor = zlib.compressobj(level=6, wbits=31) + size = len(compressor.compress(first)) + while chunk := source.read(1024 * 1024): + size += len(compressor.compress(chunk)) + size += len(compressor.flush()) + elif first.startswith(b"\x28\xb5\x2f\xfd"): + raise ValueError("zstd layers are unsupported; export gzip layers for this registry") + else: + # Manifests, image configuration and other non-layer blobs. + continue + layers += 1 + status = "FAIL" if size >= limit else "OK" + print(f"{status}: {member.name}: {size:,} compressed bytes", flush=True) + oversized |= size >= limit + if layers == 0: + raise ValueError("no image layers found in docker save stream") + print(f"Checked {layers} layers; each must be smaller than {limit:,} bytes.") + return not oversized + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--max-bytes", type=int, default=90_000_000) + options = parser.parse_args() + if options.max_bytes <= 0: + parser.error("--max-bytes must be positive") + try: + return 0 if check(sys.stdin.buffer, options.max_bytes) else 1 + except (tarfile.TarError, ValueError, OSError) as error: + print(f"Layer check failed: {error}", file=sys.stderr) + return 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/containers/ci/smoke.sh b/containers/ci/smoke.sh new file mode 100644 index 0000000..02df62b --- /dev/null +++ b/containers/ci/smoke.sh @@ -0,0 +1,42 @@ +#!/bin/sh +set -eu +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT HUP INT TERM +cd "$work" +raz --version | grep '^raz 0\.21\.0, ' +cat > Hello.raz <<'EOF' +module Hello; +import Out; +proc main*; +begin + Out.str("hello, world\n"); +end; +end Hello. +EOF +raz -Werror Hello.raz +test "$(./Hello)" = 'hello, world' +cat > Libc.raz <<'EOF' +module Libc; +import C; +proc main*; +const message = "libc-ok\n"; +begin + if C.write(1, PTR(message), LEN(message)) # LEN(message) then + C.exit(1); + end; +end; +end Libc. +EOF +raz -Werror Libc.raz +test "$(./Libc)" = libc-ok +raz -Werror -o Pretty /opt/raz/tools/Pretty.raz +./Pretty Hello.raz > formatted.raz +test -s formatted.raz +test "$(concha -c 'echo concha-ok')" = concha-ok +cat > Robfile <<'EOF' +check: + printf 'robbie-ok\n' +EOF +robbie -q check > robbie.log +grep -qx robbie-ok robbie.log +printf 'raz CI smoke tests passed\n' diff --git a/registry/.gitignore b/registry/.gitignore new file mode 100644 index 0000000..e91db30 --- /dev/null +++ b/registry/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +dist/ +.wrangler/ +.dev.vars +.env diff --git a/registry/README.md b/registry/README.md new file mode 100644 index 0000000..acf8e38 --- /dev/null +++ b/registry/README.md @@ -0,0 +1,141 @@ +# raz's container registry + +This Worker serves the `raz` image from a private R2 bucket using the +Docker Registry v2 protocol. It is a separate deployment from raz's +website and ladle source browser. The proposed public address is +`raz-registry.lucelad.workers.dev`; another account uses its own +workers.dev subdomain. + +After deployment and publication, the image can be pulled with: + +```sh +docker pull raz-registry.lucelad.workers.dev/raz:0.21.0-debian12-r1 +``` + +Preparing these files does not create a Cloudflare deployment. + +## Implementation and checks + +`package.json` pins Cloudflare's Apache-2.0 +[serverless-registry](https://github.com/cloudflare/serverless-registry) +to commit `a73605d6d5587286eb9cfcb910148f7d1423f218`. +`package-lock.json` fixes dependencies and archive integrity. +`worker.ts` adds anonymous pulls for `raz` alone. The upstream handles +authentication, storage, digest checks and multipart uploads. + +Docker discovers a Bearer token endpoint at `/v2/`. Anonymous clients +receive pull-only tokens automatically; a publisher supplies Basic +credentials to receive a push token. Tokens last five minutes, are bound +to this registry's hostname and repository, and use HMAC-SHA256 with the +publisher secret as the signing key. Rotating that secret revokes tokens. +The adapter passes authorized operations to the upstream using its +appropriate read-only or publisher identity. + +Anonymous reads use an upstream identity with pull capability alone; +knowing that public identity cannot authorize writes. Supplied +credentials are checked, including on the endpoint used by `docker +login`. Upload status also needs authentication. No other repositories, +catalog or fallback registry are exposed. The R2 bucket stays private. + +Use Node 24 or later: + +```sh +cd registry +npm ci +npm test +npm run dry-run +``` + +Tests use isolated local R2 storage, not a Cloudflare account. They +exercise anonymous reads, authentication and write restrictions, +repository scope, upload cancellation, and OCI manifest/blob upload +and pull by tag and digest, plus token scope, expiry, signature and +audience validation. The dry run bundles without publishing. To test +the actual Docker handshake with a built image: + +```sh +npm run test:docker -- raz:0.21.0-debian12-r1 +``` + +That test starts a disposable local Worker/R2 instance, pushes using +a generated test password, pulls with an empty Docker credential +directory, and runs the image smoke test. It needs a Docker engine on +the same host. Existing source-image tags are kept. + +For local Docker testing, put a disposable `REGISTRY_PASSWORD` in the +ignored `.dev.vars` file and run `npm run dev`. Push to +`localhost:8787/raz:local-test`, using username `publisher`. Docker +permits HTTP for localhost; the deployed registry uses HTTPS. Do not +reuse a local password for production. + +## First deployment + +Enable R2 on the target Cloudflare account. Attach these values securely +to the environment running Wrangler: + +- `CLOUDFLARE_ACCOUNT_ID`: the target account ID. +- `CLOUDFLARE_API_TOKEN`: an account-scoped secret with Workers Scripts + Edit and Workers R2 Storage Edit. Do not commit or paste this token. + +From `registry/`, after `npm ci` and local checks: + +```sh +npx wrangler r2 bucket create raz-image-registry +npm run deploy +npx wrangler secret put REGISTRY_PASSWORD +``` + +Use a newly generated strong password for the last command; Wrangler +reads it interactively. This publisher password is separate from the +Cloudflare API token. Image publishers do not need the Cloudflare token. +Until the password is set, reads work but uploads cannot be authorized. +`REGISTRY_USERNAME` is `publisher`, set in `wrangler.jsonc`. + +The deploy output gives the actual hostname. Its version endpoint should +return a 401 Bearer challenge pointing at `/token`; Docker follows that +challenge automatically, without requiring login for pulls: + +```sh +curl -i https://raz-registry.lucelad.workers.dev/v2/ +``` + +## Publishing images + +The container workflow validates on relevant pushes. Its manual publish +option needs the deployed registry and GitHub Actions secret +`RAZ_REGISTRY_PASSWORD`. Set repository variable `RAZ_REGISTRY` to the +deployed hostname if it differs from the proposed address. + +For a manual push, build and test `../containers/ci/` as its README +says, then: + +```sh +registry=raz-registry.lucelad.workers.dev +docker login "$registry" --username publisher +docker tag raz:0.21.0-debian12-r1 "$registry/raz:0.21.0-debian12-r1" +docker push "$registry/raz:0.21.0-debian12-r1" +``` + +Keep published release tags fixed. A changed tool, base or package set +gets a new revision such as `r2`. This is a publishing convention: the +upstream permits authenticated tag replacement. The workflow serializes +its runs and refuses an existing tag; that does not prevent unrelated +manual publishers from replacing it. Pin the manifest digest in +downstream CI for an exact image. + +Verify anonymous pulling with an empty Docker credential directory: + +```sh +docker_config=$(mktemp -d) +docker --config "$docker_config" pull "$registry/raz:0.21.0-debian12-r1" +docker --config "$docker_config" run --rm "$registry/raz:0.21.0-debian12-r1" \ + sh /usr/local/share/raz-ci/smoke.sh +rm -r "$docker_config" +``` + +The Worker and R2 have their own request, storage and usage limits. +An individual Docker layer upload must fit the account's request body +limit: advertising chunk sizes does not make every Docker client split +a large layer. Keep compressed layers below 90 MB for headroom under a +100 MB request limit. Local tests cannot establish billing, hostname +availability or edge limits; repeat the push/pull test after deployment. diff --git a/registry/build.mjs b/registry/build.mjs new file mode 100644 index 0000000..e8264a3 --- /dev/null +++ b/registry/build.mjs @@ -0,0 +1,10 @@ +import { build } from "esbuild"; + +await build({ + entryPoints: ["worker.ts"], + outfile: "dist/worker.mjs", + bundle: true, + format: "esm", + platform: "browser", + target: "es2022", +}); diff --git a/registry/docker-smoke.mjs b/registry/docker-smoke.mjs new file mode 100644 index 0000000..1e35628 --- /dev/null +++ b/registry/docker-smoke.mjs @@ -0,0 +1,56 @@ +// Exercise the real Docker authentication flow against a disposable local +// Worker/R2 instance. No Cloudflare account or production password is used. +import { spawn } from "node:child_process"; +import { randomBytes } from "node:crypto"; +import { mkdtemp, rm } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { fileURLToPath } from "node:url"; +import { Miniflare, Log, LogLevel } from "miniflare"; + +const image = process.argv[2]; +if (!image) throw new Error("Usage: node registry/docker-smoke.mjs SOURCE_IMAGE"); +const work = await mkdtemp(join(tmpdir(), "raz-docker-registry-")); +const password = randomBytes(32).toString("hex"); +const mf = new Miniflare({ + modules: true, + scriptPath: fileURLToPath(new URL("dist/worker.mjs", import.meta.url)), + compatibilityDate: "2026-07-30", + host: "127.0.0.1", + port: 0, + r2Buckets: ["REGISTRY"], + bindings: { REGISTRY_USERNAME: "publisher", REGISTRY_PASSWORD: password }, + log: new Log(LogLevel.ERROR), +}); + +function docker(args, input) { + return new Promise((resolve, reject) => { + const child = spawn("docker", args, { + stdio: [input ? "pipe" : "ignore", "inherit", "inherit"], + timeout: 300_000, + }); + if (input) child.stdin.end(input); + child.on("error", reject); + child.on("exit", (code) => code === 0 ? resolve() : reject(new Error(`docker ${args[0]} exited ${code}`))); + }); +} + +let target; +try { + const address = await mf.ready; + const registry = `localhost:${address.port}`; + target = `${registry}/raz:local-smoke-${Date.now()}`; + await docker(["--config", work, "login", registry, "--username", "publisher", "--password-stdin"], password); + await docker(["tag", image, target]); + await docker(["--config", work, "push", target]); + // Remove just this test's alias. The source image and its tags stay intact. + await docker(["image", "rm", target]); + const anonymous = await mkdtemp(join(work, "anonymous-")); + await docker(["--config", anonymous, "pull", target]); + await docker(["--config", anonymous, "run", "--rm", target, "sh", "/usr/local/share/raz-ci/smoke.sh"]); + console.log("Authenticated Docker push and anonymous pull/run passed."); +} finally { + if (target) await docker(["image", "rm", target]).catch(() => {}); + await mf.dispose(); + await rm(work, { recursive: true, force: true }); +} diff --git a/registry/package-lock.json b/registry/package-lock.json new file mode 100644 index 0000000..5d97857 --- /dev/null +++ b/registry/package-lock.json @@ -0,0 +1,2292 @@ +{ + "name": "raz-image-registry", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "raz-image-registry", + "dependencies": { + "r2-registry": "https://github.com/cloudflare/serverless-registry/archive/a73605d6d5587286eb9cfcb910148f7d1423f218.tar.gz" + }, + "devDependencies": { + "esbuild": "0.28.2", + "miniflare": "4.20260730.0", + "wrangler": "4.151.2" + }, + "engines": { + "node": ">=24" + } + }, + "node_modules/@cloudflare/kv-asset-handler": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.5.0.tgz", + "integrity": "sha512-jxQYkj8dSIzc0cD6cMMNdOc1UVjqSqu8BZdor5s8cGjW2I8BjODt/kWPVdY+u9zj3ms75Q5qaZgnxUad83+eAg==", + "dev": true, + "license": "MIT OR Apache-2.0", + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@cloudflare/unenv-preset": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.16.2.tgz", + "integrity": "sha512-JBP1+Z7ZSNG/d4mRP+y8VC5dka3tZVMLEZRvS+rzQ4DGV1EoxRFQckcJTTkXbHSQiTj0DtNI01Zwb/V2fX0mvQ==", + "dev": true, + "license": "MIT OR Apache-2.0", + "peerDependencies": { + "unenv": "2.0.0-rc.24", + "workerd": ">1.20260305.0 <2.0.0-0" + }, + "peerDependenciesMeta": { + "workerd": { + "optional": true + } + } + }, + "node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20260730.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260730.1.tgz", + "integrity": "sha512-+MBHmPaiTe2KajryW0T24rZvWFxb41hD3d8anNzQqHzft6vSEb18+sp0znSwxgij7ApPhSM1+vhkNg4f3YMguA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20260730.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260730.1.tgz", + "integrity": "sha512-SBHKntPkKvNPgaCrTe99xC1CAl8ygJDzlYfK0LbuJ1muKadIw35WnhO0wu894fKBtllsVQdNzDLee+cm0ppLSQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20260730.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260730.1.tgz", + "integrity": "sha512-ouyPOSMbiKPeSwUJUvxtMcxGAXs2J4aPE4T5ABIYX5ClcQx5j5bbHTmnqOQEY8sAuLTPjH7dY+iB6UI5ISlwwA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20260730.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260730.1.tgz", + "integrity": "sha512-YQ+Mi78U3TPdgBPtwq+Sm6rJU+Ihl2y0pjYtuuKkdmUbYzL7oLR6Xqq9wljhasnuCFICssDJaqhMep5WizYoEQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20260730.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260730.1.tgz", + "integrity": "sha512-27fAN+vUECW1oYVc1KOcHYpkL8COM2Uxtxql7TL595kxbjoqS5yckw7NLz7bTf2pALFCZWjqXDjZGJ/xbG4ZKQ==", + "cpu": [ + "x64" + ], + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "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==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.2.tgz", + "integrity": "sha512-eEieHsMksAW4IiO5NzauESRl2D2qz3J/kwUxUrSfV06A93eEaRfMpHXyUb1mAqrR7i8U9A0GRqE9pjn6u1Jjpg==", + "cpu": [ + "arm64" + ], + "dev": true, + "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.1" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.2.tgz", + "integrity": "sha512-BaktuGPCeHJMARpodR8jK4uKiZrPAy9WrfQW0sdI37clracq8Bp01AYS3SZgi5FS/y5twa9t4+LIuuxQjqRrWw==", + "cpu": [ + "x64" + ], + "dev": true, + "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.1" + } + }, + "node_modules/@img/sharp-freebsd-wasm32": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.2.tgz", + "integrity": "sha512-YoAxdnd8hPUkvLHd3bWY+YA8nw3xM/RyRopYucNsWHVSan8NLVM3X2volsfoRDcXdUJPg6tXahSd7HXPK7lRnw==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "dependencies": { + "@img/sharp-wasm32": "0.35.2" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.1.tgz", + "integrity": "sha512-4V/M3roRMTYjiwZY9IOVQOE8OyeCxFAkYmyZDrZl51uOKjibm3oeEJ4WAmLxutAfzFbC9jqUiPs2gbnGflH+7g==", + "cpu": [ + "arm64" + ], + "dev": true, + "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.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.1.tgz", + "integrity": "sha512-c0/DxItpJv2+dGhgycJBBgotdqruGYDvA79drdh0MD1dFpy7JzJ/PlXwi1H4rFf0eTy8tgbI91aHDnZIceY3jQ==", + "cpu": [ + "x64" + ], + "dev": true, + "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.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.1.tgz", + "integrity": "sha512-aGGy9aWzXgHBG7HNyQPWorZthlp7+x6fDRoPAQbGO3ThcttuTyKIx3NuSHb6zb4gBNq6/yNn9f1cy9nFKS/Vmg==", + "cpu": [ + "arm" + ], + "dev": true, + "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.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.1.tgz", + "integrity": "sha512-JznefmcK9j1JKPz8AkQDh89kjojubyfOasWBPKfzMIhPwsgDy9evpE/naJTXXXmghS1iFwR8u/kTwh/I2/+GCw==", + "cpu": [ + "arm64" + ], + "dev": true, + "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.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.1.tgz", + "integrity": "sha512-1EkwGNCZk6iWNCMWqrvdJ+r1j0PT1zIz60CNPhYnJlK/zyeWqlsPZIe+ocBVqPF8k/Ssee/NCk+tE9Ryrko6ng==", + "cpu": [ + "ppc64" + ], + "dev": true, + "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.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.1.tgz", + "integrity": "sha512-Ilays+w2bXdnxzxtQdmXR62u8o8GYa3eL4+Gr+1KiE4xperMZUslRaVPJwwPkzlHEjGfXAfRVAa/7CYCtSqsBw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "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.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.1.tgz", + "integrity": "sha512-VfBwVHQTbRoj4XlpA/KLZ7ltgMpz+4WSejFzQ+GnoImjo1PtEJ59QB2qR1xQEeRPYIkNrPIm2L4cICMvz4C2ew==", + "cpu": [ + "s390x" + ], + "dev": true, + "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.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.1.tgz", + "integrity": "sha512-+c8ukgwU62DS54nCAjw7keOfHUkmr0B5QHEdcOqRnodF/MNXJbVI8Eopoj4B/0H8Asr65I+A4Amrn7a85/md6A==", + "cpu": [ + "x64" + ], + "dev": true, + "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.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.1.tgz", + "integrity": "sha512-qlKb/pwbkAi1WMsJrYHk7CuDrd12s27U2QnRhFYUoJNrRCmkosMTttuRFat/DDB3IlDm5qE1TJgZ4JDnHX8Ldw==", + "cpu": [ + "arm64" + ], + "dev": true, + "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.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.1.tgz", + "integrity": "sha512-yO21HwoUVLN8Qa+/SBjQLMYwBWAVJjeGPNe+hc0OUeMeifEtJqu5a1c4HayE1nNpDih9y3/KkoltfkDodmKAlg==", + "cpu": [ + "x64" + ], + "dev": true, + "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.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.2.tgz", + "integrity": "sha512-SE4kzF2mepn6z+6E7L6lsV8FzuLL6IPQdyX8ZiwROAG/G8td+hP/m7FsFPwidtrF19gvajuC9l6TxAVcsA4S7A==", + "cpu": [ + "arm" + ], + "dev": true, + "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.1" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.2.tgz", + "integrity": "sha512-af12Pnd0ZGu2HfP8NayB0kk6eC/lrfbQE6HlR4jD+34wdJ1Vw9TF6TMn6ZvffT+WgqVsl0hRbmNvz2u/23VmwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "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.1" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.2.tgz", + "integrity": "sha512-hYSBm7zcNtDCozCxQHYZJiu63b/bXsgRZuOxCIBZsStMM9Vap47iFHdbX4kCvQsblPB/k+clhELpdQJHQLSHvg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "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.1" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.2.tgz", + "integrity": "sha512-qQt0Kc13+Hoan/Awq/qMSQw3L+RI1NCRPgD5cUJ/1WSSmIoysLOc72jlRM3E0OHN9Yr313jgeQ2T+zW+F03QFA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "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.1" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.2.tgz", + "integrity": "sha512-E4fLLfRPzDLlEeDaTzI98OFLcv++WL5ChLLMwPoVd0CIoZQqupBSNbOisPL5am9XsbQ9T84+iiMpUvbFtkunbA==", + "cpu": [ + "s390x" + ], + "dev": true, + "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.1" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.2.tgz", + "integrity": "sha512-gi0zFJJRLswfCZmHtJdikXPOc5u7qamSOS3NHedLqLd4W8Q0NqjdBr6TTRIgsfFjqfTsHFgdfvJ9LwqSgcHiAA==", + "cpu": [ + "x64" + ], + "dev": true, + "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.1" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.2.tgz", + "integrity": "sha512-siWbOW1u6HFnFLrp0waKyW7VEf7jYvcDWdrXEFa8AkdAQgEvuu5Fz8/Y70w9EeqAdwDtfU012BhEHHaDqvQNzg==", + "cpu": [ + "arm64" + ], + "dev": true, + "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.1" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.2.tgz", + "integrity": "sha512-YBqMMcjDi4QGYiSn4vNOYBhmlC4z5AXqkOUUqI2e0AFA4urNv4ESgOgwNl3K+4etQhha0twXlzeF20bbULm9Yg==", + "cpu": [ + "x64" + ], + "dev": true, + "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.1" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.2.tgz", + "integrity": "sha512-Mrv4JQNYVQ94xH+jzZ9r+gowleN8mv2FTgKT+PI6bx5C0G8TdNYndu161pg2i7uoBwxy2ImPMHrJOM2LZef7Bw==", + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.11.1" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-webcontainers-wasm32": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.2.tgz", + "integrity": "sha512-QNV27pxs9wpApEiCfvHM1RDoP1w1+2KrUWWDPEhEwg+latvOrfuhWrHWZKwdSFwU6jh3myjw/yOCRsUIuOft3g==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@img/sharp-wasm32": "0.35.2" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.2.tgz", + "integrity": "sha512-BiVRYc/t6/Vl3e1hBx0hugG4oN9Pydf4fgMSpxTQJmwGUg/YoXTWHiFeRymHfCZzifxu4F4rpk/I67D0LQ20wQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "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.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.2.tgz", + "integrity": "sha512-YYEhx9PImCC7T0tI8JDMi4DB9LwLCXCU5OWNYEXAxh5Q1ShKkyC6byxzoBJ3gEFDnH2lQckWuDe70G7mB2XJog==", + "cpu": [ + "ia32" + ], + "dev": true, + "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.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.2.tgz", + "integrity": "sha512-imoOyBcoM/iiUr4J6VPpCNjPnjvP/Gks95898yB8YqoGGYmHYbOyCuNv9FMhFgtaiHFGbHW8bxKqRV6VjtXThQ==", + "cpu": [ + "x64" + ], + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/@tsndr/cloudflare-worker-jwt": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@tsndr/cloudflare-worker-jwt/-/cloudflare-worker-jwt-3.2.3.tgz", + "integrity": "sha512-qAwqvhtO0d6Ixsxpi3a01HKCLQlwwjBxDoqF/6fvMEWgW/fdjE3AE8GqO8lQilryBilNX9wNR8p6vMbVWyzJ4Q==", + "license": "MIT" + }, + "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==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/itty-router": { + "version": "5.0.24", + "resolved": "https://registry.npmjs.org/itty-router/-/itty-router-5.0.24.tgz", + "integrity": "sha512-PXij1qGKtE6jg3dLgrTRdh/Frovl5Wc4Av67sD2xfhDPrgNt4u79++/il8/c/OfZGkhD/8uYJub8tjo+H165rA==", + "license": "MIT" + }, + "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==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/miniflare": { + "version": "4.20260730.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-4.20260730.0.tgz", + "integrity": "sha512-1Z9SB9r/o//80UA02Re3QhtcecSHAyAjf5EcKBfQVlQrCg7Miy79hl2PvtkwFLIaJ5rcrOPdDcRr577okwZPsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "0.8.1", + "sharp": "0.35.2", + "undici": "7.28.0", + "workerd": "1.20260730.1", + "ws": "8.21.0", + "youch": "4.1.0-beta.10" + }, + "bin": { + "miniflare": "bootstrap.js" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/path-to-regexp": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/r2-registry": { + "version": "1.1.0", + "resolved": "https://github.com/cloudflare/serverless-registry/archive/a73605d6d5587286eb9cfcb910148f7d1423f218.tar.gz", + "integrity": "sha512-JG44LBs8dhDkm2jBltewUe0XnCRouIq4aZNwJr4mNGLIl9ZuZOQ/FFBwLLLmwJ6Iax7Ykot3qBvDkOoaxHQxyg==", + "license": "Apache-2.0", + "dependencies": { + "@tsndr/cloudflare-worker-jwt": "^3.2.3", + "itty-router": "^5.0.24", + "rfc4648": "^1.5.4", + "zod": "^4.4.3" + }, + "engines": { + "node": ">=24.0.0", + "pnpm": ">=11.0.0" + } + }, + "node_modules/rfc4648": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/rfc4648/-/rfc4648-1.5.4.tgz", + "integrity": "sha512-rRg/6Lb+IGfJqO05HZkN50UtY7K/JhxJag1kP23+zyMfrvoB0B7RWv06MbOzoc79RgCdNTiUaNsTT1AJZ7Z+cg==", + "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==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sharp": { + "version": "0.35.2", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.2.tgz", + "integrity": "sha512-FVtFjtBCMiJS6yb5CX7Sop45WFMpeGw6oRKuJnXYgf/f1ms/D7LE/ZUSNxnW7rZ/dbslQWYkoqFHGPaDBtaK4w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.1.0", + "detect-libc": "^2.1.2", + "semver": "^7.8.4" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.35.2", + "@img/sharp-darwin-x64": "0.35.2", + "@img/sharp-freebsd-wasm32": "0.35.2", + "@img/sharp-libvips-darwin-arm64": "1.3.1", + "@img/sharp-libvips-darwin-x64": "1.3.1", + "@img/sharp-libvips-linux-arm": "1.3.1", + "@img/sharp-libvips-linux-arm64": "1.3.1", + "@img/sharp-libvips-linux-ppc64": "1.3.1", + "@img/sharp-libvips-linux-riscv64": "1.3.1", + "@img/sharp-libvips-linux-s390x": "1.3.1", + "@img/sharp-libvips-linux-x64": "1.3.1", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.1", + "@img/sharp-libvips-linuxmusl-x64": "1.3.1", + "@img/sharp-linux-arm": "0.35.2", + "@img/sharp-linux-arm64": "0.35.2", + "@img/sharp-linux-ppc64": "0.35.2", + "@img/sharp-linux-riscv64": "0.35.2", + "@img/sharp-linux-s390x": "0.35.2", + "@img/sharp-linux-x64": "0.35.2", + "@img/sharp-linuxmusl-arm64": "0.35.2", + "@img/sharp-linuxmusl-x64": "0.35.2", + "@img/sharp-webcontainers-wasm32": "0.35.2", + "@img/sharp-win32-arm64": "0.35.2", + "@img/sharp-win32-ia32": "0.35.2", + "@img/sharp-win32-x64": "0.35.2" + } + }, + "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==", + "dev": true, + "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==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/undici": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.28.0.tgz", + "integrity": "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/unenv": { + "version": "2.0.0-rc.24", + "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz", + "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "pathe": "^2.0.3" + } + }, + "node_modules/workerd": { + "version": "1.20260730.1", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20260730.1.tgz", + "integrity": "sha512-zmfNIjwYSWFY5chGBOjWtH3xAE7p97FTC6vR4Ep98290ho6AeAR/NVcBD274YCLEUYzqm8yxdtZlxMybU8a3jA==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20260730.1", + "@cloudflare/workerd-darwin-arm64": "1.20260730.1", + "@cloudflare/workerd-linux-64": "1.20260730.1", + "@cloudflare/workerd-linux-arm64": "1.20260730.1", + "@cloudflare/workerd-windows-64": "1.20260730.1" + } + }, + "node_modules/wrangler": { + "version": "4.151.2", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.151.2.tgz", + "integrity": "sha512-yIT5Q08eVP2ZSE4XHGZ81Y+Y1b25uzp7LANwV2siaEt/O7TpeiFiEih/xHwARHGQo8sufs2ZaILGxCccHgjQPg==", + "dev": true, + "license": "MIT OR Apache-2.0", + "dependencies": { + "@cloudflare/kv-asset-handler": "0.5.0", + "@cloudflare/unenv-preset": "2.16.2", + "blake3-wasm": "2.1.5", + "esbuild": "0.28.2", + "miniflare": "5.20261019.0-beta", + "path-to-regexp": "6.3.0", + "unenv": "2.0.0-rc.24", + "workerd": "1.20261019.1" + }, + "bin": { + "cf-wrangler": "bin/cf-wrangler.js", + "wrangler": "bin/wrangler.js", + "wrangler2": "bin/wrangler.js" + }, + "engines": { + "node": ">=22.0.0" + }, + "optionalDependencies": { + "fsevents": "2.3.3" + }, + "peerDependencies": { + "@cloudflare/workers-types": "^5.20261019.1" + }, + "peerDependenciesMeta": { + "@cloudflare/workers-types": { + "optional": true + } + } + }, + "node_modules/wrangler/node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20261019.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20261019.1.tgz", + "integrity": "sha512-5ZILbAta/fBQvhmAYeCE7dKMMYIr7N9wJEX50fEGLKSIwGtvT0HzSfHNIK/O7cBQ4gHQ2WfIiPClvwcye6E0fA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/wrangler/node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20261019.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20261019.1.tgz", + "integrity": "sha512-cww2Ab6lVMxpTiEEjKmPI58p5EMo0vYTZSH+3WkqXJdQgc3ES66GuL247+U2B2YWajhhu2tqj7jySrXneU749g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/wrangler/node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20261019.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20261019.1.tgz", + "integrity": "sha512-4++VRi9vkQROYqrpZYOixIJuVDmujkwrT4kszsxNFlvcmsX6Mr2GumvxIN3gIixS3vJUh3Umdtkthqj5X0S3Xw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/wrangler/node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20261019.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20261019.1.tgz", + "integrity": "sha512-75PVtJOwfjScQ53sbLtQXI7D8yP1c21t+WEUPaYbqkzaz4ZqfR5wAd+zuWs8G5Q7kOj2SQIvEfY5Sn8Y+UVrnA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/wrangler/node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20261019.1", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20261019.1.tgz", + "integrity": "sha512-z49fvKTETMCnG6wnMcQwxx9CpryFceiKz04FRjq26EkhCyzRNJ6c3UXhyZz3r5f1CXnnBZc5DcU8ZouPkUJCqw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-darwin-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz", + "integrity": "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==", + "cpu": [ + "arm64" + ], + "dev": true, + "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.4" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-darwin-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz", + "integrity": "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==", + "cpu": [ + "x64" + ], + "dev": true, + "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.4" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-freebsd-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz", + "integrity": "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "dependencies": { + "@img/sharp-wasm32": "0.35.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz", + "integrity": "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz", + "integrity": "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz", + "integrity": "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz", + "integrity": "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz", + "integrity": "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz", + "integrity": "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz", + "integrity": "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz", + "integrity": "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz", + "integrity": "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz", + "integrity": "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-linux-arm": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz", + "integrity": "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==", + "cpu": [ + "arm" + ], + "dev": true, + "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.4" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-linux-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz", + "integrity": "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "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.4" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-linux-ppc64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz", + "integrity": "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "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.4" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-linux-riscv64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz", + "integrity": "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "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.4" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-linux-s390x": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz", + "integrity": "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==", + "cpu": [ + "s390x" + ], + "dev": true, + "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.4" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-linux-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz", + "integrity": "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==", + "cpu": [ + "x64" + ], + "dev": true, + "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.4" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz", + "integrity": "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==", + "cpu": [ + "arm64" + ], + "dev": true, + "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.4" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz", + "integrity": "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==", + "cpu": [ + "x64" + ], + "dev": true, + "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.4" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz", + "integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==", + "dev": true, + "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/wrangler/node_modules/@img/sharp-webcontainers-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz", + "integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@img/sharp-wasm32": "0.35.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/wrangler/node_modules/@img/sharp-win32-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz", + "integrity": "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "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/wrangler/node_modules/@img/sharp-win32-ia32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz", + "integrity": "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==", + "cpu": [ + "ia32" + ], + "dev": true, + "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/wrangler/node_modules/@img/sharp-win32-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz", + "integrity": "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==", + "cpu": [ + "x64" + ], + "dev": true, + "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/wrangler/node_modules/miniflare": { + "version": "5.20261019.0-beta", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20261019.0-beta.tgz", + "integrity": "sha512-NmE6Yz7MSdjrfr3lMaMAVO55rIm3+6YXllOkJOMy6pPQITDuDeo0PYRedp7pju2olNWmrAlf1i1LIWYfGQvvuw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "0.8.1", + "sharp": "0.35.5", + "undici": "7.29.1", + "workerd": "1.20261019.1", + "ws": "8.21.0", + "youch": "4.1.0-beta.10" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/wrangler/node_modules/sharp": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.5.tgz", + "integrity": "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==", + "dev": true, + "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.5", + "@img/sharp-darwin-x64": "0.35.5", + "@img/sharp-freebsd-wasm32": "0.35.5", + "@img/sharp-libvips-darwin-arm64": "1.3.4", + "@img/sharp-libvips-darwin-x64": "1.3.4", + "@img/sharp-libvips-linux-arm": "1.3.4", + "@img/sharp-libvips-linux-arm64": "1.3.4", + "@img/sharp-libvips-linux-ppc64": "1.3.4", + "@img/sharp-libvips-linux-riscv64": "1.3.4", + "@img/sharp-libvips-linux-s390x": "1.3.4", + "@img/sharp-libvips-linux-x64": "1.3.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", + "@img/sharp-libvips-linuxmusl-x64": "1.3.4", + "@img/sharp-linux-arm": "0.35.5", + "@img/sharp-linux-arm64": "0.35.5", + "@img/sharp-linux-ppc64": "0.35.5", + "@img/sharp-linux-riscv64": "0.35.5", + "@img/sharp-linux-s390x": "0.35.5", + "@img/sharp-linux-x64": "0.35.5", + "@img/sharp-linuxmusl-arm64": "0.35.5", + "@img/sharp-linuxmusl-x64": "0.35.5", + "@img/sharp-webcontainers-wasm32": "0.35.5", + "@img/sharp-win32-arm64": "0.35.5", + "@img/sharp-win32-ia32": "0.35.5", + "@img/sharp-win32-x64": "0.35.5" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/wrangler/node_modules/undici": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.29.1.tgz", + "integrity": "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/wrangler/node_modules/workerd": { + "version": "1.20261019.1", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20261019.1.tgz", + "integrity": "sha512-UUYRUq/7DmeCl11YriNbcVbjUZVLtt8uuCXFu+nz77hGFf8d4DEVXoCYtnA+MlBatE4+wxoj47DVqzK3xGBAiw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20261019.1", + "@cloudflare/workerd-darwin-arm64": "1.20261019.1", + "@cloudflare/workerd-linux-64": "1.20261019.1", + "@cloudflare/workerd-linux-arm64": "1.20261019.1", + "@cloudflare/workerd-windows-64": "1.20261019.1" + } + }, + "node_modules/ws": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "license": "MIT", + "dependencies": { + "@poppinss/exception": "^1.2.2", + "error-stack-parser-es": "^1.0.5" + } + }, + "node_modules/zod": { + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/registry/package.json b/registry/package.json new file mode 100644 index 0000000..55c3751 --- /dev/null +++ b/registry/package.json @@ -0,0 +1,22 @@ +{ + "name": "raz-image-registry", + "private": true, + "type": "module", + "engines": { "node": ">=24" }, + "scripts": { + "build": "node build.mjs", + "test": "npm run build && node --test test.mjs", + "test:docker": "npm run build && node docker-smoke.mjs", + "dev": "wrangler dev --ip 0.0.0.0 --port 8787", + "deploy": "wrangler deploy", + "dry-run": "wrangler deploy --dry-run --outdir dist/deploy" + }, + "dependencies": { + "r2-registry": "https://github.com/cloudflare/serverless-registry/archive/a73605d6d5587286eb9cfcb910148f7d1423f218.tar.gz" + }, + "devDependencies": { + "esbuild": "0.28.2", + "miniflare": "4.20260730.0", + "wrangler": "4.151.2" + } +} diff --git a/registry/test.mjs b/registry/test.mjs new file mode 100644 index 0000000..02c85f3 --- /dev/null +++ b/registry/test.mjs @@ -0,0 +1,186 @@ +import assert from "node:assert/strict"; +import { createHash, createHmac } from "node:crypto"; +import { after, before, test } from "node:test"; +import { Miniflare, Log, LogLevel } from "miniflare"; + +const origin = "https://registry.test"; +const authorization = `Basic ${Buffer.from("publisher:test-only-password").toString("base64")}`; +const readonly = `Basic ${Buffer.from("__anonymous_pull__:public-read-only").toString("base64")}`; +const digest = (bytes) => `sha256:${createHash("sha256").update(bytes).digest("hex")}`; +let mf; + +before(async () => { + mf = new Miniflare({ + modules: true, + scriptPath: "dist/worker.mjs", + compatibilityDate: "2026-07-30", + r2Buckets: ["REGISTRY"], + bindings: { REGISTRY_USERNAME: "publisher", REGISTRY_PASSWORD: "test-only-password" }, + log: new Log(LogLevel.ERROR), + }); + await mf.ready; +}); +after(async () => mf?.dispose()); + +async function request(path, method = "GET", auth, body, headers = {}) { + if (auth) headers.Authorization = auth; + return mf.dispatchFetch(new URL(path, origin), { method, headers, body }); +} + +async function upload(bytes) { + let response = await request("/v2/raz/blobs/uploads/", "POST", authorization); + assert.equal(response.status, 202, await response.text()); + let location = response.headers.get("Location"); + response = await request(location, "PATCH", authorization, bytes, { + "Content-Type": "application/octet-stream", + "Content-Length": String(bytes.length), + }); + assert.equal(response.status, 202, await response.text()); + location = new URL(response.headers.get("Location"), origin); + location.searchParams.set("digest", digest(bytes)); + response = await request(location, "PUT", authorization, undefined, { "Content-Length": "0" }); + assert.equal(response.status, 201, await response.text()); + return digest(bytes); +} + +test("Docker discovers Bearer authentication and gets an anonymous pull token", async () => { + const challenge = await request("/v2/"); + assert.equal(challenge.status, 401); + assert.match(challenge.headers.get("WWW-Authenticate"), /^Bearer realm="https:\/\/registry.test\/token"/); + const token = (await (await request("/token?service=registry.test&scope=repository:raz:pull")).json()).token; + for (const method of ["GET", "HEAD"]) { + const response = await request("/v2/", method, `Bearer ${token}`); + assert.equal(response.status, 200); + assert.equal(response.headers.get("Docker-Distribution-Api-Version"), "registry/2.0"); + } +}); + +test("supplied credentials are validated, including during docker login", async () => { + assert.equal((await request("/v2/", "GET", authorization)).status, 200); + const response = await request("/v2/", "GET", "Basic d3Jvbmc6d3Jvbmc="); + assert.equal(response.status, 401); + assert.match(response.headers.get("WWW-Authenticate"), /Bearer/); +}); + +test("anonymous tokens have pull permission only", async () => { + const response = await request("/token?scope=repository:raz:pull,push"); + assert.equal(response.status, 200); + assert.equal(response.headers.get("Cache-Control"), "no-store"); + const auth = `Bearer ${(await response.json()).token}`; + assert.equal((await request("/v2/", "GET", auth)).status, 200); + assert.equal((await request("/v2/raz/blobs/uploads/", "POST", auth)).status, 401); +}); + +test("publisher tokens authorize uploads, respecting requested scope", async () => { + for (const actions of ["pull,push", "pull"]) { + const token = await request(`/token?scope=repository:raz:${actions}`, "GET", authorization); + assert.equal(token.status, 200); + const response = await request("/v2/raz/blobs/uploads/", "POST", `Bearer ${(await token.json()).token}`); + assert.equal(response.status, actions.includes("push") ? 202 : 401); + } +}); + +test("token issuance validates credentials, service and repository scope", async () => { + assert.equal((await request("/token", "GET", "Basic d3Jvbmc6d3Jvbmc=")).status, 401); + assert.equal((await request("/token?service=other.test")).status, 400); + assert.equal((await request("/token?scope=repository:other:pull")).status, 400); + assert.equal((await request("/token?scope=repository:raz:delete")).status, 400); + assert.equal((await request("/token", "POST")).status, 405); +}); + +test("expired, tampered and foreign-audience tokens cannot authorize requests", async () => { + const issued = await request("/token", "GET", authorization); + const token = (await issued.json()).token; + for (const invalid of ["invalid", `${token}garbage`]) { + assert.equal((await request("/v2/", "GET", `Bearer ${invalid}`)).status, 401); + } + function signedToken(payload) { + const header = Buffer.from(JSON.stringify({ alg: "HS256", typ: "JWT" })).toString("base64url"); + const body = Buffer.from(JSON.stringify(payload)).toString("base64url"); + const message = `${header}.${body}`; + return `${message}.${createHmac("sha256", "test-only-password").update(message).digest("base64url")}`; + } + const payload = { iss: "raz-registry", aud: "registry.test", exp: Math.floor(Date.now() / 1000) + 300, + access: [{ type: "repository", name: "raz", actions: ["pull", "push"] }] }; + for (const changed of [{ exp: 1 }, { aud: "another-registry.test" }, { iss: "someone-else" }, + { access: [{ type: "repository", name: "other", actions: ["push"] }] }]) { + const auth = `Bearer ${signedToken({ ...payload, ...changed })}`; + assert.equal((await request("/v2/raz/blobs/uploads/", "POST", auth)).status, 401); + } +}); + +test("anonymous and public read-only credentials cannot mutate registry data", async () => { + for (const auth of [undefined, readonly, "Basic d3Jvbmc6d3Jvbmc="]) { + for (const [method, path] of [ + ["POST", "/v2/raz/blobs/uploads/"], + ["PATCH", "/v2/raz/blobs/uploads/unknown"], + ["PUT", "/v2/raz/manifests/release"], + ["DELETE", "/v2/raz/manifests/release"], + ["DELETE", "/v2/raz/blobs/uploads/unknown"], + ]) { + const response = await request(path, method, auth); + assert.equal(response.status, 401, `${method} ${path}`); + } + } +}); + +test("unknown repositories and nested namespaces are not served", async () => { + for (const path of [ + "/v2/other/manifests/release", "/v2/raz/nested/manifests/release", + "/v2/_catalog", "/", "/v2/raz/anything", + ]) { + assert.equal((await request(path, "GET", authorization)).status, 404, path); + assert.equal((await request(path, "PUT", authorization)).status, 404, path); + } +}); + +test("upload status is not an anonymous read endpoint", async () => { + assert.equal((await request("/v2/raz/blobs/uploads/unknown")).status, 401); +}); + +test("a publisher can cancel an incomplete upload", async () => { + const response = await request("/v2/raz/blobs/uploads/", "POST", authorization); + assert.equal(response.status, 202); + assert.equal((await request(response.headers.get("Location"), "DELETE", authorization)).status, 204); +}); + +test("published OCI manifests and blobs can be pulled without credentials", async () => { + const config = Buffer.from(JSON.stringify({ + architecture: "amd64", os: "linux", config: {}, + rootfs: { type: "layers", diff_ids: [] }, history: [], + })); + const configDigest = await upload(config); + const manifest = JSON.stringify({ + schemaVersion: 2, + mediaType: "application/vnd.oci.image.manifest.v1+json", + config: { mediaType: "application/vnd.oci.image.config.v1+json", digest: configDigest, size: config.length }, + layers: [], + }); + const path = "/v2/raz/manifests/test-release"; + const response = await request(path, "PUT", authorization, manifest, { + "Content-Type": "application/vnd.oci.image.manifest.v1+json", + }); + assert.equal(response.status, 201, await response.text()); + const manifestDigest = response.headers.get("Docker-Content-Digest"); + assert.equal(manifestDigest, digest(manifest)); + for (const reference of ["test-release", manifestDigest]) { + const get = await request(`/v2/raz/manifests/${reference}`); + assert.equal(get.status, 200); + assert.equal(await get.text(), manifest); + const head = await request(`/v2/raz/manifests/${reference}`, "HEAD"); + assert.equal(head.status, 200); + assert.equal(head.headers.get("Docker-Content-Digest"), manifestDigest); + } + const blob = await request(`/v2/raz/blobs/${configDigest}`); + assert.equal(blob.status, 200); + assert.deepEqual(Buffer.from(await blob.arrayBuffer()), config); + const tags = await request("/v2/raz/tags/list"); + assert.equal(tags.status, 200); + assert.ok((await tags.json()).tags.includes("test-release")); +}); + +test("missing manifests return a registry error rather than a login challenge", async () => { + const response = await request("/v2/raz/manifests/not-published"); + assert.equal(response.status, 404); + assert.equal(response.headers.has("WWW-Authenticate"), false); +}); diff --git a/registry/worker.ts b/registry/worker.ts new file mode 100644 index 0000000..a9a40f0 --- /dev/null +++ b/registry/worker.ts @@ -0,0 +1,148 @@ +// The upstream implements the Docker registry protocol and R2 storage. +// This adapter exposes anonymous pulls for raz alone. All uploads still +// pass through upstream authentication; its public identity has only pull. +import registry, { type Env as RegistryEnv } from "r2-registry"; +import { UserAuthenticator } from "r2-registry/src/user"; + +interface Env { + REGISTRY: R2Bucket; + REGISTRY_USERNAME: string; + REGISTRY_PASSWORD?: string; +} + +const anonymousUser = "__anonymous_pull__"; +const anonymousPassword = "public-read-only"; +const publicPath = /^\/v2\/raz\/(?:manifests\/[^/]+|blobs\/[^/]+|tags\/list|referrers\/[^/]+)$/; +const uploadPath = /^\/v2\/raz\/blobs\/uploads\/(?:[^/]+)?$/; + +const encoder = new TextEncoder(); +const tokenLifetime = 300; +const encode = (bytes: Uint8Array) => btoa(String.fromCharCode(...bytes)).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); +const decode = (text: string) => Uint8Array.from(atob(text.replace(/-/g, "+").replace(/_/g, "/")), (c) => c.charCodeAt(0)); + +// One secret serves as publisher password and token signing key. Rotation +// revokes both. Without a configured password, only public pulls can work. +async function tokenKey(env: Env) { + return crypto.subtle.importKey("raw", encoder.encode(env.REGISTRY_PASSWORD || anonymousPassword), + { name: "HMAC", hash: "SHA-256" }, false, ["sign", "verify"]); +} + +function challenge(request: Request): Response { + const url = new URL(request.url); + const scope = url.pathname === "/v2/" ? "" : ',scope="repository:raz:pull,push"'; + return new Response(JSON.stringify({ errors: [{ code: "UNAUTHORIZED", message: "authentication required" }] }), { + status: 401, + headers: { + "Content-Type": "application/json", + "Docker-Distribution-Api-Version": "registry/2.0", + "WWW-Authenticate": `Bearer realm="${url.origin}/token",service="${url.host}"${scope}`, + }, + }); +} + +async function issueToken(request: Request, env: Env): Promise { + if (request.method !== "GET") return new Response(null, { status: 405, headers: { Allow: "GET" } }); + const url = new URL(request.url); + if (url.searchParams.has("service") && url.searchParams.get("service") !== url.host) { + return new Response("Unknown service\n", { status: 400 }); + } + const scopes = url.searchParams.getAll("scope"); + if (scopes.length > 1 || (scopes.length && !/^repository:raz:(pull|push)(,(pull|push))*$/.test(scopes[0]))) { + return new Response("Unknown scope\n", { status: 400 }); + } + let publisher = false; + if (request.headers.has("Authorization")) { + const credentials = env.REGISTRY_PASSWORD ? [{ + username: env.REGISTRY_USERNAME, password: env.REGISTRY_PASSWORD, capabilities: ["pull", "push"] as ("pull" | "push")[], + }] : []; + publisher = (await new UserAuthenticator(credentials).checkCredentials(request)).verified; + if (!publisher) return challenge(request); + } + const requested = scopes.length ? scopes[0].split(":")[2].split(",") : ["pull", "push"]; + const actions = requested.filter((action) => action === "pull" || publisher); + const now = Math.floor(Date.now() / 1000); + const header = encode(encoder.encode(JSON.stringify({ alg: "HS256", typ: "JWT" }))); + const payload = encode(encoder.encode(JSON.stringify({ + iss: "raz-registry", aud: url.host, iat: now, exp: now + tokenLifetime, + access: [{ type: "repository", name: "raz", actions }], + }))); + const message = `${header}.${payload}`; + const signature = encode(new Uint8Array(await crypto.subtle.sign("HMAC", await tokenKey(env), encoder.encode(message)))); + return Response.json({ token: `${message}.${signature}`, expires_in: tokenLifetime, issued_at: new Date().toISOString() }, { + headers: { "Cache-Control": "no-store" }, + }); +} + +async function bearerActions(request: Request, env: Env): Promise { + try { + const token = request.headers.get("Authorization")!.slice(7).split("."); + if (token.length !== 3) return null; + const valid = await crypto.subtle.verify("HMAC", await tokenKey(env), decode(token[2]), encoder.encode(`${token[0]}.${token[1]}`)); + if (!valid) return null; + const header = JSON.parse(new TextDecoder().decode(decode(token[0]))); + const payload = JSON.parse(new TextDecoder().decode(decode(token[1]))); + if (header.alg !== "HS256" || payload.iss !== "raz-registry" || payload.aud !== new URL(request.url).host + || !Number.isFinite(payload.exp) || payload.exp <= Date.now() / 1000) return null; + const access = payload.access?.find((entry: { type: string; name: string }) => entry.type === "repository" && entry.name === "raz"); + return Array.isArray(access?.actions) ? access.actions : null; + } catch { + return null; + } +} + +export default { + async fetch(request: Request, env: Env, context: ExecutionContext): Promise { + const path = new URL(request.url).pathname; + if (path === "/token") return issueToken(request, env); + const ping = path === "/v2/"; + const pull = request.method === "GET" || request.method === "HEAD"; + if (!ping && !publicPath.test(path) && !uploadPath.test(path)) { + return new Response("Not found\n", { status: 404 }); + } + + const headers = new Headers(request.headers); + const authorization = headers.get("Authorization"); + if (authorization?.startsWith("Bearer ")) { + const actions = await bearerActions(request, env); + const permitted = actions && (ping || request.method === "HEAD" + ? actions.includes("pull") || actions.includes("push") + : actions.includes(pull ? "pull" : "push")); + if (!permitted) return challenge(request); + const publisher = !pull && env.REGISTRY_PASSWORD && actions!.includes("push"); + if (!pull && !publisher) return challenge(request); + const user = publisher ? env.REGISTRY_USERNAME : anonymousUser; + const password = publisher ? env.REGISTRY_PASSWORD! : anonymousPassword; + headers.set("Authorization", `Basic ${btoa(`${user}:${password}`)}`); + } else if (ping && !authorization) { + // Docker discovers authentication at the initial ping. Returning 200 + // here makes it omit credentials on subsequent uploads. + return challenge(request); + } else if (pull && publicPath.test(path) && !authorization) { + headers.set("Authorization", `Basic ${btoa(`${anonymousUser}:${anonymousPassword}`)}`); + } + const forwarded = new Request(request, { + headers, + method: ping && request.method === "HEAD" ? "GET" : request.method, + }); + // REGISTRY_CLIENT is initialized by the upstream fetch handler. Do not + // pass fallback registries or other credentials into this public service. + const registryEnv = { + REGISTRY: env.REGISTRY, + ENVIRONMENT: "production", + USERNAME: env.REGISTRY_USERNAME, + PASSWORD: env.REGISTRY_PASSWORD, + READONLY_USERNAME: anonymousUser, + READONLY_PASSWORD: anonymousPassword, + PUSH_COMPATIBILITY_MODE: "full", + } as RegistryEnv; + const response = await registry.fetch(forwarded, registryEnv, context); + if (response.status === 401) return challenge(request); + const responseHeaders = new Headers(response.headers); + responseHeaders.set("Docker-Distribution-Api-Version", "registry/2.0"); + return new Response(request.method === "HEAD" ? null : response.body, { + status: response.status, + statusText: response.statusText, + headers: responseHeaders, + }); + }, +} satisfies ExportedHandler; diff --git a/registry/wrangler.jsonc b/registry/wrangler.jsonc new file mode 100644 index 0000000..ad0d874 --- /dev/null +++ b/registry/wrangler.jsonc @@ -0,0 +1,13 @@ +{ + "$schema": "node_modules/wrangler/config-schema.json", + "name": "raz-registry", + "main": "worker.ts", + "compatibility_date": "2026-07-30", + "workers_dev": true, + "preview_urls": false, + "r2_buckets": [ + { "binding": "REGISTRY", "bucket_name": "raz-image-registry" } + ], + "vars": { "REGISTRY_USERNAME": "publisher" } + // REGISTRY_PASSWORD is a Worker secret, never a committed value. +}