SuggestedPackagesForFiletypesSpec

Differences between revisions 4 and 20 (spanning 16 versions)
Revision 4 as of 2006-06-22 12:47:51
Size: 3779
Editor: ALagny-109-1-9-136
Comment: view
Revision 20 as of 2008-08-06 16:37:32
Size: 6300
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
 * '''Launchpad Entry''': https://launchpad.net/distros/ubuntu/+spec//suggest-packages-for-filetypes
 * '''Contributors''': MichaelVogt, MattZimmerman, JeffWaugh
 * '''Packages affected''': natilus, gnome-app-install
 * '''Launchpad Entry''': https://launchpad.net/distros/ubuntu/+spec/suggest-packages-for-filetypes
 * '''Contributors''': MichaelVogt, MattZimmerman, JeffWaugh, IanJackson
 * '''Packages affected''': nautilus, gnome-app-install
Line 9: Line 9:
Ubuntu does not install packages for every file type there is but if a user wants to open a document that is not supported out-of-the-box there should be a option to install the required package(s) to work with that file type. Ubuntu does not install packages for every file type in the world. If a user wants to open a document that is not supported out-of-the-box there should be a option to install the required package(s) to work with that file type.
Line 13: Line 13:
We have the information about the suppported mime-types for most packages via the desktop files already. This information should be used to present a user-friendly way to install packages. We already have the information about the supported MIME-types for most packages via the desktop files. This information should be used to present a user-friendly way to install packages.
Line 17: Line 17:
 1. Alice clicks on a .xxx document and gets a error message that this file-stype is not supported. She is frustrated by the lack of options.  1. Alice clicks on a .xxx document. Instead of getting a error message that this file-type is not supported and being frustrated by the lack of options, she is presented with a dialog asking if she wants to install the application she needs to view the document.
Line 21: Line 21:
Modifications to gnome-app-install and nautilus packages needs to be done. Modifications to gnome-app-install and nautilus packages need to be done.
Line 27: Line 27:
If a user clicks on a unsupported filetype with nautilus it should talk to gnome-app-install (either via dbus or the commandline) and make it show a dialog of the applications that could possibly open that file-type. Those applications should be ranked with the popcon information and it should be a subset of the normal gnome-app-install window (without the sections on the left and the search field on the top). Nautilus needs to pass the mime-type and the actual path to the file to gnome-app-install. When the user selects "install" and it is installed, g-a-i should open the file with the just installed application. If a user clicks on a unsupported filetype with nautilus it should talk to gnome-app-install (either via dbus or the commandline) and make it show a dialog of the applications that could possibly open that file-type. Those applications should be ranked with the popcon information and it should be a subset of the normal gnome-app-install window (without the sections on the left and the search field on the top). Nautilus needs to pass the MIME-type and the actual path to the file to gnome-app-install. When the user selects "install" and it is installed, g-a-i should open the file with the just installed application.
Line 29: Line 29:
The interface should honor the "show unsupported", "show restricted" selections of the user. If that results in not showing any application to the user we need to show a entry that explains that with the current view setting nothing can be displayed but that this can be changed with the view settings. The interface should honor the "show unsupported", "show restricted" selections of the user. If that results in not showing any application to the user we need to show a entry that explains that with the current view setting nothing can be displayed but that this can be changed with the view settings. If the user selects a proprietary application (like RealPlayer) the usual dialog about adding Channels/LicenseUri comes up. '''Note''' however that at present data will only be available for security-supported software (see Security, below).

The actual interaction with gnome-app-install can be done using command line arguments because some packages (like firefox) do not support invoking it using dbus. But additional dbus support should be added.

The .desktop data is already collected in the gnome-app-install package including application name, MIME types, and pocket.
Line 33: Line 37:
The current gnome-app-install tree on http://people.ubuntu.com/~mvo/bzr/gnome-app-install/gai--main/ supports a "--mime-type=" argument that will show only packages matching that mime-type. The optimizations are not done yet because it turns out that using the pyxdg module to generate the menu makes matters not as easy as was hoped initially.

== Security considerations ==

