From 9b4110e72d046b7d06d682028e6f61ca30e46f43 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 22 Mar 2019 19:29:16 +0100 Subject: [PATCH 1/2] 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 @@ - + - + From a67bab334cbcf7bd1446f357a16160a8df6d5a77 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 2 Apr 2019 16:09:36 +0200 Subject: [PATCH 2/2] Fix quotes preventing var interpretation + RANDOMHASH -> RANDOMID (it's not really a hash strictly speaking) --- debian/postinst | 6 +++--- src/index.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/postinst b/debian/postinst index c21cd330..4c40d718 100644 --- a/debian/postinst +++ b/debian/postinst @@ -11,11 +11,11 @@ do_configure() { # Set document root permissions chown -R root:root /usr/share/yunohost/admin - # Replace RANDOMHASH with a random hash to invalidate + # Replace RANDOMID 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 + RANDOMID=$(openssl rand -hex 4) + sed -i "s/RANDOMID/$RANDOMID/g" /usr/share/yunohost/admin/index.html } # summary of how this script can be called: diff --git a/src/index.html b/src/index.html index 868b9708..4d032f17 100644 --- a/src/index.html +++ b/src/index.html @@ -7,9 +7,9 @@ - + - +