Commit Graph

6727 Commits (1c8a9134118f8032721264dab9d989bba4934939)

Author SHA1 Message Date
Richard Hansen 1c8a913411 lint: Delete unnecessary `eslint-disable-line` comment 2021-02-13 08:12:53 +00:00
Richard Hansen d56a02c85a express: Forcibly terminate HTTP connections when restarting
This should make restarts via `/admin` actions (e.g., plugin
installation) more reliable.
2021-02-13 07:37:22 +00:00
John McLear 4c4c7b526d
performance: i18n maxage (#4759) 2021-02-13 02:35:25 -05:00
Richard Hansen 01c83917d1 socket.io: Manually track client connections/disconnections
This change is required for socket.io 3.x because in 3.x
`io.sockets.clients()` no longer returns all client Socket objects.
2021-02-13 07:13:37 +00:00
Richard Hansen 66544be354 lint: `src/tests/backend/specs/api/api.js` 2021-02-13 00:46:30 -05:00
Richard Hansen eb9d5bb470 lint: `src/tests/frontend/helper.js` and friends 2021-02-13 00:46:30 -05:00
Richard Hansen 8f2f6593be lint: Re-run `eslint --fix` 2021-02-13 00:31:36 -05:00
Richard Hansen db8ca2818f lint: Treat `helper.js` and friends as normal browser files
This enables the prefer-arrow/prefer-arrow-functions rule.
2021-02-13 00:29:30 -05:00
John McLear bcd5e36688 tests: backend and frontend tests for image upload 2021-02-12 18:00:47 -05:00
John McLear 55c96e5577 socketio: increase socketio limit to 1MiB 2021-02-12 17:56:50 -05:00
John McLear fcd9adf20d
tests: admin test timeout increase, bugfix and removal of buggy test (#4762) 2021-02-12 20:04:42 +00:00
Richard Hansen 73d31b12a8 Minify: Replace deprecated `url.parse()` with `new URL()` 2021-02-12 07:08:51 +00:00
Richard Hansen 7efca7dc7d Minify: Don't ignore request headers in `requestURI()` 2021-02-12 07:08:51 +00:00
Richard Hansen 7a003cb9e2 Minify: Let Express render the 500 error page 2021-02-12 07:08:51 +00:00
Richard Hansen 44e420b6c5 Minify: Return `Date` objects from `statFile()` 2021-02-12 07:08:51 +00:00
Richard Hansen aa11667ff7 Minify: Use `fs.promises` 2021-02-12 07:08:51 +00:00
Richard Hansen 073052ac66 Minify: Asyncify `minify()` 2021-02-12 07:08:51 +00:00
Richard Hansen 3eefe71834 Minify: Don't set cache headers if `statFile()` causes 500 2021-02-12 07:08:51 +00:00
Richard Hansen 84190793dc Minify: Asyncify `getFileCompressed()` 2021-02-12 07:08:51 +00:00
Richard Hansen dd7ea1a8f9 Minify: Asyncify `statFile()` 2021-02-12 07:08:51 +00:00
Richard Hansen 947dc8eeed Minify: Asyncify `getFile()` 2021-02-12 07:08:51 +00:00
Richard Hansen 5d7c07e81c Minify: Asyncify `lastModifiedDateOfEverything()` 2021-02-12 07:08:51 +00:00
Richard Hansen e573276755 Minify: Asyncify `getAceFile()` 2021-02-12 07:08:51 +00:00
Richard Hansen 5cc191f185 Minify: Replace `async.forEach()` with `Promise.all()` 2021-02-12 07:08:51 +00:00
Richard Hansen 0c428e068e Minify: Use `Promise.all()` to simplify `requestURIs()` 2021-02-12 07:08:51 +00:00
Richard Hansen 1ec29e0d45 Minify: Asyncify `requestURI()` 2021-02-12 07:08:51 +00:00
Richard Hansen a952df2cf5 Minify: Un-export `requestURI()`
Nobody outside this file uses it.
2021-02-12 07:08:51 +00:00
Richard Hansen d9607f7c66 static: Asyncify 2021-02-12 07:08:51 +00:00
Richard Hansen 7f4a7156e2 Minify: Move `getTar()` to `static.js`
`static.js` is the only file that uses it.
2021-02-12 07:08:51 +00:00
Richard Hansen 996dc81825 Minify: Move tar processing into a function
This reduces the overhead of `require()`ing the module, and it will
make it easier for a future commit to asyncify everything in
`Minify.js`.
2021-02-12 07:08:51 +00:00
Richard Hansen 8ae8710a14 ace: Fix EMBEDDED check 2021-02-12 07:08:51 +00:00
Richard Hansen 50929fe7f7 express: Call expressConfigure, expressCreateServer hooks asynchronously 2021-02-12 07:08:51 +00:00
Richard Hansen 8919f63c98 lint: Replace use of underscore.js with plain ECMAScript 2021-02-12 07:08:51 +00:00
John McLear ab127289c4 security: limit socketio to 1M chars 2021-02-11 21:01:47 -05:00
Richard Hansen 085ab452a0 chat tests: Give some time to process each of the 140 chat messages
This avoids overflowing socket.io's receive buffer.
2021-02-11 21:01:47 -05:00
Richard Hansen 020df75677 chat tests: Asyncify 2021-02-11 21:01:47 -05:00
Richard Hansen 0fae34009d chat tests: Delete unnecessary `expect()` 2021-02-11 21:01:47 -05:00
snyk-bot f6df9ffad0 fix: upgrade measured-core from 1.11.2 to 1.51.1
Snyk has created this PR to upgrade measured-core from 1.11.2 to 1.51.1.

See this package in npm:
https://www.npmjs.com/package/measured-core

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-02-11 18:39:08 +00:00
John McLear cc7f11560f
Fix OL list items not increasing (#4749)
* tests: additional test coverage for OL items

* parseInt means we can do a proper check

* tests: use ol check value test for #4748
2021-02-11 13:26:37 -05:00
snyk-bot 60a55ec428 fix: upgrade resolve from 1.1.7 to 1.19.0
Snyk has created this PR to upgrade resolve from 1.1.7 to 1.19.0.

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

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-02-11 18:24:32 +00:00
snyk-bot b50fcb065a fix: upgrade underscore from 1.8.3 to 1.12.0
Snyk has created this PR to upgrade underscore from 1.8.3 to 1.12.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-02-11 18:18:11 +00:00
translatewiki.net 2f1d648787 Localisation updates from https://translatewiki.net. 2021-02-11 18:48:51 +01:00
Richard Hansen 2301c6ec83 pad: Don't throw on socket.io error 2021-02-11 17:25:09 +00:00
Richard Hansen fc9f236977 plugins: Use `npm ls` to list the installed plugins
This speeds up startup considerably, and we get rid of a lot of buggy
code.

This works with both npm v6.x and v7.x.
2021-02-09 22:18:35 +00:00
Richard Hansen ce1b69feda plugins: Helper function to run the `npm` CLI 2021-02-09 22:18:35 +00:00
Richard Hansen 87341af429 GitHub workflows: Install Node.js v12
I'm not sure how these tests ever worked. I guess some version of
Node.js and npm come pre-installed on the ubuntu-latest images?

I would have prefered to use Node.js v10 because that is our current
minimum supported version, but we have a surprising number of tests
that don't work on Node.js v10 (mostly due to `assert.match()`, which
was added in Node.js v12).
2021-02-09 22:18:35 +00:00
Richard Hansen 83a519941b /admin/plugins: Fix logging of error messages 2021-02-09 22:18:35 +00:00
John McLear 94a65062c7
checkPlugins: remove lib/travis.yml and add github badges if they aren't present (#4731)
A future PR should remove all Travis badges and CI jobs.
2021-02-09 09:41:41 +00:00
Richard Hansen ebdb2798ff server: Fix handling of errors during startup and shutdown
Before, an unhandled rejection or uncaught exception during startup
would cause `exports.exit()` to wait forever for startup completion.
Similarly, an error during shutdown would cause `exports.exit()` to
wait forever for shutdown to complete. Now any error during startup or
shutdown triggers an immediate exit.
2021-02-09 08:57:24 +00:00
Richard Hansen 5999d8cd44 server: Only pass `err` arg to `exports.exit()`
The `uncaughtException` event handlers are passed two arguments: error
and "origin". The `exports.exit()` argument doesn't expect a second
argument.
2021-02-09 08:57:24 +00:00