From f8a51fc90b911b72fc380ed3e338c88e34d0da84 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Fri, 15 Sep 2023 13:49:35 +0500 Subject: [PATCH] Add samesite variable predefinition --- build/install/deb/debian/rules | 2 +- build/install/docker/docker-entrypoint.py | 2 ++ build/install/rpm/SPECS/build.spec | 2 +- build/install/win/build-batch.bat | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build/install/deb/debian/rules b/build/install/deb/debian/rules index 4c60f3167b..cfb0db3484 100755 --- a/build/install/deb/debian/rules +++ b/build/install/deb/debian/rules @@ -45,7 +45,7 @@ override_dh_auto_build: -e "this.ssoauth={ 'path': '../ASC.SsoAuth/' }" -e "this.logLevel=\"warning\"" -e "this.core={ 'products': { 'folder': '/var/www/${PRODUCT}/products', 'subfolder': 'server'} }" find ${SRC_PATH}/config/ -type f -regex '.*\.\(test\|dev\).*' -delete - json -I -f ${SRC_PATH}/config/appsettings.json -e "this.core.notify.postman=\"services\"" -e "this.Logging.LogLevel.Default=\"Warning\"" -e "this['debug-info'].enabled=\"false\"" + json -I -f ${SRC_PATH}/config/appsettings.json -e "this.core.notify.postman=\"services\"" -e "this.Logging.LogLevel.Default=\"Warning\"" -e "this['debug-info'].enabled=\"false\"" -e "this.web.samesite=\"None\"" json -I -f ${SRC_PATH}/config/apisystem.json -e "this.core.notify.postman=\"services\"" sed 's_\(minlevel=\)".*"_\1"Warn"_g' -i ${SRC_PATH}/config/nlog.config diff --git a/build/install/docker/docker-entrypoint.py b/build/install/docker/docker-entrypoint.py index 9b7c987d54..f51e2b8df0 100755 --- a/build/install/docker/docker-entrypoint.py +++ b/build/install/docker/docker-entrypoint.py @@ -37,6 +37,7 @@ APP_KNOWN_PROXIES = os.environ["APP_KNOWN_PROXIES"] APP_KNOWN_NETWORKS = os.environ["APP_KNOWN_NETWORKS"] LOG_LEVEL = os.environ["LOG_LEVEL"] if environ.get("LOG_LEVEL") else None DEBUG_INFO = os.environ["DEBUG_INFO"] if environ.get("DEBUG_INFO") else "false" +SAMESITE = os.environ["SAMESITE"] if environ.get("SAMESITE") else "None" DOCUMENT_CONTAINER_NAME = os.environ["DOCUMENT_CONTAINER_NAME"] if environ.get("DOCUMENT_CONTAINER_NAME") else "onlyoffice-document-server" DOCUMENT_SERVER_JWT_SECRET = os.environ["DOCUMENT_SERVER_JWT_SECRET"] if environ.get("DOCUMENT_SERVER_JWT_SECRET") else "your_jwt_secret" @@ -167,6 +168,7 @@ updateJsonData(jsonData,"$.files.docservice.secret.value", DOCUMENT_SERVER_JWT_S updateJsonData(jsonData,"$.files.docservice.secret.header", DOCUMENT_SERVER_JWT_HEADER) updateJsonData(jsonData,"$.Logging.LogLevel.Default", LOG_LEVEL) updateJsonData(jsonData,"$.debug-info.enabled", DEBUG_INFO) +updateJsonData(jsonData,"$.web.samesite", SAMESITE) if INSTALLATION_TYPE == "ENTERPRISE": updateJsonData(jsonData, "$.license.file.path", "/app/onlyoffice/data/license.lic") diff --git a/build/install/rpm/SPECS/build.spec b/build/install/rpm/SPECS/build.spec index 61f08b551c..17df32e1da 100644 --- a/build/install/rpm/SPECS/build.spec +++ b/build/install/rpm/SPECS/build.spec @@ -16,7 +16,7 @@ json -I -f %{_builddir}/%{sourcename}/config/appsettings.services.json -e "this. -e "this.ssoauth={ 'path': '../ASC.SsoAuth/' }" -e "this.logLevel=\"warning\"" -e "this.core={ 'products': { 'folder': '%{buildpath}/products', 'subfolder': 'server'} }" find %{_builddir}/%{sourcename}/config/ -type f -regex '.*\.\(test\|dev\).*' -delete -json -I -f %{_builddir}/%{sourcename}/config/appsettings.json -e "this.core.notify.postman=\"services\"" -e "this.Logging.LogLevel.Default=\"Warning\"" -e "this['debug-info'].enabled=\"false\"" +json -I -f %{_builddir}/%{sourcename}/config/appsettings.json -e "this.core.notify.postman=\"services\"" -e "this.Logging.LogLevel.Default=\"Warning\"" -e "this['debug-info'].enabled=\"false\"" -e "this.web.samesite=\"None\"" json -I -f %{_builddir}/%{sourcename}/config/apisystem.json -e "this.core.notify.postman=\"services\"" sed 's_\(minlevel=\)".*"_\1"Warn"_g' -i %{_builddir}/%{sourcename}/config/nlog.config diff --git a/build/install/win/build-batch.bat b/build/install/win/build-batch.bat index 6fd1c61a61..3083f48e85 100644 --- a/build/install/win/build-batch.bat +++ b/build/install/win/build-batch.bat @@ -52,6 +52,8 @@ del /f /q build\install\win\Files\config\*.dev.json %sed% "s_\(\"logLevel\":\).*_\1 \"warning\"_g" -i build\install\win\Files\config\appsettings.services.json %sed% "/\"debug-info\": {/,/}/ s/\(\"enabled\": \)\".*\"/\1\"false\"/" -i build\install\win\Files\config\appsettings.json +%sed% "s_\(\"samesite\":\).*,_\1 \"None\",_g" -i build\install\win\Files\config\appsettings.json + ::redirectUrl value replacement %sed% "s/teamlab.info/onlyoffice.com/g" -i build\install\win\Files\config/autofac.consumers.json