Enhance configuration management with comprehensive environment setup
- Added detailed .env.example with extensive configuration options - Created centralized configuration module with type-safe environment variable loading - Implemented configuration validation and default value handling - Added support for different environment modes (development, production, test) - Introduced interfaces for robust type definitions across the project - Implemented middleware for request validation, security, and input sanitization
This commit is contained in:
52
.env.example
52
.env.example
@@ -1,7 +1,51 @@
|
||||
NODE_ENV=development
|
||||
# Home Assistant Configuration
|
||||
# The URL of your Home Assistant instance
|
||||
HASS_HOST=http://homeassistant.local:8123
|
||||
|
||||
# Long-lived access token from Home Assistant
|
||||
# Generate from Profile -> Long-Lived Access Tokens
|
||||
HASS_TOKEN=your_home_assistant_token
|
||||
PORT=3000
|
||||
|
||||
# WebSocket URL for real-time updates
|
||||
HASS_SOCKET_URL=ws://homeassistant.local:8123/api/websocket
|
||||
LOG_LEVEL=debug
|
||||
PROCESSOR_TYPE=claude
|
||||
|
||||
# Server Configuration
|
||||
# Port for the MCP server (default: 3000)
|
||||
PORT=3000
|
||||
|
||||
# Environment (development/production/test)
|
||||
NODE_ENV=development
|
||||
|
||||
# Debug mode (true/false)
|
||||
DEBUG=false
|
||||
|
||||
# Logging level (debug/info/warn/error)
|
||||
LOG_LEVEL=info
|
||||
|
||||
# AI Configuration
|
||||
# Natural Language Processor type (claude/gpt4/custom)
|
||||
PROCESSOR_TYPE=claude
|
||||
|
||||
# OpenAI API Key (required for GPT-4 analysis)
|
||||
OPENAI_API_KEY=your_openai_api_key
|
||||
|
||||
# Rate Limiting
|
||||
# Requests per minute per IP for regular endpoints
|
||||
RATE_LIMIT_REGULAR=100
|
||||
|
||||
# Requests per minute per IP for WebSocket connections
|
||||
RATE_LIMIT_WEBSOCKET=1000
|
||||
|
||||
# Security
|
||||
# JWT secret for token generation (change this in production!)
|
||||
JWT_SECRET=your_jwt_secret_key
|
||||
|
||||
# CORS configuration (comma-separated list of allowed origins)
|
||||
CORS_ORIGINS=http://localhost:3000,http://localhost:8123
|
||||
|
||||
# Test Configuration
|
||||
# Only needed if running tests
|
||||
TEST_HASS_HOST=http://localhost:8123
|
||||
TEST_HASS_TOKEN=test_token
|
||||
TEST_HASS_SOCKET_URL=ws://localhost:8123/api/websocket
|
||||
TEST_PORT=3001
|
||||
Reference in New Issue
Block a user