openwisp / openwisp-firmware-upgrader

Firmware upgrade solution for OpenWRT with possibility to add support for other embedded OSes. Provides features like automatic retry for network failures, mass upgrades, REST API and more.
http://openwisp.org
Other
50 stars 58 forks source link

UPGRADER_MAX_FILE_SIZE does not change nginx setting #220

Closed kosli closed 1 year ago

kosli commented 1 year ago

I have set the OPENWISP_FIRMWARE_UPGRADER_MAX_FILE_SIZE to 50MB (50 1024 1024). The nginx site conf does not get changed, whereas the firmware upload limit in OpenWISP itself indeed gets changed as after changing the nginx conf manually (which gets reverted by the ansible playbook!) I could successfully upload the firmware image.

nemesifier commented 1 year ago

The ansible-openwisp2 role handles it with the var openwisp2_firmware_upgrader_max_file_size:

Please before opening issues reach us in our general gitter/matrix chat.

kosli commented 1 year ago

I am using the ansible-galaxy (openwisp.openwisp2, 22.5.2) role and I have set

    openwisp2_extra_django_settings_instructions:
      - |
        OPENWISP_FIRMWARE_UPGRADER_MAX_FILE_SIZE = 50 * 1024 * 1024

Unfortunately only the settings.py on the server gets changed. Whereas even there, the line in the middle of the file stays as OPENWISP_FIRMWARE_UPGRADER_MAX_FILE_SIZE = 31457280 whereas a new line gets added at the bottom of the file: OPENWISP_FIRMWARE_UPGRADER_MAX_FILE_SIZE = 50 * 1024 * 1024 this seems to be a bug so that is why I created the issue here instead of asking in the matrix chat. The nginx site conf does not get changed. And if I have changed it manually it gets reverted back to client_max_body_size 31457280; I also tried using OPENWISP_FIRMWARE_UPGRADER_MAX_FILE_SIZE = 52428800 instead of 50 1024 1024 but the behavior is the same.

nemesifier commented 1 year ago

Use openwisp2_firmware_upgrader_max_file_size.

kosli commented 1 year ago

Thanks @nemesisdesign Note for others: openwisp2_firmware_upgrader_max_file_size is an ansible variable and NOT a django setting ;-)

nemesifier commented 1 year ago

Yes, an ansible role variable, see here: https://github.com/openwisp/ansible-openwisp2#role-variables.