docs: Restructure documentation and enhance configuration

- Reorganize MkDocs navigation structure with new sections
- Add configuration, security, and development environment documentation
- Remove outdated development and getting started files
- Update requirements and plugin configurations
- Improve overall documentation layout and content
This commit is contained in:
jango-blockchained
2025-02-06 04:11:16 +01:00
parent 1328bd1306
commit 81d6dea7da
11 changed files with 596 additions and 384 deletions

106
docs/configuration.md Normal file
View File

@@ -0,0 +1,106 @@
# System Configuration
This document provides detailed information about configuring the Home Assistant MCP Server.
## Configuration File Structure
The MCP Server uses a hierarchical configuration structure:
```yaml
server:
host: 0.0.0.0
port: 8123
log_level: INFO
security:
jwt_secret: YOUR_SECRET_KEY
allowed_origins:
- http://localhost:3000
- https://your-domain.com
devices:
scan_interval: 30
default_timeout: 10
```
## Server Settings
### Basic Server Configuration
- `host`: Server binding address (default: 0.0.0.0)
- `port`: Server port number (default: 8123)
- `log_level`: Logging level (INFO, DEBUG, WARNING, ERROR)
### Security Settings
- `jwt_secret`: Secret key for JWT token generation
- `allowed_origins`: CORS allowed origins list
- `ssl_cert`: Path to SSL certificate (optional)
- `ssl_key`: Path to SSL private key (optional)
### Device Management
- `scan_interval`: Device state scan interval in seconds
- `default_timeout`: Default device command timeout
- `retry_attempts`: Number of retry attempts for failed commands
## Environment Variables
Environment variables override configuration file settings:
```bash
MCP_HOST=0.0.0.0
MCP_PORT=8123
MCP_LOG_LEVEL=INFO
MCP_JWT_SECRET=your-secret-key
```
## Advanced Configuration
### Rate Limiting
```yaml
rate_limit:
enabled: true
requests_per_minute: 100
burst: 20
```
### Caching
```yaml
cache:
enabled: true
ttl: 300 # seconds
max_size: 1000 # entries
```
### Logging
```yaml
logging:
file: /var/log/mcp-server.log
max_size: 10MB
backup_count: 5
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
```
## Best Practices
1. Always use environment variables for sensitive information
2. Keep configuration files in a secure location
3. Regularly backup your configuration
4. Use SSL in production environments
5. Monitor log files for issues
## Validation
The server validates configuration on startup:
- Required fields are checked
- Value types are verified
- Ranges are validated
- Security settings are assessed
## Troubleshooting
Common configuration issues:
1. Permission denied accessing files
2. Invalid YAML syntax
3. Missing required fields
4. Type mismatches in values
See the [Troubleshooting Guide](troubleshooting.md) for solutions.