Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cloudflare/map-site/public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&family=Newsreader:ital,wght@0,400;0,500;1,400&display=swap">
<link rel="stylesheet" href="/assets/hub.css?v=7">
<script src="/assets/js.js"></script>
<script src="/assets/analytics.js?v=1" defer></script>
</head>
<body>
<a class="skip" href="#main">Skip to content</a>
Expand Down
22 changes: 11 additions & 11 deletions cloudflare/map-site/public/_headers
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
X-Frame-Options: DENY

/
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self' https://cloudflareinsights.com; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com https://*.googletagmanager.com https://*.posthog.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data: https://*.google-analytics.com https://*.googletagmanager.com; connect-src 'self' https://cloudflareinsights.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'

/index.html
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self' https://cloudflareinsights.com; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com https://*.googletagmanager.com https://*.posthog.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data: https://*.google-analytics.com https://*.googletagmanager.com; connect-src 'self' https://cloudflareinsights.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'

/learn/*
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self' https://cloudflareinsights.com; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com https://*.googletagmanager.com https://*.posthog.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data: https://*.google-analytics.com https://*.googletagmanager.com; connect-src 'self' https://cloudflareinsights.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'

/blake2b/*
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self' https://cloudflareinsights.com; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com https://*.googletagmanager.com https://*.posthog.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data: https://*.google-analytics.com https://*.googletagmanager.com; connect-src 'self' https://cloudflareinsights.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'

/ecosystem/*
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self' https://cloudflareinsights.com; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com https://*.googletagmanager.com https://*.posthog.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data: https://*.google-analytics.com https://*.googletagmanager.com; connect-src 'self' https://cloudflareinsights.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'

/stream/*
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self' https://cloudflareinsights.com; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com https://*.googletagmanager.com https://*.posthog.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data: https://*.google-analytics.com https://*.googletagmanager.com; connect-src 'self' https://cloudflareinsights.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'

/faq/*
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self' https://cloudflareinsights.com; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com https://*.googletagmanager.com https://*.posthog.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data: https://*.google-analytics.com https://*.googletagmanager.com; connect-src 'self' https://cloudflareinsights.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'

/key/app
X-Content-Type-Options: nosniff
Expand All @@ -33,19 +33,19 @@
X-Content-Type-Options: nosniff

/key/*
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self' https://cloudflareinsights.com; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com https://*.googletagmanager.com https://*.posthog.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data: https://*.google-analytics.com https://*.googletagmanager.com; connect-src 'self' https://cloudflareinsights.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'

/404.html
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self' https://cloudflareinsights.com; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com https://*.googletagmanager.com https://*.posthog.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data: https://*.google-analytics.com https://*.googletagmanager.com; connect-src 'self' https://cloudflareinsights.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'

/assets/*
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data:; connect-src 'self' https://cloudflareinsights.com; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com https://*.googletagmanager.com https://*.posthog.com; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data: https://*.google-analytics.com https://*.googletagmanager.com; connect-src 'self' https://cloudflareinsights.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'

/assets/*
Cache-Control: public, max-age=604800

/map/*
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com 'sha256-vlGx9AvjSJDahRHjiKwqKUG7BedPk8gKirI6r9RF/rI='; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data: blob:; connect-src 'self' https://cloudflareinsights.com; worker-src 'self' blob:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com https://*.googletagmanager.com https://*.posthog.com 'sha256-vlGx9AvjSJDahRHjiKwqKUG7BedPk8gKirI6r9RF/rI='; style-src 'self' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; img-src 'self' data: https://*.google-analytics.com https://*.googletagmanager.com blob:; connect-src 'self' https://cloudflareinsights.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'; base-uri 'none'; form-action 'none'

# three.js is versioned by folder and the page's own files by ?v=, so they can be held a while.
/map/vendor/*
Expand Down
31 changes: 31 additions & 0 deletions cloudflare/map-site/public/assets/analytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Google Analytics 4 and PostHog for lazarus-xbt.xyz and pool.lazarus-xbt.xyz.
//
// One GA4 property ("Lazarus Pool websites", stream G-CFKT50ZPQE) and one PostHog project
// ("Lazarus sites", 625142) cover both hosts. Both set their cookies on .lazarus-xbt.xyz, so a visit
// that goes from the hub to the pool stays one visitor and one session, and reports split by host.
// The hub serves this file as /assets/analytics.js and the pool as /static/analytics.js; the two
// copies must stay identical (cloudflare/pool-site/tests/indexing.py checks).
(function () {
// Only the production hosts report: *.pages.dev previews, local servers and the node stay out.
var host = location.hostname;
if (host !== "lazarus-xbt.xyz" && host !== "pool.lazarus-xbt.xyz") return;

var GA4 = "G-CFKT50ZPQE";
var tag = document.createElement("script");
tag.async = true;
tag.src = "https://www.googletagmanager.com/gtag/js?id=" + GA4;
document.head.appendChild(tag);
window.dataLayer = window.dataLayer || [];
window.gtag = function () { window.dataLayer.push(arguments); };
window.gtag("js", new Date());
window.gtag("config", GA4);

// PostHog's loader as published at posthog.com/docs/libraries/js: it queues calls until
// array.js arrives from us-assets.i.posthog.com.
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.crossOrigin="anonymous",p.async=!0,p.src=s.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],Object.defineProperty(u,"toString",{configurable:!0,enumerable:!0,writable:!0,value:function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e}}),Object.defineProperty(u.people,"toString",{configurable:!0,enumerable:!0,writable:!0,value:function(){return u.toString(1)+".people (stub)"}}),o="init capture register register_once register_for_session unregister unregister_for_session getFeatureFlag getFeatureFlagResult isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSessionId getSurveys getActiveMatchingSurveys renderSurvey canRenderSurvey getNextSurveyStep identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty createPersonProfile opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing clear_opt_in_out_capturing debug".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
// The project token is write-only and meant to ship in public pages.
window.posthog.init("phc_r27v8tfk5zd9AVat9hEHu2Ev7RMynSYZxnbXxf5Znewb", {
api_host: "https://us.i.posthog.com",
defaults: "2026-05-30",
});
})();
1 change: 1 addition & 0 deletions cloudflare/map-site/public/blake2b/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&family=Newsreader:ital,wght@0,400;0,500;1,400&display=swap">
<link rel="stylesheet" href="/assets/hub.css?v=7">
<script src="/assets/js.js"></script>
<script src="/assets/analytics.js?v=1" defer></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand Down
1 change: 1 addition & 0 deletions cloudflare/map-site/public/ecosystem/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&family=Newsreader:ital,wght@0,400;0,500;1,400&display=swap">
<link rel="stylesheet" href="/assets/hub.css?v=7">
<script src="/assets/js.js"></script>
<script src="/assets/analytics.js?v=1" defer></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand Down
1 change: 1 addition & 0 deletions cloudflare/map-site/public/faq/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&family=Newsreader:ital,wght@0,400;0,500;1,400&display=swap">
<link rel="stylesheet" href="/assets/hub.css?v=7">
<script src="/assets/js.js"></script>
<script src="/assets/analytics.js?v=1" defer></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand Down
1 change: 1 addition & 0 deletions cloudflare/map-site/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&family=Newsreader:ital,wght@0,400;0,500;1,400&display=swap">
<link rel="stylesheet" href="/assets/hub.css?v=7">
<script src="/assets/js.js"></script>
<script src="/assets/analytics.js?v=1" defer></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand Down
1 change: 1 addition & 0 deletions cloudflare/map-site/public/key/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&family=Newsreader:ital,wght@0,400;0,500;1,400&display=swap">
<link rel="stylesheet" href="/assets/hub.css?v=7">
<script src="/assets/js.js"></script>
<script src="/assets/analytics.js?v=1" defer></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand Down
1 change: 1 addition & 0 deletions cloudflare/map-site/public/learn/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&family=Newsreader:ital,wght@0,400;0,500;1,400&display=swap">
<link rel="stylesheet" href="/assets/hub.css?v=7">
<script src="/assets/js.js"></script>
<script src="/assets/analytics.js?v=1" defer></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand Down
1 change: 1 addition & 0 deletions cloudflare/map-site/public/map/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<link href="https://fonts.googleapis.com/css2?family=Antonio:wght@400;600;700&family=Orbitron:wght@500;700;900&family=Share+Tech+Mono&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./style.css?v=4">
<link rel="modulepreload" href="./vendor/build/three.module.min.js">
<script src="/assets/analytics.js?v=1" defer></script>
<!-- three.js is served from here, not a CDN: an import map carries no integrity check, so a CDN
compromise would have run arbitrary code on this origin. It also saves a DNS and TLS
handshake on first load, and the minified build is about half the size of the one we used. -->
Expand Down
1 change: 1 addition & 0 deletions cloudflare/map-site/public/stream/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<link rel="stylesheet" href="/assets/hub.css?v=7">
<link rel="stylesheet" href="/stream/stream.css?v=1">
<script src="/assets/js.js"></script>
<script src="/assets/analytics.js?v=1" defer></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
Expand Down
4 changes: 4 additions & 0 deletions cloudflare/map-site/scripts/lastmod-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Commits that edited hub pages without changing their words. sitemap-lastmod.mjs skips them when
# it dates a page. One full commit hash per line; say what the commit did in a comment above it.
# 2026-10-19: GA4 and PostHog tag on every page, CSP for them (no words changed)
7ab669deeed250064fe30f0b4c0d8b2fcb5904e0
15 changes: 12 additions & 3 deletions cloudflare/map-site/scripts/sitemap-lastmod.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,24 @@ function pageFiles(loc) {
return [join("public", pathname.replace(/^\/|\/$/g, ""), "index.html")];
}

// Commits that touched every page without changing what it says (an analytics tag, a CSP), listed
// in lastmod-ignore-revs like .git-blame-ignore-revs, so they do not move lastmod. Merge such a PR
// with a merge commit: a squash or rebase gives the commit a new hash and the dates move after all.
const ignored = new Set(
readFileSync(join(here, "scripts", "lastmod-ignore-revs"), "utf8")
.split("\n").map((l) => l.replace(/#.*/, "").trim()).filter(Boolean),
);

