[config] Add editor.maxChangesSize limit to document changes

This commit is contained in:
Sergey Konovalov
2022-10-04 18:16:02 +03:00
committed by Sergey Konovalov
parent e82abbd3b2
commit 2553f74e5c
2 changed files with 3 additions and 1 deletions

View File

@ -259,7 +259,8 @@
"attempts": 50,
"delay": "2s"
},
"websocketMaxPayloadSize": "1.5MB"
"websocketMaxPayloadSize": "1.5MB",
"maxChangesSize": "50mb"
},
"sockjs": {
"sockjs_url": "",

View File

@ -112,6 +112,7 @@ const editorDataStorage = require('./' + configCommon.get('services.CoAuthoring.
let cfgEditor = JSON.parse(JSON.stringify(config.get('editor')));
cfgEditor['reconnection']['delay'] = ms(cfgEditor['reconnection']['delay']);
cfgEditor['websocketMaxPayloadSize'] = bytes.parse(cfgEditor['websocketMaxPayloadSize']);
cfgEditor['maxChangesSize'] = bytes.parse(cfgEditor['maxChangesSize']);
//websocket payload size is limited by https://github.com/faye/faye-websocket-node#initialization-options (64 MiB)
//xhr payload size is limited by nginx param client_max_body_size (current 100MB)
//"1.5MB" is choosen to avoid disconnect(after 25s) while downloading/uploading oversized changes with 0.5Mbps connection