QueryGlow

Environment Variables

Configuration options for the QueryGlow container. These should be defined in your .env file or passed via Docker Compose. The deploy.sh script generates this file automatically.

Critical Security Variables

VariableRequiredDescription
SESSION_SECRETYESA 64-character hex string used to derive the encryption key for database passwords and SSH keys. Encrypts using AES-256-GCM with scrypt key derivation.
Warning: If you lose this, all saved database passwords become unreadable. Back up your .env file securely!
ENCRYPTION_SALTAUTOAuto-generated by deploy.sh. Each installation gets a unique salt for credential encryption.

Do not manually set this unless migrating installations.

NODE_ENVRECSet to production for production deployments. Enables performance optimizations and disables verbose logging.

Safe Mode Configuration

VariableDefaultDescription
QUERYGLOW_ALLOW_DESTRUCTIVEfalseControls Query Editor safety behavior:

false = Safe Mode (default)

Blocks DROP TABLE, TRUNCATE, DELETE/UPDATE without WHERE

true = Power Mode

All SQL commands allowed in Query Editor

Note: This only affects the Query Editor (raw SQL). Data Browser buttons (edit/delete single rows) always work.

Always blocked (cannot be enabled): DROP DATABASE, SHUTDOWN, INTO OUTFILE, LOAD_FILE, xp_cmdshell, COPY TO/FROM PROGRAM

System Configuration

VariableDefaultDescription
PORT3000Internal port the Next.js server listens on. Auto-detected by deploy.sh if 3000 is in use (tries 3001, 3002, etc.).
DATA_DIR/app/dataDirectory path where persistent JSON files are stored:
  • connections.json — encrypted connection profiles
  • query-history.json — execution history (1,000 per connection)
  • saved-queries.json — saved SQL snippets

AI Assistant (Optional)

Providing these keys enables the AI query generation feature. Requests are proxied through your server, keeping API keys secret from the browser. Leave blank to disable AI features—the app works perfectly without AI.

VariableProviderDescription
OPENAI_API_KEYOpenAIEnables GPT-4o model. Key format: sk-...
ANTHROPIC_API_KEYAnthropicEnables Claude 3.5 Sonnet model. Key format: sk-ant-...
GOOGLE_API_KEYGoogleEnables Gemini 1.5 Pro model. Key format: AIza...

Rate limited to 30 requests/minute to prevent API cost abuse.

Example .env File

# ==============================================
# QueryGlow Configuration
# ==============================================

# CRITICAL: Security
# Generate with: openssl rand -hex 32
SESSION_SECRET=your-64-character-hex-string-here

# Auto-generated by deploy.sh (unique per installation)
ENCRYPTION_SALT=auto-generated-do-not-set-manually

# Environment
NODE_ENV=production

# Safe Mode (default: false = Safe Mode ON)
# Set to true only if you need DROP TABLE, TRUNCATE, etc.
QUERYGLOW_ALLOW_DESTRUCTIVE=false

# Data persistence
DATA_DIR=/app/data

# Port (default: 3000, auto-detected if in use)
PORT=3000

# Optional: AI Assistant (add one or more)
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_API_KEY=AIza...

Generate a secure SESSION_SECRET: openssl rand -hex 32 (produces 64 hex characters)

Quick Reference

VariableRequiredDefaultPurpose
SESSION_SECRETYesEncryption key derivation
ENCRYPTION_SALTAutogeneratedUnique salt per installation
QUERYGLOW_ALLOW_DESTRUCTIVENofalseSafe Mode control
NODE_ENVRecdevelopmentProduction optimizations
PORTNo3000Server port
DATA_DIRNo/app/dataPersistent storage path
OPENAI_API_KEYNoGPT-4o AI
ANTHROPIC_API_KEYNoClaude AI
GOOGLE_API_KEYNoGemini AI