Commit Graph

3479 Commits (a78d6605b7d6bd1a990e094b39f1fc932745aa96)

Author SHA1 Message Date
Richard Hansen a78d6605b7 lint: Configure ESLint 2020-11-24 20:06:12 +00:00
Richard Hansen 6665c4693f Clear hang timeout timer when LibreOffice exits
This prevents `npm test` from freezing for two minutes after the tests
complete.

Also switch to an arrow function for the `setTimeout` callback.
2020-11-24 10:04:14 +00:00
webzwo0i f2febcfc7e
minify: Fix gzip not triggered for packages (#4491)
* caching_middleware: fix gzip compression not triggered

* packages: If a client sets `Accept-Encoding: gzip`, the responseCache will
include `Content-Encoding: gzip` in all future responses, even
if a subsequent request does not set `Accept-Encoding` or another client
requests the file without setting `Accept-Encoding`.
Fix that.

* caching_middleware: use `test` instead of `match`

* add tests

* make code easier to understand

* make the regex more clear
2020-11-22 09:23:33 +00:00
John McLear 776eda2d4e
import/export: Kill soffice spawned process after 120 seconds (#4499)
Due to libreoffice being buggy / hanging on certain pdf imports (even in 7.0.3) we should just kill it so it doesn't consume CPU indefinitely.
2020-11-20 18:33:31 -05:00
Richard Hansen 867fdbd3f9 webaccess: Asyncify `checkAccess` 2020-11-19 09:05:38 +00:00
Richard Hansen a803f570e0 webaccess: Don't export `checkAccess`
Nobody uses it outside of this module.
2020-11-19 09:05:38 +00:00
Richard Hansen 5d585a12d6 webaccess: Fix some ESLint errors 2020-11-19 09:05:38 +00:00
Richard Hansen 4587c0fb4d webaccess: Use a non-capturing regex group 2020-11-19 09:05:38 +00:00
Richard Hansen a05e8198c9
bugfix: Fix bad paren placement in `/javascript` handler (#4496)
* Fix bad paren placement in `/javascript` handler

This fixes a bug introduced in commit
ed5a635f4c.

* add regression test for #4495

* Move `/javascript` test to `specialpages.js`

Co-authored-by: webzwo0i <webzwo0i@c3d2.de>
2020-11-19 08:19:13 +00:00
Richard Hansen 07bcbbd404 pad: Include the stack in the data sent to `/jserror` 2020-11-17 08:02:27 +00:00
Richard Hansen c845d985e0 pad: Pop up an error message on unhandled Promise rejection 2020-11-17 08:02:27 +00:00
Richard Hansen 93c335b3b8 pad: Use a relative URL to simplify
Also avoid creating an unnecessary variable.
2020-11-17 08:02:27 +00:00
translatewiki.net 41d02db023 Localisation updates from https://translatewiki.net. 2020-11-16 15:15:14 +01:00
webzwo0i 1d8e8d3484 terser was not called because mime type did not match 2020-11-15 19:46:48 +00:00
Richard Hansen cedd27e4fe plugins: Default the module name to the plugin name 2020-11-13 20:30:27 +00:00
Richard Hansen afb025030c plugins: Use a log4js logger for npm messages 2020-11-13 20:30:27 +00:00
Richard Hansen 8a918fbc46 plugins: `async`ify more functions 2020-11-13 20:30:27 +00:00
Richard Hansen 9f575ebc84 plugins: Delete unused `ensure` function 2020-11-13 20:30:27 +00:00
Richard Hansen ac5614dadd plugins: Don't export `callInit`
It's unused outside of this module.

Also use an arrow function.
2020-11-13 20:30:27 +00:00
Richard Hansen ba4794cf8a plugins: Call `require('./hooks')` at top level 2020-11-13 20:30:27 +00:00
Richard Hansen 14a9479e69 plugins: Use functions from `fs.promises` 2020-11-13 20:30:27 +00:00
Richard Hansen d624aa936e plugins: Fix plugin name in error messages 2020-11-13 20:30:27 +00:00
Richard Hansen 6a8563eeab import/export: Simplify exportEtherpadAdditionalContent processing
Also:
  * Improve parallelization
  * Refine the documentation
2020-11-10 23:02:43 +00:00
Richard Hansen 8c55a38582 HTML export: Add missing `)`
This bug was introduced in 68a91f5e24.
2020-11-10 02:51:55 -05:00
Richard Hansen 68a91f5e24 HTML export: Move `padId` to context object property 2020-11-10 07:13:26 +00:00
John McLear 881d8b8d95
pluginfw: Hook to include additional body in HTML exports (#4469)
* hook, needs docs

* docs
2020-11-06 13:48:59 +00:00
John McLear 3fa58efede
pluginfw: Export .etherpad hooks (#4466)
* export support

* proper prefix

* just a basic example, needs working on still

* docs

* comments shouldnt be hard coded
2020-11-06 13:48:25 +00:00
ilmar d5c5ca224b Fix missing arg handling in html10n.js 2020-11-05 10:38:22 +00:00
Richard Hansen 405e3e3e19 Settings: Don't filter out users based on `password` or `hash`
Some authentication plugins use the users defined in the `users`
object but ignore the `password` and `hash` properties.

This change deletes all of the filtering logic, including the logic
that filters out users that have both `password` and `hash` properties
defined. I could have kept that check, but decided to remove it
because:
  * There's no harm in defining both `hash` and `password`.
  * Allowing both makes it easier to transition from one scheme to
    another.
  * It's fewer lines of code to maintain.
2020-11-04 18:06:08 +00:00
Richard Hansen 6408d2313c webaccess: Be extra paranoid about nullish password
If `settings.json` contains a user without a `password` property then
nobody should be able to log in as that user using the built-in HTTP
basic authentication. This is true both with and without this change,
but before this change it wasn't immediately obvious that a malicious
user couldn't use an empty or null password to log in as such a user.
This commit adds an explicit nullish check and some unit tests to
ensure that an empty or null password will not work if the `password`
property is null or undefined.
2020-11-04 18:06:08 +00:00
Richard Hansen 98de2b0899 Use `contentEditable` for all browsers
This makes it possible to disable `contentEditable` for certain
elements in some circumstances (e.g., on links so that users can click
on them normally).
2020-11-03 19:02:01 +00:00
Richard Hansen 5e2a27a182 Replace `setClassPresence(x, ...)` with `x.classList.toggle(...)` 2020-11-03 19:02:01 +00:00
Richard Hansen 4594608c04 Delete commented-out code 2020-11-03 19:02:01 +00:00
Richard Hansen 91268e14b7 PadMessageHandler: Rename `client` to `socket`
The `client` variable is actually a socket.io Socket object. Rename it
to reduce confusion.
2020-11-02 20:39:08 +00:00
Richard Hansen ed5a635f4c Add `req` to EJS render args when possible
This makes it possible for EJS templates and `eejsBlock_*` hook
functions to access the user's express-session state.
2020-11-02 16:05:01 +00:00
translatewiki.net 127923eb54 Localisation updates from https://translatewiki.net. 2020-11-02 12:40:50 +01:00
Gabriel Medeiros Coelho ce77c48475 remove unnecessary conditional
if animationState evaluates to -1 or 0, it would end up in a conditional that assign its value to itself. Since this is redundant, it is better to remove this conditional, to avoid an extra check
2020-11-01 01:41:09 -05:00
webzwo0i 66a3647579 remove broken async inclusion in tar.json 2020-10-27 20:33:09 +00:00
Richard Hansen 2f65987ba2 webaccess: Remove user's password from session info
This prevents the password from being logged or stored in the
database.
2020-10-27 20:30:01 +00:00
translatewiki.net 50c22f0ae4 Localisation updates from https://translatewiki.net. 2020-10-26 15:56:46 +01:00
Viljami Kuosmanen c502ca3259 Use isHttpError utility provided by http-errors
This new utility method was introduced in http-errors v1.8.0. Let's use
that instead of instanceof. This also upgrades the http-errors dependency
2020-10-25 10:45:58 +00:00
Viljami Kuosmanen aef4cce0c9 Use correct constructor for 404,501 error handlers
Fixes error message mentioned in #4378.
2020-10-25 10:45:58 +00:00
Sebastian Castro 5a1110d0d6 Display outline when toolbar button focused 2020-10-25 10:34:51 +00:00
Richard Hansen 193028702d pad: Don't paste when middle-clicking on a link 2020-10-25 07:06:29 +00:00
Andrew Dassonville bee1ae06d8 utils: Fix commit checking on detached HEAD 2020-10-24 16:22:01 -04:00
John McLear cb5fcbb74e
editor: allow paste into links (#3802) 2020-10-24 16:59:03 +01:00
Richard Hansen 36aceb3aba hooks: Rewrite `callAll` and `aCallAll` for consistency
Rewrite the `callAll` and `aCallAll` functions to support all
reasonable hook behaviors and to report errors for unreasonable
behaviors (e.g., calling the callback twice).

Now a hook function like the following works as expected when invoked
by `aCallAll`:

```
exports.myHookFn = (hookName, context, cb) => {
  cb('some value');
  return;
};
```
2020-10-24 16:08:50 +01:00
Richard Hansen 79119baf58 hooks: Call the callback when done
If a hook function neither calls the callback nor returns a
(non-undefined) value then there's no way for the hook system to know
if/when the hook function has finished.
2020-10-24 16:08:50 +01:00
Richard Hansen 55939a0d7e hooks: Delete unused `flatten` function 2020-10-24 16:08:50 +01:00
Wouter bd2343f131 Added nl translations for adminpage 2020-10-23 16:18:57 -04:00