Commit graph

332 commits

Author SHA1 Message Date
Richard Hansen
bba47ea2df checkPlugin: Make sure package.json ends with a newline 2021-01-11 08:51:04 +00:00
Richard Hansen
bf8d55ab8e checkPlugin: New writePackageJson() convenience function 2021-01-11 08:51:04 +00:00
Richard Hansen
b3b9afa668 checkPlugin: Split dirty working directory check into two checks
Rather than check for modifications and untracked files in one
command, use two commands: one for modifications and one for untracked
files. This makes the error messages easier to understand, and it
allows us to include `git status`-like output in the modifications
error message.
2021-01-09 22:49:27 +00:00
Richard Hansen
6a13baf7d4 checkPlugin: Use --name-status for git diff-index
`--compact-sumary` is relatively new (v2.17.0), and I actually
intended to use `--name-status` anyway.
2021-01-09 22:49:27 +00:00
Richard Hansen
071cca1d48 checkPlugin: Don't create an empty commit 2021-01-09 08:05:31 +00:00
Richard Hansen
38ca0c52a6 checkPlugin: Add lots of Git sanity checks 2021-01-09 08:05:31 +00:00
Richard Hansen
1a9bfc8d4f checkPlugin: Don't capture stdout when unnecessary 2021-01-09 08:05:31 +00:00
Richard Hansen
102c01f723 checkPlugin: Move log messages where they make more sense 2021-01-09 08:05:31 +00:00
Richard Hansen
d816bb2b38 checkPlugin: New execSync() convenience function 2021-01-09 08:05:31 +00:00
Richard Hansen
a55dd73f2b Typo fix: checkPlugins.js -> checkPlugin.js 2021-01-08 19:02:55 -05:00
Richard Hansen
44118c0e7b checkPlugin: Refine installation of lint dependencies 2021-01-08 19:02:55 -05:00
Richard Hansen
a0d21f75c4 checkPlugin: Add missing lint dependency 2021-01-08 18:42:10 -05:00
Richard Hansen
6890bfada1 checkPlugin: Bump eslint, eslint-config-etherpad versions 2021-01-08 18:24:42 -05:00
Richard Hansen
ba1c468865 checkPlugin: Fix command-line argument parsing bug 2021-01-08 18:07:55 -05:00
John McLear
fd3004faad
checkPlugins: various minor updates (#4635)
Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-01-07 21:52:45 -05:00
Richard Hansen
3373f059e6 Plugin publish workflow: Run git push before npm publish 2021-01-05 21:59:03 +00:00
John McLear
6012a9a480 scripts: include v in release number to fix rleease script docs 2021-01-05 16:45:14 +00:00
John McLear
4671b275e9 script: various fixes to release script 2020-12-23 16:27:02 -05:00
John McLear
b59461a469 script: include package files in release script logic 2020-12-23 16:18:28 -05:00
John McLear
89ae726221 script: close console log in release script... 2020-12-23 16:18:28 -05:00
John McLear
ece7fd896c scripts: A script to create an Etherpad release (#4538) 2020-12-23 16:18:28 -05:00
Richard Hansen
f54dcbc766 lint: Re-run eslint --fix 2020-12-16 22:09:48 +00:00
John McLear
003363bc89
checkPlugin: dont run sauce labs connector on travis backend tests (#4542) 2020-12-05 08:21:08 +00:00
John McLear
ee0a37f96c checkPlugins fix travis and include contributing.md 2020-12-05 07:50:16 +00:00
John McLear
239a0bccbd checkPlugins: improve travis config to not error 2020-12-05 07:50:16 +00:00
John McLear
d1e9ea6e27
tests/plugins: checkPlugins backend tests config
Tnx to @webzwo0i 👍
2020-11-30 17:22:52 +00:00
John McLear
42c0d80914 plugins: checkPlugin script includes remove node_modules if committed. 2020-11-28 13:13:14 +00:00
John McLear
325941a1ad
plugins: add peerdeps and correct engine to checkPlugins script (#4524)
* pere deps example

* fixed by rh

* doh

* doh...
2020-11-27 21:43:23 +00:00
Richard Hansen
5fcf5f6135 checkPlugin.js: Use https, not http, for Etherpad URL 2020-11-27 14:55:51 -05:00
Richard Hansen
2fdac836d0 lint: Bump eslint-config-etherpad to 1.0.13
Also bump eslint to 7.14.0.
2020-11-27 06:25:43 +00:00
Richard Hansen
b8d07a42eb lint: Run eslint --fix on bin/ and tests/ 2020-11-24 20:06:12 +00:00
Richard Hansen
7df3ded66f lint: Put opening brace on same line as function
Normally I would let `eslint --fix` do this for me, but there's a bug
that causes:

    const x = function ()
    {
      // ...
    };

to become:

    const x = ()
    => {
      // ...
    };

which ESLint thinks is a syntax error. (It probably is; I don't know
enough about the automatic semicolon insertion rules to be confident.)
2020-11-24 20:06:12 +00:00
Richard Hansen
cc988bd67b lint: Convert CR+LF line endings to LF 2020-11-24 20:06:12 +00:00
Richard Hansen
029f2f765e checkPlugins: Revise npmpublish.yml
* Add commentary explaining why things are done the way they are.
  * Delete steps that were added for debugging.
  * Pass `--no-save` when installing `ep_etherpad-lite`.
2020-11-23 19:09:52 +00:00
John McLear
c702fdb488
checkPlugins: Support adaptive npmpublish.yml (#4509) 2020-11-23 16:34:26 +00:00
John McLear
b167f97048
plugins: include eslint in checkPlugins.js (#4505)
* probably not working but dumping up

* check plugins lint
2020-11-22 14:58:11 +00:00
John McLear
cfc7e47db0
plugins: Various checkPlugins.js and associated file fixes. (#4439)
This PR makes checkPlugins some what more useful for developers.  

It adds auto npm publish support and various travis improvements among other goodies.
2020-11-02 16:13:24 +00:00
jeanfabrice
52f8fc9ba3
legacySupport: Run node 10 with '--experimental_worker' flags (#4392)
* Run node 10 with '--experimental_worker' flags
* Use dedicated function to retrieve node/npm program version

The goal of this commit is to ensure that any linux based node 10 deployments run with the experimental_worker flag.  This flag is required for workers to "work" in node 10.  This will not affect other versions of node.  This resolves #4335 where Docker would fail due to being based on node 10.
2020-10-06 13:28:11 +01:00
John McLear
ff4da04907 no need to ask for translations if no template files are included 2020-09-23 09:25:17 +01:00
Richard Hansen
3365e944bf async-ify more functions, and await completion
Where feasible I put the await at the end of the function to
minimize the impact on latency.

My motivation for this change: Eliminate a race condition in tests I
am writing.
2020-09-22 14:10:44 +01:00
Richard Hansen
6c2a361935 import: Use the correct author ID when using sessions
There are two different ways an author ID becomes associated with a
user: either bound to a token or bound to a session ID. (The token and
session ID come from the `token` and `sessionID` cookies, or, in the
case of socket.io messages, from the `token` and `sessionID` message
properties.) When `settings.requireSession` is true or the user is
accessing a group pad, the session ID should be used. Otherwise the
token should be used.

Before this change, the `/p/:pad/import` handler was always using the
token, even when `settings.requireSession` was true. This caused the
following error because a different author ID was bound to the token
versus the session ID:

> Unable to import file into ${pad}. Author ${authorID} exists but he
> never contributed to this pad

This bug was reported in issue #4006. PR #4012 worked around the
problem by binding the same author ID to the token as well as the
session ID.

This change does the following:
  * Modifies the import handler to use the session ID to obtain the
    author ID (when appropriate).
  * Expands the documentation for the SecurityManager checkAccess
    function.
  * Removes the workaround from PR #4012.
  * Cleans up the `bin/createUserSession.js` test script.
2020-09-08 15:04:17 +01:00
John McLear
7a076d1f3a
housekeeping: v3 of automatic plugin fixing tool.
Make sure plugins do npm install before being tested.
2020-08-22 15:50:55 +01:00
John McLear
91c0848ede
Plugin Developer Tools: Plugin check & fix tool
Automated tool to discover and fix common plugin faults.

https://mclear.co.uk/2020/07/18/suggestions-for-improving-etherpad-plugins/

- [x] Adds CI and updates existing travis configs.
- [x] Adds a LICENSE
- [x] Adds a .gitignore
- [x] Adds a README and checks it includes a reference to the license
- [x] Recommends translations
- [x] Checks for files that shouldn't exist and removes them (.ep_initialized, npm-debug.log)

still to do in the distant future depending on usage.
- [ ] Check packages.json includes link to github repo
- [ ] Checks Etherpad is referred to as Etherpad Lite
- [ ] Checks README includes animated gif.
2020-07-26 13:18:02 +01:00
John McLear
78c97d811c
Script to create session and store token <> author more throughly (dont create ghosts) (#4012) 2020-07-16 10:51:02 +01:00
Benson Muite
b361e6e7ed
Fix for better user color selection. (#4142)
Colorpallet has 64 colors, not 32, see line 26 in [src/node/db/AuthorManager.js](4c45ac3cb1/src/node/db/AuthorManager.js) 
By expanding to full range, get better contrasts when there are more than 15 users. It may be helpful to examine color choices a little more and find a better algorithm for automatically assigning colors to users.
2020-06-30 09:40:14 +01:00
Richard Hansen
17a1b96736 bin: Fix 'for' loop style 2020-06-03 23:11:44 -04:00
Richard Hansen
4f0b1fa7ec bin: Improve the run-as-root confirmation prompt
* Send the prompt to stderr
  * Print "> " without a newline so the user knows it is a prompt
  * Wrap long lines
  * Use a here-document
2020-06-03 23:11:44 -04:00
Richard Hansen
18fb75968a bin: Use ISO 8601 date format 2020-06-03 23:11:44 -04:00
Richard Hansen
edfe59e84f bin: Improve restart notification email 2020-06-03 23:11:44 -04:00
Richard Hansen
98e6ec3517 bin: Log the date in the restart message 2020-06-03 23:11:44 -04:00