improves documentation formatting
[src/app-framework-main.git] / doc / application-framework.html
1 <html>
2 <head>
3   <link rel="stylesheet" type="text/css" href="doc.css">
4   <meta charset="UTF-8">
5 </head>
6 <body>
7 <a name="Application.framework"></a>
8 <h1>Application framework</h1>
9
10 <pre><code>version: 1
11 Date:    29 mai 2016
12 Author:  José Bollo
13 </code></pre>
14
15 <p><ul>
16  <li><a href="#Application.framework">Application framework</a>
17  <ul>
18   <li><a href="#Foreword">Foreword</a></li>
19   <li><a href="#Overview">Overview</a></li>
20   <li><a href="#Comparison.to.other.frameworks">Comparison to other frameworks</a>
21   <ul>
22    <li><a href="#Tizen.framework">Tizen framework</a></li>
23    <li><a href="#xdg-app">xdg-app</a></li>
24    <li><a href="#ostro">ostro</a>
25 </li>
26   </ul>
27   </li>
28  </ul>
29  </li>
30  <li><a href="#Organisation.of.directory.of.applications">Organisation of directory of applications</a>
31  <ul>
32   <li><a href="#Identity.of.installed.files">Identity of installed files</a></li>
33   <li><a href="#Labelling.the.directories.of.applications">Labelling the directories of applications</a></li>
34  </ul>
35  </li>
36  <li><a href="#Organisation.of.data">Organisation of data</a></li>
37  <li><a href="#Setting.Smack.rules.for.the.application">Setting Smack rules for the application</a></li>
38  <li><a href="#What.user.can.run.an.application.">What user can run an application?</a></li>
39 </ul></p>
40
41 <a name="Foreword"></a>
42 <h2>Foreword</h2>
43
44 <p>This document describes what we intend to do. It may happen that our
45 current implementation and the content of this document differ.</p>
46
47 <p>In case of differences, it is assumed that this document is right
48 and the implementation is wrong.</p>
49
50 <a name="Overview"></a>
51 <h2>Overview</h2>
52
53 <p>The application framework on top of the security framework
54 provides the components to install and uninstall applications
55 and to run it in a secured environment.</p>
56
57 <p>The goal is to manage applications and to hide the details of
58 the security framework to the applications.</p>
59
60 <p>For the reasons explained in introduction, we did not used the
61 application framework of Tizen as is but used an adaptation of it.</p>
62
63 <p>The basis is kept identical: the applications are distributed
64 in a digitally signed container that must match the specifications
65 of widgets (web applications). This is described by the technical
66 recomendations <a href="http://www.w3.org/TR/widgets" title="Packaged Web Apps">widgets</a> and <a href="http://www.w3.org/TR/widgets-digsig" title="XML Digital Signatures for Widgets">widgets-digsig</a> of the W3 consortium.</p>
67
68 <p>This model allows the distribution of HTML, QML and binary applications.</p>
69
70 <p>The management of signatures of the widget packages
71 This basis is not meant as being rigid and it can be extended in the
72 futur to include for example incremental delivery.</p>
73
74 <a name="Comparison.to.other.frameworks"></a>
75 <h2>Comparison to other frameworks</h2>
76
77 <a name="Tizen.framework"></a>
78 <h3>Tizen framework</h3>
79
80 <a name="xdg-app"></a>
81 <h3>xdg-app</h3>
82
83 <a name="ostro"></a>
84 <h3>ostro</h3>
85
86 <a name="Organisation.of.directory.of.applications"></a>
87 <h1>Organisation of directory of applications</h1>
88
89 <p>The main path for applivcations are: APPDIR/PKGID/VER.</p>
90
91 <p>Where:</p>
92
93 <ul>
94 <li>APPDIR is as defined above</li>
95 <li>PKGID is a directory whose name is the package identifier</li>
96 <li>VER is the version of the package MAJOR.MINOR</li>
97 </ul>
98
99
100 <p>This organisation has the advantage to allow several versions to leave together.
101 This is needed for some good reasons (rolling back) and also for less good reasons (user habits).</p>
102
103 <a name="Identity.of.installed.files"></a>
104 <h2>Identity of installed files</h2>
105
106 <p>All the files are installed as the user &ldquo;userapp&rdquo; and group &ldquo;userapp&rdquo;.
107 All files have rw(x) for user and r-(x) for group and others.</p>
108
109 <p>This allows any user to read the files.</p>
110
111 <a name="Labelling.the.directories.of.applications"></a>
112 <h2>Labelling the directories of applications</h2>
113
114 <a name="Organisation.of.data"></a>
115 <h1>Organisation of data</h1>
116
117 <p>The data of a user are in its directory and are labelled using the labels of the application</p>
118
119 <a name="Setting.Smack.rules.for.the.application"></a>
120 <h1>Setting Smack rules for the application</h1>
121
122 <p>For Tizen, the following rules are set by the security manager for each application.</p>
123
124 <pre><code>System ~APP~             rwx
125 System ~PKG~             rwxat
126 System ~PKG~::RO         rwxat
127 ~APP~  System            wx
128 ~APP~  System::Shared    rxl
129 ~APP~  System::Run       rwxat
130 ~APP~  System::Log       rwxa
131 ~APP~  _                 l
132 User   ~APP~             rwx
133 User   ~PKG~             rwxat
134 User   ~PKG~::RO         rwxat
135 ~APP~  User              wx
136 ~APP~  User::Home        rxl
137 ~APP~  User::App::Shared rwxat
138 ~APP~  ~PKG~             rwxat
139 ~APP~  ~PKG~::RO         rxl
140 </code></pre>
141
142 <p>Here, ~PKG~ is the identifier of the package and ~APP~ is the identifier of the application.</p>
143
144 <a name="What.user.can.run.an.application."></a>
145 <h1>What user can run an application?</h1>
146
147 <p>Not all user are able to run all applications.
148 How to manage that?</p>
149 </body>
150 </html>