1 # Launching options of afb-daemon
3 The launch options for binder **afb-daemon** are:
6 -v, --verbose Verbose Mode, repeat to increase verbosity
7 -c, --color Colorize the ouput
8 -q, --quiet Quiet Mode, repeat to decrease verbosity
9 -l, --log=xxxx Tune log level
10 --foreground Get all in foreground mode
11 --background Get all in background mode
12 -D, --daemon Get all in background mode
13 -n, --name=xxxx Set the visible name
14 -p, --port=xxxx HTTP listening TCP port [default 1234]
15 --roothttp=xxxx HTTP Root Directory [default no root http (files not served but apis still available)]
16 --rootbase=xxxx Angular Base Root URL [default /opa]
17 --rootapi=xxxx HTML Root API URL [default /api]
18 --alias=xxxx Multiple url map outside of rootdir [eg: --alias=/icons:/usr/share/icons]
19 --apitimeout=xxxx Binding API timeout in seconds [default 20]
20 --cntxtimeout=xxxx Client Session Context Timeout [default 32000000]
21 --cache-eol=xxxx Client cache end of live [default 100000]
22 -w, --workdir=xxxx Set the working directory [default: $PWD or current working directory]
23 -u, --uploaddir=xxxx Directory for uploading files [default: workdir] relative to workdir
24 --rootdir=xxxx Root Directory of the application [default: workdir] relative to workdir
25 --ldpaths=xxxx Load bindings from dir1:dir2:... [default: path of afb-dbus-binding.so]
26 -b, --binding=xxxx Load the binding of path
27 --weak-ldpaths=xxxx Same as --ldpaths but ignore errors
28 --no-ldpaths Discard default ldpaths loading
29 -t, --token=xxxx Initial Secret [default=random, use --token= to allow any token]
30 -r, --random-token Enforce a random token
31 -V, --version Display version and copyright
32 -h, --help Display this help
33 --ws-client=xxxx Bind to an afb service through websocket
34 --ws-server=xxxx Provide an afb service through websockets
35 -A, --auto-api=xxxx Automatic load of api of the given directory
36 --session-max=xxxx Max count of session simultaneously [default 200]
37 --tracereq=xxxx Log the requests: no, common, extra, 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 --traceglob=xxxx Log the globals: none, all
42 --traceditf=xxxx Log the daemons: no, common, all
43 --tracesvc=xxxx Log the services: no, all
44 --call=xxxx call at start, format of val: API/VERB:json-args
45 --no-httpd Forbid HTTP service
46 -e, --exec Execute the remaining arguments
47 -M, --monitoring Enable HTTP monitoring at <ROOT>/monitoring/
48 -C, --config=xxxx Load options from the given config file
49 -Z, --dump-config Dump the config to stdout and exit
50 -s, --set=xxxx Set parameters ([API]/[KEY]:JSON or {"API":{"KEY":JSON}}
51 -o, --output=xxxx Redirect stdout and stderr to output file (when --daemon)
52 --trap-faults=xxxx Trap faults: on, off, yes, no, true, false, 1, 0 (default: true)
57 Prints help with available options
61 Display version and copyright
65 Increases the verbosity, can be repeated
69 Add basic colorization to the ouput.
73 Decreases the verbosity, can be repeated
77 Tune the log level mask. The levels are:
85 The level can be set using + or -.
87 | Examples | descritpion
88 |-----------------|-------------------
89 | error,warning | selects only the levels error and warning
90 | +debug | adds level debug to the current verbosity
91 | -warning | remove the level warning from the current verbosity
92 | +warning-debug,info | Adds error and remove errors and warnings
96 HTTP listening TCP port [default 1234]
100 Directory where the daemon must run [default: $PWD if defined
101 or the current working directory]
105 Directory where uploaded files are temporarily stored [default: workdir]
109 Root directory of the application to serve [default: workdir]
113 Directory of HTTP served files. If not set, files are not served
114 but apis are still accessible.
118 Angular Base Root URL [default /opa]
120 This is used for any application of kind OPA (one page application).
121 When set, any missing document whose url has the form /opa/zzz
122 is translated to /opa/#!zzz
126 HTML Root API URL [default /api]
128 The bindings are available within that url.
132 Maps a path located anywhere in the file system to the
133 a subdirectory. The syntax for mapping a PATH to the
134 subdirectory NAME is: --alias=/NAME:PATH.
136 Example: --alias=/icons:/usr/share/icons maps the
137 content of /usr/share/icons within the subpath /icons.
139 This option can be repeated.
143 binding API timeout in seconds [default 20]
145 Defines how many seconds maximum a method is allowed to run.
150 Client Session Timeout in seconds [default 32000000 that is 1 year]
154 Client cache end of live [default 100000 that is 27,7 hours]
158 Maximum count of simultaneous sessions [default 200]
162 Load bindings from given paths separated by colons
163 as for dir1:dir2:binding1.so:... [default = $libdir/afb]
165 You can mix path to directories and to bindings.
166 The sub-directories of the given directories are searched
169 The bindings are the files terminated by '.so' (the extension
170 so denotes shared object) that contain the public entry symbol.
174 Same as --ldpaths but instead of stopping on error, ignore errors and continue.
178 Load the binding of given path.
182 Initial Secret token to authenticate.
184 If not set, no client can authenticate.
186 If set to the empty string, then any initial token is accepted.
190 Generate a random starting token. See option --exec.
194 Transparent binding to a binder afb-daemon service through a WebSocket.
196 The value of xxxx is either a unix naming socket, of the form "unix:path/api",
197 or an internet socket, of the form "host:port/api".
201 Provides a binder afb-daemon service through WebSocket.
203 The value of xxxx is either a unix naming socket, of the form "unix:path/api",
204 or an internet socket, of the form "host:port/api".
208 Get all in foreground mode (default)
212 Get all in background mode
220 Must be the last option for afb-daemon. The remaining
221 arguments define a command that afb-daemon will launch.
222 The sequences @p, @t and @@ of the arguments are replaced
223 with the port, the token and @.
227 Trace the processing of requests in the log file.
229 Valid values are 'no' (default), 'common', 'extra' or 'all'.
233 Trace the accesses to functions of class api.
235 Valid values are 'no' (default), 'common', 'api', 'event' or 'all'.
239 Trace the accesses to functions of class event.
241 Valid values are 'no' (default), 'common', 'extra' or 'all'.
245 Call a binding at start (can be be repeated).
246 The values are given in the form API/VERB:json-args.
248 Example: --call 'monitor/set:{"verbosity":{"api":"debug"}}'
252 Enable HTTP monitoring at <ROOT>/monitoring/
260 Automatic activation of api of the given directory when the api is missing.
264 Load options from the given config file
266 This can be used instead of arguments on the command line.
272 --binding /home/15646/bindings/binding45.so \
273 --binding /home/15646/bindings/binding3.so \
277 --set api45/key:54027a5e3c6cb2ca5ddb97679ce32f185b067b0a557d16a8333758910bc25a72 \
278 --exec /home/15646/bin/test654 @p @t
282 afb-daemon --config /home/15646/config1
284 when the file **/home/15646/config1** is:
289 "\/home\/15646\/bindings\/binding45.so",
290 "\/home\/15646\/bindings\/binding3.so"
292 "tracereq": "common",
297 "key": "54027a5e3c6cb2ca5ddb97679ce32f185b067b0a557d16a8333758910bc25a72"
301 "\/home\/15646\/bin\/test654",
307 The options are the keys of the config object.
309 See option --dump-config
313 Output a JSON representation of the configuration resulting from
314 environment and options.
318 Redirect stdout and stderr to output file
322 Set values that can be retrieved by bindings.
324 The set value can have different formats.
326 The most generic format is **{"API1":{"KEY1":VALUE,"KEY2":VALUE2,...},"API2":...}**
328 This example set 2 keys for the api *chook*:
330 afb-daemon -Z --set '{"chook":{"account":"urn:chook:b2ca5ddb97679","delay":500}}'
334 "account": "urn:chook:b2ca5ddb97679",
340 An other format is: **[API]/[KEY]:VALUE**.
341 When API is omitted, it take the value "*".
342 When KEY is ommitted, it take the value of "*".
344 The settings for the API \* are globals and apply to all bindings.
346 The settings for the KEY \* are mixing the value for the API.
348 The following examples are all setting the same values:
350 afb-daemon --set '{"chook":{"account":"urn:chook:b2ca5ddb97679","delay":500}}'
351 afb-daemon --set 'chook/*:{"account":"urn:chook:b2ca5ddb97679","delay":500}'
352 afb-daemon --set 'chook/:{"account":"urn:chook:b2ca5ddb97679","delay":500}'
353 afb-daemon --set 'chook/account:"urn:chook:b2ca5ddb97679"' --set chook/delay:500