Skip to content

Commit 868c685

Browse files
committed
Merge branch 'develop'
2 parents 571b37b + 2e19087 commit 868c685

File tree

116 files changed

+6600
-6498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+6600
-6498
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
IMPORTANT: Please disable plugins prior to posting a bug report. If you have a problem with a plugin please post on the plugin repository. Thanks!
2+
13
---
24
name: Bug report
35
about: Create a report to help us improve
@@ -28,6 +30,7 @@ If applicable, add screenshots to help explain your problem.
2830
- OS: [e.g., Ubuntu 20.04]
2931
- Node.js version (`node --version`):
3032
- npm version (`npm --version`):
33+
- Is the server free of plugins:
3134

3235
**Desktop (please complete the following information):**
3336
- OS: [e.g. iOS]

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
<!--
22
3-
Some key notes before you open a PR:
3+
1. If you haven't already, please read https://github.com/ether/etherpad-lite/blob/master/CONTRIBUTING.md#pull-requests .
4+
2. Run all the tests, both front-end and back-end. (see https://github.com/ether/etherpad-lite/blob/master/CONTRIBUTING.md#testing)
5+
3. Keep business logic and validation on the server-side.
6+
4. Update documentation.
7+
5. Write `fixes #XXXX` in your comment to auto-close an issue.
48
5-
1. Select which branch should this PR be merged in? By default, you should always merge to the develop branch.
6-
2. PR name follows [convention](http://karma-runner.github.io/4.0/dev/git-commit-msg.html)
7-
3. All tests pass locally, UI and Unit tests
8-
4. All business logic and validations must be on the server-side
9-
5. Update necessary Documentation
10-
6. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes
11-
12-
13-
Also, if you're new here
14-
15-
- Contribution Guide => https://github.com/ether/etherpad-lite/blob/master/CONTRIBUTING.md
9+
If you're making a big change, please explain what problem it solves:
10+
- Explain the purpose of the change. When adding a way to do X, explain why it is important to be able to do X.
11+
- Show the current vs desired behavior with screenshots/GIFs.
1612
1713
-->
18-
19-
> Please provide enough information so that others can review your pull request:
20-
21-
<!-- You can skip this if you're fixing a typo or updating existing documentation -->
22-
23-
> Explain the **details** for making this change. What existing problem does the pull request solve?
24-
25-
<!-- Example: When "Adding a function to do X", explain why it is necessary to have a way to do X. -->
26-
27-
> Screenshots/GIFs
28-
29-
<!-- Add images/recordings to better visualize the change: expected/current behviour -->

.github/workflows/backend-tests.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ jobs:
116116
node-version: 12
117117

118118
- name: Install all dependencies and symlink for ep_etherpad-lite
119-
run: |
120-
cd src
121-
npm ci --no-optional
119+
run: src/bin/installOnWindows.bat
122120

123121
- name: Fix up the settings.json
124122
run: |
@@ -172,9 +170,7 @@ jobs:
172170
# if npm correctly hoists the dependencies, the hoisting seems to confuse
173171
# tools such as `npm outdated`, `npm update`, and some ESLint rules.
174172
- name: Install all dependencies and symlink for ep_etherpad-lite
175-
run: |
176-
cd src
177-
npm ci --no-optional
173+
run: src/bin/installOnWindows.bat
178174

179175
- name: Fix up the settings.json
180176
run: |

.github/workflows/frontend-admin-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ jobs:
5757
- name: Write custom settings.json that enables the Admin UI tests
5858
run: "sed -i 's/\"enableAdminUITests\": false/\"enableAdminUITests\": true,\\n\"users\":{\"admin\":{\"password\":\"changeme\",\"is_admin\":true}}/' settings.json"
5959

60+
- name: increase maxHttpBufferSize
61+
run: "sed -i 's/\"maxHttpBufferSize\": 10000/\"maxHttpBufferSize\": 100000/' settings.json"
62+
6063
- name: Remove standard frontend test files, so only admin tests are run
6164
run: mv src/tests/frontend/specs/* /tmp && mv /tmp/admin*.js src/tests/frontend/specs
6265

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ var/dirty.db
99
*.patch
1010
npm-debug.log
1111
*.DS_Store
12-
.ep_initialized
1312
*.crt
1413
*.key
1514
credentials.json

CHANGELOG.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,79 @@
1+
# 1.8.15
2+
3+
### Security fixes
4+
5+
* Fixed leak of the writable pad ID when exporting from the pad's read-only ID.
6+
This only matters if you treat the writeable pad IDs as secret (e.g., you are
7+
not using [ep_padlist2](https://www.npmjs.com/package/ep_padlist2)) and you
8+
share the pad's read-only ID with untrusted users. Instead of treating
9+
writeable pad IDs as secret, you are encouraged to take advantage of
10+
Etherpad's authentication and authorization mechanisms (e.g., use
11+
[ep_openid_connect](https://www.npmjs.com/package/ep_openid_connect) with
12+
[ep_readonly_guest](https://www.npmjs.com/package/ep_readonly_guest), or write
13+
your own
14+
[authentication](https://etherpad.org/doc/v1.8.14/#index_authenticate) and
15+
[authorization](https://etherpad.org/doc/v1.8.14/#index_authorize) plugins).
16+
17+
### Compatibility changes
18+
19+
* The `logconfig` setting is deprecated.
20+
* For plugin authors:
21+
* Etherpad now uses [jsdom](https://github.com/jsdom/jsdom) instead of
22+
[cheerio](https://cheerio.js.org/) for processing HTML imports. There are
23+
two consequences of this change:
24+
* `require('ep_etherpad-lite/node_modules/cheerio')` no longer works. To
25+
fix, your plugin should directly depend on `cheerio` and do
26+
`require('cheerio')`.
27+
* The `node` context argument passed to the `collectContentImage` hook is
28+
now an
29+
[`HTMLImageElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement)
30+
object rather than a Cheerio Node-like object, so the API is slightly
31+
different. See
32+
[citizenos/ep_image_upload#49](https://github.com/citizenos/ep_image_upload/pull/49)
33+
for an example fix.
34+
* The `clientReady` server-side hook is deprecated; use the new `userJoin`
35+
hook instead.
36+
* The `init_<pluginName>` server-side hooks are now run every time Etherpad
37+
starts up, not just the first time after the named plugin is installed.
38+
* The `userLeave` server-side hook's context properties have changed:
39+
* `auth`: Deprecated.
40+
* `author`: Deprecated; use the new `authorId` property instead.
41+
* `readonly`: Deprecated; use the new `readOnly` property instead.
42+
* `rev`: Deprecated.
43+
* Changes to the `src/static/js/Changeset.js` library:
44+
* `opIterator()`: The unused start index parameter has been removed, as has
45+
the unused `lastIndex()` method on the returned object.
46+
* `smartOpAssembler()`: The returned object's `appendOpWithText()` method is
47+
deprecated without a replacement available to plugins (if you need one,
48+
let us know and we can make the private `opsFromText()` function public).
49+
* Several functions that should have never been public are no longer
50+
exported: `applyZip()`, `assert()`, `clearOp()`, `cloneOp()`, `copyOp()`,
51+
`error()`, `followAttributes()`, `opString()`, `stringOp()`,
52+
`textLinesMutator()`, `toBaseTen()`, `toSplices()`.
53+
54+
### Notable enhancements
55+
56+
* Simplified pad reload after importing an `.etherpad` file.
57+
* For plugin authors:
58+
* `clientVars` was added to the context for the `postAceInit` client-side
59+
hook. Plugins should use this instead of the `clientVars` global variable.
60+
* New `userJoin` server-side hook.
61+
* The `userLeave` server-side hook has a new `socket` context property.
62+
* The `helper.aNewPad()` function (accessible to client-side tests) now
63+
accepts hook functions to inject when opening a pad. This can be used to
64+
test any new client-side hooks your plugin provides.
65+
* Chat improvements:
66+
* The `chatNewMessage` client-side hook context has new properties:
67+
* `message`: Provides access to the raw message object so that plugins can
68+
see the original unprocessed message text and any added metadata.
69+
* `rendered`: Allows plugins to completely override how the message is
70+
rendered in the UI.
71+
* New `chatSendMessage` client-side hook that enables plugins to process the
72+
text before sending it to the server or augment the message object with
73+
custom metadata.
74+
* New `chatNewMessage` server-side hook to process new chat messages before
75+
they are saved to the database and relayed to users.
76+
177
# 1.8.14
278

379
### Security fixes

CONTRIBUTING.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,17 @@
1515
number of the issue that is being fixed, in the form: Fixes #someIssueNumber
1616
```
1717
* if the PR is a **bug fix**:
18-
* the first commit in the series must be a test that shows the failure
19-
* subsequent commits will fix the bug and make the test pass
20-
* the final commit message should include the text `Fixes: #xxx` to link it to its bug report
18+
* The commit that fixes the bug should **include a regression test** that
19+
would fail if the bug fix was reverted. Adding the regression test in the
20+
same commit as the bug fix makes it easier for a reviewer to verify that the
21+
test is appropriate for the bug fix.
22+
* If there is a bug report, **the pull request description should include the
23+
text "`Fixes #xxx`"** so that the bug report is auto-closed when the PR is
24+
merged. It is less useful to say the same thing in a commit message because
25+
GitHub will spam the bug report every time the commit is rebased, and
26+
because a bug number alone becomes meaningless in forks. (A full URL would
27+
be better, but ideally each commit is readable on its own without the need
28+
to examine an external reference to understand motivation or context.)
2129
* think about stability: code has to be backwards compatible as much as possible. Always **assume your code will be run with an older version of the DB/config file**
2230
* if you want to remove a feature, **deprecate it instead**:
2331
* write an issue with your deprecation plan

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ RUN export DEBIAN_FRONTEND=noninteractive; \
6363
apt-get -qq --no-install-recommends install \
6464
ca-certificates \
6565
git \
66+
curl \
6667
${INSTALL_ABIWORD:+abiword} \
6768
${INSTALL_SOFFICE:+libreoffice} \
6869
&& \
@@ -94,5 +95,7 @@ COPY --chown=etherpad:etherpad ./settings.json.docker "${EP_DIR}"/settings.json
9495
# Fix group permissions
9596
RUN chmod -R g=u .
9697

98+
HEALTHCHECK --interval=20s --timeout=3s CMD curl -f http://localhost:9001 || exit 1
99+
97100
EXPOSE 9001
98101
CMD ["node", "src/node/server.js"]

doc/api/changeset_library.md

Lines changed: 25 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,44 @@
11
# Changeset Library
22

3-
```
4-
"Z:z>1|2=m=b*0|1+1$\n"
5-
```
6-
7-
This is a Changeset. It's just a string and it's very difficult to read in this form. But the Changeset Library gives us some tools to read it.
8-
9-
A changeset describes the diff between two revisions of the document. The Browser sends changesets to the server and the server sends them to the clients to update them. These Changesets also get saved into the history of a pad. This allows us to go back to every revision from the past.
3+
The [changeset
4+
library](https://github.com/ether/etherpad-lite/blob/develop/src/static/js/Changeset.js)
5+
provides tools to create, read, and apply changesets.
106

11-
## Changeset.unpack(changeset)
12-
13-
* `changeset` {String}
14-
15-
This function returns an object representation of the changeset, similar to this:
7+
## Changeset
168

9+
```javascript
10+
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
1711
```
18-
{ oldLen: 35, newLen: 36, ops: '|2=m=b*0|1+1', charBank: '\n' }
19-
```
20-
21-
* `oldLen` {Number} the original length of the document.
22-
* `newLen` {Number} the length of the document after the changeset is applied.
23-
* `ops` {String} the actual changes, introduced by this changeset.
24-
* `charBank` {String} All characters that are added by this changeset.
2512

26-
## Changeset.opIterator(ops)
13+
A changeset describes the difference between two revisions of a document. When a
14+
user edits a pad, the browser generates and sends a changeset to the server,
15+
which relays it to the other users and saves a copy (so that every past revision
16+
is accessible).
2717

28-
* `ops` {String} The operators, returned by `Changeset.unpack()`
18+
A transmitted changeset looks like this:
2919

30-
Returns an operator iterator. This iterator allows us to iterate over all operators that are in the changeset.
31-
32-
You can iterate with an opIterator using its `next()` and `hasNext()` methods. Next returns the `next()` operator object and `hasNext()` indicates, whether there are any operators left.
33-
34-
## The Operator object
35-
There are 3 types of operators: `+`,`-` and `=`. These operators describe different changes to the document, beginning with the first character of the document. A `=` operator doesn't change the text, but it may add or remove text attributes. A `-` operator removes text. And a `+` Operator adds text and optionally adds some attributes to it.
36-
37-
* `opcode` {String} the operator type
38-
* `chars` {Number} the length of the text changed by this operator.
39-
* `lines` {Number} the number of lines changed by this operator.
40-
* `attribs` {attribs} attributes set on this text.
41-
42-
### Example
4320
```
44-
{ opcode: '+',
45-
chars: 1,
46-
lines: 1,
47-
attribs: '*0' }
21+
'Z:z>1|2=m=b*0|1+1$\n'
4822
```
4923

50-
## APool
24+
## Attribute Pool
5125

26+
```javascript
27+
const AttributePool = require('ep_etherpad-lite/static/js/AttributePool');
5228
```
53-
> var AttributePoolFactory = require("./utils/AttributePoolFactory");
54-
> var apool = AttributePoolFactory.createAttributePool();
55-
> console.log(apool)
56-
{ numToAttrib: {},
57-
attribToNum: {},
58-
nextNum: 0,
59-
putAttrib: [Function],
60-
getAttrib: [Function],
61-
getAttribKey: [Function],
62-
getAttribValue: [Function],
63-
eachAttrib: [Function],
64-
toJsonable: [Function],
65-
fromJsonable: [Function] }
66-
```
67-
68-
This creates an empty apool. An apool saves which attributes were used during the history of a pad. There is one apool for each pad. It only saves the attributes that were really used, it doesn't save unused attributes. Let's fill this apool with some values
6929

70-
```
71-
> apool.fromJsonable({"numToAttrib":{"0":["author","a.kVnWeomPADAT2pn9"],"1":["bold","true"],"2":["italic","true"]},"nextNum":3});
72-
> console.log(apool)
73-
{ numToAttrib:
74-
{ '0': [ 'author', 'a.kVnWeomPADAT2pn9' ],
75-
'1': [ 'bold', 'true' ],
76-
'2': [ 'italic', 'true' ] },
77-
attribToNum:
78-
{ 'author,a.kVnWeomPADAT2pn9': 0,
79-
'bold,true': 1,
80-
'italic,true': 2 },
81-
nextNum: 3,
82-
putAttrib: [Function],
83-
getAttrib: [Function],
84-
getAttribKey: [Function],
85-
getAttribValue: [Function],
86-
eachAttrib: [Function],
87-
toJsonable: [Function],
88-
fromJsonable: [Function] }
89-
```
90-
91-
We used the fromJsonable function to fill the empty apool with values. the fromJsonable and toJsonable functions are used to serialize and deserialize an apool. You can see that it stores the relation between numbers and attributes. So for example the attribute 1 is the attribute bold and vise versa. An attribute is always a key value pair. For stuff like bold and italic it's just 'italic':'true'. For authors it's author:$AUTHORID. So a character can be bold and italic. But it can't belong to multiple authors
92-
93-
```
94-
> apool.getAttrib(1)
95-
[ 'bold', 'true' ]
96-
```
97-
98-
Simple example of how to get the key value pair for the attribute 1
99-
100-
## AText
101-
102-
```
103-
> var atext = {"text":"bold text\nitalic text\nnormal text\n\n","attribs":"*0*1+9*0|1+1*0*1*2+b|1+1*0+b|2+2"};
104-
> console.log(atext)
105-
{ text: 'bold text\nitalic text\nnormal text\n\n',
106-
attribs: '*0*1+9*0|1+1*0*1*2+b|1+1*0+b|2+2' }
107-
```
108-
109-
This is an atext. An atext has two parts: text and attribs. The text is just the text of the pad as a string. We will look closer at the attribs at the next steps
110-
111-
```
112-
> var opiterator = Changeset.opIterator(atext.attribs)
113-
> console.log(opiterator)
114-
{ next: [Function: next],
115-
hasNext: [Function: hasNext],
116-
lastIndex: [Function: lastIndex] }
117-
> opiterator.next()
118-
{ opcode: '+',
119-
chars: 9,
120-
lines: 0,
121-
attribs: '*0*1' }
122-
> opiterator.next()
123-
{ opcode: '+',
124-
chars: 1,
125-
lines: 1,
126-
attribs: '*0' }
127-
> opiterator.next()
128-
{ opcode: '+',
129-
chars: 11,
130-
lines: 0,
131-
attribs: '*0*1*2' }
132-
> opiterator.next()
133-
{ opcode: '+',
134-
chars: 1,
135-
lines: 1,
136-
attribs: '' }
137-
> opiterator.next()
138-
{ opcode: '+',
139-
chars: 11,
140-
lines: 0,
141-
attribs: '*0' }
142-
> opiterator.next()
143-
{ opcode: '+',
144-
chars: 2,
145-
lines: 2,
146-
attribs: '' }
147-
```
30+
Changesets do not include any attribute key–value pairs. Instead, they use
31+
numeric identifiers that reference attributes kept in an [attribute
32+
pool](https://github.com/ether/etherpad-lite/blob/develop/src/static/js/AttributePool.js).
33+
This attribute interning reduces the transmission overhead of attributes that
34+
are used many times.
14835

149-
The attribs are again a bunch of operators like .ops in the changeset was. But these operators are only + operators. They describe which part of the text has which attributes
36+
There is one attribute pool per pad, and it includes every current and
37+
historical attribute used in the pad.
15038

151-
## Resources / further reading
39+
## Further Reading
15240

15341
Detailed information about the changesets & Easysync protocol:
15442

155-
* Easysync Protocol - [/doc/easysync/easysync-notes.pdf](https://github.com/ether/etherpad-lite/blob/develop/doc/easysync/easysync-notes.pdf)
156-
* Etherpad and EasySync Technical Manual - [/doc/easysync/easysync-full-description.pdf](https://github.com/ether/etherpad-lite/blob/develop/doc/easysync/easysync-full-description.pdf)
43+
* [Easysync Protocol](https://github.com/ether/etherpad-lite/blob/develop/doc/easysync/easysync-notes.pdf)
44+
* [Etherpad and EasySync Technical Manual](https://github.com/ether/etherpad-lite/blob/develop/doc/easysync/easysync-full-description.pdf)

doc/api/editbar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ src/static/js/pad_editbar.js
55

66
## disable()
77

8-
## toggleDropDown(dropdown, callback)
8+
## toggleDropDown(dropdown)
99
Shows the dropdown `div.popup` whose `id` equals `dropdown`.
1010

1111
## registerCommand(cmd, callback)

0 commit comments

Comments
 (0)