If we would be installing an unsupported program there are problematic security implications: if any unsupported program has a vulnerability to bad data then the user could easily be induced to install the vulnerable program by the presence of the malicious data.

Therefore for now we will support this primarily for main.

To support this for universe, where there is no security support, we adopt the following solution:
 * gnome-app-install will contain a whitelist of non-main programs for which this functionality will be enabled
 * for a program to be in the whitelist, we promise at least to take steps to be aware of any security problems that appear in it (eg, by following upstream announce list) and to fix the problem if they do.
 * Here `fix' can and often will mean issuing a new gnome-app-install in edgy-security which removes the package from the whitelist.

The result will be that the automatic suggestion and installation will occur for packages in main and a small subset of packages in universe. For users who are insane (or expert) and want to have it for all packages in universe, there will be a gconf key (not settable via the UI) to trigger installation for all available packages regardless of the whitelist.

When a program is not offered due to lack of a whitelist entry, the "cannot open this file" message will be different, so that the user can distinguish "we do not know any application for this file" and "no application with sufficient security assurance could be found".
Line 35: Line 56:
The lookup if the mime-type can be supported needs to be very fast (and pre-cached) because if  we actually do not have any package that supports the given mime-type we need to tell nautilus so that it can display a error dialog. That one should be better worded than the current: "Couldn't display '%s'". Something like "There is no application available to view: '%s'" is more appropriate. The lookup if the MIME-type can be supported needs to be very fast (and pre-cached) because if we actually do not have any package that supports the given MIME-type we need to tell nautilus so that it can display a error dialog. That one should be better worded than the current: "Couldn't display '%s'". Something like "There is no application available to view: '%s'" is more appropriate.
Line 37: Line 58:
== BOF discussion bits == == File formats and interfaces ==
Line 39: Line 60:
  - if we have something to install display a dialog with the information and ask the user if he wants to install it - this should most likely bring up gnome-app-install in a special mode without "sections" and "search" and a header with a explaination. open issue: what to do when there is only something in "unsupported" but "unsupported" is unchecked in the g-a-i checkbox. we bring up a text that explains that a component is not checked and expand/show when the checkbox is checked /usr/share/app-install/gai-mime-map.gdbm is a gdbm database which maps the mime type to a space-separated list of component/packagename strings.
Line 41: Line 62:
  - make sure that commerial stuff (vmware-player, realplayer) does the right thing (display license uri etc) /apps/gnome-app-install/mime-whitelist-components is a gconf key, a list of strings, defaulting to just main.
Line 43: Line 64:
  - the dialog invokes gnome-app-install via dbus/commandline and installs the stuff /usr/share/gnome-app-install/mime-whitelist-packages and /etc/gnome-app-install/mime-whitelist-packages are optional text files whose lines are package names. Both of these files may contain #-comments.
Line 45: Line 66:
  - sort by popularity ranking! nautilus invokes gnome-app-install --mime-type=... uri urifordisplay which looks up the mime type and does the appropriate thing: either launching itself to offer applications, or displaying an error dialogue box. (Without uri, the dialogues are replaced by messages on stderr with an appropriate exit status.) If an application is installed then the file is opened again.
Line 47: Line 68:
  - when the application is installed, it is launched with the file that was requested (so g-a-i needs the filename too)

  - we need a commandline interface (for e.g. firefox that does not use dbus) and optionally a dbus interface

 * make a nicer dialog if a unknown file-type comes up (instead of the current

== Implementation ==

=== Code ===

=== Data preservation and migration ===
gnome-app-install --mime-type=.... has the following defined exit statuses: 4 - no entry found; 5 - entries found but not in whitelist; 6 - we displayed an error dialogue box.

Summary

Ubuntu does not install packages for every file type in the world. If a user wants to open a document that is not supported out-of-the-box there should be a option to install the required package(s) to work with that file type.

Rationale

We already have the information about the supported MIME-types for most packages via the desktop files. This information should be used to present a user-friendly way to install packages.

Use cases

  1. Alice clicks on a .xxx document. Instead of getting a error message that this file-type is not supported and being frustrated by the lack of options, she is presented with a dialog asking if she wants to install the application she needs to view the document.

Scope

Modifications to gnome-app-install and nautilus packages need to be done.

Design

The information about the supported filetypes is part of the desktop file for the applications. We generate a cached version (pickle?) of the desktop-files database that contains the required information for gnome-app-install.

If a user clicks on a unsupported filetype with nautilus it should talk to gnome-app-install (either via dbus or the commandline) and make it show a dialog of the applications that could possibly open that file-type. Those applications should be ranked with the popcon information and it should be a subset of the normal gnome-app-install window (without the sections on the left and the search field on the top). Nautilus needs to pass the MIME-type and the actual path to the file to gnome-app-install. When the user selects "install" and it is installed, g-a-i should open the file with the just installed application.

The interface should honor the "show unsupported", "show restricted" selections of the user. If that results in not showing any application to the user we need to show a entry that explains that with the current view setting nothing can be displayed but that this can be changed with the view settings. If the user selects a proprietary application (like RealPlayer) the usual dialog about adding Channels/LicenseUri comes up. Note however that at present data will only be available for security-supported software (see Security, below).

The actual interaction with gnome-app-install can be done using command line arguments because some packages (like firefox) do not support invoking it using dbus. But additional dbus support should be added.

The .desktop data is already collected in the gnome-app-install package including application name, MIME types, and pocket.

Implementation

The current gnome-app-install tree on http://people.ubuntu.com/~mvo/bzr/gnome-app-install/gai--main/ supports a "--mime-type=" argument that will show only packages matching that mime-type. The optimizations are not done yet because it turns out that using the pyxdg module to generate the menu makes matters not as easy as was hoped initially.

Security considerations

If we would be installing an unsupported program there are problematic security implications: if any unsupported program has a vulnerability to bad data then the user could easily be induced to install the vulnerable program by the presence of the malicious data.

Therefore for now we will support this primarily for main.

To support this for universe, where there is no security support, we adopt the following solution:

  • gnome-app-install will contain a whitelist of non-main programs for which this functionality will be enabled
  • for a program to be in the whitelist, we promise at least to take steps to be aware of any security problems that appear in it (eg, by following upstream announce list) and to fix the problem if they do.
  • Here `fix' can and often will mean issuing a new gnome-app-install in edgy-security which removes the package from the whitelist.

