Secret can be set from config and internal data is made available

This commit is contained in:
2022-02-11 10:31:58 +01:00
parent 637c248b40
commit fdfcba54ee
2 changed files with 14 additions and 6 deletions

View File

@@ -5,3 +5,4 @@ dockerDns1="80.241.218.68" # https://dismail.de/info.html#dns
dockerDns2="46.182.19.48" # https://digitalcourage.de/support/zensurfreier-dns-server
dockerDefaultConf="/etc/default/docker"
dockerImageName="onlyoffice/documentserver"
dockerSecret=

View File

@@ -94,8 +94,9 @@ step_4() {
fi
}
step_5_info() {
echo "Install/start onlyoffice docker container <SECRET>."
step_5_info() {
echoinfoArgs "<SECRET>"
echo "Install/start onlyoffice docker container"
echoinfo "If <SECRET> is empty, user input will be available if not run --quiet."
echoinfo "$toolName will be run unsecured if no secret was provied."
}
@@ -106,6 +107,8 @@ step_5() {
if [ ! -z "$2" ] ; then
secret="$2"
elif [ ! -z "$dockerSecret" ]; then
secret="$dockerSecret"
elif [ $QUIET -eq 0 ] ; then
exe read -s -p "JWT Secret: " secret
fi
@@ -115,10 +118,14 @@ step_5() {
if [ ! -z "$secret" ] ; then
options="-e JWT_ENABLED=true -e JWT_SECRET="
# This is the only way to provide SECRET($2) to docker command line which handles all types of characters.
exe docker run -i -t -d -p ${onlyOfficePort}:80 ${options}"$secret" --restart=always onlyoffice/documentserver
exe docker run -i -t -d -p ${onlyOfficePort}:80 ${options}"$secret" --restart=always \
-v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \
-v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \
-v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice \
-v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql "${dockerImageName}"
else
echoerr " [W] Running $toolName without JWT (JSON Web Tokens)"
exe docker run -i -t -d -p ${onlyOfficePort}:80 --restart=always onlyoffice/documentserver
exe docker run -i -t -d -p ${onlyOfficePort}:80 --restart=always "${dockerImageName}"
fi
unset secret
@@ -183,5 +190,5 @@ step_102() {
esac
}
VERSION_SEQREV=8
. sequencer.sh
VERSION_SEQREV=14
. /usr/local/bin/sequencer.sh