FlowFuse / nr-launcher

A Laucher for Node-RED that allows settings to be loaded at startup.
Apache License 2.0
5 stars 6 forks source link

Config httpStatic based on instance settings #276

Closed knolleary closed 3 weeks ago

knolleary commented 1 month ago

Closes https://github.com/FlowFuse/nr-launcher/issues/274 Part of https://github.com/FlowFuse/flowfuse/issues/4194

Description

This sets httpStatic in the runtime settings based on the content received from the platform.

~I've followed the lead taken by the uibuilder work around path formatting - so it should work on Windows. Will need to verify that before release.~

Updated to avoid path traversal - ensures the resolved file system path is still within the storage path. To do this, I've used path.normalize which should handle all the necessary path separator changes. But - this will need testing on Windows (including a check on uibuilder as I normalise the new storageDir property which gets reused in the uibuilder piece).

The PR to include the httpStatic config from the platform is here: https://github.com/FlowFuse/flowfuse/pull/4388