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 --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]
24 --rootdir=xxxx Root Directory of the application [default: workdir]
25 --ldpaths=xxxx Load bindings from dir1:dir2:... [default = /opt/jobol/lib64/afb]
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
56 Prints help with available options
60 Display version and copyright
64 Increases the verbosity, can be repeated
68 Add basic colorization to the ouput.
72 Decreases the verbosity, can be repeated
76 Tune the log level mask. The levels are:
84 The level can be set using + or -.
86 | Examples | descritpion
87 |-----------------|-------------------
88 | error,warning | selects only the levels error and warning
89 | +debug | adds level debug to the current verbosity
90 | -warning | remove the level warning from the current verbosity
91 | +warning-debug,info | Adds error and remove errors and warnings
95 HTTP listening TCP port [default 1234]
99 Directory where the daemon must run [default: $PWD if defined
100 or the current working directory]
104 Directory where uploaded files are temporarily stored [default: workdir]
108 Root directory of the application to serve [default: workdir]
112 Directory of HTTP served files. If not set, files are not served
113 but apis are still accessible.
117 Angular Base Root URL [default /opa]
119 This is used for any application of kind OPA (one page application).
120 When set, any missing document whose url has the form /opa/zzz
121 is translated to /opa/#!zzz
125 HTML Root API URL [default /api]
127 The bindings are available within that url.
131 Maps a path located anywhere in the file system to the
132 a subdirectory. The syntax for mapping a PATH to the
133 subdirectory NAME is: --alias=/NAME:PATH.
135 Example: --alias=/icons:/usr/share/icons maps the
136 content of /usr/share/icons within the subpath /icons.
138 This option can be repeated.
142 binding API timeout in seconds [default 20]
144 Defines how many seconds maximum a method is allowed to run.
149 Client Session Timeout in seconds [default 32000000 that is 1 year]
153 Client cache end of live [default 100000 that is 27,7 hours]
157 Maximum count of simultaneous sessions [default 200]
161 Load bindings from given paths separated by colons
162 as for dir1:dir2:binding1.so:... [default = $libdir/afb]
164 You can mix path to directories and to bindings.
165 The sub-directories of the given directories are searched
168 The bindings are the files terminated by '.so' (the extension
169 so denotes shared object) that contain the public entry symbol.
173 Same as --ldpaths but instead of stopping on error, ignore errors and continue.
177 Load the binding of given path.
181 Initial Secret token to authenticate.
183 If not set, no client can authenticate.
185 If set to the empty string, then any initial token is accepted.
189 Generate a random starting token. See option --exec.
193 Transparent binding to a binder afb-daemon service through a WebSocket.
195 The value of xxxx is either a unix naming socket, of the form "unix:path/api",
196 or an internet socket, of the form "host:port/api".
200 Provides a binder afb-daemon service through WebSocket.
202 The value of xxxx is either a unix naming socket, of the form "unix:path/api",
203 or an internet socket, of the form "host:port/api".
207 Get all in foreground mode (default)
211 Get all in background mode
219 Must be the last option for afb-daemon. The remaining
220 arguments define a command that afb-daemon will launch.
221 The sequences @p, @t and @@ of the arguments are replaced
222 with the port, the token and @.
226 Trace the processing of requests in the log file.
228 Valid values are 'no' (default), 'common', 'extra' or 'all'.
232 Trace the accesses to functions of class api.
234 Valid values are 'no' (default), 'common', 'api', 'event' or 'all'.
238 Trace the accesses to functions of class event.
240 Valid values are 'no' (default), 'common', 'extra' or 'all'.
244 Call a binding at start (can be be repeated).
245 The values are given in the form API/VERB:json-args.
247 Example: --call 'monitor/set:{"verbosity":{"api":"debug"}}'
251 Enable HTTP monitoring at <ROOT>/monitoring/
259 Automatic activation of api of the given directory when the api is missing.
263 Load options from the given config file
265 This can be used instead of arguments on the command line.
271 --binding /home/15646/bindings/binding45.so \
272 --binding /home/15646/bindings/binding3.so \
276 --set api45/key:54027a5e3c6cb2ca5ddb97679ce32f185b067b0a557d16a8333758910bc25a72 \
277 --exec /home/15646/bin/test654 @p @t
281 afb-daemon --config /home/15646/config1
283 when the file **/home/15646/config1** is:
288 "\/home\/15646\/bindings\/binding45.so",
289 "\/home\/15646\/bindings\/binding3.so"
291 "tracereq": "common",
296 "key": "54027a5e3c6cb2ca5ddb97679ce32f185b067b0a557d16a8333758910bc25a72"
300 "\/home\/15646\/bin\/test654",
306 The options are the keys of the config object.
308 See option --dump-config
312 Output a JSON representation of the configuration resulting from
313 environment and options.
317 Redirect stdout and stderr to output file
321 Set values that can be retrieved by bindings.
323 The set value can have different formats.
325 The most generic format is **{"API1":{"KEY1":VALUE,"KEY2":VALUE2,...},"API2":...}**
327 This example set 2 keys for the api *chook*:
329 afb-daemon -Z --set '{"chook":{"account":"urn:chook:b2ca5ddb97679","delay":500}}'
333 "account": "urn:chook:b2ca5ddb97679",
339 An other format is: **[API]/[KEY]:VALUE**.
340 When API is omitted, it take the value "*".
341 When KEY is ommitted, it take the value of "*".
343 The settings for the API \* are globals and apply to all bindings.
345 The settings for the KEY \* are mixing the value for the API.
347 The following examples are all setting the same values:
349 afb-daemon --set '{"chook":{"account":"urn:chook:b2ca5ddb97679","delay":500}}'
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"' --set chook/delay:500