diff options
| -rw-r--r-- | docs/POLICY.txt | 9 | ||||
| -rw-r--r-- | src/render.rs | 2 | ||||
| -rw-r--r-- | web/index.html | 4 | ||||
| -rw-r--r-- | 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 <https://www.gnu.org/licenses/>. <title>Doan Luu Duc Tai</title> - <link rel="stylesheet" href="styles.css"> + <link rel="stylesheet" href="/styles.css?v=ef54dd8d9908ae8682c273d84377d322935874c3d491d9cc656f4485c5e795a1"> </head> <body> @@ -77,7 +77,7 @@ ________________________________________________________________________________ <a href="{{CHAT_PUBLIC_ORIGIN}}/">{{CHAT_HOST}}</a> -* A home-grown experimental messenger. <span class="librejs-note"><a href="https://www.gnu.org/software/librejs/" aria-describedby="chat-js-warning">LibreJS-compliant</a><span class="librejs-warning" id="chat-js-warning" role="tooltip">LibreJS 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.</span></span>. Know its <a href="{{CHAT_PUBLIC_ORIGIN}}/LIMITATIONS.txt">limitations</a>. +* A home-grown experimental messenger. <span class="librejs-note"><a href="https://www.gnu.org/software/librejs/" aria-describedby="chat-js-warning">LibreJS-compliant</a><span class="librejs-warning" id="chat-js-warning" role="tooltip" hidden>LibreJS 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.</span></span>. Know its <a href="{{CHAT_PUBLIC_ORIGIN}}/LIMITATIONS.txt">limitations</a>. </pre> 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 <https://www.gnu.org/licenses/>. <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>Message Me — Doan Luu Duc Tai</title> - <link rel="stylesheet" href="/styles.css"> + <link rel="stylesheet" href="/styles.css?v=ef54dd8d9908ae8682c273d84377d322935874c3d491d9cc656f4485c5e795a1"> </head> <body> <div id="page"> |
