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 |
SMTP_*, EMAIL_SENDER, REGISTER_USERS_AS_INACTIVE |
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.
Security
Generate a unique secret for production:
bash
openssl rand -hex 32
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.
Security
Generate a unique secret for production:
bash
openssl rand -hex 64
JWT_EXPIRY¶
JWT token expiration time.
BCRYPT_ROUNDS¶
Number of bcrypt hashing rounds.
Email Settings¶
TruSpace uses SMTP to send transactional emails such as password resets and, optionally, registration confirmation emails.
Note
Email settings are optional. If not configured, password reset and user activation emails will not be sent.
SMTP_HOST¶
Address of the SMTP server.
SMTP_PORT¶
Port used to connect to the SMTP server.
| Port | Typical use |
|---|---|
465 |
SMTP over SSL (SMTP_SSL=true) |
587 |
SMTP with STARTTLS (SMTP_TLS=true, SMTP_SSL=false) |
25 |
Unencrypted (not recommended) |
SMTP_USER¶
Username for authenticating with the SMTP server.
SMTP_PASSWORD¶
Password for authenticating with the SMTP server.
Security
Never commit this value to version control. Use a dedicated app password or service account credential.
SMTP_SSL¶
Enable SSL/TLS from the start of the connection (typically used on port 465).
# Enable SSL (port 465)
SMTP_SSL=true
# Disable SSL — use with SMTP_TLS=true on port 587
SMTP_SSL=false
SMTP_TLS¶
Upgrade an initially unencrypted connection to TLS using STARTTLS (typically on port 587). Set SMTP_SSL=false when using this option.
EMAIL_SENDER¶
The email address that appears as the sender in outgoing notification and system emails.
REGISTER_USERS_AS_INACTIVE¶
When set to true, newly registered users are created as inactive and must confirm their email address before they can log in. Requires SMTP to be configured.
# Require email confirmation on registration
REGISTER_USERS_AS_INACTIVE=true
# Allow immediate login after registration (default)
REGISTER_USERS_AS_INACTIVE=false
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
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=noreply@example.com
SMTP_PASSWORD=<smtp-password>
SMTP_SSL=false
SMTP_TLS=true
EMAIL_SENDER=noreply@example.com
REGISTER_USERS_AS_INACTIVE=true
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: