AptUrlRedirector

Differences between revisions 5 and 6
Revision 5 as of 2010-01-08 19:10:22
Size: 4218
Editor: eth0
Comment: Design team to provide HTML/images/CSS
Revision 6 as of 2010-01-11 10:46:03
Size: 4212
Editor: eth0
Comment: "Switch to Ubuntu" -> "Try Ubuntu" (thanks to David Siegel)
Deletions are marked like this. Additions are marked like this.
Line 24: Line 24:
 * If it is not, it should return an HTTP 426 error page, “Switch to Ubuntu”, which briefly describes the Ubuntu Software Center and has a “Get Ubuntu Now” link to [[http://www.ubuntu.com/getubuntu]].  * If it is not, it should return an HTTP 400 error page, “Try Ubuntu”, which briefly describes the Ubuntu Software Center and has a “Get Ubuntu Now” link to [[http://www.ubuntu.com/getubuntu]].

There should be a simple Web service at apt.ubuntu.com that redirects (for example) the URL http://apt.ubuntu.com/p/abiword to apt:abiword. This works right now for Firefox in Ubuntu. It needs to work for other browsers, and produce understandable results when you follow the link on other operating systems.

Rationale

apt: protocol links provide easy prompts to install packages on Ubuntu. However, there are thousands of Weblog systems, forums, wikis, and other CMSes that do not handle apt: links correctly, and most of them never will. People publishing on these systems still want to be able to make it as easy as possible for people to install Ubuntu software from the official repositories. So, they need to be able to use an http: URL that does the same job.

User stories

  • Matt Zimmermann wants to be able to write an item on his Web site extolling the virtues of apt: URLs for making Ubuntu software easy to install, without giving up after “WordPress completely destroys the apt: links in this post.”

  • Someone answering questions on Launchpad Answers wants to make it as easy as possible for the person they’re helping to install a particular package, despite Launchpad still not linkifying apt: URLs.

  • Someone providing help on Twitter wants to make it as easy as possible for the person they’re helping to people to install a particular package, despite Twitter not linkifying apt: URLs. (A few URL-shortening services do, but many don’t, and it’s tedious to work out which is which.)

Behavior

flow-chart.jpg

On any Web request, apt.ubuntu.com should first examine the request URL.

  • If it is /, the server should return a static “Ubuntu Software Center Web links” page explaining Ubuntu Software Center Web links, including instructions on how to make a link.

  • If it is of the form /p/packagename (where packagename consists only of valid characters for a package name), continue to the next step.

  • If it is anything else, the server should return an HTTP 400 error page, including instructions on how to make a correct Web link.

If the URL is of the form /p/packagename, the server should next examine the User-Agent: header to determine whether the browser is running on Ubuntu.

  • If it is not, it should return an HTTP 400 error page, “Try Ubuntu”, which briefly describes the Ubuntu Software Center and has a “Get Ubuntu Now” link to http://www.ubuntu.com/getubuntu.

  • If it is continue to the next step.

Next, the server should display an HTTP 200 “One moment…” page with an indeterminate progress animation, so that the user has something to look at while Ubuntu Software Center is launching.

Next, it should open the URL apt:packagename. The most reliable way of doing this is probably (but not definitely) a <meta http-equiv="refresh">.

Once that is done, a script in the “One moment…” page should wait a few seconds, then determine whether the browser window has any session history. If it does, it should go back one page (i.e. to the page that the apt.ubuntu.com link was on in the first place). If it does not, it should close the window (because the window that was opened solely to launch the Ubuntu Software Center, and this window should not hang around).

For all HTML, images, and CSS (but not JavaScript), the Design team will provide artwork and text.

Future enhancements

  • Extend apt.ubuntu.com to cover other already-existing apt: URL syntaxes, e.g. multiple packages in a single URL, or packages from a particular Ubuntu component.

  • Extend the variety of apt: syntaxes to cover things like search results, departments, and/or vendors. Each would follow a three-stage process:

    1. Ubuntu Software Center handles the apt: link correctly

    2. apt.ubuntu.com redirects the equivalent link correctly

    3. Ubuntu Software Center generates the equivalent apt.ubuntu.com link.

AptUrlRedirector (last edited 2010-12-15 12:35:02 by eth0)