From e0bfd8bd4991c898d008b433977a922e843ab354 Mon Sep 17 00:00:00 2001 From: Doan Luu Duc Tai Date: Sat, 31 Oct 2026 08:16:47 -0500 Subject: Version site CSS and hide tooltip text before styles load --- docs/POLICY.txt | 9 +++++++++ src/render.rs | 2 ++ web/index.html | 4 ++-- web/message/index.html | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/POLICY.txt b/docs/POLICY.txt index 442d068..16d97c2 100644 --- a/docs/POLICY.txt +++ b/docs/POLICY.txt @@ -83,3 +83,12 @@ PORTABILITY Generated third-party legal texts retain upstream whitespace and line endings. .gitattributes exempts only THIRD-PARTY-LICENSES.html from whitespace errors; first-party source checks remain strict. Workspace audits include every member. + +STATIC ASSET CACHING + + Main-site stylesheet links include the SHA-256 of web/styles.css as a query + version. Update both website templates when CSS changes. The render test + checks that the published URL matches the current stylesheet, preventing + old cached CSS from being paired with new markup. Tooltip text carries the + native hidden attribute as well as CSS visibility rules, so a stylesheet + failure cannot expose it as ordinary page text. diff --git a/src/render.rs b/src/render.rs index 5171753..dea7e28 100644 --- a/src/render.rs +++ b/src/render.rs @@ -98,6 +98,8 @@ mod tests { assert!(!caddy.contains("do-not-publish")); let homepage = fs::read_to_string(output.join("web/index.html"))?; assert!(homepage.contains("https://git.example.net:8443")); + let stylesheet = files::hash_file(&root.path().join("web/styles.css"))?; + assert!(homepage.contains(&format!("/styles.css?v={stylesheet}"))); assert!(homepage.contains("https://chat.doan.luuduct.ai:8443/LIMITATIONS.txt")); settings.mode = Mode::Local; settings.port = 8180; diff --git a/web/index.html b/web/index.html index 825e48e..0c7ff51 100644 --- a/web/index.html +++ b/web/index.html @@ -22,7 +22,7 @@ along with this program. If not, see . Doan Luu Duc Tai - + @@ -77,7 +77,7 @@ ________________________________________________________________________________ {{CHAT_HOST}} -* A home-grown experimental messenger. LibreJS-compliantLibreJS compliance concerns software freedom, not a guarantee of privacy or security. Review the source code, dependencies, and scripts delivered to your browser. Server-delivered code can change between visits; free software can still track users or behave maliciously.. Know its limitations. +* A home-grown experimental messenger. LibreJS-compliant. Know its limitations. diff --git a/web/message/index.html b/web/message/index.html index dbab7cf..cc64787 100644 --- a/web/message/index.html +++ b/web/message/index.html @@ -20,7 +20,7 @@ along with this program. If not, see . Message Me — Doan Luu Duc Tai - +
-- cgit v1.2.3