site: first-party, cookieless visit stats (self-hosted Umami at storebound.dev/s/, Do Not Track respected) with events for copy buttons, desktop downloads per OS, the teaser (play, 50 %, complete) and outbound docs / git / npm links; a privacy note in the footer; docs/site-analytics.md and tools/vds/ configs to rebuild the server side; scrub allows a page's public stats website id

This commit is contained in:
CRTkafa 2026-10-14 11:11:13 +08:00
parent 83c14d3a8e
commit 34c2fa22e5
7 changed files with 129 additions and 3 deletions

View file

@ -0,0 +1,26 @@
# stats.crt.fyi: the Umami dashboard (/opt/umami, 127.0.0.1:3920). Behind Cloudflare (*.crt.fyi wildcard DNS + cert).
<VirtualHost *:80>
ServerName stats.crt.fyi
Redirect permanent / https://stats.crt.fyi/
</VirtualHost>
<VirtualHost *:443>
ServerName stats.crt.fyi
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/crt.fyi/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/crt.fyi/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
Header always set Strict-Transport-Security "max-age=63072000"
Header always set X-Robots-Tag "noindex, nofollow"
ProxyRequests Off
ProxyPreserveHost On
RemoteIPHeader CF-Connecting-IP
# RemoteIPTrustedProxy lines from https://www.cloudflare.com/ips-v4 and ips-v6 (docs/site-analytics.md)
Include /etc/apache2/cloudflare-trusted-proxies.conf
RequestHeader set X-Sb-Client "expr=%{REMOTE_ADDR}"
RequestHeader set X-Forwarded-Proto "https"
Header always set Cache-Control "no-store"
ProxyPass / http://127.0.0.1:3920/ retry=0 timeout=60
ProxyPassReverse / http://127.0.0.1:3920/
ErrorLog ${APACHE_LOG_DIR}/stats.crt.fyi-error.log
CustomLog ${APACHE_LOG_DIR}/stats.crt.fyi-access.log combined
</VirtualHost>

View file

@ -0,0 +1,16 @@
# storebound.dev first-party stats (Umami in /opt/umami on 127.0.0.1:3920), included in the :443 vhost.
# Neutral paths only: /s/p.js (script) and /s/e (collect). See docs/site-analytics.md.
# The real visitor IP: only Cloudflare may set CF-Connecting-IP; Umami reads it from X-Sb-Client.
RemoteIPHeader CF-Connecting-IP
# RemoteIPTrustedProxy lines from https://www.cloudflare.com/ips-v4 and ips-v6 (docs/site-analytics.md)
Include /etc/apache2/cloudflare-trusted-proxies.conf
ProxyRequests Off
<Location "/s/p.js">
ProxyPass http://127.0.0.1:3920/p.js retry=0 timeout=10
Header set Cache-Control "public, max-age=3600"
</Location>
<Location "/s/e">
ProxyPass http://127.0.0.1:3920/e retry=0 timeout=10
RequestHeader set X-Sb-Client "expr=%{REMOTE_ADDR}"
Header always set Cache-Control "no-store"
</Location>