Configuration
Environment Variables
Complete reference for all OpenQA environment variables.
🔧 Configuration Priority
OpenQA uses a layered configuration system with the following priority:
Database Config (Web UI) > Environment Variables > Defaults
This means you can configure everything via the web interface at /config, and those settings will override environment variables. Learn more →
💡 Two Configuration Methods
Method 1: Web UI Only (Recommended for demos/development)
- No
.envfile needed - Configure everything via
/configpage - Changes take effect immediately
Method 2: Environment Variables + Web UI (Recommended for production)
- Set defaults via
.envor docker-compose - Override specific values via web UI
- Best for automated deployments
Quick Setup
Copy the example file and edit it:
bash
1cp .env.example .env2# Edit .env with your valuesSecurity (Required for Production)
| Variable | Default | Description |
|---|---|---|
| OPENQA_JWT_SECRET | - | JWT secret for authentication (required in production) |
| OPENQA_AUTH_DISABLED | false | Disable authentication (NEVER in production) |
| NODE_ENV | development | Set to "production" for production deployments |
LLM Configuration
| Variable | Default | Description |
|---|---|---|
| LLM_PROVIDER | openai | LLM provider: openai, anthropic, or ollama |
| OPENAI_API_KEY | - | OpenAI API key (required if using OpenAI) |
| ANTHROPIC_API_KEY | - | Anthropic API key (required if using Anthropic) |
| OLLAMA_BASE_URL | http://localhost:11434 | Ollama server URL (if using Ollama) |
| LLM_MODEL | gpt-4o | Model to use for test generation |
Target Application
| Variable | Default | Description |
|---|---|---|
| SAAS_URL | - | URL of the application to test |
| SAAS_AUTH_TYPE | none | Authentication type: none, basic, or session |
| SAAS_USERNAME | - | Username for authentication |
| SAAS_PASSWORD | - | Password for authentication |
GitHub Integration
| Variable | Default | Description |
|---|---|---|
| GITHUB_TOKEN | - | GitHub personal access token |
| GITHUB_OWNER | - | GitHub repository owner/organization |
| GITHUB_REPO | - | GitHub repository name |
GitLab Integration
| Variable | Default | Description |
|---|---|---|
| GITLAB_TOKEN | - | GitLab personal access token |
| GITLAB_PROJECT_ID | - | GitLab project ID |
| GITLAB_URL | https://gitlab.com | GitLab instance URL |
Agent Behavior
| Variable | Default | Description |
|---|---|---|
| AGENT_INTERVAL_MS | 3600000 | Time between test sessions (ms). Default: 1 hour |
| AGENT_MAX_ITERATIONS | 20 | Maximum actions per test session |
| AGENT_AUTO_START | true | Start testing automatically on launch |
Web UI
| Variable | Default | Description |
|---|---|---|
| WEB_PORT | 4242 | Port for the web interface |
| WEB_HOST | 0.0.0.0 | Host to bind the web server |
| CORS_ORIGINS | * | Allowed CORS origins (comma-separated) |
Database
| Variable | Default | Description |
|---|---|---|
| DB_PATH | ./data/openqa.db | Path to SQLite database file |
Git Listener
| Variable | Default | Description |
|---|---|---|
| GIT_LISTENER_ENABLED | false | Enable automatic testing on git events |
| GIT_LISTENER_POLL_INTERVAL | 60000 | Polling interval for git events (ms) |
Example .env File
bash
1# LLM Configuration2LLM_PROVIDER=openai3OPENAI_API_KEY=sk-your-api-key-here4 5# Target Application6SAAS_URL=https://your-app.com7SAAS_AUTH_TYPE=session8SAAS_USERNAME=test@example.com9SAAS_PASSWORD=testpassword10 11# GitHub Integration (Optional)12GITHUB_TOKEN=ghp_your-token13GITHUB_OWNER=your-username14GITHUB_REPO=your-repo15 16# Agent Behavior17AGENT_INTERVAL_MS=360000018AGENT_MAX_ITERATIONS=2019AGENT_AUTO_START=true20 21# Web UI22WEB_PORT=300023WEB_HOST=0.0.0.024 25# Database26DB_PATH=./data/openqa.db27 28# Git Listener (Optional)29GIT_LISTENER_ENABLED=true30GIT_LISTENER_POLL_INTERVAL=60000