Commit Graph

1332 Commits (ba6bdf35be1d35ca3a7f57e6066c92eb228f6fc7)

Author SHA1 Message Date
Ray Bellis 8108964472 db/AuthorManager.js: further conversion
also fixes a missing await calling `.createAuthor` in db/Pad.js
2019-01-28 15:36:36 +00:00
Ray Bellis 005c0afa97 db/SessionManager.js: completely converted to Promises/async 2019-01-28 14:44:36 +00:00
Ray Bellis e58da69cfb db/SecurityManager.js: converted checkAccess() to pure Promises
Also converted the handler functions that depend on checkAccess() into async
functions too.

NB: this commit needs specific attention to it because it touches a lot of
security related code!
2019-01-28 13:13:24 +00:00
Ray Bellis e7dc0766fd db/API.js: complete conversion to Promises
This patch also contains significant refactoring relating to error checking of
arguments supplied to the functions (e.g. rev) facilitated by use of `throw`
instead of nodeback errors.
2019-01-25 18:08:34 +00:00
Ray Bellis 1b6430ae9f db/PadMessageHandler.js: partial conversion to Promises
Converted those functions that API.js still depends on, and others that at this
point are never called via the nodeback mechanism.
2019-01-25 18:07:01 +00:00
Ray Bellis 8f53e4407e db/AuthorManager.js: partial conversion to Promises 2019-01-25 15:47:25 +00:00
Ray Bellis eedae98e2f db/PadManager.js: convert sanitizePadId() to Promises
The function is now iterative rather than recursive.
2019-01-25 15:15:16 +00:00
Ray Bellis bf9e3f92b5 db/PadManager.js: renamed doesPadExists() -> doesPadExist()
Removed the 's' for consistency with the other `doesFooExist()` manager calls.
Retained an alias for plugins that might be using it.
2019-01-25 15:05:12 +00:00
Ray Bellis a875ca6c30 db/SessionManager.js: mostly converted to Promises 2019-01-25 14:53:24 +00:00
Ray Bellis 16c4c33f49 db/AuthorManager.js: renamed doesAuthorExists() -> doesAuthorExist()
Removed the 's' for consistency with the other `doesFooExist()` manager calls.
Retained an alias for plugins that might be using it.
2019-01-25 13:37:24 +00:00
Ray Bellis 70a045ad3c db/GroupManager.js: mostly converted to Promises / async 2019-01-25 12:56:57 +00:00
Ray Bellis 29e9f86cad db/DB.js: add Promise-only API methods
Promisified methods:
  - get()
  - set()
  - findKeys()
  - getSub()
  - setSub()
  - remove()
  - doShutdown()
2019-01-23 18:08:47 +00:00
Ray Bellis 583ea92aaf db/SessionStore.js: do not migrate to Promises. Make optional all(), clear() and length()
1. This module was not migrated to Promises, because it is only used via
   express-session, which can't actually use promises anyway.

2. all(), clear() and length() depend on the presence of the `db.forEach()`
   function, which in ueberdb2 doesn't even exist.

   Fortunately those three methods are optional, so I made their existence
   conditional on the presence of `db.forEach`.

3. in SessionStore.clear(), replaced a call to db.db.remove() with db.remove()
2019-01-23 16:58:43 +00:00
muxator 630af9af7d db/SessionStore.js: call nextTick() only if there is something to do
Changed two occurrences of:

  process.nextTick(function() {
     if (fn) fn();
  });

with

  if (fn) {
    process.nextTick(fn);
  }

i.e. such that no function even gets added to the `nextTick` queue unless
there's actually a function to be called.

Extracted from Ray's work.
2019-02-09 00:14:53 +01:00
Ray Bellis 96d875b4d1 padurlsanitize.js: rewritten to consume promises 2019-01-23 16:36:28 +00:00
muxator b699621e5a padurlsanitize.js: invert a condition prior to refactoring
Extracted from Ray's work.
2019-02-09 00:05:21 +01:00
Ray Bellis d5d28717c4 access controls: promisification
`getPadAccess()` (src/node/padaccess.js) is now "promise only", resolving to
`true` or `false` as appropriate, and throwing an exception if there's an
error.

