mykiwi/mykiwi.blogpublic Fork
⑂ ff80112
Commits
⬇ Clone ▾
git clone https://git.rickub.com/mykiwi/mykiwi.blog.git
git clone ssh://git@rickub.com/mykiwi/mykiwi.blog.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

Send GoatCounter hits to stats.mykiwi.blog

Add the stats CNAME to GoatCounter in infra (DNS-only so GoatCounter can issue its own certificate) and point the count endpoint at it. count.js stays on gc.zgo.at: the custom domain serves an HTML page at /count.js, not the script.
Romain Gautier committed 2026-09-24T09:46:42+02:00 Browse files
ff80112 parent: bda94bb
modified blog/layouts/_default/baseof.html +1 -1
@@ -344,7 +344,7 @@
344344 });
345345 })();
346346 </script>
347- <script data-goatcounter="https://mykiwi.goatcounter.com/count"
347+ <script data-goatcounter="https://stats.mykiwi.blog/count"
348348 async src="//gc.zgo.at/count.js"></script>
349349 {{- /* count.js only sees the first full load; hx-boost navigations after
350350 that never reload <head>, so each one is reported by hand. The initial
@@ -344,7 +344,7 @@
344 });344 });
345 })();345 })();
346 </script>346 </script>
347- <script data-goatcounter="https://mykiwi.goatcounter.com/count"347+ <script data-goatcounter="https://stats.mykiwi.blog/count"
348 async src="//gc.zgo.at/count.js"></script>348 async src="//gc.zgo.at/count.js"></script>
349 {{- /* count.js only sees the first full load; hx-boost navigations after349 {{- /* count.js only sees the first full load; hx-boost navigations after
350 that never reload <head>, so each one is reported by hand. The initial350 that never reload <head>, so each one is reported by hand. The initial
modified infra/main.tf +11 -0
@@ -61,6 +61,17 @@ resource "cloudflare_record" "www" {
6161 proxied = true
6262 }
6363
64+# stats.mykiwi.blog -> GoatCounter, so the analytics endpoint is first-party.
65+# Not proxied: GoatCounter terminates TLS itself and issues the certificate
66+# for this hostname, which it can't do from behind Cloudflare's edge.
67+resource "cloudflare_record" "stats" {
68+ zone_id = data.cloudflare_zone.this.id
69+ name = "stats"
70+ type = "CNAME"
71+ content = "mykiwi.goatcounter.com"
72+ proxied = false
73+}
74+
6475 # Page Rules would also do this but its Edit permission only shows up in
6576 # the API token builder for account Super Administrators - Single Redirects
6677 # (this resource) works with a normal scoped token (Zone:Dynamic Redirect:Edit).
@@ -61,6 +61,17 @@ resource "cloudflare_record" "www" {
61 proxied = true61 proxied = true
62 }62 }
63 63
64+# stats.mykiwi.blog -> GoatCounter, so the analytics endpoint is first-party.
65+# Not proxied: GoatCounter terminates TLS itself and issues the certificate
66+# for this hostname, which it can't do from behind Cloudflare's edge.
67+resource "cloudflare_record" "stats" {
68+ zone_id = data.cloudflare_zone.this.id
69+ name = "stats"
70+ type = "CNAME"
71+ content = "mykiwi.goatcounter.com"
72+ proxied = false
73+}
74+
64 # Page Rules would also do this but its Edit permission only shows up in75 # Page Rules would also do this but its Edit permission only shows up in
65 # the API token builder for account Super Administrators - Single Redirects76 # the API token builder for account Super Administrators - Single Redirects
66 # (this resource) works with a normal scoped token (Zone:Dynamic Redirect:Edit).77 # (this resource) works with a normal scoped token (Zone:Dynamic Redirect:Edit).