Page 2 of 5

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Tue Jan 04, 2011 1:33 pm
by Timbalu
What kind of user feedback do you mean?
I expect it just means
- do a manual search for an update
- be informed about risks
- submit routine to update on normal installations.

auto-update means no user feedback necessary - something like push... (I don't think anybody wants this...!)

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Tue Jan 04, 2011 2:26 pm
by onli
auto-update means no user feedback necessary - something like push... (I don't think anybody wants this...!)
No, true.
I want the autoupdater to start after the notfiction. The notifier says in the dashboard something like "Your version 1.5.5 is old and insecure, 1.6 is available. Get the update manually or try to update now automatically".
"Get the update manually" leads to the normal downloadpage or to an update-manual. But if the user selects "Update now automatically", the autoupdater tries to do the steps i described:

- Backup or, if not possible, recommend to do a backup now
- fetch the files
- unpack them
- lead to the update-page, or better update directly

If fetching the file fails, we can't unpack and so can't do any harm. If unpacking fails the same. Only if both succeeds and the update fails would there be a problem.

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Tue Jan 04, 2011 2:29 pm
by yellowled
Timbalu wrote:auto-update means no user feedback necessary - something like push... (I don't think anybody wants this...!)
I surely never intended to suggest something like an automatic update without any user interaction. The user should still have to initiate downloading the update as well as starting it, but from within the backend instead of having to download (and notice) it manually. This would BTW also solve the problem of users wondering which zip file to use, although I realize that's not really a selling point. :)

YL

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Thu Jan 13, 2011 1:03 pm
by Timbalu
Hi

What about making the dashboard plugin a core plugin?
Reinvent some of the features to cover the needs discussed in our thread, define things to be more precisely and chip it with next available Serendipity version?

Ian

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Thu Jan 13, 2011 3:54 pm
by onli
I also think the updater should be part of a (core-)plugin and not inserted anywhere else. Think I'll start to write a protoype that weekend.

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Thu Jan 13, 2011 8:35 pm
by onli
Well, i was curious if it would work and i had the evening, so i started today.

The attached plugin will hook into the dashboard-plugin, add an "update now!"-button if the dashboard-plugin detects an available update, download it and copy the files over the old ones.

However, it does not:
* make a backup
* start the update-process itself, which begins when visiting a page afterwards
* check for the necessary rights
* work if the dashboard-plugin isn't modified

The necessary modification to the dashboard-plugin is an added event-hook:

Code: Select all

--- serendipity_event_dashboard/serendipity_event_dashboard.php	2010-08-13 00:37:10.000000000 +0200
+++ /var/www/plugins/serendipity_event_dashboard/serendipity_event_dashboard.php	2011-01-13 20:30:29.151714772 +0100
@@ -464,8 +464,11 @@
         else {
             $nv = $this->get_config('last_version');
             if($this->compareVersion($nv, $serendipity['version'])){
+                $addData = '';
+                serendipity_plugin_api::hook_event('plugin_dashboard_updater', $nv, &$addData);
                 print $this->showUpdateHeader();
-                print $this->get_config('update_text');
+                $update_text = $this->get_config('update_text');
+                print $update_text . $addData;
                 print '</div>';
             }
             return;
I now am convinced we could go that way. Even though the plugin at first failed to unpack all the files on my testinstallation because of insufficent rights (only the prior modified dirs plugins/ and templates_c/ worked), nothing got broken. With some polish on showing the progress, a hint to backup everything, maybe an automatic backup of the filesystem and a prior shown hint how the filepermissions should look like (like in the installation) this could already be it.

Have fun testing ;)

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Fri Jan 14, 2011 11:14 am
by Timbalu
Hey well done, onli.

I can not test it in the moment, but there is one question remaining:
I never used CURL before, but it seems you have got to check if libcurl is build in and supported.

Ian

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Fri Jan 14, 2011 2:16 pm
by onli
If i remember correctly, it checks if curl_init() exists, though curl is only the alternative approach (if copy does not work with an url). If the check is not in the plugin at the moment then there is only one if missing :)

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Fri Jan 14, 2011 2:52 pm
by garvinhicking
Hi!

That's great work! If you want, please go ahaead and make the modifications to the dashboard plugin in the official spartacus plugin and commit it, also you might want to label your plugin EXPERIMENTAL in the title and description and put it into spartacus for more people to be able to test?

Once the plugin works and everybody's happy with the functionality, adding it to the core would be a possibility. I usually prefer to have plugins in spartacus because it allows for easier isolated updating, and we can maintain it easier with new functionality (without requiring to release a new s9y version). But if the core functionality works well, I think we can happily bundle it.

We might even want to think about creating a new "Serendipity Plus" download package, that has plugins like this and staticpages as well as some other popular plugins bundled in. We'd need to settle on a good list of plugins of course. :)

Thanks a heap!

Regards,
Garvin

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Fri Jan 14, 2011 3:30 pm
by yellowled
garvinhicking wrote:We might even want to think about creating a new "Serendipity Plus" download package, that has plugins like this and staticpages as well as some other popular plugins bundled in. We'd need to settle on a good list of plugins of course. :)
First of all, I think we should also think very hard about changing the plugins bundled with the core for future version. As far as I remember, S9y has been shipped with the same plugins. (And I can remember back to v0.6!) The way people use the system sure as hell has changed a lot since then. For example, most blogs these days don't use the sidebar calendar, almost no one seems to use textile or markdown etc. I guess we can really tidy up the core a little bit in this area. Same with templates, actually. We could at least drop the mt-* stuff, leaving it on spartacus for those still wanting to use these templates.

Edit: Moved the part about static pages to a seperate thread.

YL

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Fri Jan 14, 2011 5:57 pm
by Lux
yellowled wrote:First of all, I think we should also think very hard about changing the plugins bundled with the core for future version. As far as I remember, S9y has been shipped with the same plugins. (And I can remember back to v0.6!) The way people use the system sure as hell has changed a lot since then. For example, most blogs these days don't use the sidebar calendar, almost no one seems to use textile or markdown etc. I guess we can really tidy up the core a little bit in this area. Same with templates, actually. We could at least drop the mt-* stuff, leaving it on spartacus for those still wanting to use these templates.
I totally agree with this one. Having a very small core could lead us as well to plugin packs for installations in Intranets where no Internet connection is available.

All others get a very good possibililty with Spartacus.
yellowled wrote:Second, I would like to propose a rewrite of the static pages plugin. This has become a vital plugin for almost every blog, but a) it has been, well, more or less unmaintained for quite some time now and b) it is not up to speed in many areas. The navigation is a joke, handling a larger number of pages (10-15) is rather cumbersome etc. I'd also like to see some kind of possibility to integrate it with the core navigation functionality.
Please put "Versionning" on the wanted features list for static pages.

Cheers

Dirk

P.S.: I found this by fortune, shouldn't it be an own topic?

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Fri Jan 14, 2011 7:25 pm
by yellowled
Lux wrote:I found this by fortune, shouldn't it be an own topic?
It should, but I was a little torn (and a little lazy) because it seemed to have more of a reply character. :)

We'll open up another thread if this actually becomes a "ticket".

YL

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Sat Jan 15, 2011 7:56 pm
by onli
I just commited the plugin to spartacus, after i made some additions (a check if the files which need to be overwritten are writable). Still needs some polish. And Garvin, i encountered the strange behaviour that all output from the 'backend_sidebar_entries_event_display_update'-hook was printed twice, i guess everything is done twice. Have no idea why, can you please have a look? If i haven't overseen something very trivial, that is a strange behavior caused by serendipity (or the post-form leading to that page is send twice).

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Sat Jan 15, 2011 11:39 pm
by mattsches
Just read this thread for the first time .. would it be reasonable to do some md5 checksum comparison after downloading the update? The md5 hashes for the latest releases are published here.

Re: [2.0] Auto upgrade manager [developer needed]

Posted: Sat Jan 15, 2011 11:53 pm
by onli
Good idea, to do this before maybe unpacking corrupted files. I will add this.