- Implemented centralized logging utility using Winston with daily log rotation - Added logging middleware for request and error tracking - Extended .env.example with logging configuration options - Updated app configuration to support flexible logging settings - Replaced console.log with structured logging in main application entry point - Created logging middleware to capture request details and response times
73 lines
1.7 KiB
Plaintext
73 lines
1.7 KiB
Plaintext
# 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
|
|
|
|
# WebSocket URL for real-time updates
|
|
HASS_SOCKET_URL=ws://homeassistant.local:8123/api/websocket
|
|
|
|
# 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
|
|
|
|
# Security Configuration
|
|
JWT_SECRET=your-secret-key
|
|
|
|
# Rate Limiting
|
|
RATE_LIMIT_WINDOW_MS=900000 # 15 minutes
|
|
RATE_LIMIT_MAX=100
|
|
|
|
# SSE Configuration
|
|
SSE_MAX_CLIENTS=1000
|
|
SSE_PING_INTERVAL=30000
|
|
|
|
# Logging Configuration
|
|
LOG_LEVEL=info
|
|
LOG_DIR=logs
|
|
LOG_MAX_SIZE=20m
|
|
LOG_MAX_DAYS=14d
|
|
LOG_COMPRESS=true
|
|
LOG_REQUESTS=true
|
|
|
|
# Version
|
|
VERSION=0.1.0 |