Installation Manual
1. Installation and deployment
The service is dockerized, and there is a docker image in a Facephi repository. To be able to download the image you must be login as following:
docker login facephicorp.jfrog.io
user: username
pass: token
Download the image:
docker pull facephicorp.jfrog.io/docker-pro-fphi/facephi-face-liveness-service:#VERSION#
Where #VERSION# is the version number that we want to download (e.g. 1.0.0).
2. docker-compose
One way to deploy the service is to create a docker-compose.yml file with the following content:
version: '3.7'
services:
face-liveness-service:
image: facephicorp.jfrog.io/docker-pro-fphi/facephi-face-liveness-service:#VERSION#
container_name: facephi-face-liveness-service
ports:
- "6982:6982"
volumes:
- ./license:/service/license
- ./config:/service/config
- ./logs:/service/logs
Note the volume that is mounted in the container. This volume is used to store the license file.
The config is optional, but allow you to configure the service. See the 2.2 Service section.
The logs is optional, but allow you to save the logs in the local storage, avoiding to lose the logs when the docker is down.
Run the following command, inside the folder where the docker-compose.yml file is located, to deploy the service:
docker compose up
3. Configuration
3.1 License
To use this service, you need to have a valid license file.
The license file could contain the following information:
LICENSE_TYPE= # License type, can be MACHINE, SHARED or LOCAL
LICENSE_BEHAVIOUR= # License behaviour, can be ONLINE or OFFLINE
LICENSE_KEY= # License key
LICENSE_ID= # Product ID
LICENSE_DATA= # Product data
LICENSE_URLS= # Comma-separated license server URLs. Only needed if LICENSE_TYPE is LOCAL
LICENSE_PATH_OFFLINE= # Path to a local file with data for offline activation. Only needed if LICENSE_TYPE is MACHINE and LICENSE_BEHAVIOUR is OFFLINE
The license file can be passed as a parameter to the service. By default the service will look for a file named /service/license/license.lic. In the case of the docker container, the configuration file could be located in a volume mounted in /service/license.
In order to be able to connect with our License servers you must add to your firewall's rules the following rules:
| IP | Port | Type |
|---|---|---|
| 52.223.22.71 | 443 | TCP/IP |
| 35.71.188.31 | 443 | TCP/IP |
| 75.2.113.112 | 443 | TCP/IP |
| 99.83.149.57 | 443 | TCP/IP |
Then add the following DNS to your whitelist:
https://api.cryptlex.com:443
https://api.eu.cryptlex.com:443
3.2 Service
The config file could contain the following information by default:
{
"port": 6982, # Service port number.
"number_of_threads": 1, # The number of IO threads, 1 by default, if the value is set to 0, the number of threads is the number of CPU cores.
"connection_timeout": 60, # The lifetime of the connection without read or write.
"keep_alive_request_number": 0, # Set the maximum number of requests that can be served through one keep-alive connection.
# After the maximum number of requests are made, the connection is closed.
# The default value of 0 means no limit.
"client_max_body_size": 50, # The maximum size of the body allowed in the requests in Mb.
# The default value of 100 Mb.
"logger_path" : "./logs", # Set the path to store log files.
"logger_level" : "trace", # Possible values are [trace|debug|info|warning|error|critical|off].
"logger_rotation" : "daily", # Possible values are [hourly|daily].
"logger_max_files" : 31, # The default value of 0 means no limit.
"facial_liveness_num_threads": 2, # Maximum number of threads available for the processing of **one** request.
"facial_liveness_threshold": 50 # Liveness threshold for accepting or rejecting a face liveness check.
}
The config file can be passed as a parameter to the service. By default the service will look for a file named /service/config/config.json. In the case of the docker container, the configuration file could be located in a volume mounted in /service/config.