Start Up Options¶
FaceLiveness Server Program Options¶
By default the FaceLiveness servers is started on the localhost and only processes running on that system could access the server.
Options can be specified via command line arguments, in the configuration file, or through environment variables.
Options from the command line have the highest priority.
Options from the configuration file are the second highest priority.
Options from environment variables are the lowest priority.
The FaceLiveness server provides the following startup arguments (FaceLiveness Server Program Options
).
Argument |
Description |
---|---|
-h [ –help ] |
Produce help message. |
-c [ –config ] |
Load configuration from specified file. |
-l [ –log-config ] |
Load log4cplus configuration from specified file. |
–host |
Set host name (default 0.0.0.0). |
-p [ –port ] |
Set port number (default 8080). |
-u [ –url-path ] |
URL base path. |
–logged-image-path |
Enable logging images to this directory. |
–model-path |
Path to face liveness model data files. |
–device-brand-emulator-whitelist |
Specifies a newline separated plain text file that specifies device brands that should not be evaluated by the emulator detection. |
–device-model-emulator-whitelist |
Specifies a newline separated plain text file that specifies device models that should not be evaluated by the emulator detection. |
-t [ –concurrent-tasks ] |
Set the maximum number of concurrent tasks. Defaults to number of cores available. |
-q [ –queue-size ] |
Set the maximum number of tasks that can be queued up. Defaults to unlimited. |
–allowed-timestamp-seconds |
How old an image timestamp is allowed to be without being rejected. |
–allowed-future-timestamp-seconds |
How far in the future an image timestamp is allowed to be without being rejected. |
–disable-blur-detection |
Disables evaluating incoming images for blur. |
–require-username |
Require all request packages contain the username element in order to process for liveness. |
–certificate |
Path to PEM certificate keystore file, enabling TLS. |
–password |
TLS certificate private key password (use if private key is encrypted). |
–enable-cors |
Enable Cross-Origin Resource Sharing. |
–cors-acao-policy |
Access-Control-Allow-Origin policy (default “*”). |
–cors-acac-policy |
Access-Control-Allow-Credentials policy (default “”). |
–cors-aceh-policy |
Access-Control-Expose-Headers policy (default “”). |
–cors-acma-policy |
Access-Control-Max-Age policy (default “”). |
–cors-acam-policy |
Access-Control-Allow-Methods policy (default “GET,POST,OPTIONS”). |
–cors-acah-policy |
Access-Control-Allow-Headers policy (default “Content-Type”). |
–endpoint-decryption-key |
Path to endpoint decryption key, enabling encrypted requests. |
–password-encrypted |
Encrypted password using symmetric key. |
–password-decryption-iv |
Initiation vector that was used to encrypt the password. |
–password-decryption-key |
File containing symmetric key to encrypt password. |
–db-host |
Transaction counting database host server. |
–db-user |
Transaction counting database login user name. |
–db-pw |
Transaction counting database login password. |
–db-name |
Transaction counting database name. |
–db-poll-interval |
OPTIONAL: Transaction counting database polling interval for reconnecting. Time in minutes. Default 5 minutes. |
Help¶
Configuration File¶
Log4Cplus Configuration¶
Host Name¶
Port Number¶
URL Path¶
Logged Image Path¶
Model Path¶
Device Brand Emulator Whitelist¶
Device Model Emulator Whitelist¶
Concurrent Tasks¶
Queue Size¶
Allowed Timestamp Seconds¶
Allowed Future Timestamp Seconds¶
Disable Blur Detection¶
Require Username¶
Certificate¶
Password¶
Enable CORS¶
CORS ACAO Policy¶
CORS ACAC Policy¶
CORS ACEH Policy¶
CORS ACMA Policy¶
CORS ACAM Policy¶
CORS ACAH Policy¶
Endpoint Decryption Key¶
Password Encryption¶
Password Decryption IV¶
Password Decryption Key¶
DB Host¶
DB User¶
DB Password¶
DB Name¶
DB Poll Interval¶
Server Log Configuration¶
Logging in the Knomi REST server is provided by the log4cplus library. The face_liveness_log_config.ini configuration file is documented by the log4cplus project here. Knomi Face Liveness has two loggers, which are detailed below.
Info log¶
The info log contains general info and error output from the server. By default it is output to both face_liveness_info.txt and stdout. The format of the log can be controlled by the face_liveness_log_config.ini file using the “aw_face_liveness_rest_server_info” named logger.
Stats log¶
The stats log contains detailed information on each successful transaction processed by the server. By default it is output to both face_liveness_stats.js. The log content is a JSON per newline of the log, containing numerious fields describing the transaction. Below are some, but not all of the contained fields:
date - Unix timestamp of the time of the transaction.
duration - Time spent on the server (in seconds) handling the transaction (including network activity).
images - Contains information on where the logged images are saved.
input - The entire input request, with the images from the “frames” field removed.
result - The entire output request, with the returned image removed.
The log is controlled by the face_liveness_log_config.ini file using the “aw_face_liveness_rest_server_stats” named logger. It is not recommended to change the format of the stats log, as it is read directly by the Knomi Report Server.
# MyConsoleAppender
log4cplus.appender.MyConsoleAppender=log4cplus::ConsoleAppender
log4cplus.appender.MyConsoleAppender.layout=log4cplus::PatternLayout
log4cplus.appender.MyConsoleAppender.layout.ConversionPattern=[%-5p][%d] %m%n
# InfoLogAppender
log4cplus.appender.InfoLogAppender=log4cplus::DailyRollingFileAppender
log4cplus.appender.InfoLogAppender.File=./face_liveness_info.txt
log4cplus.appender.InfoLogAppender.layout=log4cplus::PatternLayout
log4cplus.appender.InfoLogAppender.layout.ConversionPattern=[%-5p][%d] %m%n
log4cplus.appender.InfoLogAppender.Schedule=MONTHLY
log4cplus.appender.InfoLogAppender.RollOnClose=false
# JsonAppender
log4cplus.appender.JsonAppender=log4cplus::DailyRollingFileAppender
log4cplus.appender.JsonAppender.File=./face_liveness_stats.js
log4cplus.appender.JsonAppender.layout=log4cplus::PatternLayout
log4cplus.appender.JsonAppender.layout.ConversionPattern=%m
log4cplus.appender.JsonAppender.Schedule=MONTHLY
log4cplus.appender.JsonAppender.RollOnClose=false
log4cplus.logger.aw_face_liveness_rest_server_info=DEBUG, MyConsoleAppender, InfoLogAppender
log4cplus.logger.aw_face_liveness_rest_server_stats=INFO, MyConsoleAppender, JsonAppender