From 9b4110e72d046b7d06d682028e6f61ca30e46f43 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 22 Mar 2019 19:29:16 +0100 Subject: [PATCH] Don't use version for cache control --- debian/postinst | 6 ++++++ debian/rules | 4 ---- src/index.html | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/debian/postinst b/debian/postinst index 67360059..c21cd330 100644 --- a/debian/postinst +++ b/debian/postinst @@ -10,6 +10,12 @@ do_configure() { # Set document root permissions chown -R root:root /usr/share/yunohost/admin + + # Replace RANDOMHASH with a random hash to invalidate + # old cache ... we generate this locally on each machine + # to avoid leaking stuff like the version + RANDOMHASH=$(openssl rand -hex 4) + sed -i 's/RANDOMHASH/$RANDOMHASH/g' /usr/share/yunohost/admin/index.html } # summary of how this script can be called: diff --git a/debian/rules b/debian/rules index b0315118..3cd60cb6 100755 --- a/debian/rules +++ b/debian/rules @@ -15,10 +15,6 @@ TMPDIR = $$(pwd)/debian/yunohost-admin dh $@ override_dh_auto_build: - # Replace VERSION with current package version to prevent web browser - # to serve old css/js files - sed -i 's/VERSION/$(DEBVERS)/g' src/index.html - # Run npm/bower/gulp cd src ; npm --progress false --loglevel warn --color false install cd src ; node_modules/gulp/bin/gulp.js build diff --git a/src/index.html b/src/index.html index 6577bcfe..868b9708 100644 --- a/src/index.html +++ b/src/index.html @@ -7,9 +7,9 @@ - + - +