From 36caae2baad09e22c962f63eda177ab283404a8c Mon Sep 17 00:00:00 2001 From: Sergey Kirichenko Date: Wed, 4 Oct 2023 17:05:30 +0300 Subject: [PATCH 01/16] Fix entrypoint in nginx (#4) --- install/docker/Dockerfile.app | 1 + 1 file changed, 1 insertion(+) diff --git a/install/docker/Dockerfile.app b/install/docker/Dockerfile.app index b1afb17e2f..60d65e7989 100644 --- a/install/docker/Dockerfile.app +++ b/install/docker/Dockerfile.app @@ -153,6 +153,7 @@ COPY --from=base ${SRC_PATH}/buildtools/install/docker/config/nginx/docker-entry COPY --from=base ${SRC_PATH}/buildtools/install/docker/config/nginx/templates/upstream.conf.template /etc/nginx/templates/upstream.conf.template COPY --from=base ${SRC_PATH}/buildtools/install/docker/config/nginx/templates/nginx.conf.template /etc/nginx/nginx.conf.template COPY --from=base ${SRC_PATH}/buildtools/install/docker/prepare-nginx-router.sh /docker-entrypoint.d/prepare-nginx-router.sh +COPY --from=base ${SRC_PATH}/buildtools/install/docker/config/nginx/docker-entrypoint.sh /docker-entrypoint.sh # changes for upstream configure From 897ccd9033cb76e30215542714c6b5c2226ff0c7 Mon Sep 17 00:00:00 2001 From: Vyacheslav Semin Date: Thu, 5 Oct 2023 16:16:10 +0300 Subject: [PATCH 02/16] Add the ability to set a pass for redis in router (#5) * Add the ability to set a pass for redis in router * Add redis_password to compose --- install/docker/docspace.yml | 1 + install/docker/prepare-nginx-router.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/install/docker/docspace.yml b/install/docker/docspace.yml index 6dfa8c8d9f..8ba08c3b04 100644 --- a/install/docker/docspace.yml +++ b/install/docker/docspace.yml @@ -222,6 +222,7 @@ services: - REDIS_CONTAINER_NAME=${REDIS_CONTAINER_NAME} - REDIS_HOST=${REDIS_HOST} - REDIS_PORT=${REDIS_PORT} + - REDIS_PASSWORD=${REDIS_PASSWORD} - SERVICE_PORT=${SERVICE_PORT} volumes: - router_log:/var/log/nginx diff --git a/install/docker/prepare-nginx-router.sh b/install/docker/prepare-nginx-router.sh index b508ea09b6..b99e41221e 100755 --- a/install/docker/prepare-nginx-router.sh +++ b/install/docker/prepare-nginx-router.sh @@ -2,8 +2,10 @@ WRONG_PORTAL_NAME_URL=${WRONG_PORTAL_NAME_URL:-""} REDIS_HOST=${REDIS_HOST:-"${REDIS_CONTAINER_NAME}"} REDIS_PORT=${REDIS_PORT:-"6379"} +REDIS_PASSWORD=${REDIS_PASSWORD:-""} envsubst '$MAP_HASH_BUCKET_SIZE,$COUNT_WORKER_CONNECTIONS' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf sed -i "s~\(redis_host =\).*~\1 \"$REDIS_HOST\"~" /etc/nginx/conf.d/onlyoffice.conf sed -i "s~\(redis_port =\).*~\1 $REDIS_PORT~" /etc/nginx/conf.d/onlyoffice.conf +sed -i "s~\(redis_pass =\).*~\1 \"$REDIS_PASSWORD\"~" /etc/nginx/conf.d/onlyoffice.conf sed -i "s~\(\"wrongPortalNameUrl\":\).*,~\1 \"${WRONG_PORTAL_NAME_URL}\",~g" /var/www/public/scripts/config.json From 0142e65f9714962e7f4e8c8c763cba169ea268b4 Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Thu, 5 Oct 2023 17:48:54 +0400 Subject: [PATCH 03/16] Fix dnsmasq run --- install/docker/dnsmasq.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/docker/dnsmasq.yml b/install/docker/dnsmasq.yml index 4d818284cd..dba10133d0 100644 --- a/install/docker/dnsmasq.yml +++ b/install/docker/dnsmasq.yml @@ -14,6 +14,6 @@ services: - HTTP_USER=foo - HTTP_PASS=bar volumes: - - ${ROOT_DIR}/config/dnsmasq.conf:/etc/dnsmasq.conf + - ${ROOT_DIR}/buildtools/config/dnsmasq.conf:/etc/dnsmasq.conf cap_add: - NET_ADMIN From 46127d3b7e4d313300b5f67e52a53391a3826fe8 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Mon, 9 Oct 2023 12:54:49 +0500 Subject: [PATCH 04/16] Fix incorrect log level substitution (#8) --- install/deb/debian/rules | 2 +- install/docker/docker-entrypoint.py | 3 +-- install/rpm/SPECS/build.spec | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/install/deb/debian/rules b/install/deb/debian/rules index 0401ee8fce..04bbc1d10d 100755 --- a/install/deb/debian/rules +++ b/install/deb/debian/rules @@ -47,7 +47,7 @@ override_dh_auto_build: 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\"" -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 + sed 's_\(minlevel=\)"[^"]*"_\1"Warn"_g' -i ${SRC_PATH}/config/nlog.config sed 's_etc/nginx_etc/openresty_g' -i ${SRC_PATH}/config/nginx/*.conf sed 's/teamlab.info/onlyoffice.com/g' -i ${SRC_PATH}/config/autofac.consumers.json diff --git a/install/docker/docker-entrypoint.py b/install/docker/docker-entrypoint.py index f51e2b8df0..633c90e49c 100644 --- a/install/docker/docker-entrypoint.py +++ b/install/docker/docker-entrypoint.py @@ -35,7 +35,7 @@ OAUTH_REDIRECT_URL = os.environ["OAUTH_REDIRECT_URL"] if environ.get("OAUTH_REDI APP_STORAGE_ROOT = os.environ["APP_STORAGE_ROOT"] if environ.get("APP_STORAGE_ROOT") else BASE_DIR + "/data/" 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 +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" @@ -166,7 +166,6 @@ updateJsonData(jsonData,"$.files.docservice.url.public", DOCUMENT_SERVER_URL_PUB 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,"$.Logging.LogLevel.Default", LOG_LEVEL) updateJsonData(jsonData,"$.debug-info.enabled", DEBUG_INFO) updateJsonData(jsonData,"$.web.samesite", SAMESITE) if INSTALLATION_TYPE == "ENTERPRISE": diff --git a/install/rpm/SPECS/build.spec b/install/rpm/SPECS/build.spec index f5a3256b6d..7a570f4cd6 100644 --- a/install/rpm/SPECS/build.spec +++ b/install/rpm/SPECS/build.spec @@ -18,7 +18,7 @@ json -I -f %{_builddir}/%{sourcename}/config/appsettings.services.json -e "this. 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\"" -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 +sed 's_\(minlevel=\)"[^"]*"_\1"Warn"_g' -i %{_builddir}/%{sourcename}/config/nlog.config sed 's_etc/nginx_etc/openresty_g' -i %{_builddir}/%{sourcename}/config/nginx/*.conf sed 's/teamlab.info/onlyoffice.com/g' -i %{_builddir}/%{sourcename}/config/autofac.consumers.json From a616b3b6d286d66e1a852e81d7500af4e987f021 Mon Sep 17 00:00:00 2001 From: Nasrullo Nurullaev <61620246+nasrullonurullaev@users.noreply.github.com> Date: Mon, 9 Oct 2023 17:38:14 +0500 Subject: [PATCH 05/16] Refactor windows build (#10) * Refactor builds for windows * Change web build directories * Directory fix * build to buildtools * Small fixes * Fix issue with building Utils.csproj * Fix issue with nuget packages * Remove sed temp files from directory --- .../win/CustomActions/C#/Utils/Utils.csproj | 2 +- install/win/build-batch.bat | 139 +++++++++--------- install/win/build-download-prereq.ps1 | 2 +- install/win/frontend-copy.bat | 8 +- install/win/publish-script.bat | 4 +- 5 files changed, 79 insertions(+), 76 deletions(-) diff --git a/install/win/CustomActions/C#/Utils/Utils.csproj b/install/win/CustomActions/C#/Utils/Utils.csproj index 7edee52fdf..a9c2a20426 100644 --- a/install/win/CustomActions/C#/Utils/Utils.csproj +++ b/install/win/CustomActions/C#/Utils/Utils.csproj @@ -1,5 +1,5 @@ - + Debug x86 diff --git a/install/win/build-batch.bat b/install/win/build-batch.bat index 138a9701c9..631538a0b6 100644 --- a/install/win/build-batch.bat +++ b/install/win/build-batch.bat @@ -1,111 +1,114 @@ REM echo ######## Set variables ######## set "publisher="Ascensio System SIA"" -set "nuget="%cd%\thirdparty\SimpleRestServices\src\.nuget\NuGet.exe"" +set "nuget="%cd%\server\thirdparty\SimpleRestServices\src\.nuget\NuGet.exe"" set "environment=production" REM echo ######## Extracting and preparing files to build ######## -md build\install\win\OpenResty\tools -md build\install\win\Files\tools -md build\install\win\Files\Logs -md build\install\win\Files\Data -md build\install\win\Files\sbin -md build\install\win\Files\products\ASC.Files\server\temp -md build\install\win\Files\products\ASC.People\server\temp -md build\install\win\Files\services\ASC.Data.Backup\service\temp -md build\install\win\Files\services\ASC.Files.Service\service\temp -md build\install\win\Files\services\ASC.Notify\service\temp -md build\install\win\Files\services\ASC.Studio.Notify\service\temp -md build\install\win\Files\services\ASC.Data.Backup.BackgroundTasks\service\temp -md build\install\win\Files\services\ASC.ClearEvents\service\temp -md build\install\win\Files\services\ASC.Web.Api\service\temp -md build\install\win\Files\services\ASC.Web.Studio\service\temp -md build\install\win\Files\services\ASC.Web.HealthChecks.UI\service\temp -copy build\install\win\WinSW.NET4.exe "build\install\win\OpenResty\tools\OpenResty.exe" /y -copy build\install\win\tools\OpenResty.xml "build\install\win\OpenResty\tools\OpenResty.xml" /y -copy build\install\win\WinSW3.0.0.exe "build\install\win\Files\tools\Socket.IO.exe" /y -copy build\install\win\tools\Socket.IO.xml "build\install\win\Files\tools\Socket.IO.xml" /y -copy build\install\win\WinSW3.0.0.exe "build\install\win\Files\tools\SsoAuth.exe" /y -copy build\install\win\tools\SsoAuth.xml "build\install\win\Files\tools\SsoAuth.xml" /y -copy build\install\win\WinSW3.0.0.exe "build\install\win\Files\tools\DocEditor.exe" /y -copy build\install\win\tools\DocEditor.xml "build\install\win\Files\tools\DocEditor.xml" /y -copy build\install\win\WinSW3.0.0.exe "build\install\win\Files\tools\Login.exe" /y -copy build\install\win\tools\Login.xml "build\install\win\Files\tools\Login.xml" /y -copy "build\install\win\nginx.conf" "build\install\win\Files\nginx\conf\nginx.conf" /y -copy "build\install\docker\config\nginx\onlyoffice-proxy.conf" "build\install\win\Files\nginx\conf\onlyoffice-proxy.conf" /y -copy "build\install\docker\config\nginx\onlyoffice-proxy-ssl.conf" "build\install\win\Files\nginx\conf\onlyoffice-proxy-ssl.conf.tmpl" /y -copy "build\install\docker\config\nginx\letsencrypt.conf" "build\install\win\Files\nginx\conf\includes\letsencrypt.conf" /y -copy "build\install\win\sbin\docspace-ssl-setup.ps1" "build\install\win\Files\sbin\docspace-ssl-setup.ps1" /y -rmdir build\install\win\publish /s /q +md buildtools\install\win\OpenResty\tools +md buildtools\install\win\Files\tools +md buildtools\install\win\Files\Logs +md buildtools\install\win\Files\Data +md buildtools\install\win\Files\sbin +md buildtools\install\win\Files\products\ASC.Files\server\temp +md buildtools\install\win\Files\products\ASC.People\server\temp +md buildtools\install\win\Files\services\ASC.Data.Backup\service\temp +md buildtools\install\win\Files\services\ASC.Files.Service\service\temp +md buildtools\install\win\Files\services\ASC.Notify\service\temp +md buildtools\install\win\Files\services\ASC.Studio.Notify\service\temp +md buildtools\install\win\Files\services\ASC.Data.Backup.BackgroundTasks\service\temp +md buildtools\install\win\Files\services\ASC.ClearEvents\service\temp +md buildtools\install\win\Files\services\ASC.Web.Api\service\temp +md buildtools\install\win\Files\services\ASC.Web.Studio\service\temp +md buildtools\install\win\Files\services\ASC.Web.HealthChecks.UI\service\temp +copy buildtools\install\win\WinSW.NET4.exe "buildtools\install\win\OpenResty\tools\OpenResty.exe" /y +copy buildtools\install\win\tools\OpenResty.xml "buildtools\install\win\OpenResty\tools\OpenResty.xml" /y +copy buildtools\install\win\WinSW3.0.0.exe "buildtools\install\win\Files\tools\Socket.IO.exe" /y +copy buildtools\install\win\tools\Socket.IO.xml "buildtools\install\win\Files\tools\Socket.IO.xml" /y +copy buildtools\install\win\WinSW3.0.0.exe "buildtools\install\win\Files\tools\SsoAuth.exe" /y +copy buildtools\install\win\tools\SsoAuth.xml "buildtools\install\win\Files\tools\SsoAuth.xml" /y +copy buildtools\install\win\WinSW3.0.0.exe "buildtools\install\win\Files\tools\DocEditor.exe" /y +copy buildtools\install\win\tools\DocEditor.xml "buildtools\install\win\Files\tools\DocEditor.xml" /y +copy buildtools\install\win\WinSW3.0.0.exe "buildtools\install\win\Files\tools\Login.exe" /y +copy buildtools\install\win\tools\Login.xml "buildtools\install\win\Files\tools\Login.xml" /y +copy "buildtools\install\win\nginx.conf" "buildtools\install\win\Files\nginx\conf\nginx.conf" /y +copy "buildtools\install\docker\config\nginx\onlyoffice-proxy.conf" "buildtools\install\win\Files\nginx\conf\onlyoffice-proxy.conf" /y +copy "buildtools\install\docker\config\nginx\onlyoffice-proxy-ssl.conf" "buildtools\install\win\Files\nginx\conf\onlyoffice-proxy-ssl.conf.tmpl" /y +copy "buildtools\install\docker\config\nginx\letsencrypt.conf" "buildtools\install\win\Files\nginx\conf\includes\letsencrypt.conf" /y +copy "buildtools\install\win\sbin\docspace-ssl-setup.ps1" "buildtools\install\win\Files\sbin\docspace-ssl-setup.ps1" /y +rmdir buildtools\install\win\publish /s /q REM echo ######## SSL configs ######## -%sed% -i "s/the_host/host/g" build\install\win\Files\nginx\conf\onlyoffice-proxy.conf build\install\win\Files\nginx\conf\onlyoffice-proxy-ssl.conf.tmpl -%sed% -i "s/the_scheme/scheme/g" build\install\win\Files\nginx\conf\onlyoffice-proxy.conf build\install\win\Files\nginx\conf\onlyoffice-proxy-ssl.conf.tmpl -%sed% -i "s/ssl_dhparam \/etc\/ssl\/certs\/dhparam.pem;/#ssl_dhparam \/etc\/ssl\/certs\/dhparam.pem;/" build\install\win\Files\nginx\conf\onlyoffice-proxy-ssl.conf.tmpl -%sed% -i "s_\(.*root\).*;_\1 \"{APPDIR}letsencrypt\";_g" -i build\install\win\Files\nginx\conf\includes\letsencrypt.conf +%sed% -i "s/the_host/host/g" buildtools\install\win\Files\nginx\conf\onlyoffice-proxy.conf buildtools\install\win\Files\nginx\conf\onlyoffice-proxy-ssl.conf.tmpl +%sed% -i "s/the_scheme/scheme/g" buildtools\install\win\Files\nginx\conf\onlyoffice-proxy.conf buildtools\install\win\Files\nginx\conf\onlyoffice-proxy-ssl.conf.tmpl +%sed% -i "s/ssl_dhparam \/etc\/ssl\/certs\/dhparam.pem;/#ssl_dhparam \/etc\/ssl\/certs\/dhparam.pem;/" buildtools\install\win\Files\nginx\conf\onlyoffice-proxy-ssl.conf.tmpl +%sed% -i "s_\(.*root\).*;_\1 \"{APPDIR}letsencrypt\";_g" -i buildtools\install\win\Files\nginx\conf\includes\letsencrypt.conf REM echo ######## Delete test and dev configs ######## -del /f /q build\install\win\Files\config\*.test.json -del /f /q build\install\win\Files\config\*.dev.json +del /f /q buildtools\install\win\Files\config\*.test.json +del /f /q buildtools\install\win\Files\config\*.dev.json ::default logging to warning -%sed% "s_\(\"Default\":\).*,_\1 \"Warning\",_g" -i build\install\win\Files\config\appsettings.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_\(\"Default\":\).*,_\1 \"Warning\",_g" -i buildtools\install\win\Files\config\appsettings.json +%sed% "s_\(\"logLevel\":\).*_\1 \"warning\"_g" -i buildtools\install\win\Files\config\appsettings.services.json +%sed% "/\"debug-info\": {/,/}/ s/\(\"enabled\": \)\".*\"/\1\"false\"/" -i buildtools\install\win\Files\config\appsettings.json -%sed% "s_\(\"samesite\":\).*,_\1 \"None\",_g" -i build\install\win\Files\config\appsettings.json +%sed% "s_\(\"samesite\":\).*,_\1 \"None\",_g" -i buildtools\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 -%sed% "s_\(\"wrongPortalNameUrl\":\).*,_\1 \"\",_g" -i build\install\win\Files\public\scripts\config.json +%sed% "s/teamlab.info/onlyoffice.com/g" -i buildtools\install\win\Files\config/autofac.consumers.json +%sed% "s_\(\"wrongPortalNameUrl\":\).*,_\1 \"\",_g" -i buildtools\install\win\Files\public\scripts\config.json REM echo ######## Remove AWSTarget from nlog.config ######## -%sed% -i "//d; //d" build\install\win\Files\config\nlog.config -del /q build\install\win\Files\config\sed* +%sed% -i "//d; //d" buildtools\install\win\Files\config\nlog.config ::edit environment -%sed% -i "s/\(\W\)PRODUCT.ENVIRONMENT.SUB\(\W\)/\1%environment%\2/g" build\install\win\DocSpace.aip +%sed% -i "s/\(\W\)PRODUCT.ENVIRONMENT.SUB\(\W\)/\1%environment%\2/g" buildtools\install\win\DocSpace.aip ::delete nginx configs -del /f /q build\install\win\Files\nginx\conf\onlyoffice-login.conf -del /f /q build\install\win\Files\nginx\conf\onlyoffice-story.conf +del /f /q buildtools\install\win\Files\nginx\conf\onlyoffice-login.conf +del /f /q buildtools\install\win\Files\nginx\conf\onlyoffice-story.conf +::configure nuget.config +copy "server\NuGet.config" . /y +%sed% -i "s/\.nuget\\packages/server\\.nuget\\packages/g" NuGet.config REM echo ######## Build Utils ######## -%nuget% install %cd%\build\install\win\CustomActions\C#\Utils\packages.config -OutputDirectory %cd%\build\install\win\CustomActions\C#\Utils\packages -%msbuild% build\install\win\CustomActions\C#\Utils\Utils.csproj -copy build\install\win\CustomActions\C#\Utils\bin\Debug\Utils.CA.dll build\install\win\Utils.CA.dll /y -rmdir build\install\win\CustomActions\C#\Utils\bin /s /q -rmdir build\install\win\CustomActions\C#\Utils\obj /s /q +%nuget% install %cd%\buildtools\install\win\CustomActions\C#\Utils\packages.config -OutputDirectory %cd%\buildtools\install\win\CustomActions\C#\Utils\packages +%msbuild% buildtools\install\win\CustomActions\C#\Utils\Utils.csproj +copy buildtools\install\win\CustomActions\C#\Utils\bin\Debug\Utils.CA.dll buildtools\install\win\Utils.CA.dll /y +rmdir buildtools\install\win\CustomActions\C#\Utils\bin /s /q +rmdir buildtools\install\win\CustomActions\C#\Utils\obj /s /q REM echo ######## Delete temp files ######## -del /f /q build\install\win\*.back.* +del /f /q buildtools\install\win\*.back.* +del /f /q sed* REM echo ######## Build MySQL Server Installer ######## -iscc /Qp /S"byparam="signtool" sign /a /n "%publisher%" /t http://timestamp.digicert.com $f" "build\install\win\MySQL Server Installer Runner.iss" +iscc /Qp /S"byparam="signtool" sign /a /n "%publisher%" /t http://timestamp.digicert.com $f" "buildtools\install\win\MySQL Server Installer Runner.iss" REM echo ######## Build OpenResty ######## IF "%SignBuild%"=="true" ( -%AdvancedInstaller% /edit build\install\win\OpenResty.aip /SetSig -%AdvancedInstaller% /edit build\install\win\OpenResty.aip /SetDigitalCertificateFile -file %onlyoffice_codesign_path% -password "%onlyoffice_codesign_password%" +%AdvancedInstaller% /edit buildtools\install\win\OpenResty.aip /SetSig +%AdvancedInstaller% /edit buildtools\install\win\OpenResty.aip /SetDigitalCertificateFile -file %onlyoffice_codesign_path% -password "%onlyoffice_codesign_password%" ) -%AdvancedInstaller% /rebuild build\install\win\OpenResty.aip +%AdvancedInstaller% /rebuild buildtools\install\win\OpenResty.aip REM echo ######## Build DocSpace package ######## -%AdvancedInstaller% /edit build\install\win\DocSpace.aip /SetVersion %BUILD_VERSION%.%BUILD_NUMBER% +%AdvancedInstaller% /edit buildtools\install\win\DocSpace.aip /SetVersion %BUILD_VERSION%.%BUILD_NUMBER% IF "%SignBuild%"=="true" ( -%AdvancedInstaller% /edit build\install\win\DocSpace.aip /SetSig -%AdvancedInstaller% /edit build\install\win\DocSpace.aip /SetDigitalCertificateFile -file %onlyoffice_codesign_path% -password "%onlyoffice_codesign_password%" +%AdvancedInstaller% /edit buildtools\install\win\DocSpace.aip /SetSig +%AdvancedInstaller% /edit buildtools\install\win\DocSpace.aip /SetDigitalCertificateFile -file %onlyoffice_codesign_path% -password "%onlyoffice_codesign_password%" ) -%AdvancedInstaller% /rebuild build\install\win\DocSpace.aip +%AdvancedInstaller% /rebuild buildtools\install\win\DocSpace.aip REM echo ######## Build DocSpace Enterprise package ######## -%AdvancedInstaller% /edit build\install\win\DocSpace.Enterprise.aip /SetVersion %BUILD_VERSION%.%BUILD_NUMBER% +%AdvancedInstaller% /edit buildtools\install\win\DocSpace.Enterprise.aip /SetVersion %BUILD_VERSION%.%BUILD_NUMBER% IF "%SignBuild%"=="true" ( -%AdvancedInstaller% /edit build\install\win\DocSpace.Enterprise.aip /SetSig -%AdvancedInstaller% /edit build\install\win\DocSpace.Enterprise.aip /SetDigitalCertificateFile -file %onlyoffice_codesign_path% -password "%onlyoffice_codesign_password%" +%AdvancedInstaller% /edit buildtools\install\win\DocSpace.Enterprise.aip /SetSig +%AdvancedInstaller% /edit buildtools\install\win\DocSpace.Enterprise.aip /SetDigitalCertificateFile -file %onlyoffice_codesign_path% -password "%onlyoffice_codesign_password%" ) -%AdvancedInstaller% /rebuild build\install\win\DocSpace.Enterprise.aip \ No newline at end of file +%AdvancedInstaller% /rebuild buildtools\install\win\DocSpace.Enterprise.aip diff --git a/install/win/build-download-prereq.ps1 b/install/win/build-download-prereq.ps1 index 7a7413cdd8..8e5f355126 100644 --- a/install/win/build-download-prereq.ps1 +++ b/install/win/build-download-prereq.ps1 @@ -86,7 +86,7 @@ $prerequisites = @( } ) -$path_nuget_packages = "${pwd}\.nuget\packages\" +$path_nuget_packages = "${pwd}\server\.nuget\packages\" $nuget_packages = @( @{ diff --git a/install/win/frontend-copy.bat b/install/win/frontend-copy.bat index 0cdfe05103..9373971a86 100644 --- a/install/win/frontend-copy.bat +++ b/install/win/frontend-copy.bat @@ -16,7 +16,7 @@ if defined SecondArg ( set PathToAppFolder=%FirstArg%\publish ) -xcopy "%PathToRepository%\buildtools\deploy\public" "%PathToAppFolder%\public" /s /y /b /i -xcopy "%PathToRepository%\buildtools\deploy\client" "%PathToAppFolder%\client" /s /y /b /i -xcopy "%PathToRepository%\config\nginx" "%PathToAppFolder%\nginx\conf" /s /y /b /i -xcopy "%PathToRepository%\config\*" "%PathToAppFolder%\config" /y /b /i +xcopy "%PathToRepository%\publish\web\public" "%PathToAppFolder%\public" /s /y /b /i +xcopy "%PathToRepository%\publish\web\client" "%PathToAppFolder%\client" /s /y /b /i +xcopy "%PathToRepository%\buildtools\config\nginx" "%PathToAppFolder%\nginx\conf" /s /y /b /i +xcopy "%PathToRepository%\buildtools\config\*" "%PathToAppFolder%\config" /y /b /i diff --git a/install/win/publish-script.bat b/install/win/publish-script.bat index 548f9c7d6f..30c87d87f8 100644 --- a/install/win/publish-script.bat +++ b/install/win/publish-script.bat @@ -41,7 +41,7 @@ xcopy "%PathToRepository%\common\ASC.SsoAuth" "%PathToAppFolder%\services\ASC.Ss rem backend services (Nodejs) in directory 'products' mkdir "%PathToAppFolder%\products\ASC.Login\login" -xcopy "%PathToRepository%\buildtools\deploy\login" "%PathToAppFolder%\products\ASC.Login\login" /s /y /b /i +xcopy "%PathToRepository%\..\publish\web\login" "%PathToAppFolder%\products\ASC.Login\login" /s /y /b /i mkdir "%PathToAppFolder%\products\ASC.Files\editor" -xcopy "%PathToRepository%\buildtools\deploy\editor" "%PathToAppFolder%\products\ASC.Files\editor" /s /y /b /i +xcopy "%PathToRepository%\..\publish\web\editor" "%PathToAppFolder%\products\ASC.Files\editor" /s /y /b /i From 5095fa01d7fd49bf27c3d1c24d7790cfdfbd3b97 Mon Sep 17 00:00:00 2001 From: Sergey Kirichenko Date: Tue, 10 Oct 2023 09:48:01 +0300 Subject: [PATCH 06/16] Add fix for git clone building images (#6) * Fix git clone for building docker image * Modify git clone feature for docker build --- install/docker/Dockerfile.app | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/install/docker/Dockerfile.app b/install/docker/Dockerfile.app index 60d65e7989..4b422ff738 100644 --- a/install/docker/Dockerfile.app +++ b/install/docker/Dockerfile.app @@ -39,17 +39,15 @@ RUN apt-get -y update && \ rm -rf /var/lib/apt/lists/* ADD https://api.github.com/repos/ONLYOFFICE/DocSpace/git/refs/heads/${GIT_BRANCH} version.json -RUN echo ${GIT_BRANCH} && \ - git clone --recurse-submodules -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace.git ${SRC_PATH} +RUN git clone -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace-buildtools.git ${SRC_PATH}/buildtools && \ + git clone --recurse-submodules -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace-Server.git ${SRC_PATH}/server && \ + git clone -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/DocSpace-Client.git ${SRC_PATH}/client RUN cd ${SRC_PATH} && \ mkdir -p /app/onlyoffice/config/ && \ cd buildtools/config && \ ls | grep -v test | grep -v dev | grep -v nginx | xargs cp -t /app/onlyoffice/config/ && \ cd ${SRC_PATH} && \ - # mkdir -p /app/onlyoffice/ && \ - #find buildtools/config/ -maxdepth 1 -name "*.json" | grep -v test | grep -v dev | xargs tar -cvf config.tar && \ - # tar -C "/app/onlyoffice/" -xvf config.tar && \ cp buildtools/config/*.config /app/onlyoffice/config/ && \ mkdir -p /etc/nginx/conf.d && cp -f buildtools/config/nginx/onlyoffice*.conf /etc/nginx/conf.d/ && \ mkdir -p /etc/nginx/includes/ && cp -f buildtools/config/nginx/includes/onlyoffice*.conf /etc/nginx/includes/ && \ From ca41aedeb8eef2007f9c90e8922f1c118f85df39 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Tue, 10 Oct 2023 18:48:27 +0500 Subject: [PATCH 07/16] Refactoring build rpm packages (#9) --- install/rpm/SPECS/build.spec | 47 ++++++------ install/rpm/SPECS/install.spec | 129 ++++++++++++++++----------------- install/rpm/SPECS/product.spec | 25 ++++--- 3 files changed, 105 insertions(+), 96 deletions(-) diff --git a/install/rpm/SPECS/build.spec b/install/rpm/SPECS/build.spec index 7a570f4cd6..fbc483855a 100644 --- a/install/rpm/SPECS/build.spec +++ b/install/rpm/SPECS/build.spec @@ -1,36 +1,39 @@ %build -bash buildtools/install/common/systemd/build.sh +cd %{_builddir}/buildtools -bash buildtools/install/common/build-frontend.sh --srcpath %{_builddir}/%{sourcename} -bash buildtools/install/common/build-backend.sh --srcpath %{_builddir}/%{sourcename} -bash buildtools/install/common/publish-backend.sh --srcpath %{_builddir}/%{sourcename} -rename -f -v "s/product([^\/]*)$/%{product}\$1/g" buildtools/install/common/* -sed -i "s/{{product}}/%{product}/g" %{_builddir}/%{sourcename}/buildtools/install/common/logrotate/product-common +bash install/common/systemd/build.sh -rm -f %{_builddir}/%{sourcename}/config/nginx/onlyoffice-login.conf +bash install/common/build-frontend.sh --srcpath %{_builddir}/client +bash install/common/build-backend.sh --srcpath %{_builddir}/server +bash install/common/publish-backend.sh --srcpath %{_builddir}/server + +rename -f -v "s/product([^\/]*)$/%{product}\$1/g" install/common/* +sed -i "s/{{product}}/%{product}/g" install/common/logrotate/product-common + +rm -f config/nginx/onlyoffice-login.conf +find config/ -type f -regex '.*\.\(test\|dev\).*' -delete if ! grep -q 'var/www/%{product}' config/nginx/*.conf; then find config/nginx/ -name "*.conf" -exec sed -i "s@\(var/www/\)@\1%{product}/@" {} +; fi -json -I -f %{_builddir}/%{sourcename}/config/appsettings.services.json -e "this.logPath=\"/var/log/onlyoffice/%{product}\"" -e "this.socket={ 'path': '../ASC.Socket.IO/' }" \ +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/apisystem.json -e "this.core.notify.postman=\"services\"" +json -I -f %{_builddir}/publish/web/public/scripts/config.json -e "this.wrongPortalNameUrl=\"\"" -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\"" -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 +sed 's_\(minlevel=\)"[^"]*"_\1"Warn"_g' -i config/nlog.config +sed 's/teamlab.info/onlyoffice.com/g' -i config/autofac.consumers.json -sed 's_etc/nginx_etc/openresty_g' -i %{_builddir}/%{sourcename}/config/nginx/*.conf -sed 's/teamlab.info/onlyoffice.com/g' -i %{_builddir}/%{sourcename}/config/autofac.consumers.json -json -I -f %{_builddir}/%{sourcename}/client/public/scripts/config.json -e "this.wrongPortalNameUrl=\"\"" -sed -e 's/$router_host/127.0.0.1/g' -e 's/the_host/host/g' -e 's/the_scheme/scheme/g' -e 's_includes_/etc/openresty/includes_g' -i %{_builddir}/%{sourcename}/buildtools/install/docker/config/nginx/onlyoffice-proxy*.conf -sed -e '/.pid/d' -e '/temp_path/d' -e 's_etc/nginx_etc/openresty_g' -i %{_builddir}/%{sourcename}/buildtools/install/docker/config/nginx/templates/nginx.conf.template -sed -i "s_\(.*root\).*;_\1 \"/var/www/%{product}\";_g" -i %{_builddir}/%{sourcename}/buildtools/install/docker/config/nginx/letsencrypt.conf +sed 's_etc/nginx_etc/openresty_g' -i config/nginx/*.conf +sed -e 's/$router_host/127.0.0.1/g' -e 's/the_host/host/g' -e 's/the_scheme/scheme/g' -e 's_includes_/etc/openresty/includes_g' -i install/docker/config/nginx/onlyoffice-proxy*.conf +sed -e '/.pid/d' -e '/temp_path/d' -e 's_etc/nginx_etc/openresty_g' -i install/docker/config/nginx/templates/nginx.conf.template +sed -i "s_\(.*root\).*;_\1 \"/var/www/%{product}\";_g" -i install/docker/config/nginx/letsencrypt.conf -find %{_builddir}/%{sourcename}/publish/ \ - %{_builddir}/%{sourcename}/ASC.Migration.Runner \ +find %{_builddir}/server/publish/ \ + %{_builddir}/server/ASC.Migration.Runner \ -depth -type f -regex '.*\(dll\|dylib\|so\)$' -exec chmod 755 {} \; -find %{_builddir}/%{sourcename}/publish/ \ - %{_builddir}/%{sourcename}/ASC.Migration.Runner \ +find %{_builddir}/server/publish/ \ + %{_builddir}/server/ASC.Migration.Runner \ -depth -type f -regex '.*\(so\)$' -exec strip {} \; diff --git a/install/rpm/SPECS/install.spec b/install/rpm/SPECS/install.spec index 129d6b71a4..29304fbcc1 100644 --- a/install/rpm/SPECS/install.spec +++ b/install/rpm/SPECS/install.spec @@ -1,68 +1,67 @@ %install -rm -rf %{buildroot} -mkdir -p "%{buildroot}%{_bindir}/" -mkdir -p "%{buildroot}%{_docdir}/%{name}-%{version}-%{release}/" -mkdir -p "%{buildroot}%{_sysconfdir}/logrotate.d" -mkdir -p "%{buildroot}%{_sysconfdir}/openresty/conf.d/" -mkdir -p "%{buildroot}%{_sysconfdir}/openresty/includes/" -mkdir -p "%{buildroot}%{_sysconfdir}/onlyoffice/%{product}/.private/" -mkdir -p "%{buildroot}%{_sysconfdir}/onlyoffice/%{product}/openresty" -mkdir -p "%{buildroot}%{_var}/log/onlyoffice/%{product}/" -mkdir -p "%{buildroot}%{buildpath}/Tools/radicale/plugins/" -mkdir -p "%{buildroot}%{buildpath}/products/ASC.Files/client/" -mkdir -p "%{buildroot}%{buildpath}/products/ASC.Files/editor/" -mkdir -p "%{buildroot}%{buildpath}/products/ASC.Files/server/DocStore/" -mkdir -p "%{buildroot}%{buildpath}/products/ASC.Files/service/" -mkdir -p "%{buildroot}%{buildpath}/products/ASC.People/client/" -mkdir -p "%{buildroot}%{buildpath}/products/ASC.People/server/" -mkdir -p "%{buildroot}%{buildpath}/services/ASC.ApiSystem/" -mkdir -p "%{buildroot}%{buildpath}/services/ASC.ClearEvents/" -mkdir -p "%{buildroot}%{buildpath}/services/ASC.Data.Backup.BackgroundTasks/" -mkdir -p "%{buildroot}%{buildpath}/services/ASC.Data.Backup/" -mkdir -p "%{buildroot}%{buildpath}/services/ASC.Migration.Runner/" -mkdir -p "%{buildroot}%{buildpath}/services/ASC.Notify/" -mkdir -p "%{buildroot}%{buildpath}/services/ASC.Socket.IO/" -mkdir -p "%{buildroot}%{buildpath}/services/ASC.SsoAuth/" -mkdir -p "%{buildroot}%{buildpath}/services/ASC.Studio.Notify/" -mkdir -p "%{buildroot}%{buildpath}/services/ASC.Web.HealthChecks.UI/" -mkdir -p "%{buildroot}%{buildpath}/studio/ASC.Web.Api/" -mkdir -p "%{buildroot}%{buildpath}/studio/ASC.Web.Studio/" -mkdir -p "%{buildroot}%{buildpath}/public/" -mkdir -p "%{buildroot}%{buildpath}/client/" -mkdir -p "%{buildroot}%{buildpath}/products/ASC.Login/login/" +rm -rf %{buildroot} mkdir -p "%{buildroot}/usr/lib/systemd/system/" mkdir -p "%{buildroot}/%{_var}/www/onlyoffice/Data" -cp -rf %{_builddir}/%{sourcename}/LICENSE "%{buildroot}%{_docdir}/%{name}-%{version}-%{release}/" -cp -rf %{_builddir}/%{sourcename}/README.md "%{buildroot}%{_docdir}/%{name}-%{version}-%{release}/" -cp -rf %{_builddir}/%{sourcename}/ASC.Migration.Runner/service/* "%{buildroot}%{buildpath}/services/ASC.Migration.Runner/" -cp -rf %{_builddir}/%{sourcename}/buildtools/deploy/editor/* "%{buildroot}%{buildpath}/products/ASC.Files/editor/" -cp -rf %{_builddir}/%{sourcename}/buildtools/deploy/public/* "%{buildroot}%{buildpath}/public/" -cp -rf %{_builddir}/%{sourcename}/buildtools/deploy/client/* "%{buildroot}%{buildpath}/client/" -cp -rf %{_builddir}/%{sourcename}/buildtools/deploy/login/* "%{buildroot}%{buildpath}/products/ASC.Login/login/" -cp -rf %{_builddir}/%{sourcename}/buildtools/install/RadicalePlugins/* "%{buildroot}%{buildpath}/Tools/radicale/plugins/" -cp -rf %{_builddir}/%{sourcename}/buildtools/install/common/%{product}-configuration "%{buildroot}%{_bindir}/%{product}-configuration" -cp -rf %{_builddir}/%{sourcename}/buildtools/install/common/systemd/modules/* "%{buildroot}/usr/lib/systemd/system/" -cp -rf %{_builddir}/%{sourcename}/buildtools/install/common/logrotate/product-common "%{buildroot}%{_sysconfdir}/logrotate.d/%{product}-common" -cp -rf %{_builddir}/%{sourcename}/config/* "%{buildroot}%{_sysconfdir}/onlyoffice/%{product}/" -cp -rf %{_builddir}/%{sourcename}/config/nginx/includes/onlyoffice*.conf "%{buildroot}%{_sysconfdir}/openresty/includes/" -cp -rf %{_builddir}/%{sourcename}/config/nginx/onlyoffice*.conf "%{buildroot}%{_sysconfdir}/openresty/conf.d/" -cp -rf %{_builddir}/%{sourcename}/products/ASC.Files/Server/DocStore/* "%{buildroot}%{buildpath}/products/ASC.Files/server/DocStore/" -cp -rf %{_builddir}/%{sourcename}/publish/products/ASC.Files/server/* "%{buildroot}%{buildpath}/products/ASC.Files/server/" -cp -rf %{_builddir}/%{sourcename}/publish/products/ASC.People/server/* "%{buildroot}%{buildpath}/products/ASC.People/server/" -cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.ApiSystem/service/* "%{buildroot}%{buildpath}/services/ASC.ApiSystem/" -cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.ClearEvents/service/* "%{buildroot}%{buildpath}/services/ASC.ClearEvents/" -cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Data.Backup.BackgroundTasks/service/* "%{buildroot}%{buildpath}/services/ASC.Data.Backup.BackgroundTasks/" -cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Data.Backup/service/* "%{buildroot}%{buildpath}/services/ASC.Data.Backup/" -cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Files.Service/service/* "%{buildroot}%{buildpath}/products/ASC.Files/service/" -cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Notify/service/* "%{buildroot}%{buildpath}/services/ASC.Notify/" -cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Socket.IO/service/* "%{buildroot}%{buildpath}/services/ASC.Socket.IO/" -cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.SsoAuth/service/* "%{buildroot}%{buildpath}/services/ASC.SsoAuth/" -cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Studio.Notify/service/* "%{buildroot}%{buildpath}/services/ASC.Studio.Notify/" -cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Web.Api/service/* "%{buildroot}%{buildpath}/studio/ASC.Web.Api/" -cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Web.HealthChecks.UI/service/* "%{buildroot}%{buildpath}/services/ASC.Web.HealthChecks.UI/" -cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Web.Studio/service/* "%{buildroot}%{buildpath}/studio/ASC.Web.Studio/" -cp -rf %{_builddir}/%{sourcename}/buildtools/install/docker/config/nginx/onlyoffice-proxy.conf "%{buildroot}%{_sysconfdir}/openresty/conf.d/onlyoffice-proxy.conf" -cp -rf %{_builddir}/%{sourcename}/buildtools/install/docker/config/nginx/onlyoffice-proxy-ssl.conf "%{buildroot}%{_sysconfdir}/openresty/conf.d/onlyoffice-proxy-ssl.conf.template" -cp -rf %{_builddir}/%{sourcename}/buildtools/install/docker/config/nginx/letsencrypt.conf "%{buildroot}%{_sysconfdir}/openresty/includes/letsencrypt.conf" -cp -rf %{_builddir}/%{sourcename}/buildtools/install/docker/config/nginx/templates/nginx.conf.template "%{buildroot}%{_sysconfdir}/onlyoffice/%{product}/openresty/nginx.conf.template" -cp -rf %{_builddir}/%{sourcename}/buildtools/install/common/%{product}-ssl-setup "%{buildroot}%{_bindir}/%{product}-ssl-setup" +mkdir -p "%{buildroot}%{buildpath}/Tools/radicale/plugins/" +mkdir -p "%{buildroot}%{buildpath}/studio/ASC.Web.Studio/" +mkdir -p "%{buildroot}%{buildpath}/studio/ASC.Web.Api/" +mkdir -p "%{buildroot}%{buildpath}/services/ASC.Web.HealthChecks.UI/" +mkdir -p "%{buildroot}%{buildpath}/services/ASC.Studio.Notify/" +mkdir -p "%{buildroot}%{buildpath}/services/ASC.SsoAuth/" +mkdir -p "%{buildroot}%{buildpath}/services/ASC.Socket.IO/" +mkdir -p "%{buildroot}%{buildpath}/services/ASC.Notify/" +mkdir -p "%{buildroot}%{buildpath}/services/ASC.Migration.Runner/" +mkdir -p "%{buildroot}%{buildpath}/services/ASC.Data.Backup/" +mkdir -p "%{buildroot}%{buildpath}/services/ASC.Data.Backup.BackgroundTasks/" +mkdir -p "%{buildroot}%{buildpath}/services/ASC.ClearEvents/" +mkdir -p "%{buildroot}%{buildpath}/services/ASC.ApiSystem/" +mkdir -p "%{buildroot}%{buildpath}/public/" +mkdir -p "%{buildroot}%{buildpath}/products/ASC.People/server/" +mkdir -p "%{buildroot}%{buildpath}/products/ASC.People/client/" +mkdir -p "%{buildroot}%{buildpath}/products/ASC.Login/login/" +mkdir -p "%{buildroot}%{buildpath}/products/ASC.Files/service/" +mkdir -p "%{buildroot}%{buildpath}/products/ASC.Files/server/DocStore/" +mkdir -p "%{buildroot}%{buildpath}/products/ASC.Files/editor/" +mkdir -p "%{buildroot}%{buildpath}/products/ASC.Files/client/" +mkdir -p "%{buildroot}%{buildpath}/client/" +mkdir -p "%{buildroot}%{_var}/log/onlyoffice/%{product}/" +mkdir -p "%{buildroot}%{_sysconfdir}/openresty/includes/" +mkdir -p "%{buildroot}%{_sysconfdir}/openresty/conf.d/" +mkdir -p "%{buildroot}%{_sysconfdir}/onlyoffice/%{product}/openresty" +mkdir -p "%{buildroot}%{_sysconfdir}/onlyoffice/%{product}/.private/" +mkdir -p "%{buildroot}%{_sysconfdir}/logrotate.d" +mkdir -p "%{buildroot}%{_docdir}/%{name}-%{version}-%{release}/" +mkdir -p "%{buildroot}%{_bindir}/" +cp -rf %{_builddir}/publish/web/public/* "%{buildroot}%{buildpath}/public/" +cp -rf %{_builddir}/publish/web/login/* "%{buildroot}%{buildpath}/products/ASC.Login/login/" +cp -rf %{_builddir}/publish/web/editor/* "%{buildroot}%{buildpath}/products/ASC.Files/editor/" +cp -rf %{_builddir}/publish/web/client/* "%{buildroot}%{buildpath}/client/" +cp -rf %{_builddir}/server/publish/services/ASC.Web.Studio/service/* "%{buildroot}%{buildpath}/studio/ASC.Web.Studio/" +cp -rf %{_builddir}/server/publish/services/ASC.Web.HealthChecks.UI/service/* "%{buildroot}%{buildpath}/services/ASC.Web.HealthChecks.UI/" +cp -rf %{_builddir}/server/publish/services/ASC.Web.Api/service/* "%{buildroot}%{buildpath}/studio/ASC.Web.Api/" +cp -rf %{_builddir}/server/publish/services/ASC.Studio.Notify/service/* "%{buildroot}%{buildpath}/services/ASC.Studio.Notify/" +cp -rf %{_builddir}/server/publish/services/ASC.SsoAuth/service/* "%{buildroot}%{buildpath}/services/ASC.SsoAuth/" +cp -rf %{_builddir}/server/publish/services/ASC.Socket.IO/service/* "%{buildroot}%{buildpath}/services/ASC.Socket.IO/" +cp -rf %{_builddir}/server/publish/services/ASC.Notify/service/* "%{buildroot}%{buildpath}/services/ASC.Notify/" +cp -rf %{_builddir}/server/publish/services/ASC.Files.Service/service/* "%{buildroot}%{buildpath}/products/ASC.Files/service/" +cp -rf %{_builddir}/server/publish/services/ASC.Data.Backup/service/* "%{buildroot}%{buildpath}/services/ASC.Data.Backup/" +cp -rf %{_builddir}/server/publish/services/ASC.Data.Backup.BackgroundTasks/service/* "%{buildroot}%{buildpath}/services/ASC.Data.Backup.BackgroundTasks/" +cp -rf %{_builddir}/server/publish/services/ASC.ClearEvents/service/* "%{buildroot}%{buildpath}/services/ASC.ClearEvents/" +cp -rf %{_builddir}/server/publish/services/ASC.ApiSystem/service/* "%{buildroot}%{buildpath}/services/ASC.ApiSystem/" +cp -rf %{_builddir}/server/publish/products/ASC.People/server/* "%{buildroot}%{buildpath}/products/ASC.People/server/" +cp -rf %{_builddir}/server/publish/products/ASC.Files/server/* "%{buildroot}%{buildpath}/products/ASC.Files/server/" +cp -rf %{_builddir}/server/LICENSE "%{buildroot}%{_docdir}/%{name}-%{version}-%{release}/" +cp -rf %{_builddir}/server/ASC.Migration.Runner/service/* "%{buildroot}%{buildpath}/services/ASC.Migration.Runner/" +cp -rf %{_builddir}/document-templates-main-community-server/* "%{buildroot}%{buildpath}/products/ASC.Files/server/DocStore/" +cp -rf %{_builddir}/buildtools/install/RadicalePlugins/* "%{buildroot}%{buildpath}/Tools/radicale/plugins/" +cp -rf %{_builddir}/buildtools/install/docker/config/nginx/templates/nginx.conf.template "%{buildroot}%{_sysconfdir}/onlyoffice/%{product}/openresty/nginx.conf.template" +cp -rf %{_builddir}/buildtools/install/docker/config/nginx/onlyoffice-proxy.conf "%{buildroot}%{_sysconfdir}/openresty/conf.d/onlyoffice-proxy.conf" +cp -rf %{_builddir}/buildtools/install/docker/config/nginx/onlyoffice-proxy-ssl.conf "%{buildroot}%{_sysconfdir}/openresty/conf.d/onlyoffice-proxy-ssl.conf.template" +cp -rf %{_builddir}/buildtools/install/docker/config/nginx/letsencrypt.conf "%{buildroot}%{_sysconfdir}/openresty/includes/letsencrypt.conf" +cp -rf %{_builddir}/buildtools/install/common/systemd/modules/* "%{buildroot}/usr/lib/systemd/system/" +cp -rf %{_builddir}/buildtools/install/common/logrotate/product-common "%{buildroot}%{_sysconfdir}/logrotate.d/%{product}-common" +cp -rf %{_builddir}/buildtools/install/common/%{product}-ssl-setup "%{buildroot}%{_bindir}/%{product}-ssl-setup" +cp -rf %{_builddir}/buildtools/install/common/%{product}-configuration "%{buildroot}%{_bindir}/%{product}-configuration" +cp -rf %{_builddir}/buildtools/config/nginx/onlyoffice*.conf "%{buildroot}%{_sysconfdir}/openresty/conf.d/" +cp -rf %{_builddir}/buildtools/config/nginx/includes/onlyoffice*.conf "%{buildroot}%{_sysconfdir}/openresty/includes/" +cp -rf %{_builddir}/buildtools/config/* "%{buildroot}%{_sysconfdir}/onlyoffice/%{product}/" diff --git a/install/rpm/SPECS/product.spec b/install/rpm/SPECS/product.spec index d5b695f871..c9c3d28624 100644 --- a/install/rpm/SPECS/product.spec +++ b/install/rpm/SPECS/product.spec @@ -1,9 +1,10 @@ %define _binaries_in_noarch_packages_terminate_build 0 %define _build_id_links none +%define __os_install_post /usr/lib/rpm/brp-compress %{nil} %global product docspace +%global product_name DocSpace %global buildpath %{_var}/www/%{product} -%global sourcename DocSpace-%GIT_BRANCH Name: %{product} Summary: Business productivity tools @@ -19,10 +20,12 @@ Vendor: Ascensio System SIA Packager: %{packager} License: AGPLv3 -Source0: https://github.com/ONLYOFFICE/%{product}/archive/%GIT_BRANCH.tar.gz#/%{sourcename}.tar.gz -Source1: https://github.com/ONLYOFFICE/document-templates/archive/main/community-server.tar.gz#/document-templates-main-community-server.tar.gz -Source2: https://github.com/ONLYOFFICE/dictionaries/archive/master.tar.gz#/dictionaries-master.tar.gz -Source3: %{product}.rpmlintrc +Source0: https://github.com/ONLYOFFICE/%{product}-buildtools/archive/%{BRANCH_BUILDTOOLS}.tar.gz#/%{product_name}-buildtools-%{BRANCH_BUILDTOOLS}.tar.gz +Source1: https://github.com/ONLYOFFICE/%{product}-client/archive/%{BRANCH_CLIENT}.tar.gz#/%{product_name}-client-%{BRANCH_CLIENT}.tar.gz +Source2: https://github.com/ONLYOFFICE/%{product}-server/archive/%{BRANCH_SERVER}.tar.gz#/%{product_name}-server-%{BRANCH_SERVER}.tar.gz +Source3: https://github.com/ONLYOFFICE/document-templates/archive/main/community-server.tar.gz#/document-templates-main-community-server.tar.gz +Source4: https://github.com/ONLYOFFICE/dictionaries/archive/master.tar.gz#/dictionaries-master.tar.gz +Source5: %{product}.rpmlintrc BuildRequires: nodejs >= 18.0 BuildRequires: yarn @@ -58,11 +61,15 @@ predefined permissions. %include package.spec %prep +rm -rf %{_rpmdir}/%{_arch}/%{name}-* %{_builddir}/* -rm -rf %{_rpmdir}/%{_arch}/%{name}-* -%setup -b1 -b2 -n %{sourcename} -q -mv -f %{_builddir}/document-templates-main-community-server/* %{_builddir}/%{sourcename}/products/ASC.Files/Server/DocStore/ -mv -f %{_builddir}/dictionaries-master/* %{_builddir}/%{sourcename}/common/Tests/Frontend.Translations.Tests/dictionaries/ +echo "%{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4}" | xargs -n 1 -P 5 tar -xzf +cp %{SOURCE5} . + +mv -f %{product_name}-buildtools-%{BRANCH_BUILDTOOLS} buildtools +mv -f %{product_name}-client-%{BRANCH_CLIENT} client +mv -f %{product_name}-server-%{BRANCH_SERVER} server +mv -f %{_builddir}/dictionaries-master/* %{_builddir}/client/common/Tests/Frontend.Translations.Tests/dictionaries/ %include build.spec From d7322464afe11c08b235ed174a2690c287b705e7 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Tue, 10 Oct 2023 20:16:28 +0500 Subject: [PATCH 08/16] Correct the paths for downloading OCI scripts (#11) --- install/OneClickInstall/docspace-install.sh | 2 +- install/OneClickInstall/install-Debian.sh | 2 +- install/OneClickInstall/install-Docker.sh | 2 +- install/OneClickInstall/install-RedHat.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install/OneClickInstall/docspace-install.sh b/install/OneClickInstall/docspace-install.sh index 6e653d62af..b95ca368e6 100644 --- a/install/OneClickInstall/docspace-install.sh +++ b/install/OneClickInstall/docspace-install.sh @@ -142,7 +142,7 @@ fi if [ -z $GIT_BRANCH ]; then DOWNLOAD_URL_PREFIX="https://download.onlyoffice.com/${product}" else - DOWNLOAD_URL_PREFIX="https://raw.githubusercontent.com/ONLYOFFICE/${product}/${GIT_BRANCH}/buildtools/install/OneClickInstall" + DOWNLOAD_URL_PREFIX="https://raw.githubusercontent.com/ONLYOFFICE/${product}-buildtools/${GIT_BRANCH}/install/OneClickInstall" fi if [ "$DOCKER" == "true" ]; then diff --git a/install/OneClickInstall/install-Debian.sh b/install/OneClickInstall/install-Debian.sh index 0cd3824bcd..8dd90ca46f 100644 --- a/install/OneClickInstall/install-Debian.sh +++ b/install/OneClickInstall/install-Debian.sh @@ -121,7 +121,7 @@ fi if [ -z $GIT_BRANCH ]; then DOWNLOAD_URL_PREFIX="https://download.onlyoffice.com/${product}/install-Debian" else - DOWNLOAD_URL_PREFIX="https://raw.githubusercontent.com/ONLYOFFICE/${product}/${GIT_BRANCH}/buildtools/install/OneClickInstall/install-Debian" + DOWNLOAD_URL_PREFIX="https://raw.githubusercontent.com/ONLYOFFICE/${product}-buildtools/${GIT_BRANCH}/install/OneClickInstall/install-Debian" fi if [ "${LOCAL_SCRIPTS}" == "true" ]; then diff --git a/install/OneClickInstall/install-Docker.sh b/install/OneClickInstall/install-Docker.sh index 301ee51da5..519d082620 100644 --- a/install/OneClickInstall/install-Docker.sh +++ b/install/OneClickInstall/install-Docker.sh @@ -1172,7 +1172,7 @@ download_files () { if ! command_exists svn; then install_service svn subversion fi - svn export --force https://github.com/${PACKAGE_SYSNAME}/${PRODUCT}/branches/${GIT_BRANCH}/buildtools/install/docker/ ${BASE_DIR} >/dev/null + svn export --force https://github.com/${PACKAGE_SYSNAME}/${PRODUCT}-buildtools/branches/${GIT_BRANCH}/install/docker/ ${BASE_DIR} >/dev/null fi echo "OK" diff --git a/install/OneClickInstall/install-RedHat.sh b/install/OneClickInstall/install-RedHat.sh index 068210756e..3ee10a2c19 100644 --- a/install/OneClickInstall/install-RedHat.sh +++ b/install/OneClickInstall/install-RedHat.sh @@ -134,7 +134,7 @@ END if [ -z $GIT_BRANCH ]; then DOWNLOAD_URL_PREFIX="https://download.onlyoffice.com/${product}/install-RedHat" else - DOWNLOAD_URL_PREFIX="https://raw.githubusercontent.com/ONLYOFFICE/${product}/${GIT_BRANCH}/buildtools/install/OneClickInstall/install-RedHat" + DOWNLOAD_URL_PREFIX="https://raw.githubusercontent.com/ONLYOFFICE/${product}-buildtools/${GIT_BRANCH}/install/OneClickInstall/install-RedHat" fi if [ "$LOCAL_SCRIPTS" = "true" ]; then From 6f64729531029786c74a3aab595ccde92d948450 Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Tue, 10 Oct 2023 20:18:22 +0500 Subject: [PATCH 09/16] Fix the use of the default openresty config (#13) --- install/docker/Dockerfile.app | 3 ++- install/docker/Dockerfile.runtime | 3 ++- install/docker/prepare-nginx-router.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/install/docker/Dockerfile.app b/install/docker/Dockerfile.app index 4b422ff738..0a2869c6e4 100644 --- a/install/docker/Dockerfile.app +++ b/install/docker/Dockerfile.app @@ -169,7 +169,8 @@ RUN sed -i 's/127.0.0.1:5010/$service_api_system/' /etc/nginx/conf.d/onlyoffice. sed -i 's/$public_root/\/var\/www\/public\//' /etc/nginx/conf.d/onlyoffice.conf && \ sed -i 's/http:\/\/172.*/$document_server;/' /etc/nginx/conf.d/onlyoffice.conf && \ sed -i '/client_body_temp_path/ i \ \ \ \ $MAP_HASH_BUCKET_SIZE' /etc/nginx/nginx.conf.template && \ - sed -i 's/\(worker_connections\).*;/\1 $COUNT_WORKER_CONNECTIONS;/' /etc/nginx/nginx.conf.template + sed -i 's/\(worker_connections\).*;/\1 $COUNT_WORKER_CONNECTIONS;/' /etc/nginx/nginx.conf.template && \ + sed -i -e '/^user/s/^/#/' -e 's#/tmp/nginx.pid#nginx.pid#' -e 's#/etc/nginx/mime.types#mime.types#' /etc/nginx/nginx.conf.template ENTRYPOINT [ "/docker-entrypoint.sh" ] diff --git a/install/docker/Dockerfile.runtime b/install/docker/Dockerfile.runtime index c59ed5ed97..602f77e232 100644 --- a/install/docker/Dockerfile.runtime +++ b/install/docker/Dockerfile.runtime @@ -126,7 +126,8 @@ RUN chown onlyoffice:onlyoffice /etc/nginx/* -R && \ sed -i 's/http:\/\/172.*/$document_server;/' /etc/nginx/conf.d/onlyoffice.conf && \ sed -i 's/local redis_host = "127.0.0.1"/local redis_host = "onlyoffice-redis"/' /etc/nginx/conf.d/onlyoffice.conf && \ sed -i '/client_body_temp_path/ i \ \ \ \ $MAP_HASH_BUCKET_SIZE' /etc/nginx/nginx.conf.template && \ - sed -i 's/\(worker_connections\).*;/\1 $COUNT_WORKER_CONNECTIONS;/' /etc/nginx/nginx.conf.template + sed -i 's/\(worker_connections\).*;/\1 $COUNT_WORKER_CONNECTIONS;/' /etc/nginx/nginx.conf.template && \ + sed -i -e '/^user/s/^/#/' -e 's#/tmp/nginx.pid#nginx.pid#' -e 's#/etc/nginx/mime.types#mime.types#' /etc/nginx/nginx.conf.template ENTRYPOINT [ "/docker-entrypoint.sh" ] diff --git a/install/docker/prepare-nginx-router.sh b/install/docker/prepare-nginx-router.sh index b99e41221e..496a1d26da 100755 --- a/install/docker/prepare-nginx-router.sh +++ b/install/docker/prepare-nginx-router.sh @@ -4,7 +4,7 @@ REDIS_HOST=${REDIS_HOST:-"${REDIS_CONTAINER_NAME}"} REDIS_PORT=${REDIS_PORT:-"6379"} REDIS_PASSWORD=${REDIS_PASSWORD:-""} -envsubst '$MAP_HASH_BUCKET_SIZE,$COUNT_WORKER_CONNECTIONS' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf +envsubst '$MAP_HASH_BUCKET_SIZE,$COUNT_WORKER_CONNECTIONS' < /etc/nginx/nginx.conf.template > /usr/local/openresty/nginx/conf/nginx.conf sed -i "s~\(redis_host =\).*~\1 \"$REDIS_HOST\"~" /etc/nginx/conf.d/onlyoffice.conf sed -i "s~\(redis_port =\).*~\1 $REDIS_PORT~" /etc/nginx/conf.d/onlyoffice.conf sed -i "s~\(redis_pass =\).*~\1 \"$REDIS_PASSWORD\"~" /etc/nginx/conf.d/onlyoffice.conf From 28dffc0d8e20c5b9f5e6d2422a62bbdf84082f5f Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Wed, 11 Oct 2023 18:26:30 +0400 Subject: [PATCH 10/16] Added env MIGRATION_TYPE --- install/docker/.env | 1 + install/docker/docspace.profiles.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/install/docker/.env b/install/docker/.env index 0de6ebbefc..d3c9eaabdf 100644 --- a/install/docker/.env +++ b/install/docker/.env @@ -84,6 +84,7 @@ MYSQL_USER=${PRODUCT}_user MYSQL_PASSWORD=${PRODUCT}_pass DATABASE_MIGRATION=false + MIGRATION_TYPE="SAAS" # service host # API_SYSTEM_HOST=${CONTAINER_PREFIX}api-system diff --git a/install/docker/docspace.profiles.yml b/install/docker/docspace.profiles.yml index 067c2bda41..a486a26520 100644 --- a/install/docker/docspace.profiles.yml +++ b/install/docker/docspace.profiles.yml @@ -292,6 +292,7 @@ services: MYSQL_DATABASE: ${MYSQL_DATABASE} MYSQL_USER: ${MYSQL_USER} MYSQL_PASSWORD: ${MYSQL_PASSWORD} + MIGRATION_TYPE: ${MIGRATION_TYPE} networks: default: From 1ef3c6fc6a400624823ec288dbee102d75a85853 Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Wed, 11 Oct 2023 18:27:21 +0400 Subject: [PATCH 11/16] Added help (-h) and changed params --- build.backend.docker.sh | 125 ++++++++++++++++++++++++++++++---------- 1 file changed, 96 insertions(+), 29 deletions(-) diff --git a/build.backend.docker.sh b/build.backend.docker.sh index dbaa3eb38a..9960bee368 100755 --- a/build.backend.docker.sh +++ b/build.backend.docker.sh @@ -1,35 +1,97 @@ #!/bin/bash -rd="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -echo "Run script directory:" $dir +############################################################ +# Help # +############################################################ +Help() +{ + # Display Help + echo "Build and run backend and working environment. (Use 'yarn start' to run client -> https://github.com/ONLYOFFICE/DocSpace-client)" + echo + echo "Syntax: available params [-h|f|i|c|d|]" + echo "options:" + echo "h Print this Help." + echo "f Force rebuild base images." + echo "s Run as SAAS otherwise as STANDALONE." + echo "c Run as COMMUNITY otherwise ENTERPRISE." + echo "d Run dnsmasq." + echo +} +rd="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" dir=$(builtin cd $rd/../; pwd) dockerDir="$dir/buildtools/install/docker" - -echo "Root directory:" $dir -echo "Docker files root directory:" $dockerDir - local_ip=$(ipconfig getifaddr en0) -echo "LOCAL IP: $local_ip" - doceditor=${local_ip}:5013 login=${local_ip}:5011 client=${local_ip}:5001 portal_url="http://$local_ip" +force=false +dns=false +standalone=true +community=false + +migration_type="STANDALONE" # SAAS +installation_type=ENTERPRISE +document_server_image_name=onlyoffice/documentserver-de:latest + +# Get the options +while getopts "h:f:s:c:d:" opt; do + echo "argument -${opt} called with parameter $OPTARG" >&2 + case $opt in + h) # Display this Help + Help + exit + ;; + f) # Force rebuild base images + force=${OPTARG:-true} + ;; + s) # Run as STANDALONE (otherwise SAAS) + standalone=${OPTARG:-true} + ;; + c) # Run as COMMUNITY (otherwise ENTERPRISE) + community=${OPTARG:-true} + ;; + d) # Run dnsmasq + dns=${OPTARG:-true} + ;; + \?) # Invalid option + echo "Error: Invalid '-$OPTARG' option" + exit + ;; + esac +done + +echo "Run script directory:" $dir +echo "Root directory:" $dir +echo "Docker files root directory:" $dockerDir + +echo echo "SERVICE_DOCEDITOR: $doceditor" echo "SERVICE_LOGIN: $login" echo "SERVICE_CLIENT: $client" -echo "APP_URL_PORTAL: $portal_url" +echo "DOCSPACE_APP_URL: $portal_url" -force=false +echo +echo "FORCE REBUILD BASE IMAGES: $force" +echo "Run dnsmasq: $dns" -if [ "$1" = "--force" ]; then - force=true +if [ "$standalone" = false ]; then + migration_type="SAAS" fi -echo "FORCE BUILD BASE IMAGES: $force" +if [ "$community" = true ]; then + installation_type="COMMUNITY" + document_server_image_name=onlyoffice/documentserver:latest +fi + +echo +echo "MIGRATION TYPE: $migration_type" +echo "INSTALLATION TYPE: $installation_type" +echo "DS image: $document_server_image_name" +echo # Stop all backend services" $dir/buildtools/start/stop.backend.docker.sh @@ -56,7 +118,7 @@ else exit 1 fi -if [ "$1" = "--dns" ]; then +if [ "$dns" = true ]; then echo "Run local dns server" ROOT_DIR=$dir \ docker compose -f $dockerDir/dnsmasq.yml up -d @@ -68,15 +130,6 @@ rm -rf $dir/publish/services echo "Build backend services (to "publish/" folder)" bash $dir/buildtools/install/common/build-services.sh -pb backend-publish -pc Debug -de "$dockerDir/docker-entrypoint.py" -DOCUMENT_SERVER_IMAGE_NAME=onlyoffice/documentserver-de:latest -INSTALLATION_TYPE=ENTERPRISE - -if [ "$1" = "--community" ]; then - DOCUMENT_SERVER_IMAGE_NAME=onlyoffice/documentserver:latest - INSTALLATION_TYPE=COMMUNITY -fi - -echo "Run migration and services INSTALLATION_TYPE=$INSTALLATION_TYPE" dotnet_version=dev exists=$(docker images | egrep "onlyoffice/4testing-docspace-dotnet-runtime" | egrep "$dotnet_version" | awk 'NR>0 {print $1 ":" $2}') @@ -112,11 +165,11 @@ fi echo "Run migration and services" ENV_EXTENSION="dev" \ -INSTALLATION_TYPE=$INSTALLATION_TYPE \ +INSTALLATION_TYPE=$installation_type \ Baseimage_Dotnet_Run="onlyoffice/4testing-docspace-dotnet-runtime:$dotnet_version" \ Baseimage_Nodejs_Run="onlyoffice/4testing-docspace-nodejs-runtime:$node_version" \ Baseimage_Proxy_Run="onlyoffice/4testing-docspace-proxy-runtime:$proxy_version" \ -DOCUMENT_SERVER_IMAGE_NAME=$DOCUMENT_SERVER_IMAGE_NAME \ +DOCUMENT_SERVER_IMAGE_NAME=$document_server_image_name \ SERVICE_DOCEDITOR=$doceditor \ SERVICE_LOGIN=$login \ SERVICE_CLIENT=$client \ @@ -125,12 +178,26 @@ BUILD_PATH="/var/www" \ SRC_PATH="$dir/publish/services" \ DATA_DIR="$dir/data" \ APP_URL_PORTAL=$portal_url \ +MIGRATION_TYPE=$migration_type \ docker-compose -f $dockerDir/docspace.profiles.yml -f $dockerDir/docspace.overcome.yml --profile migration-runner --profile backend-local up -d -echo "" -echo "APP_URL_PORTAL: $portal_url" -echo "LOCAL IP: $local_ip" +echo +echo "Run script directory:" $dir +echo "Root directory:" $dir +echo "Docker files root directory:" $dockerDir + +echo echo "SERVICE_DOCEDITOR: $doceditor" echo "SERVICE_LOGIN: $login" echo "SERVICE_CLIENT: $client" -echo "INSTALLATION_TYPE=$INSTALLATION_TYPE" +echo "DOCSPACE_APP_URL: $portal_url" + +echo +echo "FORCE REBUILD BASE IMAGES: $force" +echo "Run dnsmasq: $dns" + +echo +echo "MIGRATION TYPE: $migration_type" +echo "INSTALLATION TYPE: $installation_type" +echo "DS image: $document_server_image_name" +echo From d2ee9f8a9fe781a00e7f7760c1b7705d332f15be Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Thu, 12 Oct 2023 13:56:16 +0300 Subject: [PATCH 12/16] Fixed parameters for ps1 script --- build.backend.docker.ps1 | 67 ++++++++++++++++++++++++++-------------- build.backend.docker.sh | 2 +- 2 files changed, 45 insertions(+), 24 deletions(-) diff --git a/build.backend.docker.ps1 b/build.backend.docker.ps1 index 1decd6ca84..15fe253899 100644 --- a/build.backend.docker.ps1 +++ b/build.backend.docker.ps1 @@ -1,3 +1,25 @@ +param( + [switch] $h = $false, + [switch] $f = $false, + [switch] $s = $true, + [switch] $c = $false, + [switch] $d = $false +) + +if ($h) { + Write-Host "Build and run backend and working environment. (Use 'yarn start' to run client -> https://github.com/ONLYOFFICE/DocSpace-client)" + Write-Host + Write-Host "Syntax: available params [-h|f|s|c|d|]" + Write-Host "Options:" + Write-Host "h Print this Help." + Write-Host "f Force rebuild base images." + Write-Host "s Run as SAAS otherwise as STANDALONE." + Write-Host "c Run as COMMUNITY otherwise ENTERPRISE." + Write-Host "d Run dnsmasq." + Write-Host + exit +} + $PSversionMajor = $PSVersionTable.PSVersion | sort-object major | ForEach-Object { $_.major } $PSversionMinor = $PSVersionTable.PSVersion | sort-object minor | ForEach-Object { $_.minor } @@ -21,24 +43,16 @@ $ProxyVersion="v1.0.0" $Env:COMPOSE_IGNORE_ORPHANS = "True" -$Force = $False - -if ($args[0] -eq "--force") { - $Force = $True -} - -Write-Host "FORCE BUILD BASE IMAGES: $Force" -ForegroundColor Blue - $ExistsNetwork= docker network ls --format '{{.Name}}' | findstr "onlyoffice" if (-not $ExistsNetwork) { - docker network create --driver bridge onlyoffice + docker network create --driver bridge onlyoffice } Write-Host "Run MySQL" -ForegroundColor Green docker compose -f "$DockerDir\db.yml" up -d -if ($args[0] -eq "--dns" ) { +if ($d) { Write-Host "Run local dns server" -ForegroundColor Green $Env:ROOT_DIR=$RootDir docker compose -f "$DockerDir\dnsmasq.yml" up -d @@ -49,12 +63,17 @@ Write-Host "Build backend services (to `publish/` folder)" -ForegroundColor Gree $Env:DOCUMENT_SERVER_IMAGE_NAME = "onlyoffice/documentserver-de:latest" $Env:INSTALLATION_TYPE = "ENTERPRISE" +$Env:MIGRATION_TYPE = "STANDALONE" -if ($args[0] -eq "--community" ) { +if ($c) { $Env:DOCUMENT_SERVER_IMAGE_NAME = "onlyoffice/documentserver:latest" $Env:INSTALLATION_TYPE = "COMMUNITY" } +if (-not $s) { + $Env:MIGRATION_TYPE = "SAAS" +} + Set-Location -Path $RootDir $DotnetVersion = "dev" @@ -65,25 +84,25 @@ $ExistsDotnet= docker images --format "{{.Repository}}:{{.Tag}}" | findstr "only $ExistsNode= docker images --format "{{.Repository}}:{{.Tag}}" | findstr "onlyoffice/4testing-docspace-nodejs-runtime:$NodeVersion" $ExistsProxy= docker images --format "{{.Repository}}:{{.Tag}}" | findstr "onlyoffice/4testing-docspace-proxy-runtime:$ProxyVersion" -if (!$ExistsDotnet -or $Force) { - Write-Host "Build dotnet base image from source (apply new dotnet config)" -ForegroundColor Green - docker build -t "onlyoffice/4testing-docspace-dotnet-runtime:$DotnetVersion" -f "$DockerDir\Dockerfile.runtime" --target dotnetrun . +if (!$ExistsDotnet -or $f) { + Write-Host "Build dotnet base image from source (apply new dotnet config)" -ForegroundColor Green + docker build -t "onlyoffice/4testing-docspace-dotnet-runtime:$DotnetVersion" -f "$DockerDir\Dockerfile.runtime" --target dotnetrun . } else { - Write-Host "SKIP build dotnet base image (already exists)" -ForegroundColor Blue + Write-Host "SKIP build dotnet base image (already exists)" -ForegroundColor Blue } -if (!$ExistsNode -or $Force) { - Write-Host "Build node base image from source" -ForegroundColor Green - docker build -t "onlyoffice/4testing-docspace-nodejs-runtime:$NodeVersion" -f "$DockerDir\Dockerfile.runtime" --target noderun . +if (!$ExistsNode -or $f) { + Write-Host "Build node base image from source" -ForegroundColor Green + docker build -t "onlyoffice/4testing-docspace-nodejs-runtime:$NodeVersion" -f "$DockerDir\Dockerfile.runtime" --target noderun . } else { - Write-Host "SKIP build node base image (already exists)" -ForegroundColor Blue + Write-Host "SKIP build node base image (already exists)" -ForegroundColor Blue } -if (!$ExistsProxy -or $Force) { - Write-Host "Build proxy base image from source (apply new nginx config)" -ForegroundColor Green - docker build -t "onlyoffice/4testing-docspace-proxy-runtime:$ProxyVersion" -f "$DockerDir\Dockerfile.runtime" --target router . +if (!$ExistsProxy -or $f) { + Write-Host "Build proxy base image from source (apply new nginx config)" -ForegroundColor Green + docker build -t "onlyoffice/4testing-docspace-proxy-runtime:$ProxyVersion" -f "$DockerDir\Dockerfile.runtime" --target router . } else { - Write-Host "SKIP build proxy base image (already exists)" -ForegroundColor Blue + Write-Host "SKIP build proxy base image (already exists)" -ForegroundColor Blue } Write-Host "Run migration and services" -ForegroundColor Green @@ -108,5 +127,7 @@ Write-Host "SERVICE_DOCEDITOR: $Env:SERVICE_DOCEDITOR" -ForegroundColor Blue Write-Host "SERVICE_LOGIN: $Env:SERVICE_LOGIN" -ForegroundColor Blue Write-Host "SERVICE_CLIENT: $Env:SERVICE_CLIENT" -ForegroundColor Blue Write-Host "INSTALLATION_TYPE: $Env:INSTALLATION_TYPE" -ForegroundColor Blue +Write-Host "MIGRATION TYPE: $Env:MIGRATION_TYPE" -ForegroundColor Blue +Write-Host "DS IMAGE: $Env:DOCUMENT_SERVER_IMAGE_NAME" -ForegroundColor Blue Set-Location -Path $PSScriptRoot \ No newline at end of file diff --git a/build.backend.docker.sh b/build.backend.docker.sh index 9960bee368..7cbc9b17bc 100755 --- a/build.backend.docker.sh +++ b/build.backend.docker.sh @@ -8,7 +8,7 @@ Help() # Display Help echo "Build and run backend and working environment. (Use 'yarn start' to run client -> https://github.com/ONLYOFFICE/DocSpace-client)" echo - echo "Syntax: available params [-h|f|i|c|d|]" + echo "Syntax: available params [-h|f|s|c|d|]" echo "options:" echo "h Print this Help." echo "f Force rebuild base images." From e7c6fe6b7941e6ec9afef6b241401946bf0b436c Mon Sep 17 00:00:00 2001 From: Evgeniy Antonyuk Date: Thu, 12 Oct 2023 17:11:05 +0400 Subject: [PATCH 13/16] Fix openresty logging error in nginx file --- install/deb/debian/rules | 2 +- install/rpm/SPECS/build.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install/deb/debian/rules b/install/deb/debian/rules index 04bbc1d10d..d86143429a 100755 --- a/install/deb/debian/rules +++ b/install/deb/debian/rules @@ -54,7 +54,7 @@ override_dh_auto_build: json -I -f ${SRC_PATH}/client/public/scripts/config.json -e "this.wrongPortalNameUrl=\"\"" sed -e 's/$$router_host/127.0.0.1/g' -e 's/the_host/host/g' -e 's/the_scheme/scheme/g' -e 's_includes_/etc/openresty/includes_g' -i ${SRC_PATH}/buildtools/install/docker/config/nginx/onlyoffice-proxy*.conf sed "s_\(.*root\).*;_\1 \"/var/www/${PRODUCT}\";_g" -i ${SRC_PATH}/buildtools/install/docker/config/nginx/letsencrypt.conf - sed -e '/.pid/d' -e '/temp_path/d' -e 's_etc/nginx_etc/openresty_g' -i ${SRC_PATH}/buildtools/install/docker/config/nginx/templates/nginx.conf.template + sed -e '/.pid/d' -e '/temp_path/d' -e 's_etc/nginx_etc/openresty_g' -e 's/\.log/-openresty.log/g' -i ${SRC_PATH}/buildtools/install/docker/config/nginx/templates/nginx.conf.template mv -f ${SRC_PATH}/buildtools/install/docker/config/nginx/onlyoffice-proxy-ssl.conf ${SRC_PATH}/buildtools/install/docker/config/nginx/onlyoffice-proxy-ssl.conf.template for i in ${PRODUCT} $$(ls ${CURRENT_PATH}/debian/*.install | grep -oP 'debian/\K.*' | grep -o '^[^.]*'); do \ diff --git a/install/rpm/SPECS/build.spec b/install/rpm/SPECS/build.spec index fbc483855a..630636104b 100644 --- a/install/rpm/SPECS/build.spec +++ b/install/rpm/SPECS/build.spec @@ -27,7 +27,7 @@ sed 's/teamlab.info/onlyoffice.com/g' -i config/autofac.consumers.json sed 's_etc/nginx_etc/openresty_g' -i config/nginx/*.conf sed -e 's/$router_host/127.0.0.1/g' -e 's/the_host/host/g' -e 's/the_scheme/scheme/g' -e 's_includes_/etc/openresty/includes_g' -i install/docker/config/nginx/onlyoffice-proxy*.conf -sed -e '/.pid/d' -e '/temp_path/d' -e 's_etc/nginx_etc/openresty_g' -i install/docker/config/nginx/templates/nginx.conf.template +sed -e '/.pid/d' -e '/temp_path/d' -e 's_etc/nginx_etc/openresty_g' -e 's/\.log/-openresty.log/g' -i install/docker/config/nginx/templates/nginx.conf.template sed -i "s_\(.*root\).*;_\1 \"/var/www/%{product}\";_g" -i install/docker/config/nginx/letsencrypt.conf find %{_builddir}/server/publish/ \ From 7079467cc827e318aef32130b461e9908774962e Mon Sep 17 00:00:00 2001 From: Sergey Kirichenko Date: Thu, 12 Oct 2023 18:44:39 +0300 Subject: [PATCH 14/16] Add gzip config level to router (#16) * Modify gzip config level and proxied * Modify gzip config * Modify gzip config --- config/nginx/onlyoffice.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/nginx/onlyoffice.conf b/config/nginx/onlyoffice.conf index 577132a785..9a0b7c30d7 100644 --- a/config/nginx/onlyoffice.conf +++ b/config/nginx/onlyoffice.conf @@ -68,6 +68,8 @@ server { gzip on; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; + gzip_min_length 1000; + gzip_proxied any; fastcgi_read_timeout 600; fastcgi_send_timeout 600; From 7952dea531bf1b242b4acd63569c38d5b11e0dad Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Sun, 15 Oct 2023 13:12:13 +0400 Subject: [PATCH 15/16] Update +x permission --- start/restart.backend.docker.sh | 0 start/start.backend.docker.sh | 0 start/stop.backend.docker.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 start/restart.backend.docker.sh mode change 100644 => 100755 start/start.backend.docker.sh mode change 100644 => 100755 start/stop.backend.docker.sh diff --git a/start/restart.backend.docker.sh b/start/restart.backend.docker.sh old mode 100644 new mode 100755 diff --git a/start/start.backend.docker.sh b/start/start.backend.docker.sh old mode 100644 new mode 100755 diff --git a/start/stop.backend.docker.sh b/start/stop.backend.docker.sh old mode 100644 new mode 100755 From 46d3c130a2196f9060d87bc8575fdabf5b9068c8 Mon Sep 17 00:00:00 2001 From: Nasrullo Nurullaev <61620246+nasrullonurullaev@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:13:02 +0500 Subject: [PATCH 16/16] Add Enterprise build and bundled prerequisites (#15) * Add Enterprise build and bundled prerequisites * Small fixes * Small fixes * Fix issue with Licenses * Revert changes with License_Redist.rtf --- install/win/DocSpace.aip | 144 +++++++++++++++++++++++++++--------- install/win/build-batch.bat | 15 ++-- 2 files changed, 115 insertions(+), 44 deletions(-) diff --git a/install/win/DocSpace.aip b/install/win/DocSpace.aip index 5ff1cfcfac..0aaaa72022 100644 --- a/install/win/DocSpace.aip +++ b/install/win/DocSpace.aip @@ -50,7 +50,9 @@ + + @@ -58,7 +60,7 @@ - + @@ -210,8 +212,10 @@ + + @@ -264,6 +268,7 @@ + @@ -310,8 +315,8 @@ - - + + @@ -415,11 +420,13 @@ + + @@ -427,6 +434,7 @@ + @@ -474,8 +482,8 @@ - - + + @@ -501,6 +509,7 @@ + @@ -538,6 +547,7 @@ + @@ -1075,6 +1085,7 @@ + @@ -1188,6 +1199,8 @@ + + @@ -1207,16 +1220,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -1241,7 +1254,7 @@ - + @@ -1271,6 +1284,7 @@ + @@ -1304,7 +1318,7 @@ - + @@ -1392,6 +1406,7 @@ + @@ -1402,26 +1417,49 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -1431,6 +1469,9 @@ + + + @@ -1524,47 +1565,80 @@ - - - - - - + + + + + - - - + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + diff --git a/install/win/build-batch.bat b/install/win/build-batch.bat index 631538a0b6..a6fc2dd2e8 100644 --- a/install/win/build-batch.bat +++ b/install/win/build-batch.bat @@ -101,14 +101,11 @@ IF "%SignBuild%"=="true" ( %AdvancedInstaller% /edit buildtools\install\win\DocSpace.aip /SetDigitalCertificateFile -file %onlyoffice_codesign_path% -password "%onlyoffice_codesign_password%" ) -%AdvancedInstaller% /rebuild buildtools\install\win\DocSpace.aip +:: Build DocSpace Community +%AdvancedInstaller% /rebuild buildtools\install\win\DocSpace.aip -buildslist DOCSPACE_COMMUNITY -REM echo ######## Build DocSpace Enterprise package ######## -%AdvancedInstaller% /edit buildtools\install\win\DocSpace.Enterprise.aip /SetVersion %BUILD_VERSION%.%BUILD_NUMBER% +:: Build DocSpace Enterprise +copy "buildtools\install\win\Resources\License_Enterprise.rtf" "buildtools\install\win\Resources\License.rtf" /y +copy "buildtools\install\win\Resources\License_Enterprise_Redist.rtf" "buildtools\install\win\Resources\License_Redist.rtf" /y -IF "%SignBuild%"=="true" ( -%AdvancedInstaller% /edit buildtools\install\win\DocSpace.Enterprise.aip /SetSig -%AdvancedInstaller% /edit buildtools\install\win\DocSpace.Enterprise.aip /SetDigitalCertificateFile -file %onlyoffice_codesign_path% -password "%onlyoffice_codesign_password%" -) - -%AdvancedInstaller% /rebuild buildtools\install\win\DocSpace.Enterprise.aip +%AdvancedInstaller% /rebuild buildtools\install\win\DocSpace.aip -buildslist DOCSPACE_ENTERPRISE