Skip to content

Storage

You can configure IDLive Face Server to send copies of uploaded images to Amazon S3, MinIO or save them to a filesystem.

The storage used is controlled by the environment variable IDFACE_SERVER_STORAGE_TYPE. Available values are aws, minio, file-storage.

Saved files will be named with the template <request_id>-<index> where:

  • request_id is a random UUID generated for every request,
  • index is an 2-digit index of image in the request, starting with 0.

This name will be printed in logs. For example if you upload an image with:

curl "http://localhost:8080/check_liveness" --form image=@selfie.png

You will see this record in the logs:

Liveness check performed for 0aef214e-a3f2-495d-8652-228951cab4b3-00 file(s), dionysus pipeline, UNKNOWN os, REGULAR calibration with CheckLivenessResponse{score=5.2165456, quality=0.72107375, probability=0.9946032} in 216 ms

The name of the saved image is 0aef214e-a3f2-495d-8652-228951cab4b3-00.

Amazon S3

To store images to Amazon S3 set IDFACE_SERVER_STORAGE_TYPE to aws. You also need to specify:

  1. Name of an S3 bucket and its AWS region. The bucket with this name must already exist.

  2. AWS Access Key ID and Secret Access Key for the user that has access to the bucket.

docker run \
    --env IDFACE_SERVER_STORAGE_TYPE=aws \
    --env S3_REGION=eu-central-1 \
    --env S3_BUCKET=idliveface \
    --env S3_TOKEN=AKIAI44QH8DHBEXAMPLE \
    --env S3_SECRET=je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY \
    ...

Additionally you can set a path inside the bucket with the S3_PATH variable.

MinIO

S3 connector also supports MinIO. To use it set IDFACE_SERVER_STORAGE_TYPE to minio. It has the same setup, you only need to specify a MinIO's url instead of the S3 region:

docker run \
    --env IDFACE_SERVER_STORAGE_TYPE=minio \
    --env S3_URL=http://192.168.1.51 \
    --env S3_BUCKET=idliveface \
    --env S3_TOKEN=AKIAI44QH8DHBEXAMPLE \
    --env S3_SECRET=je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY \
    ...

File storage

To save images to local directory set IDFACE_SERVER_STORAGE_TYPE to file-storage. The images will be stored to the /file-storage directory in the running container. Use a volume if you want persist the files after the container's restart.