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:
- Shell Environment: Directly set in the shell before starting the application, or set using docker-compose files.
- Docker Secrets: When using Docker, sensitive values can be provided via Docker secrets.
- .env File: A file named
.envin the./conf/directory can be used to set environment variables. The path to this file can be changed using theCV_ENV_FILEenvironment 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 Name | Description | Default Value |
|---|---|---|
| CV_APPLICATION_NAME | The name of the application, used in node descriptions and email subjects | Cafe Variome V4 |
| CV_APPLICATION_DESCRIPTION | A short description of the application, used in email bodies | A federated platform for sharing and discovering healthcare data. |
| CV_ACCESS_URL | The base URL for accessing the application | http://localhost:5000 |
| CV_ACCESS_TOKEN_TTL | The time-to-live (TTL) for access tokens in seconds | 300 |
| CV_REFRESH_TOKEN_TTL | The time-to-live (TTL) for refresh tokens in seconds | 7200 |
| CV_ALLOW_REGISTRATION | Whether to allow user registration | true |
| CV_SSO_REGISTRATION | Whether to automatically register user coming from SSO | true |
| CV_MAINTAIN_SSO_SESSION | Whether to maintain SSO session for users by automatically refreshing tokens | false |
| CV_LOGGING_LEVEL | The logging level for the application | INFO |
| CV_ENABLE_METRICS | Whether to enable Prometheus metrics | false |
| CV_DATA_DIR | The directory for storing application data | data |
| CV_ALLOW_ORIGINS | A JSON array of allowed origins for CORS | [] |
| CV_SERVICE_ROOT_PATH | The root path for the API endpoints | /api |
| CV_OPENAPI_URL | The URL for the OpenAPI specification | /openapi.json |
| CV_DOCS_URL | The URL for the API documentation | /docs |
| CV_REDOC_URL | The URL for the ReDoc API documentation | /redoc |
| CV_ENVIRONMENT | The application environment (e.g., development, production) | development |
| CV_DATABASE_DRIVER | The database driver to use (e.g., mongo) | mongo |
| CV_MONGODB_HOST | The hostname of the MongoDB server | localhost |
| CV_MONGODB_PORT | The port of the MongoDB server | 27017 |
| CV_MONGODB_DB_NAME | The name of the MongoDB database | cafe-variome |
| CV_CACHE_DRIVER | The caching driver to use (e.g., redis) | redis |
| CV_REDIS_HOST | The hostname of the Redis server | localhost |
| CV_REDIS_PORT | The port of the Redis server | 6379 |
| CV_KMS_DRIVER | The Key Management Service (KMS) driver to use (e.g., vault) | vault |
| CV_VAULT_URL | The URL of the Vault server | http://localhost:8200 |
| CV_VAULT_ROLE_ID | The role ID for Vault AppRole authentication | cafe-variome-role |
| CV_VAULT_SECRET_ID | The secret ID for Vault AppRole authentication | cafe-variome-secret |
| CV_VAULT_KV_ENGINE | The name of the Vault KV engine | kv |
| CV_VAULT_KV_PATH | The path in Vault for storing secrets | cafe-variome |
| CV_VAULT_TRANSIT_ENGINE | The name of the Vault Transit engine | transit |
| CV_VAULT_TOTP_ENGINE | The name of the Vault TOTP engine | totp |
| CV_EMAIL_DRIVER | The email driver to use (e.g., smtp, sendmail, mta) | smtp |
| CV_SMTP_HOST | The hostname of the SMTP server | localhost |
| CV_SMTP_PORT | The port of the SMTP server | 25 |
| CV_SMTP_USERNAME | The username for SMTP authentication | empty |
| CV_SMTP_PASSWORD | The password for SMTP authentication | empty |
| CV_SMTP_START_TLS | Whether to use STARTTLS for SMTP | false |
| CV_SMTP_USE_TLS | Whether to use TLS for SMTP | false |
| CV_SMTP_FROM_EMAIL | The "from" email address for SMTP | no-reply@cafevariome.org |
| CV_SENDMAIL_BINARY | The path to the sendmail binary | sendmail |
| CV_MTA_FROM_EMAIL | The "from" email address for MTA | no-reply@cafevariome.org |
| CV_MTA_ENVELOPE_FROM | The envelope "from" email address for MTA | empty |
| CV_VECTOR_DB_DRIVER | The vector database driver to use (e.g., qdrant) | qdrant |
| CV_VECTOR_CHUNKING_MAX_TOKENS | The maximum number of tokens per chunk for vectorization | 200 |
| CV_VECTOR_CHUNKING_OVERLAP | The overlap ratio between chunks for vectorization | 0.1 |
| CV_VECTOR_TOKENIZER_MODEL_NAME | The name of the tokenizer model for vectorization | bert-base-uncased |
| CV_VECTOR_EMBEDDING_MODEL_NAME | The name of the embedding model for vectorization | all-MiniLM-L6-v2 |
| CV_QDRANT_LOCATION | The URL of the Qdrant server | http://localhost:6333 |
| CV_SCHEDULER_DRIVER | The scheduler driver to use (e.g., memory, celery) | memory |
| CV_CHALLENGE_DIFFICULTY | The difficulty level for challenges (e.g., CAPTCHA) | 22 |
| CV_SIMILARITY_URL | The URL of the similarity service | https://similarity.cafevariome.org |