-
Notifications
You must be signed in to change notification settings - Fork 611
NodeOS auto-updater #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I kinda like the idea! But we should seperate system updates and package updates because the system updates like newer kernel and such things should only be installed on admin mode. |
The more I think about it, the more I think it's a fantastic idea :-D Obviously this would not be on the core of NodeOS, but it would be nice to provide a module that users would install if they want. I'm used to use the npm-check-updates module and works like a charm :-D so we could be able to use it to be able to check and update all the globally installed modules, and users could be able to exec it on their Global modules would be check and updated too, and would be done automatically on boot too, but this would need a careful thinking since this updates would run as root and so they could be an attack vector if a module gets an update with malware inside. It's an interesting point, but don't think of too much interest since scripts running as root should be minimal (mostly mounting the users partition). Regarding the upgrade of the kernel... well, it could be done too!!! :-P I have been thinking if |
This is interesting discussion! Let's continue. As school comes to a close I will finally be able to continue contributing, and as I now have a few users who've opted in to beta test NodeOS-mobile the auto-updater seems more than reasonable.
Interesting suggestion! With this autoupdater, I'm curious whether we ought to go the simplistic as possible route and set a bunch of defaults, or try and make everything configurable. Finding a nice inbetween is something we should pay a lot of attention to seeing that a lot of the people using it won't be advanced users.
Yeah that makes sense. This leaves me with a question. Users can boot into administrator mode, but if an application, like the updater needs it, could it request a reboot into administrator mode? If a kernel update was available, the updater could simply reboot into administrator on shutdown, update the kernel, then turn off the device. (or boot into admin, update, the restart in normal mode if turning on the device and updating) If we were to attempt to add this feature, it's important that users are querried first before restarting or that could definetely be a feature leveraged by malware.
Ah okay this sounds excellent! If we were to begin right away, we could build off this module to create the module updater. However, I do have a counter point. To voice simplicity, ought we include a module updater? Technically speaking, anyone wanting to update their modules on device should be using that module or something similar and all our updater would truly need to do is update NodeOS system related modules. What do you think?
Yes, auto updates are often a bad idea. I suggest we prompt users first, but this could definetely be a configurable feature. If a module got loaded while in administrator mode, who know's what could happen! (we all know).
This is an exciting idea! I do agree that the feature makes sense. Whether it is, or isn't practical to most users, that I don't know. |
In this way, we could also configure nightly tasks to check external dependencies like new versions of the Linux kernel or of Node.js so new packages could be created and published automatically, and the auto-updater could be able to fetch them and have an up-to-date system without having any human harmed or involved in the process :-) |
haha, well said! Sounds like an excellent idea! Let's start at PR for it. |
And maybe we ought to create a thread too? We could just use the PR thread? |
Maybe better an independent project, not inside NodeOS core. Remember, modularity and reusability ;-) This could be used on regular Node.js installations, too :-) |
[piranna@Latitude:~/Proyectos/prebuild]
(prerelease) > ncu -g -u
ncu cannot upgrade global packages. Run npm install -g [package] to update a global package Seems it only last the last mile... :-) Two options, to do a pull-request on npm-check-updates to add that functionality (that since they only update the |
@piranna I was referring to creating a PR for mounting rootfs as boot :P |
Oh, I though you were talking about the auto-updater. They are two independent and unrelated things, and in fact mounting rootfs as By the way, we have open other issues for 1.0 version like the nsh update (my fault...) and the git client, how are they going? |
Git has made no progress from my understanding. I'm contemplating taking it on in the summer. And yes I'm working on the auto-updater as we speak on 'noUpdate' repo on my page. I know what needs to be done for mounting but if you have a free hand right now, we could save manpower if you went ahead and did it right now. (I'd have to go hunt which file needs changes because I forget which script does the mounting...) |
|
Alright, I've got a prototype of the updater on it's repo noUpdate. What I have so far, is it reads it's config (I'm not sure where you'd like that to go. Where did we put the PalmTree configuration again?) and updates all the packages listed in it. It first runs ncu on the package.json, then runs an npm install to update it. Possible adjustments could be having it scan and update everything and instead use a blacklist of what NOT to update. Any other suggestions?? P.S. yes I'm aware that Object.values() isn't available in Node... I have to go find a substitute. |
Far better. I would check if we are inside a project (there's a
Why not iterate over the object itself? It's standard... |
Gotcha
Okay so you're suggesting to see if we're already in a package and if not, proceed to updating all the globals. Yeah that makes sense, okay. We could also add a parameter to specify which modules to update.
I wanted to see if there was an elegant one-line solution similar to Object.values() but there isn't so yeah I'll just iterate. |
Yes, but don't obsess with that, focus first on the default functionality without parameters to upgrade the globally installed modules, that's what will be used more. Oh, and please use the |
I actually reverted to using the command-line because that's what npm said to do. (The api is apparently only to be used internally and will not remain stable) |
Could you be able to point me where it says so? I think it's a bad design,
|
@piranna here is one place where it's quoted from the doc. I could probably go find it in the docs but I'm about to go to sleep 😛 |
Sh*t... Problem is NodeOS don't have npm installed by default (and
|
@piranna. Oh, no problem. I'll rip the install command right out of npm then and grab all it's dependencies. |
@piranna easier said than done. I'm trying to see if I can mimic npm's install command. |
Seems npm update does almost all we need here... I think we should think
|
@piranna well from my understanding, the goal of noUpdater is to create an auto-updater for npm packages. Originally I had intended for it to be used to update the base NodeOS system so we would have to keep fetching new releases from git, but have the system automatically update itself (just as Android updates itself). That's why originally there was a list of programs to update; this way only required packages would be updated and nothing else. Auto-updating packages from other things on the system can be dangerous if the application breaks because of an incompatible update. What do you think? I'll be on gitter. |
I think all can be done with 'npm update -g', so what extra functionality I think we have here four main use cases:
1 & 2 are somewhat the same and feasible with 'npm update -g', and the same 3 is more tricky since it's not on a npm standard place, but also it could |
Alright sounds good. I'll close this here, and let's open a new thread for each feature so they can be discussed in depth. |
I thought this might be a cool module to create. I wouldn't suggest we include it with NodeOS simply to remain simplistic but it could be installed by users. Optimally, the module would simply check for updates on the startup of a NodeOS session. This would be nice for users using a bare-metal installation. The installer would of course run within NodeOS.
I have a few questions however. Is this feasable without using Administrator Mode? Could the updates be cached and then implemented on a system restart? Wouldn't this require the module to be installed while in Administrator Mode?
I like the idea of this. What do y'all think?
The text was updated successfully, but these errors were encountered: