From 5eae753821a69d3094d3406bfe1c2456c3ea0694 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 24 Oct 2026 22:41:51 +0000 Subject: [PATCH 1/2] Bump the actions-deps group with 5 updates (#508) Bumps the actions-deps group with 5 updates: | Package | From | To | | --- | --- | --- | | [ptr727/ProjectTemplate/.github/workflows/validate-task.yml](https://github.com/ptr727/projecttemplate) | `2.0.1120` | `2.0.1125` | | [ptr727/ProjectTemplate/.github/workflows/deploy-site-task.yml](https://github.com/ptr727/projecttemplate) | `2.0.1120` | `2.0.1125` | | [ptr727/ProjectTemplate/.github/workflows/merge-bot-task.yml](https://github.com/ptr727/projecttemplate) | `2.0.1120` | `2.0.1125` | | [ptr727/ProjectTemplate/.github/workflows/publish-plan-task.yml](https://github.com/ptr727/projecttemplate) | `2.0.1120` | `2.0.1125` | | [ptr727/ProjectTemplate/.github/workflows/build-release-task.yml](https://github.com/ptr727/projecttemplate) | `2.0.1120` | `2.0.1125` | Updates `ptr727/ProjectTemplate/.github/workflows/validate-task.yml` from 2.0.1120 to 2.0.1125 - [Release notes](https://github.com/ptr727/projecttemplate/releases) - [Changelog](https://github.com/ptr727/ProjectTemplate/blob/main/HISTORY.md) - [Commits](https://github.com/ptr727/projecttemplate/compare/4b10111c29a2b6200cf270e44e39846614f4a1c0...96f571ae0a25becdc1351d2d885ee23d54927f86) Updates `ptr727/ProjectTemplate/.github/workflows/deploy-site-task.yml` from 2.0.1120 to 2.0.1125 - [Release notes](https://github.com/ptr727/projecttemplate/releases) - [Changelog](https://github.com/ptr727/ProjectTemplate/blob/main/HISTORY.md) - [Commits](https://github.com/ptr727/projecttemplate/compare/4b10111c29a2b6200cf270e44e39846614f4a1c0...96f571ae0a25becdc1351d2d885ee23d54927f86) Updates `ptr727/ProjectTemplate/.github/workflows/merge-bot-task.yml` from 2.0.1120 to 2.0.1125 - [Release notes](https://github.com/ptr727/projecttemplate/releases) - [Changelog](https://github.com/ptr727/ProjectTemplate/blob/main/HISTORY.md) - [Commits](https://github.com/ptr727/projecttemplate/compare/4b10111c29a2b6200cf270e44e39846614f4a1c0...96f571ae0a25becdc1351d2d885ee23d54927f86) Updates `ptr727/ProjectTemplate/.github/workflows/publish-plan-task.yml` from 2.0.1120 to 2.0.1125 - [Release notes](https://github.com/ptr727/projecttemplate/releases) - [Changelog](https://github.com/ptr727/ProjectTemplate/blob/main/HISTORY.md) - [Commits](https://github.com/ptr727/projecttemplate/compare/4b10111c29a2b6200cf270e44e39846614f4a1c0...96f571ae0a25becdc1351d2d885ee23d54927f86) Updates `ptr727/ProjectTemplate/.github/workflows/build-release-task.yml` from 2.0.1120 to 2.0.1125 - [Release notes](https://github.com/ptr727/projecttemplate/releases) - [Changelog](https://github.com/ptr727/ProjectTemplate/blob/main/HISTORY.md) - [Commits](https://github.com/ptr727/projecttemplate/compare/4b10111c29a2b6200cf270e44e39846614f4a1c0...96f571ae0a25becdc1351d2d885ee23d54927f86) --- updated-dependencies: - dependency-name: ptr727/ProjectTemplate/.github/workflows/validate-task.yml dependency-version: 2.0.1125 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: ptr727/ProjectTemplate/.github/workflows/deploy-site-task.yml dependency-version: 2.0.1125 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: ptr727/ProjectTemplate/.github/workflows/merge-bot-task.yml dependency-version: 2.0.1125 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: ptr727/ProjectTemplate/.github/workflows/publish-plan-task.yml dependency-version: 2.0.1125 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps - dependency-name: ptr727/ProjectTemplate/.github/workflows/build-release-task.yml dependency-version: 2.0.1125 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions-deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/deploy-site.yml | 4 ++-- .github/workflows/merge-bot-pull-request.yml | 2 +- .github/workflows/publish-release.yml | 6 +++--- .github/workflows/test-pull-request.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index 299ea83..25b3927 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -40,7 +40,7 @@ jobs: validate: name: Validate sources job needs: [ assert-ref ] - uses: ptr727/ProjectTemplate/.github/workflows/validate-task.yml@4b10111c29a2b6200cf270e44e39846614f4a1c0 # 2.0.1120 + uses: ptr727/ProjectTemplate/.github/workflows/validate-task.yml@96f571ae0a25becdc1351d2d885ee23d54927f86 # 2.0.1125 permissions: contents: read with: @@ -58,7 +58,7 @@ jobs: deploy: name: Deploy site job needs: [ validate ] - uses: ptr727/ProjectTemplate/.github/workflows/deploy-site-task.yml@4b10111c29a2b6200cf270e44e39846614f4a1c0 # 2.0.1120 + uses: ptr727/ProjectTemplate/.github/workflows/deploy-site-task.yml@96f571ae0a25becdc1351d2d885ee23d54927f86 # 2.0.1125 with: environment: ${{ inputs.environment }} permissions: diff --git a/.github/workflows/merge-bot-pull-request.yml b/.github/workflows/merge-bot-pull-request.yml index ac06375..747b917 100644 --- a/.github/workflows/merge-bot-pull-request.yml +++ b/.github/workflows/merge-bot-pull-request.yml @@ -19,7 +19,7 @@ jobs: merge-bot: name: Merge bot pull request job - uses: ptr727/ProjectTemplate/.github/workflows/merge-bot-task.yml@4b10111c29a2b6200cf270e44e39846614f4a1c0 # 2.0.1120 + uses: ptr727/ProjectTemplate/.github/workflows/merge-bot-task.yml@96f571ae0a25becdc1351d2d885ee23d54927f86 # 2.0.1125 secrets: CODEGEN_APP_CLIENT_ID: ${{ secrets.CODEGEN_APP_CLIENT_ID }} CODEGEN_APP_PRIVATE_KEY: ${{ secrets.CODEGEN_APP_PRIVATE_KEY }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 6ab0842..f535151 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -17,7 +17,7 @@ jobs: # Also replaces this repo's own dispatch-ref assertion: the hub task errors identically on a ref other than main/develop. plan: name: Plan release job - uses: ptr727/ProjectTemplate/.github/workflows/publish-plan-task.yml@4b10111c29a2b6200cf270e44e39846614f4a1c0 # 2.0.1120 + uses: ptr727/ProjectTemplate/.github/workflows/publish-plan-task.yml@96f571ae0a25becdc1351d2d885ee23d54927f86 # 2.0.1125 with: event_name: ${{ github.event_name }} actor: ${{ github.actor }} @@ -31,7 +31,7 @@ jobs: name: Validate sources job needs: [plan] if: ${{ needs.plan.outputs.publish == 'true' }} - uses: ptr727/ProjectTemplate/.github/workflows/validate-task.yml@4b10111c29a2b6200cf270e44e39846614f4a1c0 # 2.0.1120 + uses: ptr727/ProjectTemplate/.github/workflows/validate-task.yml@96f571ae0a25becdc1351d2d885ee23d54927f86 # 2.0.1125 permissions: contents: read with: @@ -55,7 +55,7 @@ jobs: # An if: on a job replaces the implicit success() over its needs. # Without the validate arm a failed gate would publish anyway. if: ${{ needs.plan.outputs.publish == 'true' && needs.validate.result == 'success' }} - uses: ptr727/ProjectTemplate/.github/workflows/build-release-task.yml@4b10111c29a2b6200cf270e44e39846614f4a1c0 # 2.0.1120 + uses: ptr727/ProjectTemplate/.github/workflows/build-release-task.yml@96f571ae0a25becdc1351d2d885ee23d54927f86 # 2.0.1125 permissions: contents: write actions: write diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index 134fce1..93ebd31 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -19,7 +19,7 @@ jobs: validate: name: Validate sources job - uses: ptr727/ProjectTemplate/.github/workflows/validate-task.yml@4b10111c29a2b6200cf270e44e39846614f4a1c0 # 2.0.1120 + uses: ptr727/ProjectTemplate/.github/workflows/validate-task.yml@96f571ae0a25becdc1351d2d885ee23d54927f86 # 2.0.1125 permissions: contents: read with: From b13ce30a5c4006907c68477612e94e6a740bcf21 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Sat, 24 Oct 2026 20:02:37 -0700 Subject: [PATCH 2/2] Name the Host's Crawl Exemption as What Lets Staging Run the Whole Contract (#511) * Name the Host's Crawl Exemption as What Lets Staging Run the Whole Contract The VPS edge's CrowdSec crawl scenario is now exempted host-side for the site's own names, so a full run passes on VPS staging. The docs said production samples because a full run gets banned. They now say the exemption is what lets staging check everything, and that production's sample stays inside both limits without it. Who Owns What names CrowdSec and its exemptions as the host's. Co-Authored-By: Claude Opus 5.5 * Restate the Remaining Sampling Reasons Without the Crawl Ban Co-Authored-By: Claude Opus 5.5 * Restate the Crawl Limit Where the Sampling Reason Stands Alone Co-Authored-By: Claude Opus 5.5 * Cite Who Owns What for the Owner, Not the Exempted Scenario Co-Authored-By: Claude Opus 5.5 * Trim the Sampling Reason to the Sentence Cap Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- .github/actions/deploy/action.yml | 2 +- AUDIT.md | 2 +- ENVIRONMENT.md | 2 +- OPERATIONS.md | 6 +++--- README.md | 2 +- checks/README.md | 2 +- checks/check-live-urls.sh | 2 +- deploy/README.md | 6 ++++-- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/actions/deploy/action.yml b/.github/actions/deploy/action.yml index 99ef300..b3abf24 100644 --- a/.github/actions/deploy/action.yml +++ b/.github/actions/deploy/action.yml @@ -87,7 +87,7 @@ runs: # The only step that observes the running site. # The token pairs are set on staging alone, since production answers unauthenticated. # Both environments serve the family site, so an empty SITE_EXTRA_BASE_URL is a missing variable, and the check would skip the family host. - # Production samples the contract by class, since its edge bans a runner that crawls it, and staging checks every URL. + # Production samples the contract by class within the edge's ban limits, and staging checks every URL. - name: Verify URL contract step if: inputs.mode == 'verify' shell: bash diff --git a/AUDIT.md b/AUDIT.md index 36a3160..322859b 100644 --- a/AUDIT.md +++ b/AUDIT.md @@ -80,7 +80,7 @@ checks/check-url-parity.py public checks/check-live-urls.sh ``` -Run the live gate against a local mirror, which checks every URL. Against the VPS production site, set `SAMPLE_CONTRACT=1`, because the edge there bans a client that requests the whole contract. +Run the live gate against a local mirror, which checks every URL. Against the VPS production site, set `SAMPLE_CONTRACT=1`, so the run stays under the edge's 40-page crawl limit without the host's exemption. - **The build gate** proves every URL that must render exists as a built page, that every legacy media URL resolves, and that every local asset reference points at a file that exists. - **The live gate** proves the redirects, which the build cannot: a redirect is the web server's job. It follows each redirect to its destination rather than trusting the status code, because a redirect into a hole returns a perfectly healthy 301. A sampled production run checks each redirect's status and `Location` without following it, so an audit proves destinations on a local mirror. diff --git a/ENVIRONMENT.md b/ENVIRONMENT.md index c44742c..790ff70 100644 --- a/ENVIRONMENT.md +++ b/ENVIRONMENT.md @@ -80,7 +80,7 @@ Set on the command line for one run rather than stored anywhere. | `KEEP_RELEASES` | how many releases `make-release.sh` leaves behind | | `EXPECT_RELEASE` | the release id `check-live-urls.sh` requires the live site to report, which is what makes a rollback verifiable rather than merely exiting zero. Each family page is held to it as well | | `MTIME_RESTORED=1` | the caller has already restored `static/` mtimes. Two effects, and no others: `make-release.sh` does not run the restore, and does not require `git-restore-mtime` to be installed. **The assertion that the mtimes are correct still runs**, so setting this without having restored fails the build rather than bypassing it. **CI sets it**, because the workflows restore with a pinned action that runs the tool from the action's own directory and never puts it on `PATH` | -| `SAMPLE_CONTRACT=1` | `check-live-urls.sh` requests the first URL of each contract class rather than every URL. The deploy hook sets it for `production` alone, since that edge bans a client that requests the whole contract. Any value other than `1` or empty is refused | +| `SAMPLE_CONTRACT=1` | `check-live-urls.sh` requests the first URL of each contract class rather than every URL. The deploy hook sets it for `production` alone, so that run stays under the edge's 40-page crawl limit without the host's exemption. Any value other than `1` or empty is refused | | `CHECK_TAG` | the `X-Blog-Check` provenance this run announces on every request. **`/` is enforced, not merely expected**: exactly one `/`, which is the separator and the only one allowed, with both halves non-empty and each drawn from letters, digits, `.`, `_`, `-`. Rarely set by hand, since `check-live-urls.sh` derives `github/-` under Actions and `proxmox/manual` elsewhere. Set it to name a purpose for a hand run, as `proxmox/media-dev` | ## Two credentials to the VPS, and why they are separate diff --git a/OPERATIONS.md b/OPERATIONS.md index b15a41a..1ab033f 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -129,7 +129,7 @@ The deploy root and the base URL are the only host-specific values. A local run **A VPS release is named by its deploy run, never by a commit.** The hub's deploy task names each release `--` and verifies the site against that id itself. To check a VPS site by hand afterwards, pass that id as `EXPECT_RELEASE`. Read it from the **Deploy site job**'s log, where `make-release.sh` prints `==> installing release ` with the id ending in the run's own id and attempt. The Validate sources job prints the same line earlier in the run, for a scratch bundle stamped with a bare timestamp, so the first match of a log search is the wrong id. Never copy it from the site's `X-Blog-Release` header, since a stale config still serves the previous id and the check would then pass against it. A short SHA never matches, so the check waits out its timeout and fails. -**Production's deploy checks a sample of the contract, and every other run checks all of it.** The production edge bans a client that requests more than 40 distinct pages in a burst. It also bans one when more than 10 distinct pages answer `404`, `403` or `400`. A full run from the GitHub runner therefore gets it banned. The deploy hook sets `SAMPLE_CONTRACT=1` for `production` alone, and the check then requests one URL from each class. That covers each redirect class, each shape of page that must render, each media tree, and the family pages. It also covers `/all/`, `/feed.xml`, and `/sitemap.xml`, the fixed redirect destinations no list names. The script holds that to 30 distinct pages at most, and none is expected to answer an error. Its `404`s are a missing `.png` on each site, which the edge counts as a static request rather than a page. Staging and the local mirrors keep the whole contract, which is where it is proven. **A hand run against the VPS production site sets `SAMPLE_CONTRACT=1` too**, for the same reason the hook does. The local production mirror sits behind no such edge and keeps the whole contract. `checks/check-live-urls.sh --print-sample` lists what a sampled run requests without requesting anything. [`deploy/README.md`](./deploy/README.md#environment-variables) carries the budget. +**Production's deploy checks a sample of the contract, and every other run checks all of it.** The VPS edge runs CrowdSec, which bans a client that requests more than 40 distinct pages in a burst. It also bans one when more than 10 distinct pages answer `404`, `403` or `400`. The host side, which owns CrowdSec per [Who Owns What](#who-owns-what), exempts the blog and family names from the first scenario only. That exemption is what lets a full run from the GitHub runner pass on VPS staging. A staging run ending in empty `403`s points at the exemption first. Production keeps its run inside both limits without it. The deploy hook sets `SAMPLE_CONTRACT=1` for `production` alone, and the check then requests one URL from each class. That covers each redirect class, each shape of page that must render, each media tree, and the family pages. It also covers `/all/`, `/feed.xml`, and `/sitemap.xml`, the fixed redirect destinations no list names. The script holds that to 30 distinct pages at most, and none is expected to answer an error. Its `404`s are a missing `.png` on each site, which the edge counts as a static request rather than a page. Staging and the local mirrors keep the whole contract, which is where it is proven. **A hand run against the VPS production site sets `SAMPLE_CONTRACT=1` too**, for the same reason the hook does. The local production mirror sits behind no such edge and keeps the whole contract. `checks/check-live-urls.sh --print-sample` lists what a sampled run requests without requesting anything. [`deploy/README.md`](./deploy/README.md#environment-variables) carries the budget. **A hand run counts as measured through Cloudflare only once every host it reaches prints ` proxied`.** The check prints a verdict for the base host after its preflight and for the family host after its pages. It prints `proxied` only when the response carries `server: cloudflare` with a `cf-ray` header. Right after a hostname flips to proxied, the resolver on the machine running the check can keep answering with the origin for minutes. Another resolver can already answer with Cloudflare by then. A run in that window prints ` UNCONFIRMED`, since it reached the origin directly, so run it again once the resolver catches up. @@ -310,7 +310,7 @@ The mechanism is the `X-Blog-Check` request header, which the scripted checks se - **Absence is not proof of a human**, since a scanner sends no header either, so this pairs with the scanner-shape filters below rather than replacing them. The field is forgeable and must never reach auth, rate limiting, robots handling, or caching. - **Before 2026-08-09 the log carries no such field**, and user agent is the only key for those days: on 2026-08-08, 9,285 of 9,996 requests were `curl/8.5.0`, leaving 711 real ones. That key is a coincidence rather than a rule, since the CI runner's curl and the host's are byte-identical and only the rotating client address separates them, which is why the header exists. - **The header won over four alternatives, and each lost for a reason that still holds.** Other consumers read the user agent, and a runner image bumping curl would silently break a filter built on it. A query parameter pollutes the path, which is the analysis key, and collides with the `?p=` redirects. A source address fails because CI runner addresses rotate daily. A separate check hostname would exercise a different router and certificate, so the check would stop testing what production serves. -- **Keep production probes to a handful per pass, because a burst gets the reviewing network banned.** The edge runs CrowdSec. Its `crowdsecurity/http-probing` scenario overflows past about 10 distinct non-static paths answered 404, 403, or 400, and drains one every 10 seconds. Its `crowdsecurity/http-crawl-non_statics` scenario overflows past about 40 distinct non-static paths, and drains one every 0.5 seconds. Either overflow sets a 4-hour ban. A ban shows as an empty 403 on every production site, which reads like an outage. The allowlist for the reviewing network is host-side and owned by HomeAutomation-Config. Prefer the Wayback evidence below to a probe wherever it answers the question. +- **Keep production probes to a handful per pass, because a burst gets the reviewing network banned.** The edge runs CrowdSec. Its `crowdsecurity/http-probing` scenario overflows past about 10 distinct non-static paths answered 404, 403, or 400, and drains one every 10 seconds. Its `crowdsecurity/http-crawl-non_statics` scenario overflows past about 40 distinct non-static paths, and drains one every 0.5 seconds. The blog and family names are exempt from the crawl scenario alone, so a probe of them meets only the probing one. Each overflow sets a 4-hour ban. A ban shows as an empty 403 on every production site, which reads like an outage. The allowlist for the reviewing network is host-side and owned by HomeAutomation-Config. Prefer the Wayback evidence below to a probe wherever it answers the question. **A referer does not implicate this site unless it points somewhere else.** The rule worth applying is that a 404 carrying a referer is a broken link and a 404 without one is a typed or probed address, and it fails on scanners, which set `Referer` to the request URL itself. Every one of the 36 referer-bearing site-host 404s on 2026-08-08 was self-referential, so the unrefined rule reported three dozen broken links on a site that had none. Discard the matches before counting, and **normalize the scheme rather than comparing it**, because a scanner reaching an HTTPS site routinely sends an `http://` referer for the same address. Comparing against the request's own scheme therefore matches nothing and leaves every false positive in place: on the 2026-08-08 data the naive form kept all 36 where the normalized form kept none. @@ -618,7 +618,7 @@ The site and the server it runs on are maintained separately, so the boundary is | The GitHub Actions workflow | The SSH endpoint and its forced command | | `deploy/make-release.sh`, the bundle layout, and the Caddyfile inside it | The bootstrap `import`, the containers, and their environment variables | | `checks/check-live-urls.sh` and the URL contract | Config-watchdog and release-prune timers | -| The release id and the `@@RELEASE@@` stamp | Proxy resources, routing, tokens, TLS, DNS, and redirects from other domains | +| The release id and the `@@RELEASE@@` stamp | Proxy resources, routing, tokens, TLS, DNS, redirects from other domains, and CrowdSec with its exemptions | | What a release contains | Where a release may be written, and what happens after | The two meet at the container contract in [`deploy/README.md`](./deploy/README.md#container-contract). A defect on the host side is fixed on the host. A pipeline that needs the contract to say something different asks for a contract change rather than growing a second copy of the other side's work. diff --git a/README.md b/README.md index 1845bcb..d9d34a9 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ Most of the contract is not pages, though. It is redirects, and a redirect is th **3. Deploy to staging.** A dispatched workflow builds the commit, uploads the release, flips the symlink, and runs the same live gate from CI against the running site. The local mirror proves the artifact, and staging proves the infrastructure that exists only on the server: routing, TLS, the deploy key, and its confined transport. Staging keeps its authentication gate on and the check presents a token, so a byte-identical copy of the public site is never exposed to a crawler. A human then reads it. -**4. Promote, and deploy production.** `develop` merges into `main` through a pull request, and production is a second dispatch that accepts `main` alone. The same gate runs a third time, against the production `SITE_BASE_URL` and with no token. It requests one URL from each class of the contract rather than every URL. The production edge bans a client that requests too many pages in a burst. The mirror and staging have already proven the whole contract. A human then reads the result. +**4. Promote, and deploy production.** `develop` merges into `main` through a pull request, and production is a second dispatch that accepts `main` alone. The same gate runs a third time, against the production `SITE_BASE_URL` and with no token. It requests one URL from each class of the contract rather than every URL. The edge bans a client that requests more than 40 distinct pages in a burst. The host exempts this site's names, but the sample stays under that limit without the exemption. The mirror and staging have already proven the whole contract. A human then reads the result. Each branch feeds one environment: diff --git a/checks/README.md b/checks/README.md index fea362c..6560797 100644 --- a/checks/README.md +++ b/checks/README.md @@ -24,7 +24,7 @@ The contract is enforced by two gates, because one cannot cover both halves: | [`check-url-parity.py`][check-url-parity] | Every URL that must render exists as a built page, every legacy image URL resolves, every local asset reference points at a real file, and the count of carried media linked from no page still equals its recorded baseline | Against `public/`, in CI and before any release is installed | | [`check-live-urls.sh`][check-live-urls] | Every redirect resolves, and its destination answers | Against a running server, which is the only thing that exercises a redirect | -**Production's deploy checks a sample of the contract rather than all of it.** Its edge bans a client that requests more than 40 distinct pages in a burst, and the full contract is over 1,200. So the deploy hook sets `SAMPLE_CONTRACT=1` there, and `check-live-urls.sh` then requests the first URL of each class in file order. That covers every redirect class in [`deploy/README.md`][deploy-readme-redirects], every shape of page that must render, each media tree, and the family site. It also requests `/all/`, `/feed.xml`, and `/sitemap.xml`, the fixed redirect destinations, since no list names them and a sampled redirect is not followed to one. A sampled redirect is checked for its status and its `Location` and is not followed. The script asserts the sample's budget before its first request, and `checks/tests/test_check_live_urls_sample.py` holds the classes to the table's sizes and the sample to that budget. `checks/check-live-urls.sh --print-sample` prints the sample and its budget without requesting anything. Staging, the local mirrors, and any run without the variable check every URL, which is where the contract itself is proven. +**Production's deploy checks a sample of the contract rather than all of it.** The VPS edge bans a client that requests more than 40 distinct pages in a burst, and the full contract is over 1,200. The host side exempts the site's own names from that scenario, which is what lets staging's full run pass. Production stays under the limit without the exemption. Its deploy hook sets `SAMPLE_CONTRACT=1`, and `check-live-urls.sh` then requests the first URL of each class in file order. That covers every redirect class in [`deploy/README.md`][deploy-readme-redirects], every shape of page that must render, each media tree, and the family site. It also requests `/all/`, `/feed.xml`, and `/sitemap.xml`, the fixed redirect destinations, since no list names them and a sampled redirect is not followed to one. A sampled redirect is checked for its status and its `Location` and is not followed. The script asserts the sample's budget before its first request, and `checks/tests/test_check_live_urls_sample.py` holds the classes to the table's sizes and the sample to that budget. `checks/check-live-urls.sh --print-sample` prints the sample and its budget without requesting anything. Staging, the local mirrors, and any run without the variable check every URL, which is where the contract itself is proven. ## The two lists diff --git a/checks/check-live-urls.sh b/checks/check-live-urls.sh index 840401e..ec2ec6e 100755 --- a/checks/check-live-urls.sh +++ b/checks/check-live-urls.sh @@ -55,7 +55,7 @@ done FAMILY_PAGES=("/|The Viljoen Family" "/en/|The Viljoen Family" "/af/|Die Viljoen-familie") -# Production's edge bans a client that requests more than 40 distinct pages in a burst, so its deploy checks one URL per class rather than the whole contract. +# Production's deploy checks one URL per class, staying inside the edge's ban limits without the host's crawl exemption. # Staging and the local mirrors check every URL, which is where the contract itself is proven. SAMPLE_PER_CLASS=1 SAMPLE_MAX_PATHS=30 diff --git a/deploy/README.md b/deploy/README.md index f1d6b81..5beb4f3 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -164,9 +164,11 @@ One more decides how much of the contract is requested: | --- | --- | | `SAMPLE_CONTRACT` | `1` requests the first URL of each class rather than every URL. Unset checks the whole contract. Any other value is refused. | -Production's deploy sets it, and so does a hand run against the VPS production site. Nothing else sets it. Production's edge bans a client that requests +Production's deploy sets it, and so does a hand run against the VPS production site. Nothing else sets it. The VPS edge bans a client that requests more than 40 distinct pages in a burst. It also bans one when more than 10 distinct pages answer -`404`, `403` or `400` in a short window. Images, CSS and JS count toward neither. The whole +`404`, `403` or `400` in a short window. Images, CSS and JS count toward neither. The host side +exempts the site's own names from the first scenario, which lets staging check the whole contract. +The sample keeps production's run inside both limits whether or not that exemption holds. The whole contract is over 1,200 URLs. The sample takes one URL from each redirect class in [How the redirects are expressed][how-the-redirects-are-expressed]. It adds one from each shape of page that must render, one from each media tree, and the three family pages. It also adds