From 2a7cd3574d802cfa47d50ec4a6f60421e2eece87 Mon Sep 17 00:00:00 2001 From: antelle Date: Thu, 7 Jan 2021 22:05:04 +0100 Subject: [PATCH] update.json --- Gruntfile.js | 13 ++++++------- app/manifest.appcache | 7 ------- app/scripts/const/links.js | 2 +- app/update.json | 4 ++++ grunt.tasks.js | 2 +- plugins/keeweb-plugin/keeweb-plugin.js | 6 ------ 6 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 app/manifest.appcache create mode 100644 app/update.json diff --git a/Gruntfile.js b/Gruntfile.js index 8778f397..43953b07 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -25,7 +25,6 @@ module.exports = function (grunt) { const dt = date.toISOString().replace(/T.*/, ''); const year = date.getFullYear(); - const minElectronVersionForUpdate = '11.0.3'; const zipCommentPlaceholderPart = 'zip_comment_placeholder_that_will_be_replaced_with_hash'; const zipCommentPlaceholder = zipCommentPlaceholderPart + '.'.repeat(512 - zipCommentPlaceholderPart.length); @@ -295,20 +294,20 @@ module.exports = function (grunt) { } }, 'string-replace': { - manifest: { + 'update-manifest': { options: { replacements: [ { - pattern: '# YYYY-MM-DD:v0.0.0', - replacement: '# ' + dt + ':v' + pkg.version + pattern: /"version":\s*".*?"/, + replacement: `"version": "${pkg.version}"` }, { - pattern: '# updmin:v0.0.0', - replacement: '# updmin:v' + minElectronVersionForUpdate + pattern: /"date":\s*".*?"/, + replacement: `"date": "${dt}"` } ] }, - files: { 'dist/manifest.appcache': 'app/manifest.appcache' } + files: { 'dist/update.json': 'app/update.json' } }, 'service-worker': { options: { replacements: [{ pattern: '0.0.0', replacement: pkg.version }] }, diff --git a/app/manifest.appcache b/app/manifest.appcache deleted file mode 100644 index 3dbd79dd..00000000 --- a/app/manifest.appcache +++ /dev/null @@ -1,7 +0,0 @@ -CACHE MANIFEST - -# YYYY-MM-DD:v0.0.0 -# updmin:v0.0.0 - -NETWORK: -* diff --git a/app/scripts/const/links.js b/app/scripts/const/links.js index 2d6b4bf3..52388746 100644 --- a/app/scripts/const/links.js +++ b/app/scripts/const/links.js @@ -10,7 +10,7 @@ const Links = { UpdateDesktop: 'https://github.com/keeweb/keeweb/releases/download/v{ver}/UpdateDesktop.zip', ReleaseNotes: 'https://github.com/keeweb/keeweb/blob/master/release-notes.md#release-notes', SelfHostedDropbox: 'https://github.com/keeweb/keeweb#self-hosting', - Manifest: 'https://app.keeweb.info/manifest.appcache', + UpdateJson: 'https://app.keeweb.info/update.json', AutoType: 'https://github.com/keeweb/keeweb/wiki/Auto-Type', Translation: 'https://keeweb.oneskyapp.com/', Donation: 'https://opencollective.com/keeweb#support', diff --git a/app/update.json b/app/update.json new file mode 100644 index 00000000..143e24f5 --- /dev/null +++ b/app/update.json @@ -0,0 +1,4 @@ +{ + "version": "0.0.0", + "date": "0000-00-00" +} diff --git a/grunt.tasks.js b/grunt.tasks.js index 78010849..22001ec4 100644 --- a/grunt.tasks.js +++ b/grunt.tasks.js @@ -13,7 +13,7 @@ module.exports = function (grunt) { 'csp-hashes', 'copy:content-dist', 'string-replace:service-worker', - 'string-replace:manifest', + 'string-replace:update-manifest', 'copy:dist-icons', 'copy:dist-manifest' ]); diff --git a/plugins/keeweb-plugin/keeweb-plugin.js b/plugins/keeweb-plugin/keeweb-plugin.js index 23256974..fa92e27c 100644 --- a/plugins/keeweb-plugin/keeweb-plugin.js +++ b/plugins/keeweb-plugin/keeweb-plugin.js @@ -188,10 +188,6 @@ function servePlugin(packageName) { }); } }; - const serveManifestAppCache = (res) => { - res.writeHead(200); - res.end('CACHE MANIFEST\nNETWORK:\n*\n'); - }; const serveConfig = (res) => { res.writeHead(200); res.end(`{"settings":{},"plugins":[{"url":"/"}]}`); @@ -211,8 +207,6 @@ function servePlugin(packageName) { } if (req.url === '/') { return serveKeeWebHtml(res); - } else if (req.url === '/manifest.appcache') { - return serveManifestAppCache(res); } else if (req.url === '/config.json') { return serveConfig(res); }