Start Up Options

Server Program Options

By default the 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 server provides the following startup arguments (Server Program Options).

Face Analyzer 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 localhost).

-p [ –port ]

Set port number (default 8080).

-u [ –url-path ]

URL base path (default preface).

–preface-classifier-path

Path to Preface classifier data file.

-t [ –concurrent-tasks ]

Set the maximum number of concurrent PreFace tasks. Defaults to number of cores available.

-q [ –queue-size ]

Set the maximum number of PreFace tasks that can be queued up. Defaults unlimited.

–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

Description : Produce help message.
Command Line Option Name : -h [ –help ]
Configuration File Parameter Name : N/A
Environment Variable Name : N/A

Configuration File

Description : Load configuration from specified file.
Command Line Option Name : -c [ –config ]
Configuration File Parameter Name : N/A
Environment Variable Name : KNOMI_FACE_ANALYZER_CONFIG

Log Configuration File

Description : Load log4cplus configuration from specified file.
Command Line Option Name : -l [ –log-config ]
Configuration File Parameter Name : log-config
Environment Variable Name : KNOMI_FACE_ANALYZER_LOG_CONFIG

Host

Description : Set host name. Default localhost.
Command Line Option Name : –host
Configuration File Parameter Name : host
Environment Variable Name : KNOMI_FACE_ANALYZER_HOST

Port

Description : Set port number. Default 8080.
Command Line Option Name : -p [ –port ]
Configuration File Parameter Name : port
Environment Variable Name : KNOMI_FACE_ANALYZER_PORT

Url Path

Description : URL base path. Default preface.
Command Line Option Name : -u [ –url-path ]
Configuration File Parameter Name : url-path
Environment Variable Name : KNOMI_FACE_ANALYZER_URL_PATH

PreFace Classifier Path

Description : Path to the PreFace classifier data file.
Command Line Option Name : –preface-classifier-path
Configuration File Parameter Name : preface-classifier-path
Environment Variable Name : KNOMI_FACE_ANALYZER_PREFACE_CLASSIFIER_PATH

Concurrent Tasks

Description : Set the meximum number of concurrent tasks. Defaults to the number of cores available.
Command Line Option Name : -t [ –concurrent-tasks ]
Configuration File Parameter Name : concurrent-tasks
Environment Variable Name : KNOMI_FACE_ANALYZER_CONCURRENT_TASKS

Queue Size

Description : Set the maximum number of tasks that can be queued up. Defaults to unlimited.
Command Line Option Name : -q [ –queue-size ]
Configuration File Parameter Name : queue-size
Environment Variable Name : KNOMI_FACE_ANALYZER_QUEUE_SIZE

Certificate

Description : Path to PEM certificate keystore file. Enable TLS.
Command Line Option Name : –certificate
Configuration File Parameter Name : certificate
Environment Variable Name : KNOMI_FACE_ANALYZER_CERTIFICATE

Password

Description : TLS certificate private key password (use if private key is encrypted).
Command Line Option Name : –password
Configuration File Parameter Name : password
Environment Variable Name : KNOMI_FACE_ANALYZER_PASSWORD

Enable CORS

Description : Enable Cross-Origin Resource Sharing
Command Line Option Name : –enable-cors
Configuration File Parameter Name : enable-cors
Environment Variable Name : KNOMI_FACE_ANALYZER_ENABLE_CORS

CORS ACAO Policy

Description : Set the CORS Access-Control-Allow-Origin policy. Default is “*”.
Command Line Option Name : –cors-acao-policy
Configuration File Parameter Name : cors-acao-policy
Environment Variable Name : KNOMI_FACE_ANALYZER_CORS_ACAO_POLICY

CORS ACAC Policy

Description : Set the CORS Access-Control-Allow-Credentials policy. Default is “”.
Command Line Option Name : –cors-acac-policy
Configuration File Parameter Name : cors-acac-policy
Environment Variable Name : KNOMI_FACE_ANALYZER_CORS_ACAC_POLICY

CORS ACEH Policy

Description : Set the CORS Access-Control-Expose-Headers policy. Default is “”.
Command Line Option Name : –cors-aceh-policy
Configuration File Parameter Name : cors-aceh-policy
Environment Variable Name : KNOMI_FACE_ANALYZER_CORS_ACEH_POLICY

