Skip to content

Commit

Permalink
Add substitutions for core.oidc parameters (#86)
Browse files Browse the repository at this point in the history
Co-authored-by: Evgeniy Antonyuk <antonyuk.evgenyiy@onlyoffice.com>
Co-committed-by: Evgeniy Antonyuk <antonyuk.evgenyiy@onlyoffice.com>
  • Loading branch information
evgeniy-antonyuk authored and agolybev committed Nov 21, 2024
1 parent 0c0c9b0 commit cbb4284
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion install/deb/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ override_dh_auto_build: check_archives
-e "this.ssoauth={ 'path': '../ASC.SsoAuth/' }" -e "this.logLevel=\"warning\"" -e "this.core={ 'products': { 'folder': '/var/www/${PRODUCT}/products', 'subfolder': 'server'} }"

find ${BUILDTOOLS_PATH}/config/ -type f -regex '.*\.\(test\|dev\)\..*' -delete
json -I -f ${BUILDTOOLS_PATH}/config/appsettings.json -e "this.core.notify.postman=\"services\"" -e "this['debug-info'].enabled=\"false\"" -e "this.web.samesite=\"None\""
json -I -f ${BUILDTOOLS_PATH}/config/appsettings.json -e "this.core.notify.postman=\"services\"" -e "this['debug-info'].enabled=\"false\"" -e "this.web.samesite=\"None\"" -e "this.core.oidc.disableValidateToken=\"false\"" -e "this.core.oidc.showPII=\"false\""
json -I -f ${BUILDTOOLS_PATH}/config/apisystem.json -e "this.core.notify.postman=\"services\""
sed 's_\(minlevel=\)"[^"]*"_\1"Warn"_g' -i ${BUILDTOOLS_PATH}/config/nlog.config

Expand Down
3 changes: 3 additions & 0 deletions install/docker/docker-entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
LOG_LEVEL = os.environ["LOG_LEVEL"].lower() 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"
DISABLE_VALIDATE_TOKEN = os.environ["DISABLE_VALIDATE_TOKEN"] if environ.get("DISABLE_VALIDATE_TOKEN") else "false"

CERTIFICATE_PATH = os.environ.get("CERTIFICATE_PATH")
CERTIFICATE_PARAM = "NODE_EXTRA_CA_CERTS=" + CERTIFICATE_PATH + " " if CERTIFICATE_PATH and os.path.exists(CERTIFICATE_PATH) else ""
Expand Down Expand Up @@ -172,6 +173,8 @@ def writeJsonFile(jsonFile, jsonData, indent=4):
updateJsonData(jsonData,"$.files.docservice.url.internal", DOCUMENT_SERVER_CONNECTION_HOST)
updateJsonData(jsonData,"$.files.docservice.secret.value", DOCUMENT_SERVER_JWT_SECRET)
updateJsonData(jsonData,"$.files.docservice.secret.header", DOCUMENT_SERVER_JWT_HEADER)
updateJsonData(jsonData,"$.core.oidc.disableValidateToken", DISABLE_VALIDATE_TOKEN)
updateJsonData(jsonData,"$.core.oidc.showPII", DEBUG_INFO)
updateJsonData(jsonData,"$.debug-info.enabled", DEBUG_INFO)
updateJsonData(jsonData,"$.web.samesite", SAMESITE)

Expand Down
2 changes: 1 addition & 1 deletion install/rpm/SPECS/build.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if ! grep -q 'var/www/%{product}' config/nginx/*.conf; then find config/nginx/ -

json -I -f config/appsettings.services.json -e "this.logPath=\"/var/log/onlyoffice/%{product}\"" -e "this.socket={ 'path': '../ASC.Socket.IO/' }" \
-e "this.ssoauth={ 'path': '../ASC.SsoAuth/' }" -e "this.logLevel=\"warning\"" -e "this.core={ 'products': { 'folder': '%{buildpath}/products', 'subfolder': 'server'} }"
json -I -f config/appsettings.json -e "this.core.notify.postman=\"services\"" -e "this['debug-info'].enabled=\"false\"" -e "this.web.samesite=\"None\""
json -I -f config/appsettings.json -e "this.core.notify.postman=\"services\"" -e "this['debug-info'].enabled=\"false\"" -e "this.web.samesite=\"None\"" -e "this.core.oidc.disableValidateToken=\"false\"" -e "this.core.oidc.showPII=\"false\""
json -I -f config/apisystem.json -e "this.core.notify.postman=\"services\""
json -I -f %{_builddir}/publish/web/public/scripts/config.json -e "this.wrongPortalNameUrl=\"\""

Expand Down
2 changes: 2 additions & 0 deletions install/win/build-batch.bat
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ del /f /q buildtools\install\win\Files\config\*.dev.json
%sed% "/\"debug-info\": {/,/}/ s/\(\"enabled\": \)\".*\"/\1\"false\"/" -i buildtools\install\win\Files\config\appsettings.json

%sed% "s_\(\"samesite\":\).*,_\1 \"None\",_g" -i buildtools\install\win\Files\config\appsettings.json
%sed% "s_\(\"disableValidateToken\":\).*,_\1 \"false\",_g" -i buildtools\install\win\Files\config\appsettings.json
%sed% "s_\(\"showPII\":\).*_\1 \"false\"_g" -i buildtools\install\win\Files\config\appsettings.json

::redirectUrl value replacement
%sed% "s/teamlab.info/onlyoffice.com/g" -i buildtools\install\win\Files\config\autofac.consumers.json
Expand Down

0 comments on commit cbb4284

Please sign in to comment.