Posted by cwgordon7 on March 20, 2008 at 3:12am
Moved to official ideas list at http://drupal.org/node/237532
Here it is, the traditional proposal: a module that automatically fetches modules (and themes, theme engines, etc.) from drupal.org and uploads them to your site.
Unlike previous attempts, however, this will not be a security risk; it will use its own (s)ftp engine to upload fetched files to the site. The password will not be stored; the user will be prompted for it every time.
This project consists of main parts:
- Creation of an (s)ftp client or the adaptation of an existing gpl (s)ftp client to fit Drupal's needs.
- Adding the ability to use this module to fetch other modules, themes, etc from drupal.org.
- Adding the ability to use this (s)ftp client to upload modules, themes, etc to the appropriate place on each Drupal site.
The benefit of this project is:
Increased usability.
Mentors:
TBD. I would not be a good mentor for this as I know next to nothing about it. :(
Difficulty:
Pretty hard. But not impossible. :)
Comments
You might want to look into
You might want to look into Wim Leer's CDN module for moving files around. It has a built in file transfer mechanism with pluggable interfaces for whatever you need (although currently only ftp is built.) I had been wanting to send him a patch which abstracts the file transfer stuff into its own distinct module for easier usage in situations exactly like this one.
http://drupal.org/project/cdn
Oh, cool
Then that makes it easier. So this is probably a better SoC project now. :)
seems great - some enhancements
A few things that I'd like to see...
This seems like a great proposal to me and those two items are really "nice to have".
--
Open Prediction Markets | Drupal Dashboard
knaddison blog | Morris Animal Foundation
challengingly cool!
this is very cool, and definitely challenging, I would love to take on something like this! thanks cwgordon7...
I like it.
I too find this to be highly intriguing. I would very much like to do work with this.
Clarification
Would it be acceptable to use PHP's built in ftp wrapper to handle most of the ftp needs of the system? I believe this would still yield the desired code security / stability without incurring the problem of increased code quantities. It would also natively support SSL.
Thank you for your time,
Joshua Rogers
s9y SPARTACUS
I would recommend taking a look at the Serendipity Project's SPARTACUS which uses XML+version control to do exactly this for s9y.
I was closely involved in the project when SPARTACUS was developed, and would be more than glad to answer questions.
For those who came in late ;-), Serendipity is an open-source blogging engine written in PHP.
Cheers,
-K
Source List
Would there be any possibility of enabling feeds for the theme and module pages? Otherwise the client would have to load the entire page and then parse it. Said parser could not be guaranteed to continue working if the theme ever changed. Not that that is particularly likely, but it just seems that the second option would involve much unneccessary overhead and taxing of the d.o server.
There is already
There is already xml data available for project releases. It is used by the update status module. I do not see that this would be particularly overtaxing on the d.o. server, as it is simply replacing manual downloads with automated ones.
Hi, looks interesting -
Hi, looks interesting - could you give it a more descriptive title, please? thank you!
http://www.twitter.com/lxbarth
agreed
I changed the title - cwgordon07 or anyone else with the permissions should feel free to refine it.
--
Open Prediction Markets | Drupal Dashboard
knaddison blog | Morris Animal Foundation
I'm interested
I really like this idea. How can I get involved? How can I start? I know it's a big project, and I don't want to take something I can't do. Currently, I'm a student (and here we are just starting -- summer+holidays are gone!) and I have time besides the university time. But I don't know how much time it will consume studying in the next months. What can I do? Thanks!
Let me fire you over the
Let me fire you over the link.. Sec.
http://code.google.com/opensource/gsoc/2008/faqs.html - FAQ
http://groups.google.com/group/google-summer-of-code-announce/web/guide-... - getting into the Summer of Code interface
+1
PHP 5 offers an FTP file wrapper and an ssh/scp file wrapper (optional) for just this sort of thing. This would be hugely beneficial, and is one of the recently discussed benefits of moving to PHP 5-only.
Any such module would need to have a good fallback process, though. Try SFTP, if that fails try FTP, if that fails don't work. :-) This should be a fairly straightforward process, but with lots of failure points that need to be handled.
I may be missing a part of the picture here, but...
.. why not simply use HTTP to transfer the files? The update status module already checks for updated versions of the modules you've already have installed and retrieves the direct link to the downloadable tarball for the module in question. So why not use something similar to retrieve the different URLs and then use file() and gzopen() or something similar to retrieve this module directly? The only challenge I see is how you overcome the fact that you probably haven't got write access to the file system, so some additional rights has to be set to be able to accomplish the actual unpacking of the tarball.
But as I said, I may be missing a part of the picture here :)
you pretty much said it yourself.
Granting "additional rights" to the webserver to write modules into your directories, means allowing the application to write to itself - which means immediately opening yourself up to many, many security issues.
Doing it via sftp/ftp, you're running as your actual user account on the server (and would be prompted for your password whenever installing/upgrading) - so there's no way someone could install all kinds of crazy stuff to your PC if they managed to escalate permissions or otherwise get access to the download interface.
Not to mention there's 2-3 modules in contrib that do it that way already. All with big red warnings on them from the security team.
Drupal module?
But should this still be added as a Drupal module that adds itself to the Drupal administrative panel, or is this more like a "third-party" tool that runs as some daemon on the machine? The Drupal module part of this implementation communicates to the underlying service that then does the downloading and gunzipping? Have I fully understood it then? :) (he said, with his fingers crossed and self-respect on the line :)
As far as I understand it,
As far as I understand it, which isn't all that much, there's a drupal module which acts as a front end GUI to it's own s/ftp client (which will be heavily dependent on PHP5's ftp support and hence hopefully very small). The Drupal module lets you choose what to install/upgrade - but the actually grabbing and writing of the files is done using the user account privileges server - not the webserver permissions. This isn't trivial to do, which is why it hasn't been done yet (and why it'll hopefully make a very cool GSoC project for someone) - it also needs additional security checks to ensure that the files being downloaded are genuine etc. To get the convenience benefits this promises, the UI has to be in Drupal, whilst Drupal absolutely can't have privileges to write to itself - which is where the s/ftp layer comes in.
What does exist at the moment is Drush, which provides an apt-like way to install and upgrade modules from the command line, and is very nice.
Automatic but not too automatic
This should be automatic but not too automatic in that the modules should download but not be overwritten without the direct interaction of the admin. I like the idea of having to match MD5 codes - but only if the module provides a link to the d.o pages with the MD5 codes, I don't want to make it an all day process to find the codes.
Because we know that this will make Drupal a more open environment for less technical users we also need to address the backup question in this post as well. Can we backup the tables specifically altered by the specific update that is being installed and can we back up the folder for the specific module as well with the ability to revert to the old version of the module.
So the work flow looks like this in my mind.
I am not a programmer and I could be oversimplifying some of this but I think that this would be a big help to make Drupal more availible to more users. I am lucky enough to have SSH from my host but not everyone has the luxury. This is a great SOC project.
Owner and Lead Consultant
Denver DataMan
backups
For backup, there's a separate GSoC proposal for that here: http://groups.drupal.org/node/10060 - it's related, but it's a very big task in itself.
I agree all isntall/upgrades should be triggered manually (very manually) though. The idea of it all happening in the background one day scares the crap out of me.
Clarification
I want to see if I understand the idea here. For example, where "drupalbox" is the server on which drupal is run:
Is this about right? (Or would/could it be more along the lines of running a shell script as the non-root, non-apache user whose credentials were given?)
close
How does that seem?
The "magic DMTI" is a module within Drupal, so you do all these things from within the Drupal interface and it runs inside of the PHP process.
--
Open Prediction Markets | Drupal Dashboard
knaddison blog | Morris Animal Foundation
Many shared hosting use
Many shared hosting use fcgi-suexec and suphp.
So module can check or ask about uploading to local filesystem.
I think it is very good idea because:
1 user can be in fcgi based system
2 user can be in suphp based system
3 user can be in mod_phpX based system then we upload to local (s)ftp
4 user can be in mod_phpX based system and have scp proto
Personally I dont really
Personally I dont really think this kind of functionality belongs in a module state. Although saying that, it would certainly be more usable for some people, but I would prefer the CLI method of an apt-get approach, rather than having the overhead of a module which is essentially is just a utility.
vision media
350designs
Print Huge Edmonton Printing Services
Design Inspiration Gallery
Tj Holowaychuk
Vision Media - Victoria BC Web Design
Victoria British Columbia Web Design School
Have you seen Drush?
Have you seen Drush? http://drupal.org/project/drush
Yup
Even with Drush I would prefer similar functionality in a non-module package.
vision media
350designs
Print Huge Edmonton Printing Services
Design Inspiration Gallery
Tj Holowaychuk
Vision Media - Victoria BC Web Design
Victoria British Columbia Web Design School
+1; remember to look at best practice
Huge huge huge +1! I've been begging whoever would listen for a module like this for a long time... I think mostly through annoying, irrelevant comments on update_status issues. I'd love to code it myself, but I don't know if I have the time to do it justice. When I switched from Windows to Ubuntu a few years ago, the ease of installing software through Add/Remove Applications and Synaptic blew me away. It would be awesome if a Drupal package manager could have the same impact.
The implementer should consider "best practice" in package management (which is basically what this appears to be). Many Linux distributions have their own package managers: apt, rpm, and portage are mature examples. The PEAR library also includes a package manager. I realize that these are complex and multi-layered programs, but there are lots of lessons to be learned for the simpler Drupal context. For example:
...what I'm trying to say is that other people have already wrestled with many of the ideas brought up here. Drupal doesn't have to — and shouldn't — copy their solutions, but it's certainly wise to do some research.
Like houndbee, I'd be glad to talk further with anyone interested in implementing this.
coming soon to a Drupal near you
Thanks, Paul Kishimoto! Great points and great summary of features!
There is actually some work on this as a PluginManager via the Summer of Code project: http://groups.drupal.org/node/10893
Please do keep track of that project and be sure to provide feedback. One note: many of the features (most) are currently out of scope. We just need to get the basic pieces of it done and done securely first. Then we can see about the rest of the ideas.
Certainly these should all be feature requests on the project eventually so that they can be planned for the future.
--
Open Prediction Markets | Drupal Dashboard
knaddison blog | Morris Animal Foundation
Good news
I agree that a lot of the things are out of scope... mainly my hope is that those 'basic pieces' are written with some forethought so they're extensible enough to cover future enhancements, without API breaks.
Looks like I'll be harassing JoshuaRogers a lot in the near future :D Thanks for the tip!
Harass me all you like!
Believe me, I read every one of the comments and suggestions about this project. I'll even help you harass me: A more recent discussion on this project is occuring at http://groups.drupal.org/node/11678. :P
Wrap a gui on drush
I use drush. I'd be happy to walk clients through a nice UI wrapper around drush.
I like debian's apt model: The server (ftp.drupal.org?) looks into all the modules and builds the dependency tree. This is then compressed and made available for download.
Drupal clients poll this file, download it if outdated, and uses it deciding what to install for project X.
So, +1 for best practices. :)