CORS ACMA Policy

Description : Set the CORS Access-Control-Max-Age policy. Default is “”.
Command Line Option Name : –cors-acma-policy
Configuration File Parameter Name : cors-acma-policy
Environment Variable Name : KNOMI_FACE_ANALYZER_CORS_ACMA_POLICY

CORS ACAM Policy

Description : Set the CORS Access-Control-Allow-Methods policy. Default is “GET, POST, OPTIONS”.
Command Line Option Name : –cors-acam-policy
Configuration File Parameter Name : cors-acam-policy
Environment Variable Name : KNOMI_FACE_ANALYZER_CORS_ACAM_POLICY

CORS ACAH Policy

Description : Set the CORS Access-Control-Allow-Headers policy. Default is “Content-Type”.
Command Line Option Name : –cors-acah-policy
Configuration File Parameter Name : cors-acah-policy
Environment Variable Name : KNOMI_FACE_ANALYZER_CORS_ACAH_POLICY

Endpoint Decryption Key

Description : Specify the path to the endpoint decryption key. Enables encrypted requests.
Command Line Option Name : –endpoint-decryption-key
Configuration File Parameter Name : endpoint-decryption-key
Environment Variable Name : KNOMI_FACE_ANALYZER_ENDPOINT_DECRYPTION_KEY

Password Encryption

Description : Specify the encrypted password.
Command Line Option Name : –password-encrypted
Configuration File Parameter Name : password-encrypted
Environment Variable Name : KNOMI_FACE_ANALYZER_PASSWORD_ENCRYPTED

Password Decryption IV

Description : Specify the initiation vector used to encrypt the password.
Command Line Option Name : –password-decryption-iv
Configuration File Parameter Name : password-decryption-iv
Environment Variable Name : KNOMI_FACE_ANALYZER_PASSWORD_DECRYPTION_IV

Password Decryption Key

Description : Specify the file containing the symmetric key used to decrypt the password.
Command Line Option Name : –password-decryption-key
Configuration File Parameter Name : password-decryption-key
Environment Variable Name : KNOMI_FACE_ANALYZER_PASSWORD_DECRYPTION_KEY

DB Host

Description : Specify the transaction counting database host server.
Command Line Option Name : –db-host
Configuration File Parameter Name : db-host
Environment Variable Name : KNOMI_FACE_ANALYZER_DB_HOST

DB User

Description : Specify the transaction counting database login user name.
Command Line Option Name : –db-user
Configuration File Parameter Name : db-user
Environment Variable Name : KNOMI_FACE_ANALYZER_DB_USER

DB Password

Description : Specify the transaction counting database login password.
Command Line Option Name : –db-pw
Configuration File Parameter Name : db-pw
Environment Variable Name : KNOMI_FACE_ANALYZER_DB_PW

DB Name

Description : Specify the transaction counting database name.
Command Line Option Name : –db-name
Configuration File Parameter Name : db-name
Environment Variable Name : KNOMI_FACE_ANALYZER_DB_NAME

DB Poll Interval

Description : Specify the transaction counting database polling interval in minutes for reconnecting. Default is 5 minutes.
Command Line Option Name : –db-poll-interval
Configuration File Parameter Name : db-poll-interval
Environment Variable Name : KNOMI_FACE_ANALYZER_DB_POLL_INTERVAL

Server Log Configuration

The logging can be controlled by the parameters specified in the preface_log_config.ini file. This file defines what will be logged to the console and what will be logged to the log file. The default log configuration is set to roll over monthly. The formatting options (i.e. [%-5p][%d] %m%n) in the Knomi logging configuration file are defined by the log4cplus library. See (Logging configuration example).

Logging configuration example
# 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=./knomi_face_analyzer_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=./knomi_face_analyzer_stats.js
log4cplus.appender.JsonAppender.layout=log4cplus::PatternLayout
log4cplus.appender.JsonAppender.layout.ConversionPattern=%m%n
log4cplus.appender.JsonAppender.Schedule=MONTHLY
log4cplus.appender.JsonAppender.RollOnClose=false

log4cplus.logger.aw_knomi_face_analyzer_rest_server_info=INFO, MyConsoleAppender, InfoLogAppender
log4cplus.logger.aw_knomi_face_analyzer_rest_server_stats=INFO, MyConsoleAppender, JsonAppender