From e85e625e55bcfbfc0080f2ba22c4400c0c0c197b Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Mon, 30 Mar 2020 17:44:55 +0200 Subject: [PATCH 01/38] Add Dockerfile and components --- Dockerfile | 37 +++++++++++++++++++++++ README.md | 36 ++++++++++++++++++++++ license.py | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ run-oo.sh | 10 +++++++ 4 files changed, 170 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 license.py create mode 100644 run-oo.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..880b047 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +ARG oo_version=5.5.0.165 +FROM onlyoffice/documentserver:$oo_version + + +RUN sed -is \ + 's/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g' \ + /var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/mobile/app.js + +RUN sed -is \ + 's/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g' \ + /var/www/onlyoffice/documentserver/web-apps/apps/presentationeditor/mobile/app.js + +RUN sed -is \ + 's/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g' \ + /var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/mobile/app.js + + +RUN apt-get update && apt-get install -y \ + python3-pip \ + && rm -rf /var/lib/apt/lists/* \ + && pip3 install pycryptodome + + +COPY license.py /tmp/ +RUN python3 /tmp/license.py + +RUN pip3 uninstall -y pycryptodome \ + && apt-get purge -y python3-pip \ + && apt-get purge -y --autoremove \ + && rm -rf /var/lib/apt/lists/* + + +COPY run-oo.sh /usr/local/bin/run-oo.sh +RUN chmod a+x /usr/local/bin/run-oo.sh + + +ENTRYPOINT [ "/usr/local/bin/run-oo.sh" ] diff --git a/README.md b/README.md new file mode 100644 index 0000000..ffd3533 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# OnlyOffice Community server with license + +## Usage + +```sh +docker build \ + --tag=onlyoffice-patched \ + https://github.com/aleho/onlyoffice-ce-docker-license.git +``` + +```sh +docker run \ + --name=onlyoffice \ + --detach \ + --volume=$(pwd)/ooData:/var/www/onlyoffice/Data onlyoffice-patched \ + onlyoffice-patched +``` + +## Background +Recently, just about a month after Nextcloud announced their partnership with +Ascensio and featuring a community version of OnlyOffice, the latter decided +to remove support for mobile editing of documents via the Nextcloud app. + +This happened without any prior notice and alienated quite a lot of home users, +who would now be forced to pay more than €1.000 to unlock that previously free +feature. Only after some outcries Ascensio deigned to release a statement and +a new, albeit "limited", offer of €90 for home servers. + +In my opinion these deceptive practices are unacceptable for a company +advertising itself and their product as open source . + + +## Thanks + +This repo is heavily inspired by the works of +[Zegorax/OnlyOffice-Unlimited](https://github.com/Zegorax/OnlyOffice-Unlimited). diff --git a/license.py b/license.py new file mode 100644 index 0000000..18dc0d3 --- /dev/null +++ b/license.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 + +from Crypto.Hash import SHA, SHA256 +from Crypto.Signature import PKCS1_v1_5 +from Crypto.PublicKey import RSA +from shutil import copyfile +import json +import codecs + + + +def gen_keys(): + privKey = RSA.generate(1024) + publKey = privKey.publickey().exportKey('PEM') + + f = open("/var/www/onlyoffice/license_key.pub", "w+") + f.write(publKey.decode('utf-8')) + f.close() + + return publKey, privKey + + + +def write_license(publKey, privKey): + license = { + "branding": False, + "connections": 9999, + "customization": False, + "end_date": "2099-01-01T23:59:59.000Z", + "light": "False", + "mode": "", + "portal_count": "0", + "process": 2, + "ssbranding": False, + "test": "False", + "trial": "False", + "user_quota": "0", + "users_count": 9999, + "users_expire": 99999, + "whiteLabel": False, + "customer_id": "customerID", + "start_date": "2020-01-01T00:00:00.000Z", + "users": [], + "version": 2 + } + + jsonData = codecs.encode(json.dumps(license, separators=(',', ':')), encoding='utf-8') + + digest = SHA.new(jsonData) + signer = PKCS1_v1_5.new(privKey) + signature = signer.sign(digest) + finalSignature = signature.hex() + + license['signature'] = finalSignature + + f = open("/var/www/onlyoffice/license.lic", "w+") + f.write(json.dumps(license)) + f.close + + + +def patch_files(): + basePath = "/var/www/onlyoffice/documentserver/server/" + files = ["DocService/docservice", "FileConverter/converter"] + + for file in files: + f = open(basePath + file, 'rb') + data = f.read() + f.close() + + replacedData = data.replace(b"-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRhGF7X4A0ZVlEg594WmODVVUI\niiPQs04aLmvfg8SborHss5gQXu0aIdUT6nb5rTh5hD2yfpF2WIW6M8z0WxRhwicg\nXwi80H1aLPf6lEPPLvN29EhQNjBpkFkAJUbS8uuhJEeKw0cE49g80eBBF4BCqSL6\nPFQbP9/rByxdxEoAIQIDAQAB\n-----END PUBLIC KEY-----", bytes(publKey)) + + f = open(basePath + file, 'wb') + f.write(replacedData) + f.close() + + + + +print("Generating and exporting key pair...") +publKey, privKey = gen_keys() + +print("Writing license file...") +write_license(publKey, privKey) + +print("Patching document server and converter...") +patch_files() diff --git a/run-oo.sh b/run-oo.sh new file mode 100644 index 0000000..ed5ad6b --- /dev/null +++ b/run-oo.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -e + + +echo "Providing license" +cp -f /var/www/onlyoffice/license.lic /var/www/onlyoffice/Data/license.lic + +echo "Starting server" +/app/ds/run-document-server.sh + From 86721ea9db4603439241a7d686507da4dd878be9 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Fri, 17 Apr 2020 23:03:53 +0200 Subject: [PATCH 02/38] Update for 5.5.1.76 --- Dockerfile | 38 ++++++++++------- README.md | 3 +- license.patch | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++ license.py | 87 --------------------------------------- run-oo.sh | 10 ----- 5 files changed, 134 insertions(+), 114 deletions(-) create mode 100644 license.patch delete mode 100644 license.py delete mode 100644 run-oo.sh diff --git a/Dockerfile b/Dockerfile index 880b047..07c72a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ -ARG oo_version=5.5.0.165 +ARG oo_version=5.5.1.76 FROM onlyoffice/documentserver:$oo_version +ARG oo_version=5.5.1.76 RUN sed -is \ @@ -15,23 +16,30 @@ RUN sed -is \ /var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/mobile/app.js +# source patching and compilation RUN apt-get update && apt-get install -y \ - python3-pip \ - && rm -rf /var/lib/apt/lists/* \ - && pip3 install pycryptodome - - -COPY license.py /tmp/ -RUN python3 /tmp/license.py - -RUN pip3 uninstall -y pycryptodome \ - && apt-get purge -y python3-pip \ - && apt-get purge -y --autoremove \ + git \ + curl \ + && curl -sL https://deb.nodesource.com/setup_10.x | bash - \ + && apt install -y nodejs \ && rm -rf /var/lib/apt/lists/* -COPY run-oo.sh /usr/local/bin/run-oo.sh -RUN chmod a+x /usr/local/bin/run-oo.sh +RUN mkdir /build +WORKDIR /build + +RUN git clone --branch v$oo_version --depth 1 https://github.com/ONLYOFFICE/server.git . + +COPY license.patch /build/ +RUN patch -p1 < license.patch -ENTRYPOINT [ "/usr/local/bin/run-oo.sh" ] +RUN npm install pkg grunt-cli \ + && make \ + && node_modules/.bin/pkg --targets=linux build/server/FileConverter \ + && node_modules/.bin/pkg --targets=linux build/server/DocService \ + && cp fileconverter /var/www/onlyoffice/documentserver/server/FileConverter/converter \ + && cp coauthoring /var/www/onlyoffice/documentserver/server/DocService/docservice + +WORKDIR / +RUN rm -rf /build diff --git a/README.md b/README.md index ffd3533..50f0ef3 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ docker build \ docker run \ --name=onlyoffice \ --detach \ - --volume=$(pwd)/ooData:/var/www/onlyoffice/Data onlyoffice-patched \ onlyoffice-patched ``` @@ -32,5 +31,5 @@ advertising itself and their product as open source . ## Thanks -This repo is heavily inspired by the works of +This repo was heavily inspired by the works of [Zegorax/OnlyOffice-Unlimited](https://github.com/Zegorax/OnlyOffice-Unlimited). diff --git a/license.patch b/license.patch new file mode 100644 index 0000000..1672fbe --- /dev/null +++ b/license.patch @@ -0,0 +1,110 @@ +diff --git a/Common/sources/commondefines.js b/Common/sources/commondefines.js +index 4518ac8..34ab4e2 100644 +--- a/Common/sources/commondefines.js ++++ b/Common/sources/commondefines.js +@@ -970,8 +970,8 @@ const c_oAscQueueType = { + activemq: 'activemq' + }; + +-const buildVersion = '4.1.2'; +-const buildNumber = 37; ++const buildVersion = '5.5.1'; ++const buildNumber = 76; + + exports.TaskQueueData = TaskQueueData; + exports.CMailMergeSendData = CMailMergeSendData; +diff --git a/Common/sources/license.js b/Common/sources/license.js +index 290d85d..c136956 100644 +--- a/Common/sources/license.js ++++ b/Common/sources/license.js +@@ -32,53 +32,26 @@ + + 'use strict'; + +-const config = require('config'); +-const configL = config.get('license'); + const constants = require('./constants'); +-const logger = require('./logger'); +-const editorDataStorage = require('./../../DocService/sources/' + config.get('services.CoAuthoring.server.editorDataStorage')); +- + const buildDate = '6/29/2016'; + const oBuildDate = new Date(buildDate); +-const oPackageType = configL.get('packageType'); +- +-const cfgRedisPrefix = config.get('services.CoAuthoring.redis.prefix'); +-const redisKeyLicense = cfgRedisPrefix + constants.REDIS_KEY_LICENSE; +- +-let editorData = new editorDataStorage(); + + exports.readLicense = function*() { +- const c_LR = constants.LICENSE_RESULT; +- const res = { ++ return { + count: 1, +- type: c_LR.Error, ++ type: constants.LICENSE_RESULT.Success, + light: false, +- packageType: oPackageType, ++ packageType: constants.PACKAGE_TYPE_I, + mode: constants.LICENSE_MODE.None, + branding: false, +- connections: constants.LICENSE_CONNECTIONS, ++ connections: 9999, + customization: false, +- usersCount: 0, +- usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY, +- hasLicense: false, ++ usersCount: 9999, ++ usersExpire: 99999, ++ hasLicense: true, + plugins: false, + buildDate: oBuildDate, +- endDate: null ++ endDate: "2099-01-01T23:59:59.000Z" + }; +- +- if (yield* _getFileState()) { +- res.type = c_LR.ExpiredTrial; +- } +- +- if (res.type === c_LR.Expired || res.type === c_LR.ExpiredTrial) { +- res.count = 1; +- logger.error('License: License Expired!!!'); +- } +- +- return res; + }; +-exports.packageType = oPackageType; +- +-function* _getFileState() { +- return yield editorData.getLicense(redisKeyLicense); +-} ++exports.packageType = constants.PACKAGE_TYPE_I; +diff --git a/Makefile b/Makefile +index 40bf93e..7109dbd 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,4 +1,4 @@ +-GRUNT = grunt ++GRUNT = ./node_modules/.bin/grunt + GRUNT_FLAGS = --no-color -v + + GRUNT_FILES = Gruntfile.js.out +@@ -46,7 +46,7 @@ endif + + TARGET := $(PLATFORM)_$(ARCHITECTURE) + +-OUTPUT = ../build_tools/out/$(TARGET)/onlyoffice/documentserver/server ++OUTPUT = build/out/$(TARGET)/onlyoffice/documentserver/server + + SPELLCHECKER_DICTIONARIES := $(OUTPUT)/SpellChecker/dictionaries + SPELLCHECKER_DICTIONARY_FILES += ../dictionaries/*_* +@@ -83,7 +83,7 @@ DEBUG = $(BRANDING_DIR)/debug.js + .PHONY: all clean install uninstall build-date + + .NOTPARALLEL: +-all: $(SPELLCHECKER_DICTIONARIES) $(TOOLS) $(SCHEMA) $(CORE_FONTS) $(LICENSE) $(WELCOME) $(INFO) build-date ++all: build-date + + build-date: $(GRUNT_FILES) + sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS) diff --git a/license.py b/license.py deleted file mode 100644 index 18dc0d3..0000000 --- a/license.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python3 - -from Crypto.Hash import SHA, SHA256 -from Crypto.Signature import PKCS1_v1_5 -from Crypto.PublicKey import RSA -from shutil import copyfile -import json -import codecs - - - -def gen_keys(): - privKey = RSA.generate(1024) - publKey = privKey.publickey().exportKey('PEM') - - f = open("/var/www/onlyoffice/license_key.pub", "w+") - f.write(publKey.decode('utf-8')) - f.close() - - return publKey, privKey - - - -def write_license(publKey, privKey): - license = { - "branding": False, - "connections": 9999, - "customization": False, - "end_date": "2099-01-01T23:59:59.000Z", - "light": "False", - "mode": "", - "portal_count": "0", - "process": 2, - "ssbranding": False, - "test": "False", - "trial": "False", - "user_quota": "0", - "users_count": 9999, - "users_expire": 99999, - "whiteLabel": False, - "customer_id": "customerID", - "start_date": "2020-01-01T00:00:00.000Z", - "users": [], - "version": 2 - } - - jsonData = codecs.encode(json.dumps(license, separators=(',', ':')), encoding='utf-8') - - digest = SHA.new(jsonData) - signer = PKCS1_v1_5.new(privKey) - signature = signer.sign(digest) - finalSignature = signature.hex() - - license['signature'] = finalSignature - - f = open("/var/www/onlyoffice/license.lic", "w+") - f.write(json.dumps(license)) - f.close - - - -def patch_files(): - basePath = "/var/www/onlyoffice/documentserver/server/" - files = ["DocService/docservice", "FileConverter/converter"] - - for file in files: - f = open(basePath + file, 'rb') - data = f.read() - f.close() - - replacedData = data.replace(b"-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRhGF7X4A0ZVlEg594WmODVVUI\niiPQs04aLmvfg8SborHss5gQXu0aIdUT6nb5rTh5hD2yfpF2WIW6M8z0WxRhwicg\nXwi80H1aLPf6lEPPLvN29EhQNjBpkFkAJUbS8uuhJEeKw0cE49g80eBBF4BCqSL6\nPFQbP9/rByxdxEoAIQIDAQAB\n-----END PUBLIC KEY-----", bytes(publKey)) - - f = open(basePath + file, 'wb') - f.write(replacedData) - f.close() - - - - -print("Generating and exporting key pair...") -publKey, privKey = gen_keys() - -print("Writing license file...") -write_license(publKey, privKey) - -print("Patching document server and converter...") -patch_files() diff --git a/run-oo.sh b/run-oo.sh deleted file mode 100644 index ed5ad6b..0000000 --- a/run-oo.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -set -e - - -echo "Providing license" -cp -f /var/www/onlyoffice/license.lic /var/www/onlyoffice/Data/license.lic - -echo "Starting server" -/app/ds/run-document-server.sh - From a1431337a44872462b2f45fec9b8e681f8b90f1b Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sun, 19 Apr 2020 11:10:27 +0200 Subject: [PATCH 03/38] Document docker-compose usage --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 50f0ef3..f8c084a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ ## Usage +### CLI + ```sh docker build \ --tag=onlyoffice-patched \ @@ -15,6 +17,17 @@ docker run \ onlyoffice-patched ``` +### docker-compose.yml + +```yml +services: + onlyoffice: + container_name: onlyoffice + image: onlyoffice-patched + build: + context: https://github.com/aleho/onlyoffice-ce-docker-license.git +``` + ## Background Recently, just about a month after Nextcloud announced their partnership with Ascensio and featuring a community version of OnlyOffice, the latter decided From fe1a3d439114bb15121b32dfa67530ca7fa7b083 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sun, 19 Apr 2020 13:07:33 +0200 Subject: [PATCH 04/38] Improve patch format, use git to apply, enable plugins, fix build date to tag date --- Dockerfile | 2 +- license.patch | 36 +++++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 07c72a3..4d94982 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ WORKDIR /build RUN git clone --branch v$oo_version --depth 1 https://github.com/ONLYOFFICE/server.git . COPY license.patch /build/ -RUN patch -p1 < license.patch +RUN git apply license.patch RUN npm install pkg grunt-cli \ diff --git a/license.patch b/license.patch index 1672fbe..7a3433c 100644 --- a/license.patch +++ b/license.patch @@ -1,8 +1,19 @@ +From 77edf2dd0cc894aefca49927c292defbccf7365b Mon Sep 17 00:00:00 2001 +From: Alexander Hofbauer +Date: Sun, 19 Apr 2020 12:52:29 +0200 +Subject: [PATCH] Enable rebuild with fake license + +--- + Common/sources/commondefines.js | 5 ++-- + Common/sources/license.js | 52 ++++++++------------------------- + Makefile | 6 ++-- + 3 files changed, 18 insertions(+), 45 deletions(-) + diff --git a/Common/sources/commondefines.js b/Common/sources/commondefines.js -index 4518ac8..34ab4e2 100644 +index 4518ac8..ff00ffe 100644 --- a/Common/sources/commondefines.js +++ b/Common/sources/commondefines.js -@@ -970,8 +970,8 @@ const c_oAscQueueType = { +@@ -970,8 +970,9 @@ const c_oAscQueueType = { activemq: 'activemq' }; @@ -10,14 +21,15 @@ index 4518ac8..34ab4e2 100644 -const buildNumber = 37; +const buildVersion = '5.5.1'; +const buildNumber = 76; ++exports.buildDate = '2020-03-36T14:02:15.000Z'; exports.TaskQueueData = TaskQueueData; exports.CMailMergeSendData = CMailMergeSendData; diff --git a/Common/sources/license.js b/Common/sources/license.js -index 290d85d..c136956 100644 +index 290d85d..5a1ab21 100644 --- a/Common/sources/license.js +++ b/Common/sources/license.js -@@ -32,53 +32,26 @@ +@@ -32,53 +32,25 @@ 'use strict'; @@ -27,14 +39,15 @@ index 290d85d..c136956 100644 -const logger = require('./logger'); -const editorDataStorage = require('./../../DocService/sources/' + config.get('services.CoAuthoring.server.editorDataStorage')); - - const buildDate = '6/29/2016'; - const oBuildDate = new Date(buildDate); +-const buildDate = '6/29/2016'; +-const oBuildDate = new Date(buildDate); -const oPackageType = configL.get('packageType'); - -const cfgRedisPrefix = config.get('services.CoAuthoring.redis.prefix'); -const redisKeyLicense = cfgRedisPrefix + constants.REDIS_KEY_LICENSE; - -let editorData = new editorDataStorage(); ++const commonDefines = require('./commondefines'); exports.readLicense = function*() { - const c_LR = constants.LICENSE_RESULT; @@ -54,12 +67,14 @@ index 290d85d..c136956 100644 - usersCount: 0, - usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY, - hasLicense: false, +- plugins: false, +- buildDate: oBuildDate, +- endDate: null + usersCount: 9999, + usersExpire: 99999, + hasLicense: true, - plugins: false, - buildDate: oBuildDate, -- endDate: null ++ plugins: true, ++ buildDate: commonDefines.buildDate, + endDate: "2099-01-01T23:59:59.000Z" }; - @@ -108,3 +123,6 @@ index 40bf93e..7109dbd 100644 build-date: $(GRUNT_FILES) sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS) +-- +2.26.1 + From a17ec8bbf72678510489934bb8672a0cb9746af7 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sun, 12 Jul 2020 12:37:49 +0200 Subject: [PATCH 05/38] Bump version to 5.5.3.39 --- Dockerfile | 4 ++-- license.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4d94982..996f68f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG oo_version=5.5.1.76 +ARG oo_version=5.5.3.39 FROM onlyoffice/documentserver:$oo_version -ARG oo_version=5.5.1.76 +ARG oo_version=5.5.3.39 RUN sed -is \ diff --git a/license.patch b/license.patch index 7a3433c..1add48b 100644 --- a/license.patch +++ b/license.patch @@ -19,7 +19,7 @@ index 4518ac8..ff00ffe 100644 -const buildVersion = '4.1.2'; -const buildNumber = 37; -+const buildVersion = '5.5.1'; ++const buildVersion = '5.5.3'; +const buildNumber = 76; +exports.buildDate = '2020-03-36T14:02:15.000Z'; From 4a19854542279fd7f5ad98afd69b1df3af887603 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sun, 12 Jul 2020 13:30:48 +0200 Subject: [PATCH 06/38] Document simple version check --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index f8c084a..c750732 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,12 @@ services: context: https://github.com/aleho/onlyoffice-ce-docker-license.git ``` +### Verify + +To verify that the container was built successfully simply call +`[server-url]/web-apps/apps/api/documents/api.js` and check the header comment. + + ## Background Recently, just about a month after Nextcloud announced their partnership with Ascensio and featuring a community version of OnlyOffice, the latter decided From 6f4181f51ad251fd610a07fba6d8c7b7ce5e0654 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Mon, 3 Aug 2020 11:52:17 +0200 Subject: [PATCH 07/38] Refresh for version 5.6.0.17 --- Dockerfile | 4 ++-- README.md | 2 +- license.patch | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 996f68f..b78fee2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG oo_version=5.5.3.39 +ARG oo_version=5.6.0.17 FROM onlyoffice/documentserver:$oo_version -ARG oo_version=5.5.3.39 +ARG oo_version=5.6.0.17 RUN sed -is \ diff --git a/README.md b/README.md index c750732..a0ba02a 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ feature. Only after some outcries Ascensio deigned to release a statement and a new, albeit "limited", offer of €90 for home servers. In my opinion these deceptive practices are unacceptable for a company -advertising itself and their product as open source . +advertising itself and their product as open source. ## Thanks diff --git a/license.patch b/license.patch index 1add48b..3ab763e 100644 --- a/license.patch +++ b/license.patch @@ -1,6 +1,6 @@ -From 77edf2dd0cc894aefca49927c292defbccf7365b Mon Sep 17 00:00:00 2001 +From 49041ccf02617c5a9b92693b3bf65870e6b79006 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer -Date: Sun, 19 Apr 2020 12:52:29 +0200 +Date: Mon, 3 Aug 2020 11:44:57 +0200 Subject: [PATCH] Enable rebuild with fake license --- @@ -10,18 +10,18 @@ Subject: [PATCH] Enable rebuild with fake license 3 files changed, 18 insertions(+), 45 deletions(-) diff --git a/Common/sources/commondefines.js b/Common/sources/commondefines.js -index 4518ac8..ff00ffe 100644 +index 694a13a..eb85e04 100644 --- a/Common/sources/commondefines.js +++ b/Common/sources/commondefines.js -@@ -970,8 +970,9 @@ const c_oAscQueueType = { - activemq: 'activemq' +@@ -975,8 +975,9 @@ const c_oAscUnlockRes = { + Empty: 2 }; -const buildVersion = '4.1.2'; -const buildNumber = 37; -+const buildVersion = '5.5.3'; -+const buildNumber = 76; -+exports.buildDate = '2020-03-36T14:02:15.000Z'; ++const buildVersion = '5.6.0'; ++const buildNumber = 17; ++exports.buildDate = '2020-07-29T10:19:00.000Z'; exports.TaskQueueData = TaskQueueData; exports.CMailMergeSendData = CMailMergeSendData; @@ -124,5 +124,5 @@ index 40bf93e..7109dbd 100644 build-date: $(GRUNT_FILES) sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS) -- -2.26.1 +2.28.0 From 42d32196fa2fa6e4a3f911322bfea678333c48c5 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Fri, 7 Aug 2020 20:11:24 +0200 Subject: [PATCH 08/38] 5.6.2.2 --- Dockerfile | 4 ++-- license.patch | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b78fee2..5201e12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG oo_version=5.6.0.17 +ARG oo_version=5.6.2.2 FROM onlyoffice/documentserver:$oo_version -ARG oo_version=5.6.0.17 +ARG oo_version=5.6.2.2 RUN sed -is \ diff --git a/license.patch b/license.patch index 3ab763e..a8f45bc 100644 --- a/license.patch +++ b/license.patch @@ -19,9 +19,9 @@ index 694a13a..eb85e04 100644 -const buildVersion = '4.1.2'; -const buildNumber = 37; -+const buildVersion = '5.6.0'; -+const buildNumber = 17; -+exports.buildDate = '2020-07-29T10:19:00.000Z'; ++const buildVersion = '5.6.2'; ++const buildNumber = 2 ++exports.buildDate = '2020-08-07T11:23:00.000Z'; exports.TaskQueueData = TaskQueueData; exports.CMailMergeSendData = CMailMergeSendData; From 4dbf466ea4a7011a762de086f9f5538fe8f4025e Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sat, 22 Aug 2020 21:48:06 +0200 Subject: [PATCH 09/38] Document healthcheck --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a0ba02a..0f32131 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,8 @@ services: ### Verify -To verify that the container was built successfully simply call +To verify that the container is running successfully open +`[server-url]/healthcheck` (has to return `true`) and for the version number open `[server-url]/web-apps/apps/api/documents/api.js` and check the header comment. From 2b876e77299bd229b7ff9d716d749645921d3123 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sat, 22 Aug 2020 21:48:24 +0200 Subject: [PATCH 10/38] 5.6.3.2 --- Dockerfile | 4 ++-- license.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5201e12..c9bd6a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG oo_version=5.6.2.2 +ARG oo_version=5.6.3.2 FROM onlyoffice/documentserver:$oo_version -ARG oo_version=5.6.2.2 +ARG oo_version=5.6.3.2 RUN sed -is \ diff --git a/license.patch b/license.patch index a8f45bc..e13e8c8 100644 --- a/license.patch +++ b/license.patch @@ -19,9 +19,9 @@ index 694a13a..eb85e04 100644 -const buildVersion = '4.1.2'; -const buildNumber = 37; -+const buildVersion = '5.6.2'; ++const buildVersion = '5.6.3'; +const buildNumber = 2 -+exports.buildDate = '2020-08-07T11:23:00.000Z'; ++exports.buildDate = '2020-08-17T10:18:00.000+02:00' exports.TaskQueueData = TaskQueueData; exports.CMailMergeSendData = CMailMergeSendData; From 21a3f620a540d9f6c1471d18d9bf3de6df5f41ad Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sat, 29 Aug 2020 18:00:32 +0200 Subject: [PATCH 11/38] Document dockerhub Closes #2 --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 0f32131..0ba177c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,34 @@ # OnlyOffice Community server with license + ## Usage ### CLI +```sh +docker run \ + --name=onlyoffice \ + --detach \ + --publish=80:80 + alehoho/oo-ce-docker-license +``` + +### docker-compose.yml + +```yml +services: + onlyoffice: + container_name: onlyoffice + image: alehoho/oo-ce-docker-license + ports: + - "80" +``` + + +## Build + +### CLI + ```sh docker build \ --tag=onlyoffice-patched \ @@ -14,6 +39,7 @@ docker build \ docker run \ --name=onlyoffice \ --detach \ + … onlyoffice-patched ``` @@ -26,6 +52,7 @@ services: image: onlyoffice-patched build: context: https://github.com/aleho/onlyoffice-ce-docker-license.git + … ``` ### Verify From b0858e052fea529ed00661c2052e12a5c72530b3 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Tue, 15 Sep 2020 20:42:54 +0200 Subject: [PATCH 12/38] 5.6.4.20 --- Dockerfile | 4 ++-- README.md | 2 +- license.patch | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index c9bd6a4..cbb5625 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG oo_version=5.6.3.2 +ARG oo_version=5.6.4.20 FROM onlyoffice/documentserver:$oo_version -ARG oo_version=5.6.3.2 +ARG oo_version=5.6.4.20 RUN sed -is \ diff --git a/README.md b/README.md index 0ba177c..e3ff090 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ docker run \ --name=onlyoffice \ --detach \ - --publish=80:80 + --publish=80:80 \ alehoho/oo-ce-docker-license ``` diff --git a/license.patch b/license.patch index e13e8c8..ba4e8b6 100644 --- a/license.patch +++ b/license.patch @@ -19,9 +19,9 @@ index 694a13a..eb85e04 100644 -const buildVersion = '4.1.2'; -const buildNumber = 37; -+const buildVersion = '5.6.3'; -+const buildNumber = 2 -+exports.buildDate = '2020-08-17T10:18:00.000+02:00' ++const buildVersion = '5.6.4'; ++const buildNumber = 20 ++exports.buildDate = '2020-09-08T10:46:00.000+02:00' exports.TaskQueueData = TaskQueueData; exports.CMailMergeSendData = CMailMergeSendData; From ad729642be38c2f98ddbe8361f97986ac2041061 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sat, 26 Sep 2020 12:21:15 +0200 Subject: [PATCH 13/38] 5.6.5.3 --- Dockerfile | 4 ++-- license.patch | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index cbb5625..d1714fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG oo_version=5.6.4.20 +ARG oo_version=5.6.5.3 FROM onlyoffice/documentserver:$oo_version -ARG oo_version=5.6.4.20 +ARG oo_version=5.6.5.3 RUN sed -is \ diff --git a/license.patch b/license.patch index ba4e8b6..9073225 100644 --- a/license.patch +++ b/license.patch @@ -19,9 +19,9 @@ index 694a13a..eb85e04 100644 -const buildVersion = '4.1.2'; -const buildNumber = 37; -+const buildVersion = '5.6.4'; -+const buildNumber = 20 -+exports.buildDate = '2020-09-08T10:46:00.000+02:00' ++const buildVersion = '5.6.5'; ++const buildNumber = 3 ++exports.buildDate = '2020-09-21T09:52:00.000+02:00' exports.TaskQueueData = TaskQueueData; exports.CMailMergeSendData = CMailMergeSendData; From 3c264e164a98d950f5cfc999853939cca583e74f Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sat, 26 Sep 2020 22:21:25 +0200 Subject: [PATCH 14/38] Document podman/buildah --- README.md | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e3ff090..84fa2c8 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,17 @@ ## Usage -### CLI +### Podman CLI + +```sh +podman run \ + --name=onlyoffice \ + --detach \ + --publish=80:80 \ + docker.io/alehoho/oo-ce-docker-license +``` + +### Docker CLI ```sh docker run \ @@ -27,7 +37,15 @@ services: ## Build -### CLI +### Buildah CLI + +```sh +buildah build-using-dockerfile \ + --tag=onlyoffice-patched \ + https://github.com/aleho/onlyoffice-ce-docker-license.git +``` + +### Docker CLI ```sh docker build \ @@ -35,13 +53,6 @@ docker build \ https://github.com/aleho/onlyoffice-ce-docker-license.git ``` -```sh -docker run \ - --name=onlyoffice \ - --detach \ - … - onlyoffice-patched -``` ### docker-compose.yml From 1105492df04c27b03745f02e54feeee7120d3e65 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sat, 3 Oct 2020 18:22:21 +0200 Subject: [PATCH 15/38] Fix sed typo, consolidate patching Wrong ordering created a backup copy we don't need. --- Dockerfile | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index d1714fc..ea277f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,16 +3,10 @@ FROM onlyoffice/documentserver:$oo_version ARG oo_version=5.6.5.3 -RUN sed -is \ - 's/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g' \ - /var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/mobile/app.js - -RUN sed -is \ - 's/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g' \ - /var/www/onlyoffice/documentserver/web-apps/apps/presentationeditor/mobile/app.js - -RUN sed -is \ +RUN sed -si \ 's/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g' \ + /var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/mobile/app.js \ + /var/www/onlyoffice/documentserver/web-apps/apps/presentationeditor/mobile/app.js \ /var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/mobile/app.js From b40abf44f38d0babde058c3293ef75f8a6157c14 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sun, 18 Oct 2020 14:36:58 +0200 Subject: [PATCH 16/38] Various updates for 6.0.0.105 --- Dockerfile | 56 ++++++++++-------- license.patch | 161 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 138 insertions(+), 79 deletions(-) diff --git a/Dockerfile b/Dockerfile index ea277f6..325dc5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,39 +1,45 @@ -ARG oo_version=5.6.5.3 -FROM onlyoffice/documentserver:$oo_version -ARG oo_version=5.6.5.3 +ARG product_version=6.0.0 +ARG build_number=105 +FROM onlyoffice/documentserver:${product_version}.${build_number} +ARG product_version +ARG build_number RUN sed -si \ - 's/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g' \ - /var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/mobile/app.js \ - /var/www/onlyoffice/documentserver/web-apps/apps/presentationeditor/mobile/app.js \ - /var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/mobile/app.js + 's/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g' \ + /var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/mobile/app.js \ + /var/www/onlyoffice/documentserver/web-apps/apps/presentationeditor/mobile/app.js \ + /var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/mobile/app.js # source patching and compilation -RUN apt-get update && apt-get install -y \ - git \ - curl \ - && curl -sL https://deb.nodesource.com/setup_10.x | bash - \ - && apt install -y nodejs \ - && rm -rf /var/lib/apt/lists/* +RUN apt update && apt install -y git curl \ + && curl -sL https://deb.nodesource.com/setup_10.x | bash - \ + && apt install -y nodejs \ + && rm -rf /var/lib/apt/lists/* -RUN mkdir /build -WORKDIR /build - -RUN git clone --branch v$oo_version --depth 1 https://github.com/ONLYOFFICE/server.git . +ARG tag=v${product_version}.${build_number} +RUN mkdir /build \ + && git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/build_tools.git /build/build_tools \ + && git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/server.git /build/server COPY license.patch /build/ -RUN git apply license.patch +WORKDIR /build/server -RUN npm install pkg grunt-cli \ - && make \ - && node_modules/.bin/pkg --targets=linux build/server/FileConverter \ - && node_modules/.bin/pkg --targets=linux build/server/DocService \ - && cp fileconverter /var/www/onlyoffice/documentserver/server/FileConverter/converter \ - && cp coauthoring /var/www/onlyoffice/documentserver/server/DocService/docservice +ENV PRODUCT_VERSION=${product_version} +ENV BUILD_NUMBER=${build_number} + +RUN npm install -g pkg grunt grunt-cli \ + && git apply /build/license.patch \ + && make \ + && pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/FileConverter --targets=node10-linux -o /build/converter \ + && pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/DocService --targets=node10-linux --options max_old_space_size=4096 -o /build/docservice \ + && cp /build/converter /var/www/onlyoffice/documentserver/server/FileConverter/converter \ + && cp /build/docservice /var/www/onlyoffice/documentserver/server/DocService/docservice \ + && npm uninstall -g pkg grunt grunt-cli \ + && rm -rf /root/.cache /root/.config/ /root/.npm/ /root/.pkg-cache \ + && rm -rf /build WORKDIR / -RUN rm -rf /build diff --git a/license.patch b/license.patch index 9073225..65d0ae1 100644 --- a/license.patch +++ b/license.patch @@ -1,82 +1,94 @@ -From 49041ccf02617c5a9b92693b3bf65870e6b79006 Mon Sep 17 00:00:00 2001 +From bfd54caaf3a89d1b2aea5c38ed42c78c113ac7c1 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer -Date: Mon, 3 Aug 2020 11:44:57 +0200 -Subject: [PATCH] Enable rebuild with fake license +Date: Sun, 18 Oct 2020 15:17:44 +0200 +Subject: [PATCH] Patch for license --- - Common/sources/commondefines.js | 5 ++-- - Common/sources/license.js | 52 ++++++++------------------------- - Makefile | 6 ++-- - 3 files changed, 18 insertions(+), 45 deletions(-) + Common/sources/commondefines.js | 4 +- + Common/sources/license.js | 66 +++++++++--------------- + DocService/sources/DocsCoServer.js | 5 +- + DocService/sources/server.js | 1 - + FileConverter/sources/convertermaster.js | 1 - + Makefile | 2 +- + 6 files changed, 30 insertions(+), 49 deletions(-) diff --git a/Common/sources/commondefines.js b/Common/sources/commondefines.js -index 694a13a..eb85e04 100644 +index 694a13a..6f8a07b 100644 --- a/Common/sources/commondefines.js +++ b/Common/sources/commondefines.js -@@ -975,8 +975,9 @@ const c_oAscUnlockRes = { +@@ -975,8 +975,8 @@ const c_oAscUnlockRes = { Empty: 2 }; -const buildVersion = '4.1.2'; -const buildNumber = 37; -+const buildVersion = '5.6.5'; -+const buildNumber = 3 -+exports.buildDate = '2020-09-21T09:52:00.000+02:00' ++const buildVersion = '6.0.0'; ++const buildNumber = 105; exports.TaskQueueData = TaskQueueData; exports.CMailMergeSendData = CMailMergeSendData; diff --git a/Common/sources/license.js b/Common/sources/license.js -index 290d85d..5a1ab21 100644 +index 290d85d..655df27 100644 --- a/Common/sources/license.js +++ b/Common/sources/license.js -@@ -32,53 +32,25 @@ +@@ -32,53 +32,35 @@ 'use strict'; -const config = require('config'); -const configL = config.get('license'); - const constants = require('./constants'); --const logger = require('./logger'); +-const constants = require('./constants'); + const logger = require('./logger'); -const editorDataStorage = require('./../../DocService/sources/' + config.get('services.CoAuthoring.server.editorDataStorage')); -- ++const constants = require('./constants'); + -const buildDate = '6/29/2016'; -const oBuildDate = new Date(buildDate); -const oPackageType = configL.get('packageType'); -- ++const LICENSE = { ++ count: 9999, ++ type: constants.LICENSE_RESULT.Success, ++ light: false, ++ packageType: constants.PACKAGE_TYPE_I, ++ mode: constants.LICENSE_MODE.None, ++ branding: false, ++ connections: 9999, ++ customization: false, ++ usersCount: 9999, ++ usersExpire: new Date("2099-01-01T23:59:59.000Z").getTime() / 1000, ++ hasLicense: true, ++ plugins: true, ++ buildDate: "2020-10-15T14:07:00.000Z", ++ endDate: "2099-01-01T23:59:59.000Z" ++}; + -const cfgRedisPrefix = config.get('services.CoAuthoring.redis.prefix'); -const redisKeyLicense = cfgRedisPrefix + constants.REDIS_KEY_LICENSE; -- ++function getLicense() { ++ logger.debug('Injecting fake license', LICENSE) + -let editorData = new editorDataStorage(); -+const commonDefines = require('./commondefines'); ++ return { ...LICENSE }; ++} exports.readLicense = function*() { - const c_LR = constants.LICENSE_RESULT; - const res = { -+ return { - count: 1, +- count: 1, - type: c_LR.Error, -+ type: constants.LICENSE_RESULT.Success, - light: false, +- light: false, - packageType: oPackageType, -+ packageType: constants.PACKAGE_TYPE_I, - mode: constants.LICENSE_MODE.None, - branding: false, +- mode: constants.LICENSE_MODE.None, +- branding: false, - connections: constants.LICENSE_CONNECTIONS, -+ connections: 9999, - customization: false, +- customization: false, - usersCount: 0, - usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY, - hasLicense: false, - plugins: false, - buildDate: oBuildDate, - endDate: null -+ usersCount: 9999, -+ usersExpire: 99999, -+ hasLicense: true, -+ plugins: true, -+ buildDate: commonDefines.buildDate, -+ endDate: "2099-01-01T23:59:59.000Z" - }; +- }; - - if (yield* _getFileState()) { - res.type = c_LR.ExpiredTrial; @@ -88,38 +100,79 @@ index 290d85d..5a1ab21 100644 - } - - return res; ++ return getLicense(); }; -exports.packageType = oPackageType; -- + -function* _getFileState() { - return yield editorData.getLicense(redisKeyLicense); -} ++exports.getLicense = getLicense; +exports.packageType = constants.PACKAGE_TYPE_I; +diff --git a/DocService/sources/DocsCoServer.js b/DocService/sources/DocsCoServer.js +index be22d80..fb19abe 100644 +--- a/DocService/sources/DocsCoServer.js ++++ b/DocService/sources/DocsCoServer.js +@@ -103,6 +103,7 @@ const pubsubService = require('./pubsubRabbitMQ'); + const queueService = require('./../../Common/sources/taskqueueRabbitMQ'); + const rabbitMQCore = require('./../../Common/sources/rabbitMQCore'); + const activeMQCore = require('./../../Common/sources/activeMQCore'); ++const license = require('./../../Common/sources/license'); + + const editorDataStorage = require('./' + configCommon.get('services.CoAuthoring.server.editorDataStorage')); + let cfgEditor = JSON.parse(JSON.stringify(config.get('editor'))); +@@ -162,7 +163,7 @@ let connections = []; // Активные соединения + let lockDocumentsTimerId = {};//to drop connection that can't unlockDocument + let pubsub; + let queue; +-let licenseInfo = {type: constants.LICENSE_RESULT.Error, light: false, branding: false, customization: false, plugins: false}; ++let licenseInfo = license.getLicense(); + let shutdownFlag = false; + + const MIN_SAVE_EXPIRATION = 60000; +@@ -3013,7 +3014,7 @@ exports.install = function(server, callbackFunction) { + }); + }; + exports.setLicenseInfo = function(data) { +- licenseInfo = data; ++ logger.debug('Not updating license info', data) + }; + exports.getLicenseInfo = function() { + return licenseInfo; +diff --git a/DocService/sources/server.js b/DocService/sources/server.js +index db085bb..7d76d34 100644 +--- a/DocService/sources/server.js ++++ b/DocService/sources/server.js +@@ -129,7 +129,6 @@ try { + } catch (e) { + logger.warn('Failed to subscribe to plugin folder updates. When changing the list of plugins, you must restart the server. https://nodejs.org/docs/latest/api/fs.html#fs_availability'); + } +-fs.watchFile(configCommon.get('license').get('license_file'), updateLicense); + setInterval(updateLicense, 86400000); + + // Если захочется использовать 'development' и 'production', +diff --git a/FileConverter/sources/convertermaster.js b/FileConverter/sources/convertermaster.js +index c246bb8..9fe3d41 100644 +--- a/FileConverter/sources/convertermaster.js ++++ b/FileConverter/sources/convertermaster.js +@@ -85,7 +85,6 @@ if (cluster.isMaster) { + + updateLicense(); + +- fs.watchFile(configCommon.get('license').get('license_file'), updateLicense); + setInterval(updateLicense, 86400000); + } else { + const converter = require('./converter'); diff --git a/Makefile b/Makefile -index 40bf93e..7109dbd 100644 +index 40bf93e..1df9c10 100644 --- a/Makefile +++ b/Makefile -@@ -1,4 +1,4 @@ --GRUNT = grunt -+GRUNT = ./node_modules/.bin/grunt - GRUNT_FLAGS = --no-color -v - - GRUNT_FILES = Gruntfile.js.out -@@ -46,7 +46,7 @@ endif - - TARGET := $(PLATFORM)_$(ARCHITECTURE) - --OUTPUT = ../build_tools/out/$(TARGET)/onlyoffice/documentserver/server -+OUTPUT = build/out/$(TARGET)/onlyoffice/documentserver/server - - SPELLCHECKER_DICTIONARIES := $(OUTPUT)/SpellChecker/dictionaries - SPELLCHECKER_DICTIONARY_FILES += ../dictionaries/*_* @@ -83,7 +83,7 @@ DEBUG = $(BRANDING_DIR)/debug.js .PHONY: all clean install uninstall build-date .NOTPARALLEL: -all: $(SPELLCHECKER_DICTIONARIES) $(TOOLS) $(SCHEMA) $(CORE_FONTS) $(LICENSE) $(WELCOME) $(INFO) build-date -+all: build-date ++all: $(SCHEMA) $(LICENSE) $(WELCOME) $(INFO) build-date build-date: $(GRUNT_FILES) sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS) From b9a687f4f93ac4fc4c7c7a0fd09d56173e77f67e Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Wed, 28 Oct 2020 21:01:15 +0100 Subject: [PATCH 17/38] 6.0.1.32 --- Dockerfile | 4 ++-- license.patch | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 325dc5f..cfd3c6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG product_version=6.0.0 -ARG build_number=105 +ARG product_version=6.0.1 +ARG build_number=32 FROM onlyoffice/documentserver:${product_version}.${build_number} ARG product_version diff --git a/license.patch b/license.patch index 65d0ae1..165a28b 100644 --- a/license.patch +++ b/license.patch @@ -1,6 +1,6 @@ -From bfd54caaf3a89d1b2aea5c38ed42c78c113ac7c1 Mon Sep 17 00:00:00 2001 +From 39435fb1df8653303f6155927246408dcfe217a5 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer -Date: Sun, 18 Oct 2020 15:17:44 +0200 +Date: Wed, 28 Oct 2020 20:57:51 +0100 Subject: [PATCH] Patch for license --- @@ -13,7 +13,7 @@ Subject: [PATCH] Patch for license 6 files changed, 30 insertions(+), 49 deletions(-) diff --git a/Common/sources/commondefines.js b/Common/sources/commondefines.js -index 694a13a..6f8a07b 100644 +index 694a13a..89fbbec 100644 --- a/Common/sources/commondefines.js +++ b/Common/sources/commondefines.js @@ -975,8 +975,8 @@ const c_oAscUnlockRes = { @@ -22,13 +22,13 @@ index 694a13a..6f8a07b 100644 -const buildVersion = '4.1.2'; -const buildNumber = 37; -+const buildVersion = '6.0.0'; -+const buildNumber = 105; ++const buildVersion = '6.0.1'; ++const buildNumber = 32; exports.TaskQueueData = TaskQueueData; exports.CMailMergeSendData = CMailMergeSendData; diff --git a/Common/sources/license.js b/Common/sources/license.js -index 290d85d..655df27 100644 +index 290d85d..b2b9163 100644 --- a/Common/sources/license.js +++ b/Common/sources/license.js @@ -32,53 +32,35 @@ @@ -58,7 +58,7 @@ index 290d85d..655df27 100644 + usersExpire: new Date("2099-01-01T23:59:59.000Z").getTime() / 1000, + hasLicense: true, + plugins: true, -+ buildDate: "2020-10-15T14:07:00.000Z", ++ buildDate: "2020-10-28T15:51:00.000Z", + endDate: "2099-01-01T23:59:59.000Z" +}; @@ -177,5 +177,5 @@ index 40bf93e..1df9c10 100644 build-date: $(GRUNT_FILES) sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS) -- -2.28.0 +2.29.1 From a6e7e5dc2ac775c379605b6c9f8b0a9837a9370a Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sun, 27 Dec 2020 21:02:07 +0100 Subject: [PATCH 18/38] 6.1.0.83 --- Dockerfile | 28 ++++++----- license.patch | 130 +++++++++++++++++++------------------------------- 2 files changed, 65 insertions(+), 93 deletions(-) diff --git a/Dockerfile b/Dockerfile index cfd3c6d..a765a38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,11 @@ -ARG product_version=6.0.1 -ARG build_number=32 +ARG product_version=6.1.0 +ARG build_number=83 FROM onlyoffice/documentserver:${product_version}.${build_number} ARG product_version ARG build_number + RUN sed -si \ 's/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g' \ /var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/mobile/app.js \ @@ -12,17 +13,14 @@ RUN sed -si \ /var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/mobile/app.js -# source patching and compilation -RUN apt update && apt install -y git curl \ - && curl -sL https://deb.nodesource.com/setup_10.x | bash - \ - && apt install -y nodejs \ - && rm -rf /var/lib/apt/lists/* +ARG build_deps="git make g++ nodejs npm" +RUN apt-get update && apt-get install -y ${build_deps} ARG tag=v${product_version}.${build_number} RUN mkdir /build \ - && git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/build_tools.git /build/build_tools \ - && git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/server.git /build/server + && git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/build_tools.git /build/build_tools \ + && git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/server.git /build/server COPY license.patch /build/ @@ -37,9 +35,13 @@ RUN npm install -g pkg grunt grunt-cli \ && pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/FileConverter --targets=node10-linux -o /build/converter \ && pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/DocService --targets=node10-linux --options max_old_space_size=4096 -o /build/docservice \ && cp /build/converter /var/www/onlyoffice/documentserver/server/FileConverter/converter \ - && cp /build/docservice /var/www/onlyoffice/documentserver/server/DocService/docservice \ - && npm uninstall -g pkg grunt grunt-cli \ - && rm -rf /root/.cache /root/.config/ /root/.npm/ /root/.pkg-cache \ - && rm -rf /build + && cp /build/docservice /var/www/onlyoffice/documentserver/server/DocService/docservice WORKDIR / + +RUN npm uninstall -g pkg grunt grunt-cli \ + && apt-get purge -y --autoremove ${build_deps} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && rm -rf /root/.cache /root/.config/ /root/.npm/ /root/.pkg-cache \ + && rm -rf /build diff --git a/license.patch b/license.patch index 165a28b..d29c69f 100644 --- a/license.patch +++ b/license.patch @@ -1,19 +1,20 @@ -From 39435fb1df8653303f6155927246408dcfe217a5 Mon Sep 17 00:00:00 2001 +From cf7351495fd7cdb2ede5bfe4972adc1f0aa1465e Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer -Date: Wed, 28 Oct 2020 20:57:51 +0100 +Date: Sun, 27 Dec 2020 21:49:37 +0100 Subject: [PATCH] Patch for license --- - Common/sources/commondefines.js | 4 +- - Common/sources/license.js | 66 +++++++++--------------- - DocService/sources/DocsCoServer.js | 5 +- + Common/sources/commondefines.js | 4 ++-- + Common/sources/constants.js | 2 +- + Common/sources/license.js | 16 ++++++++-------- + DocService/sources/DocsCoServer.js | 5 +++-- DocService/sources/server.js | 1 - FileConverter/sources/convertermaster.js | 1 - Makefile | 2 +- - 6 files changed, 30 insertions(+), 49 deletions(-) + 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Common/sources/commondefines.js b/Common/sources/commondefines.js -index 694a13a..89fbbec 100644 +index 694a13a..b2b2e9b 100644 --- a/Common/sources/commondefines.js +++ b/Common/sources/commondefines.js @@ -975,8 +975,8 @@ const c_oAscUnlockRes = { @@ -22,95 +23,64 @@ index 694a13a..89fbbec 100644 -const buildVersion = '4.1.2'; -const buildNumber = 37; -+const buildVersion = '6.0.1'; -+const buildNumber = 32; ++const buildVersion = '6.1.0'; ++const buildNumber = 83; exports.TaskQueueData = TaskQueueData; exports.CMailMergeSendData = CMailMergeSendData; +diff --git a/Common/sources/constants.js b/Common/sources/constants.js +index 2b79e02..738df37 100644 +--- a/Common/sources/constants.js ++++ b/Common/sources/constants.js +@@ -70,7 +70,7 @@ exports.LICENSE_RESULT = { + ExpiredLimited: 11 + }; + +-exports.LICENSE_CONNECTIONS = 20; ++exports.LICENSE_CONNECTIONS = 9999; + exports.LICENSE_EXPIRE_USERS_ONE_DAY = 24 * 60 * 60; // day in seconds + + exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000; diff --git a/Common/sources/license.js b/Common/sources/license.js -index 290d85d..b2b9163 100644 +index 19f0b61..30c31c4 100644 --- a/Common/sources/license.js +++ b/Common/sources/license.js -@@ -32,53 +32,35 @@ +@@ -34,7 +34,7 @@ - 'use strict'; - --const config = require('config'); --const configL = config.get('license'); --const constants = require('./constants'); - const logger = require('./logger'); --const editorDataStorage = require('./../../DocService/sources/' + config.get('services.CoAuthoring.server.editorDataStorage')); -+const constants = require('./constants'); + const constants = require('./constants'); -const buildDate = '6/29/2016'; --const oBuildDate = new Date(buildDate); --const oPackageType = configL.get('packageType'); -+const LICENSE = { -+ count: 9999, -+ type: constants.LICENSE_RESULT.Success, -+ light: false, -+ packageType: constants.PACKAGE_TYPE_I, -+ mode: constants.LICENSE_MODE.None, -+ branding: false, -+ connections: 9999, -+ customization: false, -+ usersCount: 9999, -+ usersExpire: new Date("2099-01-01T23:59:59.000Z").getTime() / 1000, -+ hasLicense: true, -+ plugins: true, -+ buildDate: "2020-10-28T15:51:00.000Z", -+ endDate: "2099-01-01T23:59:59.000Z" -+}; - --const cfgRedisPrefix = config.get('services.CoAuthoring.redis.prefix'); --const redisKeyLicense = cfgRedisPrefix + constants.REDIS_KEY_LICENSE; -+function getLicense() { -+ logger.debug('Injecting fake license', LICENSE) - --let editorData = new editorDataStorage(); -+ return { ...LICENSE }; -+} ++const buildDate = '2021-01-28T11:37:00.000Z'; + const oBuildDate = new Date(buildDate); exports.readLicense = function*() { -- const c_LR = constants.LICENSE_RESULT; -- const res = { -- count: 1, -- type: c_LR.Error, -- light: false, -- packageType: oPackageType, -- mode: constants.LICENSE_MODE.None, -- branding: false, -- connections: constants.LICENSE_CONNECTIONS, +@@ -43,17 +43,17 @@ exports.readLicense = function*() { + count: 1, + type: c_LR.Success, + light: false, +- packageType: constants.PACKAGE_TYPE_OS, ++ packageType: constants.PACKAGE_TYPE_I, + mode: constants.LICENSE_MODE.None, + branding: false, + connections: constants.LICENSE_CONNECTIONS, - customization: false, -- usersCount: 0, ++ customization: true, + usersCount: 0, - usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY, - hasLicense: false, - plugins: false, -- buildDate: oBuildDate, ++ usersExpire: new Date("2099-01-01T23:59:59.000Z").getTime() / 1000, ++ hasLicense: true, ++ plugins: true, + buildDate: oBuildDate, - endDate: null -- }; -- -- if (yield* _getFileState()) { -- res.type = c_LR.ExpiredTrial; -- } -- -- if (res.type === c_LR.Expired || res.type === c_LR.ExpiredTrial) { -- res.count = 1; -- logger.error('License: License Expired!!!'); -- } -- -- return res; -+ return getLicense(); ++ endDate: "2099-01-01T23:59:59.000Z" + }; }; --exports.packageType = oPackageType; - --function* _getFileState() { -- return yield editorData.getLicense(redisKeyLicense); --} -+exports.getLicense = getLicense; +-exports.packageType = constants.PACKAGE_TYPE_OS; +exports.packageType = constants.PACKAGE_TYPE_I; diff --git a/DocService/sources/DocsCoServer.js b/DocService/sources/DocsCoServer.js -index be22d80..fb19abe 100644 +index 471a271..5df4fe0 100644 --- a/DocService/sources/DocsCoServer.js +++ b/DocService/sources/DocsCoServer.js @@ -103,6 +103,7 @@ const pubsubService = require('./pubsubRabbitMQ'); @@ -126,11 +96,11 @@ index be22d80..fb19abe 100644 let pubsub; let queue; -let licenseInfo = {type: constants.LICENSE_RESULT.Error, light: false, branding: false, customization: false, plugins: false}; -+let licenseInfo = license.getLicense(); ++let licenseInfo = license.readLicense().next().value; let shutdownFlag = false; const MIN_SAVE_EXPIRATION = 60000; -@@ -3013,7 +3014,7 @@ exports.install = function(server, callbackFunction) { +@@ -2969,7 +2970,7 @@ exports.install = function(server, callbackFunction) { }); }; exports.setLicenseInfo = function(data) { @@ -177,5 +147,5 @@ index 40bf93e..1df9c10 100644 build-date: $(GRUNT_FILES) sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS) -- -2.29.1 +2.29.2 From 4418f059582f3089f0a271f25c9432eebf3d527f Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Mon, 15 Feb 2021 21:23:46 +0100 Subject: [PATCH 19/38] Switch to multi-staged build Fixes #9 --- Dockerfile | 67 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index a765a38..1c524a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,47 +1,66 @@ +## Build stage ARG product_version=6.1.0 ARG build_number=83 +ARG oo_root='/var/www/onlyoffice/documentserver' -FROM onlyoffice/documentserver:${product_version}.${build_number} +FROM onlyoffice/documentserver:${product_version}.${build_number} as build-stage ARG product_version ARG build_number +ARG oo_root + +ENV PRODUCT_VERSION=${product_version} +ENV BUILD_NUMBER=${build_number} + +# Mobile apps patching +ARG me_search='isSupportEditFeature:function(){return!1}' +ARG me_patch='s/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g' + +RUN grep -q "${me_search}" ${oo_root}/web-apps/apps/documenteditor/mobile/app.js \ + && sed -si "${me_patch}" ${oo_root}/web-apps/apps/documenteditor/mobile/app.js + +RUN grep -q "${me_search}" ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js \ + && sed -si "${me_patch}" ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js + +RUN grep -q "${me_search}" ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js \ + && sed -si "${me_patch}" ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js -RUN sed -si \ - 's/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g' \ - /var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/mobile/app.js \ - /var/www/onlyoffice/documentserver/web-apps/apps/presentationeditor/mobile/app.js \ - /var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/mobile/app.js - - +# Rebuild with license checks replaced ARG build_deps="git make g++ nodejs npm" RUN apt-get update && apt-get install -y ${build_deps} - ARG tag=v${product_version}.${build_number} RUN mkdir /build \ && git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/build_tools.git /build/build_tools \ && git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/server.git /build/server -COPY license.patch /build/ WORKDIR /build/server -ENV PRODUCT_VERSION=${product_version} -ENV BUILD_NUMBER=${build_number} +RUN npm install -g pkg grunt grunt-cli -RUN npm install -g pkg grunt grunt-cli \ - && git apply /build/license.patch \ - && make \ +COPY license.patch /build/ +RUN git apply /build/license.patch + +RUN make \ && pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/FileConverter --targets=node10-linux -o /build/converter \ && pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/DocService --targets=node10-linux --options max_old_space_size=4096 -o /build/docservice \ - && cp /build/converter /var/www/onlyoffice/documentserver/server/FileConverter/converter \ - && cp /build/docservice /var/www/onlyoffice/documentserver/server/DocService/docservice + && cp /build/converter ${oo_root}/server/FileConverter/converter \ + && cp /build/docservice ${oo_root}/server/DocService/docservice -WORKDIR / -RUN npm uninstall -g pkg grunt grunt-cli \ - && apt-get purge -y --autoremove ${build_deps} \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ - && rm -rf /root/.cache /root/.config/ /root/.npm/ /root/.pkg-cache \ - && rm -rf /build +## Prod image +FROM onlyoffice/documentserver:${product_version}.${build_number} +ARG oo_root + +COPY --from=build-stage ${oo_root}/web-apps/apps/documenteditor/mobile/app.js \ + ${oo_root}/web-apps/apps/documenteditor/mobile/app.js +COPY --from=build-stage ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js \ + ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js +COPY --from=build-stage ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js \ + ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js + +COPY --from=build-stage ${oo_root}/server/FileConverter/converter \ + ${oo_root}/server/FileConverter/converter +COPY --from=build-stage ${oo_root}/server/DocService/docservice \ + ${oo_root}/server/DocService/docservice From f78cf9366c25836533d932bd60a55ceb6c7e98f1 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Tue, 23 Feb 2021 21:34:42 +0100 Subject: [PATCH 20/38] 6.1.1.53 --- Dockerfile | 4 ++-- license.patch | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1c524a1..e807761 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ## Build stage -ARG product_version=6.1.0 -ARG build_number=83 +ARG product_version=6.1.1 +ARG build_number=53 ARG oo_root='/var/www/onlyoffice/documentserver' FROM onlyoffice/documentserver:${product_version}.${build_number} as build-stage diff --git a/license.patch b/license.patch index d29c69f..661ac17 100644 --- a/license.patch +++ b/license.patch @@ -1,4 +1,4 @@ -From cf7351495fd7cdb2ede5bfe4972adc1f0aa1465e Mon Sep 17 00:00:00 2001 +From 34c308280edbb3011ce64e727f8cb522c5fd5ed7 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sun, 27 Dec 2020 21:49:37 +0100 Subject: [PATCH] Patch for license @@ -14,7 +14,7 @@ Subject: [PATCH] Patch for license 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Common/sources/commondefines.js b/Common/sources/commondefines.js -index 694a13a..b2b2e9b 100644 +index 694a13a..8d6d795 100644 --- a/Common/sources/commondefines.js +++ b/Common/sources/commondefines.js @@ -975,8 +975,8 @@ const c_oAscUnlockRes = { @@ -23,8 +23,8 @@ index 694a13a..b2b2e9b 100644 -const buildVersion = '4.1.2'; -const buildNumber = 37; -+const buildVersion = '6.1.0'; -+const buildNumber = 83; ++const buildVersion = '6.1.1'; ++const buildNumber = 53; exports.TaskQueueData = TaskQueueData; exports.CMailMergeSendData = CMailMergeSendData; @@ -42,7 +42,7 @@ index 2b79e02..738df37 100644 exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000; diff --git a/Common/sources/license.js b/Common/sources/license.js -index 19f0b61..30c31c4 100644 +index 19f0b61..9076c94 100644 --- a/Common/sources/license.js +++ b/Common/sources/license.js @@ -34,7 +34,7 @@ @@ -50,7 +50,7 @@ index 19f0b61..30c31c4 100644 const constants = require('./constants'); -const buildDate = '6/29/2016'; -+const buildDate = '2021-01-28T11:37:00.000Z'; ++const buildDate = '2021-01-29T10:10:00.000Z'; const oBuildDate = new Date(buildDate); exports.readLicense = function*() { From ce96de1d2b608ef0cc6cb8a9a08dcf341af64321 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Fri, 19 Mar 2021 21:41:45 +0100 Subject: [PATCH 21/38] 6.2.0.123 --- Dockerfile | 4 ++-- license.patch | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index e807761..49a8946 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ## Build stage -ARG product_version=6.1.1 -ARG build_number=53 +ARG product_version=6.2.0 +ARG build_number=123 ARG oo_root='/var/www/onlyoffice/documentserver' FROM onlyoffice/documentserver:${product_version}.${build_number} as build-stage diff --git a/license.patch b/license.patch index 661ac17..28e5e12 100644 --- a/license.patch +++ b/license.patch @@ -1,4 +1,4 @@ -From 34c308280edbb3011ce64e727f8cb522c5fd5ed7 Mon Sep 17 00:00:00 2001 +From 11b275653eb1961c7392aa1badd1a29a09bcfda0 Mon Sep 17 00:00:00 2001 From: Alexander Hofbauer Date: Sun, 27 Dec 2020 21:49:37 +0100 Subject: [PATCH] Patch for license @@ -14,17 +14,17 @@ Subject: [PATCH] Patch for license 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Common/sources/commondefines.js b/Common/sources/commondefines.js -index 694a13a..8d6d795 100644 +index 2a38911..25b8608 100644 --- a/Common/sources/commondefines.js +++ b/Common/sources/commondefines.js -@@ -975,8 +975,8 @@ const c_oAscUnlockRes = { +@@ -992,8 +992,8 @@ const c_oAscUnlockRes = { Empty: 2 }; -const buildVersion = '4.1.2'; -const buildNumber = 37; -+const buildVersion = '6.1.1'; -+const buildNumber = 53; ++const buildVersion = '6.2.0'; ++const buildNumber = 123; exports.TaskQueueData = TaskQueueData; exports.CMailMergeSendData = CMailMergeSendData; @@ -42,7 +42,7 @@ index 2b79e02..738df37 100644 exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000; diff --git a/Common/sources/license.js b/Common/sources/license.js -index 19f0b61..9076c94 100644 +index 19f0b61..fb20c21 100644 --- a/Common/sources/license.js +++ b/Common/sources/license.js @@ -34,7 +34,7 @@ @@ -50,7 +50,7 @@ index 19f0b61..9076c94 100644 const constants = require('./constants'); -const buildDate = '6/29/2016'; -+const buildDate = '2021-01-29T10:10:00.000Z'; ++const buildDate = '2021-03-01T12:10:00.000Z'; const oBuildDate = new Date(buildDate); exports.readLicense = function*() { @@ -80,7 +80,7 @@ index 19f0b61..9076c94 100644 -exports.packageType = constants.PACKAGE_TYPE_OS; +exports.packageType = constants.PACKAGE_TYPE_I; diff --git a/DocService/sources/DocsCoServer.js b/DocService/sources/DocsCoServer.js -index 471a271..5df4fe0 100644 +index bd209ea..9151489 100644 --- a/DocService/sources/DocsCoServer.js +++ b/DocService/sources/DocsCoServer.js @@ -103,6 +103,7 @@ const pubsubService = require('./pubsubRabbitMQ'); @@ -100,7 +100,7 @@ index 471a271..5df4fe0 100644 let shutdownFlag = false; const MIN_SAVE_EXPIRATION = 60000; -@@ -2969,7 +2970,7 @@ exports.install = function(server, callbackFunction) { +@@ -2976,7 +2977,7 @@ exports.install = function(server, callbackFunction) { }); }; exports.setLicenseInfo = function(data) { @@ -110,7 +110,7 @@ index 471a271..5df4fe0 100644 exports.getLicenseInfo = function() { return licenseInfo; diff --git a/DocService/sources/server.js b/DocService/sources/server.js -index db085bb..7d76d34 100644 +index b623759..29574bd 100644 --- a/DocService/sources/server.js +++ b/DocService/sources/server.js @@ -129,7 +129,6 @@ try { @@ -147,5 +147,5 @@ index 40bf93e..1df9c10 100644 build-date: $(GRUNT_FILES) sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS) -- -2.29.2 +2.30.2 From a216814c3061ce34e4f008a188f4e6239ef1fb73 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 24 Aug 2024 21:49:56 -0400 Subject: [PATCH 22/38] Initial commit --- .forgejo/workflows/release-build.yaml | 74 ++++++++++ .forgejo/workflows/test-build.yaml | 61 ++++++++ README.md | 22 +++ core_v8-no-enum-constexrp-conversion.patch | 34 +++++ disable-licensing-limits.patch | 160 +++++++++++++++++++++ 5 files changed, 351 insertions(+) create mode 100644 .forgejo/workflows/release-build.yaml create mode 100644 .forgejo/workflows/test-build.yaml create mode 100644 README.md create mode 100644 core_v8-no-enum-constexrp-conversion.patch create mode 100644 disable-licensing-limits.patch diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml new file mode 100644 index 0000000..e3c11f2 --- /dev/null +++ b/.forgejo/workflows/release-build.yaml @@ -0,0 +1,74 @@ +on: + push: + tags: + - 'v*' + +jobs: + release-build: + runs-on: x86_64 + container: + image: ubuntu:22.04 + env: + pkgver: 8.1.1 + buildno: 39 + qtver: 5.15.3 + steps: + - name: Environment setup + run: | + cat /etc/os-release + apt-get update + apt-get install -y git make g++ bzip2 sudo patch python2 curl lsb-release p7zip-full qtbase5-dev debhelper + curl -sL https://deb.nodesource.com/setup_16.x | bash - + apt-get install -y nodejs + npm install -g pkg grunt grunt-cli + - name: Getting patches + uses: actions/checkout@v4 + - name: Fetching sources + run: | + git clone https://github.com/ONLYOFFICE/DocumentServer --recursive -b v$pkgver build + git clone https://github.com/ONLYOFFICE/build_tools.git -b v$pkgver.$buildno build/build_tools + git clone https://github.com/ONLYOFFICE/document-server-integration -b v$pkgver.$buildno build/document-server-integration + git clone https://github.com/ONLYOFFICE/document-templates -b v$pkgver.$buildno build/document-templates + git clone https://github.com/ONLYOFFICE/onlyoffice.github.io build/onlyoffice.github.io + git clone https://github.com/ONLYOFFICE/document-server-package.git -b v$pkgver.$buildno build/document-server-package + - name: Applying patches + run: | + git -C build/server apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/server.patch + git -C build/web-apps apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/web-apps.patch + git -C build apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-no-enum-constexrp-conversion.patch + - name: Development setup + run: | + mkdir -p build/build_tools/system_qt-$qtver/gcc_64 + ln -s /usr/lib/x86_64-linux-gnu build/build_tools/system_qt-$qtver/gcc_64/lib + ln -s /usr/lib/x86_64-linux-gnu/qt5/bin build/build_tools/system_qt-$qtver/gcc_64/bin + ln -s /usr/lib/x86_64-linux-gnu/qt5/plugins build/build_tools/system_qt-$qtver/gcc_64/plugins + cd build/build_tools/tools/linux + python2 ./deps.py + - name: Build server + run: | + cd build/build_tools + python2 ./configure.py --update 0 --module "server" --qt-dir $(pwd)/system_qt-$qtver + python2 ./make.py + - name: Build package + run: | + cd build/document-server-package + PRODUCT_VERSION=$pkgver BUILD_NUMBER=$buildno make deb + - name: Package upload + uses: forgejo/upload-artifact@v3 + with: + name: documentserver-deb + path: build/document-server-package/deb/onlyoffice-documentserver_*.deb + release-deploy: + needs: [release-build] + runs-on: x86_64 + container: + image: alpine:latest + steps: + - name: Setting up environment + run: apk add nodejs curl + - name: Package download + uses: forgejo/download-artifact@v3 + - name: Package deployment + run: curl --user ${{ vars.FORGE_REPO_USER }}:${{ secrets.FORGE_REPO_PRIVKEY }} --upload-file */onlyoffice-documentserver_*.deb https://forge.ilot.io/api/packages/ilot/debian/pool/jammy/main/upload + + diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml new file mode 100644 index 0000000..c315e34 --- /dev/null +++ b/.forgejo/workflows/test-build.yaml @@ -0,0 +1,61 @@ +on: + pull_request: + types: [ assigned, opened, synchronize, reopened ] + +jobs: + test-build: + runs-on: x86_64 + container: + image: ubuntu:22.04 + env: + pkgver: 8.1.1 + buildno: 39 + qtver: 5.15.3 + steps: + - name: Environment setup + run: | + cat /etc/os-release + apt-get update + apt-get install -y git make g++ bzip2 sudo patch python2 curl lsb-release p7zip-full qtbase5-dev debhelper + curl -sL https://deb.nodesource.com/setup_16.x | bash - + apt-get install -y nodejs + npm install -g pkg grunt grunt-cli + - name: Getting patches + uses: actions/checkout@v4 + - name: Fetching sources + run: | + git clone https://github.com/ONLYOFFICE/DocumentServer --recursive -b v$pkgver build + git clone https://github.com/ONLYOFFICE/build_tools.git -b v$pkgver.$buildno build/build_tools + git clone https://github.com/ONLYOFFICE/document-server-integration -b v$pkgver.$buildno build/document-server-integration + git clone https://github.com/ONLYOFFICE/document-templates -b v$pkgver.$buildno build/document-templates + git clone https://github.com/ONLYOFFICE/onlyoffice.github.io build/onlyoffice.github.io + git clone https://github.com/ONLYOFFICE/document-server-package.git -b v$pkgver.$buildno build/document-server-package + - name: Applying patches + run: | + git -C build/server apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/server.patch + git -C build/web-apps apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/web-apps.patch + git -C build apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-no-enum-constexrp-conversion.patch + - name: Development setup + run: | + mkdir -p build/build_tools/system_qt-$qtver/gcc_64 + ln -s /usr/lib/x86_64-linux-gnu build/build_tools/system_qt-$qtver/gcc_64/lib + ln -s /usr/lib/x86_64-linux-gnu/qt5/bin build/build_tools/system_qt-$qtver/gcc_64/bin + ln -s /usr/lib/x86_64-linux-gnu/qt5/plugins build/build_tools/system_qt-$qtver/gcc_64/plugins + cd build/build_tools/tools/linux + python2 ./deps.py + - name: Build server + run: | + cd build/build_tools + python2 ./configure.py --update 0 --module "server" --qt-dir $(pwd)/system_qt-$qtver + python2 ./make.py + - name: Build package + run: | + cd build/document-server-package + PRODUCT_VERSION=$pkgver BUILD_NUMBER=$buildno make deb + - name: Package upload + uses: forgejo/upload-artifact@v3 + with: + name: documentserver-deb + path: build/document-server-package/deb/onlyoffice-documentserver_*.deb + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..3702f6a --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# onlyoffice-document-server +Upstream: https://forge.ilot.io/ilot/onlyoffice-document-server + +## Description + +This repository contains the necessary workflows to build onlyoffice-document-server +from source, and produce a usable Debian package. The build process also allows +introducing patches for ilot's application. + +## How to use + +Follow the instruction the guide on [OnlyOffice's docs](https://helpcenter.onlyoffice.com/installation/docs-community-install-ubuntu.aspx). +Instead of adding their repository, use ilot's by following the instructions [here](https://forge.ilot.io/ilot/-/packages/debian/onlyoffice-documentserver) + +## Support + +As these aports are built for ilot's own application, we make no guarantees that +they will work for you. + +## License +This readme, workflows and support scripts are licensed under MIT License. + diff --git a/core_v8-no-enum-constexrp-conversion.patch b/core_v8-no-enum-constexrp-conversion.patch new file mode 100644 index 0000000..da56ce3 --- /dev/null +++ b/core_v8-no-enum-constexrp-conversion.patch @@ -0,0 +1,34 @@ +diff --git a/core/Common/3dParty/v8/tools/no-enum-constexrp-conversion.patch b/core/Common/3dParty/v8/tools/no-enum-constexrp-conversion.patch +new file mode 100644 +index 0000000000..5a1a8067a6 +--- /dev/null ++++ b/core/Common/3dParty/v8/tools/no-enum-constexrp-conversion.patch +@@ -0,0 +1,14 @@ ++diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn ++index 5ea2f213..29fa7742 100644 ++--- a/build/config/compiler/BUILD.gn +++++ b/build/config/compiler/BUILD.gn ++@@ -1548,6 +1548,9 @@ config("default_warnings") { ++ # TODO(https://crbug.com/989932): Evaluate and possibly enable. ++ "-Wno-implicit-int-float-conversion", ++ +++ "-Wno-enum-constexpr-conversion", +++ +++ ++ # TODO(https://crbug.com/999886): Clean up, enable. ++ "-Wno-final-dtor-non-final-class", ++ +diff --git a/build_tools/scripts/core_common/modules/v8_89.py b/core/build_tools/core_common/modules/v8_89.py +index 9643263..35ee1fe 100644 +--- a/build_tools/scripts/core_common/modules/v8_89.py ++++ b/build_tools/scripts/core_common/modules/v8_89.py +@@ -150,6 +150,8 @@ def make(): + "use_custom_libcxx=false", + "treat_warnings_as_errors=false"] + ++ base.cmd("patch", ["-p1", "-i", "../../v8/tools/no-enum-constexrp-conversion.patch"]) ++ + if config.check_option("platform", "linux_64"): + base.cmd2("gn", ["gen", "out.gn/linux_64", make_args(gn_args, "linux")]) + base.cmd("ninja", ["-C", "out.gn/linux_64"]) + diff --git a/disable-licensing-limits.patch b/disable-licensing-limits.patch new file mode 100644 index 0000000..c38af07 --- /dev/null +++ b/disable-licensing-limits.patch @@ -0,0 +1,160 @@ +From 5ee269eef8bd02d066151deaa4d8c0fe6b6cbce4 Mon Sep 17 00:00:00 2001 +Patch-Source: https://github.com/xbeeant/onlyoffice-ce-docker-license +From: xbeeant +Date: Tue, 15 Nov 2022 01:04:46 -0500 +Subject: onlyoffice-ce-docker-license + +This patches OnlyOffice Docs server with mobile editing enabled in the +Nextcloud apps for an unlimited amount of concurrent users. + +Background: Just about two months after Nextcloud released their partnership +with Ascensio and featured a community version of OnlyOffice, the latter +decided to remove support for mobile editing of documents. This affected the +Nextcloud app, killing a feature that was previously marketed by both +companies. + +The changes were executed without any prior notice and alienated quite a lot of +home users, who would now be forced to pay more than €1.000 to unlock that +previously free feature. Only after some outcries Ascensio deigned to release a +statement and a new, albeit "limited", offer of €90 for home servers. This +offer has since expired and their licensing tier suggests current licenses are +valid for one year, starting at about €140. + +In my opinion these deceptive practices of advertising a feature only to take +it away are unacceptable for a company presenting itself and their products as +open source. + +--- + +diff --git a/server/Common/sources/constants.js b/server/Common/sources/constants.js +index 3e8e7aaa..aad4d05f 100644 +--- a/server/Common/sources/constants.js ++++ b/server/Common/sources/constants.js +@@ -85,8 +85,8 @@ exports.LICENSE_RESULT = { + NotBefore: 16 + }; + +-exports.LICENSE_CONNECTIONS = 20; +-exports.LICENSE_USERS = 3; ++exports.LICENSE_CONNECTIONS = 999999; ++exports.LICENSE_USERS = 999999; + exports.LICENSE_EXPIRE_USERS_ONE_DAY = 24 * 60 * 60; // day in seconds + + exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000; +diff --git a/server/Common/sources/license.js b/server/Common/sources/license.js +index 5df8d693..3fd9de14 100644 +--- a/server/Common/sources/license.js ++++ b/server/Common/sources/license.js +@@ -45,24 +45,24 @@ exports.readLicense = function*() { + count: 1, + type: c_LR.Success, + light: false, +- packageType: constants.PACKAGE_TYPE_OS, ++ packageType: constants.PACKAGE_TYPE_I, + mode: constants.LICENSE_MODE.None, +- branding: false, ++ branding: true, + connections: constants.LICENSE_CONNECTIONS, + connectionsView: constants.LICENSE_CONNECTIONS, +- customization: false, +- advancedApi: false, +- usersCount: 0, +- usersViewCount: 0, ++ customization: true, ++ advancedApi: true, ++ usersCount: constants.LICENSE_CONNECTIONS, ++ usersViewCount: constants.LICENSE_CONNECTIONS, + usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY, +- hasLicense: false, +- plugins: false, ++ hasLicense: true, ++ plugins: true, + buildDate: oBuildDate, + startDate: startDate, +- endDate: null, ++ endDate: new Date("2099-01-01T23:59:59.000Z"), + customerId: "", +- alias: "" ++ alias: "community" + }, null]; + }; + +-exports.packageType = constants.PACKAGE_TYPE_OS; ++exports.packageType = constants.PACKAGE_TYPE_I; +diff --git a/server/DocService/sources/server.js b/server/DocService/sources/server.js +index 76303af9..9d2e6888 100644 +--- a/server/DocService/sources/server.js ++++ b/server/DocService/sources/server.js +@@ -129,7 +129,7 @@ if (!(cfgTokenEnableBrowser && cfgTokenEnableRequestInbox && cfgTokenEnableReque + } + + updateLicense(); +-fs.watchFile(cfgLicenseFile, updateLicense); ++// fs.watchFile(cfgLicenseFile, updateLicense); + setInterval(updateLicense, 86400000); + + try { + +diff --git a/server/FileConverter/sources/convertermaster.js b/server/FileConverter/sources/convertermaster.js +index 46615032..6ce2d3e6 100644 +--- a/server/FileConverter/sources/convertermaster.js ++++ b/server/FileConverter/sources/convertermaster.js +@@ -92,7 +92,7 @@ if (cluster.isMaster) { + + updateLicense(); + +- fs.watchFile(cfgLicenseFile, updateLicense); ++ // fs.watchFile(cfgLicenseFile, updateLicense); + setInterval(updateLicense, 86400000); + } else { + const converter = require('./converter'); +diff --git a/server/Makefile b/server/Makefile +index e8e1308f..23f7e2ef 100644 +--- a/server/Makefile ++++ b/server/Makefile +@@ -87,7 +87,7 @@ DEBUG = $(BRANDING_DIR)/debug.js + .PHONY: all clean install uninstall build-date + + .NOTPARALLEL: +-all: $(SPELLCHECKER_DICTIONARIES) $(TOOLS) $(SCHEMA) $(CORE_FONTS) $(DOCUMENT_TEMPLATES) $(LICENSE) $(WELCOME) $(INFO) build-date ++all: $(SCHEMA) $(LICENSE) $(WELCOME) $(INFO) build-date + + build-date: $(GRUNT_FILES) + sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS) +diff --git a/web-apps/apps/documenteditor/mobile/src/lib/web-apps/patch.jsx b/web-apps/apps/documenteditor/mobile/src/lib/web-apps/patch.jsx +index 963aca451..1ee48e856 100644 +--- a/web-apps/apps/documenteditor/mobile/src/lib/web-apps/patch.jsx ++++ b/web-apps/apps/documenteditor/mobile/src/lib/web-apps/patch.jsx +@@ -4,7 +4,7 @@ const EditorUIController = () => { + }; + + EditorUIController.isSupportEditFeature = () => { +- return false ++ return true + }; + + EditorUIController.getToolbarOptions = () => { +diff --git a/web-apps/apps/presentationeditor/mobile/src/lib/web-apps/patch.jsx b/web-apps/apps/presentationeditor/mobile/src/lib/web-apps/patch.jsx +index ec7b37a2c..bfd879583 100644 +--- a/web-apps/apps/presentationeditor/mobile/src/lib/web-apps/patch.jsx ++++ b/web-apps/apps/presentationeditor/mobile/src/lib/web-apps/patch.jsx +@@ -1,6 +1,6 @@ + + const EditorUIController = () => null; + +-EditorUIController.isSupportEditFeature = () => false; ++EditorUIController.isSupportEditFeature = () => true; + + export default EditorUIController; +diff --git a/web-apps/apps/spreadsheeteditor/mobile/src/lib/web-apps/patch.jsx b/web-apps/apps/spreadsheeteditor/mobile/src/lib/web-apps/patch.jsx +index ec7b37a2c..bfd879583 100644 +--- a/web-apps/apps/spreadsheeteditor/mobile/src/lib/web-apps/patch.jsx ++++ b/web-apps/apps/spreadsheeteditor/mobile/src/lib/web-apps/patch.jsx +@@ -1,6 +1,6 @@ + + const EditorUIController = () => null; + +-EditorUIController.isSupportEditFeature = () => false; ++EditorUIController.isSupportEditFeature = () => true; + + export default EditorUIController; From b8ea58e005caa339e7a5ed7d77dd7cbb991481fd Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 24 Aug 2024 21:57:35 -0400 Subject: [PATCH 23/38] forgejo-ci: fix patching --- .forgejo/workflows/release-build.yaml | 3 +-- .forgejo/workflows/test-build.yaml | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index e3c11f2..597a315 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -33,9 +33,8 @@ jobs: git clone https://github.com/ONLYOFFICE/document-server-package.git -b v$pkgver.$buildno build/document-server-package - name: Applying patches run: | - git -C build/server apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/server.patch - git -C build/web-apps apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/web-apps.patch git -C build apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-no-enum-constexrp-conversion.patch + git -C build apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/disable-licensing-limits.patch - name: Development setup run: | mkdir -p build/build_tools/system_qt-$qtver/gcc_64 diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml index c315e34..fb782b8 100644 --- a/.forgejo/workflows/test-build.yaml +++ b/.forgejo/workflows/test-build.yaml @@ -32,9 +32,9 @@ jobs: git clone https://github.com/ONLYOFFICE/document-server-package.git -b v$pkgver.$buildno build/document-server-package - name: Applying patches run: | - git -C build/server apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/server.patch - git -C build/web-apps apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/web-apps.patch - git -C build apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-no-enum-constexrp-conversion.patch + cd build + git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-no-enum-constexrp-conversion.patch + git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/disable-licensing-limits.patch - name: Development setup run: | mkdir -p build/build_tools/system_qt-$qtver/gcc_64 From 67e4ae34339b976a3d0632fd313e6f68b75d3bfa Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 24 Aug 2024 22:09:52 -0400 Subject: [PATCH 24/38] forgejo-ci: cd to build before patching --- .forgejo/workflows/release-build.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 597a315..6d634a7 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -33,8 +33,9 @@ jobs: git clone https://github.com/ONLYOFFICE/document-server-package.git -b v$pkgver.$buildno build/document-server-package - name: Applying patches run: | - git -C build apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-no-enum-constexrp-conversion.patch - git -C build apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/disable-licensing-limits.patch + cd build + git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-no-enum-constexrp-conversion.patch + git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/disable-licensing-limits.patch - name: Development setup run: | mkdir -p build/build_tools/system_qt-$qtver/gcc_64 From 72bf9f201f03d1176ba429b3652747b087d715c6 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 24 Aug 2024 22:12:28 -0400 Subject: [PATCH 25/38] disable-licensing-limits: fix patch --- disable-licensing-limits.patch | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/disable-licensing-limits.patch b/disable-licensing-limits.patch index c38af07..e71c1e8 100644 --- a/disable-licensing-limits.patch +++ b/disable-licensing-limits.patch @@ -121,10 +121,10 @@ index e8e1308f..23f7e2ef 100644 build-date: $(GRUNT_FILES) sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS) -diff --git a/web-apps/apps/documenteditor/mobile/src/lib/web-apps/patch.jsx b/web-apps/apps/documenteditor/mobile/src/lib/web-apps/patch.jsx +diff --git a/web-apps/apps/documenteditor/mobile/src/lib/patch.jsx b/web-apps/apps/documenteditor/mobile/src/lib/patch.jsx index 963aca451..1ee48e856 100644 ---- a/web-apps/apps/documenteditor/mobile/src/lib/web-apps/patch.jsx -+++ b/web-apps/apps/documenteditor/mobile/src/lib/web-apps/patch.jsx +--- a/web-apps/apps/documenteditor/mobile/src/lib/patch.jsx ++++ b/web-apps/apps/documenteditor/mobile/src/lib/patch.jsx @@ -4,7 +4,7 @@ const EditorUIController = () => { }; @@ -134,10 +134,10 @@ index 963aca451..1ee48e856 100644 }; EditorUIController.getToolbarOptions = () => { -diff --git a/web-apps/apps/presentationeditor/mobile/src/lib/web-apps/patch.jsx b/web-apps/apps/presentationeditor/mobile/src/lib/web-apps/patch.jsx +diff --git a/web-apps/apps/presentationeditor/mobile/src/lib/patch.jsx b/web-apps/apps/presentationeditor/mobile/src/lib/patch.jsx index ec7b37a2c..bfd879583 100644 ---- a/web-apps/apps/presentationeditor/mobile/src/lib/web-apps/patch.jsx -+++ b/web-apps/apps/presentationeditor/mobile/src/lib/web-apps/patch.jsx +--- a/web-apps/apps/presentationeditor/mobile/src/lib/patch.jsx ++++ b/web-apps/apps/presentationeditor/mobile/src/lib/patch.jsx @@ -1,6 +1,6 @@ const EditorUIController = () => null; @@ -146,10 +146,10 @@ index ec7b37a2c..bfd879583 100644 +EditorUIController.isSupportEditFeature = () => true; export default EditorUIController; -diff --git a/web-apps/apps/spreadsheeteditor/mobile/src/lib/web-apps/patch.jsx b/web-apps/apps/spreadsheeteditor/mobile/src/lib/web-apps/patch.jsx +diff --git a/web-apps/apps/spreadsheeteditor/mobile/src/lib/patch.jsx b/web-apps/apps/spreadsheeteditor/mobile/src/lib/patch.jsx index ec7b37a2c..bfd879583 100644 ---- a/web-apps/apps/spreadsheeteditor/mobile/src/lib/web-apps/patch.jsx -+++ b/web-apps/apps/spreadsheeteditor/mobile/src/lib/web-apps/patch.jsx +--- a/web-apps/apps/spreadsheeteditor/mobile/src/lib/patch.jsx ++++ b/web-apps/apps/spreadsheeteditor/mobile/src/lib/patch.jsx @@ -1,6 +1,6 @@ const EditorUIController = () => null; From 348736e8aae4dd700c6e800d432fdf1b6c973366 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 4 Sep 2024 11:48:38 -0400 Subject: [PATCH 26/38] Upgrade to 8.1.3.3 --- .forgejo/workflows/release-build.yaml | 4 ++-- .forgejo/workflows/test-build.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 6d634a7..fd25036 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -9,8 +9,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.1.1 - buildno: 39 + pkgver: 8.1.3 + buildno: 3 qtver: 5.15.3 steps: - name: Environment setup diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml index fb782b8..bdba047 100644 --- a/.forgejo/workflows/test-build.yaml +++ b/.forgejo/workflows/test-build.yaml @@ -8,8 +8,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.1.1 - buildno: 39 + pkgver: 8.1.3 + buildno: 3 qtver: 5.15.3 steps: - name: Environment setup From f2d5250a63e7f51226a2577e618259e72a907c48 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 5 Sep 2024 10:05:16 -0400 Subject: [PATCH 27/38] Use system clang-14 --- .forgejo/workflows/release-build.yaml | 4 +-- .forgejo/workflows/test-build.yaml | 4 +-- core_v8-no-enum-constexrp-conversion.patch | 34 ---------------------- core_v8-use-system-clang.patch | 12 ++++++++ 4 files changed, 16 insertions(+), 38 deletions(-) delete mode 100644 core_v8-no-enum-constexrp-conversion.patch create mode 100644 core_v8-use-system-clang.patch diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index fd25036..1806ca0 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -17,7 +17,7 @@ jobs: run: | cat /etc/os-release apt-get update - apt-get install -y git make g++ bzip2 sudo patch python2 curl lsb-release p7zip-full qtbase5-dev debhelper + apt-get install -y git make g++ bzip2 sudo patch python2 curl lsb-release p7zip-full qtbase5-dev debhelper clang-14 lld-14 curl -sL https://deb.nodesource.com/setup_16.x | bash - apt-get install -y nodejs npm install -g pkg grunt grunt-cli @@ -34,7 +34,7 @@ jobs: - name: Applying patches run: | cd build - git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-no-enum-constexrp-conversion.patch + git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-use-system-clang.patch git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/disable-licensing-limits.patch - name: Development setup run: | diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml index bdba047..f73eb9e 100644 --- a/.forgejo/workflows/test-build.yaml +++ b/.forgejo/workflows/test-build.yaml @@ -16,7 +16,7 @@ jobs: run: | cat /etc/os-release apt-get update - apt-get install -y git make g++ bzip2 sudo patch python2 curl lsb-release p7zip-full qtbase5-dev debhelper + apt-get install -y git make g++ bzip2 sudo patch python2 curl lsb-release p7zip-full qtbase5-dev debhelper clang-14 lld-14 curl -sL https://deb.nodesource.com/setup_16.x | bash - apt-get install -y nodejs npm install -g pkg grunt grunt-cli @@ -33,7 +33,7 @@ jobs: - name: Applying patches run: | cd build - git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-no-enum-constexrp-conversion.patch + git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-use-system-clang.patch git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/disable-licensing-limits.patch - name: Development setup run: | diff --git a/core_v8-no-enum-constexrp-conversion.patch b/core_v8-no-enum-constexrp-conversion.patch deleted file mode 100644 index da56ce3..0000000 --- a/core_v8-no-enum-constexrp-conversion.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/core/Common/3dParty/v8/tools/no-enum-constexrp-conversion.patch b/core/Common/3dParty/v8/tools/no-enum-constexrp-conversion.patch -new file mode 100644 -index 0000000000..5a1a8067a6 ---- /dev/null -+++ b/core/Common/3dParty/v8/tools/no-enum-constexrp-conversion.patch -@@ -0,0 +1,14 @@ -+diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -+index 5ea2f213..29fa7742 100644 -+--- a/build/config/compiler/BUILD.gn -++++ b/build/config/compiler/BUILD.gn -+@@ -1548,6 +1548,9 @@ config("default_warnings") { -+ # TODO(https://crbug.com/989932): Evaluate and possibly enable. -+ "-Wno-implicit-int-float-conversion", -+ -++ "-Wno-enum-constexpr-conversion", -++ -++ -+ # TODO(https://crbug.com/999886): Clean up, enable. -+ "-Wno-final-dtor-non-final-class", -+ -diff --git a/build_tools/scripts/core_common/modules/v8_89.py b/core/build_tools/core_common/modules/v8_89.py -index 9643263..35ee1fe 100644 ---- a/build_tools/scripts/core_common/modules/v8_89.py -+++ b/build_tools/scripts/core_common/modules/v8_89.py -@@ -150,6 +150,8 @@ def make(): - "use_custom_libcxx=false", - "treat_warnings_as_errors=false"] - -+ base.cmd("patch", ["-p1", "-i", "../../v8/tools/no-enum-constexrp-conversion.patch"]) -+ - if config.check_option("platform", "linux_64"): - base.cmd2("gn", ["gen", "out.gn/linux_64", make_args(gn_args, "linux")]) - base.cmd("ninja", ["-C", "out.gn/linux_64"]) - diff --git a/core_v8-use-system-clang.patch b/core_v8-use-system-clang.patch new file mode 100644 index 0000000..cdbb4c9 --- /dev/null +++ b/core_v8-use-system-clang.patch @@ -0,0 +1,12 @@ +--- a/build_tools/scripts/core_common/modules/v8_89.py ++++ b/build_tools/scripts/core_common/modules/v8_89.py +@@ -48,6 +48,8 @@ def make_args(args, platform, is_64=True, is_debug=False): + + if (platform == "linux"): + args_copy.append("is_clang=true") ++ args_copy.append("clang_base_path=\\\"/usr/lib/llvm-14\\\"") ++ args_copy.append("clang_use_chrome_plugins=false") + args_copy.append("use_sysroot=false") + if (platform == "windows"): + args_copy.append("is_clang=false") + From d1939290c0de54f819742071de18ec4c9b620e67 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 17 Oct 2024 13:37:04 -0400 Subject: [PATCH 28/38] Upgrade to 8.2.0-143 --- .forgejo/workflows/release-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 1806ca0..8d97fca 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -9,8 +9,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.1.3 - buildno: 3 + pkgver: 8.2.0 + buildno: 143 qtver: 5.15.3 steps: - name: Environment setup From 882a17f0dcb0b94d84c2eeca5008125c39e4ffce Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 17 Oct 2024 15:51:27 -0400 Subject: [PATCH 29/38] Upgrade tests --- .forgejo/workflows/test-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml index f73eb9e..4bd4ce9 100644 --- a/.forgejo/workflows/test-build.yaml +++ b/.forgejo/workflows/test-build.yaml @@ -8,8 +8,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.1.3 - buildno: 3 + pkgver: 8.2.0 + buildno: 143 qtver: 5.15.3 steps: - name: Environment setup From 80736c3e77fcb2797f0f4ced4d5664321036c058 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 17 Oct 2024 19:09:39 -0400 Subject: [PATCH 30/38] Update patch --- disable-licensing-limits.patch | 134 ++++++++++++++++----------------- 1 file changed, 66 insertions(+), 68 deletions(-) diff --git a/disable-licensing-limits.patch b/disable-licensing-limits.patch index e71c1e8..1dfabf6 100644 --- a/disable-licensing-limits.patch +++ b/disable-licensing-limits.patch @@ -26,61 +26,6 @@ open source. --- -diff --git a/server/Common/sources/constants.js b/server/Common/sources/constants.js -index 3e8e7aaa..aad4d05f 100644 ---- a/server/Common/sources/constants.js -+++ b/server/Common/sources/constants.js -@@ -85,8 +85,8 @@ exports.LICENSE_RESULT = { - NotBefore: 16 - }; - --exports.LICENSE_CONNECTIONS = 20; --exports.LICENSE_USERS = 3; -+exports.LICENSE_CONNECTIONS = 999999; -+exports.LICENSE_USERS = 999999; - exports.LICENSE_EXPIRE_USERS_ONE_DAY = 24 * 60 * 60; // day in seconds - - exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000; -diff --git a/server/Common/sources/license.js b/server/Common/sources/license.js -index 5df8d693..3fd9de14 100644 ---- a/server/Common/sources/license.js -+++ b/server/Common/sources/license.js -@@ -45,24 +45,24 @@ exports.readLicense = function*() { - count: 1, - type: c_LR.Success, - light: false, -- packageType: constants.PACKAGE_TYPE_OS, -+ packageType: constants.PACKAGE_TYPE_I, - mode: constants.LICENSE_MODE.None, -- branding: false, -+ branding: true, - connections: constants.LICENSE_CONNECTIONS, - connectionsView: constants.LICENSE_CONNECTIONS, -- customization: false, -- advancedApi: false, -- usersCount: 0, -- usersViewCount: 0, -+ customization: true, -+ advancedApi: true, -+ usersCount: constants.LICENSE_CONNECTIONS, -+ usersViewCount: constants.LICENSE_CONNECTIONS, - usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY, -- hasLicense: false, -- plugins: false, -+ hasLicense: true, -+ plugins: true, - buildDate: oBuildDate, - startDate: startDate, -- endDate: null, -+ endDate: new Date("2099-01-01T23:59:59.000Z"), - customerId: "", -- alias: "" -+ alias: "community" - }, null]; - }; - --exports.packageType = constants.PACKAGE_TYPE_OS; -+exports.packageType = constants.PACKAGE_TYPE_I; diff --git a/server/DocService/sources/server.js b/server/DocService/sources/server.js index 76303af9..9d2e6888 100644 --- a/server/DocService/sources/server.js @@ -95,19 +40,6 @@ index 76303af9..9d2e6888 100644 try { -diff --git a/server/FileConverter/sources/convertermaster.js b/server/FileConverter/sources/convertermaster.js -index 46615032..6ce2d3e6 100644 ---- a/server/FileConverter/sources/convertermaster.js -+++ b/server/FileConverter/sources/convertermaster.js -@@ -92,7 +92,7 @@ if (cluster.isMaster) { - - updateLicense(); - -- fs.watchFile(cfgLicenseFile, updateLicense); -+ // fs.watchFile(cfgLicenseFile, updateLicense); - setInterval(updateLicense, 86400000); - } else { - const converter = require('./converter'); diff --git a/server/Makefile b/server/Makefile index e8e1308f..23f7e2ef 100644 --- a/server/Makefile @@ -158,3 +90,69 @@ index ec7b37a2c..bfd879583 100644 +EditorUIController.isSupportEditFeature = () => true; export default EditorUIController; +diff --git a/server/Common/sources/constants.js.orig b/server/Common/sources/constants.js +index 700696ff..d8bb9178 100644 +--- a/server/Common/sources/constants.js.orig ++++ b/server/Common/sources/constants.js +@@ -87,8 +87,8 @@ exports.LICENSE_RESULT = { + NotBefore: 16 + }; + +-exports.LICENSE_CONNECTIONS = 20; +-exports.LICENSE_USERS = 3; ++exports.LICENSE_CONNECTIONS = 999999; ++exports.LICENSE_USERS = 999999; + exports.LICENSE_EXPIRE_USERS_ONE_DAY = 24 * 60 * 60; // day in seconds + + exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000; +diff --git a/server/FileConverter/sources/convertermaster.js.orig b/server/FileConverter/sources/convertermaster.js +index 2209e8c9..feef6247 100644 +--- a/server/FileConverter/sources/convertermaster.js.orig ++++ b/server/FileConverter/sources/convertermaster.js +@@ -90,7 +90,7 @@ if (cluster.isMaster) { + + updateLicense(); + +- fs.watchFile(cfgLicenseFile, updateLicense); ++ // fs.watchFile(cfgLicenseFile, updateLicense); + setInterval(updateLicense, 86400000); + } else { + const converter = require('./converter'); +diff --git a/server/Common/sources/license.js.orig b/server/Common/sources/license.js +index 8813cbac..90177d15 100644 +--- a/server/Common/sources/license.js.orig ++++ b/server/Common/sources/license.js +@@ -44,23 +44,23 @@ exports.readLicense = async function () { + return [{ + count: 1, + type: c_LR.Success, +- packageType: constants.PACKAGE_TYPE_OS, ++ packageType: constants.PACKAGE_TYPE_I, + mode: constants.LICENSE_MODE.None, +- branding: false, ++ branding: true, + connections: constants.LICENSE_CONNECTIONS, + connectionsView: constants.LICENSE_CONNECTIONS, +- customization: false, +- advancedApi: false, +- usersCount: 0, +- usersViewCount: 0, ++ customization: true, ++ advancedApi: true, ++ usersCount: constants.LICENSE_CONNECTIONS, ++ usersViewCount: constants.LICENSE_CONNECTIONS, + usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY, +- hasLicense: false, ++ hasLicense: true, + buildDate: oBuildDate, + startDate: startDate, +- endDate: null, ++ endDate: new Date("2099-01-01T23:59:59.000Z"), + customerId: "", +- alias: "" ++ alias: "community" + }, null]; + }; + +-exports.packageType = constants.PACKAGE_TYPE_OS; ++exports.packageType = constants.PACKAGE_TYPE_I; From 78f2d77b5bd3a6f85a2c682d02d7eb63951c0793 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 17 Oct 2024 20:21:23 -0400 Subject: [PATCH 31/38] Fix patch --- disable-licensing-limits.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/disable-licensing-limits.patch b/disable-licensing-limits.patch index 1dfabf6..3f82618 100644 --- a/disable-licensing-limits.patch +++ b/disable-licensing-limits.patch @@ -90,9 +90,9 @@ index ec7b37a2c..bfd879583 100644 +EditorUIController.isSupportEditFeature = () => true; export default EditorUIController; -diff --git a/server/Common/sources/constants.js.orig b/server/Common/sources/constants.js +diff --git a/server/Common/sources/constants.js b/server/Common/sources/constants.js index 700696ff..d8bb9178 100644 ---- a/server/Common/sources/constants.js.orig +--- a/server/Common/sources/constants.js +++ b/server/Common/sources/constants.js @@ -87,8 +87,8 @@ exports.LICENSE_RESULT = { NotBefore: 16 @@ -105,9 +105,9 @@ index 700696ff..d8bb9178 100644 exports.LICENSE_EXPIRE_USERS_ONE_DAY = 24 * 60 * 60; // day in seconds exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000; -diff --git a/server/FileConverter/sources/convertermaster.js.orig b/server/FileConverter/sources/convertermaster.js +diff --git a/server/FileConverter/sources/convertermaster.js b/server/FileConverter/sources/convertermaster.js index 2209e8c9..feef6247 100644 ---- a/server/FileConverter/sources/convertermaster.js.orig +--- a/server/FileConverter/sources/convertermaster.js +++ b/server/FileConverter/sources/convertermaster.js @@ -90,7 +90,7 @@ if (cluster.isMaster) { @@ -118,9 +118,9 @@ index 2209e8c9..feef6247 100644 setInterval(updateLicense, 86400000); } else { const converter = require('./converter'); -diff --git a/server/Common/sources/license.js.orig b/server/Common/sources/license.js +diff --git a/server/Common/sources/license.js b/server/Common/sources/license.js index 8813cbac..90177d15 100644 ---- a/server/Common/sources/license.js.orig +--- a/server/Common/sources/license.js +++ b/server/Common/sources/license.js @@ -44,23 +44,23 @@ exports.readLicense = async function () { return [{ From 18b17a1e23938184651719be1034d4380dbb1b3e Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 18 Oct 2024 08:04:29 -0400 Subject: [PATCH 32/38] Use build_no 144 --- .forgejo/workflows/release-build.yaml | 2 +- .forgejo/workflows/test-build.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 8d97fca..5fa553c 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -10,7 +10,7 @@ jobs: image: ubuntu:22.04 env: pkgver: 8.2.0 - buildno: 143 + buildno: 144 qtver: 5.15.3 steps: - name: Environment setup diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml index 4bd4ce9..1c47cbc 100644 --- a/.forgejo/workflows/test-build.yaml +++ b/.forgejo/workflows/test-build.yaml @@ -9,7 +9,7 @@ jobs: image: ubuntu:22.04 env: pkgver: 8.2.0 - buildno: 143 + buildno: 144 qtver: 5.15.3 steps: - name: Environment setup From 7bf927c2c34926c2106500ed0809fb44bb876c1e Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 10 Nov 2024 00:17:48 -0500 Subject: [PATCH 33/38] Initial pkg version checker --- .forgejo/bin/check_ver.sh | 34 +++++++ .forgejo/bin/create_issue.sh | 165 +++++++++++++++++++++++++++++++ .forgejo/workflows/check-pkg.yml | 24 +++++ 3 files changed, 223 insertions(+) create mode 100755 .forgejo/bin/check_ver.sh create mode 100755 .forgejo/bin/create_issue.sh create mode 100644 .forgejo/workflows/check-pkg.yml diff --git a/.forgejo/bin/check_ver.sh b/.forgejo/bin/check_ver.sh new file mode 100755 index 0000000..ed17d5e --- /dev/null +++ b/.forgejo/bin/check_ver.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# expects the following env variables: +# downstream: downstream repo + +repo=${downstream/*\/} + +curl --silent $downstream/binary-amd64/Packages > Packages + +owned_by_you=$(awk -F ': ' '{if($1=="Package"){print $2}}' Packages | sort | uniq) + +echo "Found $(printf '%s\n' $owned_by_you | wc -l ) packages" + +rm -f out_of_date not_in_anitya + +for pkg in $owned_by_you; do + upstream_version=$(curl --fail -X GET -sS -H 'Content-Type: application/json' "https://release-monitoring.org/api/v2/packages/?name=$pkg&distribution=Debian" | jq -r '.items.[].stable_version') + downstream_version=$(sed -n "/^Package: $pkg$/,/^$/p" Packages| awk -F ': ' '{if($1=="Version"){print $2 }}' | sort -V | tail -n 1) + downstream_version=${downstream_version/-*} + + echo $upstream_version + echo $downstream_version + + if [ -z "$upstream_version" ]; then + echo "$pkg not in anitya" + echo "$pkg" >> not_in_anitya + elif [ "$downstream_version" != "$(printf '%s\n' $upstream_version $downstream_version | sort -V | head -n 1)" ]; then + echo "$pkg higher downstream" + continue + elif [ "$upstream_version" != "$downstream_version" ]; then + echo "$pkg upstream version $upstream_version does not match downstream version $downstream_version" + echo "$pkg $downstream_version $upstream_version $repo" >> out_of_date + fi +done diff --git a/.forgejo/bin/create_issue.sh b/.forgejo/bin/create_issue.sh new file mode 100755 index 0000000..d162758 --- /dev/null +++ b/.forgejo/bin/create_issue.sh @@ -0,0 +1,165 @@ +#!/bin/bash + +# expects: +# env variable FORGEJO_TOKEN +# file out_of_date + +IFS=' +' +repo=${downstream/*\/} + +does_it_exist() { + name=$1 + downstream_version=$2 + upstream_version=$3 + repo=$4 + + query="$repo/$name: upgrade to $upstream_version" + query="$(echo $query | sed 's| |%20|g' | sed 's|:|%3A|g' | sed 's|/|%2F|g' )" + + result="$(curl --silent -X 'GET' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" + )" + + if [ "$result" == "[]" ]; then + return 1 + fi +} + +is_it_old() { + name=$1 + downstream_version=$2 + upstream_version=$3 + repo=$4 + + query="$repo/$name: upgrade to" + query="$(echo $query | sed 's| |%20|g' | sed 's|:|%3A|g' | sed 's|/|%2F|g' )" + + result="$(curl --silent -X 'GET' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" + )" + + result_title="$(echo $result | jq -r '.[].title' )" + result_id="$(echo $result | jq -r '.[].number' )" + result_upstream_version="$(echo $result_title | awk '{print $4}')" + + if [ "$upstream_version" != "$result_upstream_version" ]; then + echo $result_id + else + echo 0 + fi +} + +update_title() { + name=$1 + downstream_version=$2 + upstream_version=$3 + repo=$4 + id=$5 + + result=$(curl --silent -X 'PATCH' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$id" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" \ + -H 'Content-Type: application/json' \ + -d "{ + \"title\": \"$repo/$name: upgrade to $upstream_version\" + }" + ) + + return 0 +} + +create_issue() { + name=$1 + downstream_version=$2 + upstream_version=$3 + repo=$4 + + result=$(curl --silent -X 'POST' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" \ + -H 'Content-Type: application/json' \ + -d "{ + \"title\": \"$repo/$name: upgrade to $upstream_version\", + \"labels\": [ + $LABEL_NUMBER + ] + }") + + return 0 +} + +if [ -f out_of_date ]; then + out_of_date="$(cat out_of_date)" + + echo "Detected $(wc -l out_of_date) out-of-date packages, creating issues" + + for pkg in $out_of_date; do + name="$(echo $pkg | awk '{print $1}')" + downstream_version="$(echo $pkg | awk '{print $2}')" + upstream_version="$(echo $pkg | awk '{print $3}')" + repo="$(echo $pkg | awk '{print $4}')" + + if does_it_exist $name $downstream_version $upstream_version $repo; then + echo "Issue for $repo/$name already exists" + continue + fi + + id=$(is_it_old $name $downstream_version $upstream_version $repo) + + if [ "$id" != "0" ] && [ -n "$id" ]; then + echo "Issue for $repo/$name needs updating" + update_title $name $downstream_version $upstream_version $repo $id + continue + fi + + echo "Creating issue for $repo/$name" + create_issue $name $downstream_version $upstream_version $repo + done +fi + +if [ -f not_in_anitya ]; then + query="Add missing $repo packages to anitya" + query="$(echo $query | sed 's| |%20|g')" + + result="$(curl --silent -X 'GET' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" + )" + + if [ "$result" == "[]" ]; then + echo "Creating anitya issue" + result=$(curl --silent -X 'POST' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" \ + -H 'Content-Type: application/json' \ + -d "{ + \"title\": \"Add missing $repo packages to anitya\", + \"body\": \"- [ ] $(sed '{:q;N;s/\n/\\n- [ ] /g;t q}' not_in_anitya)\", + \"labels\": [ + $LABEL_NUMBER + ] + }") + + else + echo "Updating anitya issue" + result_id="$(echo $result | jq -r '.[].number' )" + result=$(curl --silent -X 'PATCH' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$result_id" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" \ + -H 'Content-Type: application/json' \ + -d "{ + \"body\": \"- [ ] $(sed '{:q;N;s/\n/\\n- [ ] /g;t q}' not_in_anitya)\" + }" + ) + fi +fi diff --git a/.forgejo/workflows/check-pkg.yml b/.forgejo/workflows/check-pkg.yml new file mode 100644 index 0000000..b7c5778 --- /dev/null +++ b/.forgejo/workflows/check-pkg.yml @@ -0,0 +1,24 @@ +on: + workflow_dispatch: + +jobs: + check-user: + name: Check user repo + runs-on: x86_64 + container: + image: alpine:latest + env: + downstream: https://forge.ilot.io/api/packages/ilot/debian/dists/jammy/main + FORGEJO_TOKEN: ${{ secrets.forgejo_token }} + LABEL_NUMBER: 4 + steps: + - name: Environment setup + run: apk add grep coreutils gawk curl wget bash nodejs git jq sed + - name: Get scripts + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Check out-of-date packages + run: ${{ github.workspace }}/.forgejo/bin/check_ver.sh + - name: Create issues + run: ${{ github.workspace }}/.forgejo/bin/create_issue.sh From 22502496a66ba93bc1e0196ba7c325ef883d186b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 28 Nov 2024 10:58:38 -0500 Subject: [PATCH 34/38] Upgrade to 8.2.2-22 --- .forgejo/workflows/release-build.yaml | 4 ++-- .forgejo/workflows/test-build.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 5fa553c..6f59067 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -9,8 +9,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.2.0 - buildno: 144 + pkgver: 8.2.2 + buildno: 22 qtver: 5.15.3 steps: - name: Environment setup diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml index 1c47cbc..96d3280 100644 --- a/.forgejo/workflows/test-build.yaml +++ b/.forgejo/workflows/test-build.yaml @@ -8,8 +8,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.2.0 - buildno: 144 + pkgver: 8.2.2 + buildno: 22 qtver: 5.15.3 steps: - name: Environment setup From 4fa4653f8fb6f19c2492a96d669f7e6ca6f44ebb Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 15 Feb 2025 15:57:05 -0500 Subject: [PATCH 35/38] Upgrade to 8.3.0-98 --- .forgejo/workflows/release-build.yaml | 5 +++-- disable-licensing-limits.patch | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 6f59067..9e64a9d 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -9,8 +9,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.2.2 - buildno: 22 + pkgver: 8.3.0 + buildno: 98 qtver: 5.15.3 steps: - name: Environment setup @@ -18,6 +18,7 @@ jobs: cat /etc/os-release apt-get update apt-get install -y git make g++ bzip2 sudo patch python2 curl lsb-release p7zip-full qtbase5-dev debhelper clang-14 lld-14 + # node version set in build_tools/scripts/build_server variable pkg_target curl -sL https://deb.nodesource.com/setup_16.x | bash - apt-get install -y nodejs npm install -g pkg grunt grunt-cli diff --git a/disable-licensing-limits.patch b/disable-licensing-limits.patch index 3f82618..3160f0e 100644 --- a/disable-licensing-limits.patch +++ b/disable-licensing-limits.patch @@ -119,10 +119,10 @@ index 2209e8c9..feef6247 100644 } else { const converter = require('./converter'); diff --git a/server/Common/sources/license.js b/server/Common/sources/license.js -index 8813cbac..90177d15 100644 +index d43ee210..9e787b08 100644 --- a/server/Common/sources/license.js +++ b/server/Common/sources/license.js -@@ -44,23 +44,23 @@ exports.readLicense = async function () { +@@ -44,24 +44,24 @@ exports.readLicense = async function () { return [{ count: 1, type: c_LR.Success, @@ -149,8 +149,9 @@ index 8813cbac..90177d15 100644 - endDate: null, + endDate: new Date("2099-01-01T23:59:59.000Z"), customerId: "", -- alias: "" -+ alias: "community" +- alias: "", ++ alias: "community", + multitenancy: false }, null]; }; From 101f52f9ab7f1ce6e1dd7550871811dda0399f28 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 23 Mar 2025 16:26:46 -0400 Subject: [PATCH 36/38] Upgrade to 8.3.2-28 --- .forgejo/workflows/release-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 9e64a9d..32a38ba 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -9,8 +9,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.3.0 - buildno: 98 + pkgver: 8.3.2 + buildno: 28 qtver: 5.15.3 steps: - name: Environment setup From 663a763150d77ad7cd6c2abae6ea345c28f45e74 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 2 Apr 2025 15:58:01 -0400 Subject: [PATCH 37/38] Attempt to fix compilation introduced from https://github.com/ONLYOFFICE/core/commit/4f4f61bb1918e0a0a6d79827227ae5129443564f --- .forgejo/workflows/release-build.yaml | 1 + ...officefileformatchecker2-add-limits-include.patch | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 core_common-officefileformatchecker2-add-limits-include.patch diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 32a38ba..f45c087 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -37,6 +37,7 @@ jobs: cd build git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-use-system-clang.patch git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/disable-licensing-limits.patch + git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_common-officefileformatchecker2-add-limits-include.patch - name: Development setup run: | mkdir -p build/build_tools/system_qt-$qtver/gcc_64 diff --git a/core_common-officefileformatchecker2-add-limits-include.patch b/core_common-officefileformatchecker2-add-limits-include.patch new file mode 100644 index 0000000..f015968 --- /dev/null +++ b/core_common-officefileformatchecker2-add-limits-include.patch @@ -0,0 +1,12 @@ +diff --git a/core/Common/OfficeFileFormatChecker2.cpp b/core/Common/OfficeFileFormatChecker2.cpp +index d2887d78..43c28a0b 100644 +--- a/core/Common/OfficeFileFormatChecker2.cpp ++++ b/core/Common/OfficeFileFormatChecker2.cpp +@@ -44,6 +44,7 @@ + + #include "3dParty/pole/pole.h" + #include ++#include + + #include "OfficeFileFormatDefines.h" + From 007139a8a6af1122489123d0b6e0182c03dc875b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 16 Apr 2025 21:16:50 -0400 Subject: [PATCH 38/38] Upgrade to 8.3.3-21 --- .forgejo/workflows/release-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index f45c087..20da54b 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -9,8 +9,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.3.2 - buildno: 28 + pkgver: 8.3.3 + buildno: 21 qtver: 5.15.3 steps: - name: Environment setup