b3a6a1850bc10dec7be9d7b2c74b7f0a2d716cf2
[src/app-framework-binder.git] / docs / afb-daemon-options.md
1 # Launching options of afb-daemon
2
3 The launch options for binder **afb-daemon** are:
4
5 ```
6  -v, --verbose           Verbose Mode, repeat to increase verbosity
7  -q, --quiet             Quiet Mode, repeat to decrease verbosity
8  -l, --log=xxxx          Tune log level
9      --foreground        Get all in foreground mode
10      --daemon            Get all in background mode
11  -n, --name=xxxx         Set the visible name
12  -p, --port=xxxx         HTTP listening TCP port  [default 1234]
13      --roothttp=xxxx     HTTP Root Directory [default no root http (files not served but apis still available)]
14      --rootbase=xxxx     Angular Base Root URL [default /opa]
15      --rootapi=xxxx      HTML Root API URL [default /api]
16      --alias=xxxx        Multiple url map outside of rootdir [eg: --alias=/icons:/usr/share/icons]
17      --apitimeout=xxxx   Binding API timeout in seconds [default 20]
18      --cntxtimeout=xxxx  Client Session Context Timeout [default 32000000]
19      --cache-eol=xxxx    Client cache end of live [default 100000]
20  -w, --workdir=xxxx      Set the working directory [default: $PWD or current working directory]
21  -u, --uploaddir=xxxx    Directory for uploading files [default: workdir]
22      --rootdir=xxxx      Root Directory of the application [default: workdir]
23      --ldpaths=xxxx      Load bindings from dir1:dir2:... [default = /opt/jobol/lib64/afb]
24  -b, --binding=xxxx      Load the binding of path
25      --weak-ldpaths=xxxx Same as --ldpaths but ignore errors
26      --no-ldpaths        Discard default ldpaths loading
27  -t, --token=xxxx        Initial Secret [default=random, use --token= to allow any token]
28  -r, --random-token      Enforce a random token
29  -V, --version           Display version and copyright
30  -h, --help              Display this help
31      --ws-client=xxxx    Bind to an afb service through websocket
32      --ws-server=xxxx    Provide an afb service through websockets
33  -A, --auto-api=xxxx     Automatic load of api of the given directory
34      --session-max=xxxx  Max count of session simultaneously [default 200]
35      --tracereq=xxxx     Log the requests: no, common, extra, all
36      --traceditf=xxxx    Log the daemons: no, common, all
37      --tracesvc=xxxx     Log the services: no, all
38      --traceevt=xxxx     Log the events: no, common, extra, all
39      --traceses=xxxx     Log the sessions: no, all
40      --traceapi=xxxx     Log the apis: no, common, api, event, all
41  -c, --call=xxxx         call at start format of val: API/VERB:json-args
42      --no-httpd          Forbid HTTP service
43  -e, --exec              Execute the remaining arguments
44  -M, --monitoring        Enable HTTP monitoring at <ROOT>/monitoring/
45 ```
46
47 ## help
48
49 Prints help with available options
50
51 ## version
52
53 Display version and copyright
54
55 ## verbose
56
57 Increases the verbosity, can be repeated
58
59 ## quiet
60
61 Decreases the verbosity, can be repeated
62
63 ## log=xxxx
64
65 Tune the log level mask. The levels are:
66
67  - error
68  - warning
69  - notice
70  - info
71  - debug
72
73 The level can be set using + or -.
74
75 | Examples | descritpion
76 |-----------------|-------------------
77 | error,warning   | selects only the levels error and warning
78 | +debug          | adds level debug to the current verbosity
79 | -warning        | remove the level warning from the current verbosity
80 | +warning-debug,info | Adds error and remove errors and warnings
81
82 ## port=xxxx
83
84 HTTP listening TCP port  [default 1234]
85
86 ## workdir=xxxx
87
88 Directory where the daemon must run [default: $PWD if defined
89 or the current working directory]
90
91 ## uploaddir=xxxx
92
93 Directory where uploaded files are temporarily stored [default: workdir]
94
95 ## rootdir=xxxx
96
97 Root directory of the application to serve [default: workdir]
98
99 ## roothttp=xxxx
100
101 Directory of HTTP served files. If not set, files are not served
102 but apis are still accessible.
103
104 ## rootbase=xxxx
105
106 Angular Base Root URL [default /opa]
107
108 This is used for any application of kind OPA (one page application).
109 When set, any missing document whose url has the form /opa/zzz
110 is translated to /opa/#!zzz
111
112 ## rootapi=xxxx
113
114 HTML Root API URL [default /api]
115
116 The bindings are available within that url.
117
118 ## alias=xxxx
119
120 Maps a path located anywhere in the file system to the
121 a subdirectory. The syntax for mapping a PATH to the
122 subdirectory NAME is: --alias=/NAME:PATH.
123
124 Example: --alias=/icons:/usr/share/icons maps the
125 content of /usr/share/icons within the subpath /icons.
126
127 This option can be repeated.
128
129 ## apitimeout=xxxx
130
131 binding API timeout in seconds [default 20]
132
133 Defines how many seconds maximum a method is allowed to run.
134 0 means no limit.
135
136 ## cntxtimeout=xxxx
137
138 Client Session Timeout in seconds [default 32000000 that is 1 year]
139
140 ## cache-eol=xxxx
141
142 Client cache end of live [default 100000 that is 27,7 hours]
143
144 ## session-max=xxxx
145
146 Maximum count of simultaneous sessions [default 200]
147
148 ## ldpaths=xxxx
149
150 Load bindings from given paths separated by colons
151 as for dir1:dir2:binding1.so:... [default = $libdir/afb]
152
153 You can mix path to directories and to bindings.
154 The sub-directories of the given directories are searched
155 recursively.
156
157 The bindings are the files terminated by '.so' (the extension
158 so denotes shared object) that contain the public entry symbol.
159
160 ## weak-ldpaths=xxxx
161
162 Same as --ldpaths but instead of stopping on error, ignore errors and continue.
163
164 ## binding=xxxx
165
166 Load the binding of given path.
167
168 ## token=xxxx
169
170 Initial Secret token to authenticate.
171
172 If not set, no client can authenticate.
173
174 If set to the empty string, then any initial token is accepted.
175
176 ## random-token
177
178 Generate a random starting token. See option --exec.
179
180 ## ws-client=xxxx
181
182 Transparent binding to a binder afb-daemon service through a WebSocket.
183
184 The value of xxxx is either a unix naming socket, of the form "unix:path/api",
185 or an internet socket, of the form "host:port/api".
186
187 ## ws-server=xxxx
188
189 Provides a binder afb-daemon service through WebSocket.
190
191 The value of xxxx is either a unix naming socket, of the form "unix:path/api",
192 or an internet socket, of the form "host:port/api".
193
194 ## foreground
195
196 Get all in foreground mode (default)
197
198 ## daemon
199
200 Get all in background mode
201
202 ## no-httpd
203
204 Forbids HTTP serve
205
206 ## exec
207
208 Must be the last option for afb-daemon. The remaining
209 arguments define a command that afb-daemon will launch.
210 The sequences @p, @t and @@ of the arguments are replaced
211 with the port, the token and @.
212
213 ## tracereq=xxxx
214
215 Trace the processing of requests in the log file.
216
217 Valid values are 'no' (default), 'common', 'extra' or 'all'.
218
219 ## traceapi=xxxx
220
221 Trace the accesses to functions of class api.
222
223 Valid values are 'no' (default), 'common', 'api', 'event' or 'all'.
224
225 ## traceevt=xxxx
226
227 Trace the accesses to functions of class event.
228
229 Valid values are 'no' (default), 'common', 'extra' or 'all'.
230
231 ## call=xxx
232
233 Call a binding at start (can be be repeated).
234 The values are given in the form API/VERB:json-args.
235
236 Example: --call 'monitor/set:{"verbosity":{"api":"debug"}}'
237
238 ## monitoring
239
240 Enable HTTP monitoring at <ROOT>/monitoring/
241
242 ## name=xxxx
243
244 Set the visible name
245
246 ## auto-api=xxxx
247
248 Automatic activation of api of the given directory when the api is missing.
249