Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Configuration

Manabu Niseki edited this page Apr 25, 2021 · 9 revisions

ASGI server configuration

Uzen is built on FastAPI, Starlette and Uvicorn.

Please refer to the official Uvicorn doc for learning how to configure the ASGI server.

Application configuration

Configuration should be stored in environment variables, or in a ".env".

Configuration precedence

The order in which configuration values are read is:

  • From an environment variable.
  • From the ".env" file.

Configuration items

General configuration

  • DEBUG: Whether the app starts in debug mode or not. (default = False)
  • GLOBAL_API_KEY: Global API key to interact with Uzen API

Logging configuration

  • LOG_FILE: Path to the log file.
  • LOG_LEVEL: Level of logging.
  • LOG_BACKTRACE: Whether the exception trace should display the variables values.

MySQL configuration

  • DATABASE_URL: Database configuration in a URL form.
    • Format: DB_TYPE://USERNAME:PASSWORD@HOST:PORT/DB_NAME?PARAM1=value&PARAM2=value
    • e.g.:
      • SQLite: sqlite:///data/db.sqlite
      • MySQL: mysql://myuser:mypass@db.host:3306/somedb

Redis configuration

  • REDIS_URL: REDIS configuration in a URL form.
    • Format: redis://USERNAME:PASSWORD@HOST:PORT/DB_NAME

MinIO configuration

  • MINIO_ENDPOINT: Hostname of a S3 service.
  • MINIO_ACCESS_KEY: Access key (aka user ID) of your account in S3 service.
  • MINIO_SECRET_KEY: Secret Key (aka password) of your account in S3 service.
  • MINIO_SECURE: Flag to indicate to use secure (TLS) connection to S3 service or not.

Other configuration

  • GOOGLE_SAFE_BROWSING_API_KEY: Google Safebrowsing API key
  • VIRUSTOTAL_API_KEY: VirusTotal API key