You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove curl & Nano from standard conatiner builds #338
Please do not remove curl, I have many automations using curl getting json date from websites and (more important for me) from internal components like my not well supported thermostat and more.
You may also need to tell the http-request not not to validate the the response headers if the device isn't following the spec, but that option has been included in the 3.1.x stream since it was a security update to NodeJS 18 iirc
Please do not remove curl, I have many automations using curl getting json date from websites and (more important for me) from internal components like my not well supported thermostat and more.
You can create simple Dockerfile which will install curl to your image:
FROM nodered/node-red:latest
RUN apk update && apk add curl
In my experience (with IOTstack on Raspberry Pis and Debian Proxmox guests - but YMMV), it needs at least:
FROM nodered/node-red:latest
USER root
RUN apk add --no-cache curl
USER node-red
Why? You need to be root to run apk. The base image on DockerHub leaves the user set to "node-red" (Dockerfile line 85). You inherit that at the point of the FROM so you have to switch to root to run apk and then put it back again. Putting it back to "node-red" is particularly important if you also use the Dockerfile to install add-on nodes.
The --no-cache flag implies an apk update and a corresponding cleanup. It's designed to minimise clutter and keep containers small. That said, it doesn't actually make a huge difference to container size (~2MB) so the traditional "update + add" is just as good.
Activity
WeterPeter commentedon Jan 4, 2024
Please do not remove curl, I have many automations using curl getting json date from websites and (more important for me) from internal components like my not well supported thermostat and more.
hardillb commentedon Apr 19, 2024
Why can't you use the http-request node instead of shelling out to curl?
WeterPeter commentedon Apr 19, 2024
How to use http-request node doing this? :
curl -f -k -H 'Accept: application/json' -H 'Authorization: Bearer [LONG TOKEN]' -X GET https://192.168.xx.xx/api/v1/production/inverters
hardillb commentedon Apr 19, 2024
You can set headers on in the config for the http-request node or pass them in as
msg.headerAnd you can set the http-request node to not validate the server cerificate
hardillb commentedon Apr 19, 2024
You may also need to tell the http-request not not to validate the the response headers if the device isn't following the spec, but that option has been included in the 3.1.x stream since it was a security update to NodeJS 18 iirc
WeterPeter commentedon Apr 20, 2024
Thanks but is goes beond me I am affraid.
Maybe you could give me an example flow how to do this?
zba commentedon Jul 29, 2024
You can create simple Dockerfile which will install curl to your image:
Paraphraser commentedon Jul 29, 2024
In my experience (with IOTstack on Raspberry Pis and Debian Proxmox guests - but YMMV), it needs at least:
Why? You need to be root to run
apk. The base image on DockerHub leaves the user set to "node-red" (Dockerfile line 85). You inherit that at the point of theFROMso you have to switch to root to runapkand then put it back again. Putting it back to "node-red" is particularly important if you also use the Dockerfile to install add-on nodes.The
--no-cacheflag implies anapk updateand a corresponding cleanup. It's designed to minimise clutter and keep containers small. That said, it doesn't actually make a huge difference to container size (~2MB) so the traditional "update + add" is just as good.2024-07-30 Node-RED - master branch - PR 1 of 2
2024-07-30 Node-RED - old-menu branch - PR 2 of 2