From b8e0d6a1fe15f3d0ee0dc9a51a62e4b2bc2c73cd Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 22 Mar 2021 16:50:33 +0530 Subject: [PATCH 1/5] remove a duplicated attribute, lint compliance --- www/common/application_config_internal.js | 1 - www/common/inner/access.js | 1 - 2 files changed, 2 deletions(-) diff --git a/www/common/application_config_internal.js b/www/common/application_config_internal.js index e119b3e5e..9b3eaed26 100644 --- a/www/common/application_config_internal.js +++ b/www/common/application_config_internal.js @@ -196,7 +196,6 @@ define(function() { // a different page (Drive, Settings, etc.) or try to create a new pad themselves. You can disable // the driveless mode by changing the following value to "false" config.allowDrivelessMode = true; - config.allowDrivelessMode = true; return config; }); diff --git a/www/common/inner/access.js b/www/common/inner/access.js index 95450e073..47b04a5c4 100644 --- a/www/common/inner/access.js +++ b/www/common/inner/access.js @@ -941,7 +941,6 @@ define([ _href = Hash.hashToHref(newHash, parsed.type); } - var reload = false; // Trigger a page reload if the href didn't change if (_href === href) { _href = undefined; } From 5eddb41d776885f79919891c55984db9a092141a Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 22 Mar 2021 16:51:11 +0530 Subject: [PATCH 2/5] add more background info for some protocol semantics --- lib/hk-util.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/hk-util.js b/lib/hk-util.js index 0d8d6224f..da08fcd8b 100644 --- a/lib/hk-util.js +++ b/lib/hk-util.js @@ -685,6 +685,14 @@ const handleGetHistory = function (Env, Server, seq, userId, parsed) { // If we're asking for a specific version (lastKnownHash) but we receive an // ENOENT, this is not a pad creation so we need to abort. if (err && err.code === 'ENOENT' && lastKnownHash) { +/* + This informs clients that the pad they're trying to load was deleted by its owner. + The user in question might be reconnecting or might have loaded the document from their cache. + The owner that deleted it could be another user or the same user from a different device. + Either way, the respectful thing to do is display an error screen informing them that the content + is no longer on the server so they don't abuse the data and so that they don't unintentionally continue + to edit it in a broken state. +*/ const parsedMsg2 = {error:'EDELETED', channel: channelName, txid: txid}; Server.send(userId, [0, HISTORY_KEEPER_ID, 'MSG', userId, JSON.stringify(parsedMsg2)]); return; From 0dedaa34cf7ce5b3ba5f3ac8ff81169d1636f29c Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 22 Mar 2021 16:51:25 +0530 Subject: [PATCH 3/5] more changes --- CHANGELOG.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dd0f5091..644be1c35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ * websockets * sandbox CSP * login block + * recommend against trailing slashes for configured domains + * remove slashes in server.js anyway * admin page * support responses to closed tickets * collapse very long messages @@ -24,7 +26,9 @@ * display survey URL * support 'KB' in Util.magnitudeOfBytes * degraded mode - * decide on a number + * decide on a number: 8 + * provide an easy way to change it (application_config.js) + * inform users what the limit is (when degraded mode "kicks in") * sheets * fix naming collisions between images in spreadsheets * degraded mode not supported @@ -44,6 +48,16 @@ * nodrive * load anonymous accounts without creating a drive * faster load time, less junk on the server + * `AppConfig.allowDrivelessMode` + * cursor color is randomly generated each time and doesn't persist after creating a drive +* secure iframe now always knows the channel of the related document + * more consistent API with other APPs +* debug app doesn't create a drive +* implement/fix ability to destroy pads whether they exist in your drive or not + + +* Known issues + * change password for documents in your drive when you don't have the most recent password (multi-owner pads) # 4.2.1 From 4762cbf491fcfcabda4dadc750047bf6b68d9636 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 22 Mar 2021 17:54:39 +0530 Subject: [PATCH 4/5] preserve data stored in the hash when navigating to register from login --- www/login/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/login/main.js b/www/login/main.js index 768c012a8..5023e0b19 100644 --- a/www/login/main.js +++ b/www/login/main.js @@ -70,7 +70,8 @@ define([ if ($uname.val()) { localStorage.login_user = $uname.val(); } - window.location.href = '/register/'; + var hash = (window.location.hash || '').replace(/\/login\//, '/register/'); + window.location.href = '/register/' + hash; }); Test(function (t) { From 56c095a6c84b3adce5fee4e203c521dec961a66f Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 22 Mar 2021 17:55:23 +0530 Subject: [PATCH 5/5] don't distribute a default survey for all instances --- www/common/application_config_internal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/application_config_internal.js b/www/common/application_config_internal.js index 9b3eaed26..0f91ea447 100644 --- a/www/common/application_config_internal.js +++ b/www/common/application_config_internal.js @@ -162,7 +162,7 @@ define(function() { // making it much faster to open new tabs. config.disableWorkers = false; - config.surveyURL = "https://survey.cryptpad.fr/index.php/672782"; + //config.surveyURL = ""; // Teams are always loaded during the initial loading screen (for the first tab only if // SharedWorkers are available). Allowing users to be members of multiple teams can