Configuration
Configuration Method
Section titled “Configuration Method”Glean is configured through environment variables. Create a .env file:
# Download example configurationcurl -fsSL https://raw.githubusercontent.com/LeslieLeung/glean/main/.env.example -o .env
# Edit configurationnano .envCore Configuration
Section titled “Core Configuration”Security Settings
Section titled “Security Settings”| Variable | Required | Default | Description |
|---|---|---|---|
SECRET_KEY | Yes | - | JWT signing key, at least 32 characters |
DEBUG | No | false | Debug mode, must be disabled in production |
Database Configuration
Section titled “Database Configuration”| Variable | Required | Default | Description |
|---|---|---|---|
POSTGRES_DB | No | glean | Database name |
POSTGRES_USER | No | glean | Database username |
POSTGRES_PASSWORD | Yes | glean | Database password |
Port Configuration
Section titled “Port Configuration”| Variable | Default | Description |
|---|---|---|
WEB_PORT | 80 | Web application port |
ADMIN_PORT | 3001 | Admin dashboard port |
Admin Configuration
Section titled “Admin Configuration”Auto-create admin account on first startup:
| Variable | Default | Description |
|---|---|---|
CREATE_ADMIN | false | Whether to auto-create admin |
ADMIN_USERNAME | admin | Admin username |
ADMIN_PASSWORD | - | Admin password (required if enabled) |
ADMIN_ROLE | super_admin | Admin role |
Example configuration:
CREATE_ADMIN=trueADMIN_USERNAME=adminADMIN_PASSWORD=MySecurePass123!Logging Configuration
Section titled “Logging Configuration”| Variable | Default | Description |
|---|---|---|
LOG_LEVEL | INFO | Log level (DEBUG/INFO/WARNING/ERROR) |
LOG_FILE | /app/logs/glean-api.log | Log file path |
LOG_ROTATION | 100 MB | Log rotation size |
LOG_RETENTION | 30 days | Log retention period |
LOG_COMPRESSION | gz | Log compression format |
Milvus Configuration (Vector Database)
Section titled “Milvus Configuration (Vector Database)”Milvus configuration for full deployment mode:
| Variable | Default | Description |
|---|---|---|
MILVUS_HOST | milvus | Milvus service host |
MILVUS_PORT | 19530 | Milvus service port |
MILVUS_USER | - | Milvus username (if auth enabled) |
MILVUS_PASSWORD | - | Milvus password (if auth enabled) |
Embedding Configuration
Section titled “Embedding Configuration”Vector embedding configuration for smart recommendations:
| Variable | Default | Description |
|---|---|---|
EMBEDDING_PROVIDER | sentence-transformers | Embedding provider |
EMBEDDING_MODEL | all-MiniLM-L6-v2 | Model name |
EMBEDDING_DIMENSION | 384 | Vector dimension (must match model) |
EMBEDDING_API_KEY | - | API key (OpenAI/Volcengine) |
EMBEDDING_BASE_URL | - | Custom API endpoint |
EMBEDDING_BATCH_SIZE | 20 | Batch processing size |
EMBEDDING_TIMEOUT | 30 | Request timeout (seconds) |
Supported Embedding Providers
Section titled “Supported Embedding Providers”sentence-transformers (local, default):
EMBEDDING_PROVIDER=sentence-transformersEMBEDDING_MODEL=all-MiniLM-L6-v2EMBEDDING_DIMENSION=384OpenAI:
EMBEDDING_PROVIDER=openaiEMBEDDING_MODEL=text-embedding-3-smallEMBEDDING_DIMENSION=1536EMBEDDING_API_KEY=sk-xxxVolcengine:
EMBEDDING_PROVIDER=volc-engineEMBEDDING_MODEL=doubao-embeddingEMBEDDING_DIMENSION=1024EMBEDDING_API_KEY=your-api-keyComplete Configuration Example
Section titled “Complete Configuration Example”# SecuritySECRET_KEY=your-long-random-secret-key-at-least-32-charsDEBUG=false
# DatabasePOSTGRES_PASSWORD=your-secure-database-password
# PortsWEB_PORT=80ADMIN_PORT=3001
# Admin (first startup)CREATE_ADMIN=trueADMIN_USERNAME=adminADMIN_PASSWORD=YourSecurePassword123!
# LoggingLOG_LEVEL=INFO
# Embedding (using OpenAI)EMBEDDING_PROVIDER=openaiEMBEDDING_MODEL=text-embedding-3-smallEMBEDDING_DIMENSION=1536EMBEDDING_API_KEY=sk-xxxApplying Configuration
Section titled “Applying Configuration”Restart services after modifying configuration:
# Restart all servicesdocker compose downdocker compose up -d
# Or restart specific services onlydocker compose restart backend workerVerifying Configuration
Section titled “Verifying Configuration”# Check service statusdocker compose ps
# View backend logsdocker compose logs backend
# Check health statuscurl http://localhost/api/healthNext Steps
Section titled “Next Steps”- HTTPS Setup - Configure SSL certificates
- Backup & Restore - Data backup strategies