From 3a0962e5fef35f4a36d6302dde569967488d002a Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Thu, 21 Sep 2023 16:58:34 +0300 Subject: [PATCH 01/17] [bug] Fix bug with request-filtering-agent config; Fix bug 64259 --- Common/sources/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/sources/utils.js b/Common/sources/utils.js index 29303716..7a5f2b81 100644 --- a/Common/sources/utils.js +++ b/Common/sources/utils.js @@ -310,8 +310,8 @@ function downloadUrlPromiseWithoutRedirect(ctx, uri, optTimeout, optLimit, opt_A let options = config.util.extendDeep({}, tenTenantRequestDefaults); Object.assign(options, {uri: urlParsed, encoding: null, timeout: connectionAndInactivity, followRedirect: false}); if (opt_filterPrivate) { - const options = Object.assign({}, https.globalAgent.options, tenRequesFilteringAgent); - options.agent = getRequestFilterAgent(uri, options); + const agentOptions = Object.assign({}, https.globalAgent.options, tenRequesFilteringAgent); + options.agent = getRequestFilterAgent(uri, agentOptions); } else { //baseRequest creates new agent(win-ca injects in globalAgent) options.agentOptions = https.globalAgent.options; From 92d514946a6b8cc8e01207653fd5f8c153097d04 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Thu, 21 Sep 2023 17:23:50 +0300 Subject: [PATCH 02/17] [bug] Allow trial period for timelimited tenant license; Fix bug 64231; --- Common/sources/tenantManager.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Common/sources/tenantManager.js b/Common/sources/tenantManager.js index aebbed9c..d876cf3c 100644 --- a/Common/sources/tenantManager.js +++ b/Common/sources/tenantManager.js @@ -356,7 +356,17 @@ async function readLicenseTenant(ctx, licenseFile, baseVerifiedLicense) { res.type = c_LR.NotBefore; ctx.logger.warn('License: License not active before start_date:%s.', startDate.toISOString()); } else if (timeLimited) { - res.type = c_LR.ExpiredLimited; + // 30 days after end license = limited mode with 20 Connections + if (endDate.setDate(checkDate.getDate() + 30) >= checkDate) { + res.type = c_LR.SuccessLimit; + res.connections = constants.LICENSE_CONNECTIONS; + res.connectionsView = res.connectionsView ? constants.LICENSE_CONNECTIONS : 0; + ctx.logger.error('License: License needs to be renewed.\nYour users have only 20 concurrent ' + + 'connections available for document editing for the next 30 days.\nPlease renew the ' + + 'license to restore the full access'); + } else { + res.type = c_LR.ExpiredLimited; + } } else if (0 !== (res.mode & c_LM.Trial)) { res.type = c_LR.ExpiredTrial; } else { From 5977f643e8637970e266a6311df53a5b18e4eefb Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Mon, 25 Sep 2023 17:29:09 +0300 Subject: [PATCH 03/17] [bug] Fix image upload in pdf editor; Fix bug 64240 --- DocService/sources/fileuploaderservice.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DocService/sources/fileuploaderservice.js b/DocService/sources/fileuploaderservice.js index 11b6d9f1..7081c468 100644 --- a/DocService/sources/fileuploaderservice.js +++ b/DocService/sources/fileuploaderservice.js @@ -101,7 +101,8 @@ function checkJwtUploadTransformRes(ctx, errorName, checkJwtRes){ if (checkJwtRes.decoded) { var doc = checkJwtRes.decoded.document; var edit = checkJwtRes.decoded.editorConfig; - if (!edit.ds_view && !edit.ds_isCloseCoAuthoring) { + //todo check view and pdf editor (temporary fix) + if (!edit.ds_isCloseCoAuthoring) { res.err = false; res.docId = doc.key; res.encrypted = doc.ds_encrypted; From 7c768c8f4359f1db55b752ebfaf57e9ca64abfa2 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Wed, 27 Sep 2023 12:09:34 +0300 Subject: [PATCH 04/17] [bug] Fix crash with timeLimited=false license; Fix bug 64367 --- Common/sources/tenantManager.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Common/sources/tenantManager.js b/Common/sources/tenantManager.js index d876cf3c..8858a3cb 100644 --- a/Common/sources/tenantManager.js +++ b/Common/sources/tenantManager.js @@ -42,7 +42,6 @@ const utils = require('./../../Common/sources/utils'); const { readFile } = require('fs/promises'); const path = require('path'); -const oPackageType = config.get('license.packageType'); const cfgTenantsBaseDomain = config.get('tenants.baseDomain'); const cfgTenantsBaseDir = config.get('tenants.baseDir'); const cfgTenantsFilenameSecret = config.get('tenants.filenameSecret'); @@ -344,7 +343,7 @@ async function readLicenseTenant(ctx, licenseFile, baseVerifiedLicense) { const timeLimited = 0 !== (res.mode & c_LM.Limited); - const checkDate = ((res.mode & c_LM.Trial) || timeLimited) ? new Date() : oBuildDate; + const checkDate = ((res.mode & c_LM.Trial) || timeLimited) ? new Date() : licenseInfo.buildDate; //Calendar check of start_date allows to issue a license for old versions const checkStartDate = new Date(); if (startDate <= checkStartDate && checkDate <= endDate && (!oLicense.hasOwnProperty('version') || 2 <= oLicense['version'])) { @@ -399,7 +398,7 @@ async function readLicenseTenant(ctx, licenseFile, baseVerifiedLicense) { } return [res, oLicense]; -}; +} exports.getDefautTenant = getDefautTenant; exports.getTenantByConnection = getTenantByConnection; From 68ac6ec1614f1bb558279f2f97d9119f808595ce Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Fri, 29 Sep 2023 11:40:20 +0300 Subject: [PATCH 05/17] [bug] Rotate image while uploading in case of exif orientation flag; For bug 46717 --- DocService/npm-shrinkwrap.json | 354 ++++++++++++++++++++++ DocService/package.json | 1 + DocService/sources/canvasservice.js | 8 + DocService/sources/fileuploaderservice.js | 9 + 4 files changed, 372 insertions(+) diff --git a/DocService/npm-shrinkwrap.json b/DocService/npm-shrinkwrap.json index f154a8a8..7808f1e8 100644 --- a/DocService/npm-shrinkwrap.json +++ b/DocService/npm-shrinkwrap.json @@ -248,11 +248,21 @@ "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" }, + "b4a": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", + "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==" + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, "base64-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/base64-stream/-/base64-stream-1.0.0.tgz", @@ -263,6 +273,33 @@ "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==" }, + "bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "body-parser": { "version": "1.20.1", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", @@ -337,6 +374,15 @@ "balanced-match": "^1.0.0" } }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", @@ -407,6 +453,11 @@ "supports-color": "^7.1.0" } }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, "cluster-key-slot": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", @@ -417,6 +468,15 @@ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" }, + "color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "requires": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + } + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -430,6 +490,15 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -521,11 +590,24 @@ } } }, + "decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "requires": { + "mimic-response": "^3.1.0" + } + }, "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + }, "denque": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/denque/-/denque-2.0.1.tgz", @@ -541,6 +623,11 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, + "detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==" + }, "dicer": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz", @@ -623,6 +710,14 @@ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, "engine.io": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.1.tgz", @@ -680,6 +775,11 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, + "expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" + }, "express": { "version": "4.18.2", "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", @@ -809,6 +909,11 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, + "fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==" + }, "fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", @@ -874,6 +979,11 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -902,6 +1012,11 @@ "has-symbols": "^1.0.3" } }, + "github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -967,11 +1082,21 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, "ioredis": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.1.tgz", @@ -1021,6 +1146,11 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", @@ -1192,6 +1322,11 @@ } } }, + "mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==" + }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1224,6 +1359,11 @@ "minimist": "^1.2.5" } }, + "mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, "moment": { "version": "2.29.4", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", @@ -1341,11 +1481,39 @@ } } }, + "napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + }, "negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, + "node-abi": { + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz", + "integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==", + "requires": { + "semver": "^7.3.5" + }, + "dependencies": { + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "node-addon-api": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==" + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -1364,6 +1532,14 @@ "ee-first": "1.1.1" } }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, "packet-reader": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", @@ -1461,6 +1637,38 @@ "xtend": "^4.0.0" } }, + "prebuild-install": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "requires": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "dependencies": { + "tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "requires": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + } + } + }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", @@ -1480,6 +1688,15 @@ "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -1493,6 +1710,11 @@ "side-channel": "^1.0.4" } }, + "queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==" + }, "random-bytes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", @@ -1521,6 +1743,17 @@ } } }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, "readable-stream": { "version": "2.3.6", "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", @@ -1659,6 +1892,31 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" }, + "sharp": { + "version": "0.32.6", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz", + "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==", + "requires": { + "color": "^4.2.3", + "detect-libc": "^2.0.2", + "node-addon-api": "^6.1.0", + "prebuild-install": "^7.1.1", + "semver": "^7.5.4", + "simple-get": "^4.0.1", + "tar-fs": "^3.0.4", + "tunnel-agent": "^0.6.0" + }, + "dependencies": { + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, "side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -1669,6 +1927,29 @@ "object-inspect": "^1.9.0" } }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==" + }, + "simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "requires": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "requires": { + "is-arrayish": "^0.3.1" + } + }, "snappy": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/snappy/-/snappy-7.2.2.tgz", @@ -1775,6 +2056,15 @@ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" }, + "streamx": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.1.tgz", + "integrity": "sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==", + "requires": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -1783,6 +2073,11 @@ "safe-buffer": "~5.1.0" } }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==" + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -1791,11 +2086,65 @@ "has-flag": "^4.0.0" } }, + "tar-fs": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", + "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", + "requires": { + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "dependencies": { + "tar-stream": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", + "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", + "requires": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + } + } + }, + "tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "requires": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "toidentifier": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "type-is": { "version": "1.6.16", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", @@ -1864,6 +2213,11 @@ "resolved": "https://registry.npmjs.org/windows-locale/-/windows-locale-1.0.1.tgz", "integrity": "sha512-X8B22Cg9njwV4h3C5j28xmZ2eWaO69j63WhReeglB69LOT3LoqSO4Vb6TTVSfFikh4KQ9qBOJb6+WvR4tVLTfQ==" }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, "ws": { "version": "8.11.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", diff --git a/DocService/package.json b/DocService/package.json index 13b5bb98..dbb58518 100644 --- a/DocService/package.json +++ b/DocService/package.json @@ -36,6 +36,7 @@ "pg": "8.8.0", "redis": "4.6.5", "retry": "0.12.0", + "sharp": "0.32.6", "socket.io": "4.7.1", "underscore": "1.13.1", "utf7": "1.0.2", diff --git a/DocService/sources/canvasservice.js b/DocService/sources/canvasservice.js index 7c956309..db506e77 100644 --- a/DocService/sources/canvasservice.js +++ b/DocService/sources/canvasservice.js @@ -52,6 +52,7 @@ var statsDClient = require('./../../Common/sources/statsdclient'); var operationContext = require('./../../Common/sources/operationContext'); var tenantManager = require('./../../Common/sources/tenantManager'); var config = require('config'); +const sharp = require("sharp"); const cfgTypesUpload = config.get('services.CoAuthoring.utils.limits_image_types_upload'); const cfgImageSize = config.get('services.CoAuthoring.server.limits_image_size'); @@ -725,6 +726,13 @@ function* commandImgurls(ctx, conn, cmd, outputData) { const filterPrivate = !authorizations[i] || !tenAllowPrivateIPAddressForSignedRequests; let getRes = yield utils.downloadUrlPromise(ctx, urlSource, tenImageDownloadTimeout, tenImageSize, authorizations[i], filterPrivate); data = getRes.body; + //fix exif rotation + //todo move to commons + let sharpTransform = sharp(data); + let metadata = yield sharpTransform.metadata(); + if (undefined !== metadata.orientation && metadata.orientation > 1) { + data = yield sharpTransform.rotate().toBuffer(); + } urlParsed = urlModule.parse(urlSource); } catch (e) { data = undefined; diff --git a/DocService/sources/fileuploaderservice.js b/DocService/sources/fileuploaderservice.js index 7081c468..524a617f 100644 --- a/DocService/sources/fileuploaderservice.js +++ b/DocService/sources/fileuploaderservice.js @@ -45,6 +45,7 @@ const commonDefines = require('./../../Common/sources/commondefines'); const operationContext = require('./../../Common/sources/operationContext'); var config = require('config'); +const sharp = require("sharp"); const cfgImageSize = config.get('services.CoAuthoring.server.limits_image_size'); const cfgTypesUpload = config.get('services.CoAuthoring.utils.limits_image_types_upload'); @@ -256,6 +257,14 @@ exports.uploadImageFile = function(req, res) { var strImageName = crypto.randomBytes(16).toString("hex"); var strPathRel = 'media/' + strImageName + '.' + formatStr; var strPath = docId + '/' + strPathRel; + //fix exif rotation + //todo move to commons + let sharpTransform = sharp(buffer); + let metadata = yield sharpTransform.metadata(); + if (undefined !== metadata.orientation && metadata.orientation > 1) { + buffer = yield sharpTransform.rotate().toBuffer(); + } + yield storageBase.putObject(ctx, strPath, buffer, buffer.length); output[strPathRel] = yield storageBase.getSignedUrl(ctx, utils.getBaseUrlByRequest(ctx, req), strPath, commonDefines.c_oAscUrlTypes.Session); From 461f46cfd47f93ed55c0791eb31dfa941a0e6dfe Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Sun, 1 Oct 2023 22:50:31 +0300 Subject: [PATCH 06/17] Revert "[bug] Rotate image while uploading in case of exif orientation flag; For bug 46717" This reverts commit 68ac6ec1614f1bb558279f2f97d9119f808595ce. --- DocService/npm-shrinkwrap.json | 354 ---------------------- DocService/package.json | 1 - DocService/sources/canvasservice.js | 16 +- DocService/sources/fileuploaderservice.js | 17 +- 4 files changed, 16 insertions(+), 372 deletions(-) diff --git a/DocService/npm-shrinkwrap.json b/DocService/npm-shrinkwrap.json index 7808f1e8..f154a8a8 100644 --- a/DocService/npm-shrinkwrap.json +++ b/DocService/npm-shrinkwrap.json @@ -248,21 +248,11 @@ "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" }, - "b4a": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", - "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==" - }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, "base64-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/base64-stream/-/base64-stream-1.0.0.tgz", @@ -273,33 +263,6 @@ "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==" }, - "bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "requires": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - }, - "dependencies": { - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, "body-parser": { "version": "1.20.1", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", @@ -374,15 +337,6 @@ "balanced-match": "^1.0.0" } }, - "buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, "buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", @@ -453,11 +407,6 @@ "supports-color": "^7.1.0" } }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, "cluster-key-slot": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", @@ -468,15 +417,6 @@ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" }, - "color": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", - "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", - "requires": { - "color-convert": "^2.0.1", - "color-string": "^1.9.0" - } - }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -490,15 +430,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "color-string": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", - "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", - "requires": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -590,24 +521,11 @@ } } }, - "decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "requires": { - "mimic-response": "^3.1.0" - } - }, "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" - }, "denque": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/denque/-/denque-2.0.1.tgz", @@ -623,11 +541,6 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, - "detect-libc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==" - }, "dicer": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz", @@ -710,14 +623,6 @@ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "requires": { - "once": "^1.4.0" - } - }, "engine.io": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.1.tgz", @@ -775,11 +680,6 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, - "expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" - }, "express": { "version": "4.18.2", "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", @@ -909,11 +809,6 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, - "fast-fifo": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", - "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==" - }, "fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", @@ -979,11 +874,6 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -1012,11 +902,6 @@ "has-symbols": "^1.0.3" } }, - "github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1082,21 +967,11 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, "ioredis": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.1.tgz", @@ -1146,11 +1021,6 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, - "is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" - }, "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", @@ -1322,11 +1192,6 @@ } } }, - "mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==" - }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1359,11 +1224,6 @@ "minimist": "^1.2.5" } }, - "mkdirp-classic": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" - }, "moment": { "version": "2.29.4", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", @@ -1481,39 +1341,11 @@ } } }, - "napi-build-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", - "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" - }, "negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, - "node-abi": { - "version": "3.47.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz", - "integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==", - "requires": { - "semver": "^7.3.5" - }, - "dependencies": { - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, - "node-addon-api": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", - "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==" - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -1532,14 +1364,6 @@ "ee-first": "1.1.1" } }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "requires": { - "wrappy": "1" - } - }, "packet-reader": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", @@ -1637,38 +1461,6 @@ "xtend": "^4.0.0" } }, - "prebuild-install": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", - "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", - "requires": { - "detect-libc": "^2.0.0", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^3.3.0", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^4.0.0", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "dependencies": { - "tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", - "requires": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - } - } - }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", @@ -1688,15 +1480,6 @@ "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -1710,11 +1493,6 @@ "side-channel": "^1.0.4" } }, - "queue-tick": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", - "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==" - }, "random-bytes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", @@ -1743,17 +1521,6 @@ } } }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, "readable-stream": { "version": "2.3.6", "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", @@ -1892,31 +1659,6 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" }, - "sharp": { - "version": "0.32.6", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz", - "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==", - "requires": { - "color": "^4.2.3", - "detect-libc": "^2.0.2", - "node-addon-api": "^6.1.0", - "prebuild-install": "^7.1.1", - "semver": "^7.5.4", - "simple-get": "^4.0.1", - "tar-fs": "^3.0.4", - "tunnel-agent": "^0.6.0" - }, - "dependencies": { - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, "side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -1927,29 +1669,6 @@ "object-inspect": "^1.9.0" } }, - "simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==" - }, - "simple-get": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", - "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", - "requires": { - "decompress-response": "^6.0.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "requires": { - "is-arrayish": "^0.3.1" - } - }, "snappy": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/snappy/-/snappy-7.2.2.tgz", @@ -2056,15 +1775,6 @@ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" }, - "streamx": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.1.tgz", - "integrity": "sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==", - "requires": { - "fast-fifo": "^1.1.0", - "queue-tick": "^1.0.1" - } - }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -2073,11 +1783,6 @@ "safe-buffer": "~5.1.0" } }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==" - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2086,65 +1791,11 @@ "has-flag": "^4.0.0" } }, - "tar-fs": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", - "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", - "requires": { - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^3.1.5" - }, - "dependencies": { - "tar-stream": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", - "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", - "requires": { - "b4a": "^1.6.4", - "fast-fifo": "^1.2.0", - "streamx": "^2.15.0" - } - } - } - }, - "tar-stream": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "requires": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, "toidentifier": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, "type-is": { "version": "1.6.16", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", @@ -2213,11 +1864,6 @@ "resolved": "https://registry.npmjs.org/windows-locale/-/windows-locale-1.0.1.tgz", "integrity": "sha512-X8B22Cg9njwV4h3C5j28xmZ2eWaO69j63WhReeglB69LOT3LoqSO4Vb6TTVSfFikh4KQ9qBOJb6+WvR4tVLTfQ==" }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, "ws": { "version": "8.11.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", diff --git a/DocService/package.json b/DocService/package.json index dbb58518..13b5bb98 100644 --- a/DocService/package.json +++ b/DocService/package.json @@ -36,7 +36,6 @@ "pg": "8.8.0", "redis": "4.6.5", "retry": "0.12.0", - "sharp": "0.32.6", "socket.io": "4.7.1", "underscore": "1.13.1", "utf7": "1.0.2", diff --git a/DocService/sources/canvasservice.js b/DocService/sources/canvasservice.js index db506e77..6bb0015a 100644 --- a/DocService/sources/canvasservice.js +++ b/DocService/sources/canvasservice.js @@ -52,7 +52,7 @@ var statsDClient = require('./../../Common/sources/statsdclient'); var operationContext = require('./../../Common/sources/operationContext'); var tenantManager = require('./../../Common/sources/tenantManager'); var config = require('config'); -const sharp = require("sharp"); +//const sharp = require("sharp"); const cfgTypesUpload = config.get('services.CoAuthoring.utils.limits_image_types_upload'); const cfgImageSize = config.get('services.CoAuthoring.server.limits_image_size'); @@ -726,13 +726,13 @@ function* commandImgurls(ctx, conn, cmd, outputData) { const filterPrivate = !authorizations[i] || !tenAllowPrivateIPAddressForSignedRequests; let getRes = yield utils.downloadUrlPromise(ctx, urlSource, tenImageDownloadTimeout, tenImageSize, authorizations[i], filterPrivate); data = getRes.body; - //fix exif rotation - //todo move to commons - let sharpTransform = sharp(data); - let metadata = yield sharpTransform.metadata(); - if (undefined !== metadata.orientation && metadata.orientation > 1) { - data = yield sharpTransform.rotate().toBuffer(); - } + // //fix exif rotation + // //todo move to commons + // let sharpTransform = sharp(data); + // let metadata = yield sharpTransform.metadata(); + // if (undefined !== metadata.orientation && metadata.orientation > 1) { + // data = yield sharpTransform.rotate().toBuffer(); + // } urlParsed = urlModule.parse(urlSource); } catch (e) { data = undefined; diff --git a/DocService/sources/fileuploaderservice.js b/DocService/sources/fileuploaderservice.js index 524a617f..e0dc348b 100644 --- a/DocService/sources/fileuploaderservice.js +++ b/DocService/sources/fileuploaderservice.js @@ -43,9 +43,8 @@ var storageBase = require('./../../Common/sources/storage-base'); var formatChecker = require('./../../Common/sources/formatchecker'); const commonDefines = require('./../../Common/sources/commondefines'); const operationContext = require('./../../Common/sources/operationContext'); - +//const sharp = require("sharp"); var config = require('config'); -const sharp = require("sharp"); const cfgImageSize = config.get('services.CoAuthoring.server.limits_image_size'); const cfgTypesUpload = config.get('services.CoAuthoring.utils.limits_image_types_upload'); @@ -257,13 +256,13 @@ exports.uploadImageFile = function(req, res) { var strImageName = crypto.randomBytes(16).toString("hex"); var strPathRel = 'media/' + strImageName + '.' + formatStr; var strPath = docId + '/' + strPathRel; - //fix exif rotation - //todo move to commons - let sharpTransform = sharp(buffer); - let metadata = yield sharpTransform.metadata(); - if (undefined !== metadata.orientation && metadata.orientation > 1) { - buffer = yield sharpTransform.rotate().toBuffer(); - } + // //fix exif rotation + // //todo move to commons + // let sharpTransform = sharp(buffer); + // let metadata = yield sharpTransform.metadata(); + // if (undefined !== metadata.orientation && metadata.orientation > 1) { + // buffer = yield sharpTransform.rotate().toBuffer(); + // } yield storageBase.putObject(ctx, strPath, buffer, buffer.length); output[strPathRel] = yield storageBase.getSignedUrl(ctx, utils.getBaseUrlByRequest(ctx, req), strPath, From 634737f96528cfdac6acfcaf24ae8da0755e3454 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Mon, 2 Oct 2023 23:38:51 +0300 Subject: [PATCH 07/17] [bug] Add LICENSE_USERS for expired timelimited licenses; For bug 64231 --- Common/sources/constants.js | 1 + Common/sources/tenantManager.js | 11 +++++++---- branding/info/index.html | 16 +++++++++++++--- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Common/sources/constants.js b/Common/sources/constants.js index 6354a46c..3e8e7aaa 100644 --- a/Common/sources/constants.js +++ b/Common/sources/constants.js @@ -86,6 +86,7 @@ exports.LICENSE_RESULT = { }; exports.LICENSE_CONNECTIONS = 20; +exports.LICENSE_USERS = 3; exports.LICENSE_EXPIRE_USERS_ONE_DAY = 24 * 60 * 60; // day in seconds exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000; diff --git a/Common/sources/tenantManager.js b/Common/sources/tenantManager.js index 8858a3cb..c8bf0da7 100644 --- a/Common/sources/tenantManager.js +++ b/Common/sources/tenantManager.js @@ -358,10 +358,13 @@ async function readLicenseTenant(ctx, licenseFile, baseVerifiedLicense) { // 30 days after end license = limited mode with 20 Connections if (endDate.setDate(checkDate.getDate() + 30) >= checkDate) { res.type = c_LR.SuccessLimit; - res.connections = constants.LICENSE_CONNECTIONS; - res.connectionsView = res.connectionsView ? constants.LICENSE_CONNECTIONS : 0; - ctx.logger.error('License: License needs to be renewed.\nYour users have only 20 concurrent ' + - 'connections available for document editing for the next 30 days.\nPlease renew the ' + + res.connections = Math.min(res.connections, constants.LICENSE_CONNECTIONS); + res.connectionsView = Math.min(res.connectionsView, constants.LICENSE_CONNECTIONS); + res.usersCount = Math.min(res.usersCount, constants.LICENSE_USERS); + res.usersViewCount = Math.min(res.usersViewCount, constants.LICENSE_USERS); + let errStr = res.usersCount ? `${res.usersCount} unique users` : `${res.connections} concurrent connections`; + ctx.logger.error(`License: License needs to be renewed.\nYour users have only ${errStr} ` + + `available for document editing for the next 30 days.\nPlease renew the ` + 'license to restore the full access'); } else { res.type = c_LR.ExpiredLimited; diff --git a/branding/info/index.html b/branding/info/index.html index f781ff67..b5841cc7 100644 --- a/branding/info/index.html +++ b/branding/info/index.html @@ -290,14 +290,24 @@ elem = document.getElementById('build-version'); elem.innerText = 'Version: ' + serverInfo.buildVersion + '.' + serverInfo.buildNumber; + let limitText, limitEdit, limitView; + if (licenseInfo.usersCount > 0) { + limitText = 'Users limit'; + limitEdit = licenseInfo.usersCount; + limitView = licenseInfo.usersViewCount; + } else { + limitText = 'Connections limit'; + limitEdit = licenseInfo.connections; + limitView = licenseInfo.connectionsView; + } elem = document.getElementById('limit-type'); - elem.innerText = (licenseInfo.usersCount>0) ? 'Users limit' : 'Connections limit' ; + elem.innerText = limitText; elem = document.getElementById('lic-limit-edit'); - elem.innerText = 'Editors: ' + (licenseInfo.usersCount || licenseInfo.connections); + elem.innerText = 'Editors: ' + limitEdit; elem = document.getElementById('lic-limit-view'); - elem.innerText = 'Live Viewer: ' + (licenseInfo.usersViewCount || licenseInfo.connectionsView); + elem.innerText = 'Live Viewer: ' + limitView; if (licenseInfo.endDate===null) { elem = document.getElementById('lic-valid-type'); From 6fca64104332bb2ec0b11b8c8a78428e5bb31e90 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Thu, 5 Oct 2023 23:00:17 +0300 Subject: [PATCH 08/17] [bug] Fix bug 64492 --- DocService/sources/DocsCoServer.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DocService/sources/DocsCoServer.js b/DocService/sources/DocsCoServer.js index 85de3e52..d6a77358 100644 --- a/DocService/sources/DocsCoServer.js +++ b/DocService/sources/DocsCoServer.js @@ -3782,10 +3782,10 @@ exports.install = function(server, callbackFunction) { } yield addPresence(ctx, conn, false); if (utils.isLiveViewer(conn)) { - countViewByShard++; + countLiveViewByShard++; tenant.countLiveViewByShard++; } else if(conn.isCloseCoAuthoring || (conn.user && conn.user.view)) { - countLiveViewByShard++; + countViewByShard++; tenant.countViewByShard++; } else { countEditByShard++; @@ -3816,9 +3816,9 @@ exports.install = function(server, callbackFunction) { let aggregationCtx = new operationContext.Context(); aggregationCtx.init(tenantManager.getDefautTenant(), ctx.docId, ctx.userId); //yield ctx.initTenantCache();//no need - yield editorData.setEditorConnectionsCountByShard(ctx, SHARD_ID, countEditByShard); - yield editorData.setLiveViewerConnectionsCountByShard(ctx, SHARD_ID, countLiveViewByShard); - yield editorData.setViewerConnectionsCountByShard(ctx, SHARD_ID, countViewByShard); + yield editorData.setEditorConnectionsCountByShard(aggregationCtx, SHARD_ID, countEditByShard); + yield editorData.setLiveViewerConnectionsCountByShard(aggregationCtx, SHARD_ID, countLiveViewByShard); + yield editorData.setViewerConnectionsCountByShard(aggregationCtx, SHARD_ID, countViewByShard); } ctx.initDefault(); } catch (err) { From c032cdbde40ab1ba1b7c5764d2c8adb940d0baa5 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Thu, 5 Oct 2023 23:42:25 +0300 Subject: [PATCH 09/17] [bug] Fix unique users counting for bug 64492 --- DocService/sources/DocsCoServer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DocService/sources/DocsCoServer.js b/DocService/sources/DocsCoServer.js index d6a77358..ab6cdcf1 100644 --- a/DocService/sources/DocsCoServer.js +++ b/DocService/sources/DocsCoServer.js @@ -2542,7 +2542,7 @@ exports.install = function(server, callbackFunction) { aggregationCtx.init(tenantManager.getDefautTenant(), ctx.docId, ctx.userId); //yield ctx.initTenantCache(); //no need licenseInfoAggregation = tenantManager.getServerLicense(); - licenseType = yield* _checkLicenseAuth(aggregationCtx, licenseInfoAggregation, conn.user.idOriginal, isLiveViewer, logPrefixServer); + licenseType = yield* _checkLicenseAuth(aggregationCtx, licenseInfoAggregation, `${ctx.tenant}:${ conn.user.idOriginal}`, isLiveViewer, logPrefixServer); } conn.licenseType = licenseType; if ((c_LR.Success !== licenseType && c_LR.SuccessLimit !== licenseType) || (!tenIsAnonymousSupport && data.IsAnonymousUser)) { @@ -2557,7 +2557,7 @@ exports.install = function(server, callbackFunction) { yield* updateEditUsers(ctx, licenseInfo, conn.user.idOriginal, !!data.IsAnonymousUser, isLiveViewer); if (aggregationCtx && licenseInfoAggregation) { //update server aggregation license - yield* updateEditUsers(aggregationCtx, licenseInfoAggregation, conn.user.idOriginal, !!data.IsAnonymousUser, isLiveViewer); + yield* updateEditUsers(aggregationCtx, licenseInfoAggregation, `${ctx.tenant}:${ conn.user.idOriginal}`, !!data.IsAnonymousUser, isLiveViewer); } } } From 3593d769eccf64d45e1808dc628af9daed008ab8 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Thu, 5 Oct 2023 23:53:53 +0300 Subject: [PATCH 10/17] [feature] Allow tenant license with any limits on number of connections or unique users --- Common/sources/tenantManager.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Common/sources/tenantManager.js b/Common/sources/tenantManager.js index c8bf0da7..cb354108 100644 --- a/Common/sources/tenantManager.js +++ b/Common/sources/tenantManager.js @@ -209,22 +209,22 @@ function fixTenantLicense(ctx, licenseInfo, licenseInfoTenant) { errors.push('advanced_api'); } //can not up limits - if (licenseInfo.connections < licenseInfoTenant.connections) { - licenseInfoTenant.connections = licenseInfo.connections; - errors.push('connections'); - } - if (licenseInfo.connectionsView < licenseInfoTenant.connectionsView) { - licenseInfoTenant.connectionsView = licenseInfo.connectionsView; - errors.push('connections_view'); - } - if (licenseInfo.usersCount < licenseInfoTenant.usersCount) { - licenseInfoTenant.usersCount = licenseInfo.usersCount; - errors.push('users_count'); - } - if (licenseInfo.usersViewCount < licenseInfoTenant.usersViewCount) { - licenseInfoTenant.usersViewCount = licenseInfo.usersViewCount; - errors.push('users_view_count'); - } + // if (licenseInfo.connections < licenseInfoTenant.connections) { + // licenseInfoTenant.connections = licenseInfo.connections; + // errors.push('connections'); + // } + // if (licenseInfo.connectionsView < licenseInfoTenant.connectionsView) { + // licenseInfoTenant.connectionsView = licenseInfo.connectionsView; + // errors.push('connections_view'); + // } + // if (licenseInfo.usersCount < licenseInfoTenant.usersCount) { + // licenseInfoTenant.usersCount = licenseInfo.usersCount; + // errors.push('users_count'); + // } + // if (licenseInfo.usersViewCount < licenseInfoTenant.usersViewCount) { + // licenseInfoTenant.usersViewCount = licenseInfo.usersViewCount; + // errors.push('users_view_count'); + // } if (licenseInfo.endDate && licenseInfoTenant.endDate && licenseInfo.endDate < licenseInfoTenant.endDate) { licenseInfoTenant.endDate = licenseInfo.endDate; errors.push('end_date'); From 6a095ea3041d68caca43ccf68dea039c0b923003 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Fri, 6 Oct 2023 00:08:56 +0300 Subject: [PATCH 11/17] [bug] Fix bug 64498 --- branding/info/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/branding/info/index.html b/branding/info/index.html index b5841cc7..96c17c6c 100644 --- a/branding/info/index.html +++ b/branding/info/index.html @@ -317,10 +317,12 @@ elem.innerText = ((licenseInfo.mode & 1) || (licenseInfo.mode & 4)) ? 'Valid: ' : 'Updates available: '; var licdate = new Date(licenseInfo.endDate); + var licType = licenseInfo.type; elem = document.getElementById('lic-valid'); elem.innerText = licdate.toLocaleDateString(); - if (Date.now() > licdate) + if (2 === licType || 1 === licType || 6 === licType || 16 === licType || 11 === licType) { elem.classList.add('critical'); + } elem = document.getElementById('trial'); elem.innerText = (licenseInfo.mode & 1) ? 'Trial' : ''; From 2d7be6562dfc687fc14950c3972ae2224bdec56e Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Fri, 6 Oct 2023 01:38:04 +0300 Subject: [PATCH 12/17] [bug] Allow send form without changes; For bug 64493 --- DocService/sources/DocsCoServer.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/DocService/sources/DocsCoServer.js b/DocService/sources/DocsCoServer.js index ab6cdcf1..fbf71c1d 100644 --- a/DocService/sources/DocsCoServer.js +++ b/DocService/sources/DocsCoServer.js @@ -892,7 +892,7 @@ async function applyForceSaveCache(ctx, docId, forceSave, type, opt_userConnecti } return res; } -async function startForceSave(ctx, docId, type, opt_userdata, opt_formdata, opt_userId, opt_userConnectionId, opt_userConnectionDocId, opt_userIndex, opt_responseKey, opt_baseUrl, opt_queue, opt_pubsub) { +async function startForceSave(ctx, docId, type, opt_userdata, opt_formdata, opt_userId, opt_userConnectionId, opt_userConnectionDocId, opt_userIndex, opt_responseKey, opt_baseUrl, opt_queue, opt_pubsub, opt_conn) { ctx.logger.debug('startForceSave start'); let res = {code: commonDefines.c_oAscServerCommandErrors.NoError, time: null, inProgress: false}; let startedForceSave; @@ -904,6 +904,16 @@ async function startForceSave(ctx, docId, type, opt_userdata, opt_formdata, opt_ }); if (!hasEncrypted) { let forceSave = await editorData.getForceSave(ctx, docId); + if (!forceSave && commonDefines.c_oAscForceSaveTypes.Form === type && opt_conn) { + //stub to send forms without changes + let newChangesLastDate = new Date(); + newChangesLastDate.setMilliseconds(0);//remove milliseconds avoid issues with MySQL datetime rounding + let newChangesLastTime = newChangesLastDate.getTime(); + let baseUrl = utils.getBaseUrlByConnection(ctx, opt_conn); + let changeInfo = getExternalChangeInfo(opt_conn.user, newChangesLastTime); + await editorData.setForceSave(ctx, docId, newChangesLastTime, 0, baseUrl, changeInfo, null); + forceSave = await editorData.getForceSave(ctx, docId); + } let applyCacheRes = await applyForceSaveCache(ctx, docId, forceSave, type, opt_userConnectionId, opt_userConnectionDocId, opt_responseKey, opt_formdata); startedForceSave = applyCacheRes.startedForceSave; if (applyCacheRes.notModified) { @@ -1002,7 +1012,9 @@ function* startRPC(ctx, conn, responseKey, data) { case 'sendForm': { let forceSaveRes; if (conn.user) { - forceSaveRes = yield startForceSave(ctx, docId, commonDefines.c_oAscForceSaveTypes.Form, undefined, data.formdata, conn.user.idOriginal, conn.user.id, undefined, conn.user.indexUser, responseKey); + forceSaveRes = yield startForceSave(ctx, docId, commonDefines.c_oAscForceSaveTypes.Form, undefined, + data.formdata, conn.user.idOriginal, conn.user.id, undefined, conn.user.indexUser, + responseKey, undefined, undefined, undefined, conn); } if (!forceSaveRes || commonDefines.c_oAscServerCommandErrors.NoError !== forceSaveRes.code || forceSaveRes.inProgress) { sendDataRpc(ctx, conn, responseKey, forceSaveRes); From 8ae7d85bad847e4bccfe799068ef27847b55278d Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Fri, 6 Oct 2023 13:46:01 +0300 Subject: [PATCH 13/17] [feature] Parse body from 'savefromorigin' request. For downloadAs pdf with changes --- DocService/sources/canvasservice.js | 20 +++++++++------- FileConverter/sources/converter.js | 37 ++++++++++++++++++++++------- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/DocService/sources/canvasservice.js b/DocService/sources/canvasservice.js index 6bb0015a..df5ede69 100644 --- a/DocService/sources/canvasservice.js +++ b/DocService/sources/canvasservice.js @@ -348,12 +348,14 @@ function* saveParts(ctx, cmd, filename) { } if (cmd.getUrl()) { result = true; - } else { + } else if (cmd.getData() && cmd.getData().length > 0) { var buffer = cmd.getData(); yield storage.putObject(ctx, cmd.getSaveKey() + '/' + filename, buffer, buffer.length); //delete data to prevent serialize into json cmd.data = null; result = (SAVE_TYPE_COMPLETE_ALL === saveType || SAVE_TYPE_COMPLETE === saveType); + } else { + result = true; } return result; } @@ -826,14 +828,16 @@ function* commandPathUrl(ctx, conn, cmd, outputData) { } } function* commandSaveFromOrigin(ctx, cmd, outputData, password) { - let docPassword = sqlBase.DocumentPassword.prototype.getDocPassword(ctx, password); - if (docPassword.initial) { - cmd.setPassword(docPassword.initial); + var completeParts = yield* saveParts(ctx, cmd, "changes0.json"); + if (completeParts) { + let docPassword = sqlBase.DocumentPassword.prototype.getDocPassword(ctx, password); + if (docPassword.initial) { + cmd.setPassword(docPassword.initial); + } + var queueData = getSaveTask(ctx, cmd); + queueData.setFromOrigin(true); + yield* docsCoServer.addTask(queueData, constants.QUEUE_PRIORITY_LOW); } - yield* addRandomKeyTaskCmd(ctx, cmd); - var queueData = getSaveTask(ctx, cmd); - queueData.setFromOrigin(true); - yield* docsCoServer.addTask(queueData, constants.QUEUE_PRIORITY_LOW); outputData.setStatus('ok'); outputData.setData(cmd.getSaveKey()); } diff --git a/FileConverter/sources/converter.js b/FileConverter/sources/converter.js index 4e8a43dc..e2319b3a 100644 --- a/FileConverter/sources/converter.js +++ b/FileConverter/sources/converter.js @@ -409,19 +409,29 @@ function* downloadFileFromStorage(ctx, strPath, dir, opt_specialDir) { var data = yield storage.getObject(ctx, file, opt_specialDir); fs.writeFileSync(path.join(dir, fileRel), data); } + return list.length; } function* processDownloadFromStorage(ctx, dataConvert, cmd, task, tempDirs, authorProps) { const tenEditor = ctx.getCfg('services.CoAuthoring.editor', cfgEditor); let res = constants.NO_ERROR; - let needConcatFiles = false; + let concatDir; + let concatTemplate; if (task.getFromOrigin() || task.getFromSettings()) { + let changesDir = path.join(tempDirs.source, constants.CHANGES_NAME); + fs.mkdirSync(changesDir); + let filesCount = yield* downloadFileFromStorage(ctx, cmd.getSaveKey(), changesDir); + if (filesCount > 0) { + concatDir = changesDir; + concatTemplate = "changes0"; + task.setFromChanges(true); + } dataConvert.fileFrom = path.join(tempDirs.source, 'origin.' + cmd.getFormat()); } else { //overwrite some files from m_sKey (for example Editor.bin or changes) yield* downloadFileFromStorage(ctx, cmd.getSaveKey(), tempDirs.source); let format = cmd.getFormat() || 'bin'; dataConvert.fileFrom = path.join(tempDirs.source, 'Editor.' + format); - needConcatFiles = true; + concatDir = tempDirs.source; } if (!utils.checkPathTraversal(ctx, dataConvert.key, tempDirs.source, dataConvert.fileFrom)) { return constants.CONVERT_PARAMS; @@ -430,12 +440,20 @@ function* processDownloadFromStorage(ctx, dataConvert, cmd, task, tempDirs, auth let mailMergeSend = cmd.getMailMergeSend(); if (mailMergeSend) { yield* downloadFileFromStorage(ctx, mailMergeSend.getJsonKey(), tempDirs.source); - needConcatFiles = true; + concatDir = tempDirs.source; } - if (needConcatFiles) { - yield* concatFiles(tempDirs.source); + if (concatDir) { + yield* concatFiles(concatDir, concatTemplate); + if (concatTemplate) { + let filenames = fs.readdirSync(concatDir); + filenames.forEach(file => { + if (file.match(new RegExp(`${concatTemplate}\\d+\\.`))) { + fs.rmSync(path.join(concatDir, file)); + } + }); + } } - if (task.getFromChanges()) { + if (task.getFromChanges() && !(task.getFromOrigin() || task.getFromSettings())) { if(tenEditor['binaryChanges']) { res = yield* processChangesBin(ctx, tempDirs, task, cmd, authorProps); } else { @@ -458,15 +476,16 @@ function* processDownloadFromStorage(ctx, dataConvert, cmd, task, tempDirs, auth return res; } -function* concatFiles(source) { +function* concatFiles(source, template) { + template = template || "Editor"; //concatenate EditorN.ext parts in Editor.ext let list = yield utils.listObjects(source, true); list.sort(utils.compareStringByLength); let writeStreams = {}; for (let i = 0; i < list.length; ++i) { let file = list[i]; - if (file.match(/Editor\d+\./)) { - let target = file.replace(/(Editor)\d+(\..*)/, '$1$2'); + if (file.match(new RegExp(`${template}\\d+\\.`))) { + let target = file.replace(new RegExp(`(${template})\\d+(\\..*)`), '$1$2'); let writeStream = writeStreams[target]; if (!writeStream) { writeStream = yield utils.promiseCreateWriteStream(target); From 98695d707d4d3b45d8bd88ad6212a3cd7e5c2614 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Mon, 9 Oct 2023 11:01:34 +0300 Subject: [PATCH 14/17] [bug] Set fromChanges flag to save annotations in pdf --- FileConverter/sources/converter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FileConverter/sources/converter.js b/FileConverter/sources/converter.js index e2319b3a..fdbfa77b 100644 --- a/FileConverter/sources/converter.js +++ b/FileConverter/sources/converter.js @@ -423,7 +423,8 @@ function* processDownloadFromStorage(ctx, dataConvert, cmd, task, tempDirs, auth if (filesCount > 0) { concatDir = changesDir; concatTemplate = "changes0"; - task.setFromChanges(true); + dataConvert.fromChanges = true; + task.setFromChanges(dataConvert.fromChanges); } dataConvert.fileFrom = path.join(tempDirs.source, 'origin.' + cmd.getFormat()); } else { From ae8096257a9b00c06b89df563030ac56e866c38d Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Mon, 9 Oct 2023 19:36:13 +0300 Subject: [PATCH 15/17] [bug] Fix bug 64557 --- Common/sources/tenantManager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/sources/tenantManager.js b/Common/sources/tenantManager.js index cb354108..9ea972a6 100644 --- a/Common/sources/tenantManager.js +++ b/Common/sources/tenantManager.js @@ -324,6 +324,9 @@ async function readLicenseTenant(ctx, licenseFile, baseVerifiedLicense) { if (oLicense.hasOwnProperty('advanced_api')) { res.advancedApi = !!oLicense['advanced_api']; } + if (oLicense.hasOwnProperty('process')) { + res.connections = Math.max(res.count, oLicense['process'] >> 0) * 75; + } if (oLicense.hasOwnProperty('connections')) { res.connections = oLicense['connections'] >> 0; } @@ -347,9 +350,6 @@ async function readLicenseTenant(ctx, licenseFile, baseVerifiedLicense) { //Calendar check of start_date allows to issue a license for old versions const checkStartDate = new Date(); if (startDate <= checkStartDate && checkDate <= endDate && (!oLicense.hasOwnProperty('version') || 2 <= oLicense['version'])) { - if (oLicense.hasOwnProperty('process')) { - res.connections = Math.max(res.count, oLicense['process'] >> 0) * 75; - } res.type = c_LR.Success; } else if (startDate > checkStartDate) { res.type = c_LR.NotBefore; From 368423f932dd5dc18778ed4c57981d43e192f196 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Mon, 9 Oct 2023 20:06:23 +0300 Subject: [PATCH 16/17] [se] Fix bug 64498 --- DocService/sources/DocsCoServer.js | 5 ++++- branding/info/index.html | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DocService/sources/DocsCoServer.js b/DocService/sources/DocsCoServer.js index fbf71c1d..9a1054a5 100644 --- a/DocService/sources/DocsCoServer.js +++ b/DocService/sources/DocsCoServer.js @@ -3986,9 +3986,12 @@ exports.healthCheck = function(req, res) { exports.licenseInfo = function(req, res) { return co(function*() { let isError = false; + let serverDate = new Date(); + //security risk of high-precision time + serverDate.setMilliseconds(0); let output = { connectionsStat: {}, licenseInfo: {}, serverInfo: { - buildVersion: commonDefines.buildVersion, buildNumber: commonDefines.buildNumber, + buildVersion: commonDefines.buildVersion, buildNumber: commonDefines.buildNumber, date: serverDate.toISOString() }, quota: { edit: { connectionsCount: 0, diff --git a/branding/info/index.html b/branding/info/index.html index 96c17c6c..51976db2 100644 --- a/branding/info/index.html +++ b/branding/info/index.html @@ -313,14 +313,17 @@ elem = document.getElementById('lic-valid-type'); elem.innerText = 'No license'; } else { + var isLimited = (licenseInfo.mode & 1) || (licenseInfo.mode & 4); elem = document.getElementById('lic-valid-type'); - elem.innerText = ((licenseInfo.mode & 1) || (licenseInfo.mode & 4)) ? 'Valid: ' : 'Updates available: '; + elem.innerText = isLimited ? 'Valid: ' : 'Updates available: '; var licdate = new Date(licenseInfo.endDate); var licType = licenseInfo.type; elem = document.getElementById('lic-valid'); elem.innerText = licdate.toLocaleDateString(); - if (2 === licType || 1 === licType || 6 === licType || 16 === licType || 11 === licType) { + var isInvalid = 2 === licType || 1 === licType || 6 === licType || 16 === licType || 11 === licType; + var isUpdateUnavailible = !isLimited && new Date(serverInfo.date) > licdate; + if (isInvalid || isUpdateUnavailible) { elem.classList.add('critical'); } From 0705e054cb47472c07f310b90ab26771da0199ad Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Thu, 12 Oct 2023 13:44:55 +0300 Subject: [PATCH 17/17] [bug] Fix bug 64605 --- DocService/sources/canvasservice.js | 1 + FileConverter/sources/converter.js | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/DocService/sources/canvasservice.js b/DocService/sources/canvasservice.js index df5ede69..4cae113a 100644 --- a/DocService/sources/canvasservice.js +++ b/DocService/sources/canvasservice.js @@ -836,6 +836,7 @@ function* commandSaveFromOrigin(ctx, cmd, outputData, password) { } var queueData = getSaveTask(ctx, cmd); queueData.setFromOrigin(true); + queueData.setFromChanges(true); yield* docsCoServer.addTask(queueData, constants.QUEUE_PRIORITY_LOW); } outputData.setStatus('ok'); diff --git a/FileConverter/sources/converter.js b/FileConverter/sources/converter.js index fdbfa77b..29982f6f 100644 --- a/FileConverter/sources/converter.js +++ b/FileConverter/sources/converter.js @@ -417,14 +417,17 @@ function* processDownloadFromStorage(ctx, dataConvert, cmd, task, tempDirs, auth let concatDir; let concatTemplate; if (task.getFromOrigin() || task.getFromSettings()) { - let changesDir = path.join(tempDirs.source, constants.CHANGES_NAME); - fs.mkdirSync(changesDir); - let filesCount = yield* downloadFileFromStorage(ctx, cmd.getSaveKey(), changesDir); - if (filesCount > 0) { - concatDir = changesDir; - concatTemplate = "changes0"; - dataConvert.fromChanges = true; - task.setFromChanges(dataConvert.fromChanges); + if (task.getFromChanges()) { + let changesDir = path.join(tempDirs.source, constants.CHANGES_NAME); + fs.mkdirSync(changesDir); + let filesCount = yield* downloadFileFromStorage(ctx, cmd.getSaveKey(), changesDir); + if (filesCount > 0) { + concatDir = changesDir; + concatTemplate = "changes0"; + } else { + dataConvert.fromChanges = false; + task.setFromChanges(dataConvert.fromChanges); + } } dataConvert.fileFrom = path.join(tempDirs.source, 'origin.' + cmd.getFormat()); } else {