SDK: Application Data Folders
Applications running under confinement don't have access to $HOME or $XDG_ locations freely as on the classic desktop. Most locations are ready-only or mediated by a service.
Blueprint information
- Status:
- Not started
- Approver:
- Zoltan Balogh
- Priority:
- Undefined
- Drafter:
- Cris Dywan
- Direction:
- Approved
- Assignee:
- Cris Dywan
- Definition:
- Drafting
- Series goal:
- Accepted for saucy
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Use cases:
U1Db. Databases belong into "share".
Proposed solution: default relative paths to the right location.
C++ QML plugin code. May need either "share" or "cache".
Needs API functions to access files.
QtWebKit
When WebKit is used, files are automatically written to "share".
localStorage
Using localStorage API may use "share" and "cache" (currently /var/tmp/).
Standard Qt5 API that works on the desktop today:
QStandardPa
Translations
On the desktop gettext reads .mo files containing translations from /usr/share/locale. On click packages it might make sense to read them from /opt/click.
Questions:
Which locations can we support with and without confinement?
~/.
~/.
The $APP_ID used here is a placeholder that preferrably isn't exposed in API.
Do pure QML apps need access to absolute locations?
Unlikely. By design most QML API doesn't expose raw file access.
What about Firefox, LibreOffice and friends?
It's not clear if they will run under confinement - if they do, this only affects where internal data is stored, none of the GUI facing locations. That needs to be sorted separately.
Should XDG variables be overridden to enforce confined paths?
This should be seen as a last resort and preferrably avoided. Applications can be run in different ways and under different environments ie. Unity, KDE, Elementary etc and even if variables could be overriden per application it would result in complicated paths.
Resources:
https:/
https:/
Work Items
Work items for ubuntu-13.10:
[kalikiana] Collect use cases for app data storage: DONE
[kalikiana] Ensure U1Db-Qt uses a sensible storage folder: DONE
[kalikiana] Implement app-specific environment variables in confinement: DONE
Dependency tree
* Blueprints in grey have been implemented.