2 title: Options of afb-daemon
5 The launch options for binder **afb-daemon** are:
8 -v, --verbose Verbose Mode, repeat to increase verbosity
9 -c, --color Colorize the ouput
10 -q, --quiet Quiet Mode, repeat to decrease verbosity
11 -l, --log=xxxx Tune log level
12 --foreground Get all in foreground mode
13 --background Get all in background mode
14 -D, --daemon Get all in background mode
15 -n, --name=xxxx Set the visible name
16 -p, --port=xxxx HTTP listening TCP port [default 1234]
17 --roothttp=xxxx HTTP Root Directory [default no root http (files not served but apis still available)]
18 --rootbase=xxxx Angular Base Root URL [default /opa]
19 --rootapi=xxxx HTML Root API URL [default /api]
20 --alias=xxxx Multiple url map outside of rootdir [eg: --alias=/icons:/usr/share/icons]
21 --apitimeout=xxxx Binding API timeout in seconds [default 20]
22 --cntxtimeout=xxxx Client Session Context Timeout [default 32000000]
23 --cache-eol=xxxx Client cache end of live [default 100000]
24 -w, --workdir=xxxx Set the working directory [default: $PWD or current working directory]
25 -u, --uploaddir=xxxx Directory for uploading files [default: workdir] relative to workdir
26 --rootdir=xxxx Root Directory of the application [default: workdir] relative to workdir
27 --ldpaths=xxxx Load bindings from dir1:dir2:... [default: path of afb-dbus-binding.so]
28 -b, --binding=xxxx Load the binding of path
29 --weak-ldpaths=xxxx Same as --ldpaths but ignore errors
30 --no-ldpaths Discard default ldpaths loading
31 -t, --token=xxxx Initial Secret [default=random, use --token= to allow any token]
32 -r, --random-token Enforce a random token
33 -V, --version Display version and copyright
34 -h, --help Display this help
35 --ws-client=xxxx Bind to an afb service through websocket
36 --ws-server=xxxx Provide an afb service through websockets
37 -A, --auto-api=xxxx Automatic load of api of the given directory
38 --session-max=xxxx Max count of session simultaneously [default 200]
39 --tracereq=xxxx Log the requests: no, common, extra, all
40 --traceevt=xxxx Log the events: no, common, extra, all
41 --traceses=xxxx Log the sessions: no, all
42 --traceapi=xxxx Log the apis: no, common, api, event, all
43 --traceglob=xxxx Log the globals: none, all
44 --traceditf=xxxx Log the daemons: no, common, all
45 --tracesvc=xxxx Log the services: no, all
46 --call=xxxx call at start, format of val: API/VERB:json-args
47 --no-httpd Forbid HTTP service
48 -e, --exec Execute the remaining arguments
49 -M, --monitoring Enable HTTP monitoring at <ROOT>/monitoring/
50 -C, --config=xxxx Load options from the given config file
51 -Z, --dump-config Dump the config to stdout and exit
52 -s, --set=xxxx Set parameters ([API]/[KEY]:JSON or {"API":{"KEY":JSON}}
53 -o, --output=xxxx Redirect stdout and stderr to output file (when --daemon)
54 --trap-faults=xxxx Trap faults: on, off, yes, no, true, false, 1, 0 (default: true)
59 Prints help with available options
63 Display version and copyright
67 Increases the verbosity, can be repeated
71 Add basic colorization to the ouput.
75 Decreases the verbosity, can be repeated
79 Tune the log level mask. The levels are:
87 The level can be set using + or -.
89 | Examples | descritpion
90 |-----------------|-------------------
91 | error,warning | selects only the levels error and warning
92 | +debug | adds level debug to the current verbosity
93 | -warning | remove the level warning from the current verbosity
94 | +warning-debug,info | Adds error and remove errors and warnings
98 HTTP listening TCP port [default 1234]
102 Directory where the daemon must run [default: $PWD if defined
103 or the current working directory]
107 Directory where uploaded files are temporarily stored [default: workdir]
111 Root directory of the application to serve [default: workdir]
115 Directory of HTTP served files. If not set, files are not served
116 but apis are still accessible.
120 Angular Base Root URL [default /opa]
122 This is used for any application of kind OPA (one page application).
123 When set, any missing document whose url has the form /opa/zzz
124 is translated to /opa/#!zzz
128 HTML Root API URL [default /api]
130 The bindings are available within that url.
134 Maps a path located anywhere in the file system to the
135 a subdirectory. The syntax for mapping a PATH to the
136 subdirectory NAME is: --alias=/NAME:PATH.
138 Example: --alias=/icons:/usr/share/icons maps the
139 content of /usr/share/icons within the subpath /icons.
141 This option can be repeated.
145 binding API timeout in seconds [default 20]
147 Defines how many seconds maximum a method is allowed to run.
152 Client Session Timeout in seconds [default 32000000 that is 1 year]
156 Client cache end of live [default 100000 that is 27,7 hours]
160 Maximum count of simultaneous sessions [default 200]
164 Load bindings from given paths separated by colons
165 as for dir1:dir2:binding1.so:... [default = $libdir/afb]
167 You can mix path to directories and to bindings.
168 The sub-directories of the given directories are searched
171 The bindings are the files terminated by '.so' (the extension
172 so denotes shared object) that contain the public entry symbol.
176 Same as --ldpaths but instead of stopping on error, ignore errors and continue.
180 Load the binding of given path.
184 Initial Secret token to authenticate.
186 If not set, no client can authenticate.
188 If set to the empty string, then any initial token is accepted.
192 Generate a random starting token. See option --exec.
196 Transparent binding to a binder afb-daemon service through a WebSocket.
198 The value of xxxx is either a unix naming socket, of the form "unix:path/api",
199 or an internet socket, of the form "host:port/api".
203 Provides a binder afb-daemon service through WebSocket.
205 The value of xxxx is either a unix naming socket, of the form "unix:path/api",
206 or an internet socket, of the form "host:port/api".
210 Get all in foreground mode (default)
214 Get all in background mode
222 Must be the last option for afb-daemon. The remaining
223 arguments define a command that afb-daemon will launch.
224 The sequences @p, @t and @@ of the arguments are replaced
225 with the port, the token and @.
229 Trace the processing of requests in the log file.
231 Valid values are 'no' (default), 'common', 'extra' or 'all'.
235 Trace the accesses to functions of class api.
237 Valid values are 'no' (default), 'common', 'api', 'event' or 'all'.
241 Trace the accesses to functions of class event.
243 Valid values are 'no' (default), 'common', 'extra' or 'all'.
247 Call a binding at start (can be be repeated).
248 The values are given in the form API/VERB:json-args.
250 Example: --call 'monitor/set:{"verbosity":{"api":"debug"}}'
254 Enable HTTP monitoring at <ROOT>/monitoring/
262 Automatic activation of api of the given directory when the api is missing.
266 Load options from the given config file
268 This can be used instead of arguments on the command line.
274 --binding /home/15646/bindings/binding45.so \
275 --binding /home/15646/bindings/binding3.so \
279 --set api45/key:54027a5e3c6cb2ca5ddb97679ce32f185b067b0a557d16a8333758910bc25a72 \
280 --exec /home/15646/bin/test654 @p @t
284 afb-daemon --config /home/15646/config1
286 when the file **/home/15646/config1** is:
291 "\/home\/15646\/bindings\/binding45.so",
292 "\/home\/15646\/bindings\/binding3.so"
294 "tracereq": "common",
299 "key": "54027a5e3c6cb2ca5ddb97679ce32f185b067b0a557d16a8333758910bc25a72"
303 "\/home\/15646\/bin\/test654",
309 The options are the keys of the config object.
311 See option --dump-config
315 Output a JSON representation of the configuration resulting from
316 environment and options.
320 Redirect stdout and stderr to output file
324 Set values that can be retrieved by bindings.
326 The set value can have different formats.
328 The most generic format is **{"API1":{"KEY1":VALUE,"KEY2":VALUE2,...},"API2":...}**
330 This example set 2 keys for the api *chook*:
332 afb-daemon -Z --set '{"chook":{"account":"urn:chook:b2ca5ddb97679","delay":500}}'
336 "account": "urn:chook:b2ca5ddb97679",
342 An other format is: **[API]/[KEY]:VALUE**.
343 When API is omitted, it take the value " * ".
344 When KEY is ommitted, it take the value of " * ".
346 The settings for the API \* are globals and apply to all bindings.
348 The settings for the KEY \* are mixing the value for the API.
350 The following examples are all setting the same values:
352 afb-daemon --set '{"chook":{"account":"urn:chook:b2ca5ddb97679","delay":500}}'
353 afb-daemon --set 'chook/*:{"account":"urn:chook:b2ca5ddb97679","delay":500}'
354 afb-daemon --set 'chook/:{"account":"urn:chook:b2ca5ddb97679","delay":500}'
355 afb-daemon --set 'chook/account:"urn:chook:b2ca5ddb97679"' --set chook/delay:500