From 0a1593aa66decca95f8a45b0e655a6511eee3b1b Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Fri, 23 Oct 2026 09:55:52 -0700 Subject: [PATCH 1/5] Redirect the Old News Sitemap to sitemap.xml The old platform served /news-sitemap.xml, and the Wayback Machine holds captures of it answering 200 from 2022 through 2024. Crawlers still poll it daily and get a 404. A slugs.map entry sends it to /sitemap.xml, the contract carries it, and the README counts move with it. OPERATIONS.md also records that a routerless https 404 landing beside 502s is the edge restarting on its schedule, so a pass leaves it alone. --- OPERATIONS.md | 2 ++ checks/README.md | 4 ++-- checks/redirect-urls.txt | 1 + deploy/README.md | 4 ++-- deploy/maps/slugs.map | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OPERATIONS.md b/OPERATIONS.md index c6ca125c..ffd2e32d 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -288,6 +288,8 @@ A request crosses the proxy before it reaches the site, so no single log answers **When `ServiceName` is absent the edge answered, and `entryPointName` with `RequestScheme` say why**, which is the difference between a finding and a fault. The common cause is a cleartext request to the TLS port: the `websecure` router carries `tls` and therefore matches TLS requests only, so a plaintext request to 443 matches nothing and Traefik answers its own 404 with a body of a few dozen bytes. That is correct behavior rather than a gap, and it needs no action. Read the two fields together before treating a routerless 404 as a routing problem, because the shape that does deserve investigation is a routerless 404 arriving over **https**, which means a hostname the proxy serves no route for. +**A routerless https `404` on a hostname the proxy does serve is the edge restarting when `502`s land in the same minute.** The edge restarts on a nightly schedule and whenever the host side pushes a change during the day, and the routes return within a minute. Such a window is an intentional update blip, so leave it alone. Investigate only a window that does not look like one, such as one that outlasts a restart or recurs with no `502` beside it. + Two properties of the Caddy side are worth knowing before parsing it. Its access log is `format console`, so each line is a timestamp, a level, and a logger name followed by a JSON object rather than being JSON itself, and a parser that assumes one object per line reads nothing. And `trusted_proxies` is what makes `client_ip` the reader rather than the proxy, which is the same setting "Serving" describes as a security boundary. Without it every request in the log appears to come from one internal address, and the inward pass cannot distinguish a reader from a health check. ### Reading a 404 list without being fooled by it diff --git a/checks/README.md b/checks/README.md index 44d50536..259ea54c 100644 --- a/checks/README.md +++ b/checks/README.md @@ -45,7 +45,7 @@ The contract is enforced by two gates, because one cannot cover both halves: The 180 tag archives are exactly the tags the migrated posts carry. Three further terms answer with an empty page and are redirects rather than renders: `brultech` and `phyn`, which no published post uses, and `review`, an empty tag that is also a 12-post category. Hugo generates a term page only where posts exist, which is why the render list is 180 tags rather than 183. -**`redirect-urls.txt`, 955 URLs that must resolve but need not render.** These have no Hugo equivalent. Reproducing them would be absurd, and 404ing them discards real inbound links. +**`redirect-urls.txt`, 956 URLs that must resolve but need not render.** These have no Hugo equivalent. Reproducing them would be absurd, and 404ing them discards real inbound links. | Shape | Count | Disposition | | --- | --- | --- | @@ -61,7 +61,7 @@ The 180 tag archives are exactly the tags the migrated posts carry. Three furthe | Blogger feed | 3 | `/feeds/posts/default` and its `/atom.xml` alias, redirected to `/feed.xml` | | Blogger per-post comment feeds | 27 | `/feeds//comments/default` to the post, via `blogger.map` | | Blogger static pages | 2 | `/p/.html` to `//` | -| Root files | 2 | `/robots.txt/` to the file and `/osd.xml/` to `/`, via `slugs.map`, as below | +| Root files | 3 | `/robots.txt/` to the file, `/osd.xml/` to `/`, and `/news-sitemap.xml`, the old platform's news sitemap, to `/sitemap.xml`, via `slugs.map`, as below | | Feed type suffixes | 2 | Redirect to the same feed without its WordPress type suffix, `/feed/atom/` to `/feed/` and likewise for `rss`, `rss2` and `rdf` | | Empty term archives | 3 | `brultech`, `phyn`, `review`, as above | | Site and section feeds | 3 | `/feed/`, `/about/feed/`, `/comments/feed/` | diff --git a/checks/redirect-urls.txt b/checks/redirect-urls.txt index 2bb46fe3..5e28b762 100644 --- a/checks/redirect-urls.txt +++ b/checks/redirect-urls.txt @@ -758,6 +758,7 @@ /img_9377/ /jellyfish-light-arrow-500x182-1/ /jellyfish-lighting-ports-500x214-1/ +/news-sitemap.xml /osd.xml/ /p/about.html /p/viljoen-family.html diff --git a/deploy/README.md b/deploy/README.md index 36935ad5..de742022 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -345,7 +345,7 @@ It forwards `Host` and `Accept-Language` unchanged. Everything the site does not render is the web server's job, and the workload constrains which server can serve it. Two requirements are load-bearing, so a replacement has to meet both: - **The query string must be matchable.** 110 `?p=` shortlinks redirect on the query alone. A server that matches on the path only would resolve `/?p=123` as `/`, redirect the homepage, and carry the query through to it. -- **There must be a lookup primitive.** 314 of the 955 resolve through map files rather than patterns, since no rule can derive their destination. The five maps carry 714 entries between them. A linear scan of that many rules per request is the wrong shape. +- **There must be a lookup primitive.** 315 of the 956 resolve through map files rather than patterns, since no rule can derive their destination. The five maps carry 715 entries between them. A linear scan of that many rules per request is the wrong shape. The Caddyfile carries **15 `redir` directives**, reading **5 map files** through **4 `map` blocks**. Eleven directives match on a pattern and four resolve through a map lookup. A map serves wherever no pattern can derive the destination from the input. @@ -361,7 +361,7 @@ Every class below is a legacy shape, closed by the migration, so no count here m | `@term_feed` | 192 | `/tag//feed/` and `/category//feed/` -> the term archive | | `@post_id` | 110 | `/?p=` -> the permalink, via `p-ids.map` | | `@post_child_feed` | 107 | `/YYYY/MM/DD/post//feed/` -> the post, ordered **before** `@post_child` | -| `@mapped` via `slugs.map` | 108 | bare `//` -> best destination, `/robots.txt/` -> the file, `/osd.xml/` -> `/`, and a retired page -> the site that replaced it | +| `@mapped` via `slugs.map` | 109 | bare `//` -> best destination, `/robots.txt/` -> the file, `/osd.xml/` -> `/`, `/news-sitemap.xml` -> `/sitemap.xml`, and a retired page -> the site that replaced it | | `@date_archive` | 83 | `/YYYY/`, `/YYYY/MM/`, and their pagination -> `/all/`. The matcher accepts any date, including dates absent from the list | | `@mapped` via `blogger.map` | 63 | `/YYYY/MM/slug.html` -> the current post | | `@mapped` via `blogger.map` | 27 | `/feeds//comments/default` -> the post, Blogger's per-post comment feed | diff --git a/deploy/maps/slugs.map b/deploy/maps/slugs.map index 1e90f92c..23ddfed0 100644 --- a/deploy/maps/slugs.map +++ b/deploy/maps/slugs.map @@ -98,6 +98,7 @@ /img_9377/ /2021/12/21/getting-carried-away-with-rgb-holiday-lights/ /jellyfish-light-arrow-500x182-1/ / /jellyfish-lighting-ports-500x214-1/ / +/news-sitemap.xml /sitemap.xml /osd.xml/ / /packet/ /2020/09/05/abandoning-greeneye-for-sense/ /robots.txt/ /robots.txt From 74a450145706982b19ded5d8bf0a2fc05b6ecfa7 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Fri, 23 Oct 2026 10:03:00 -0700 Subject: [PATCH 2/5] Serve the News Sitemap Redirect From the Caddyfile The strict review found the map entry would not survive, since capture/build-redirects.py rewrites slugs.map from the capture and its filter never emits a one-slash key. The redirect is an exact-path class of its own instead, the shape the Blogger feed alias uses, with its own rows in both README tables, its sampler class, and /sitemap.xml among the fixed destinations the sample renders. OPERATIONS.md's restart paragraph opens as the exception to the routing fault the paragraph before it describes, and attributes the restart schedule to the host side's own documentation. --- OPERATIONS.md | 2 +- checks/README.md | 3 ++- checks/check-live-urls.sh | 4 +++- checks/tests/test_check_live_urls_sample.py | 2 +- deploy/Caddyfile | 3 +++ deploy/README.md | 9 +++++---- deploy/maps/slugs.map | 1 - 7 files changed, 15 insertions(+), 9 deletions(-) diff --git a/OPERATIONS.md b/OPERATIONS.md index ffd2e32d..2d077283 100644 --- a/OPERATIONS.md +++ b/OPERATIONS.md @@ -288,7 +288,7 @@ A request crosses the proxy before it reaches the site, so no single log answers **When `ServiceName` is absent the edge answered, and `entryPointName` with `RequestScheme` say why**, which is the difference between a finding and a fault. The common cause is a cleartext request to the TLS port: the `websecure` router carries `tls` and therefore matches TLS requests only, so a plaintext request to 443 matches nothing and Traefik answers its own 404 with a body of a few dozen bytes. That is correct behavior rather than a gap, and it needs no action. Read the two fields together before treating a routerless 404 as a routing problem, because the shape that does deserve investigation is a routerless 404 arriving over **https**, which means a hostname the proxy serves no route for. -**A routerless https `404` on a hostname the proxy does serve is the edge restarting when `502`s land in the same minute.** The edge restarts on a nightly schedule and whenever the host side pushes a change during the day, and the routes return within a minute. Such a window is an intentional update blip, so leave it alone. Investigate only a window that does not look like one, such as one that outlasts a restart or recurs with no `502` beside it. +**The one routerless https `404` that is not a routing fault is the edge restarting.** It arrives on a hostname the proxy does serve, in a minute that also carries `502`s. The host side restarts the edge nightly and when it pushes a change during the day, and its documentation holds that schedule. The routes return within a minute. Such a window is an intentional update blip, so leave it alone. Investigate only a window that does not look like one, such as one that outlasts a restart or recurs with no `502` beside it. Two properties of the Caddy side are worth knowing before parsing it. Its access log is `format console`, so each line is a timestamp, a level, and a logger name followed by a JSON object rather than being JSON itself, and a parser that assumes one object per line reads nothing. And `trusted_proxies` is what makes `client_ip` the reader rather than the proxy, which is the same setting "Serving" describes as a security boundary. Without it every request in the log appears to come from one internal address, and the inward pass cannot distinguish a reader from a health check. diff --git a/checks/README.md b/checks/README.md index 259ea54c..2dad263d 100644 --- a/checks/README.md +++ b/checks/README.md @@ -59,9 +59,10 @@ The 180 tag archives are exactly the tags the migrated posts carry. Three furthe | Blogger monthly archives | 21 | Redirect to `/all/` | | Author archive and pagination | 12 | Redirect to `/`, a single-author blog duplicating home | | Blogger feed | 3 | `/feeds/posts/default` and its `/atom.xml` alias, redirected to `/feed.xml` | +| News sitemap | 1 | `/news-sitemap.xml`, the old platform's news sitemap, redirected to `/sitemap.xml` | | Blogger per-post comment feeds | 27 | `/feeds//comments/default` to the post, via `blogger.map` | | Blogger static pages | 2 | `/p/.html` to `//` | -| Root files | 3 | `/robots.txt/` to the file, `/osd.xml/` to `/`, and `/news-sitemap.xml`, the old platform's news sitemap, to `/sitemap.xml`, via `slugs.map`, as below | +| Root files | 2 | `/robots.txt/` to the file and `/osd.xml/` to `/`, via `slugs.map`, as below | | Feed type suffixes | 2 | Redirect to the same feed without its WordPress type suffix, `/feed/atom/` to `/feed/` and likewise for `rss`, `rss2` and `rdf` | | Empty term archives | 3 | `brultech`, `phyn`, `review`, as above | | Site and section feeds | 3 | `/feed/`, `/about/feed/`, `/comments/feed/` | diff --git a/checks/check-live-urls.sh b/checks/check-live-urls.sh index b08d43e2..5dce9bb9 100755 --- a/checks/check-live-urls.sh +++ b/checks/check-live-urls.sh @@ -61,7 +61,7 @@ SAMPLE_PER_CLASS=1 SAMPLE_MAX_PATHS=30 SAMPLE_MAX_STATICS=8 # Pages only a redirect reaches, so no list names them and a sampled redirect never requests them. -SAMPLE_DESTINATIONS=(/all/ /feed.xml) +SAMPLE_DESTINATIONS=(/all/ /feed.xml /sitemap.xml) # Each classifier sets CLASS rather than printing it, since a subshell per URL costs seconds across the redirect list. # The redirect classes are the rows of deploy/README.md's table, with the map shapes last, since a bare .html test would claim two Blogger rows. @@ -87,6 +87,8 @@ redirect_class() { CLASS='@site_feed' elif [[ $path =~ ^/(feeds/posts/default/?|atom\.xml)$ ]]; then CLASS='@blogger_feed' + elif [[ $path == /news-sitemap.xml ]]; then + CLASS='@news_sitemap' elif [[ $path =~ $blogger_archive ]]; then CLASS='@blogger_archive' elif [[ $path =~ $blogger_page ]]; then diff --git a/checks/tests/test_check_live_urls_sample.py b/checks/tests/test_check_live_urls_sample.py index a8b3d404..1cc459d8 100644 --- a/checks/tests/test_check_live_urls_sample.py +++ b/checks/tests/test_check_live_urls_sample.py @@ -88,7 +88,7 @@ def test_every_redirect_class_in_the_table_is_sampled_with_its_size(self) -> Non if kind == "redirect" ) expected = readme_classes() - self.assertEqual(len(expected), 16) + self.assertEqual(len(expected), 17) self.assertEqual(sampled, expected) def test_render_media_and_family_are_each_sampled(self) -> None: diff --git a/deploy/Caddyfile b/deploy/Caddyfile index a04e61b0..3734410c 100644 --- a/deploy/Caddyfile +++ b/deploy/Caddyfile @@ -98,6 +98,9 @@ @blogger_feed path /feeds/posts/default /feeds/posts/default/ /atom.xml redir @blogger_feed /feed.xml 301 + @news_sitemap path /news-sitemap.xml + redir @news_sitemap /sitemap.xml 301 + # Every monthly archive path answers, including dates the blog never covered. # The archive index is where a visitor can actually find the month. @blogger_archive path_regexp ^/\d{4}_\d{2}_01_archive\.html$ diff --git a/deploy/README.md b/deploy/README.md index de742022..9dc1a71e 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -345,9 +345,9 @@ It forwards `Host` and `Accept-Language` unchanged. Everything the site does not render is the web server's job, and the workload constrains which server can serve it. Two requirements are load-bearing, so a replacement has to meet both: - **The query string must be matchable.** 110 `?p=` shortlinks redirect on the query alone. A server that matches on the path only would resolve `/?p=123` as `/`, redirect the homepage, and carry the query through to it. -- **There must be a lookup primitive.** 315 of the 956 resolve through map files rather than patterns, since no rule can derive their destination. The five maps carry 715 entries between them. A linear scan of that many rules per request is the wrong shape. +- **There must be a lookup primitive.** 314 of the 956 resolve through map files rather than patterns, since no rule can derive their destination. The five maps carry 714 entries between them. A linear scan of that many rules per request is the wrong shape. -The Caddyfile carries **15 `redir` directives**, reading **5 map files** through **4 `map` blocks**. Eleven directives match on a pattern and four resolve through a map lookup. A map serves wherever no pattern can derive the destination from the input. +The Caddyfile carries **16 `redir` directives**, reading **5 map files** through **4 `map` blocks**. Twelve directives match on a pattern and four resolve through a map lookup. A map serves wherever no pattern can derive the destination from the input. Directives and URL classes are not one to one, in both directions. `@mapped` is a single directive serving four classes, because their key spaces are disjoint and merging them keeps those four classes to one lookup. `@uploads` is one directive covering a URL set that is gated separately. @@ -361,7 +361,7 @@ Every class below is a legacy shape, closed by the migration, so no count here m | `@term_feed` | 192 | `/tag//feed/` and `/category//feed/` -> the term archive | | `@post_id` | 110 | `/?p=` -> the permalink, via `p-ids.map` | | `@post_child_feed` | 107 | `/YYYY/MM/DD/post//feed/` -> the post, ordered **before** `@post_child` | -| `@mapped` via `slugs.map` | 109 | bare `//` -> best destination, `/robots.txt/` -> the file, `/osd.xml/` -> `/`, `/news-sitemap.xml` -> `/sitemap.xml`, and a retired page -> the site that replaced it | +| `@mapped` via `slugs.map` | 108 | bare `//` -> best destination, `/robots.txt/` -> the file, `/osd.xml/` -> `/`, and a retired page -> the site that replaced it | | `@date_archive` | 83 | `/YYYY/`, `/YYYY/MM/`, and their pagination -> `/all/`. The matcher accepts any date, including dates absent from the list | | `@mapped` via `blogger.map` | 63 | `/YYYY/MM/slug.html` -> the current post | | `@mapped` via `blogger.map` | 27 | `/feeds//comments/default` -> the post, Blogger's per-post comment feed | @@ -370,11 +370,12 @@ Every class below is a legacy shape, closed by the migration, so no count here m | `@site_feed` | 3 | `/feed/`, `/comments/feed/`, `/about/feed/` -> `/feed.xml` | | `@mapped` via `terms.map` | 3 | the three empty term archives | | `@blogger_feed` | 3 | `/feeds/posts/default` and `/atom.xml` -> `/feed.xml`, Blogger's Atom feed and its alias, which WordPress.com kept as a redirect | +| `@news_sitemap` | 1 | `/news-sitemap.xml` -> `/sitemap.xml`, the old platform's news sitemap, which crawlers still poll | | `@mapped_slash` | 3 | a `slugs.map` or `terms.map` key requested without its trailing slash -> that key's destination. The matcher accepts every such key, including keys absent from the list, and leaves out a dotted path | | `@blogger_page` | 2 | `/p/.html` -> `//`, Blogger's static-page shape | | `@feed_type` | 2 | a WordPress post, attachment, term, author, site, comments, or about feed at `/feed/atom/`, `/feed/rss/`, `/feed/rss2/` or `/feed/rdf/` -> the same feed at `/feed/`, which another row resolves | -**Those sixteen classes account for every line in [`checks/redirect-urls.txt`](../checks/redirect-urls.txt), with nothing in the contract outside the table.** Completeness is the property worth holding, and the list's line count is how to check it. `check-live-urls.sh` classifies the list by the same rows to sample production. A unit test holds each class's count to the size column above, so a new row needs a new class there. +**Those seventeen classes account for every line in [`checks/redirect-urls.txt`](../checks/redirect-urls.txt), with nothing in the contract outside the table.** Completeness is the property worth holding, and the list's line count is how to check it. `check-live-urls.sh` classifies the list by the same rows to sample production. A unit test holds each class's count to the size column above, so a new row needs a new class there. `@uploads` is deliberately absent from that table and from the redirect contract. It rewrites `/wp-content/uploads/(.*)` to `/media/$1`, preserving all 778 legacy image URLs, which are gated by `golden-media-legacy.txt` on their own. Counting them here would double-count a set that has its own list. diff --git a/deploy/maps/slugs.map b/deploy/maps/slugs.map index 23ddfed0..1e90f92c 100644 --- a/deploy/maps/slugs.map +++ b/deploy/maps/slugs.map @@ -98,7 +98,6 @@ /img_9377/ /2021/12/21/getting-carried-away-with-rgb-holiday-lights/ /jellyfish-light-arrow-500x182-1/ / /jellyfish-lighting-ports-500x214-1/ / -/news-sitemap.xml /sitemap.xml /osd.xml/ / /packet/ /2020/09/05/abandoning-greeneye-for-sense/ /robots.txt/ /robots.txt From c37d6b01c6a58b8412e99d5a77a40f71ea61a9a2 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Fri, 23 Oct 2026 10:06:49 -0700 Subject: [PATCH 3/5] Drop the Stale Class Ordinal From the Redirect README --- deploy/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/README.md b/deploy/README.md index 9dc1a71e..b90b947b 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -379,7 +379,7 @@ Every class below is a legacy shape, closed by the migration, so no count here m `@uploads` is deliberately absent from that table and from the redirect contract. It rewrites `/wp-content/uploads/(.*)` to `/media/$1`, preserving all 778 legacy image URLs, which are gated by `golden-media-legacy.txt` on their own. Counting them here would double-count a set that has its own list. -`@label` is the seventeenth class and is deliberately **not** in the contract. `/search/label/