From 772f477bee0d084ef86307d8cd765c3aab236471 Mon Sep 17 00:00:00 2001 From: Antonios Motakis Date: Sat, 25 Apr 2015 03:41:14 +0200 Subject: [PATCH 1/3] Syncthing: update to version 0.11.0 --- syncthing/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncthing/Dockerfile b/syncthing/Dockerfile index 24c7747..239333b 100644 --- a/syncthing/Dockerfile +++ b/syncthing/Dockerfile @@ -1,6 +1,6 @@ FROM debian:jessie -ENV SYNCTHING_VERSION 0.10.30 +ENV SYNCTHING_VERSION 0.11.0 RUN apt-get update && apt-get install -y ca-certificates --no-install-recommends && rm -rf /var/lib/apt/lists/* From 7e3df528b5ebc204d91dc159dac1b6c9af2340fa Mon Sep 17 00:00:00 2001 From: pierreozoux Date: Sun, 24 May 2015 19:29:20 +0200 Subject: [PATCH 2/3] Adds configuration for etherpad port --- etherpad-lite/README.md | 1 + etherpad-lite/entrypoint.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/etherpad-lite/README.md b/etherpad-lite/README.md index a440818..3378279 100644 --- a/etherpad-lite/README.md +++ b/etherpad-lite/README.md @@ -44,6 +44,7 @@ already exist. You can now access Etherpad Lite from http://localhost:9001/ 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. diff --git a/etherpad-lite/entrypoint.sh b/etherpad-lite/entrypoint.sh index 02d2adc..14134b2 100755 --- a/etherpad-lite/entrypoint.sh +++ b/etherpad-lite/entrypoint.sh @@ -26,6 +26,7 @@ if [ -z "$ETHERPAD_DB_PASSWORD" ]; then fi : ${ETHERPAD_TITLE:=Etherpad} +: ${ETHERPAD_PORT:=9001} : ${ETHERPAD_SESSION_KEY:=$( node -p "require('crypto').randomBytes(32).toString('hex')")} @@ -48,7 +49,7 @@ if [ ! -f settings.json ]; then { "title": "${ETHERPAD_TITLE}", "ip": "0.0.0.0", - "port" : 9001, + "port" :${ETHERPAD_PORT}, "sessionKey" : "${ETHERPAD_SESSION_KEY}", "dbType" : "mysql", "dbSettings" : { From 9a7206f37eaf8ac851fe614f2cd2a8eac2d63d5f Mon Sep 17 00:00:00 2001 From: Pierre Ozoux Date: Mon, 25 May 2015 09:27:40 +0000 Subject: [PATCH 3/3] Adds db check --- etherpad-lite/entrypoint.sh | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/etherpad-lite/entrypoint.sh b/etherpad-lite/entrypoint.sh index 14134b2..0b38c64 100755 --- a/etherpad-lite/entrypoint.sh +++ b/etherpad-lite/entrypoint.sh @@ -30,20 +30,32 @@ fi : ${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} \ +# Check DB connectivity + +for ((i=0;i<20;i++)) +do + DB_CONNECTABLE=$(mysql -u${ETHERPAD_DB_USER} -p${ETHERPAD_DB_PASSWORD} -hmysql -e 'status' >/dev/null 2>&1; echo "$?") + if [[ DB_CONNECTABLE -eq 0 ]]; then + break + fi + sleep 1 +done + +if [[ $DB_CONNECTABLE -eq 0 ]]; then + # 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 + 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 + fi -if [ ! -f settings.json ]; then + if [ ! -f settings.json ]; then cat <<- EOF > settings.json { @@ -77,6 +89,11 @@ if [ ! -f settings.json ]; then cat <<- EOF >> settings.json } EOF + fi + + exec "$@" +else + echo "Cannot connect to Mysql" + exit $DB_CONNECTABLE fi -exec "$@"