onlyoffice-ce-docker-license/server.patch

145 lines
5.1 KiB
Diff
Raw Normal View History

2021-07-02 08:07:53 +00:00
From 03a3990e83a94666abb5a27447fa1b67076b0e08 Mon Sep 17 00:00:00 2001
From: Alexander Hofbauer <alex@derhofbauer.at>
2021-05-21 08:54:28 +00:00
Date: Fri, 21 May 2021 10:35:05 +0200
2020-10-18 12:36:58 +00:00
Subject: [PATCH] Patch for license
---
2020-12-27 20:02:07 +00:00
Common/sources/commondefines.js | 4 ++--
Common/sources/constants.js | 2 +-
Common/sources/license.js | 16 ++++++++--------
2021-07-02 08:07:53 +00:00
DocService/sources/DocsCoServer.js | 4 ++--
2020-10-18 12:36:58 +00:00
DocService/sources/server.js | 1 -
FileConverter/sources/convertermaster.js | 1 -
Makefile | 2 +-
2021-07-02 08:07:53 +00:00
7 files changed, 14 insertions(+), 16 deletions(-)
2020-04-17 21:03:53 +00:00
diff --git a/Common/sources/commondefines.js b/Common/sources/commondefines.js
2021-07-02 08:07:53 +00:00
index ec6a870..d1f21c2 100644
2020-04-17 21:03:53 +00:00
--- a/Common/sources/commondefines.js
+++ b/Common/sources/commondefines.js
2021-05-21 08:54:28 +00:00
@@ -1035,8 +1035,8 @@ const c_oAscUnlockRes = {
2020-08-03 09:52:17 +00:00
Empty: 2
2020-04-17 21:03:53 +00:00
};
-const buildVersion = '4.1.2';
-const buildNumber = 37;
2021-07-02 08:07:53 +00:00
+const buildVersion = '6.3.1';
+const buildNumber = 32;
2020-04-17 21:03:53 +00:00
exports.TaskQueueData = TaskQueueData;
exports.CMailMergeSendData = CMailMergeSendData;
2020-12-27 20:02:07 +00:00
diff --git a/Common/sources/constants.js b/Common/sources/constants.js
2021-05-21 08:54:28 +00:00
index f976ed9..e5b91fd 100644
2020-12-27 20:02:07 +00:00
--- 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;
2020-04-17 21:03:53 +00:00
diff --git a/Common/sources/license.js b/Common/sources/license.js
2021-07-02 08:07:53 +00:00
index ea257bd..5aefbf1 100644
2020-04-17 21:03:53 +00:00
--- a/Common/sources/license.js
+++ b/Common/sources/license.js
2020-12-27 20:02:07 +00:00
@@ -34,7 +34,7 @@
2020-04-17 21:03:53 +00:00
2020-12-27 20:02:07 +00:00
const constants = require('./constants');
2020-10-18 12:36:58 +00:00
-const buildDate = '6/29/2016';
2021-07-02 08:07:53 +00:00
+const buildDate = '2021-06-06T14:34:00.000Z';
2020-12-27 20:02:07 +00:00
const oBuildDate = new Date(buildDate);
2020-04-17 21:03:53 +00:00
exports.readLicense = function*() {
2021-07-02 08:07:53 +00:00
@@ -43,18 +43,18 @@ exports.readLicense = function*() {
2020-12-27 20:02:07 +00:00
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,
2020-10-18 12:36:58 +00:00
- customization: false,
2020-12-27 20:02:07 +00:00
+ customization: true,
usersCount: 0,
2020-04-17 21:03:53 +00:00
- usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY,
- hasLicense: false,
- plugins: false,
2020-12-27 20:02:07 +00:00
+ usersExpire: new Date("2099-01-01T23:59:59.000Z").getTime() / 1000,
+ hasLicense: true,
+ plugins: true,
buildDate: oBuildDate,
- endDate: null
2020-12-27 20:02:07 +00:00
+ endDate: "2099-01-01T23:59:59.000Z"
};
2020-04-17 21:03:53 +00:00
};
2021-07-02 08:07:53 +00:00
2020-12-27 20:02:07 +00:00
-exports.packageType = constants.PACKAGE_TYPE_OS;
2020-04-17 21:03:53 +00:00
+exports.packageType = constants.PACKAGE_TYPE_I;
2020-10-18 12:36:58 +00:00
diff --git a/DocService/sources/DocsCoServer.js b/DocService/sources/DocsCoServer.js
2021-07-02 08:07:53 +00:00
index 0365510..ee25b0c 100644
2020-10-18 12:36:58 +00:00
--- a/DocService/sources/DocsCoServer.js
+++ b/DocService/sources/DocsCoServer.js
2021-07-02 08:07:53 +00:00
@@ -163,7 +163,7 @@ let connections = []; // Активные соединения
2020-10-18 12:36:58 +00:00
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};
2020-12-27 20:02:07 +00:00
+let licenseInfo = license.readLicense().next().value;
2020-10-18 12:36:58 +00:00
let shutdownFlag = false;
2021-05-21 08:54:28 +00:00
let expDocumentsStep = gc.getCronStep(cfgExpDocumentsCron);
2020-10-18 12:36:58 +00:00
2021-07-02 08:07:53 +00:00
@@ -3094,7 +3094,7 @@ exports.install = function(server, callbackFunction) {
2020-10-18 12:36:58 +00:00
});
};
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
2021-03-19 20:41:45 +00:00
index b623759..29574bd 100644
2020-10-18 12:36:58 +00:00
--- 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');
2020-04-17 21:03:53 +00:00
diff --git a/Makefile b/Makefile
2020-10-18 12:36:58 +00:00
index 40bf93e..1df9c10 100644
2020-04-17 21:03:53 +00:00
--- a/Makefile
+++ b/Makefile
@@ -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
2020-10-18 12:36:58 +00:00
+all: $(SCHEMA) $(LICENSE) $(WELCOME) $(INFO) build-date
2020-04-17 21:03:53 +00:00
build-date: $(GRUNT_FILES)
sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS)
--
2021-05-21 08:54:28 +00:00
2.31.1