Skip to main content

Environment Variables

Cafe Variome V4 uses environment variables for operational configurations that remains constant throughout the lifecycle of the application. These configurations include database connections, authentication settings, email server details, caching options, and more.

Setting Environment Variables

The environment variables can be set in multiple ways, and the precedence order is as follows:

  1. Shell Environment: Directly set in the shell before starting the application, or set using docker-compose files.
  2. Docker Secrets: When using Docker, sensitive values can be provided via Docker secrets.
  3. .env File: A file named .env in the ./conf/ directory can be used to set environment variables. The path to this file can be changed using the CV_ENV_FILE environment variable.

The frontend does not use environment variables directly. It has one value that can be set during compilation, which is the API base URL.

Configurable Environment Variables

All environment variables that are not security sensitive has a default value. The following environment variables can be configured for Cafe Variome V4:

Variable NameDescriptionDefault Value
CV_APPLICATION_NAMEThe name of the application, used in node descriptions and email subjectsCafe Variome V4
CV_APPLICATION_DESCRIPTIONA short description of the application, used in email bodiesA federated platform for sharing and discovering healthcare data.
CV_ACCESS_URLThe base URL for accessing the applicationhttp://localhost:5000
CV_ACCESS_TOKEN_TTLThe time-to-live (TTL) for access tokens in seconds300
CV_REFRESH_TOKEN_TTLThe time-to-live (TTL) for refresh tokens in seconds7200
CV_ALLOW_REGISTRATIONWhether to allow user registrationtrue
CV_SSO_REGISTRATIONWhether to automatically register user coming from SSOtrue
CV_MAINTAIN_SSO_SESSIONWhether to maintain SSO session for users by automatically refreshing tokensfalse
CV_LOGGING_LEVELThe logging level for the applicationINFO
CV_ENABLE_METRICSWhether to enable Prometheus metricsfalse
CV_DATA_DIRThe directory for storing application datadata
CV_ALLOW_ORIGINSA JSON array of allowed origins for CORS[]
CV_SERVICE_ROOT_PATHThe root path for the API endpoints/api
CV_OPENAPI_URLThe URL for the OpenAPI specification/openapi.json
CV_DOCS_URLThe URL for the API documentation/docs
CV_REDOC_URLThe URL for the ReDoc API documentation/redoc
CV_ENVIRONMENTThe application environment (e.g., development, production)development
CV_DATABASE_DRIVERThe database driver to use (e.g., mongo)mongo
CV_MONGODB_HOSTThe hostname of the MongoDB serverlocalhost
CV_MONGODB_PORTThe port of the MongoDB server27017
CV_MONGODB_DB_NAMEThe name of the MongoDB databasecafe-variome
CV_CACHE_DRIVERThe caching driver to use (e.g., redis)redis
CV_REDIS_HOSTThe hostname of the Redis serverlocalhost
CV_REDIS_PORTThe port of the Redis server6379
CV_KMS_DRIVERThe Key Management Service (KMS) driver to use (e.g., vault)vault
CV_VAULT_URLThe URL of the Vault serverhttp://localhost:8200
CV_VAULT_ROLE_IDThe role ID for Vault AppRole authenticationcafe-variome-role
CV_VAULT_SECRET_IDThe secret ID for Vault AppRole authenticationcafe-variome-secret
CV_VAULT_KV_ENGINEThe name of the Vault KV enginekv
CV_VAULT_KV_PATHThe path in Vault for storing secretscafe-variome
CV_VAULT_TRANSIT_ENGINEThe name of the Vault Transit enginetransit
CV_VAULT_TOTP_ENGINEThe name of the Vault TOTP enginetotp
CV_EMAIL_DRIVERThe email driver to use (e.g., smtp, sendmail, mta)smtp
CV_SMTP_HOSTThe hostname of the SMTP serverlocalhost
CV_SMTP_PORTThe port of the SMTP server25
CV_SMTP_USERNAMEThe username for SMTP authenticationempty
CV_SMTP_PASSWORDThe password for SMTP authenticationempty
CV_SMTP_START_TLSWhether to use STARTTLS for SMTPfalse
CV_SMTP_USE_TLSWhether to use TLS for SMTPfalse
CV_SMTP_FROM_EMAILThe "from" email address for SMTPno-reply@cafevariome.org
CV_SENDMAIL_BINARYThe path to the sendmail binarysendmail
CV_MTA_FROM_EMAILThe "from" email address for MTAno-reply@cafevariome.org
CV_MTA_ENVELOPE_FROMThe envelope "from" email address for MTAempty
CV_VECTOR_DB_DRIVERThe vector database driver to use (e.g., qdrant)qdrant
CV_VECTOR_CHUNKING_MAX_TOKENSThe maximum number of tokens per chunk for vectorization200
CV_VECTOR_CHUNKING_OVERLAPThe overlap ratio between chunks for vectorization0.1
CV_VECTOR_TOKENIZER_MODEL_NAMEThe name of the tokenizer model for vectorizationbert-base-uncased
CV_VECTOR_EMBEDDING_MODEL_NAMEThe name of the embedding model for vectorizationall-MiniLM-L6-v2
CV_QDRANT_LOCATIONThe URL of the Qdrant serverhttp://localhost:6333
CV_SCHEDULER_DRIVERThe scheduler driver to use (e.g., memory, celery)memory
CV_CHALLENGE_DIFFICULTYThe difficulty level for challenges (e.g., CAPTCHA)22
CV_SIMILARITY_URLThe URL of the similarity servicehttps://similarity.cafevariome.org