Page MenuHomeDevCentral

No OneTemporary

diff --git a/README.md b/README.md
index a440818..3378279 100644
--- a/README.md
+++ b/README.md
@@ -1,65 +1,66 @@
# Etherpad Lite image for docker
This is a docker image for [Etherpad Lite](http://etherpad.org/) collaborative
text editor. The Dockerfile for this image has been inspired by the
[official Wordpress](https://registry.hub.docker.com/_/wordpress/) Dockerfile and
[johbo's etherpad-lite](https://registry.hub.docker.com/u/johbo/etherpad-lite/)
image.
This image uses an mysql container for the backend for the pads. It is based
on debian jessie instead of the official node docker image, since the latest
stable version of etherpad-lite does not support npm 2.
## About Etherpad Lite
> *From the official website:*
Etherpad allows you to edit documents collaboratively in real-time, much like a live multi-player editor that runs in your browser. Write articles, press releases, to-do lists, etc. together with your friends, fellow students or colleagues, all working on the same document at the same time.
![alt text](http://i.imgur.com/zYrGkg3.gif "Etherpad in action on PrimaryPad")
All instances provide access to all data through a well-documented API and supports import/export to many major data exchange formats. And if the built-in feature set isn't enough for you, there's tons of plugins that allow you to customize your instance to suit your needs.
You don't need to set up a server and install Etherpad in order to use it. Just pick one of publicly available instances that friendly people from everywhere around the world have set up. Alternatively, you can set up your own instance by following our installation guide
## Quickstart
First you need a running mysql container, for example:
```bash
$ docker run -d -e MYSQL_ROOT_PASSWORD=password --name ep_mysql mysql
```
Finally you can start an instance of Etherpad Lite:
```bash
$ docker run -d --link=ep_mysql:mysql -p 9001:9001 tvelocity/etherpad-lite
```
This will create an etherpad database to the mysql container, if it does not
already exist. You can now access Etherpad Lite from http://localhost:9001/
## Environment variables
This image supports the following environment variables:
* `ETHERPAD_TITLE`: Title of the Etherpad Lite instance. Defaults to "Etherpad".
+* `ETHERPAD_PORT`: Port of the Etherpad Lite instance. Defaults to 9001.
* `ETHERPAD_SESSION_KEY`: Session key for the Etherpad Lite configuraition. You
can set this in case of migrating from another installation. A value is
automatically generated by default.
* `ETHERPAD_ADMIN_PASSWORD`: If set, an admin account is enabled for Etherpad,
and the /admin/ interface is accessible via it.
* `ETHERPAD_ADMIN_USER`: If the admin password is set, this defaults to "admin".
Otherwise the user can set it to another username.
* `ETHERPAD_DB_USER`: By default Etherpad Lite will attempt to connect as root
to the mysql container. This allows to change this.
* `ETHERPAD_DB_PASSWORD`: The password for the mysql user. If the root user is
used, then the password will default to the mysql container's
`MYSQL_ROOT_PASSWORD`.
* `ETHERPAD_DB_NAME`: The mysql database to use. Defaults to *etherpad*. If the
database is not available, it will be created when the container is launched.
The generated settings.json file will be available as a volume under
*/opt/etherpad-lite/var/*.
diff --git a/entrypoint.sh b/entrypoint.sh
index 02d2adc..14134b2 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -1,81 +1,82 @@
#!/bin/bash
set -e
if [ -z "$MYSQL_PORT_3306_TCP_ADDR" ]; then
echo >&2 'error: missing MYSQL_PORT_3306_TCP environment variable'
echo >&2 ' Did you forget to --link some_mysql_container:mysql ?'
exit 1
fi
# if we're linked to MySQL, and we're using the root user, and our linked
# container has a default "root" password set up and passed through... :)
: ${ETHERPAD_DB_USER:=root}
if [ "$ETHERPAD_DB_USER" = 'root' ]; then
: ${ETHERPAD_DB_PASSWORD:=$MYSQL_ENV_MYSQL_ROOT_PASSWORD}
fi
: ${ETHERPAD_DB_NAME:=etherpad}
ETHERPAD_DB_NAME=$( echo $ETHERPAD_DB_NAME | sed 's/\./_/g' )
if [ -z "$ETHERPAD_DB_PASSWORD" ]; then
echo >&2 'error: missing required ETHERPAD_DB_PASSWORD environment variable'
echo >&2 ' Did you forget to -e ETHERPAD_DB_PASSWORD=... ?'
echo >&2
echo >&2 ' (Also of interest might be ETHERPAD_DB_USER and ETHERPAD_DB_NAME.)'
exit 1
fi
: ${ETHERPAD_TITLE:=Etherpad}
+: ${ETHERPAD_PORT:=9001}
: ${ETHERPAD_SESSION_KEY:=$(
node -p "require('crypto').randomBytes(32).toString('hex')")}
# Check if database already exists
RESULT=`mysql -u${ETHERPAD_DB_USER} -p${ETHERPAD_DB_PASSWORD} \
-hmysql --skip-column-names \
-e "SHOW DATABASES LIKE '${ETHERPAD_DB_NAME}'"`
if [ "$RESULT" != $ETHERPAD_DB_NAME ]; then
# mysql database does not exist, create it
echo "Creating database ${ETHERPAD_DB_NAME}"
mysql -u${ETHERPAD_DB_USER} -p${ETHERPAD_DB_PASSWORD} -hmysql \
-e "create database ${ETHERPAD_DB_NAME}"
fi
if [ ! -f settings.json ]; then
cat <<- EOF > settings.json
{
"title": "${ETHERPAD_TITLE}",
"ip": "0.0.0.0",
- "port" : 9001,
+ "port" :${ETHERPAD_PORT},
"sessionKey" : "${ETHERPAD_SESSION_KEY}",
"dbType" : "mysql",
"dbSettings" : {
"user" : "${ETHERPAD_DB_USER}",
"host" : "mysql",
"password": "${ETHERPAD_DB_PASSWORD}",
"database": "${ETHERPAD_DB_NAME}"
},
EOF
if [ $ETHERPAD_ADMIN_PASSWORD ]; then
: ${ETHERPAD_ADMIN_USER:=admin}
cat <<- EOF >> settings.json
"users": {
"${ETHERPAD_ADMIN_USER}": {
"password": "${ETHERPAD_ADMIN_PASSWORD}",
"is_admin": true
}
},
EOF
fi
cat <<- EOF >> settings.json
}
EOF
fi
exec "$@"

File Metadata

Mime Type
text/x-diff
Expires
Thu, Sep 18, 16:36 (12 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2991089
Default Alt Text
(5 KB)

Event Timeline