855956bcf241d022effb70abe51f74b177b98f6f
[src/app-framework-main.git] / conf / generate-unit-conf / binder.inc
1 dnl vim: set filetype=sysctl.conf.m4 syntax=sysctl.conf.m4:
2
3 IF_AGL_DEVEL
4 X-AFM-http-port={{:#metadata.http-port}}
5 ELSE
6 IF_NOT_CONTENT(application/vnd.agl.service)
7 X-AFM--http-port={{:#metadata.http-port}}
8 ENDIF
9 ENDIF
10
11 ExecStart=/usr/bin/afb-daemon \
12         --name afbd-TARGET \
13         --rootdir={{:#metadata.install-dir}} \
14         --workdir=APP_DATA_DIR/{{id}} \
15 IF_AGL_DEVEL \
16         --verbose \
17         --verbose \
18         --monitoring \
19         --port={{:#metadata.http-port}} \
20         --token=HELLO \
21         --roothttp=ON_CONTENT(application/vnd.agl.service, ., ON_PERM(:public:no-htdocs, ., htdocs)) \
22 ELSE \
23         IF_CONTENT(application/vnd.agl.service) \
24                 --no-httpd \
25         ELSE \
26                 --port={{:#metadata.http-port}} \
27                 --random-token \
28                 --roothttp=ON_PERM(:public:no-htdocs, ., htdocs) \
29         ENDIF \
30 ENDIF \
31         ON_PERM(:public:applications:read, --alias=/icons:{{:#metadata.icons-dir}}) \
32         {{#required-api}} \
33                 ON_VALUE(auto|ws,       --ws-client=unix:%t/apis/ws/{{name}}) \
34                 ON_VALUE(dbus,          --dbus-client={{name}}) \
35                 ON_VALUE(link,          --binding=%t/apis/lib/{{name}}) \
36                 ON_VALUE(cloud,         --cloud-client={{name}}) \
37                 ON_VALUE(local,         --binding={{:#metadata.install-dir}}/{{name}}) \
38         {{/required-api}} \
39         {{#provided-api}} \
40                 ON_VALUE(auto|ws,       --ws-server=sd:{{name}}) \
41                 ON_VALUE(dbus,          --dbus-server={{name}}) \
42         {{/provided-api}} \
43         ON_CONTENT(text/html,                   --exec /usr/bin/web-runtime http://localhost:@p/{{content.src}}?token=@t) \
44         ON_CONTENT(application/vnd.agl.native,  --exec {{:#metadata.install-dir}}/{{content.src}} @p @t)
45