[2.0] Auto upgrade manager [developer needed]

Mark threads with "[2.0]" for discussions about features in the longer-term future, "[1.6]" is for short-term. This is not the place for general discussions or plugin or template requests. Only features that are approved to happen by the core team should be listed here for better structuring.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

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

Post 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...!)
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post 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.
Last edited by onli on Tue Jan 04, 2011 3:04 pm, edited 1 time in total.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

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

Post 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
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

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

Post 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
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post 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.
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post 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 ;)
Attachments
serendipity_event_autoupdate-0.1.tar.gz
(1.75 KiB) Downloaded 707 times
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

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

Post 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
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post 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 :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

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

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

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

Post 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
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

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

Post 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?
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

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

Post 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
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post 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).
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

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

Post 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.
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

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

Post by onli »

Good idea, to do this before maybe unpacking corrupted files. I will add this.
Locked