HomeBridgeController icon indicating copy to clipboard operation
HomeBridgeController copied to clipboard

Auto-Update Feature

Open epheterson opened this issue 8 years ago • 6 comments

It'd be nice if HomeBridge had an 'Update All' and/or Auto-Update feature to keep my plugins always updated w/out any effort.

This feature should be off by default, but discoverable, as some setups require homebridge never be restarted.

It is possible to update the plugins automatically and present the user with a 'Restart Homebridge' button, similar to how OS X downloads updates then tells the user when it's time to reboot. Personally, I'd want the updates to be installed, and homebridge restarted, all on its own as a moment of downtime is inconsequential.

epheterson avatar Feb 10 '16 07:02 epheterson

The first part is def doable but the second part (the restart) is a little more tricky. I myself have completely diff OS's and both have multiple ways to start homebridge. I started this project assuming people would just have homebridge installed on their Mac but given that I myself don't (RPi) I realized that that was a bad assumption.

I know they are working on a way to update homebridge without restarting (https://github.com/nfarina/homebridge/pull/497), but not sure when that would be done.

I couldn't think of anyway to self destruct homebridge but have it restart the exact same way. I'm sure there is a node js guru who has a sneaky way :smile:

KraigM avatar Feb 10 '16 07:02 KraigM

Not having to relaunch to reload the config file is a great idea for homebridge!

In the meantime, if you package homebridge with the UI, you have absolute control over its location on disk, and how it stops/starts. Perhaps this will make it easier for you to relaunch homebridge on the users' behalf?

epheterson avatar Feb 10 '16 07:02 epheterson

ABSOLUTE CONTROL! I like that :smile:

Yeah I figure one way is to bundle it in or at least control the installed version. Prob with that is getting sandboxing approved.

Another option would be docker. That way it is a closed system that is easily managed.

KraigM avatar Feb 10 '16 22:02 KraigM

I think we can still get it to be "sandboxed" if we bundle it with it but I think that would involve any plugins that use native code to be precompiled and signed.

Another way to get it to be "sandboxed" might be to build a embedded, self installing command line toolset (similar to what Xcode does) that would handle all the auto restart magic via the link. Or if embedding it doesn't work, it could just be a separate installer package.

KraigM avatar Feb 10 '16 22:02 KraigM

Or if anyone has some clever node js voodoo, I'm open to suggestions. NodeJS is not my forte :sweat_smile:

KraigM avatar Feb 10 '16 22:02 KraigM

@KraigM Can you persist the data? @devbobo Would this be possible, to have it relaunch in its previous state? Not exactly sure if what you ended up doing on the platform-wemo could be applied in a similar fashion to accomplish what we want to achieve.

AppleTechy avatar Feb 12 '16 03:02 AppleTechy