aboutsummaryrefslogtreecommitdiff
path: root/docker/scripts/pre/03_make_dhparam.sh
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2017-03-21 18:59:12 +0100
committerChristophe Romain <christophe.romain@process-one.net>2017-03-21 18:59:12 +0100
commit430fc8eb6235f6d73468187453a7376e5879a8bb (patch)
tree011f5f6b30f3ec1b3c0aab2daa79af6c87120178 /docker/scripts/pre/03_make_dhparam.sh
parentprosody2ejabberd: Fix offline message record type (diff)
Update docker files from latest Rafael's changes
Diffstat (limited to 'docker/scripts/pre/03_make_dhparam.sh')
-rwxr-xr-xdocker/scripts/pre/03_make_dhparam.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/docker/scripts/pre/03_make_dhparam.sh b/docker/scripts/pre/03_make_dhparam.sh
new file mode 100755
index 000000000..e240210fc
--- /dev/null
+++ b/docker/scripts/pre/03_make_dhparam.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -e
+
+source "${EJABBERD_HOME}/scripts/lib/base_config.sh"
+source "${EJABBERD_HOME}/scripts/lib/config.sh"
+source "${EJABBERD_HOME}/scripts/lib/base_functions.sh"
+source "${EJABBERD_HOME}/scripts/lib/functions.sh"
+
+
+make_dhparam() {
+ local dhfile=$1
+ local bits=$2
+
+ echo "Writing dh file to '${dhfile}'..."
+ openssl dhparam -out ${dhfile} ${bits}
+}
+
+
+is_true ${EJABBERD_SKIP_MAKE_DHPARAM} \
+ && echo "Skip DH param generation" \
+ && exit 0
+
+if is_true ${EJABBERD_DHPARAM} ; then
+ file_exist ${SSLDHPARAM} \
+ || make_dhparam ${SSLDHPARAM} 4096
+fi
+
+exit 0