Oz API Configuration

The configuration settings are contained in theconfig.py file. Its location depends on the installation method:

  • host machine or Docker container oz-api: /opt/gateway/configs

  • standalone installer: /var/lib/docker/volumes/api_oz-api-config-vol/_data

Postgres Connection

DB_USER = 'user name'
DB_HOST = 'Postgres server address'
DB_PASS = 'user password'
DB_NAME = 'database name'

Path to Media Files

All incoming media files are saved in the local directory mounted to one of possible endpoints depending of the installation method:

  • host server or Docker container: /opt/gateway/static

  • in case of standalone installer: /var/lib/docker/volumes/api_oz-api-static-vol/_data

  • any path specified via configuration

In most of the integration cases, the media files can be accessed in web using the direct links to randomly generated filenames.

To access the media, you need to specify in the configuration file their external host name or IP address, port, and connection protocol.

PORT = 443
SCHEME = 'https'
HOST = 'api.globalbank.com'

Connection to Oz Bio / Liveness

OZ_SERVICE_TFSS_HOST = 'http://bio-server-name:8501/v1/'

Timing and Limits

# amount of retries to perform analyses to Oz Bio
OZ_CELERY_RETRY_MAX_COUNT = 7
# delay between tries
OZ_CELERY_RETRY_STEP = 30

# maximum wait time of one analyse
OZ_ANALYSE_PROCESSING_EXPIRE_TIMEOUT = 15 * 60  # 15 minutes
# maximum wait time of analyse from API
OZ_ANALYSE_DELIVERY_EXPIRE_TIMEOUT = 60 * 60  # 1 hour
# frequency for check analyse expiration
OZ_ANALYSE_EXPIRE_BEAT_PERIOD = 1 * 60  # every minute

# maximum amount of attached media
OZ_ATTACHMENT_MAX_COUNT = 10
# maximum size of one media file
OZ_ATTACHMENT_MAX_SIZE = 10 * 1024 * 1024  # 10Mb

# amount of seconds until access token expiration
OZ_SESSION_TTL = 60 * 15  # 15 minutes
# amount of seconds until service access token expiration
OZ_SESSION_LONGLIVE_TTL = 60 * 60 * 24 * 365 * 5  # 5 years

# maximum size of thumbnail in bytes
OZ_IMAGE_SIZE_THUMBNAIL = 300
# maximum duration of video file
OZ_VIDEO_DURATION_MAX = 30

Last updated