From ff8fcd01df45d9e980ebe3585089604ac337dc33 Mon Sep 17 00:00:00 2001 From: Roman Demidov Date: Mon, 12 Dec 2022 11:42:20 +0300 Subject: [PATCH] Fix #59850: Update cause the reset of .loopback=true param (#114) --- bin/documentserver-start.sh | 14 -------------- bin/nginx-start.sh | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/documentserver-start.sh b/bin/documentserver-start.sh index 32c3435..19fe051 100755 --- a/bin/documentserver-start.sh +++ b/bin/documentserver-start.sh @@ -37,20 +37,6 @@ else sed -i -e 's/"rejectUnauthorized": false/"rejectUnauthorized": true/' /var/snap/onlyoffice-ds/current/etc/onlyoffice/documentserver/local.json fi -LOOPBACK_ENABLED=$(snapctl get onlyoffice.loopback) -NGINX_CONF_PATH="$SNAP_DATA/etc/onlyoffice/documentserver/nginx" -if [ "${LOOPBACK_ENABLED}" == "true" ]; then - sed -i -r 's/ #(allow)/ \1/' \ - $NGINX_CONF_PATH/ds.conf.tmpl $NGINX_CONF_PATH/ds-ssl.conf.tmpl - sed -i -r 's/ #(deny)/ \1/' \ - $NGINX_CONF_PATH/ds.conf.tmpl $NGINX_CONF_PATH/ds-ssl.conf.tmpl -else - sed -i -r 's/ (allow)/ #\1/' \ - $NGINX_CONF_PATH/ds.conf.tmpl $NGINX_CONF_PATH/ds-ssl.conf.tmpl - sed -i -r 's/ (deny)/ #\1/' \ - $NGINX_CONF_PATH/ds.conf.tmpl $NGINX_CONF_PATH/ds-ssl.conf.tmpl -fi - export LC_ALL=C.UTF-8 #check fonts diff --git a/bin/nginx-start.sh b/bin/nginx-start.sh index 8abdea1..6f7720d 100755 --- a/bin/nginx-start.sh +++ b/bin/nginx-start.sh @@ -12,6 +12,20 @@ SSL_DHPARAM_PATH="$SSL_CERTIFICATES_DIR/dhparam.pem" SSL_CERTIFICATE_PATH="$SSL_CERTIFICATES_DIR/onlyoffice.crt" SSL_KEY_PATH="$SSL_CERTIFICATES_DIR/onlyoffice.key" +#check loopback +LOOPBACK_ENABLED=$(snapctl get onlyoffice.loopback) +if [ "${LOOPBACK_ENABLED}" == "true" ]; then + sed -i -r 's/ #(allow)/ \1/' \ + $NGINX_ONLYOFFICE_PATH/ds.conf.tmpl $NGINX_ONLYOFFICE_PATH/ds-ssl.conf.tmpl + sed -i -r 's/ #(deny)/ \1/' \ + $NGINX_ONLYOFFICE_PATH/ds.conf.tmpl $NGINX_ONLYOFFICE_PATH/ds-ssl.conf.tmpl +else + sed -i -r 's/ (allow)/ #\1/' \ + $NGINX_ONLYOFFICE_PATH/ds.conf.tmpl $NGINX_ONLYOFFICE_PATH/ds-ssl.conf.tmpl + sed -i -r 's/ (deny)/ #\1/' \ + $NGINX_ONLYOFFICE_PATH/ds.conf.tmpl $NGINX_ONLYOFFICE_PATH/ds-ssl.conf.tmpl +fi + mkdir -p $SNAP_DATA/var/log/nginx/ mkdir -p $SNAP_DATA/var/cache/nginx/client_temp mkdir -p $SNAP_DATA/var/log/onlyoffice/documentserver