afm-unit.conf: remove invocation of PAM
[src/app-framework-main.git] / conf / afm-unit-debug.conf.in
1 ;---------------------------------------------------------------------------------
2 ; File:
3 ;
4 ;    afm-unit.conf
5 ;
6 ; Role:
7 ;
8 ;    Configure how installation of widget produces unit files for systemd
9 ;
10 ; Processing and format:
11 ;
12 ;    1. File load
13 ;
14 ;           Lines beginning with ; are firstly removed
15 ;
16 ;    2. File instantiation
17 ;
18 ;           Mustache (extended) substitutions are applied using JSON
19 ;           data deduced from config.xml file of the widget.
20 ;
21 ;    3. Extraction of units
22 ;
23 ;           Extract produced units, pack it (remove empty lines and directives)
24 ;
25 ; Directives:
26 ;
27 ;    Any directive occupy one whole line starting with %
28 ;
29 ;     - %nl
30 ;
31 ;             produce an empty line at the end
32 ;
33 ;     - %begin systemd-unit
34 ;     - %end systemd-unit
35 ;
36 ;             delimit the produced unit
37 ;
38 ;     - %systemd-unit user
39 ;     - %systemd-unit system
40 ;
41 ;             tells the kind of unit (user/system)
42 ;
43 ;     - %systemd-unit service NAME
44 ;     - %systemd-unit socket NAME
45 ;
46 ;             gives the name and type of the unit
47 ;
48 ;     - %systemd-unit wanted-by NAME
49 ;
50 ;             tells to install a link to unit in the wants of NAME
51 ;
52 ; Setting variables:
53 ;
54 ;    AFM uses the feature of systemd that completely ignores options prefixed
55 ;    with X-
56 ;
57 ;    Consequently, options starting with X-AFM- are recorded as public data
58 ;    about the application and options starting starting with X-AFM-- are
59 ;    recorded as private data.
60 ;
61 ;    Examples:
62 ;
63 ;        X-AFM-description={{description}}
64 ;
65 ;              Records the description of the unit in the field "description"
66 ;              of both the public and private object describing the unit.
67 ;
68 ;        X-AFM--wgtdir={{:#metadata.install-dir}}
69 ;
70 ;              Records the installation directory path in the field "wgtdir"
71 ;              of the private object only.
72 ;
73 ;---------------------------------------------------------------------------------
74 {{#targets}}
75
76 ;---------------------------------------------------------------------------------
77 ;----        P R O V I D E D   U N I T S                                      ----
78 ;---------------------------------------------------------------------------------
79 %begin systemd-unit
80
81 # auto generated by wgtpkg-unit for {{:id}} version {{:version}} target {{:#target}} of {{:idaver}}
82 %nl
83
84 [Unit]
85 Description={{description}}
86 X-AFM-description={{description}}
87 X-AFM-name={{name.content}}
88 X-AFM-shortname={{name.short}}
89 #***************
90 # use X-AFM-id={{:id}}--{{:ver}}--{{:#target}}
91 # instead of:
92 X-AFM-id={{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}
93 # when home screen will use real ids
94 #**************
95 X-AFM-version={{:version}}
96 X-AFM-author={{author.content}}
97 X-AFM-author-email={{author.email}}
98 X-AFM-width={{width}}
99 X-AFM-height={{height}}
100 {{#icon}}
101 X-AFM-icon={{:#metadata.install-dir}}/{{:src}}
102 {{/icon}}
103 X-AFM--ID={{:id}}
104 X-AFM--target-name={{:#target}}
105 X-AFM--content={{content.src}}
106 X-AFM--type={{content.type}}
107 X-AFM--wgtdir={{:#metadata.install-dir}}
108 X-AFM--workdir={{&#metadata.app-data-dir}}/{{:id}}
109 %nl
110
111 Wants=sockets.target
112
113 # Adds check to smack
114 ConditionSecurity=smack
115 %nl
116
117 # Automatic bound to required api
118 {{#required-api}}
119 {{#value=auto|ws}}
120 BindsTo=afm-api-ws-{{name}}@%i.socket
121 After=afm-api-ws-{{name}}@%i.socket
122 {{/value=auto|ws}}
123 {{/required-api}}
124 %nl
125
126 [Service]
127 EnvironmentFile=-@afm_confdir@/unit.env.d/*
128 SmackProcessLabel=User::App::{{:id}}
129 SuccessExitStatus=0 SIGKILL
130
131 #PAMName=su
132 User=%i
133 Slice=user-%i.slice
134
135 CapabilityBoundingSet=
136 AmbientCapabilities=
137
138 {{#required-permission}}
139   {{#urn:AGL:permission::platform:no-oom}}      OOMScoreAdjust=-500             {{/urn:AGL:permission::platform:no-oom}}
140   {{#urn:AGL:permission::partner:real-time}}    IOSchedulingClass=realtime      {{/urn:AGL:permission::partner:real-time}}
141 #  {{^urn:AGL:permission::partner:real-time}}    RestrictRealtime=on             {{/urn:AGL:permission::partner:real-time}}
142   {{#urn:AGL:permission::public:display}}       SupplementaryGroups=display     {{/urn:AGL:permission::public:display}}
143   {{^urn:AGL:permission::public:syscall:clock}} SystemCallFilter=~@clock        {{/urn:AGL:permission::public:syscall:clock}}
144 {{/required-permission}}
145 %nl
146
147 WorkingDirectory=-{{&#metadata.app-data-dir}}/{{:id}}
148 ExecStartPre=/bin/mkdir -p {{&#metadata.app-data-dir}}/{{:id}}
149 Environment=AFM_APP_INSTALL_DIR={{:#metadata.install-dir}}
150 Environment=PATH=/usr/sbin:/usr/bin:/sbin:/bin:{{:#metadata.install-dir}}
151 Environment=XDG_DATA_HOME={{&#metadata.app-data-dir}}/{{:id}}
152 Environment=XDG_CONFIG_HOME={{&#metadata.app-data-dir}}/{{:id}}
153 Environment=XDG_CACHE_HOME={{&#metadata.app-data-dir}}/{{:id}}
154 Environment=XDG_RUNTIME_DIR=/run/user/%i
155 Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%i/bus
156
157 ; Needed to enable debug
158 Environment=AFM_ID={{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}
159 EnvironmentFile=-/var/run/afm-debug/{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}.env
160
161 %systemd-unit system
162 {{#required-permission.urn:AGL:permission::public:hidden}}\
163 %systemd-unit service afm-service-{{:id}}--{{:ver}}--{{:#target}}@
164 {{/required-permission.urn:AGL:permission::public:hidden}}\
165 {{^required-permission.urn:AGL:permission::public:hidden}}\
166 %systemd-unit service afm-appli-{{:id}}--{{:ver}}--{{:#target}}@
167 {{/required-permission.urn:AGL:permission::public:hidden}}\
168
169 Environment=LD_LIBRARY_PATH=$ORIGIN/lib
170
171 SyslogIdentifier=afbd-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}
172 StandardInput=null
173 StandardOutput=journal
174 StandardError=journal
175
176 ;---------------------------------------------------------------------------------
177 ;----   text/html  application/vnd.agl.native  application/vnd.agl.service    ----
178 ;---------------------------------------------------------------------------------
179 {{#content.type=text/html|application/vnd.agl.native|application/vnd.agl.service}}
180
181 X-AFM--http-port={{:#metadata.http-port}}
182
183 ExecStart=/usr/bin/afb-daemon \
184         --name afbd-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}} \
185         --rootdir={{:#metadata.install-dir}} \
186         --workdir={{&#metadata.app-data-dir}}/{{id}} \
187         --port={{:#metadata.http-port}} \
188         --token=HELLO \
189         --verbose \
190         --monitoring \
191         {{^content.type=application/vnd.agl.service}} \
192                 {{#required-permission.urn:AGL:permission::public:no-htdocs}}\
193                         --roothttp=. \
194                 {{/required-permission.urn:AGL:permission::public:no-htdocs}}\
195                 {{^required-permission.urn:AGL:permission::public:no-htdocs}}\
196                         --roothttp=htdocs \
197                 {{/required-permission.urn:AGL:permission::public:no-htdocs}}\
198         {{/content.type=application/vnd.agl.service}} \
199         {{#content.type=application/vnd.agl.service}} \
200                 --roothttp=. \
201         {{/content.type=application/vnd.agl.service}} \
202         {{#required-permission.urn:AGL:permission::public:applications:read}}\
203                 --alias=/icons:{{:#metadata.icons-dir}} \
204         {{/required-permission.urn:AGL:permission::public:applications:read}}\
205         {{#required-api}}\
206                 {{#value=auto}}\
207                         --ws-client=unix:%t/apis/ws/{{name}} \
208                 {{/value=auto}}\
209                 {{#value=ws}}\
210                         --ws-client=unix:%t/apis/ws/{{name}} \
211                 {{/value=ws}}\
212                 {{#value=dbus}}\
213                         --dbus-client={{name}} \
214                 {{/value=dbus}}\
215                 {{#value=link}}\
216                         --binding=%t/apis/lib/{{name}} \
217                 {{/value=link}}\
218                 {{#value=cloud}}\
219                         --cloud-client={{name}} \
220                 {{/value=cloud}}\
221                 {{#value=local}}\
222                         --binding={{:#metadata.install-dir}}/{{name}} \
223                 {{/value=local}}\
224         {{/required-api}}\
225         {{#provided-api}}\
226                 {{#value=auto}}\
227                         {{^required-permission.urn:AGL:permission::partner:service:no-ws}}\
228                                 --ws-server=sd:{{name}} \
229                         {{/required-permission.urn:AGL:permission::partner:service:no-ws}}\
230                         {{^required-permission.urn:AGL:permission::partner:service:no-dbus}}\
231                                 --dbus-server={{name}} \
232                         {{/required-permission.urn:AGL:permission::partner:service:no-dbus}}\
233                 {{/value=auto}}\
234                 {{#value=ws}}\
235                         --ws-server=sd:{{name}} \
236                 {{/value=ws}}\
237                 {{#value=dbus}}\
238                         --dbus-server={{name}} \
239                 {{/value=dbus}}\
240         {{/provided-api}}\
241         {{#content.type=text/html}}\
242                 --exec /usr/bin/web-runtime http://localhost:@p/{{content.src}}?token=@t
243         {{/content.type=text/html}}\
244         {{#content.type=application/vnd.agl.native}}\
245                 --exec {{:#metadata.install-dir}}/{{content.src}} @p @t
246         {{/content.type=application/vnd.agl.native}}
247
248 {{/content.type=text/html|application/vnd.agl.native|application/vnd.agl.service}}
249
250
251 ;---------------------------------------------------------------------------------
252 ;----                 application/x-executable                                ----
253 ;---------------------------------------------------------------------------------
254 {{#content.type=application/x-executable}}
255
256 ExecStart={{:#metadata.install-dir}}/{{content.src}}
257
258 {{/content.type=application/x-executable}}
259
260 ;---------------------------------------------------------------------------------
261 ; auto start
262 ;---------------------------------------------------------------------------------
263 {{#required-permission.urn:AGL:permission::system:run-by-default}}
264 %nl
265 [Install]
266 WantedBy=default.target
267 %systemd-unit wanted-by default.target
268 {{/required-permission.urn:AGL:permission::system:run-by-default}}
269
270 %end systemd-unit
271
272
273 ;---------------------------------------------------------------------------------
274 ;----        P R O V I D E D   A P I S                                        ----
275 ;---------------------------------------------------------------------------------
276
277 {{#provided-api}}
278 {{#value=ws|auto}}
279
280 %begin systemd-unit
281
282 # auto generated by wgtpkg-unit for {{:id}} version {{:version}} target {{:#target}} of {{:idaver}}
283 #
284 %systemd-unit system
285 %systemd-unit socket afm-api-ws-{{name}}@
286
287 [Socket]
288 SmackLabel=*
289 ListenStream=%t/apis/ws/{{name}}
290 FileDescriptorName={{name}}
291
292 {{#required-permission.urn:AGL:permission::public:hidden}}\
293 Service=afm-service-{{:id}}--{{:ver}}--{{:#target}}@%i.service
294 {{/required-permission.urn:AGL:permission::public:hidden}}\
295 {{^required-permission.urn:AGL:permission::public:hidden}}\
296 Service=afm-appli-{{:id}}--{{:ver}}--{{:#target}}@%i.service
297 {{/required-permission.urn:AGL:permission::public:hidden}}\
298
299 ;---------------------------------------------------------------------------------
300 %nl
301 [Install]
302 WantedBy=sockets.target
303 %systemd-unit wanted-by sockets.target
304 ;---------------------------------------------------------------------------------
305
306 %end systemd-unit
307
308 {{/value=ws|auto}}
309 {{/provided-api}}
310
311 {{/targets}}
312