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 dockerDns2="46.182.19.48" # https://digitalcourage.de/support/zensurfreier-dns-server
dockerDefaultConf="/etc/default/docker" dockerDefaultConf="/etc/default/docker"
dockerImageName="onlyoffice/documentserver" dockerImageName="onlyoffice/documentserver"
dockerSecret=

View File

@@ -95,7 +95,8 @@ step_4() {
} }
step_5_info() { step_5_info() {
echo "Install/start onlyoffice docker container <SECRET>." echoinfoArgs "<SECRET>"
echo "Install/start onlyoffice docker container"
echoinfo "If <SECRET> is empty, user input will be available if not run --quiet." 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." echoinfo "$toolName will be run unsecured if no secret was provied."
} }
@@ -106,6 +107,8 @@ step_5() {
if [ ! -z "$2" ] ; then if [ ! -z "$2" ] ; then
secret="$2" secret="$2"
elif [ ! -z "$dockerSecret" ]; then
secret="$dockerSecret"
elif [ $QUIET -eq 0 ] ; then elif [ $QUIET -eq 0 ] ; then
exe read -s -p "JWT Secret: " secret exe read -s -p "JWT Secret: " secret
fi fi
@@ -115,10 +118,14 @@ step_5() {
if [ ! -z "$secret" ] ; then if [ ! -z "$secret" ] ; then
options="-e JWT_ENABLED=true -e JWT_SECRET=" 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. # 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 else
echoerr " [W] Running $toolName without JWT (JSON Web Tokens)" 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 fi
unset secret unset secret
@@ -183,5 +190,5 @@ step_102() {
esac esac
} }
VERSION_SEQREV=8 VERSION_SEQREV=14
. sequencer.sh . /usr/local/bin/sequencer.sh