Skip to content

Commit

Permalink
Fix #59850: Update cause the reset of .loopback=true param (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
romandemidov authored Dec 12, 2022
1 parent d478d1e commit ff8fcd0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 0 additions & 14 deletions bin/documentserver-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions bin/nginx-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ff8fcd0

Please sign in to comment.