Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/hotfix/v8.2.1' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	DocService/sources/DocsCoServer.js
  • Loading branch information
konovalovsergey committed Nov 22, 2024
2 parents 6c6913f + b67bd4f commit af3cf2a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Common/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@
"getChanges": {
}
},
"win-ca": {
"inject": "+"
},
"wopi": {
"enable": false,
"host" : "",
Expand Down
7 changes: 3 additions & 4 deletions Common/sources/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ const https = require('https');
const ca = require('win-ca/api');
const util = require('util');

if(!ca.disabled) {
ca({inject: true});
}

const contentDisposition = require('content-disposition');
const operationContext = require("./operationContext");

Expand All @@ -86,6 +82,9 @@ const cfgRequesFilteringAgent = config.get('services.CoAuthoring.request-filteri
const cfgStorageExternalHost = config.get('storage.externalHost');
const cfgExternalRequestDirectIfIn = config.get('externalRequest.directIfIn');
const cfgExternalRequestAction = config.get('externalRequest.action');
const cfgWinCa = config.get('win-ca');

ca(cfgWinCa);

const minimumIterationsByteLength = 4;
const dnscache = getDnsCache(cfgDnsCache);
Expand Down
5 changes: 3 additions & 2 deletions DocService/sources/DocsCoServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ function* bindEvents(ctx, docId, callback, baseUrl, opt_userAction, opt_userData
}
} else {
oCallbackUrl = parseUrl(ctx, callback);
bChangeBase = c_oAscChangeBase.All;
bChangeBase = c_oAscChangeBase.No;
if (null !== oCallbackUrl) {
let filterStatus = yield* utils.checkHostFilter(ctx, oCallbackUrl.host);
if (filterStatus > 0) {
Expand Down Expand Up @@ -1638,7 +1638,8 @@ exports.install = function(server, callbackFunction) {
return;
}
if (getIsShutdown()) {
sendFileError(ctx, conn, 'Server shutdown');
sendDataDisconnectReason(ctx, conn, constants.SHUTDOWN_CODE, constants.SHUTDOWN_REASON);
conn.disconnect(true);
return;
}
conn.baseUrl = utils.getBaseUrlByConnection(ctx, conn);
Expand Down
11 changes: 9 additions & 2 deletions DocService/sources/canvasservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,16 @@ async function getOutputData(ctx, cmd, outputData, key, optConn, optAdditionalOu
userPassword = await utils.decryptPassword(ctx, encryptedUserPassword);
isCorrectPassword = decryptedPassword === userPassword;
}
if(password && !isCorrectPassword && !formatChecker.isBrowserEditorFormat(originFormat)) {
let isNeedPassword = password && !isCorrectPassword;
if (isNeedPassword && formatChecker.isBrowserEditorFormat(originFormat)) {
//check pdf form
//todo check without storage
let formEditor = await storage.listObjects(ctx, key + '/Editor.bin');
isNeedPassword = 0 !== formEditor.length;
}
if (isNeedPassword) {
ctx.logger.debug("getOutputData password mismatch");
if(encryptedUserPassword) {
if (encryptedUserPassword) {
outputData.setStatus('needpassword');
outputData.setData(constants.CONVERT_PASSWORD);
} else {
Expand Down
10 changes: 8 additions & 2 deletions DocService/sources/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,15 @@ fs.watchFile(cfgLicenseFile, updateLicense);
setInterval(updateLicense, 86400000);

try {
fs.watch(config.get('services.CoAuthoring.plugins.path'), updatePlugins);
let staticContent = config.get('services.CoAuthoring.server.static_content');
let pluginsUri = config.get('services.CoAuthoring.plugins.uri');
let pluginsPath = undefined;
if (staticContent[pluginsUri]) {
pluginsPath = staticContent[pluginsUri].path;
}
fs.watch(pluginsPath, updatePlugins);
} catch (e) {
operationContext.global.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');
operationContext.global.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. %s', e.stack);
}

// If you want to use 'development' and 'production',
Expand Down
4 changes: 4 additions & 0 deletions DocService/sources/utilsDocService.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
const util = require("util");
const config = require('config');
const exifParser = require('exif-parser');
//set global window to fix issue https://github.com/photopea/UTIF.js/issues/130
if (!global.window) {
global.window = global;
}
const Jimp = require('jimp');
const locale = require('windows-locale');
const ms = require('ms');
Expand Down

0 comments on commit af3cf2a

Please sign in to comment.