From 78a1c6bdbd191fce62bdcfbb8abf1b73ee8240e0 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 30 Dec 2019 12:58:26 -0500 Subject: [PATCH 1/3] prevent form autofill on the team invite modal --- www/common/common-ui-elements.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 331c15fd9..6323be780 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1639,6 +1639,11 @@ define([ h('p', Messages.team_inviteLinkTitle ), linkError = h('div.alert.alert-danger.cp-teams-invite-alert', {style : 'display: none;'}), linkForm = h('div.cp-teams-invite-form', [ + // autofill: 'off' was insufficient + // adding these two fake inputs confuses firefox and prevents unwanted form autofill + h('input', { type: 'text', style: 'display: none'}), + h('input', { type: 'password', style: 'display: none'}), + linkName = h('input', { placeholder: Messages.team_inviteLinkTempName }), From 78b54fad536c517648e6d095d75407bf13059579 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 30 Dec 2019 12:58:26 -0500 Subject: [PATCH 2/3] prevent form autofill on the team invite modal --- www/common/common-ui-elements.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 331c15fd9..6323be780 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1639,6 +1639,11 @@ define([ h('p', Messages.team_inviteLinkTitle ), linkError = h('div.alert.alert-danger.cp-teams-invite-alert', {style : 'display: none;'}), linkForm = h('div.cp-teams-invite-form', [ + // autofill: 'off' was insufficient + // adding these two fake inputs confuses firefox and prevents unwanted form autofill + h('input', { type: 'text', style: 'display: none'}), + h('input', { type: 'password', style: 'display: none'}), + linkName = h('input', { placeholder: Messages.team_inviteLinkTempName }), From a714e41d498096199b95aedaa02d5df2b0baefa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20N=C3=B6thlich?= Date: Sat, 4 Jan 2020 23:58:01 +0100 Subject: [PATCH 3/3] Log errors in faulty custom config file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CryptPAD now terminates and does not fallback to default config if the custom config is faulty. The error in the custom config is logged to the terminal now. Signed-off-by: Adrian Nöthlich --- lib/load-config.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/load-config.js b/lib/load-config.js index 80f4706dc..0756c2df4 100644 --- a/lib/load-config.js +++ b/lib/load-config.js @@ -8,7 +8,14 @@ try { console.log("You can configure the administrator email (adminEmail) in your config/config.js file"); } } catch (e) { - console.log("Config not found, loading the example config. You can customize the configuration by copying config/config.example.js to " + configPath); + if (e instanceof SyntaxError) { + console.error("config/config.js is faulty. See stacktrace below for more information. Terminating. \n"); + console.error(e.name + ": " + e.message); + console.error(e.stack.split("\n\n")[0]); + process.exit(1); + } else { + console.log("Config not found, loading the example config. You can customize the configuration by copying config/config.example.js to " + configPath); + } config = require("../config/config.example"); } module.exports = config;