Commit graph

494 commits

Author SHA1 Message Date
John McLear
2fdc737355
bugfix, lint and refactor all bin scripts (#4617)
* bugfix, lint and refactor all bin scripts

* for squash: throw Error(message) rather than log(message); throw Error()

* for squash: Exit non-0 on unhandled Promise rejection

Many of the recent lint changes have converted normal functions to
async functions, and an error thrown in an async function does not
cause Node.js to exit by default.

* for squash: fix `require()` paths

* for squash: remove erroneous `Object.keys()` call

* for squash: fix missing `continue` statements

* for squash: Fix HTTP method for deleteSession

* for squash: delete erroneous throw

Throw is only for errors, not successful completion.

* for squash: redo migrateDirtyDBtoRealDB.js to fix async bugs

* for squash: fix erroneous use of `for..of`

* for squash: Add line break between statements

* for squash: put closing paren on same line as last arg

* for squash: Move `log()` back up where it was

to minimize the diff to develop

* for squash: indentation fixes

* for squash: typo fix

* for squash: wrap long lines

* for squash: use `util.callbackify` to silence promise/no-callback-in-promise warning

* for squash: use double quotes to improve readability

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-01-18 08:53:15 +00:00
Richard Hansen
edbe6d5387 Bump ueberDB to get speed improvements 2021-01-11 09:23:08 +00:00
Richard Hansen
481fa047e4 checkPlugin: Merge the autoupdate option into autofix 2021-01-11 08:51:04 +00:00
Richard Hansen
039c50de80 checkPlugin: Make autocommit imply autoupdate, autoupdate imply autofix 2021-01-11 08:51:04 +00:00
Richard Hansen
27df9df47f checkPlugin: Revise README.md 2021-01-11 08:51:04 +00:00
Richard Hansen
adb38d0d61 checkPlugin: Display a diff of the changes 2021-01-11 08:51:04 +00:00
Richard Hansen
6ccbe374d8 checkPlugin: Don't nuke node_modules/
`git add -A` will ignore `node_modules/` because it's in `.gitignore`.
2021-01-11 08:51:04 +00:00
Richard Hansen
5f2aaea255 checkPlugin: Use git to determine whether there were changes 2021-01-11 08:51:04 +00:00
Richard Hansen
9f4bcfb79b checkPlugin: Ensure that a peer dep for ep_etherpad-lite exists
Tweak the new `updateDeps()` function and use it to add the
`ep_etherpad-lite` dependency if it is missing.
2021-01-11 08:51:04 +00:00
Richard Hansen
42da976705 checkPlugin: Move dependency update logic to a generic function
This will make it possible to reuse the logic for `peerDependencies`.
2021-01-11 08:51:04 +00:00
Richard Hansen
747f323552 checkPlugin: Use absolute path when installing ep_etherpad-lite
This makes it possible to check plugins that were installed by
symlinking into `node_modules/` like this:

    git clone git@github.com:ether/etherpad-lite.git
    git clone git@github.com:ether/ep_example.git
    cd etherpad-lite
    npm i ep_example@file:../ep_example
    node ./bin/checkPlugin.js ep_example
2021-01-11 08:51:04 +00:00
Richard Hansen
b719affe6e checkPlugin: Unconditionally run npm install 2021-01-11 08:51:04 +00:00
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
Richard Hansen
e4fec3883b bin: Improve readability of email body 2020-06-03 23:11:44 -04:00
Richard Hansen
ab408ce653 bin: Put log parameter handling logic together 2020-06-03 23:11:44 -04:00
Richard Hansen
335705e03d bin: Simplify cd to install dir 2020-06-03 23:11:44 -04:00
Richard Hansen
2f76066d95 bin: Simplify while loop condition 2020-06-03 23:11:44 -04:00
Richard Hansen
57237b8568 bin: Quote expansions that are subject to field splitting 2020-06-03 23:11:44 -04:00
Richard Hansen
a28b7c7595 bin: Use assertion-style condition checks 2020-06-03 23:11:44 -04:00
Richard Hansen
5462d2109c bin: Create and use new logging functions
These write errors to stderr and avoid unintentional backslash escape
processing in their arguments.
2020-06-03 23:11:44 -04:00
Richard Hansen
a87a9bb63b bin: Use command to check for commands
`command` is more idiomatic than `hash`. (Also, `hash` has side
effects.)
2020-06-03 23:11:44 -04:00
Richard Hansen
8e8b75be6c bin: Use consistent comment formatting 2020-06-03 23:11:44 -04:00
Richard Hansen
be1f2152fc bin: Use single equals sign for string comparison
Double equals is a non-POSIX bashism.
2020-06-03 23:11:44 -04:00
Richard Hansen
9ffb2ccfb0 Revert "scripts: Various shell script cleanups (#4008)"
This reverts commit fba4fd5314.

The series of commits I made for PR #4008 were squashed into a single
commit and rebased. Somewhere along the way a mistake was made in a
merge conflict resolution, resulting in some bad code in
`bin/buildForWindows.sh`. This commit reverts the bad squashed commit.
2020-06-03 23:11:44 -04:00
Richard Hansen
fba4fd5314
scripts: Various shell script cleanups (#4008) 2020-06-01 21:02:44 +01:00
John McLear
930e80d363
script: Delete group sessions script and fix issue where loadSettings has been moved breaking deletePad (#3973) 2020-06-01 19:36:40 +01:00
Stefan
9fdb9e224c
Windows: Always use latest erbium node version for windows build 2020-06-01 18:14:39 +01:00
muxator
2087a2e564 startup: use "npm ci" instead of "npm install" in startup scripts
Advantages:
- reproducible install: every user will have the same, exact install, instead of
  a slightly different one
- speed: installation of dependencies is measurably faster
- explicit: if a user setup is broken, from now on he'll have a clear error
  message

Fixes #3778
2020-05-15 02:20:46 +02:00
brunob
edfc7a4916 bin: use correct ueberdb module path "ueberDB" -> "ueberdb2" in tools in /bin
This change is analogous to #2998 (e11decc6f8).
2020-05-15 01:22:41 +02:00
John McLear
94921b53fd migrateDirtyDBtoRealDB: fix the script not trusting length, and directly iterating on dirtyDB tuples
Fixes #2214.
2020-05-13 23:04:01 +02:00
John McLear
d155b792e9 migrateDirtyDBtoRealDB: formatting
No functional changes.
2020-05-13 23:04:01 +02:00
muxator
ed46bd9bfe windows: bump the node version included in the prebuilt package: 10.18.0 -> 10.20.1
This is the latest version as of today.
2020-04-26 23:06:38 +02:00
muxator
db77302883 doc: remove old vendorized marked module and replace with 0.8.2
This change is needed because in 1.8.3 we are going to introduce Markdown tables
in the documentation (#3873 and #3921), and the old marked version did not
support generating them.

Instead of committing the marked source code here, we live install from npm if
needed via the Makefile.

n.b.: at the time of this change, marked latest version is 1.0.0, released a few
      days ago. I am updating to the version immediately before that (0.8.2),
      because in 1.0.0 the hyperlinks in the Table of Contents do not work
      (probably a bug in that version).
2020-04-24 02:24:53 +02:00
Sebastian Castro
8956efc4ae bin: add fastRun.sh script for developers
Useful for developers, or users that know what they are doing. If you just
upgraded Etherpad version, installed a new dependency, or are simply unsure of
what to do, then before running this script, please execute bin/installDeps.sh
once.

Fixes #3711 (partially)
2020-04-17 18:36:24 +02:00
muxator
684f374ece runtime: require node >= 10.13.0 LTS
At the moment, NodeJS 10.x is the lowest supported LTS version. NodeJS 8.x is no
longer supported upstream.

Implements #3835.
Planned in #3650.
2020-04-09 04:43:37 +02:00
John McLear
cdf5b63f26 use a deletePad approach that works when server is running and works with MySQL 2020-04-03 03:31:18 +02:00
muxator
a181ea8fbe bin: replace double backticks (``) with $()
This has been the recommended way of launching subshells for ages, and is easier
to type and on the eye.

For a quick reference, see:
https://unix.stackexchange.com/questions/5778/whats-the-difference-between-stuff-and-stuff#5782
2020-03-29 00:53:17 +01:00
John McLear
14ae2ee950 checkPadDeltas: version by JohnMcLear
From https://github.com/ether/etherpad-lite/pull/3717#issuecomment-602179127

> Afaik I used async / await that's pretty much all, I think I had to do some
> polish because something was broken, remember stuff like pad.getPadAuthors was
> b0rked in 1.7 or so
2020-03-27 01:50:56 +01:00
Marcel Klehr
90f9b8a3bd checkPadDeltas: original version from marcelklehr (2014-05-14)
Committed by muxator on 2020-03-22, taking the raw version from:
c65b496402/checkPadDeltas.js
2020-03-27 01:50:56 +01:00
muxator
5bcc5a3be0 windows: bump the node version included in the prebuilt package: 10.16.3 -> 10.18.0
This is the latest version as of today.
2019-12-18 02:00:08 +01:00
muxator
0a86024797 startup scripts: get rid of $* and replace it with properly quoted "$@"
In shell scripts an unquoted $* is rarely useful, for example because it breaks
in presence of file names with spaces.

References:
- https://google.github.io/styleguide/shell.xml
  Use "$@" unless you have a specific reason to use $*.

- https://unix.stackexchange.com/questions/41571/what-is-the-difference-between-and#94200
  Short answer: use "$@" (note the double quotes). The other forms are very
  rarely useful.
2019-12-01 01:52:32 +01:00
muxator
9ee131ca1f installDeps.sh: create a package-lock.json on startup. Track it in the repo.
This change reverts c4918efc1b, and basically negates what was done for #3396,
but aligns better with current practices in the nodejs ecosystem.

Pragmatically speaking, this will allow users, if they want, to use
npm-force-resolutions (https://github.com/rogeriochaves/npm-force-resolutions)
to manually fix security vulnerabilities.
We had a problem for that (see #3598), and - given the fragmented nature of
the nodejs ecosystem - it is reasonable to expect more issues like that one,
so it's better to be prepared.

Closes #3659.
2019-10-31 19:20:28 +01:00
muxator
529c4a314e windows: bump the node version included in the prebuilt package: 8.15.0 -> 10.16.3
Nodejs 8.x is going to be EOLed in a few months, and newer nodejs runtimes are
typically faster, a much needed benefit under Windows.

Closes #3652.
2019-10-20 03:16:01 +02:00
muxator
ce666f19bd windows: do not include dev dependencies in the prebuilt package
This makes the package smaller.

Before this change:
    added 981 packages from 1497 contributors [...]
    53M etherpad-lite-win.zip

After this change:
    added 734 packages from 1043 contributors [...]
    43M etherpad-lite-win.zip

Closes #3651.
2019-10-20 03:12:39 +02:00
muxator
312c72c364 formatting: bulk remove trailing whitespaces
Do not touch vendorized files (e.g. libraries that were imported from external
projects).

No functional changes.

Command:
    find . -name '*.<EXTENSION>' -type f -print0 | xargs -0 sed -i 's/[[:space:]]*$//'
2019-10-20 02:09:22 +02:00
muxator
4f753809fe runtime: decrease minimum command-line npm version from 6.4 to 5.5
When nodejs 8.9.0 was released, its bundled npm version was 5.5.1 (see
https://nodejs.org/en/download/releases). It makes sense that we lover our
requirement to that version.

Please note that the npm version mentioned here does not refer to the npm
library installed as Etherpad dependency in node_modules via package.json
(which indeed is higher) but is merely the npm version used to bootstrap the
installation when running installDeps.sh.

This change amends 9d35d15ae3 and its planning issue - #3424 - which were too
strict.
2019-10-19 22:38:32 +02:00
Ray Bellis
c499a08030 bin/repairPad.js: conversion to promise/async
- but see also github issue #3545
2019-01-30 10:47:50 +00:00
Ray Bellis
7709fd46e5 utility scripts: converted to use the Promise interface 2019-01-26 23:52:02 +00:00
muxator
9497ee734f prepare to async: trivial reformatting
This change is only cosmetic. Its aim is do make it easier to understand the
async changes that are going to be merged later on. It was extracted from the
original work from Ray Bellis.

To verify that nothing has changed, you can run the following command on each
file touched by this commit:
  npm install uglify-es
  diff --unified <(uglify-js --beautify bracketize <BEFORE.js>) <(uglify-js --beautify bracketize <AFTER.js>)



This is a complete script that does the same automatically (works from a
mercurial clone):

```bash
#!/usr/bin/env bash

set -eu

REVISION=<THIS_REVISION>

PARENT_REV=$(hg identify --rev "${REVISION}" --template '{p1rev}')
FILE_LIST=$(hg status --no-status --change ${REVISION})
UGLIFYJS="node_modules/uglify-es/bin/uglifyjs"

for FILE_NAME in ${FILE_LIST[@]}; do
  echo "Checking ${FILE_NAME}"
  diff --unified \
    <("${UGLIFYJS}" --beautify bracketize <(hg cat --rev "${PARENT_REV}" "${FILE_NAME}")) \
    <("${UGLIFYJS}" --beautify bracketize <(hg cat --rev "${REVISION}"   "${FILE_NAME}"))
done
```
2019-02-08 23:20:57 +01:00
muxator
b34fc2de2b use Date.now() instead of new Date().getTime()
This is documented to be more performant.

The substitution was made on frontend code, too (i.e., the one in /static),
because Date.now() is supported since IE 9, and we are life supporting only
IE 11.

Commands:
  find . -name *.js | xargs sed --in-place "s/new Date().getTime()/Date.now()/g"
  find . -name *.js | xargs sed --in-place "s/(new Date()).getTime()/Date.now()/g"

Not done on jQuery.
2019-02-26 23:25:15 +01:00
muxator
9d35d15ae3 node8: require nodejs >= 8.9.0, npm >= 6.4
Next version will be Etherpad 1.8. As planned in #3424, we are going to require
NodeJS >=8.9.0 and npm >= 6.4.

This commit implements that change and updates documentation and scripts.
Subsequent changes will get rid of old idioms, dating back to node < 0.7, that
still survive in the code.
Once migrated to NodeJS 8, we will be able to start working on migrating the
code base from callbacks to async/await, greatly simplifying legibility (see
#3540).

Closes #3557
2019-02-19 22:01:12 +01:00
muxator
acc0b05702 windows: 1.7.5 was released with node 8.15.0. Document it here. 2019-01-27 13:48:24 +01:00
Joseph C Wang
ae49409593 fix for python3 2019-01-22 22:23:18 +01:00
HairyFotr
fce55df2b7 Fix typos 2019-01-16 11:14:04 +01:00
Luiza Pagliari
59cae81152
[chore] Allow debug mode on node versions >= 6.3 (#3527)
I've tried to install `node-inspector` using Node 8 and it looks like it is not supported. 

According to the [documentation of that tool](https://www.npmjs.com/package/node-inspector):

> Since version 6.3, Node.js provides a built-in DevTools-based debugger which mostly deprecates Node Inspector (...). The built-in debugger (...) provides certain advanced features (...) that are too difficult to implement in Node Inspector.

As [we require nodejs >= 6.9.0](https://github.com/ether/etherpad-lite#requirements), and as [`node-inspector` only works on Chrome and Opera](https://www.npmjs.com/package/node-inspector#debug), it looks like a good approach to remove the dependency of that tool and use Chrome DevTools directly. Besides, [there are other tools available](https://nodejs.org/en/docs/guides/debugging-getting-started/#inspector-clients) for debugging, if Chrome is not an option.

This PR also allow external connections to the inspector, so Etherpad instances running on containers can also be debugged. [There are obviously some risks to leave that opened on public IPs](https://nodejs.org/en/docs/guides/debugging-getting-started/#exposing-the-debug-port-publicly-is-unsafe), but I assumed no instance would run on debug mode for the final user.
2018-12-22 10:28:50 -02:00
Stefan More
799319882c migrateDirtyDBtoRealDB: disabled write buffer, #2214 2018-11-27 21:18:40 +01:00
Stefan More
b8fa179622 migrateDirtyDBtoRealDB: added hint regarding memory, #2214 2018-11-27 21:18:40 +01:00
Achim Friedland
5f836f6211 Try/catch to skip invalid JSON in dirtyDB 2018-11-03 00:12:08 +01:00
muxator
9aaa02ec70 installDeps: no need to download jquery at starting time. Remove curl dependency
In installDeps.sh we have a bunch of code (from 2011) that checks for the
existence of jQuery and eventually downloads it, but since 1239ce7f28 (year
2012) jquery is vendorized in /src/static/js/jquery.js.

Also, stop mentioning curl as a dependency in the README.md

Fixes #3494
2018-10-07 18:56:28 +02:00
muxator
c09e638fc3 installDeps.sh: don't nuke all installed plugins on update
This is a modification of PR #3474 by rohieb <rohieb@rohieb.name>.

When this script is run after an update, and something fails during the npm
run, the installed plugins were deleted, too.

In this version what gets deleted is only the directory that contains the
direct dependencies of the core Etherpad, ie:
  node_modules/ep_etherpad-lite/node_modules
2018-08-29 21:45:33 +02:00
muxator
0c518cadf5 skins: replace {js,css}.template with actual files. Simplify startup scripts.
Currently, an Etherpad skin requires the existence of 6 files:
- index.{css,js}
- pad.{css,js}
- timeslider.{css,js}

In the default empty skin (in static/custom), there were 2 small placeholders
({js,css}.template) to be copied in place by the startup script in case no skin
was in use.

Now that we are moving to multiple directories (see #3471) we can simply commit
the example files and remove the copying code from the startup script.
2018-08-26 21:17:04 +02:00
muxator
5f9de6948c cleanRun.sh: get rid of "Bad substitution" error
It was introduced in 4a18f0d97d (#3356).
2018-08-17 22:22:14 +02:00
muxator
d7696413da createRelease.sh: deprecate the script. It will be removed or modified.
Starting with Etherpad 1.7.0, the branching strategies for releases will be
simplified.
Leaving this script here, as it's useful for documenting other release-related
activities.
2018-08-17 00:09:25 +02:00
"muxator ext:(%22)
d23cf924c9 installDeps: replace GNU specific long options whith short ones
Long options are only present in GNU cut, and we aim to also support other
platforms.
2018-07-31 12:44:17 +02:00
muxator
379690abbf tests: backend tests are now run with "npm test" instead of a custom bash script 2018-07-28 23:54:51 +02:00
muxator
a3ae374a67 installDeps: made version detection more robust. Require Node >= 6.9, npm >= 3.10
require_minimal_version() tries to parse semvers in a Posix portable way and
ensure a minimal Major.minor version is met.
2018-07-28 23:33:24 +02:00
muxator
c4918efc1b installDeps.sh: do not modify package.json when installing dependencies
installDeps.sh's only side effect should be to actually install dependencies
according to a configuration file, and not to modify it.

Adding --no-save to the npm command line forces npm to have a read only access
to package.json.

Old npm versions seem to support --no-XXX style flags even if not documented
(see https://github.com/npm/npm/issues/14285#issuecomment-254298519)

Tested with npm 3.5.2 and 6.1.0

Fixes #3396
2018-07-14 17:54:26 +02:00
muxator
6dbeca217e createRelease.sh: changelog editing failed for multiline messages
sed does not accept multiline strings in its replacement text.
Let's replace newlines with literal "\n" in modify_files()
2018-05-04 00:36:09 +02:00
muxator
903a2c8e43 createRelease.sh: added error checking in modify_files()
Otherwise, when inserting a multiline changelog sed would with this message:
  sed: -e expression #1, char 27: unterminated `s' command

And the script would continue with an unmodified CHANGELOG.md
For simmetry, added the same check to package.json, too
2018-05-03 23:54:08 +02:00
John McLear
0c8b9e13fa
Merge pull request #3242 from BenaeSan/master
FIX the installOnWindows Error
2018-04-03 13:06:30 +01:00
John McLear
ad89cb7d78
Merge pull request #3331 from sevu/pythonv2
specify python version in shebang
2018-04-03 13:00:45 +01:00
John McLear
e6e46404d1
Merge pull request #3342 from caugner/patch-1
Add checkPad variant to check all pads/revisions
2018-04-03 12:58:23 +01:00
Bryce York
4a18f0d97d
Fix bug with cleanRun.sh
Now works if the output of `pwd` has a space in it.
2018-03-28 22:38:30 +11:00
Claas Augner
5c915062e1
checkAllPads: Increase performance/resilience
Performance: Don't preload pads. Check for pool only once per pad.
Resilience: Handle missing revision.
2018-03-09 14:02:22 +01:00
Claas Augner
5c864ec47d
Add checkPad variant to check all pads/revisions 2018-03-09 13:45:24 +01:00
Severin Glöckner
0139965864 specify python version 2018-03-01 07:57:46 +01:00
John McLear
ad09e8ed76
Update package.json 2017-11-20 08:46:24 +00:00
Stefan (Gared)
e347f12c71 Updated node version for windows to 8.9.0 2017-11-04 17:02:25 +01:00
HairyFotr
c7548450c0
Typos and minor fixes in bin, doc, and root 2017-09-14 13:33:27 +02:00
bm jade
64aee56940 FIX
missing backslashes
2017-08-07 17:15:02 +02:00
bm jade
193afacb6f FIX
fix provide by skupfer from github, It fix the installOnWindows problem
2017-08-07 16:36:44 +02:00
jeffreyye
9ca56a4c7e wrong path of generate.js 2017-04-04 15:13:07 +08:00
Stefan
8992dd665a Merge new release into master branch! 2016-12-23 22:00:34 +01:00
Stefan
6dc808ad54 Release version 1.6.1 2016-12-23 21:59:57 +01:00
Stefan
caabb4d8f7 Update nodejs for windows to 6.9.2 2016-12-22 23:15:49 +01:00
Stefan
d1d2e462d0 Updated node for windows build to version 6.9.1 2016-11-20 12:32:36 +01:00
rugk
f4bbe00322 Download JQuery over HTTPS
Otherwise anyone can MITM the connection and add rogue code there.
2016-07-23 16:59:47 +02:00
Stefan
e11decc6f8 Fix module paths for db migration script 2016-06-08 19:43:53 +02:00
Stefan
1349cfd486 Fix error if whitespace in etherpad path 2016-05-16 16:58:58 +02:00
Stefan
fb96f32028 Update node for windows to version 4.4.3 2016-04-24 20:42:53 +02:00
Stefan
8aa297fb40 Remove node version output on start 2016-04-24 20:29:07 +02:00
Stefan
7637b0cd19 Increase version of node for windows to 4.4.2 2016-04-03 16:57:15 +02:00
John McLear
e1999d826c allow greater than or equal to v 4 2016-03-27 13:31:00 +08:00
John McLear
75cd4b3333 Merge pull request #2924 from Gared/update_windows_build
Update windows build
2016-03-26 22:11:40 +08:00
Stefan
2a81d2a578 Remove support for io.js 2016-03-20 15:21:56 +01:00
Stefan
18d583d92d Check for node version 4 or higher and not special versions 2016-03-20 15:19:34 +01:00
Stefan
3738211fd8 Do not include absolute path in windows zip 2016-03-20 14:13:26 +01:00
Stefan
bd2372def1 Update windows build:
- Update node to version 4.4.0
- Create temp folder dynamically
2016-03-14 21:56:04 +01:00
Reed A. Cartwright
843b05a6ec Use exec to switch to node process
At the end of run, `exec` should be used to switch to the node process.  That way node will take over the pid of `sh run.sh`, making it easier to monitor and daemonize the server. 

```
    exec [command [arg ...]]
             Unless command is omitted, the shell process is replaced with the
             specified program (which must be a real program, not a shell
             built-in command or function).  Any redirections on the exec com-
             mand are marked as permanent, so that they are not undone when
             the exec command finishes.
```
2016-01-19 16:17:16 -07:00
Blake Tölva
c61aa20028 Improve DB migration performance.
Achieve 10x speedup in migrating a 12mb dirtyDB file by disabling
ueberDB caching in this special case.  Add some progress messages
to the migration script and rename it, as nothing in it is tied
to mysql.
2015-11-21 23:15:46 -08:00
Komasa
5f9d1397e2 Update installDeps.sh 2015-11-04 21:15:13 +01:00
John McLear
02f88aafff Update installOnWindows.bat 2015-10-22 16:22:35 +01:00
John McLear
fa46f0b613 Merge pull request #2797 from ypid/rebuild-better-error
Give better error message when rebuildPad.js hits a non-existing rev.
2015-10-22 16:15:27 +01:00
Robin Schneider
c9924ee706
Give better error message when rebuildPad.js hits a non-existing rev. 2015-10-07 12:42:19 +02:00
Stefan
bf7930fccb Support version 4 of node.js 2015-09-26 12:15:54 +02:00
István Király
376fccfe92 bugfix for correct bash syntax
$rocks has to be enclosed into a "string" so bash can treat is as a string.
We can compare two strings with the == operator then, ...
2015-06-22 16:11:29 +02:00
Hinnerk Haardt
7ba5e97a60 Use current mysql client API 2015-05-30 15:14:40 +02:00
John McLear
e1406b826b cleaner update logic doesnt error when nothing to do 2015-04-26 14:42:21 +01:00
John McLear
a6a8c4d909 provide a script that cleans up before running to save people doing rm rf src node_modules 2015-04-24 07:07:18 +01:00
John McLear
70d338c7d5 Merge pull request #2618 from Gared/win_node_version
Update node version for windows build to 0.12.2
2015-04-16 21:58:13 +01:00
Stefan
f81c6b6476 Update node version for windows build to 0.12.2 2015-04-16 22:56:14 +02:00
John McLear
a3ce6b1ca7 remove two pointless dep removes 2015-04-15 15:51:13 +01:00
Tom Hunkapiller
4385598de6 update node version checking to 0.10+ or io.js 2015-04-08 23:12:12 -05:00
Tom Hunkapiller
63cbab484d express dropped support for node 0.8; update engine requirements 2015-04-08 23:12:11 -05:00
Raphaël Dubigny
119fc82387 Update installDeps.sh 2015-04-04 17:30:41 +02:00
Raphaël Dubigny
dfd17d1aba Update installDeps.sh 2015-04-04 17:14:59 +02:00
LeoVerto
7e9bc1b7b9 Fix minor typo in safeRun.sh email report 2015-03-31 18:33:47 +02:00
Stefan
0505a47356 Support node version 0.12.x 2015-02-15 22:21:41 +01:00
John McLear
f880b0feb7 clean up iojs 2015-01-21 12:18:38 +00:00
nemetz
648ebc08d6 check for io.js
Added a check for io.js
2015-01-16 11:11:34 -02:00
Jan-Erik Rediger
1f558dc843 Removed useless use of cat 2015-01-08 14:16:07 +01:00
John McLear
80fa2c2868 move docs 2014-12-24 02:45:21 +00:00
John McLear
1ab7dfdb7b Merge pull request #2358 from BjarniRunar/develop
Created dirty-db-cleaner.py - prunes old history from dirty.db files
2014-12-23 15:50:59 +00:00
John McLear
ffdce760d5 remove unused long paths from windows build 2014-12-21 22:05:07 +00:00
John McLear
89adbb9f12 Merge pull request #2329 from timrchavez/rebuild-pad-script
Restore pad to new location at a given revision
2014-12-04 02:34:21 +00:00
Timothy Chavez
c7b1aebfe8 Make changes based on code review
Simplified the cloning process, added validation checks to ensure the
new pad ID is valid and that a pad doesn't already exist with that ID.
Also fixed a bug in the chatHead cloning loop and added the ability to
specify a pad ID on the command the line (defaulting to the original
"-rebuilt" pad ID formula)
2014-12-03 20:11:39 -06:00
Bjarni R. Einarsson
9c174023fc Added dirty-db-cleaner.py 2014-12-01 22:39:42 +00:00
John McLear
c6d7ed114e script to update all plugins with one command on CLI 2014-11-28 16:27:12 +00:00
John McLear
5434d2118d tidy up and re-organize 2014-11-26 19:28:49 +00:00
John McLear
88b3d99fbd Merge branch 'develop' of github.com:ether/etherpad-lite into backend-tests 2014-11-26 15:33:13 +00:00
John McLear
0a84379364 make additional line break at end of imported doc 2014-11-26 15:19:22 +00:00
John McLear
3ac833d455 basic test runner 2014-11-25 22:47:22 +00:00
John McLear
97068b562d more old load testing cruft 2014-11-25 01:22:32 +00:00
John McLear
5e843a5877 remove jshint 2014-11-25 01:21:19 +00:00
Timothy Chavez
25ccb6cfc3 Simplify the rebuild process
The majority of the information needed to build the new pad can be
communicated by simply cloning the rev using a db.set().
2014-11-20 22:09:21 -06:00
Timothy Chavez
01f6d85371 Restore pad to new location at a given revision
This script gives an admin with shell access the ability to restore a
pad at a given revision by essentially rebuilding it at a new location
with data associated with the original pad.  The upsides to creating a
new pad vs. changing the original are: 1) avoiding service disruptions
(no deletes, no moving targets - builds from previous revision); and 2)
preservation of data (no deletes, no overwriting of the source pad).
The most obvious downside is the pad has a new ID which could require
folks to update their links, bookmarks, etc. to point at the new
location.
2014-11-19 13:09:37 -06:00
Stefan
94968e69be Add support for npm 2 2014-09-27 12:30:11 +02:00
Gared
ab607d3137 Add a script to reinsert all db values of a pad 2014-05-19 18:18:01 +02:00
Luc Didry
3d8452b143 Replace tabs indentation with spaces indentation
Some files are obviously external libraries, I didn't touch them
2013-12-05 08:41:29 +01:00
John McLear
8c1e066a02 mkdir 2013-11-24 13:13:29 +00:00
John McLear
97f5b581b0 cp readme on build 2013-11-24 13:08:26 +00:00
John McLear
1eef5278bd growwlll 2013-11-24 12:51:50 +00:00
John McLear
6ee57746c9 whoopsi 2013-11-24 12:44:09 +00:00
John McLear
d6f1aa3236 clean 2013-11-24 12:41:12 +00:00
John McLear
678c80d1dc whoa there, no need to include .git folder in build 2013-11-24 02:57:15 +00:00
John McLear
09429be4c9 whoops 2013-11-24 02:52:55 +00:00
John McLear
61df1facd2 semi-working build script for deb packages 2013-11-24 02:42:50 +00:00
John McLear
1f68f07083 support node 0.11 2013-11-14 22:46:58 +00:00
John McLear
fa4ebd602c Update installDeps.sh 2013-11-12 09:58:22 +00:00
John McLear
932c9ae406 allow nix file process path to be visible in ps aux 2013-11-10 16:32:33 +00:00
Eric Schrijver
b34224559d ‘Etherpad Lite’ -> ‘Etherpad’ 2013-09-29 13:57:37 +02:00