Don't use version for cache control

This commit is contained in:
Alexandre Aubin 2019-03-22 19:29:16 +01:00
parent bbb8db97b1
commit 9b4110e72d
3 changed files with 8 additions and 6 deletions

6
debian/postinst vendored
View file

@ -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:

4
debian/rules vendored
View file

@ -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

View file

@ -7,9 +7,9 @@
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, width=device-width, height=device-height" />
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" media="screen" href="dist/css/style.min.css?version=VERSION">
<link rel="stylesheet" media="screen" href="dist/css/style.min.css?version=RANDOMHASH">
<link rel="shortcut icon" href="dist/img/ynhadmin_icon.png">
<script type="text/javascript" src="dist/js/script.min.js?version=VERSION"></script>
<script type="text/javascript" src="dist/js/script.min.js?version=RANDOMHASH"></script>
</head>
<body>