// Local calendar date, the same one git's %cs prints for a commit made here.
const today = () => new Date().toLocaleDateString("en-CA");

function lastChanged(files) {
const dirty = execFileSync("git", ["status", "--porcelain", "--", ...files], { cwd: here, encoding: "utf8" }).trim();
if (dirty) return today();
const date = execFileSync("git", ["log", "-1", "--format=%cs", "--", ...files], { cwd: here, encoding: "utf8" }).trim();
if (!date) throw new Error(`no git history for ${files.join(", ")}; add the page to RENDERED or commit it`);
return date;
const log = execFileSync("git", ["log", "--format=%H %cs", "--", ...files], { cwd: here, encoding: "utf8" }).trim();
if (!log) throw new Error(`no git history for ${files.join(", ")}; add the page to RENDERED or commit it`);
const commits = log.split("\n").map((l) => l.split(" "));
return (commits.find(([hash]) => !ignored.has(hash)) || commits.at(-1))[1];
}

const xml = readFileSync(sitemapPath, "utf8");
Expand Down
1 change: 1 addition & 0 deletions cloudflare/map-site/scripts/test-indexing.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ for (const url of urls) {
assert.ok(html.includes(`rel="canonical" href="${url}"`), url);
assert.ok(!/<meta[^>]+name="robots"[^>]+noindex/i.test(html), url);
assert.ok(/<h1\b/.test(html), url);
assert.ok(html.includes('<script src="/assets/analytics.js?v=1" defer></script>'), `${url}: no analytics`);
}
for (const path of ['/naughtylist', '/naughtylist/index.html']) {
const r = await worker.fetch(new Request('https://lazarus-xbt.xyz'+path+'?pool=Lazarus'), {}, {});
Expand Down
Loading
Loading