tprelog / iocage-node-red

Node-RED - TrueNAS CORE Community Plugin
2 stars 5 forks source link

Plugin Version number missing #6

Closed Ekristoffe closed 3 years ago

Ekristoffe commented 4 years ago

Hello, Would it be possible to have the plugin version number displayed in FreeNAS ? This could be a big plus to check for updates. Thanks.

tprelog commented 4 years ago

It was explained to me is that the version comes from a BSD package ( so this version number gets pulled from the pkg site )

For Node-RED, I believe it can updated from it's own web interface so I don't think there is any need to wait for some sort of "plugin update" in order to update the application itself.

In this case, as well as some other plugins like ESPHome, TasmoAdmin and Home Assistant Core, there is no BSD package to pull a version from so the version is always NA

I agree 1000% and also wish the was a separate, plugin version listed in the FreeNAS UI. Maybe I could start adding a release tag when I make an update to the plugin. This wouldn't be so much an actual release but at least a marked point in time to see when and what changes have been made. Still only small improvement on it's own, but maybe a simple sensor in Home Assistant to watch for new plugin updates could work -- Or better yet, we all go bug IX-Systems to add a "plugin version" to the FreeNAS UI

Ekristoffe commented 4 years ago

Hello unfortunately i don't think node-red can update itself. Same thing with node-red can't restart itself. I think we need to use npm command for an update. (depending on how it was installed this can be tricky, global or local).

tprelog commented 4 years ago

I can look at adding something to the RC script if needed. At least the plugin being a somewhat controller environment I can know how Node-RED is installed so hopefully wouldn't be too difficult or we can change the install to make updates as easy as possible ?

:thinking: I thought an update for Node-RED would show as a update button here. It's not that easy? image

Ekristoffe commented 4 years ago

I don't remember. In docker I need to pull again the container in order to update Node-RED. We will see with the next release of Node-RED.

Ekristoffe commented 4 years ago

Hello node-red just been updated 1.1.0 and no update button appears in node-red.

tprelog commented 4 years ago

@Ekristoffe -- Thanks for confirming... I'll add a new "update" function to the Node-RED rc service script.

Shouldn't take too long but I need to leave for work right now. I've quickly tested and these manual update steps seem to have worked on my system. If you want to upgrade Node-RED now, without waiting for me to update anything...

iocage console $_JAIL

# Stop Node-RED
service nodered stop

# Not sure this step is needed, but my update process seemed to hang without it
/usr/local/bin/npm cache clean --force

# Update Node-RED
setenv PYTHON /usr/local/bin/python2.7
npm install -g --unsafe-perm node-red

#Start Node-RED
service nodered start

image

image

tprelog commented 4 years ago

Hi @Ekristoffe -- I have not forgotten about this

I found one issue that prevents this from being something I can just quickly add ( to the rc.d scrip ). Basically, while creating the plugin, Node-RED is installed by the user root however the rc.d script is run by user nodered -- Because the original install permission are set by root, the regular user nodered is unable to update the service.

I have been busy with real life so I have not had a chance to investigate a correct solution to include the "nodered upgrade" with the service script. Worst case will be needing a small "helper" script that is separate from the rc.d script.

tprelog commented 4 years ago

@Ekristoffe - I found was having a separate issue -- Adding the upgrade function to the rc.d script does work as expected

You can Plugins > UPDATE your Node-RED plugin using the FreeNAS UI and this will get the updated service script.

Using the updated service script, you can upgrade Node-RED at any time to the latest version using

iocage console $_JAIL
service nodered upgrade
tprelog commented 3 years ago

As stated, the version displayed in the UI is linked to a package in the FreeBSD repository.

ESPHome is installed using npm, this is not a packaged application. Therefor it is not possible to display a version number in the TrueNAS UI

Other discussion here is unrelated to the original issue, but still everything mentioned has been resolved.