Commit graph

4769 commits

Author SHA1 Message Date
Richard Hansen
a7c78768a1 ExportHelper: Simplify _analyzeLine() a bit 2021-10-07 19:53:40 -04:00
Richard Hansen
d8cbd134d3 PadMessageHandler: Improve readability 2021-10-07 19:53:40 -04:00
Richard Hansen
019e296c4a lint: Fix awkward string formatting 2021-10-07 19:53:40 -04:00
Richard Hansen
044f6543a5 lint: Fix ESLint errors (mostly camelcase warnings) 2021-10-07 19:53:40 -04:00
Richard Hansen
34cfff4e4c Changeset: Delete unused code 2021-10-07 19:53:40 -04:00
Richard Hansen
eb495e9ea2 Changeset: Move out obsolete code 2021-10-07 19:53:40 -04:00
Richard Hansen
2155e216a6 tests: Remove overly agressive timeouts 2021-10-07 19:53:03 -04:00
translatewiki.net
ac3a7191cf Localisation updates from https://translatewiki.net. 2021-10-07 13:03:04 +02:00
Richard Hansen
a7734ddd94 deps: Update ueberdb2 to 1.4.18
This pulls in newer versions of some database drivers which silences
some `npm audit` security warnings.

This also adds support for PostgreSQL connection strings.
2021-10-07 03:58:35 -04:00
snyk-bot
ee610027c0
fix: upgrade terser from 5.7.2 to 5.8.0
Snyk has created this PR to upgrade terser from 5.7.2 to 5.8.0.

See this package in npm:
https://www.npmjs.com/package/terser

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=referral&page=upgrade-pr
2021-10-05 06:23:36 +00:00
Richard Hansen
e8514db365 tests: Replace manual checks with assert 2021-10-03 20:23:30 -04:00
Richard Hansen
72b12bc97b tests: Slight backend test reorganization
* Delete some useless uses of `describe()`
  * Combine some dependent tests
  * Rename some tests to avoid duplicate names
