Merge branch 'release-1.15'

This commit is contained in:
antelle 2020-06-09 20:47:36 +02:00
commit 0c170766e5
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
8 changed files with 111 additions and 59 deletions

View File

@ -144,10 +144,13 @@ AutoTypeEmitter.prototype.modString = function () {
};
AutoTypeEmitter.prototype.runScript = function (script, callback) {
// xdotool doesn't like it when stdin doesn't end with a linebreak
// see https://github.com/keeweb/keeweb/issues/1409
const data = script + '\n';
Launcher.spawn({
cmd: 'xdotool',
args: ['-'],
data: script,
data,
complete: (err, stdout, code) => {
if (err && err.code === 'ENOENT') {
err = Locale.autoTypeErrorNotInstalled.replace('{}', 'xdotool');

View File

@ -105,7 +105,7 @@ class SettingsFileView extends View {
for (const yk of this.yubiKeys) {
for (const slot of yk.slots.filter((s) => s.valid)) {
yubiKeys.push({
value: `${yk.serial}:${slot}`,
value: `${yk.serial}:${slot.number}`,
fullName: yk.fullName,
vid: yk.vid,
pid: yk.pid,

View File

@ -1,9 +1,11 @@
const electron = require('electron');
const path = require('path');
const fs = require('fs');
const url = require('url');
let perfTimestamps = global.perfTimestamps;
perfTimestamps.push({ name: 'loading app requires', ts: process.hrtime() });
perfTimestamps?.push({ name: 'loading app requires', ts: process.hrtime() });
const app = electron.app;
@ -21,12 +23,16 @@ const portableConfigFileName = 'keeweb-portable.json';
const isDev = !__dirname.endsWith('.asar');
const startupLogging =
process.argv.some((arg) => arg.startsWith('--startup-logging')) ||
process.env.KEEWEB_STARTUP_LOGGING === '1';
const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) {
app.quit();
}
perfTimestamps?.push({ name: 'single instance lock', ts: process.hrtime() });
logProgress('single instance lock');
let usingPortableUserDataDir = false;
let execPath;
@ -36,7 +42,9 @@ setUserDataPaths();
let openFile = process.argv.filter((arg) => /\.kdbx$/i.test(arg))[0];
const htmlPath =
(isDev && process.env.KEEWEB_HTML_PATH) || 'file://' + path.join(__dirname, 'index.html');
(isDev && process.env.KEEWEB_HTML_PATH) ||
url.format({ protocol: 'file', slashes: true, pathname: path.join(__dirname, 'index.html') });
const showDevToolsOnStart =
process.argv.some((arg) => arg.startsWith('--devtools')) ||
process.env.KEEWEB_OPEN_DEVTOOLS === '1';
@ -59,7 +67,7 @@ const themeBgColors = {
};
const defaultBgColor = '#282C34';
perfTimestamps?.push({ name: 'defining args', ts: process.hrtime() });
logProgress('defining args');
setEnv();
setDevAppIcon();
@ -69,11 +77,11 @@ let appSettings;
const settingsPromise = loadSettingsEncryptionKey().then((key) => {
configEncryptionKey = key;
perfTimestamps?.push({ name: 'loading settings key', ts: process.hrtime() });
logProgress('loading settings key');
return loadConfig('app-settings').then((settings) => {
appSettings = settings ? JSON.parse(settings) : {};
perfTimestamps?.push({ name: 'reading app settings', ts: process.hrtime() });
logProgress('reading app settings');
});
});
@ -88,7 +96,7 @@ app.on('window-all-closed', () => {
}
});
app.on('ready', () => {
perfTimestamps?.push({ name: 'app on ready', ts: process.hrtime() });
logProgress('app on ready');
appReady = true;
settingsPromise
@ -191,13 +199,21 @@ app.saveConfig = saveConfig;
app.getAppMainRoot = getAppMainRoot;
app.getAppContentRoot = getAppContentRoot;
function logProgress(name) {
perfTimestamps?.push({ name, ts: process.hrtime() });
if (startupLogging) {
// eslint-disable-next-line no-console
console.log('[startup]', name);
}
}
function setSystemAppearance() {
if (process.platform === 'darwin') {
if (electron.nativeTheme.shouldUseDarkColors) {
electron.systemPreferences.appLevelAppearance = 'dark';
}
}
perfTimestamps?.push({ name: 'setting system appearance', ts: process.hrtime() });
logProgress('setting system appearance');
}
function getDefaultTheme() {
@ -219,21 +235,23 @@ function createMainWindow() {
backgroundThrottling: false,
nodeIntegration: true,
nodeIntegrationInWorker: true,
enableRemoteModule: true
enableRemoteModule: true,
spellcheck: false,
v8CacheOptions: 'none'
}
};
if (process.platform !== 'win32') {
windowOptions.icon = path.join(__dirname, 'icon.png');
}
mainWindow = new electron.BrowserWindow(windowOptions);
perfTimestamps?.push({ name: 'creating main window', ts: process.hrtime() });
logProgress('creating main window');
setMenu();
perfTimestamps?.push({ name: 'setting menu', ts: process.hrtime() });
logProgress('setting menu');
mainWindow.loadURL(htmlPath);
mainWindow.once('ready-to-show', () => {
perfTimestamps?.push({ name: 'main window ready', ts: process.hrtime() });
logProgress('main window ready');
if (startMinimized) {
emitRemoteEvent('launcher-started-minimized');
} else {
@ -241,7 +259,7 @@ function createMainWindow() {
}
ready = true;
notifyOpenFile();
perfTimestamps?.push({ name: 'main window shown', ts: process.hrtime() });
logProgress('main window shown');
reportStartProfile();
if (showDevToolsOnStart) {
@ -278,10 +296,10 @@ function createMainWindow() {
mainWindow.on('session-end', () => {
emitRemoteEvent('os-lock');
});
perfTimestamps?.push({ name: 'configuring main window', ts: process.hrtime() });
logProgress('configuring main window');
restoreMainWindowPosition();
perfTimestamps?.push({ name: 'restoring main window position', ts: process.hrtime() });
logProgress('restoring main window position');
}
function restoreMainWindow() {
@ -523,7 +541,7 @@ function setGlobalShortcuts(appSettings) {
} catch (e) {}
}
}
perfTimestamps?.push({ name: 'setting global shortcuts', ts: process.hrtime() });
logProgress('setting global shortcuts');
}
function subscribePowerEvents() {
@ -536,7 +554,7 @@ function subscribePowerEvents() {
electron.powerMonitor.on('lock-screen', () => {
emitRemoteEvent('os-lock');
});
perfTimestamps?.push({ name: 'subscribing to power events', ts: process.hrtime() });
logProgress('subscribing to power events');
}
function setUserDataPaths() {
@ -563,7 +581,7 @@ function setUserDataPaths() {
isPortable = !!JSON.parse(process.env.KEEWEB_IS_PORTABLE);
}
perfTimestamps?.push({ name: 'portable check', ts: process.hrtime() });
logProgress('portable check');
if (isPortable) {
const portableConfigDir = path.dirname(execPath);
@ -574,7 +592,7 @@ function setUserDataPaths() {
const portableUserDataDir = path.resolve(portableConfigDir, portableConfig.userDataDir);
if (!fs.existsSync(portableUserDataDir)) {
fs.mkdirSync(portableUserDataDir);
fs.mkdirSync(portableUserDataDir, { recursive: true });
}
app.setPath('userData', portableUserDataDir);
@ -582,7 +600,7 @@ function setUserDataPaths() {
}
}
perfTimestamps?.push({ name: 'userdata dir', ts: process.hrtime() });
logProgress('userdata dir');
}
function setEnv() {
@ -602,7 +620,7 @@ function setEnv() {
app.allowRendererProcessReuse = true;
perfTimestamps?.push({ name: 'setting env', ts: process.hrtime() });
logProgress('setting env');
}
// TODO: delete after v1.15
@ -654,7 +672,7 @@ function hookRequestHeaders() {
}
callback({ requestHeaders: details.requestHeaders });
});
perfTimestamps?.push({ name: 'setting request handlers', ts: process.hrtime() });
logProgress('setting request handlers');
}
// If a display is disconnected while KeeWeb is minimized, Electron does not

View File

@ -1,6 +1,6 @@
{
"name": "KeeWeb",
"version": "1.15.1",
"version": "1.5.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "KeeWeb",
"version": "1.15.1",
"version": "1.5.2",
"description": "Free cross-platform password manager compatible with KeePass",
"main": "main.js",
"homepage": "https://keeweb.info",

81
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "keeweb",
"version": "1.15.1",
"version": "1.5.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -2293,6 +2293,11 @@
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz",
"integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA=="
},
"@types/json5": {
"version": "0.0.29",
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
"integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4="
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
@ -5849,9 +5854,9 @@
}
},
"electron": {
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/electron/-/electron-9.0.2.tgz",
"integrity": "sha512-+a3KegLvQXVjC3b6yBWwZmtWp3tHf9ut27yORAWHO9JRFtKfNf88fi1UvTPJSW8R0sUH7ZEdzN6A95T22KGtlA==",
"version": "9.0.3",
"resolved": "https://registry.npmjs.org/electron/-/electron-9.0.3.tgz",
"integrity": "sha512-rY59wy50z0oWp/q69zq0UIzvtcM5j2BJbLAwEoLfVNS3DLt9wDZqRqSIBvLEBl+xWbafCnRA9haEqi7ssM94GA==",
"requires": {
"@electron/get": "^1.0.1",
"@types/node": "^12.0.12",
@ -5926,24 +5931,12 @@
}
},
"electron-notarize": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-0.3.0.tgz",
"integrity": "sha512-tuDw8H0gcDOalNLv6RM2CwGvUXU60MPGZRDEmd0ppX+yP5XqL8Ec2DuXyz9J7WQSA3aRCfzIgH8C5CAivDYWMw==",
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-1.0.0.tgz",
"integrity": "sha512-dsib1IAquMn0onCrNMJ6gtEIZn/azG8hZMCYOuZIMVMUeRMgBYHK1s5TK9P8xAcrAjh/2aN5WYHzgVSWX314og==",
"requires": {
"debug": "^4.1.1",
"fs-extra": "^8.1.0"
},
"dependencies": {
"fs-extra": {
"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.2.0",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
}
"fs-extra": "^9.0.1"
}
},
"electron-osx-sign": {
@ -6527,22 +6520,23 @@
}
},
"eslint-plugin-import": {
"version": "2.20.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz",
"integrity": "sha512-FObidqpXrR8OnCh4iNsxy+WACztJLXAHBO5hK79T1Hc77PgQZkyDGA5Ag9xAvRpglvLNxhH/zSmZ70/pZ31dHg==",
"version": "2.21.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.21.1.tgz",
"integrity": "sha512-qYOOsgUv63vHof7BqbzuD+Ud34bXHxFJxntuAC1ZappFZXYbRIek3aJ7jc9i2dHDGDyZ/0zlO0cpioES265Lsw==",
"requires": {
"array-includes": "^3.0.3",
"array.prototype.flat": "^1.2.1",
"array-includes": "^3.1.1",
"array.prototype.flat": "^1.2.3",
"contains-path": "^0.1.0",
"debug": "^2.6.9",
"doctrine": "1.5.0",
"eslint-import-resolver-node": "^0.3.2",
"eslint-module-utils": "^2.4.1",
"eslint-import-resolver-node": "^0.3.3",
"eslint-module-utils": "^2.6.0",
"has": "^1.0.3",
"minimatch": "^3.0.4",
"object.values": "^1.1.0",
"object.values": "^1.1.1",
"read-pkg-up": "^2.0.0",
"resolve": "^1.12.0"
"resolve": "^1.17.0",
"tsconfig-paths": "^3.9.0"
},
"dependencies": {
"debug": {
@ -6566,6 +6560,14 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"resolve": {
"version": "1.17.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
"integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
"requires": {
"path-parse": "^1.0.6"
}
}
}
},
@ -15376,6 +15378,27 @@
"resolved": "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz",
"integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA=="
},
"tsconfig-paths": {
"version": "3.9.0",
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz",
"integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==",
"requires": {
"@types/json5": "^0.0.29",
"json5": "^1.0.1",
"minimist": "^1.2.0",
"strip-bom": "^3.0.0"
},
"dependencies": {
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"requires": {
"minimist": "^1.2.0"
}
}
}
},
"tslib": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",

View File

@ -1,6 +1,6 @@
{
"name": "keeweb",
"version": "1.15.1",
"version": "1.5.2",
"description": "Free cross-platform password manager compatible with KeePass",
"main": "Gruntfile.js",
"private": true,
@ -29,15 +29,15 @@
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"dompurify": "^2.0.11",
"electron": "^9.0.2",
"electron": "^9.0.3",
"electron-builder": "^22.7.0",
"electron-notarize": "^0.3.0",
"electron-notarize": "^1.0.0",
"electron-osx-sign": "^0.4.16",
"eslint": "^7.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-import": "^2.21.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-promise": "4.2.1",

View File

@ -1,5 +1,13 @@
Release notes
-------------
##### v1.15.2 (2020-06-09)
`-` fix #1530: recursive creation of the portable directory
`-` fix #1530: running from directories with hash symbols
`+` possibility to debug startup with `--start-logging`
`*` updated electron version
`-` fixed duplicated YubiKeys displayed in file settings
`-` fix #1409: auto-type wrong character issues on Linux
##### v1.15.1 (2020-06-07)
`-` fix #1528: OTP generation for stored values