The result will be that the automatic suggestion and installation will occur for packages in main and a small subset of packages in universe. For users who are insane (or expert) and want to have it for all packages in universe, there will be a gconf key (not settable via the UI) to trigger installation for all available packages regardless of the whitelist.

When a program is not offered due to lack of a whitelist entry, the "cannot open this file" message will be different, so that the user can distinguish "we do not know any application for this file" and "no application with sufficient security assurance could be found".

Open issues

The lookup if the MIME-type can be supported needs to be very fast (and pre-cached) because if we actually do not have any package that supports the given MIME-type we need to tell nautilus so that it can display a error dialog. That one should be better worded than the current: "Couldn't display '%s'". Something like "There is no application available to view: '%s'" is more appropriate.

File formats and interfaces

/usr/share/app-install/gai-mime-map.gdbm is a gdbm database which maps the mime type to a space-separated list of component/packagename strings.

/apps/gnome-app-install/mime-whitelist-components is a gconf key, a list of strings, defaulting to just main.

/usr/share/gnome-app-install/mime-whitelist-packages and /etc/gnome-app-install/mime-whitelist-packages are optional text files whose lines are package names. Both of these files may contain #-comments.

nautilus invokes gnome-app-install --mime-type=... uri urifordisplay which looks up the mime type and does the appropriate thing: either launching itself to offer applications, or displaying an error dialogue box. (Without uri, the dialogues are replaced by messages on stderr with an appropriate exit status.) If an application is installed then the file is opened again.

gnome-app-install --mime-type=.... has the following defined exit statuses: 4 - no entry found; 5 - entries found but not in whitelist; 6 - we displayed an error dialogue box.


CategorySpec

SuggestedPackagesForFiletypesSpec (last edited 2008-08-06 16:37:32 by localhost)