The two call sites (padreadonly.js and importexport.js) updated to match.
2019-01-23 16:29:36 +00:00
Ray Bellis 34fdaa4e8c db/SecurityManager.js: convert checkAccess() to thenify 2019-01-23 16:25:29 +00:00
Ray Bellis 23a3a079a6 tests.js: remove use of async.js
Use real `async` instead of async.js where applicable.
The `getPluginTests()` function was never truly async anyway because it only
contains calls to synchronous `fs` modules.
2019-01-23 16:21:40 +00:00
Ray Bellis 0c2d662541 plugins download and search: converted to Promises
Also fixed a bug where the system would make a request to the central server for
the plugin list for every search even if the list was already cached.
2019-01-23 12:24:53 +00:00
Ray Bellis 5ef4a2d1d5 more thenify in node/utils/* 2019-01-22 17:30:33 +00:00
Ray Bellis 584e481430 PadMessageHandler.js: migrate to thenify 2019-01-22 15:48:29 +00:00
Ray Bellis 5d7162ac9a utils/ImportHtml.js: migrate to thenify 2019-01-22 14:58:25 +00:00
Ray Bellis c4f1f83747 APIHandler.js: use promises 2019-01-22 13:30:28 +00:00
Ray Bellis ec5baa2ab3 PadMessageHandler.js: convert two remaining API calls to thenify 2019-01-22 12:58:26 +00:00
Ray Bellis 17fe32ec0c start using "thenify" to support callback and promises
PadManager.sanitizePadId() can't use thenify: single arg callback
2019-01-21 16:28:05 +00:00
muxator 40c45077ef db/GroupManager.js: factored out a variable
Extracted from Ray's work.
2019-02-09 01:15:50 +01:00
Ray Bellis 4877ec319a server.js: rewritten to use Promises 2019-01-18 16:10:25 +00:00
Ray Bellis 3802073695 db/DB.js: allow a Promise return instead of callbacks in init() 2019-01-18 13:48:46 +00:00
muxator b0846ded14 db/SessionManager.js: "authorMangager" -> "authorManager"
Extracted from Ray's work.
2019-02-09 02:19:14 +01:00
muxator 98993fe156 db/SessionManager.js: "groupMangager" -> "groupManager"
Extracted from Ray's work.
2019-02-09 02:18:36 +01:00
muxator 11453d544c prepare to async: stricter checks
This change is in preparation of the future async refactoring by Ray. It tries
to extract as many changes in boolean conditions as possible, in order to make
more evident identifying eventual logic bugs in the future work.

This proved already useful in at least one case.

BEWARE: this commit exposes an incoherency in the DB API, in which, depending
on the driver used, some functions can return null or undefined. This condition
will be externally fixed by the final commit in this series ("db/DB.js: prevent
DB layer from returning undefined"). Until that commit, the code base may have
some bugs.
2019-03-01 09:43:41 +01:00
muxator e841798314 prepare to async: typos in error messages
This change extracts the grammar correction performed on the async branch,
anticipating them in a single commit. It cannot be folded with the previous
one, as it is not purely cosmetic.
2019-02-15 22:52:53 +01: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 cc23bd18a4 db/API.js: require() Changeset library at top of file
Introduced with d246a191c6 ("Added option to restore revisions #1791") on
2014-11-08.
2019-03-07 00:39:41 +01:00
muxator 06756e49ee db/API.js: reuse the already required padMessageHandler (2 of 2)
It was introduced on 2014-11-12 by commit 9d39c9591a ("update pad clients").
2019-03-07 00:14:49 +01:00
muxator 72260b86de db/API.js: reuse the already required padMessageHandler (1 of 2)
Commit 94cb743ca8 ("Fix API call appendChatMessage to send new message to all
connected clients") fixed a bug, but introduced a redundant require().
2019-03-07 00:04:08 +01:00
muxator 10172af199 db/API.js: no need to parseInt(time) here
We are already sure that time is an int
2019-03-07 00:02:24 +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 90bfbeb38d PadMessageHandler.js: fixed logic error in a guard condition
The guard condition on count being non negative and < 100 used the wrong
boolean operator. In its form it was impossible.

This error was introduced in 2013, in 5592c4b0fe.
Fixes #3499
2019-02-27 00:56:41 +01:00
muxator 4b913172fe PadMessageHandler.js: renamed parameter in handleCustomMessage() to avoid name clash 2019-02-26 22:19:49 +01:00
muxator 791012bb9b PadMessageHandler.js: removed redundant return statement 2019-02-26 19:15:22 +01:00
muxator 46fdeb8dc4 ExportTxt.js: getPadTXT() does not need to be exported
This function is used only inside this module, and does not belong to its
external interface.
2019-02-22 23:32:10 +01:00
muxator 169a06793d db/API.js: almost removed optional argument handling
The HTTP API doesn't ever omit arguments, it always passes `undefined` for a
parameter that wasn't supplied in the request.

The functions that were simplified are:
  - getRevisionChangeset()
  - getText()
  - getHTML()
  - saveRevision()

The only function still supporting optional arguments is getPadSafe(), which is
only called from this module.
2019-02-19 00:15:54 +01:00
muxator 26f3f1bcd0 db/Pad.js: make "force" parameter non optional in Pad.prototype.copy()
This function was simulating two overloads:
  1. copy(destinationID, force, callback)
  2. copy(destinationID, callback), in this case "force" would be assumed false

But all the call sites always used the version with arity 3.
Thus, we can remove that optionality and always assume that the funcion will be
called with three parameters. This will simplify future work.
2019-02-13 14:01:24 +01:00
muxator 59a6f2e9b8 node8: get rid of node < 0.7 compatibility when deleting files.
- path.exists() is no longer part of nodejs
- fs.exists() is deprecated (as of nodejs >= 8)
- checking a file for existence before using it is open to raca condition. It is
  preferable to go ahead and use the file, and eventually handle the error
- we can afford two simple synchronous fs operations here
2019-02-19 22:01:12 +01:00
muxator 6d36bb2c53 node8: we can safely use os.tmpdir()
Since we are requiring node >= 8, we can safely use native functionalities.
2019-02-19 22:01:12 +01:00
muxator 09949c242a node8: we no longer need to use a shim for Object.values in stats.js 2019-02-19 22:01:12 +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 9d9b7c9faf NodeVersion.js: do not use callbacks, simplify calling style in server.js 2019-02-19 00:46:37 +01:00
muxator 36addd2205 server.js: group together the loading of the stats system
No functional changes, this is intended to simplify subsequent patches.
2019-02-19 00:41:51 +01:00
muxator d5d428c4ee windows: allow graceful shutdown on Windows, too
Until Etherpad 1.7.5, process.on('SIGTERM') and process.on('SIGINT') were not
hooked up under Windows, because old nodejs versions did not support them.
This excluded the possibility of doing a graceful shutdown of the database
connection under that platform.

According to nodejs 6.x documentation, it is now safe to do so. This allows to
gracefully close the DB connection when hitting CTRL+C under Windows, for
example.

Source: https://nodejs.org/docs/latest-v6.x/api/process.html#process_signal_events

  - SIGTERM is not supported on Windows, it can be listened on.
  - SIGINT from the terminal is supported on all platforms, and can usually be
    generated with <Ctrl>+C (though this may be configurable). It is not
    generated when terminal raw mode is enabled.
2019-02-16 00:14:39 +01:00
muxator 631b23f7a2 utils/AbsolutePaths.js: do not break when running as a Windows manual install
A Windows manual install has the same directory layout of a normal Unix one
(e.g. the nice symlink node_modules/ep_etherpad-lite -> ../src).
Only when running from the pre-built Windows package the directory layout is
different (e.g. src is physically copied into node_modules/ep_etherpad-lite).
The previous version of the code wrongly assumed that all Windows installs would
be run from the pre-built pakage.

In this version the path search is the same on all platform. If it fails, and we
are on Windows, there is a fallback for the specific case of the pre-built
package.

Fixes #3550
2019-02-11 03:28:02 +01:00
muxator 78c057af31 NodeVersion.js: factor out require('semver') 2019-02-08 19:10:49 +01:00
Ray Bellis c8e5d87268 api: simplify version table
This commit vastly shortens (and simplifies) the version table within
handler/APIHandler.js by building each version's entry incrementally based off
the previous version.

The resulting table has been validated by comparing the "before" and "after"
output of the following loop on both versions of the code (albeit with an
intermediate "sort" step to account for the different insertion order)

  for (let v in version) {
    let m = version[v];
    for (let [k, a] of Object.entries(m)) {
      console.log(v, k, a);
    }
  }

The patch also fixes a few typos, and removes a duplicate definition of
getChatHistory which in each applicable version was defined with two different
parameter lists, but where only the second would be used.
2019-01-22 22:51:22 +01:00
HairyFotr fce55df2b7 Fix typos 2019-01-16 11:14:04 +01:00
muxator 5b88882e34 LibreOffice: add debugging log statements 2018-11-01 00:22:27 +01:00
muxator 4b8a0ff4ac LibreOffice: rename variables (conversion is generic and not PDF-specific) 2018-11-01 00:18:26 +01:00
muxator 73d09f1c6c LibreOffice: rephrase comments (conversion is generic and not PDF-specific) 2018-10-31 22:34:11 +01:00
muxator df5618b274 ImportHandler: flattened code
Removed redundant else, no functional changes
2018-10-31 23:34:15 +01:00
muxator fcd88de900 ImportHandler: flattened code
Removed redundant else, no functional changes
2018-10-31 23:31:23 +01:00
muxator 49a7572cee ImportHandler: early return by condition inversion
No functional changes
2018-10-31 23:28:52 +01:00
muxator df15daac0e ImportHandler: early return by condition inversion
No functional changes
2018-10-31 23:27:22 +01:00
muxator 12bb97dc2d ImportHandler: early return by condition inversion
No functional changes
2018-10-31 23:24:56 +01:00
muxator 2b8e45e2bd ImportHandler: anticipated the error checking
No functional changes.
2018-10-31 23:22:50 +01:00
muxator 4c2ad68b69 ImportHandler: early return via DeMorgan's law
Inverted a boolean condition, no functional changes.
2018-10-31 23:20:55 +01:00
muxator f652ba8c52 ImportHandler: flattened code
Removed redundant else, no functional changes
2018-10-31 23:16:20 +01:00
muxator fb552b2dbb ImportHandler: early return via DeMorgan's law
Inverted a boolean condition, no functional changes.
2018-10-31 23:15:01 +01:00
muxator 9d104cc4b0 ImportHandler: early return via DeMorgan's law
Inverted a boolean condition, no functional changes.
2018-10-31 23:09:27 +01:00
muxator 395db73eb1 ImportHandler: early return by condition inversion
No functional changes
2018-10-31 23:00:45 +01:00
muxator 6727a77073 ImportHandler: flatten code
No functional changes
2018-10-31 22:55:58 +01:00
Luc Didry e8558e3497 Allow to import files using soffice
Currently, you have to use Abiword to convert odt, pdf and doc files to be able to import those files.
This add soffice as convertor too.
2018-10-31 22:21:48 +01:00
muxator 1a93ab4eb5 db/Pad: reversed truthy condition to make core logic evident
Since the original comparison compared for truthy and not for "===", and it's
3 AM now, I blindly negated it, in order to show how fragile it was in the first
instance.

No functional changes.

This is the final commit of this refactoring series.
2018-08-29 03:03:34 +02:00
muxator 69e1bf28aa db/Pad: reversed condition to make core logic evident. No functional changes
Here it was legal to replace a lax comparison with a strict one, since we are
using indexOf(), whose return value is known.
2018-08-29 02:52:26 +02:00
muxator d931a700b4 db/Pad: reversed condition to make error handling evident. No functional changes
Here it was legal to replace a lax comparison with a strict one, since we are
using indexOf(), whose return value is known.
2018-08-29 02:49:40 +02:00
muxator 0e8789863c db/Pad: removed unuseful else clause, no functional changes 2018-08-29 02:46:08 +02:00
muxator 049f5f2859 db/Pad: removed unuseful else clause, no functional changes 2018-08-29 02:44:51 +02:00
muxator e90487c3e2 db/GroupManager: early return, no functional changes 2018-08-29 02:42:29 +02:00
muxator a1d21c0cd2 db/GroupManager: early return, no functional changes 2018-08-29 02:41:53 +02:00
muxator 9ed7608421 db/GroupManager: early return, no functional changes 2018-08-29 02:41:14 +02:00
muxator da8faa1aa9 db/GroupManager: early return, no functional changes 2018-08-29 02:40:14 +02:00
muxator f7254a47ea db/GroupManager: early return, no functional changes 2018-08-29 02:39:05 +02:00
muxator 604952bc97 db/GroupManager: fix indentation
This is to make easier on the eye the next change.
2018-08-29 02:38:09 +02:00
muxator c85bcf0614 db/GroupManager: move inner function on top. No functional change
This is to make easier on the eye the next change.
2018-08-29 02:36:25 +02:00
muxator 6af419a88e SecurityManager.js: early return, no functional changes 2018-08-29 02:33:29 +02:00
muxator 61823e7689 db/AuthorManager: early return, no functional changes 2018-08-29 02:28:40 +02:00
muxator 2b8646a855 db/AuthorManager: early return, no functional changes 2018-08-29 02:28:35 +02:00
muxator b59818676e db/API.js: early return to make error handling evident. No functional changes 2018-08-29 02:18:32 +02:00
muxator 67ce19eddb db/API.js: removed unuseful else clause, no functional changes 2018-08-29 02:16:24 +02:00
muxator 610a6db8c8 db/API.js: early return, no functional changes 2018-08-29 02:13:06 +02:00
muxator fef57efd46 db/API.js: early return, no functional changes 2018-08-29 02:10:45 +02:00
muxator 42bc0a59e1 db/API.js: early return, no functional changes 2018-08-29 02:09:33 +02:00
muxator 05a33f1533 db/API.js, SessionManager: lot of copied & pasted code in integer parsing
Replaced with an early return, no functional changes.
2018-08-29 02:08:05 +02:00
muxator 1d45a63864 db/API.js: early return, no functional changes 2018-08-29 01:57:00 +02:00
muxator 30d814d8ed db/API.js: early return, no functional changes 2018-08-29 01:57:28 +02:00
muxator 4728736dd8 db/PadManager: early return, no functional changes 2018-08-29 01:47:38 +02:00
muxator ecb0c41d29 db/PadManager: early return, no functional changes 2018-08-29 01:46:18 +02:00
muxator 12f224ae72 db/PadManager: early return, no functional changes 2018-08-29 01:44:13 +02:00
muxator 391bd79e03 padurlsanitize: early return, no functional changes 2018-08-29 01:38:55 +02:00
muxator d19436d044 adminsettings: early return, no functional changes. 2018-08-29 01:34:45 +02:00
muxator b60c0b122c PadMessageHandler: reversed condition to make core logic evident. No behavioural changes.
This one replaces a big "if (message)" negating its truthy condition.

Being lame, I erred on the safe side and wrote a super ugly statement that is
guaranteed to respect the original logic.

In the hope that eventual logic errors become more evident now.

See: https://stackoverflow.com/questions/36661748/what-is-the-exact-negation-of-ifvariable-in-javascript#36661843
2018-08-29 01:23:38 +02:00
muxator 324929ca2d PadMessageHandler: early return to reduce code depth.
Get rid of an else branch to simplify code layout. No functional changes at all.

==============

This series is an attempt to reduce the control structure depth of the code
base, maintaining at the same time its exact same behaviour, bugs included. It
is, in a sense, an initial attempt at a refactoring in the spirit of its
original definition [0].

The idea beyond this refactoring is that reducing the code depth and, sometimes,
inverting some conditions, bugs and logic errors may become easier to spot, and
the code easier to read.

When looked at ignoring whitespace changes, all of these diffs should appear
trivial.

[0] https://refactoring.com/
2018-08-29 00:57:28 +02:00
muxator fb1f8dd239 toolbar: missing var declaration
Without this, Etherpad would fail to start in strict mode:
  "ReferenceError: SelectButton is not defined"
2018-08-27 01:34:01 +02:00
muxator 27b3b0ecd2 logs: on the server, use template literals when possible
It's just synctactic sugar, but it is always better than executing string
concatenations in one's mind.

Do not do this with files in src/static, because we want to keep IE 11
compatibility.
2018-08-27 01:29:37 +02:00
muxator 0e972aaecf settings: reword some log messages 2018-08-27 01:56:33 +02:00
muxator 9c990ab08a skins: finalize support for multiple skins
The old "static/custom" directory is replaced by "static/skins/<skinName>",
where <skinName> is taken from settings.json.
When no value is found, a default of "no-skin" is assumed, so that backward
compatibility is maintained.

The most evident security concerns have been addressed.

Closes #3471.
2018-08-26 21:17:04 +02:00
muxator e34c74b24d skins: the settings class understands skinName. Send skinName value to the client
skinName must be a single string (no directory separators in it) pointing to an
existing directory under /src/static/skins.
In case these conditions are not met, its value is rewritten to "no-skin".

Also, the value of skinName if sent to the client via clientVars for allowing
its use it in the browser.
2018-08-26 21:17:04 +02:00
Luc Didry 2cc32d7fe9 Add --writer option to soffice convert command
If you edit `src/templates/export_html.html` to remove the
`<meta name="changedby" content="Etherpad">` tag[1], PDF export with
soffice has a bug: the first word of the pad is deleted and a blank page
is inserted as first page (the pad's text begins on the second page).
The `--writer` soffice option avoids that bug.

[1] you may want to delete that tag since it is inserted as a comment in
.doc or .odt soffice export.
2018-08-24 18:26:51 +02:00
muxator d1481041c2 specialpages: replace relative paths for sendfile() with absolute ones
This file uses it for robots.txt and favicon.ico.

This makes use of the new stable settings.root introduced with #3466, and will
be modified when introducing support for custom skins.
2018-08-23 23:39:38 +02:00
muxator 9db5fd7884 AbsolutePaths: introduced isSubdir()
It can be used to check whether a user input or a configuration settings tries
to traverse the directory hierarchy, going out of its allowed bounds.

source: https://stackoverflow.com/questions/37521893/determine-if-a-path-is-subdirectory-of-another-in-node-js#45242825
2018-08-23 07:20:17 +02:00
muxator ce14a99606 settings, APIHandler: use makeAbsolute() for locating APIKEY and SESSIONKEY 2018-08-23 07:02:45 +02:00
muxator 8247d5eef3 settings: use makeAbsolute() for locating settings.json and credentials.json
This should look to consistent locations when looking for relative paths,
without depending on current working directory.
For absolute paths, nothing changes.
2018-08-23 07:02:45 +02:00
muxator 435b2a4edf settings: the dirtyDb file path is interpreted using makeAbsolute()
Otherwise its position depended on process.cwd
2018-08-23 07:02:45 +02:00
muxator 5406472d65 AbsolutePaths: makeAbsolute() computes an absolute path from a relative one
The base is assumed to be exports.findEtherpadRoot(), without depending on
process.cwd.
2018-08-23 07:02:45 +02:00
muxator 1b938a7a40 settings: compute exports.root via AbsolutePaths.findEtherpadRoot()
First steps for fixing #3466.
2018-08-23 07:02:45 +02:00
muxator b1a0e14ee2 AbsolutePaths: written findEtherpadRoot()
This is just a function (with an ugly side effect for caching purposes) that
heuristically tries to compute the Etherpad installation path when running under
Unix and win32 (they have different file system layouts).

This path can be used by Etherpad as a base for all the relative paths, in order
to be deterministic and not depending on cwd.
2018-08-23 07:02:45 +02:00
muxator cbce3c1b08 AbsolutePaths: written utility function popIfEndsWith()
It will be necessary in the next commit to evaluate the Etherpad base
install path.
2018-08-23 07:02:45 +02:00
muxator dbf7eff1fc AbsolutePaths: module for deterministically computing relative Etherpad paths
Empty for now.
2018-08-23 07:02:45 +02:00
muxator ec5573f88c settings, APIHandler: generate more informative logs 2018-08-21 00:05:15 +02:00
muxator b635371d52 settings: the default dirty.db location should be var/dirty.db
This is the location that is choosen by default when Etherpad starts with no
settings.json file.
It was different than the one contained into setting.json.template.
2018-08-21 21:57:13 +02:00
muxator cb07805022 NodeVersion: take responsibility for ugly code 2018-08-22 00:12:53 +02:00
muxator fc14f60a4b runtime: polyfill Object.values()
Minimum supported Node version is 6.9.0, but Object.values() was introduced in
Node < 7. Let's use a polyfill if needed.

This will be removed when minimum supported Node version is raised to 8.9.0.

Fixes #3459
2018-08-15 22:34:05 +02:00
muxator 9d815c58b8 deprecations: get rid of DEP0005 about Buffer()
Similar code still lives in some dependent libraries.
It will be updated when upgrading the dependencies.

Fixes #3446
2018-08-14 19:45:03 +02:00
muxator 6d5a6cf795 caching_middleware: removed unnecessary escape in regex
Found by eslint with "no-useless-escape"
2018-08-14 19:33:10 +02:00
"muxator ext:(%22) 42a0772955 dependencies: updated measured 1.1.0 -> measured-core 1.11.2
When installing dependencies, npm informed us that measured had been deprecated,
and renamed to measured-core. Let's follow the advice, and get rid of the
warning.

  npm WARN deprecated measured@1.1.0: This package has been renamed to
  measured-core, all versions of measured have been re-released under
  measured-core, please update your package and consider updating to the newest
  version. See https://github.com/yaorg/node-measured for latest updates.

This package is used to expose a single endpoint ("/stats"), whose output does
not change after this commit.

Fixes #3458
2018-08-14 13:22:41 +02:00
Masaru Nagaku 392f39b623 fix bug for getPadPlainText 2018-08-11 11:02:20 -03:00
Muh Muhten 3cedf474e5 Fix misparse of port when binding Unix socket
The hostname:port of URIs used in Minify are currently bogus and refer
to localhost only for historical reasons; there's no reason to retain
them and omitting them avoids generating an invalid URI when "port" is
not an integer.

Context: settings.port is passed to express's listen; if not numeric, it
is used a filename for a Unix domain socket.
This allows e.g. starting a server to be reverse-proxied on a multi-user
system, using the filesystem to handle access control and avoiding need
to allocate port numbers.

Before this change, etherpad-lite starts without error when configured
to listen on a Unix domain socket in this manner. However, `pad.js` and
`ace2_common.js` are generated incorrecting, causing an error
"Uncaught Error: The module at "ep_etherpad-lite/static/js/rjquery" does not exist."
when loading the editor:

When settings.port is a non-numeric string, e.g. `etherpad.sock`, a URI
of the form `http://localhost:etherpad.sock/static/js/rjquery.js` is
generated and parsed to find the file needed. In this case, the file
searched for is `:etherpad.sock/static/js/rjquery.js`, rather than the
expected `static/js/rjquery.js`. No such file exists, and the required
code is silently omitted from the bundle.

As a workaround, hard-code a (meaningless) hostname which can be parsed
correctly, since the current code makes no use of it anyway.
2018-08-10 01:57:30 +02:00
Michael Braun 971853ca58 remove -k argument as it is currently for both sessionkey and apikey 2018-08-09 19:42:14 +02:00
muxator a69f8a3db9 runtime: deprecate Node <= 7. From Etherpad 1.8.0 minimum Node version will be 8 2018-07-28 23:33:24 +02:00
muxator 7544585908 runtime: enforce minimal node version to 6.9.0
Etherpad 1.6.6 does not run on node <= 5 already.
Node 6.9 is the first LTS release in the 6 series, and comes with npm 3.10.8.

Declarations in package.json are advisory unless the user has set
`engine-strict` config flag.

Updated the docs accordingly.
2018-07-28 23:33:24 +02:00
ilmar a96aa88dad merge with ether/etherpad-lite develop branch 2018-05-21 16:18:40 +03:00
ilmar 4feccff530 merge with develop branch 2018-05-21 15:41:49 +03:00
ilmar 3c66425b60 List indent fix 2018-05-21 13:07:08 +03:00
ilmar 016497dbb4 prevLine/nextLine check fix 2018-05-14 22:57:15 +03:00
ilmar 47e20a2f49 line parsing fix 2018-05-03 00:07:07 +03:00
ilmar 6684f9bfe8 hook callAll to aCallAll 2018-05-02 11:45:48 +03:00
ilmar 55ecf31786 html export fix 2018-05-02 11:12:58 +03:00
ilmar c9863f81ad sync with ether/etherpad-lite 2018-05-02 11:08:57 +03:00
ilmar 8d27f3cf03 upgrade to 1.6.5 2018-04-24 13:31:40 +03:00
ilmar 7cc7bb1abc upgrade to 1.6.5 2018-04-24 12:25:56 +03:00
ilmar d6fa065ef2 export html to original structure 2018-04-24 12:13:31 +03:00
anugu-chegg 7b6a4aba30 Remove leftover code from earlier commits 2018-04-19 23:23:16 +02:00
anugu-chegg b4068144c3 Refactor code 2018-04-19 23:23:16 +02:00
anugu-chegg 461ed413b7 Fix few mistakes 2018-04-19 23:23:16 +02:00
anugu-chegg d41e184a3c Send commits missed during the reconnect 2018-04-19 23:23:16 +02:00
anugu-chegg bf05e9ae89 Handle client reconnect properly 2018-04-19 23:23:16 +02:00
ilmar 517b249394 D 2018-04-10 00:08:42 +03:00
Olivier Tétard 5b1e1f0c35 Fix typo in `apicalls.js` which prevents from importing `isValidJSONPName`. 2018-04-09 20:56:29 +02:00
ilmar 8502c04bee html lists export fix 2018-04-09 15:37:28 +03:00
John McLear fa83de778c Password check fix 2018-04-07 10:31:47 +01:00
Peter 'Pita' Martischka 6d5dc93dbf merged 2018-04-07 10:23:49 +01:00
thomas ffe24c3dd9
Update webaccess.js 2018-04-06 22:21:33 +02:00
ilmar b4ad7cf452 Export lists fix + code linting and readability update 2018-04-05 23:27:02 +03:00
Peter 'Pita' Martischka a08c4383b8 check pad exists before importing / exporting 2018-04-04 21:48:32 +01:00
John McLear 6388055f51
Merge pull request #12 from nashe/no_findkeys_export
No findkeys during export
2018-04-04 19:36:59 +01:00
Peter 'Pita' Martischka 806c9207e3 remove findkeys from pad export 2018-04-04 18:02:54 +01:00
Mikk Andresen 20428bb427 Merge remote-tracking branch 'upstream/develop' into develop 2018-04-04 13:52:27 +03:00
Mikk Andresen a67aaa8f49 Merge remote-tracking branch 'upstream/master' into develop 2018-04-04 13:52:08 +03:00
John McLear f15c7d7186
Merge pull request #3280 from lmagniez/ImprovedReadibility
Improved readibility
2018-04-03 17:22:08 +01:00
John McLear f4f032afc0
Merge pull request #3297 from apenwarr/auth-sequence
Call authentication hooks before default basic authentication.
2018-04-03 13:41:51 +01:00
John McLear 2765a95774
Merge pull request #3218 from klausweiss/develop
Feature: New server-side hook: onAccessCheck
2018-04-03 13:38:47 +01:00
John McLear d393bf4dd8
Merge pull request #3232 from michael-dev/develop
Make APIKEY and SESSIONKEY file customizable
2018-04-03 13:34:49 +01:00
John McLear 18dd90139a
Merge pull request #3115 from noerw/redirect_fix
redirect /admin properly (fix #3114)
2018-04-03 13:10:36 +01:00
John McLear 022783a774
Merge pull request #3239 from jainendra/jainendra-feature-support-for-rtf
Feature: Support for uploading .rtf files rich text format
2018-04-03 13:07:00 +01:00
John McLear bb40aa00be
Update express.js 2018-04-03 10:59:10 +01:00
John McLear 50bbcb87bb
Merge pull request #4 from nashe/jsonp_fix
Added a jsonp var checker
2018-04-03 10:29:52 +01:00
Mikk Andresen 6f2466bebc Merge with upstream develop. 2018-04-02 13:47:16 +03:00
John McLear 8767410a36
be more strict on password check 2018-03-23 19:21:52 +00:00
Peter 'Pita' Martischka dd7894d3c9 Added a jsonp var checker 2018-03-23 11:17:39 +00:00
Luc Didry 82816acf4a Fix .doc export with LibreOffice (soffice) (#3338)
When using LibreOffice to convert pads to doc, we got `Error: no export filter for /tmp/xxxx.doc` (tested with LO 5 and 6). Maybe it's a regression from LO. Anyway, converting HTML to odt, then to doc works.

Thx to lpagliari for her review!
2018-03-08 10:44:11 -03:00
Luiza Pagliari 187e51948d
[fix] Don't show "pad deleted" message when copying pad (#3320)
Fix #3183
2018-02-16 14:18:51 -02:00
Man Yue Mo a2992b3624 fix jsonp checking. 2018-02-07 08:43:07 +00:00
Stefan b292e137ed Added missing require for is-var-name 2018-02-03 12:33:33 +01:00
Robert Helmer f56936c936 better sanitize jsonp 2018-01-30 12:52:19 -08:00
Joas Souza f1fcd16894 Add settings to scroll on edition out of viewport (#3282)
* Add scroll when it edits a line out of viewport

By default, when there is an edition of a line, which is out of the
viewport, Etherpad scrolls the minimum necessary to make this line
visible. This makes that the line stays either on the top or the bottom
of the viewport. With this commit, we add a setting to make possible to
scroll to a position x% pixels from the viewport. Besides of that, we
add a setting to make an animation of this scroll.
If nothing is changed on settings.json the Etherpad default behavior is
kept
2018-01-03 19:57:28 -02:00
Avery Pennarun e0582797f2 Call authentication hooks before default basic authentication.
This allows authenticators to do any extra session setup for a given user,
even if their username/password happens to match settings.json.
2017-12-31 12:32:50 +00:00
Loick Magniez 54e834194b Changed the color palette and changed the pad's font size to 16px 2017-11-22 16:04:17 +01:00
Rainer Rillke f12debd5c7 Catch SIGTERM for graceful shutdown (#3266)
Shut down database connection and exit the node process
when SIGTERM is encountered. This is especially important
when nodejs is run as PID1, e.g. in a docker container.

Shutting down connections to clients (browsers) is beyond
this patche's scope.

Resolves #3265
2017-11-04 19:59:19 -02:00
ilmar 76f211b0bf ExportHtml.js update 2017-11-01 09:48:23 +02:00
ilmar 5469ce85cd exportHTML update 2017-10-31 22:46:24 +02:00
ilmar 724b1d734b updated html export, run hooks also with lists 2017-10-31 16:23:41 +02:00
ilmar c36a3264fe fix to ether/etherpad-lite#2486 2017-10-21 01:04:53 +03:00
ilmar 69bf32cd46 fix to https://github.com/ether/etherpad-lite/issues/2486 2017-10-19 16:11:40 +03:00
Jainendra Mandavi b4ddd0276d Use abiword to process .rft files 2017-08-04 03:23:12 +05:30
Michael Braun 4cce3bcbed Make APIKEY und SESSIONKEY file customizable
Running multiple instances sometimes requires different api- and session-keys for security reasons.
2017-07-31 15:31:45 +02:00
Stefan 5382b06ede Merge pull request #3231 from jainendra/fix-2864-import-pdf
FIX-2864: Add useAbiword flag
2017-07-30 11:42:39 +02:00
Jainendra Mandavi e4ddb42e11 FIX-2864: Add useAbiword flag
This is a fix for the issue - 2864
Which is import failure of PDF after importing a text file
2017-07-28 23:13:07 +05:30
Luiza Pagliari 3e5d71ad5a Merge pull request #3214 from patrickeasters/add_credentials_arg
Add credentials arg to CLI module
2017-07-12 07:22:17 -03:00
Mikołaj Biel 2508b9749c fix typo 2017-07-10 20:59:08 +02:00
Mikołaj Biel 35702a0589 [feat] New server-side hook: onAccessCheck 2017-07-10 20:54:32 +02:00
Patrick Easters d72d79ea82 Fetch credentials arg from CLI 2017-07-05 15:20:02 -04:00
Luiza Pagliari fc89034a55 [feat] New server-side hook: padCopy
Let plugins know when a pad is copied.
2017-05-18 18:52:14 -03:00
Luiza Pagliari 0cb8d31e95 [fix] Have one setting for each shortcut to create ordered list
This is an adjustment to #2891.
2017-05-11 14:56:09 -03:00
Luiza Pagliari 97038c2183 [fix] Fix shortcut enabling flag for 'ESC'
This is an adjustment to #2891.
2017-05-11 12:36:20 -03:00
Luiza Pagliari cf686282ef Do not use cookie for pad shortcuts
Users still cannot choose which shortcuts they want to enable/disable,
so it does not make sense (yet) to have a cookie with that preference.

This can be reverted once we create an UI to change shortcuts, but
PLEASE PLEASE PLEASE do not read the cookie every time handleKeyEvent is
called!!!

This is an adjustment to #2891.
2017-05-11 12:26:14 -03:00
Luiza Pagliari 1ebcf0dc47 Merge pull request #2891 from bhldev/padShortcutDisable
Added pad shortcut disabling feature to settings.json
2017-05-11 11:29:25 -03:00
Luiza Pagliari 009cd31243 [feature] Create option to automatically reconnect after a few seconds
On some erros that display a modal with "Force reconnect" button, allow
Etherpad to automatically reload pad after a few seconds. Amount of
seconds is defined on settings.json.

Still need to create tests for this feature, and implement i18n.
2017-04-04 11:09:24 -03:00
Luiza Pagliari 203a48b42d Merge pull request #3136 from joassouza/fix_minify
Fix minification of JS files
2017-02-08 04:14:44 -02:00
joassouza 0025613ba6 Refactor code 2017-02-07 15:06:49 -02:00
joassouza d1e6c8492d Fix minification of code 2017-02-07 13:04:22 -02:00
Sjoerd Langkemper 21a6e66e25 Remove deprecated comment
The session key is currently stored in SESSIONKEY.txt, so it is no longer reset
every time the server starts.
2017-01-26 09:59:09 +01:00
noerw cc69e76200 redirect /admin properly (fix #3114) 2017-01-06 18:19:38 +01:00
Stefan be9ff4a0de Fixed crash on invalid export url 2016-12-22 23:04:06 +01:00
Stefan efb25f417a Merge pull request #2993 from ether/fixes-2945
fixes #2945
2016-12-20 22:08:05 +01:00
Stefan a1ec061017 Merge pull request #3053 from danfuzz/fix-timeslider-lists
Fix timeslider lists / indents, but also make CSS `@import` work
2016-12-20 22:06:31 +01:00
Stefan aefa617797 Merge branch 'develop' into improve_cookies 2016-12-20 21:31:11 +01:00
Nobody Really 97fd1ab2fe Added LibreJS support 2016-09-20 09:30:35 +02:00
Dan Bornstein 0a9d02562d Handle relative paths properly, when `@import`ing. 2016-09-09 12:59:02 -07:00
Dan Bornstein a5a7ebea3d Handle `@import` during CSS minification.
This meant plumbing a callback through to `compressCSS()`, which meant that
I had to alter the innards of `getFileCompressed()`. I tried to	leave that
function looking more understandable than when I found it; for example,	I
flattened out the nested `if`.

I went ahead and upgraded the version of `clean-css` while I was in the
territory.
2016-09-09 12:32:24 -07:00
Dan Bornstein a0403ffc22 Remove unused parameter `noDocType`.
My editor also auto-stripped some EOL whitespace.
2016-09-08 09:46:13 -07:00
Dan Bornstein 879ae7c67d Remove the `noDocType` argument, which was only ever passed as `false`. 2016-09-08 09:41:23 -07:00
Dan Bornstein 6d7f128b87 Use an EEJS template for HTML export instead of inlining it in the JS code.
The semantics of all the substitutions are identical to what they were before.
I _did_ take the liberty of formatting the CSS to be a bit more readable
(at the cost of adding a little bit of whitespace).
2016-08-24 16:25:31 -07:00
Stefan 009b61b338 Make express-session cookie scheme dependent 2016-07-10 12:44:45 +02:00
Stefan 6b9711cb70 Fixed path check 2016-06-20 00:22:29 +02:00
John McLear b3b17c2190 Merge pull request #2991 from LokeshN/deactivate-settings
Issue #2960 - deactivate settings.json
2016-06-13 14:41:30 +08:00
Stefan 4ea9c4f98d Add secure flag to express-session cookies 2016-06-08 21:15:26 +02:00
Stefan 44370f11be Merge pull request #2957 from ether/dependency_updates
Dependency updates
2016-06-07 21:32:20 +02:00
John McLear d545630912 fixes #2945 2016-05-28 22:25:44 +01:00
LokeshN a8d5dc0693 Issue #2960 - deactivate settings.json
Deactivate settings.json in Admin dashboard
2016-05-22 21:12:21 +05:30
Stefan 835bca7967 Use fs.statSync instead of fs.existsSync (deprecated) 2016-05-16 16:51:12 +02:00
Stefan 14e1f3bf22 Update socket.io to version 1.4.5 2016-04-26 18:55:58 +02:00
John McLear 6b6a028355 include the padId 2016-04-09 20:01:49 +01:00
Brian Lim 26aeb7b705 Added pad shortcut disabling feature 2016-01-21 07:38:41 -05:00
Brian Lim 295672f598 Set language cookie on initial load 2016-01-17 21:44:03 -05:00
John McLear ef9cf974a2 Merge branch 'develop' of github.com:ether/etherpad-lite into drag-and-drop-between-frames-sandbox 2016-01-10 14:37:44 +00:00
John McLear 793b34d17b hrm, removal 2016-01-08 13:39:32 +00:00
John McLear f16616d23b seems to work 2016-01-08 13:26:46 +00:00
John McLear 638757fdb5 Update DB.js 2016-01-06 00:01:48 +00:00
John McLear b519f9f156 include req and res in export convert hook 2015-12-21 17:32:05 +00:00
Chris Birk d6033de0da Use new exportAvailable() check to include check for SOffice along with Abiword in importexport hook 2015-12-18 00:14:13 -06:00
Chris Birk 7f517eca0b check for soffice before removing export paths 2015-12-17 21:54:04 -06:00
John McLear e2a0e3cd7f whoops 2015-12-02 12:10:25 +00:00
John McLear 98016665e4 working logic 2015-12-02 11:54:37 +00:00
John McLear f44c444720 Merge pull request #2831 from fcassin/develop
Protect against a null atext value in cloneAText
2015-12-01 17:50:29 +00:00
John McLear 1a8462fb4f remove unused variable 2015-12-01 17:40:16 +00:00
John McLear 4ae88b2ee7 Hook for export ocnvert control 2015-12-01 17:38:52 +00:00
John McLear 8a79ae6e02 regex incoming colors 2015-11-26 15:55:26 +00:00
John McLear a8c2833759 clean up 2015-11-24 14:03:38 +00:00
John McLear 039a761eaf allow settings to be applied from the filesystem 2015-11-24 14:02:37 +00:00
Francois Cassin 2bd698343a Protects against a null atext in cloneAText 2015-11-10 16:21:43 +01:00
Luiza Pagliari 92a8253449 Create hook exportHtmlAdditionalTagsWithData
The new hook does the same as exportHtmlAdditionalTags, but is declared
in another hook to avoid confusion about how to export tags when they
are stored as ['tag', 'value'] on attribute pool.

This complements #2762, as per @Gared suggestions.
2015-11-03 07:16:55 -02:00
Bradley Arvin a9d7ab9e18 Fix for #2809 2015-10-28 13:28:54 -04:00
John McLear 3aff0001a1 Merge pull request #2798 from ypid/fixed_get_git_hash
Get git commit hash even if the repo only points to a bare repo.
2015-10-22 16:13:58 +01:00
John McLear 50171a4c3c Merge pull request #2805 from storytouch/indentationSetting
Create setting to control if a new line will be indented or not
2015-10-22 16:12:07 +01:00
John McLear 5652adb4eb Merge pull request #2813 from simong/export-libreoffice
Allow LibreOffice to be used when exporting a pad
2015-10-22 16:11:26 +01:00
Simon Gaeremynck 7289e89070 Use `Etherpad` rather than `Etherpad Lite` when exporting HTML 2015-10-22 16:09:44 +01:00
Simon Gaeremynck 2bfc3026d2 Allow LibreOffice to be used when exporting a pad
This commit adds support for LibreOffice when exporting a pad to doc, pdf, ..

This commit also cleans up some export logic when exporting to txt
2015-10-20 19:46:08 +01:00
Ted Mielczarek a675659dc2 Add an appendText API 2015-10-19 15:27:09 -04:00
Stefan 504cc102a0 Merge pull request #2762 from storytouch/exportTagsAsArrays
Accepting Arrays on 'exportHtmlAdditionalTags'
2015-10-17 18:24:18 +02:00
Luiza Pagliari 5deb06d589 Create setting to control if a new line will be indented or not
Currently pressing ENTER on a line that ends with ':', '[', '(' or '{'
automaticaly indents the new line with 4 spaces. The variable added by
this commit to settings.json allow an Etherpad instance to not have this
behavior.
2015-10-13 18:39:23 -03:00
Stefan 9d29b15def Merge pull request #2730 from emilyxxie/clientready_hook
added clientReady hook
2015-10-10 13:30:36 +02:00
Stefan 22bf9c9297 Merge pull request #2799 from Gared/fix_url_location_error
Fix decode error if pad name contains special characters and is sanitized
2015-10-10 13:21:40 +02:00
webzwo0i 1ee1f818db if granularity is negative, endNum is negative and loop 2015-10-09 14:55:59 +02:00
webzwo0i 31f7c7e0f2 check if ChangesetRequest granularity is a number (#2796) 2015-10-09 14:55:19 +02:00
Stefan f6cebdad98 Fix decode error if pad name contains special characters and is sanitized 2015-10-08 20:46:15 +02:00
Robin Schneider 29441a8ae1
Get git commit hash even if the repo only points to a bare repo.
* Used by https://github.com/debops/ansible-etherpad
2015-10-07 15:43:29 +02:00
Andreas Fried e6b0e954b5 Fix off-by-one: The chatHead is in fact a valid message index.
This fixes #2751.
2015-09-30 00:48:15 +02:00
Luiza Pagliari 1d134f0b13 Fixing ed52626. It was closing the span with </span data-TAG=VALUE>, not </span> 2015-09-17 15:30:09 -03:00
Luiza Pagliari ed5262650a Generating pad HTML with tags like <span data-TAG="VALUE"> instead of <TAG:VALUE> 2015-09-07 03:55:56 -07:00
Stefan cc9f88e7ed Merge pull request #2757 from Gared/doc_append_chat_message
Add appendChatMessage API to docs
2015-08-30 18:15:51 +02:00
Luiza Pagliari 1a5985dc75 Accepting Arrays on 'exportHtmlAdditionalTags' to handle attributes stored as ['key', 'value'] (and not only ['key', 'true']) 2015-08-24 07:58:45 -07:00
Stefan f27aacc5bf Fix missing bracket 2015-08-15 22:41:59 +02:00
Stefan 94cb743ca8 Fix API call appendChatMessage to send new message to all connected clients 2015-08-15 22:05:31 +02:00
Thomas Russell Murphy b557927b72 Fix link to etherpad-lite on GitHub 2015-08-03 21:53:54 -05:00
Emily Xie 21f0d12d31 clientReady hook- pass entire message, updated doc 2015-07-20 11:45:41 -04:00
Xavid ad137fa4c8 Restore newline-adding to setText() if passed string does not end in '\n'.
Add a test for the ending-in-'\n' case and update tests for the other case.
2015-06-30 04:47:55 -04:00
Clark Boylan 1060595676 Check for valid session in handleUserInfoUpdate
Address issue 2674 by checking that the session is valid and has a valid
author and padId before using it to update the userInfo for that
session. Otherwise it is possible that by the time we try to update a
session with new userInfo that session has disconnected and is no longer
available to be updated. Without this commit the etherpad-lite service
gracefully shutsdown whenever this happens.
2015-06-24 15:18:35 -07:00
Xavid a4fe0d0dc8 Add an 'author' entry to the context for the padCreate and padUpdate hooks. 2015-06-21 11:29:17 -04:00
Xavid 0713553906 Allow a pad to only end with a single newline, rather than requiring two. 2015-06-19 14:02:18 -04:00
Stéphane Alnet 0b3216ecb6 Do not extend Array.prototype 2015-05-22 12:27:08 +02:00
John McLear 757ad765d3 use removeItem instead of remove namespace 2015-05-22 11:09:21 +01:00
John McLear 3944a0e79b more read only mode fixes andadd support for handleMessageSecurity hook 2015-05-20 01:05:53 +01:00
John McLear 818408cf49 other bits required for read only 2015-05-19 16:57:53 +01:00
John McLear 41d24a8c8f Merge branch 'develop' of github.com:ether/etherpad-lite into develop 2015-05-19 16:44:57 +01:00
John McLear b662d5c618 dont show editing buttons in R/O view 2015-05-19 16:43:19 +01:00
Simon Gaeremynck 7fe99cccad Using log4js in TidyHtml 2015-05-18 17:43:46 +01:00
Simon Gaeremynck 786b43efc8 Tidy HTML before trying to convert it with abiword 2015-05-18 16:24:41 +01:00
John McLear 9e9207d8b6 Merge pull request #2657 from simong/cookie-parser
Use the cookie parser middleware
2015-05-11 15:10:45 +01:00
Simon Gaeremynck 5a7750781b Use the cookie parser middleware 2015-05-07 18:35:21 +01:00
Xavid 9e86fb279b Fix backend tests with new setText() implementation; tests depended
on the old setText() behavior leaving the last character.
2015-05-06 08:45:22 -04:00
Xavid 5e64c292a4 When using setText(), replace the entire existing text of the pad,
rather than replacing all except the last letter.
2015-05-05 14:18:27 -04:00
John McLear 4938c7be38 plugins always return html so use that endpoint 2015-04-29 20:54:41 +01:00
John McLear 1f471b0f81 show versions of plugins at startup, fixes #2642 2015-04-28 23:41:55 +01:00
John McLear 254edffa9c fixes #2547 2015-04-24 14:17:49 +01:00
Andreas Åkre Solberg ec7b3fc787 Adding support for providing intermediate CA certificates when running etherpad-lite with ssl through Node/expressjs 2015-04-22 20:29:19 +02:00
Tom Hunkapiller 6ff7d4e9a6 revert to old path handling, but strip out "..". fixes #2614 2015-04-15 14:31:21 -05:00
louis 0fa7650df8 dont allow directory traversal #2 2015-04-12 17:12:35 +02:00
John McLear e3f95d0c9c Merge pull request #2604 from ether/pad-options
session key is now ignored and also padOptions are available in settings
2015-04-11 22:33:46 +01:00
Peter 'Pita' Martischka fc0cac0cad merge object settings into default settings 2015-04-11 22:01:46 +01:00
John McLear 8ed12c7776 session key is now ignored and also padOptions are available in settings 2015-04-11 21:22:00 +01:00
John McLear 4a70837de9 Merge pull request #2602 from devoidfury/fix/import-large-etherpad
fix large etherpad import, fixes #2524
2015-04-11 20:09:01 +01:00
Stefan 43687f6e8b Merge pull request #2601 from Gared/session_key_file
Move sessionKey setting from settings.json to SESSIONKEY.txt
2015-04-11 19:10:18 +02:00
Tom Hunkapiller a896d67e8c make setPadRaw async; streamline .etherpad file import handling chain 2015-04-11 12:02:19 -05:00
Stefan a3ed82ad06 Move sessionKey setting from settings.json to SESSIONKEY.txt 2015-04-11 18:45:14 +02:00
John McLear 25092fcb90 Merge pull request #2600 from devoidfury/fix/junk-binary-files
fix: only match /javascript/* for caching middleware
2015-04-11 16:00:02 +01:00
Tom Hunkapiller 133188320a fix: only match /javascript/* for caching middleware 2015-04-11 09:54:40 -05:00
John McLear 5ef22e649b Merge pull request #2302 from Gared/create_pad_special_characters
Add check for special url characters to createPad API function
2015-04-11 14:56:26 +01:00
Stefan aa0d14c7d7 Merge branch 'master' of git://github.com/ether/etherpad-lite into create_pad_special_characters 2015-04-11 12:10:37 +02:00
John McLear acc1a0626a use latest ejs 2015-04-11 09:53:27 +01:00
Tom Hunkapiller 0b0a349081 clearer comments about the path handling behavior 2015-04-11 09:05:51 +01:00