Environment Variables¶
Complete reference for all TruSpace configuration options.
Quick Reference¶
| Category | Variables |
|---|---|
| Core | NODE_ENV, LOG_LEVEL |
| Network | CORS_ORIGIN, FRONTEND_PORT, BACKEND_PORT |
| IPFS | IPFS_*, CLUSTER_* |
| AI | OLLAMA_*, DISABLE_ALL_AI_FUNCTIONALITY |
| Security | JWT_SECRET, CLUSTER_SECRET |
Core Settings¶
NODE_ENV¶
Application environment mode.
| Value | Description |
|---|---|
development |
Development mode with verbose logging |
production |
Production mode with optimized settings |
LOG_LEVEL¶
Logging verbosity level.
| Value | Description |
|---|---|
debug |
All messages including debug |
info |
Informational messages and above |
warn |
Warnings and errors only |
error |
Errors only |
Network Settings¶
CORS_ORIGIN¶
Allowed origins for CORS requests. Set to your domain.
# Local development
CORS_ORIGIN=http://localhost:3000
# Production
CORS_ORIGIN=https://yourdomain.com
FRONTEND_PORT¶
Port for the frontend service.
BACKEND_PORT¶
Port for the backend API service.
OI_CORS_ALLOW_ORIGIN¶
CORS origin for Open Web UI.
IPFS Settings¶
IPFS_PROFILE¶
IPFS configuration profile.
| Value | Description |
|---|---|
server |
Optimized for servers (default) |
lowpower |
Reduced resource usage for Pi/embedded |
IPFS_BOOTSTRAP_REMOVE¶
Remove default IPFS bootstrap nodes (for private networks).
IPFS_PATH¶
Custom IPFS data directory.
IPFS Cluster Settings¶
CLUSTER_SECRET¶
Shared secret for cluster authentication. Must be the same on all connected nodes.
CLUSTER_PEERNAME¶
Human-readable name for this cluster peer.
CLUSTER_REPLICATION_MIN¶
Minimum number of nodes that should pin each item.
CLUSTER_REPLICATION_MAX¶
Maximum number of nodes that should pin each item.
AI Settings¶
DISABLE_ALL_AI_FUNCTIONALITY¶
Completely disable AI features.
# Enable AI (default)
DISABLE_ALL_AI_FUNCTIONALITY=false
# Disable AI
DISABLE_ALL_AI_FUNCTIONALITY=true
OLLAMA_MODEL¶
Default LLM model for AI analysis.
| Model | Size | Quality | Speed |
|---|---|---|---|
tinyllama |
637 MB | Basic | Fast |
phi3 |
2.2 GB | Good | Medium |
llama3.2:3b |
2.0 GB | Good | Medium |
llama3.2:7b |
4.7 GB | Better | Slower |
mistral |
4.1 GB | Better | Slower |
OLLAMA_HOST¶
Ollama API host (if running separately).
OLLAMA_GPU¶
Enable GPU acceleration.
Security Settings¶
JWT_SECRET¶
Secret key for JWT token signing.
JWT_EXPIRY¶
JWT token expiration time.
BCRYPT_ROUNDS¶
Number of bcrypt hashing rounds.
Build Settings¶
BUILD_OR_PULL_IMAGES¶
Whether to build images locally or pull from registry.
| Value | Description |
|---|---|
pull |
Pull pre-built images (default, faster) |
build |
Build images locally |
Example Configurations¶
Local Development¶
NODE_ENV=development
LOG_LEVEL=debug
CORS_ORIGIN=http://localhost:3000
FRONTEND_PORT=3000
BACKEND_PORT=8000
OLLAMA_MODEL=tinyllama
Production¶
NODE_ENV=production
LOG_LEVEL=info
CORS_ORIGIN=https://truspace.example.com
FRONTEND_PORT=3000
BACKEND_PORT=8000
JWT_SECRET=<generated-secret>
CLUSTER_SECRET=<generated-secret>
OLLAMA_MODEL=llama3.2:7b
BUILD_OR_PULL_IMAGES=pull
Raspberry Pi¶
NODE_ENV=production
LOG_LEVEL=info
IPFS_PROFILE=lowpower
DISABLE_ALL_AI_FUNCTIONALITY=true
CORS_ORIGIN=http://raspberrypi.local:3000
Applying Changes¶
After modifying .env: