wazuh / wazuh-api

Wazuh - RESTful API
https://wazuh.com
GNU General Public License v2.0
66 stars 57 forks source link

Increase filesize limit #486

Closed AdriiiPRodri closed 4 years ago

AdriiiPRodri commented 4 years ago

Hi team,

Currently the size limit for files uploaded via the API is 1mb.

This limitation was removed in Wazuh's APP (Increased list filesize limit and fixed typo). According to this change, we will increase the size to 10Mb.

To make this change, we need to modify the following lines of the app.js file:

https://github.com/wazuh/wazuh-api/blob/683d12f67586aa58a0d6f70c2ef91859e7310721/app.js#L170

https://github.com/wazuh/wazuh-api/blob/683d12f67586aa58a0d6f70c2ef91859e7310721/app.js#L171

Regards

AdriiiPRodri commented 4 years ago

Status update

File info

adriiiprodri@wazuh ls -l --block-size=M test.txt
-rw-r--r-- 1 adriiiprodri adriiiprodri 2M May 12 15:59 test.txt

Before

adriiiprodri@wazuh curl -k -u foo:bar -X POST -H 'Content-type: application/octet-stream' --data-binary @test.txt "https://localhost:55000/manager/files?path=etc/lists/new-list&overwrite=true"
{"error":701,"message":"Size of XML file is too long"}

After

adriiiprodri@wazuh curl -k -u foo:bar -X POST -H 'Content-type: application/octet-stream' --data-binary @test.txt "https://localhost:55000/manager/files?path=etc/lists/new-list&overwrite=true"
{"error":0,"data":"File updated successfully"}