AptFirefoxFileHandler

Revision 8 as of 2007-05-15 12:05:27

Clear message

Please check the status of this specification in Launchpad before editing it. If it is Approved, contact the Assignee or another knowledgeable person before making changes.

Summary

It should be possible to install software in a safe and supported way over a website. This alllows us to provide more dynamic content and richer metadata (like screenshots, comments) than with traditional client applications. To archive this, a new "apt://" protocol will be created that allows giving commands to apt/synaptic.

Rationale

People use to install software just clicking on a URL. Softonic, Tucows and others, list lots of applications that users can easily add to their Windows boxes. The linux way is not that easy.

An Ubuntu distribution has got a defined repository with loads of software, but users need to use a specific software installer (gnome-app-install, synaptic) to add more software.

Use Cases

  • Alfonso is asking a question on Guadalinex forums. A support technician from Guadalinex team founds that his problem can be resolved by installing a single package. He post an answer with a link to apt://unrar, and the user only have to click on it to solve his problem.

  • Guadalinex team needs to provide his users with an up-to-date list of "extra-software" which doesnt fit on the CD. The developers add a menu entry in the stable version of the distro that opens a webpage hosted in Guadalinex servers that can be easily updated, with links to apt://name_of_package

  • Pepe, an Ubuntu enthusiast, wants to write a beryl-howto in his weblog. He easily adds links to the referred software with "apt://name-of-package" url.

  • Celso has a launchpad PPA for his software. He wants to make it easy to add his repository and puts a apt protocol handler in for this

Scope

The apt protocol should support the following actions:

  • install package from existing repository
  • adding new repository

Design

The default internet browser will call a external application whenever an apt://package_name url is clicked. It adds the complete url as an argument to that external application. The external application will do something like an apt-get install package_name (synaptic or adept_batch)

In its easiest from, the new url will be formatted:

  apt://package_name

We are not linking a .deb file, just giving the name of the package to an external application.

There is http://tools.ietf.org/html/rfc3986 (STD66) to describe URIs. This uri schema will follow this standard.

In addition to this, a richer aproach for more complicated commands like "only install if the application is greater than version X.Y" or if we need to add complete repositories with gpg keys to the system before we continue (important for PPA).

Implementation

  • First at all, Firefox (or default browser) must be tweaked to recognize a new (invented) apt:// protocol.

  • When an apt:// url is clicked a piece of software must be triggered. Browser will pass the url to this application.

  • The application will call synaptic with a few parameters to download and install the package, including dependencies (/usr/sbin/synaptic --hide-main-window --non-interactive --set-selections-file /tmp/apt-packagename.tmp)

Move the changes into /usr/share/firefox/defaults/prefs/apt-archive-handler.js as an additional configuration file. The whole thing should be a new package with some python clue code (maybe a modification of gdebi?)that will display information about the package and offer a dialog to install it. For installing synaptic will used as a backend. In Guadalinex, the file /usr/lib/firefox/firefox.cfg was modified to archive the same goal, and a perl script was added to parse the url, and call synaptic.

Outstanding Issues

  • If a user is using a distribution, Debian for example, and the web points to a package that exists in ubuntu but not in debian, the script will fail. It has to notify the users that something went wrong.
  • Action suggestions:
    • Install Packages (apt://vim) or (apt://vim:install), allowing more than one package in the same url in order to prevent dpkg lock errors when an user tries to install several packages clicking on several links.

    • Install specific versions of package (apt://install:vim=1.2.3)

    • Add a new repository, i.e., PPA (apt://repository:deb http://ppa.launchpad.net/cprov/ubuntu main restricted universe multiverse)

    • How do you control "evil" uses of this? It's the same thing if anybody tells an newbye to execute "rm -rf", we cannot control that. But the user is not executing this, it's been automatically written in /etc/apt/sources.list. Well, the user must give his authorization to every change, and also his password.Ok
    • Update package list: apt://update

    • Upgrade and dist-upgrade distro: apt://upgrade apt://dist-upgrade

    • Remove a package: apt://emacs:remove

    • very important that we keep backward compatibility with the schema from guadalinex
    • the primary target is the package, the first argument is always the package name, then more commands can be added after the
      • first ";"

BoF agenda and discussion

The svn for the Guadalinex implementation:

svn co http://forja.guadalinex.org/guadalinexv4/apps/xapi


CategorySpec