2021-10-03 20:06:33 -04:00
Richard Hansen
dd37251da4 tests: Promisify some backend tests 2021-10-03 19:25:50 -04:00
Richard Hansen
39a971e3b9 tests: Remove overly aggressive timeouts 2021-10-03 19:25:50 -04:00
John McLear
c361df52d2 bugfix: Allow selection to start/end before line marker 2021-10-02 02:41:58 -04:00
Richard Hansen
37a33042d2 ace2_inner: Improve rep documentation 2021-10-02 02:10:07 -04:00
Richard Hansen
e42e5457c1 LibreOffice: Improve logging 2021-10-01 03:01:24 -04:00
Richard Hansen
76374bc489 LibreOffice: Close stdin right away
This should prevent LibreOffice from hanging if it attempts to read
from stdin (it'll get EOF and probably exit with an error instead).
2021-10-01 03:01:24 -04:00
translatewiki.net
0c31940b09 Localisation updates from https://translatewiki.net. 2021-09-30 13:02:24 +02:00
webzwo0i
4d8ae3475d Changeset: Add documentation for textLinesMutator() 2021-09-30 12:29:24 +02:00
webzwo0i
0de41ee087 adminsettings test: Fix save detection race condition
Use MutationObserver to detect if a saveProgress event was received,
which will trigger an animation.

Before this, `helper.admin$('#response').is(':visible')` was true
after the page loaded and before clicking the Save button, so there
was a possibility that after clicking Save, but before sending the
socketio message to the server, the visibility is checked and returns
true, so the page gets reloaded before the changed settings have been
saved.
2021-09-29 23:49:16 -04:00
webzwo0i
bb0ca91dc2 adminupdateplugins test: swap assertions, increase timeout 2021-09-29 23:49:16 -04:00
webzwo0i
91d3974a0d adminsettings test: Be a little stricter for some assertions 2021-09-29 23:46:25 -04:00
webzwo0i
cc6fda6916 adminsettings test: Fix restart detection
We cannot guarantee that the system time on SauceLabs and Github is in
sync. In case the SauceLabs runner's clock is slow the test would have
failed.
2021-09-29 23:42:41 -04:00
Hossein
0e311184cf fix: change directory to etherpad root 2021-09-28 19:01:19 -04:00
Richard Hansen
aec619cc0b log4js: Deprecate the logconfig setting
This will make it possible to upgrade log4js in a future version.
2021-09-28 04:30:26 -04:00
Richard Hansen
b3b6c94b76 log4js: Initialize as early as possible 2021-09-28 04:30:26 -04:00
Richard Hansen
7653dc650d settings: Use a log4js logger instead of console 2021-09-28 04:30:26 -04:00
Richard Hansen
653dbb3449 tests: Wait for pad init before returning from helper.aNewPad()
This should make it easier to avoid race conditions.
2021-09-28 04:18:24 -04:00
Richard Hansen
4d2839457a CSS: Fix underscore and clear authorship icon alignment 2021-09-26 12:07:56 +02:00
snyk-bot
4637b2b729
fix: upgrade js-cookie from 3.0.0 to 3.0.1
Snyk has created this PR to upgrade js-cookie from 3.0.0 to 3.0.1.

See this package in npm:
https://www.npmjs.com/package/js-cookie

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=referral&page=upgrade-pr
2021-09-23 08:10:28 +00:00
Richard Hansen
15f17b5237 tests: Avoid deprecated Builder.withCapabilities() method 2021-09-15 19:42:11 -04:00
Richard Hansen
73cb698ba0 tests: Update selenium-webdriver to 4.0.0-rc-1 2021-09-15 19:40:47 -04:00
Richard Hansen
70c16bb1b5 tests: Check import of export of read-only pad ID 2021-09-15 18:32:06 -04:00
John McLear
b683dc300d tests: Check for leak of read-write pad ID when exporting 2021-09-15 18:32:06 -04:00
Richard Hansen
0f5a4bd1f8 tests: Restructure read-only pad export tests
This also adds coverage for `.etherpad` exports.
2021-09-15 18:32:06 -04:00
webzwo0i
dbd76f0c5d export: Don't leak writeable pad ID when exporting
Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-09-15 18:32:06 -04:00
webzwo0i
58bd96ce8f padreadonly: Remove dead /ro/:id handling
Read-only pads are accessed using `/p/` path since commit
ba3430ebb7.
2021-09-14 17:07:55 -04:00
translatewiki.net
d58b649c76 Localisation updates from https://translatewiki.net. 2021-09-09 13:02:49 +02:00
Richard Hansen
03275ba227 deps: Regenerate src/package-lock.json 2021-09-06 14:47:11 -04:00
Richard Hansen
59ebaa78fd deps: Update src/package.json versions to match lock file 2021-09-06 14:47:11 -04:00
Richard Hansen
ebe05f8e63 deps: Delete unused async-stacktrace dependency 2021-09-06 14:47:11 -04:00
Richard Hansen
bc9cdd6957 SocketIORouter: Add acknowledgement support 2021-09-06 14:45:26 -04:00
Richard Hansen
9f9adb369b SocketIORouter: Don't crash if message handler throws 2021-09-06 14:45:26 -04:00
Richard Hansen
320e5c1109 SocketIORouter: Add unit tests 2021-09-06 14:45:26 -04:00
Richard Hansen
94f71bd5e9 SocketIORouter: Add ability to unregister handler
This will make it easier to add tests.
2021-09-06 14:45:26 -04:00
Richard Hansen
2e93fca699 SocketIORouter: Logging improvements 2021-09-06 14:45:26 -04:00
Richard Hansen
b9609a749d SocketIORouter: Rename variables to improve readability 2021-09-06 14:45:26 -04:00
Richard Hansen
4a09000ca6 installDeps.sh: Don't nuke src/node_modules on error
Rationale:
  * Clearing out `src/node_modules` is unlikely to bring future
    success.
  * If there is an error, it's better to leave the filesystem alone so
    that the user can investigate the cause.
  * Deleting the directory on error is a surprising behavior.
2021-09-05 19:42:29 -04:00
Richard Hansen
2ba85dba0e installDeps.sh: Handle errors 2021-09-05 19:36:05 -04:00
Richard Hansen
258b8366e2 installDeps.sh: Ensure that ep_etherpad-lite is a directory 2021-09-05 19:31:06 -04:00
Richard Hansen
cf7cf8be69 installDeps.sh: Quote underquoted expansions 2021-09-05 19:28:58 -04:00
Richard Hansen
8b89cb3f6f installDeps.sh: Wrap long lines 2021-09-05 19:24:17 -04:00
Richard Hansen
42e59ff2cd installDeps.sh: Simplify log message 2021-09-05 19:23:01 -04:00
Richard Hansen
348bc0c269 tests: Delete overly aggressive timeouts
See https://github.com/ether/etherpad-lite/issues/4988 for rationale.
2021-08-30 02:02:37 -04:00
Richard Hansen
67dfb64095 deps: Bump ueberdb2 to 1.4.15 2021-08-30 01:49:02 -04:00
Richard Hansen
942b686f2d deps: Bump npm to 6.14.15 2021-08-30 01:22:44 -04:00
Richard Hansen
1e20936b5b deps: Bump terser to 5.7.2 2021-08-29 23:37:06 -04:00
Richard Hansen
f5657510be deps: Bump supertest to 6.1.6 2021-08-29 23:37:06 -04:00
Richard Hansen
327989ef0b deps: Bump superagent to 6.1.0 2021-08-29 23:37:06 -04:00
Richard Hansen
96e66aab17 deps: Bump sinon to 11.1.2 2021-08-29 23:37:06 -04:00
Richard Hansen
c33a2682f9 deps: Bump semver to 7.3.5 2021-08-29 23:37:06 -04:00
Richard Hansen
550c7365c2 deps: Bump openapi-backend to 4.2.0 2021-08-29 23:37:06 -04:00
Richard Hansen
529d2f6b7d deps: Bump rehype to 10.0.0 2021-08-29 23:37:06 -04:00
Richard Hansen
0accdf0a07 deps: Bump mocha to 9.1.1 2021-08-29 23:37:06 -04:00
Richard Hansen
72b22f7c02 deps: Bump measured-core to 2.0.0 2021-08-29 23:37:06 -04:00
Richard Hansen
7db3e4273d deps: Bump jsdom to 17.0.0 2021-08-29 23:37:06 -04:00
Richard Hansen
7dbd278d1d deps: Bump js-cookie to 3.0.0 2021-08-29 23:36:48 -04:00
Richard Hansen
ea43c92fe9 deps: Bump etherpad-cli-client to 0.1.12 2021-08-29 20:02:54 -04:00
Richard Hansen
912e72a8ac deps: Bump clean-css to 5.1.5 2021-08-29 19:33:03 -04:00
Richard Hansen
3225abc3c7 deps: Bump eslint to 7.32.0 2021-08-29 19:23:43 -04:00
snyk-bot
cca3ba94f9
fix: upgrade async from 3.2.0 to 3.2.1
Snyk has created this PR to upgrade async from 3.2.0 to 3.2.1.

See this package in npm:
https://www.npmjs.com/package/async

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=upgrade-pr
2021-08-27 07:05:25 +00:00
snyk-bot
3c159ef75e fix: upgrade wtfnode from 0.9.0 to 0.9.1
Snyk has created this PR to upgrade wtfnode from 0.9.0 to 0.9.1.

See this package in npm:
https://www.npmjs.com/package/wtfnode

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=upgrade-pr
2021-08-25 20:34:55 -04:00
Richard Hansen
0d65dc8a44 pad: Add clientVars to postAceInit hook context
This allows plugins to avoid the `clientVars` global variable.
2021-08-25 14:59:17 -04:00
translatewiki.net
b683cdfe0f Localisation updates from https://translatewiki.net. 2021-08-23 13:03:03 +02:00
snyk-bot
f08a443497 fix: upgrade rate-limiter-flexible from 2.2.3 to 2.2.4
Snyk has created this PR to upgrade rate-limiter-flexible from 2.2.3 to 2.2.4.

See this package in npm:
https://www.npmjs.com/package/rate-limiter-flexible

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=upgrade-pr
2021-08-19 20:46:38 -04:00
snyk-bot
05182d1d30
fix: upgrade mime-types from 2.1.31 to 2.1.32
Snyk has created this PR to upgrade mime-types from 2.1.31 to 2.1.32.

See this package in npm:
https://www.npmjs.com/package/mime-types

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=upgrade-pr
2021-08-19 07:35:17 +00:00
Richard Hansen
fed950e809 ace2_inner: Simplify handler for Ctrl-@ (show authors) 2021-08-16 00:34:30 -04:00
Richard Hansen
88057eade2 ace2_inner: Readability improvements 2021-08-16 00:34:30 -04:00
Richard Hansen
bc6428025a ace2_inner: Use for..of iteration to improve readability 2021-08-16 00:34:30 -04:00
Richard Hansen
f06307cb4c ace2_inner: Fix for..in iteration
See commit c38c34bef4.
2021-08-16 00:34:30 -04:00
Richard Hansen
2d50a8aa95 ace2_inner: Fix efficiency of rangeForLine()
Returning `true` or `false` has no effect when iterating using
`Array.prototype.forEach`. This fixes a bug introduced in commit
b28bfe8e31.
2021-08-16 00:34:30 -04:00
Richard Hansen
ca2e008e7b ace2_inner: Move variable declarations to appropriate scope 2021-08-16 00:34:30 -04:00
Richard Hansen
bf10e70f2e ace2_inner: Delete unnecessary currentLine variable 2021-08-16 00:34:30 -04:00
Richard Hansen
9fc613d362 ace2_inner: Delete unnecessary checks 2021-08-16 00:34:30 -04:00
Richard Hansen
a5f9c60a34 ace2_inner: Operate on Elements, not Nodes 2021-08-16 00:34:30 -04:00
Richard Hansen
aad75e4661 ace2_inner: Factor out duplicate line number div creation 2021-08-16 00:34:30 -04:00
Richard Hansen
3237f8d123 ace2_inner: Simplify iteration over line number divs 2021-08-16 00:34:30 -04:00
Richard Hansen
b238d9610a ace2_inner: Factor out duplicate line height application 2021-08-16 00:34:30 -04:00
Richard Hansen
1b890e3d4d ace2_inner: Replace lineNumbersShown with number of children 2021-08-16 00:34:30 -04:00
Richard Hansen
27363bf729 ace2_inner: Add line number divs directly, not via fragment
There's no layout thrashing so the fragment doesn't provide any
benefit.
2021-08-16 00:34:30 -04:00
Richard Hansen
e1a024847c ace2_inner: Delete unnecessary innerdocbody variable 2021-08-16 00:34:30 -04:00
Richard Hansen
7d807d2fc5 ace2_inner: Delete unnecessary container variable 2021-08-16 00:34:30 -04:00
Richard Hansen
4b4584c264 ace2_inner: Delete unnecessary doc and root variables 2021-08-16 00:34:25 -04:00
Richard Hansen
ec63c15a40 ace2_inner: Simplify document body selection 2021-08-16 00:31:09 -04:00
Richard Hansen
11c86e677a ace2_inner: Consistently use outerWin and outerDoc 2021-08-16 00:31:09 -04:00
Richard Hansen
98c1ba5808 ace2_inner: Use destructuring assignment to simplify 2021-08-16 00:31:09 -04:00
Richard Hansen
c7be4f9d2d ace2_inner: Move sidedivinner creation to ace.js 2021-08-16 00:31:09 -04:00
Richard Hansen
15b1d4cb75 ace2_inner: Build sidedivinner programmatically 2021-08-16 00:31:09 -04:00
Richard Hansen
b80295c228 ace2_inner: Combine declaration and initialization 2021-08-16 00:31:09 -04:00
Richard Hansen
7a8edc816b ace2_inner: Replace initLineNumbers() with an IIFE 2021-08-16 00:31:09 -04:00
Richard Hansen
b5bfff43cf ace2_inner: Delete redundant class assignment 2021-08-16 00:31:08 -04:00
Richard Hansen
e581ee01f2 ace2_inner: Formatting improvements 2021-08-16 00:30:50 -04:00
Richard Hansen
0ca5a3459f Timeslider: Install an error handler 2021-08-14 07:44:05 -04:00
Richard Hansen
1e22e0102d Timeslider: Move <title> and <script> inside <head> 2021-08-14 07:44:05 -04:00
Richard Hansen
b6fba9d66d Pad: Improve page load error handler
* Install the error handler early.
  * Include stack trace.
  * Remove unnecessary escaping.
  * Improve formatting.
  * Move to a separate script file.
2021-08-14 07:44:05 -04:00
Richard Hansen
d4e74fd038 Pad: Add missing <head> and <body> tags
The comment "head and body had been removed intentionally" implies
that the tags were causing some sort of problem, but the commit that
removed them (57075d1545) didn't provide
any rationale. I'm assuming it was a mistake.
2021-08-14 07:44:05 -04:00
Richard Hansen
4a1f21ce34 pad_editbar: Convert snake case to camel case 2021-08-14 07:26:31 -04:00
Richard Hansen
5478d2ce60 pad_editbar: Use ES6 class syntax for readability 2021-08-14 07:26:31 -04:00
Richard Hansen
97ccf9e082 pad_editbar: Factor out duplicate code 2021-08-14 07:08:57 -04:00
Richard Hansen
ee41de4809 pad_editbar: Deprecate the toggleDropDown callback 2021-08-14 07:08:57 -04:00
Richard Hansen
c629ee09a8 pad_editbar: Call the callback asynchronously
This follows JavaScript best practices.
2021-08-14 07:08:57 -04:00
Richard Hansen
148e10821b pad_editbar: Always call the callback 2021-08-14 07:08:57 -04:00
Richard Hansen
07e05a92eb pad_editbar: Call the callback after all work is done 2021-08-14 07:08:57 -04:00
Richard Hansen
a1b924f746 pad_editbar: Don't pass a callback to toggleDropDown()
The function is synchronous so there's no point.
2021-08-14 07:08:57 -04:00
Richard Hansen
59d6a8b321 pad_editbar: Delete unnecessary returned variable 2021-08-14 07:01:50 -04:00
Richard Hansen
a4652d67a0 pad_editbar: Move commands up for readability 2021-08-14 07:01:50 -04:00
Richard Hansen
fda34407f9 pad_editbar: Move dropdowns initialization to constructor
This avoids null dereference if a buggy caller calls
`toggleDropDown('none')` before `init()`. (Ideally the caller would be
fixed, but this is not always feasible.)
2021-08-14 07:01:34 -04:00
Richard Hansen
42b0b1bf00 pad_editbar: Move syncAnimation out of padeditbar IIFE
This avoids the need for an IIFE.
2021-08-14 07:01:13 -04:00
Richard Hansen
ee996f530f pad_editbar: Remove unnecessary syncAnimationFn variable 2021-08-14 07:01:13 -04:00
Richard Hansen
4b4eef5f4a pad_editbar: Convert registerDefaultCommands() into a method 2021-08-14 07:01:13 -04:00
Richard Hansen
0d4f147349 pad_editbar: Simplify iteration 2021-08-14 07:01:13 -04:00
Richard Hansen
11faf6104a pad_editbar: Convert bodyKeyEvent() into a method 2021-08-14 07:01:13 -04:00
Richard Hansen
b2fe6e3e7e pad_editbar: Fix invalid use of this 2021-08-14 07:01:12 -04:00
Richard Hansen
b884628a5a pad_editbar: Use arrow functions for callbacks, IIFEs 2021-08-14 07:01:12 -04:00
Richard Hansen
bdaa66c346 pad_editbar: Use this instead of self 2021-08-14 07:01:12 -04:00
Richard Hansen
118c66e5d0 HTML import: Improve log message for invalid HTML 2021-08-12 13:53:23 -04:00
Richard Hansen
c816c20bc7 HTML import: Replace cheerio with jsdom to simplify contentcollector
Cheerio provides jQuery-like objects but they wrap DOM Node-like
objects that are not 100% API compatible with the DOM spec. Because of
this, contentcollector, which is used in browsers and in Node.js
during HTML import, has until now needed to support two different
APIs. This commit modifies HTML import to use jsdom instead of cheerio
and simplifies contentcollector.
2021-08-12 13:53:23 -04:00
Volker Bijewitz
84d6d277d7 Accessibility fix for JAWS screen readers
ace.js: removed the role 'application' from innerDocument.body. JAWS
do not read any text from the edit lines if this role is set.

domline.createDomLine: to give JAWS the ability to read the lines
correctly, it is required to set the attribute 'aria-live' to
'assertive'.
2021-08-12 13:48:08 -04:00
Richard Hansen
15995acc2a deps: Bump require-kernel and yajsml
This brings improvements to the readability of stack traces,
especially in Firefox.
2021-08-09 19:04:42 -04:00
translatewiki.net
9eadd9988f Localisation updates from https://translatewiki.net. 2021-08-09 13:03:33 +02:00
snyk-bot
33a43b7082 fix: upgrade rate-limiter-flexible from 2.2.2 to 2.2.3
Snyk has created this PR to upgrade rate-limiter-flexible from 2.2.2 to 2.2.3.

See this package in npm:
https://www.npmjs.com/package/rate-limiter-flexible

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=upgrade-pr
2021-08-02 20:43:44 -04:00
translatewiki.net
fd4fb8874e Localisation updates from https://translatewiki.net. 2021-08-02 13:02:54 +02:00
webzwo0i
e61888dfe2 ace.js: Don't use srcdoc when creating iframes (see #4975)
Using srcdoc, especially with multiple nested iframes, seems to be
problematic when using `self` in CSP policies.
2021-07-30 03:51:57 -04:00
Richard Hansen
9fda5adcef ace2_inner.js: Improve discovery of sidediv and linemetricsdiv
The `Node.nextSibling` property returns the next Node, not the next
Element. If whitespace, an HTML comment, or any other type of
non-Element Node is ever introduced between the Elements then
`.nextSibling` no longer returns the desired Element. Switching to
`Element.nextElementSibling` would work, but finding the Elements by
ID is more readable and future-proof.
2021-07-30 03:51:56 -04:00
Richard Hansen
0c963a817a ace2_inner.js: Delete unnecessary ace_outerWin variable 2021-07-30 03:51:56 -04:00
Richard Hansen
8d869ec927 Pad: Delete non-functional debug logging facility 2021-07-30 03:50:23 -04:00
Richard Hansen
5d39a57507 Pad: Delete dead ace_getFormattedCode() 2021-07-30 03:49:35 -04:00
Richard Hansen
c3af70e5a5 deps: Bump ueberdb2 to 1.4.13 2021-07-30 03:48:36 -04:00
translatewiki.net
2dbcd00dc6 Localisation updates from https://translatewiki.net. 2021-07-29 13:03:26 +02:00
translatewiki.net
a9c6ed8701 Localisation updates from https://translatewiki.net. 2021-07-26 13:03:49 +02:00
Richard Hansen
d723270388 tests: Improve readability of multipleUsers.js
* Define utility functions above their use to silence lint warnings.
  * Use `.css()` instead of `.attr('style')` to manipulate style.
  * Pass an object to `.attr()` rather than call once per attribute.
  * Take advantage of chaining.
  * Inline unnecessary `padUrl` variable.
  * Delete some unnecessary comments.
2021-07-25 02:23:50 +02:00
Richard Hansen
ff39eeafca tests: Factor out duplicate getFrameJQuery() 2021-07-25 02:23:50 +02:00
Richard Hansen
42026ff771 tests: Add a comment explaining why Promise.all() is not used 2021-07-25 02:23:50 +02:00
Richard Hansen
01184cd1aa tests: Remove unnecessary includeJquery parameter 2021-07-25 02:23:50 +02:00
snyk-bot
4a670e96ab
fix: upgrade express-rate-limit from 5.2.6 to 5.3.0
Snyk has created this PR to upgrade express-rate-limit from 5.2.6 to 5.3.0.

See this package in npm:
https://www.npmjs.com/package/express-rate-limit

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=upgrade-pr
2021-07-23 04:22:23 +00:00
Richard Hansen
c83bb058d1 PadMessageHandler: Fix stats null dereference
It is possible for the stats to be read before the
`expressCreateServer` hook is called (in particular: when there is an
error during startup), which is when the `socketio` variable is set.
Check for non-null `socketio` before attempting to count the number of
socket.io connections.
2021-07-22 13:07:03 -04:00
translatewiki.net
3d80409236 Localisation updates from https://translatewiki.net. 2021-07-22 13:03:00 +02:00
webzwo0i
62093adce5 tests: refactor inclusion of jquery and sendkeys via script tags
Readability is increased by explicitly checking if jquery/sendkeys was
already loaded before evaluating it in the context of ace_inner and the
enclosing container (pad.html). Note that sendkeys is no longer
evaluated in the context of ace_outer, as this isn't needed

Also removes some IE 8/9 legacy code
2021-07-21 01:53:05 +02:00
Richard Hansen
4ceb3ca4c8 Chat: Allow Shift-Enter to insert a newline 2021-07-19 23:44:33 +02:00
Richard Hansen
cf86ae8b63 Chat: Use KeyboardEvent.key instead of deprecated .which 2021-07-19 23:44:33 +02:00
Richard Hansen
faf84f0143 Chat: Display whitespace in chat messages 2021-07-19 23:44:33 +02:00
Richard Hansen
834e05fc9c Chat: Use a <textarea> for message input 2021-07-19 23:44:33 +02:00
Richard Hansen
ce5ef9350f tests: sendkeys: Fix {enter} keypress event 2021-07-19 23:44:33 +02:00
translatewiki.net
c6f643dd75 Localisation updates from https://translatewiki.net. 2021-07-19 13:02:46 +02:00
Xavier Mehrenberger
ca4cc2d7c0 Fix settings.useMonospaceFontGlobal
When settings.useMonospaceFontGlobal is set to `true`, it sets the default
font to 'monospace'. This font seems to have been removed in
a5164dad43.

This commit sets the default font to "RobotoMono" which is a valid
option.

Tested in a Docker environment, setting `PAD_OPTIONS_USE_MONOSPACE_FONT`
to `true`

Signed-off-by: Xavier Mehrenberger <xavier.mehrenberger@gmail.com>
2021-07-14 04:33:38 -04:00
Richard Hansen
336d48add7 Add support for square brackets in URLs
This reverts commit 9022877cc6.
2021-07-10 22:22:31 -04:00
Richard Hansen
09f8ffbdb6 deps: Bump ueberdb2 to 1.4.11 2021-07-10 18:26:31 -04:00
Richard Hansen
5f39a1ee7f CSS: Underline links in error dialogs
Underlining was removed for unknown reasons by commit
d872b42e31.
2021-07-09 18:43:13 -04:00
webzwo0i
a634bd8ee1 bump version 2021-07-04 07:05:34 +02:00
translatewiki.net
197e04ecd7 Localisation updates from https://translatewiki.net. 2021-07-01 13:42:31 +02:00
Richard Hansen
3d40ab7e8c CSS: Move author color padding to setAuthorStyle()
This prevents the padding from clashing with plugins that use the
`aceSetAuthorStyle` hook.
2021-06-22 14:43:22 -04:00
translatewiki.net
2745557127 Localisation updates from https://translatewiki.net. 2021-06-21 12:28:27 +02:00
Richard Hansen
9fcd86b3cd Pad: Fix <script> elements in aceInitInnerdocbodyHead hook
Using `.innerHTML` to create a `<script>` element does create a DOM
node, but the script is not actually executed. Fortunately, creating a
DocumentFragment does cause the script to execute.
2021-06-18 17:50:15 -04:00
Richard Hansen
7bdd0f2f09 bin/updatePlugins.sh: Many refinements
* cd to top-level Etherpad directory is now more robust.
  * Only attempt to update packages whose names begin with `ep_`.
  * Don't create `package-lock.json`.
  * Improve logging.
  * Improve error handling.
2021-06-18 04:34:37 -04:00
Richard Hansen
4b3e47bd23 bin/importSqlFile.js: Read the file one line at a time
This avoids running out of memory if the file is large.
2021-06-17 19:45:17 -04:00
webzwo0i
485538bd79 bump wtfnode to fix #5078 2021-06-17 06:14:45 +02:00
Richard Hansen
251cc7ab32 CSS: Fix button icon centering 2021-06-16 18:27:52 -04:00
Richard Hansen
53cca5a743 PadMessageHandler: Also send USER_NEWINFO messages on reconnect
Now the user list is correct after a reconnect. This also allows
ep_webrtc to automatically recover after a temporary network glitch.
2021-06-16 01:35:25 -04:00
Richard Hansen
7ca336c28e lint: Update eslint-config-etherpad and friends 2021-06-14 23:17:17 +02:00
Richard Hansen
ef1ba21104 deps: Drop support for Node.js < 12.13.0 2021-06-14 23:17:17 +02:00
webzwo0i
66ee9c5ef9 update package-lock 2021-06-14 13:21:48 -04:00
Richard Hansen
5dcb7a7549 tests: Don't attempt to wrap non-functions 2021-06-14 13:45:13 +02:00
Richard Hansen
081b97c41d tests: Wrap more Mocha functions 2021-06-14 13:45:13 +02:00
Richard Hansen
3e4df68510 tests: Enable fake webcam on Microsoft Edge 2021-06-10 15:36:35 -04:00
Richard Hansen
565b1c5271 tests: Fix flexbox grow/shrink factors
* Make sure the `#mocha-report` div grows to fill the available
    vertical space.
  * Prevent the "Loading frontend test specs..." div from shrinking.
2021-06-10 13:28:55 -04:00
Richard Hansen
acd11c3948 tests: Fetch frontend test specs in parallel 2021-06-09 20:28:03 -04:00
Richard Hansen
36d2af5318 tests: Display frontend spec loading progress 2021-06-09 20:18:22 -04:00
Richard Hansen
e0ae997501 tests: Don't auto-scroll Mocha results if user scrolls up 2021-06-09 18:48:31 -04:00
Richard Hansen
f5046f4b18 tests: Keep the #mocha-stats div visible 2021-06-09 18:48:31 -04:00
snyk-bot
ea4500ef64
fix: upgrade express-session from 1.17.1 to 1.17.2
Snyk has created this PR to upgrade express-session from 1.17.1 to 1.17.2.

See this package in npm:
https://www.npmjs.com/package/express-session

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=upgrade-pr
2021-06-09 22:13:02 +00:00
translatewiki.net
28f2acf98a Localisation updates from https://translatewiki.net. 2021-06-07 14:48:08 +02:00
Richard Hansen
cccabf45b8 pad: Move error message to the top of the gritter box 2021-06-06 21:31:49 -04:00
Richard Hansen
b2e94685fb pad: Display error name in the gritter box 2021-06-06 21:31:40 -04:00
Richard Hansen
63a5dc6599 tests: Configure Firefox to use fake webcam
This makes it possible to test ep_webrtc in Firefox.
2021-06-06 16:53:51 -04:00
Richard Hansen
8f0d70312d tests: Also pass --use-fake-ui-for-media-stream to Chrome
For testing ep_webrtc.
2021-06-06 16:25:27 -04:00
Richard Hansen
752e2488af tests: Migrate from wd to selenium-webdriver 2021-06-06 16:23:56 -04:00
Richard Hansen
1756415495 tests: Avoid jQuery when reading Mocha output 2021-06-06 16:20:13 -04:00
Richard Hansen
6c2f31a5cb tests: Add tests for settings.json parsing 2021-06-06 14:00:52 -04:00
Richard Hansen
428f8d1684 Settings: Deprecate null as the default default value 2021-06-06 14:00:52 -04:00
Richard Hansen
c7bb18c6da Settings: Support null and undefined env var substitutions 2021-06-06 14:00:51 -04:00
Richard Hansen
299dbbe7e6 tests: Move split-grid to dev dependencies
This is only used for testing.
2021-06-06 06:45:00 -04:00
Richard Hansen
45ca82fd9f tests: Make the Mocha results area resizable 2021-06-05 03:51:55 -04:00
Richard Hansen
c4239b6059 tests: Show a scrollbar if the pad is too wide 2021-06-05 03:51:11 -04:00
Richard Hansen
fc3b811726 tests: Move iframe min width to iframe selector 2021-06-05 03:51:11 -04:00
Richard Hansen
960c2c0c0d tests: Tweak mocha report spacing 2021-06-05 03:51:11 -04:00
Richard Hansen
b09b895ac7 tests: Remove border around iframe 2021-06-05 03:51:11 -04:00
Richard Hansen
e9f08bdd11 tests: Fix frontend test CSS selectors 2021-06-05 03:51:11 -04:00
Richard Hansen
76634eb6ff tests: Add missing <head> and <body> tags 2021-06-05 03:51:11 -04:00
Richard Hansen
d9782ac628 tests: Send frontend test spec list as JSON 2021-06-05 03:51:06 -04:00
Richard Hansen
20df34bb67 tests: Promisify helper.init() 2021-06-05 03:50:36 -04:00
Richard Hansen
c714ff1014 tests: Let Express handle errors when serving frontendTestSpecs.js
Express v4.x doesn't understand Promises so we have to manually catch
Promise rejections and pass the error object to `next()`.
2021-06-05 03:50:36 -04:00
Richard Hansen
e4f011df76 tests: Use require() to load frontend test specs
This makes core and plugin tests consistent with each other, makes it
possible to `require()` relative paths in spec files, simplifies the
code somewhat, and should make it easier to move away from
require-kernel.

Also:
  * Wrap plugin tests inside a `describe()` that contains the plugin
    name to make it easier to grep for a plugin's tests and for
    consistency with core tests.
  * Add "<core>" to the core test descriptions to make it easier to
    distinguish them from plugin tests.
2021-06-05 03:50:26 -04:00
Richard Hansen
d8eb79428f tests: Recurse under frontend spec dir 2021-06-05 03:49:13 -04:00
Richard Hansen
5d54c1657a tests: Redirect /tests/frontend/index.html to /tests/frontend/ 2021-06-05 03:49:12 -04:00
Richard Hansen
712b8c5769 tests: Redirect /tests/frontend to /tests/frontend/ 2021-06-05 03:49:12 -04:00
Richard Hansen
573da027e5 tests: Preserve query string when redirecting 2021-06-05 03:49:12 -04:00
Richard Hansen
9cba96e5e9 tests: Use relative paths for scripts 2021-06-05 03:49:12 -04:00
Richard Hansen
e144434571 tests: Use relative paths in helper.init()
This avoids problems if Etherpad is served under a path like
`/etherpad`.
2021-06-05 03:49:12 -04:00
Richard Hansen
dfd649dbe9 tests: Use a relative redirect for /tests/frontend
This avoids problems if Etherpad is served under a path like
`/etherpad`.
2021-06-03 15:10:23 -04:00
Richard Hansen
617267ce71 tests: Use plugin_defs to get plugin frontend test spec paths 2021-06-03 15:10:23 -04:00
Richard Hansen
1b7b96f57e tests: Avoid deprecated fs.existsSync() 2021-06-03 15:10:23 -04:00
Richard Hansen
ab824c728f tests: Move slashes to improve readability 2021-06-03 15:10:22 -04:00
Richard Hansen
1516bf473f tests: Delete unnecessary staticDir variable 2021-06-03 15:10:22 -04:00
Richard Hansen
d69345bb4e tests: Use map+reduce to improve readability 2021-06-03 15:10:22 -04:00
Richard Hansen
a8e77126e8 tests: Combine .map().filter().map() into single .map() 2021-06-03 15:10:22 -04:00
Richard Hansen
2414203434 tests: Remove unnecessary return 2021-06-03 15:10:22 -04:00
Richard Hansen
0852df74f1 tests: Unexport unnecessarily exported functions 2021-06-03 15:10:22 -04:00
Richard Hansen
ed44449639 tests: Pretty-print frontendTestSpecs.js to make troubleshooting easier 2021-06-03 15:10:22 -04:00
Richard Hansen
4fa9f9e9d8 tests: Use window.foo instead of var foo 2021-06-03 15:10:22 -04:00
Richard Hansen
aea2fb7448 tests: Rename specs_list to frontendTestSpecs 2021-06-03 15:10:22 -04:00
Richard Hansen
1be1b704f1 tests: Simplify iteration over frontend test specs 2021-06-03 15:10:22 -04:00
Richard Hansen
b85a040f13 tests: Reuse sanitizePathname when serving frontend specs 2021-06-03 15:10:22 -04:00
Richard Hansen
ade17490e0 tests: Combine frontend test file handlers 2021-06-03 15:10:22 -04:00
Richard Hansen
995e381243 tests: Only wrap *.js files in describe() 2021-06-03 15:10:22 -04:00
Richard Hansen
e1c2c963f0 tests: URL decode test spec pathnames
Express automatically URL decodes route parameters.
2021-06-03 15:10:22 -04:00
Richard Hansen
998e77ec25 tests: Switch to promisified readFile 2021-06-03 15:10:22 -04:00
Richard Hansen
6cf27a7133 tests: Use fs.promises instead of wrapping with util.promisify 2021-06-03 15:10:22 -04:00
Richard Hansen
f00f9aa14c tests: Avoid .then() inside async functions 2021-06-03 15:10:22 -04:00
Richard Hansen
d87b4e0c20 tests: Use async/await instead of returning Promises
This makes stack traces more useful.
2021-06-03 15:10:21 -04:00
Richard Hansen
0d9476529e sanitizePathname: Move to separate module to facilitate reuse 2021-06-03 15:10:21 -04:00
Richard Hansen
926da57e34 Minify: Refine sanitizePathname to avoid pathname traversal 2021-06-03 15:10:21 -04:00
translatewiki.net
3bca85286b Localisation updates from https://translatewiki.net. 2021-06-03 15:12:59 +02:00
translatewiki.net
8f63671ea9 Localisation updates from https://translatewiki.net. 2021-05-31 10:02:43 +02:00
translatewiki.net
a04089636c Localisation updates from https://translatewiki.net. 2021-05-27 15:37:31 +02:00
translatewiki.net
c426e939d1 Localisation updates from https://translatewiki.net. 2021-05-24 14:00:35 +02:00
Richard Hansen
6f2f20233f lint: Fix straightforward ESLint errors 2021-05-12 11:26:35 +02:00
Richard Hansen
59c03bde20 lint: Re-run eslint --fix 2021-05-12 11:26:35 +02:00
Richard Hansen
30eadad79d lint: Bump ESLint dependencies 2021-05-12 11:26:35 +02:00
webzwo0i
24929d3417 package.json: bump npm from 6.14.11 to 6.14.13 2021-05-07 14:58:57 +02:00
webzwo0i
10f00906f8 update package-lock.json 2021-05-07 14:58:57 +02:00
snyk-bot
ff245dbbeb fix: upgrade underscore from 1.13.0 to 1.13.1
Snyk has created this PR to upgrade underscore from 1.13.0 to 1.13.1.

See this package in npm:
https://www.npmjs.com/package/underscore

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=upgrade-pr
2021-05-07 14:27:30 +02:00
translatewiki.net
4701cc43fa Localisation updates from https://translatewiki.net. 2021-05-07 10:50:38 +02:00
Richard Hansen
b040ebf419 Revert "PadMessageHandler: Use a Map for sessioninfos"
Switching to a Map broke ep_webrtc and maybe other plugins.

This reverts commit eeead46437.
2021-05-05 18:09:10 -04:00
webzwo0i
3c087af038 caretPosition: fix loading when iframe is hidden 2021-05-04 23:56:13 +02:00
Richard Hansen
8baacd514e remote_runner: Always call browser.quit() 2021-05-03 01:48:08 -04:00
Richard Hansen
081f739a8d remote_runner: Update browser list
Use latest versions of Chrome, Firefox, Safari, and Edge. Keep the old
Chrome version.
2021-05-03 01:48:08 -04:00
Richard Hansen
a7cd0a4b25 remote_runner: Avoid re-sending the same console text over and over 2021-05-03 01:48:08 -04:00
Richard Hansen
25275f2744 remote_runner: Treat no text as 0 lines, not 1 empty line 2021-05-03 01:48:08 -04:00
Richard Hansen
a17556b876 remote_runner: Avoid searching the full text for "FINISHED" 2021-05-03 01:48:08 -04:00
Richard Hansen
3409e3f5e6 remote_runner: Prevent Sauce errors from interrupting other tests 2021-05-03 01:48:08 -04:00
Richard Hansen
68b041c4fb remote_runner: Use newline instead of backslash n 2021-05-03 01:48:08 -04:00
Richard Hansen
713e57b451 remote_runner: Don't break long lines
Breaking lines makes it harder to read and search the test output.
2021-05-03 01:48:08 -04:00
Richard Hansen
7d75e0ef8f remote_runner: Simplify append() 2021-05-03 01:48:08 -04:00
Richard Hansen
bbb3046a87 remote_runner: Promisify 2021-05-03 01:48:08 -04:00
Richard Hansen
9059a55873 remote_runner: Improve readability of timeout duration 2021-05-03 01:48:08 -04:00
Richard Hansen
c803ec81f1 remote_runner: Handle webdriver errors 2021-05-03 01:48:08 -04:00
Richard Hansen
7f57b17b2e remote_runner: Use Error objects to convey pass/fail 2021-05-03 01:48:08 -04:00
Richard Hansen
4ec02a9af9 remote_runner: Simplify finished test check 2021-05-03 01:48:08 -04:00
Richard Hansen
b0e367a982 remote_runner: Simplify logging of console text 2021-05-03 01:48:08 -04:00
Richard Hansen
08856fe42e remote_runner: Move logIndex updates into printLog() 2021-05-03 01:48:08 -04:00
Richard Hansen
a12c475776 remote_runner: Use an options object to create webdriver object 2021-05-03 01:48:08 -04:00
Richard Hansen
925f789d4c remote_runner: Simplify logging 2021-05-03 01:48:08 -04:00
Richard Hansen
014e19cf7d remote_runner: await each browser test 2021-05-03 01:48:07 -04:00
Richard Hansen
1f3a831cc3 remote_runner: Avoid duplication in task list 2021-05-03 01:48:07 -04:00
Richard Hansen
59be8d5c05 remote_runner: Delete commented-out browsers
Also delete useless and incorrect browser comments.
2021-05-03 01:48:07 -04:00
Richard Hansen
a58fa4a2c5 tests: Add tests for SkipList.atOffset() 2021-05-03 01:42:03 -04:00
Richard Hansen
c00031a8d8 skiplist: Use Map.size to get number of nodes 2021-05-03 01:42:03 -04:00
Richard Hansen
1cdfe9193b skiplist: Convert _keyToNodeMap to a Map object 2021-05-03 01:42:03 -04:00
Richard Hansen
e2eb7327c2 skiplist: Sanity check inserted entries 2021-05-03 01:42:03 -04:00
Richard Hansen
9e2ef6ad5b skiplist: Move propagateWidthChange() to Node class 2021-05-03 01:42:03 -04:00
Richard Hansen
fc103e7f2a skiplist: Define a new Node class 2021-05-03 01:42:03 -04:00
Richard Hansen
9fc88f3601 skiplist: Convert point operations into Point methods 2021-05-03 01:42:03 -04:00
Richard Hansen
3c1be95e07 skiplist: Move point creation to a new Point class 2021-05-03 01:42:03 -04:00
Richard Hansen
8ae40e80f9 skiplist: Save entry in _insertKeyAtPoint() 2021-05-03 01:42:03 -04:00
Richard Hansen
0e424fa8c3 skiplist: Remove unnecessary newKey arg from _insertKeyAtPoint() 2021-05-03 01:42:03 -04:00
Richard Hansen
ab8c354f18 skiplist: Use ES6 class syntax
This makess it easier to examine state in dev console.
2021-05-03 01:42:03 -04:00
Richard Hansen
303fd297bd editor: Improve documentation comments 2021-05-03 01:42:03 -04:00
Richard Hansen
cbbcef8e90 AttributeManager: Add sanity checks 2021-05-03 01:42:03 -04:00
Richard Hansen
d40d59d9eb AttributeManager: Simplify logic 2021-05-03 01:42:03 -04:00
Richard Hansen
e3d32a26b6 skiplist: Delete unused methods 2021-05-03 01:42:03 -04:00
Richard Hansen
f650c3d73e editor: Delete unused PROFILER code 2021-05-03 01:42:03 -04:00
Richard Hansen
ab4e99f67a editor: Delete commented-out code 2021-05-03 01:42:03 -04:00
Richard Hansen
eeead46437 PadMessageHandler: Use a Map for sessioninfos
Maps are a bit more flexible, have clearer semantics, and have a
convenient `size` property.
2021-05-03 01:35:11 -04:00
Richard Hansen
14d4aadfe4 PadMessageHandler: Parallelize client updates
Multiple clients are updated in parallel, but multiple revisions sent
to a particular client are still sent sequentially.
2021-05-03 01:35:11 -04:00
Richard Hansen
770755debf PadMessageHandler: Assume sessioninfo stays valid during client update
...but add a try/catch around the message transmission just in case.
2021-05-03 01:35:11 -04:00
Richard Hansen
c85391862b PadMessageHandler: Avoid unnecessary property lookups 2021-05-03 01:35:11 -04:00
Richard Hansen
d5c6a44d9c PadMessageHandler: Improve documentation of sessioninfos 2021-05-03 01:35:11 -04:00
Richard Hansen
4c4415e14a PadMessageHandler: Register activePads metric only once 2021-05-03 01:35:11 -04:00
snyk-bot
6011d31b22 fix: upgrade underscore from 1.12.1 to 1.13.0
Snyk has created this PR to upgrade underscore from 1.12.1 to 1.13.0.

See this package in npm:
https://www.npmjs.com/package/underscore

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=upgrade-pr
2021-05-03 01:31:53 -04:00
Richard Hansen
8f236b8687 Minify: Avoid crash due to unhandled Promise rejection if stat fails 2021-05-03 01:26:49 -04:00
Richard Hansen
e8df643d75 Minify: Treat ENOTDIR like ENOENT when statting a file
This avoids an exception when require-kernel requests a path like
`existing-file.js/index.js`.
2021-05-03 01:26:48 -04:00
Richard Hansen
aaacbd3a7a Minify: Refactor requestURI() for readability 2021-05-03 01:26:48 -04:00
translatewiki.net
3a8d66ba6a Localisation updates from https://translatewiki.net. 2021-04-30 08:49:17 +02:00
translatewiki.net
3afc77dae7 Localisation updates from https://translatewiki.net. 2021-04-26 15:20:55 +02:00
Richard Hansen
8384a7a67b deps: Bump ueberdb2 2021-04-20 21:56:44 +02:00
Richard Hansen
ea8846154f favicon: Redo favicon customization 2021-04-20 13:33:55 -04:00
Richard Hansen
92e0bff80c favicon: Refactor handler and add tests 2021-04-20 13:33:55 -04:00
Richard Hansen
d0d4b95980 favicon: Only serve from /favicon.ico 2021-04-20 13:33:54 -04:00
webzwo0i
3a5af19492 AuthorManager: await for more db methods 2021-04-20 11:27:44 -04:00
webzwo0i
35797e57fc AuthorManager: await db.set in createAuthor 2021-04-20 11:27:44 -04:00
webzwo0i
20c512c8a9 test for await db.set in createAuthor 2021-04-20 11:27:43 -04:00
Chocobozzz
a001a13411 fix(perf): Disable wtfnode dump by default
Consumes a lot of CPU so it's better to enable it on purpose
2021-04-13 16:01:41 +02:00
Richard Hansen
951d369e3f padaccess: Delete useless try/catch 2021-04-12 22:51:06 -04:00
Richard Hansen
329d037431 Simplify read-only pad ID checks 2021-04-12 22:51:06 -04:00
Richard Hansen
f63610bb12 tests: Test access bypass via read-only pad ID 2021-04-12 22:51:06 -04:00
pcworld
3c71e8983b Fix read only pad access with authentication
Before this commit, webaccess.checkAccess saved the authorization in
user.padAuthorizations[padId] with padId being the read-only pad ID,
however later stages, e.g. in PadMessageHandler, use the real pad ID for
access checks. This led to authorization being denied.

This commit fixes it by only storing and comparing the real pad IDs and
not read-only pad IDs.

This fixes test case "authn user readonly pad -> 200, ok" in
src/tests/backend/specs/socketio.js.
2021-04-12 22:51:06 -04:00
pcworld
0d33793908 tests: readonly pastes must be readable+exportable with authentication
readonly paste links should be readable even if authentication is turned
on, as long as the user provides valid login data.
This test currently fails.

Also test that readonly paste IDs can be exported under the same
condition, which currently succeeds.
2021-04-12 22:51:06 -04:00
translatewiki.net
7d5cad6932 Localisation updates from https://translatewiki.net. 2021-04-12 15:43:27 +02:00
Richard Hansen
d01b593d3c chat: Ensure that ctx.text is interpreted as HTML 2021-04-11 06:20:29 +02:00
Richard Hansen
a3a0ff7bc1 chat: Use jQuery to build the chat message DOM object
This reduces the likelihood of accidentally introducing an XSS
vulnerability.
2021-04-11 06:20:29 +02:00
Richard Hansen
74554d36a5 chat: Allow chatNewMessage hook to modify more values 2021-04-11 06:20:29 +02:00
Richard Hansen
1ad134a538 PadMessageHandler: Improve logging of pre-CLIENT_READY drops
This should make it easier to see what is emitting the the messages so
it can be fixed.
2021-04-09 18:43:02 +02:00
Richard Hansen
91e99c84ca import: Reduce log spam from unsupported elements 2021-04-09 18:43:02 +02:00
Richard Hansen
09c349e2a1 import: Use a Set for supported elements 2021-04-09 18:43:02 +02:00
translatewiki.net
e31da37d00 Localisation updates from https://translatewiki.net. 2021-04-08 14:54:44 +02:00
webzwo0i
a796811558 escape userId before setting it as HTML attribute 2021-04-07 23:29:27 -04:00
webzwo0i
9408d4395f remove custom timeouts 2021-04-07 17:47:11 -04:00
Mikk Andresen
af19a010c5 DOCS: Fix broken links in TOC - use Marked to generate ID slugs instead of local implementation that was giving out different IDs in some cases - https://github.com/citizenos/citizenos-fe/issues/535 2021-04-06 21:42:01 +02:00
webzwo0i
e483b91916 Don't make browsers fail on sync-xhr until require-kernel is dropped 2021-04-05 04:34:29 -04:00
snyk-bot
e86547c4f5 fix: upgrade openapi-backend from 3.9.0 to 3.9.1
Snyk has created this PR to upgrade openapi-backend from 3.9.0 to 3.9.1.

See this package in npm:
https://www.npmjs.com/package/openapi-backend

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=upgrade-pr
2021-04-03 16:54:52 -04:00
Richard Hansen
e4754eb9df tests: Fix race in timeslider_revisions.js 2021-04-02 15:46:27 +02:00
Richard Hansen
27e5373050 tests: Fix race in change_user_name.js 2021-04-02 15:46:27 +02:00
Richard Hansen
58dac4c0fc tests: Fix races in inner_height.js 2021-04-02 15:46:27 +02:00
Richard Hansen
4ad80d4072 tests: Delete overly aggressive frontend test timeouts
This should reduce test flakiness.
2021-04-02 15:46:27 +02:00
Richard Hansen
7cbb3f565d tests: Speed up helper.edit() and helper.clearPad() 2021-04-02 15:46:27 +02:00
Richard Hansen
7a154b1e1d tests: Wait for commit instead of sleep in timeslider_revisions.js 2021-04-02 15:46:27 +02:00
Richard Hansen
d15ff9ce8d tests: Add missing awaits to change_user_name.js
Also increase the timeouts.
2021-04-02 15:46:27 +02:00
Richard Hansen
bbf89dfcf9 tests: Refine frontend tests
* Switch from `helper.newPad()` to `helper.aNewPad()`.
  * Promisify.
  * Delete redundant logic.
  * Lint fixes.
2021-04-02 15:46:27 +02:00
Richard Hansen
3790c0e41c tests: Use async/await instead of returning Promises
This has a few benefits:
  * It's more readable: It's easier for a user of the function to know
    that they should use `await` when calling the function.
  * Stack traces are more useful.
  * Some code (e.g., the async npm package) uses introspection to
    determine if a function is `async` vs. takes a callback.
2021-04-02 15:46:27 +02:00
Richard Hansen
b164a34e64 lint: Fix ESLint error in helper/methods.js 2021-04-02 15:46:27 +02:00
Richard Hansen
62403159df tests: Invert conditions to improve readability 2021-04-02 15:46:27 +02:00
Richard Hansen
dd9c08d821 tests: Wait for commit rather than sleep 2021-04-01 14:31:56 +02:00
Richard Hansen
2776946627 tests: Use cookie libraries to manipulate cookies 2021-04-01 14:31:56 +02:00
Richard Hansen
202d65d2bb pad_cookie: Re-read prefs cookie on every call to getPref()
This makes it easier to write tests that clear the prefs cookie.
2021-04-01 14:31:56 +02:00
Richard Hansen
0df41a9a78 pad_cookie: Move initial cookie read+save to init()
Benefits of this change:
  * It avoids race conditions with tests that clear cookies.
  * Any attempt to get or set a value before `init()` is called will
    throw an error, ensuring the API is used properly.
  * Improved readability: It's easier to understand what the
    `pad.noCookie` check is doing.
2021-04-01 14:31:56 +02:00
Richard Hansen
aeee5c0b69 tests: Fix cookie name in helper.js tests 2021-04-01 14:31:56 +02:00
Richard Hansen
137fa89d2a tests: Always set cookie path to / (to match non-test behavior) 2021-04-01 14:31:56 +02:00
Richard Hansen
5666c34061 tests: Fix encoding of prefs cookie 2021-04-01 14:31:56 +02:00
Richard Hansen
63e6e163b7 tests: Promisify some of the helper.js tests 2021-04-01 14:31:56 +02:00
Richard Hansen
701a40ac13 tests: Promisify multiple_authors_clear_authorship_colors.js 2021-04-01 14:31:56 +02:00
Richard Hansen
8b43f9eb5f tests: Promisify authorship_of_editions.js 2021-04-01 14:31:56 +02:00
Richard Hansen
056939cd22 tests: Refine helper/multipleUsers.js
* Rename "current"/"other" to "user0"/"user1".
  * Delete unnecessary `_createTokenFor*` functions.
  * Rename helper functions to remove unnecessary leading underscore
    and for brevity.
  * Use jQuery's `.attr()` to build the second iframe.
  * Use js-cookie to manipulate the token cookie.
  * Don't attempt to set the token cookie if the pad isn't loaded.
  * Use the token generated by the pad.
  * Only clear the token cookie at path=/.
2021-04-01 14:31:56 +02:00
Guilherme Goncalves
f2034ad368 tests: Add regression tests for character composition race
See: https://github.com/ether/etherpad-lite/issues/4978
2021-03-30 16:42:53 -04:00
Richard Hansen
1fdaf95c3b collab_client: Delete unused NO_COMMIT_PENDING handling 2021-03-30 16:42:53 -04:00
Richard Hansen
63a1f078f4 collab_client: Redo server message queueing
Move server message queue processing out of `handleUserChanges()` for
the following reasons:
  * Fix a race condition: Before this change the client would stop
    processing incoming messages and stop sending changes to the
    server if a `NEW_CHANGES` message arrived while the user was
    composing a character and waiting for an `ACCEPT_COMMIT` message.
  * Improve readability: The `handleUserChanges()` function is for
    handling changes from the local user, not for handling changes
    from other users.
  * Simplify the code.
2021-03-30 16:42:53 -04:00
Richard Hansen
e99fe88537 collab_client: Use Date.now() instead of casting a Date object
Also rename the `t` variable to `now` to improve readability.
2021-03-30 16:42:53 -04:00
Richard Hansen
5c445eac21 collab_client: Convert state var to committing bool 2021-03-30 16:42:53 -04:00
Richard Hansen
3ee6b5eb2b collab_client: Delete unused caughtErrors 2021-03-30 16:42:53 -04:00
Richard Hansen
81b9a2544d collab_client: Factor out duplicate ACCEPT_COMMIT code 2021-03-30 16:42:53 -04:00
snyk-bot
dd09a3f12b fix: src/package.json & src/package-lock.json to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-UNDERSCORE-1080984
2021-03-30 18:26:32 +02:00
Richard Hansen
b9753dcc71 Changeset: Return a new op object by default when iterating
Reusing the same op object for each iteration can result in very weird
behaviors because previously yielded op objects will get a surprise
mutation.

It is unclear why the code was written to reuse the same object. There
was no comment, nor is there a commit message providing rationale (it
has behaved this way since the very first commit). Perhaps the objects
were reused to improve performance (fewer object allocations that need
to be garbage collected). I do expect this change to reduce
performance somewhat, but not enough to warrant reverting this commit.
2021-03-29 18:42:55 -04:00
Richard Hansen
718da6fc1b tests: New helper.aNewPad() (promisified newPad()) 2021-03-29 18:40:05 -04:00
Richard Hansen
ec76a6548f tests: Make the helper.newPad() callback optional 2021-03-29 18:40:05 -04:00
Richard Hansen
27b35699ea tests: Fix helper.newPad() retries
* Pass retry count in options object so that each pad has its own
    retry count.
  * Delete useless `origPadName` variable.
2021-03-29 18:40:05 -04:00
translatewiki.net
eac5a52690 Localisation updates from https://translatewiki.net. 2021-03-29 17:55:09 +02:00
John McLear
b80f5bdae8
bugfix/tests/scaling: Socket query test fix (#4974)
fix socketio test where res.req is not available.
2021-03-24 21:03:48 +00:00
John McLear
2b98b930d7
scaling: include padId in socketio query string 2021-03-24 16:07:11 +00:00
webzwo0i
3ae6b01518 bump version 2021-03-22 16:17:18 +01:00
webzwo0i
65b644498f bump require-kernel dependency 2021-03-21 18:30:39 +00:00
John McLear
a8f9c2b6a7
fix: upgrade express-rate-limit from 5.2.5 to 5.2.6 (#4938)
Snyk has created this PR to upgrade express-rate-limit from 5.2.5 to 5.2.6.

See this package in npm:
https://www.npmjs.com/package/express-rate-limit

See this project in Snyk:
https://app.snyk.io/org/johnmclear/project/d9a12bfb-7ccd-443f-9e22-f30d339cc8c5?utm_source=github&utm_medium=upgrade-pr

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2021-03-20 17:45:00 -04:00
Richard Hansen
eb3cff5b3a LibreOffice: Remove unnecessary callbackification
`async.queue` will do the right thing if passed an `async` function.
2021-03-20 20:29:55 +00:00
Richard Hansen
0233399fdf Abiword: Avoid calling stdoutCallback multiple times 2021-03-20 20:29:55 +00:00
webzwo0i
c208d50c4a add version string to iframe_editor.css 2021-03-20 16:42:08 +00:00
webzwo0i
b250ceaae7 add test for wrong clientHeight 2021-03-20 16:41:15 +00:00
Richard Hansen
3ad1d0a74f cssmanager: Refactor CSS manager creation to avoid race condition
Safari takes a while to initialize `document.styleSheets`, which
results in a race condition when loading the pad. Avoid the race
condition by accessing the CSSStyleSheet objects directly from the
HTMLStyleElement DOM objects.
2021-03-20 01:07:16 +00:00
Richard Hansen
e2bfe2fd10 pad_editor: Promisify init() 2021-03-20 01:07:16 +00:00
Richard Hansen
81e36cf3c7 Ace2Inner: Promisify init() 2021-03-20 01:07:16 +00:00
Richard Hansen
742a7cd430 cssmanager: Throw if no matching style sheet is found
This avoids a later null dereference when the stack trace isn't as
useful.
2021-03-20 01:07:16 +00:00
Richard Hansen
5b05ee79ff cssmanager: Simplify iteration over style sheets 2021-03-20 01:07:16 +00:00
Richard Hansen
cb9f6d6776 ace: Use iframe srcdoc property to refine frame load logic
This seems to fix "null is not an object (evaluating
'browserSheet.insertRule')" errors on Safari.
2021-03-19 17:06:58 +01:00
Richard Hansen
b4e1e935e2 LibreOffice: Log conversion errors 2021-03-18 09:02:28 +00:00
Richard Hansen
b2c0837cf5 import/export: Promisify Abiword and LibreOffice conversion 2021-03-18 09:02:28 +00:00
Richard Hansen
b321267e66 LibreOffice: Use the async-provided callback to signal errors
This avoids having two callbacks, which improves readability.
2021-03-18 09:02:28 +00:00
Richard Hansen
b914a46a87 LibreOffice: Use async.series to properly handle conversion errors 2021-03-18 09:02:28 +00:00
Richard Hansen
a6d5611c80 LibreOffice: Use consistent intermediate filename 2021-03-18 09:02:28 +00:00
Richard Hansen
ad0be9d1d2 LibreOffice: Add missing fileExtension property on intermediate step 2021-03-18 09:02:28 +00:00
Richard Hansen
5eab3a123d Abiword: Use the async-provided callback to signal errors
This avoids having two callbacks, which improves readability.
2021-03-18 09:02:28 +00:00
Richard Hansen
8d32463915 Abiword: Fix logging of conversion failure 2021-03-18 09:02:28 +00:00
Richard Hansen
f015f59cfc Abiword: Reduce log spam 2021-03-18 09:02:28 +00:00
Richard Hansen
259ee4a987 Abiword: Don't call the callback if null 2021-03-18 09:02:28 +00:00
Richard Hansen
83f39289aa import/export: On export error return 500 instead of crashing 2021-03-18 09:02:28 +00:00
Richard Hansen
3a11e97758 import/export: Spelling fix: "convertor" -> "converter" 2021-03-18 09:02:28 +00:00
Richard Hansen
50fdadab7d ExportHandler: Pass the error unmodified 2021-03-18 09:02:28 +00:00
Richard Hansen
216aecd433 import/export: Use Error objects for errors, not strings 2021-03-18 09:02:28 +00:00
Richard Hansen
59c167e31b ExportHandler: Replace unnecessary exception with return 2021-03-18 09:02:28 +00:00
Richard Hansen
785b7d2b44 Abiword: Reset stdout buffer when starting abiword 2021-03-18 09:02:28 +00:00
Richard Hansen
b6c2586920 import/export: Delete unnecessary comments 2021-03-18 09:02:28 +00:00
Richard Hansen
fe1eceb6b5 tests: Use assert to simplify import/export tests 2021-03-18 09:02:28 +00:00
Richard Hansen
98c42d6076 tests: Promisify import/export tests 2021-03-18 09:02:28 +00:00
Richard Hansen
ff50682412 tests: Increase import/export test timeouts 2021-03-18 09:02:28 +00:00
translatewiki.net
5c9514f926 Localisation updates from https://translatewiki.net. 2021-03-15 19:03:09 +01:00
Richard Hansen
c5a37d7a92 deps: Bump ueberdb2 to get MySQL improvements 2021-03-13 19:51:43 +00:00
webzwo0i
6f591b5c77
add class pad to timeslider to fix height issue (#4941) 2021-03-12 21:16:22 -05:00
webzwo0i
8e2a21ec84
arrow functions dont have arguments (#4943) 2021-03-12 14:25:14 -05:00
Richard Hansen
0b9bf4a78e deps: Update ueberdb2 to get updated metrics 2021-03-11 20:21:38 +00:00
Richard Hansen
9b82d1d37d server: Log stats (metrics) on fatal error
This might help users troubleshoot rare crashes.
2021-03-11 07:38:44 +00:00
Richard Hansen
d2610284ad bin/safeRun.sh: Fix try: not found bug
This fixes a copy+paste bug introduced in commit
8b28e00784 (v1.8.8).
2021-03-10 02:54:20 -05:00
Richard Hansen
fcf43a7089 stats: Expose ueberDB metrics 2021-03-08 22:32:39 +00:00
Richard Hansen
71dfa7070d deps: Update ueberdb2 to get metrics 2021-03-08 22:32:39 +00:00