Skip to content

Commit c8580a6

Browse files
committed
Release version 1.8.0
2 parents 503b117 + 1dfd52b commit c8580a6

23 files changed

+1168
-647
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.hg
2+
settings.json
3+
src/node_modules

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.8
2+
* SECURITY: change referrer policy so that Etherpad addresses aren't leaked when links are clicked (discussion: https://github.com/ether/etherpad-lite/pull/3636)
3+
* SECURITY: set the "secure" flag for the session cookies when served over SSL. From now on it will not be possible to serve the same instance both in cleartext and over SSL
4+
15
# 1.8-beta.1
26
* FEATURE: code was migrated to `async`/`await`, getting rid of a lot of callbacks (see https://github.com/ether/etherpad-lite/issues/3540)
37
* FEATURE: support configuration via environment variables
Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
# Etherpad Lite Dockerfile
22
#
3-
# https://github.com/ether/etherpad-docker
3+
# https://github.com/ether/etherpad-lite
44
#
55
# Author: muxator
6-
#
7-
# Version 0.1
86

97
FROM node:10-buster-slim
108
LABEL maintainer="Etherpad team, https://github.com/ether/etherpad-lite"
119

12-
# git hash of the version to be built.
13-
# If not given, build the latest development version.
14-
ARG ETHERPAD_VERSION=develop
15-
1610
# plugins to install while building the container. By default no plugins are
1711
# installed.
1812
# If given a value, it has to be a space-separated, quoted list of plugin names.
@@ -25,24 +19,20 @@ ARG ETHERPAD_PLUGINS=
2519
# this can be done with build args (and is mandatory to build ARM version)
2620
ENV NODE_ENV=development
2721

28-
# grab the ETHERPAD_VERSION tarball from github (no need to clone the whole
29-
# repository)
30-
RUN echo "Getting version: ${ETHERPAD_VERSION}" && \
31-
curl \
32-
--location \
33-
--fail \
34-
--silent \
35-
--show-error \
36-
--output /opt/etherpad-lite.tar.gz \
37-
https://github.com/ether/etherpad-lite/archive/"${ETHERPAD_VERSION}".tar.gz && \
38-
mkdir /opt/etherpad-lite && \
39-
tar xf /opt/etherpad-lite.tar.gz \
40-
--directory /opt/etherpad-lite \
41-
--strip-components=1 && \
42-
rm /opt/etherpad-lite.tar.gz
22+
# Follow the principle of least privilege: run as unprivileged user.
23+
#
24+
# Running as non-root enables running this image in platforms like OpenShift
25+
# that do not allow images running as root.
26+
RUN useradd --uid 5001 --create-home etherpad
27+
28+
RUN mkdir /opt/etherpad-lite && chown etherpad:etherpad /opt/etherpad-lite
29+
30+
USER etherpad:etherpad
4331

4432
WORKDIR /opt/etherpad-lite
4533

34+
COPY --chown=etherpad:etherpad ./ ./
35+
4636
# install node dependencies for Etherpad
4737
RUN bin/installDeps.sh && \
4838
rm -rf ~/.npm/_cacache
@@ -54,18 +44,7 @@ RUN bin/installDeps.sh && \
5444
RUN for PLUGIN_NAME in ${ETHERPAD_PLUGINS}; do npm install "${PLUGIN_NAME}"; done
5545

5646
# Copy the configuration file.
57-
COPY ./settings.json /opt/etherpad-lite/
58-
59-
# Follow the principle of least privilege: run as unprivileged user.
60-
#
61-
# Running as non-root enables running this image in platforms like OpenShift
62-
# that do not allow images running as root.
63-
RUN \
64-
echo 'etherpad:x:65534:65534:etherpad:/:' > /etc/passwd && \
65-
echo 'etherpad:x:65534:' > /etc/group && \
66-
chown -R etherpad:etherpad ./
67-
68-
USER etherpad
47+
COPY --chown=etherpad:etherpad ./settings.json.docker /opt/etherpad-lite/settings.json
6948

7049
EXPOSE 9001
7150
CMD ["node", "node_modules/ep_etherpad-lite/node/server.js"]

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# A real-time collaborative editor for the web
2+
<a href="https://hub.docker.com/r/etherpad/etherpad"><img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/etherpad/etherpad"></a>
23
![Demo Etherpad Animated Jif](https://i.imgur.com/zYrGkg3.gif "Etherpad in action")
34

45
# About
@@ -61,6 +62,10 @@ If cloning to a subdirectory within another project, you may need to do the foll
6162
2. Edit the db `filename` in `settings.json` to the relative directory with the file (e.g. `application/lib/etherpad-lite/var/dirty.db`)
6263
3. Add auto-generated files to the main project `.gitignore`
6364

65+
## Docker container
66+
67+
Find [here](doc/docker.md) information on running Etherpad in a container.
68+
6469
# Next Steps
6570

6671
## Tweak the settings

bin/cleanRun.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [ -d "../bin" ]; then
99
fi
1010

1111
ignoreRoot=0
12-
for ARG in $*
12+
for ARG in "$@"
1313
do
1414
if [ "$ARG" = "--root" ]; then
1515
ignoreRoot=1
@@ -32,10 +32,10 @@ fi
3232
rm -rf src/node_modules
3333

3434
#Prepare the environment
35-
bin/installDeps.sh $* || exit 1
35+
bin/installDeps.sh "$@" || exit 1
3636

3737
#Move to the node folder and start
3838
echo "Started Etherpad..."
3939

4040
SCRIPTPATH=`pwd -P`
41-
node "${SCRIPTPATH}/node_modules/ep_etherpad-lite/node/server.js" $*
41+
node "${SCRIPTPATH}/node_modules/ep_etherpad-lite/node/server.js" "$@"

bin/debugRun.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ echo "Open 'chrome://inspect' on Chrome to start debugging."
1717

1818
#Use 0.0.0.0 to allow external connections to the debugger
1919
#(ex: running Etherpad on a docker container). Use default port # (9229)
20-
node --inspect=0.0.0.0:9229 node_modules/ep_etherpad-lite/node/server.js $*
20+
node --inspect=0.0.0.0:9229 node_modules/ep_etherpad-lite/node/server.js "$@"

bin/installDeps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ require_minimal_version "nodejs" "$NODE_VERSION_STRING" "$REQUIRED_NODE_MAJOR" "
8383
#Get the name of the settings file
8484
settings="settings.json"
8585
a='';
86-
for arg in $*; do
86+
for arg in "$@"; do
8787
if [ "$a" = "--settings" ] || [ "$a" = "-s" ]; then settings=$arg; fi
8888
a=$arg
8989
done

bin/run.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [ -d "../bin" ]; then
99
fi
1010

1111
ignoreRoot=0
12-
for ARG in $*
12+
for ARG in "$@"
1313
do
1414
if [ "$ARG" = "--root" ]; then
1515
ignoreRoot=1
@@ -29,11 +29,11 @@ if [ "$(id -u)" -eq 0 ] && [ $ignoreRoot -eq 0 ]; then
2929
fi
3030

3131
#Prepare the environment
32-
bin/installDeps.sh $* || exit 1
32+
bin/installDeps.sh "$@" || exit 1
3333

3434
#Move to the node folder and start
3535
echo "Started Etherpad..."
3636

3737
SCRIPTPATH=`pwd -P`
38-
exec node "$SCRIPTPATH/node_modules/ep_etherpad-lite/node/server.js" $*
38+
exec node "$SCRIPTPATH/node_modules/ep_etherpad-lite/node/server.js" "$@"
3939

docker/README.md renamed to doc/docker.md

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,60 @@
1-
# Docker image
1+
# Docker
22

3-
This directory contains the files that are used to build the official Docker image on https://hub.docker.com/r/etherpad/etherpad.
3+
The official Docker image is available on https://hub.docker.com/r/etherpad/etherpad.
44

5-
# Downloading from Docker Hub
5+
## Downloading from Docker Hub
66
If you are ok downloading a [prebuilt image from Docker Hub](https://hub.docker.com/r/etherpad/etherpad), these are the commands:
77
```bash
88
# gets the latest published version
99
docker pull etherpad/etherpad
1010

1111
# gets a specific version
12-
docker pull etherpad/etherpad:1.7.5
12+
docker pull etherpad/etherpad:1.8.0
1313
```
1414

15-
# Build a personalized container
15+
## Build a personalized container
1616

1717
If you want to use a personalized settings file, **you will have to rebuild your image**.
1818
All of the following instructions are as a member of the `docker` group.
1919

20-
## Rebuilding with custom settings
21-
Prepare your custom `settings.json` file:
22-
```bash
23-
cd <BASEDIR>/docker
24-
cp ../settings.json.template settings.json
25-
[ further edit your settings.json as needed]
26-
```
20+
### Rebuilding with custom settings
21+
Edit `<BASEDIR>/settings.json.docker` at your will. When rebuilding the image, this file will be copied inside your image and renamed to `setting.json`.
2722

2823
**Each configuration parameter can also be set via an environment variable**, using the syntax `"${ENV_VAR}"` or `"${ENV_VAR:default_value}"`. For details, refer to `settings.json.template`.
2924

30-
## Rebuilding including some plugins
25+
### Rebuilding including some plugins
3126
If you want to install some plugins in your container, it is sufficient to list them in the ETHERPAD_PLUGINS build variable.
3227
The variable value has to be a space separated, double quoted list of plugin names (see examples).
3328

34-
Some plugins will need personalized settings in the `settings.json` file. Just refer to the previous section, and include them in your custom `settings.json`.
29+
Some plugins will need personalized settings. Just refer to the previous section, and include them in your custom `settings.json.docker`.
3530

36-
## Examples
31+
### Examples
3732

38-
Build the latest development version:
33+
Build a Docker image from the currently checked-out code:
3934
```bash
4035
docker build --tag <YOUR_USERNAME>/etherpad .
4136
```
4237

43-
Build the latest stable version:
44-
```bash
45-
docker build --build-arg ETHERPAD_VERSION=master --build-arg NODE_ENV=production --tag <YOUR_USERNAME>/etherpad .
46-
```
47-
48-
Build a specific tagged version:
49-
```bash
50-
docker build --build-arg ETHERPAD_VERSION=1.7.5 --build-arg NODE_ENV=production --tag <YOUR_USERNAME>/etherpad .
51-
```
52-
53-
Build a specific git hash:
54-
```bash
55-
docker build --build-arg ETHERPAD_VERSION=4c45ac3cb1ae --tag <YOUR_USERNAME>/etherpad .
56-
```
57-
5838
Include two plugins in the container:
5939
```bash
6040
docker build --build-arg ETHERPAD_PLUGINS="ep_codepad ep_author_neat" --tag <YOUR_USERNAME>/etherpad .
6141
```
6242

63-
# Running your instance:
43+
## Running your instance:
6444

6545
To run your instance:
6646
```bash
67-
docker run --detach --publish <DESIDERED_PORT>:9001 <YOUR_USERNAME>/etherpad
47+
docker run --detach --publish <DESIRED_PORT>:9001 <YOUR_USERNAME>/etherpad
6848
```
6949

70-
And point your browser to `http://<YOUR_IP>:<DESIDERED_PORT>`
50+
And point your browser to `http://<YOUR_IP>:<DESIRED_PORT>`
7151

72-
# Options available by default
52+
## Options available by default
7353

74-
The `settings.json` available by default enables some configuration to be set from the environment.
54+
The `settings.json.docker` available by default enables some configuration to be set from the environment.
7555

7656
Available options:
57+
7758
* `TITLE`: The name of the instance
7859
* `FAVICON`: favicon default name, or a fully specified URL to your own favicon
7960
* `SKIN_NAME`: either `no-skin`, `colibris` or an existing directory under `src/static/skins`.
@@ -90,9 +71,10 @@ Available options:
9071
* `DB_FILENAME`: in case `DB_TYPE` is `DirtyDB`, the database filename. Default: `var/dirty.db`
9172
* `ADMIN_PASSWORD`: the password for the `admin` user (leave unspecified if you do not want to create it)
9273
* `USER_PASSWORD`: the password for the first user `user` (leave unspecified if you do not want to create it)
74+
* `TRUST_PROXY`: set to `true` if you are using a reverse proxy in front of Etherpad (for example: Traefik for SSL termination via Let's Encrypt). This will affect security and correctness of the logs if not done
9375
* `LOGLEVEL`: valid values are `DEBUG`, `INFO`, `WARN` and `ERROR`
9476

95-
## Examples
77+
### Examples
9678

9779
Use a Postgres database, no admin user enabled:
9880

doc/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@include documentation
22
@include stats
33
@include localization
4+
@include docker
45
@include skins
56
@include api/api
67
@include plugins

0 commit comments

Comments
 (0)