Skip to content

Commit c47933e

Browse files
committed
Merge branch hotfix/v8.3.1 into develop
2 parents ff0552e + a78bdcc commit c47933e

6 files changed

Lines changed: 23 additions & 17 deletions

File tree

Common/config/default.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103
"storageFolderName": "files",
104104
"cacheFolderName": "data",
105105
"urlExpires": 604800,
106-
"accessKeyId": "AKID",
107-
"secretAccessKey": "SECRET",
106+
"accessKeyId": "",
107+
"secretAccessKey": "",
108108
"sslEnabled": false,
109109
"s3ForcePathStyle": true,
110110
"externalHost": ""

Common/sources/storage-s3.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ function getS3Client(storageCfg) {
6363
*/
6464
let configS3 = {
6565
region: storageCfg.region,
66-
endpoint: storageCfg.endpoint,
67-
credentials : {
66+
endpoint: storageCfg.endpoint
67+
};
68+
if (storageCfg.accessKeyId && storageCfg.secretAccessKey) {
69+
configS3.credentials = {
6870
accessKeyId: storageCfg.accessKeyId,
6971
secretAccessKey: storageCfg.secretAccessKey
7072
}
71-
};
73+
}
7274

7375
if (configS3.endpoint) {
7476
configS3.tls = storageCfg.sslEnabled;

DocService/sources/DocsCoServer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3111,7 +3111,7 @@ exports.install = function(server, callbackFunction) {
31113111
let addRes = await editorData.addLocksNX(ctx, docId, locks);
31123112
let documentLocks = addRes.allLocks;
31133113
let isAllAdded = Object.keys(addRes.lockConflict).length === 0;
3114-
if (!isAllAdded || !fCheckLock(ctx, docId, documentLocks, locks, arrayBlocks, userId)) {
3114+
if (!isAllAdded && !fCheckLock(ctx, docId, documentLocks, locks, arrayBlocks, userId)) {
31153115
//remove new locks
31163116
let toRemove = {};
31173117
for (let lockId in locks) {

DocService/sources/server.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,13 @@ docsCoServer.install(server, () => {
394394
});
395395
});
396396
app.get('/document_editor_service_worker.js', apicache.middleware("5 min"), async (req, res) => {
397-
//make handler only for development version
398-
res.sendFile(path.resolve("../../sdkjs/common/serviceworker/document_editor_service_worker.js"));
397+
let staticContent = config.get('services.CoAuthoring.server.static_content');
398+
if (staticContent['/sdkjs']) {
399+
//make handler only for development version
400+
res.sendFile(path.resolve(staticContent['/sdkjs'].path + "/common/serviceworker/document_editor_service_worker.js"));
401+
} else {
402+
res.sendStatus(404);
403+
}
399404
});
400405
app.use((err, req, res, next) => {
401406
let ctx = new operationContext.Context();

DocService/sources/wopiClient.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ async function getWopiFileUrl(ctx, fileInfo, userAuth) {
383383
} else if (fileInfo?.TemplateSource) {
384384
url = fileInfo.TemplateSource;
385385
} else if (userAuth) {
386-
url = `${userAuth.wopiSrc}/contents?access_token=${userAuth.access_token}`;
386+
url = `${userAuth.wopiSrc}/contents?access_token=${encodeURIComponent(userAuth.access_token)}`;
387387
await fillStandardHeaders(ctx, headers, url, userAuth.access_token);
388388
}
389389
ctx.logger.debug('getWopiFileUrl url=%s; headers=%j', url, headers);
@@ -740,7 +740,7 @@ function putFile(ctx, wopiParams, data, dataStream, dataSize, userLastChangeId,
740740
}
741741
let fileInfo = wopiParams.commonInfo.fileInfo;
742742
let userAuth = wopiParams.userAuth;
743-
let uri = `${userAuth.wopiSrc}/contents?access_token=${userAuth.access_token}`;
743+
let uri = `${userAuth.wopiSrc}/contents?access_token=${encodeURIComponent(userAuth.access_token)}`;
744744
let filterStatus = yield checkIpFilter(ctx, uri);
745745
if (0 !== filterStatus) {
746746
return postRes;
@@ -785,7 +785,7 @@ function putRelativeFile(ctx, wopiSrc, access_token, data, dataStream, dataSize,
785785
ctx.logger.info('wopi putRelativeFile start');
786786
const tenCallbackRequestTimeout = ctx.getCfg('services.CoAuthoring.server.callbackRequestTimeout', cfgCallbackRequestTimeout);
787787

788-
let uri = `${wopiSrc}?access_token=${access_token}`;
788+
let uri = `${wopiSrc}?access_token=${encodeURIComponent(access_token)}`;
789789
let filterStatus = yield checkIpFilter(ctx, uri);
790790
if (0 !== filterStatus) {
791791
return res;
@@ -825,7 +825,7 @@ function renameFile(ctx, wopiParams, name) {
825825
}
826826
let fileInfo = wopiParams.commonInfo.fileInfo;
827827
let userAuth = wopiParams.userAuth;
828-
let uri = `${userAuth.wopiSrc}?access_token=${userAuth.access_token}`;
828+
let uri = `${userAuth.wopiSrc}?access_token=${encodeURIComponent(userAuth.access_token)}`;
829829
let filterStatus = yield checkIpFilter(ctx, uri);
830830
if (0 !== filterStatus) {
831831
return res;
@@ -909,7 +909,7 @@ function checkFileInfo(ctx, wopiSrc, access_token, opt_sc) {
909909
ctx.logger.info('wopi checkFileInfo start');
910910
const tenDownloadTimeout = ctx.getCfg('FileConverter.converter.downloadTimeout', cfgDownloadTimeout);
911911

912-
let uri = `${encodeURI(wopiSrc)}?access_token=${encodeURIComponent(access_token)}`;
912+
let uri = `${wopiSrc}?access_token=${encodeURIComponent(access_token)}`;
913913
let filterStatus = yield checkIpFilter(ctx, uri);
914914
if (0 !== filterStatus) {
915915
return fileInfo;
@@ -946,7 +946,7 @@ function lock(ctx, command, lockId, fileInfo, userAuth) {
946946
}
947947
let wopiSrc = userAuth.wopiSrc;
948948
let access_token = userAuth.access_token;
949-
let uri = `${wopiSrc}?access_token=${access_token}`;
949+
let uri = `${wopiSrc}?access_token=${encodeURIComponent(access_token)}`;
950950
let filterStatus = yield checkIpFilter(ctx, uri);
951951
if (0 !== filterStatus) {
952952
return false;
@@ -985,7 +985,7 @@ async function unlock(ctx, wopiParams) {
985985
let wopiSrc = wopiParams.userAuth.wopiSrc;
986986
let lockId = wopiParams.commonInfo.lockId;
987987
let access_token = wopiParams.userAuth.access_token;
988-
let uri = `${wopiSrc}?access_token=${access_token}`;
988+
let uri = `${wopiSrc}?access_token=${encodeURIComponent(access_token)}`;
989989
let filterStatus = await checkIpFilter(ctx, uri);
990990
if (0 !== filterStatus) {
991991
return;

Readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[![License](https://img.shields.io/badge/License-GNU%20AGPL%20V3-green.svg?style=flat)](https://www.gnu.org/licenses/agpl-3.0.en.html)
55

6-
The backend server software layer which is the part of [ONLYOFFICE Document Server][2] and [ONLYOFFICE Desktop Editors][4] and is the base for all other components.
6+
The backend server software layer which is the part of [ONLYOFFICE Document Server][2] and is the base for all other components.
77

88
## Document service set up
99

@@ -98,7 +98,6 @@ If you have any problems with or questions about [ONLYOFFICE Document Server][2]
9898
[1]: https://forum.onlyoffice.com
9999
[2]: https://github.com/ONLYOFFICE/DocumentServer
100100
[3]: https://stackoverflow.com/questions/tagged/onlyoffice
101-
[4]: https://github.com/ONLYOFFICE/DesktopEditors
102101

103102
## License
104103

0 commit comments

Comments
 (0)