diff --git a/build/install/OneClickInstall/install-Debian/install-app.sh b/build/install/OneClickInstall/install-Debian/install-app.sh index 9e88d16ad9..c7849c089c 100644 --- a/build/install/OneClickInstall/install-Debian/install-app.sh +++ b/build/install/OneClickInstall/install-Debian/install-app.sh @@ -31,6 +31,7 @@ if [ "$UPDATE" = "true" ] && [ "$DOCUMENT_SERVER_INSTALLED" = "true" ]; then RECONFIGURE_PRODUCT="true" else + systemctl is-active openresty | grep -q "^active" && systemctl stop openresty apt-get install -y --only-upgrade ${ds_pkg_name}; fi fi @@ -60,6 +61,8 @@ if [ "$DOCUMENT_SERVER_INSTALLED" = "false" ]; then echo ${package_sysname}-documentserver $DS_COMMON_NAME/jwt-enabled select ${DS_JWT_ENABLED} | sudo debconf-set-selections echo ${package_sysname}-documentserver $DS_COMMON_NAME/jwt-secret select ${DS_JWT_SECRET} | sudo debconf-set-selections echo ${package_sysname}-documentserver $DS_COMMON_NAME/jwt-header select ${DS_JWT_HEADER} | sudo debconf-set-selections + + systemctl is-active openresty | grep -q "^active" && systemctl stop openresty if [ "$INSTALLATION_TYPE" = "COMMUNITY" ]; then apt-get install -yq ${package_sysname}-documentserver diff --git a/build/install/OneClickInstall/install-Debian/install-preq.sh b/build/install/OneClickInstall/install-Debian/install-preq.sh index e9e5f3a3cc..5ff6ca3801 100644 --- a/build/install/OneClickInstall/install-Debian/install-preq.sh +++ b/build/install/OneClickInstall/install-Debian/install-preq.sh @@ -105,10 +105,7 @@ echo "deb [signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/pac chmod 644 /usr/share/keyrings/openresty.gpg #Temporary fix for missing openresty repository for debian bookworm [ "$DISTRIB_CODENAME" = "bookworm" ] && sed -i "s/$DISTRIB_CODENAME/bullseye/g" /etc/apt/sources.list.d/openresty.list - -if systemctl is-active nginx | grep -q "active"; then - systemctl disable nginx && systemctl stop nginx -fi +systemctl is-active nginx | grep -q "^active" && systemctl stop nginx # setup msttcorefonts echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections diff --git a/build/install/OneClickInstall/install-RedHat/install-app.sh b/build/install/OneClickInstall/install-RedHat/install-app.sh index 5f4c5155d4..d824913724 100644 --- a/build/install/OneClickInstall/install-RedHat/install-app.sh +++ b/build/install/OneClickInstall/install-RedHat/install-app.sh @@ -62,7 +62,7 @@ if [ "${MYSQL_FIRST_TIME_INSTALL}" = "true" ]; then MYSQL="mysql --connect-expired-password -u$MYSQL_SERVER_USER -D mysql"; else MYSQL="mysql --connect-expired-password -u$MYSQL_SERVER_USER -p${MYSQL_TEMPORARY_ROOT_PASS} -D mysql"; - MYSQL_ROOT_PASS=$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 12); + MYSQL_ROOT_PASS=$(echo $MYSQL_TEMPORARY_ROOT_PASS | sed -e 's/;/%/g' -e 's/=/%/g'); fi MYSQL_AUTHENTICATION_PLUGIN=$($MYSQL -e "SHOW VARIABLES LIKE 'default_authentication_plugin';" -s | awk '{print $2}') diff --git a/build/install/OneClickInstall/install-RedHat/install-preq.sh b/build/install/OneClickInstall/install-RedHat/install-preq.sh index da9d86d5aa..48e638d54f 100644 --- a/build/install/OneClickInstall/install-RedHat/install-preq.sh +++ b/build/install/OneClickInstall/install-RedHat/install-preq.sh @@ -94,10 +94,7 @@ END rpm --import https://openresty.org/package/pubkey.gpg OPENRESTY_REPO_FILE=$( [[ "$REV" -ge 9 ]] && echo "openresty2.repo" || echo "openresty.repo" ) curl -o /etc/yum.repos.d/openresty.repo "https://openresty.org/package/centos/${OPENRESTY_REPO_FILE}" - -if systemctl is-active nginx | grep -q "active"; then - systemctl disable nginx && systemctl stop nginx -fi +systemctl is-active nginx | grep -q "^active" && systemctl stop nginx ${package_manager} -y install epel-release \ python3 \ diff --git a/config/nginx/onlyoffice.conf b/config/nginx/onlyoffice.conf index 4d54de4ee4..b15f8ab0c2 100644 --- a/config/nginx/onlyoffice.conf +++ b/config/nginx/onlyoffice.conf @@ -90,29 +90,7 @@ server { proxy_set_header Connection $proxy_connection; proxy_set_header Proxy ""; - - location ~* ^/ds-vpath/ { - rewrite /ds-vpath/(.*) /$1 break; - - proxy_pass http://172.18.0.4:80; - proxy_redirect off; - - client_max_body_size 100m; - - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $proxy_connection; - - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $proxy_x_forwarded_host/ds-vpath; - proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; - - } - - location / { - set $csp ""; + set $csp ""; access_by_lua ' if ngx.req.get_method() == "GET" then local key = string.format("csp:%s",ngx.var.host) @@ -137,6 +115,28 @@ server { end end '; + + location ~* ^/ds-vpath/ { + rewrite /ds-vpath/(.*) /$1 break; + + proxy_pass http://172.18.0.4:80; + proxy_redirect off; + + client_max_body_size 100m; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $proxy_connection; + + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $proxy_x_forwarded_host/ds-vpath; + proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; + + } + + location / { proxy_pass http://127.0.0.1:5001; location ~* /(manifest.json|sw.js|appIcon(.)*\.png|icon.svg|bg-error.png|favicon.ico|debuginfo.md) { try_files /$basename /index.html =404;