From 320bc0fe067157f0017a8bf54be70ee5655c6f21 Mon Sep 17 00:00:00 2001 From: antelle Date: Thu, 10 Oct 2019 23:49:51 +0200 Subject: [PATCH 01/11] fix #1292: macOS app notarization --- Gruntfile.js | 22 ++++++++++++++-------- build/util/hook-rcedit.js | 4 ++-- grunt.tasks.js | 3 +-- package/osx/entitlements.mac.plist | 12 ++++++++++++ release-notes.md | 3 +++ 5 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 package/osx/entitlements.mac.plist diff --git a/Gruntfile.js b/Gruntfile.js index c8d427de..419e7ba7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -6,6 +6,7 @@ const path = require('path'); const webpackConfig = require('./build/webpack.config'); const pkg = require('./package.json'); const hookRcedit = require('./build/util/hook-rcedit'); +const codeSignConfig = require('../keys/codesign'); hookRcedit.setup(); @@ -276,7 +277,19 @@ module.exports = function(grunt) { icon: 'graphics/icon.icns', appBundleId: 'net.antelle.keeweb', appCategoryType: 'public.app-category.productivity', - extendInfo: 'package/osx/extend.plist' + extendInfo: 'package/osx/extend.plist', + osxSign: { + identity: codeSignConfig.identities.app, + hardenedRuntime: true, + entitlements: 'package/osx/entitlements.mac.plist', + 'entitlements-inherit': 'package/osx/entitlements.mac.plist', + 'gatekeeper-assess': false + }, + osxNotarize: { + appleId: codeSignConfig.appleId, + appleIdPassword: '@keychain:AC_PASSWORD', + ascProvider: codeSignConfig.teamId + } } }, win32: { @@ -296,13 +309,6 @@ module.exports = function(grunt) { } }, codesign: { - app: { - options: { - identity: 'app', - deep: true - }, - src: ['tmp/desktop/KeeWeb-darwin-x64/KeeWeb.app'] - }, dmg: { options: { identity: 'app' diff --git a/build/util/hook-rcedit.js b/build/util/hook-rcedit.js index 035ae44b..46f27779 100644 --- a/build/util/hook-rcedit.js +++ b/build/util/hook-rcedit.js @@ -4,7 +4,7 @@ const childProcess = require('child_process'); const childProcessSpawn = childProcess.spawn; -function hookedSpawn(command, options) { +function hookedSpawn(command, options, ...args) { if (command === 'wine') { options = options.map(option => { if (option.includes(' ')) { @@ -13,7 +13,7 @@ function hookedSpawn(command, options) { return option; }); } - return childProcessSpawn.call(childProcess, command, options); + return childProcessSpawn.call(childProcess, command, options, ...args); } module.exports.setup = function() { diff --git a/grunt.tasks.js b/grunt.tasks.js index de569bdd..10185910 100644 --- a/grunt.tasks.js +++ b/grunt.tasks.js @@ -40,8 +40,7 @@ module.exports = function(grunt) { 'copy:desktop-darwin-installer', 'copy:desktop-windows-helper-ia32', 'copy:desktop-windows-helper-x64', - 'chmod:linux-desktop-x64', - 'codesign:app' + 'chmod:linux-desktop-x64' ]); grunt.registerTask('build-desktop-archives', [ diff --git a/package/osx/entitlements.mac.plist b/package/osx/entitlements.mac.plist new file mode 100644 index 00000000..38c887b2 --- /dev/null +++ b/package/osx/entitlements.mac.plist @@ -0,0 +1,12 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.allow-dyld-environment-variables + + + diff --git a/release-notes.md b/release-notes.md index 64f66c1b..f7cb8eef 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,5 +1,8 @@ Release notes ------------- +##### v1.11.8 (2019-10-10) +`-` fix #1292: macOS app notarization + ##### v1.11.7 (2019-10-08) `-` fix #1289: crash on Auto sorting mode `-` fix #1288: issues when opening a file during in auto-type mode From 6010bf0ba937d4eb462d059b6f24ccc3e6abf6c7 Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Fri, 11 Oct 2019 18:49:18 +0900 Subject: [PATCH 02/11] remove duplicate apple-mobile-web-app-capable meta tag the meta tag: ` ` was appearing twice --- app/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/app/index.html b/app/index.html index 0dcb0c90..669a2cce 100644 --- a/app/index.html +++ b/app/index.html @@ -11,7 +11,6 @@ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> - From 7b4953a0490dd4ce6ce500f221908f16e136d6c4 Mon Sep 17 00:00:00 2001 From: Thoralf Rickert-Wendt Date: Fri, 11 Oct 2019 17:33:50 +0200 Subject: [PATCH 03/11] #1298 add variable to define a custom configuration within docker --- package/docker/entrypoint.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/docker/entrypoint.sh b/package/docker/entrypoint.sh index 95f0332a..afaa8262 100644 --- a/package/docker/entrypoint.sh +++ b/package/docker/entrypoint.sh @@ -31,6 +31,11 @@ then -days 3650 -nodes -sha256 fi +if [ ${KEEWEB_CONFIG_URL} ] +then + sed -i /\(no content\)/${KEEWEB_CONFIG_URL}/g keeweb/index.html +fi + # exec CMD echo ">> exec docker CMD" echo "$@" From 16612bface99dd0f199985581077a296684e00d2 Mon Sep 17 00:00:00 2001 From: Thoralf Rickert-Wendt Date: Fri, 11 Oct 2019 17:45:54 +0200 Subject: [PATCH 04/11] #1298 using url conform delimiter --- package/docker/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/docker/entrypoint.sh b/package/docker/entrypoint.sh index afaa8262..8f6e3e86 100644 --- a/package/docker/entrypoint.sh +++ b/package/docker/entrypoint.sh @@ -33,7 +33,7 @@ fi if [ ${KEEWEB_CONFIG_URL} ] then - sed -i /\(no content\)/${KEEWEB_CONFIG_URL}/g keeweb/index.html + sed -i "s,(no-config),${KEEWEB_CONFIG_URL}," keeweb/index.html fi # exec CMD From 9679841e221b95a013b317760f9de482cc0136ed Mon Sep 17 00:00:00 2001 From: Thoralf Rickert-Wendt Date: Fri, 11 Oct 2019 17:49:16 +0200 Subject: [PATCH 05/11] #1298 wrong path --- package/docker/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/docker/entrypoint.sh b/package/docker/entrypoint.sh index 8f6e3e86..1991cd94 100644 --- a/package/docker/entrypoint.sh +++ b/package/docker/entrypoint.sh @@ -33,7 +33,7 @@ fi if [ ${KEEWEB_CONFIG_URL} ] then - sed -i "s,(no-config),${KEEWEB_CONFIG_URL}," keeweb/index.html + sed -i "s,(no-config),${KEEWEB_CONFIG_URL}," /keeweb/index.html fi # exec CMD From 3eca440e0c9e09ab912a1a37841a8f86efa24d10 Mon Sep 17 00:00:00 2001 From: antelle Date: Fri, 11 Oct 2019 20:26:14 +0200 Subject: [PATCH 06/11] fix #1296: search in auto-type --- app/scripts/comp/browser/key-handler.js | 2 +- app/scripts/views/open-view.js | 5 ++++- release-notes.md | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/scripts/comp/browser/key-handler.js b/app/scripts/comp/browser/key-handler.js index 5a821a36..49098e26 100644 --- a/app/scripts/comp/browser/key-handler.js +++ b/app/scripts/comp/browser/key-handler.js @@ -63,7 +63,7 @@ class KeyHandler { const keyShortcuts = this.shortcuts[code]; if (keyShortcuts && keyShortcuts.length) { for (const sh of keyShortcuts) { - if (this.modal && (sh.modal !== this.modal || sh.modal === '*')) { + if (this.modal && (sh.modal !== this.modal && sh.modal !== '*')) { e.stopPropagation(); continue; } diff --git a/app/scripts/views/open-view.js b/app/scripts/views/open-view.js index 93caccb7..4cae560c 100644 --- a/app/scripts/views/open-view.js +++ b/app/scripts/views/open-view.js @@ -70,7 +70,10 @@ class OpenView extends View { KeyHandler.setModal('open'); this.once('remove', () => { this.passwordInput.reset(); - KeyHandler.setModal(null); + if (KeyHandler.modal !== 'auto-type') { + // TODO: refactor this + KeyHandler.setModal(null); + } }); } diff --git a/release-notes.md b/release-notes.md index f7cb8eef..20a0ce0f 100644 --- a/release-notes.md +++ b/release-notes.md @@ -2,6 +2,7 @@ Release notes ------------- ##### v1.11.8 (2019-10-10) `-` fix #1292: macOS app notarization +`-` fix #1296: search in auto-type ##### v1.11.7 (2019-10-08) `-` fix #1289: crash on Auto sorting mode From 29c3e98c05f8afe3fd1308ad3182bb100a5a9ebf Mon Sep 17 00:00:00 2001 From: antelle Date: Fri, 11 Oct 2019 20:56:35 +0200 Subject: [PATCH 07/11] fixed issues with some theme plugins --- app/scripts/plugins/theme-vars.js | 5 ++--- release-notes.md | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/scripts/plugins/theme-vars.js b/app/scripts/plugins/theme-vars.js index b4db4f6b..d6c65a33 100644 --- a/app/scripts/plugins/theme-vars.js +++ b/app/scripts/plugins/theme-vars.js @@ -1,8 +1,7 @@ import { Color } from 'util/data/color'; -const ThemeVarsScss = require('raw-loader!../../styles/base/_theme-vars.scss').default; -// eslint-disable-next-line import/no-commonjs -const ThemeDefaults = require('../../styles/themes/_theme-defaults.scss'); +import ThemeVarsScss from '!!raw-loader!../../styles/base/_theme-vars.scss'; +import ThemeDefaults from '!!raw-loader!../../styles/themes/_theme-defaults.scss'; const ThemeVars = { themeDefaults: null, diff --git a/release-notes.md b/release-notes.md index 20a0ce0f..82e199f4 100644 --- a/release-notes.md +++ b/release-notes.md @@ -3,6 +3,7 @@ Release notes ##### v1.11.8 (2019-10-10) `-` fix #1292: macOS app notarization `-` fix #1296: search in auto-type +`-` fixed issues with some theme plugins ##### v1.11.7 (2019-10-08) `-` fix #1289: crash on Auto sorting mode From 72b75176238bfc9acab72fc9e8200c36b91fadc4 Mon Sep 17 00:00:00 2001 From: antelle Date: Fri, 11 Oct 2019 20:57:30 +0200 Subject: [PATCH 08/11] release date --- release-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes.md b/release-notes.md index 82e199f4..a42e5467 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,6 +1,6 @@ Release notes ------------- -##### v1.11.8 (2019-10-10) +##### v1.11.8 (2019-10-11) `-` fix #1292: macOS app notarization `-` fix #1296: search in auto-type `-` fixed issues with some theme plugins From f1d5965bb57ba13b619a7943be7142c26042aa86 Mon Sep 17 00:00:00 2001 From: antelle Date: Fri, 11 Oct 2019 21:11:35 +0200 Subject: [PATCH 09/11] bump version --- desktop/package-lock.json | 2 +- desktop/package.json | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop/package-lock.json b/desktop/package-lock.json index 1b8752b8..ddcdfcf5 100644 --- a/desktop/package-lock.json +++ b/desktop/package-lock.json @@ -1,6 +1,6 @@ { "name": "KeeWeb", - "version": "1.11.7", + "version": "1.11.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/desktop/package.json b/desktop/package.json index f840846b..a4546624 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -1,6 +1,6 @@ { "name": "KeeWeb", - "version": "1.11.7", + "version": "1.11.8", "description": "Free cross-platform password manager compatible with KeePass", "main": "main.js", "homepage": "https://keeweb.info", diff --git a/package-lock.json b/package-lock.json index 12a89f85..18c0abca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "keeweb", - "version": "1.11.7", + "version": "1.11.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6ac2b397..23f8fcba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keeweb", - "version": "1.11.7", + "version": "1.11.8", "description": "Free cross-platform password manager compatible with KeePass", "main": "Gruntfile.js", "private": true, From 590035cce9fe65d96a33d948e12e130d80229f1b Mon Sep 17 00:00:00 2001 From: antelle Date: Fri, 11 Oct 2019 23:06:36 +0200 Subject: [PATCH 10/11] copying mac helpers --- Gruntfile.js | 57 +++++++++++++++++++++++++++++++++-------------- package-lock.json | 28 +++++++++++++++++++---- package.json | 1 + 3 files changed, 65 insertions(+), 21 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 419e7ba7..e84b09f4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,7 +1,8 @@ /* eslint-env node */ -const fs = require('fs'); +const fs = require('fs-extra'); const path = require('path'); +const debug = require('debug'); const webpackConfig = require('./build/webpack.config'); const pkg = require('./package.json'); @@ -9,6 +10,7 @@ const hookRcedit = require('./build/util/hook-rcedit'); const codeSignConfig = require('../keys/codesign'); hookRcedit.setup(); +debug.enable('electron-notarize'); module.exports = function(grunt) { require('time-grunt')(grunt); @@ -126,21 +128,6 @@ module.exports = function(grunt) { dest: 'tmp/desktop/KeeWeb-win32-x64/Resources/', nonull: true }, - 'desktop-darwin-helper-x64': { - src: 'helper/darwin/KeeWebHelper', - dest: 'tmp/desktop/KeeWeb-darwin-x64/KeeWeb.app/Contents/Resources/', - nonull: true, - options: { mode: '0755' } - }, - 'desktop-darwin-installer': { - cwd: 'package/osx/KeeWeb Installer.app', - dest: - 'tmp/desktop/KeeWeb-darwin-x64/KeeWeb.app/Contents/Installer/KeeWeb Installer.app', - src: '**', - expand: true, - nonull: true, - options: { mode: true } - }, 'desktop-win32-dist-x64': { src: 'tmp/desktop/KeeWeb.win.x64.exe', dest: `dist/desktop/KeeWeb-${pkg.version}.win.x64.exe`, @@ -289,7 +276,43 @@ module.exports = function(grunt) { appleId: codeSignConfig.appleId, appleIdPassword: '@keychain:AC_PASSWORD', ascProvider: codeSignConfig.teamId - } + }, + afterCopy: [ + (buildPath, electronVersion, platform, arch, callback) => { + if (path.basename(buildPath) !== 'app') { + throw new Error('Bad build path: ' + buildPath); + } + const resPath = path.dirname(buildPath); + if (path.basename(resPath) !== 'Resources') { + throw new Error('Bad Resources path: ' + resPath); + } + const helperTargetPath = path.join( + resPath, + 'helper/darwin/KeeWebHelper' + ); + const helperSourcePath = path.join( + __dirname, + 'helper/darwin/KeeWebHelper' + ); + fs.copySync(helperSourcePath, helperTargetPath); + + const contentsPath = path.dirname(resPath); + if (path.basename(contentsPath) !== 'Contents') { + throw new Error('Bad Contents path: ' + contentsPath); + } + const installerSourcePath = path.join( + __dirname, + 'package/osx/KeeWeb Installer.app' + ); + const installerTargetPath = path.join( + contentsPath, + 'Installer/KeeWeb Installer.app' + ); + fs.copySync(installerSourcePath, installerTargetPath); + + callback(); + } + ] } }, win32: { diff --git a/package-lock.json b/package-lock.json index 18c0abca..57ea4d9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3894,6 +3894,16 @@ "ms": "^2.1.1" } }, + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "sumchecker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-2.0.2.tgz", @@ -5298,11 +5308,11 @@ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, "fs-extra": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", - "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "requires": { - "graceful-fs": "^4.1.2", + "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } @@ -5870,6 +5880,16 @@ "requires": { "ms": "^2.1.1" } + }, + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } } } }, diff --git a/package.json b/package.json index 23f8fcba..81e35692 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "eslint-plugin-standard": "4.0.1", "exports-loader": "0.7.0", "font-awesome": "4.7.0", + "fs-extra": "^8.1.0", "grunt": "1.0.4", "grunt-chmod": "^1.1.1", "grunt-contrib-clean": "2.0.0", From 0fabdac9e0e11326a754f29f808a13a5d0a637b9 Mon Sep 17 00:00:00 2001 From: antelle Date: Fri, 11 Oct 2019 23:20:32 +0200 Subject: [PATCH 11/11] fixing build --- grunt.tasks.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/grunt.tasks.js b/grunt.tasks.js index 10185910..acccbe3e 100644 --- a/grunt.tasks.js +++ b/grunt.tasks.js @@ -36,8 +36,6 @@ module.exports = function(grunt) { 'electron', 'sign-exe:win32-build-x64', 'sign-exe:win32-build-ia32', - 'copy:desktop-darwin-helper-x64', - 'copy:desktop-darwin-installer', 'copy:desktop-windows-helper-ia32', 'copy:desktop-windows-helper-x64', 'chmod:linux-desktop-x64'