mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-10 03:51:54 +00:00
- Fixed alert clearing logic to work even when alerts are acknowledged - Added immediate WebSocket state broadcast after alert resolution - Fixed frontend activeAlerts store updates to maintain SolidJS reactivity - Added logging for alert resolution events The alert system now properly: - Creates alerts when thresholds are exceeded - Clears alerts automatically when values drop below clear threshold - Updates frontend in real-time without requiring page refresh
6.1 KiB
6.1 KiB
Pulse Configuration Guide
Pulse supports a flexible configuration system with multiple sources and clear precedence rules.
Configuration Sources (in order of precedence)
- Command-line arguments (highest priority)
- Environment variables
- Configuration file
- Default values (lowest priority)
Quick Start
Using Environment Variables
# Set custom ports
export PULSE_SERVER_BACKEND_PORT=8080
export PULSE_SERVER_FRONTEND_PORT=8081
# Set log level
export PULSE_LOG_LEVEL=debug
# Run Pulse
./bin/pulse
Using Configuration File
- Generate an example configuration file:
./bin/pulse config init
-
Edit
pulse.ymlto customize settings -
Run Pulse:
./bin/pulse
Using Command-Line Arguments
# Override specific settings
./bin/pulse --backend-port=9000 --frontend-port=9001 --log-level=debug
# Use a custom config file
./bin/pulse --config=/custom/path/pulse.yml
Configuration File Formats
Pulse supports both YAML and JSON configuration files:
/etc/pulse/pulse.yml(system-wide, YAML)/etc/pulse/pulse.json(system-wide, JSON)./pulse.yml(local directory, YAML)./pulse.json(local directory, JSON)
Example YAML Configuration
server:
backend:
port: 3000
host: "0.0.0.0"
frontend:
port: 7655
host: "0.0.0.0"
monitoring:
pollingInterval: 5000
backupPollingCycles: 10
logging:
level: "info"
file: "/var/log/pulse/pulse.log"
All Configuration Options
Server Settings
| Setting | ENV Variable | CLI Flag | Default | Description |
|---|---|---|---|---|
server.backend.port |
PULSE_SERVER_BACKEND_PORT |
--backend-port |
3000 | Backend API server port |
server.backend.host |
PULSE_SERVER_BACKEND_HOST |
--backend-host |
0.0.0.0 | Backend bind address |
server.frontend.port |
PULSE_SERVER_FRONTEND_PORT |
--frontend-port |
7655 | Frontend web UI port |
server.frontend.host |
PULSE_SERVER_FRONTEND_HOST |
--frontend-host |
0.0.0.0 | Frontend bind address |
Monitoring Settings
| Setting | ENV Variable | Default | Description |
|---|---|---|---|
monitoring.pollingInterval |
PULSE_MONITORING_POLLING_INTERVAL |
5000 | Polling interval in milliseconds |
monitoring.concurrentPolling |
PULSE_MONITORING_CONCURRENT_POLLING |
true | Enable concurrent polling |
monitoring.backupPollingCycles |
PULSE_MONITORING_BACKUP_POLLING_CYCLES |
10 | Poll backups every N cycles |
monitoring.metricsRetentionDays |
PULSE_MONITORING_METRICS_RETENTION_DAYS |
7 | Days to retain metrics |
Logging Settings
| Setting | ENV Variable | CLI Flag | Default | Description |
|---|---|---|---|---|
logging.level |
PULSE_LOG_LEVEL |
--log-level |
info | Log level (debug, info, warn, error) |
logging.file |
PULSE_LOG_FILE |
--log-file |
/opt/pulse/pulse.log | Log file path |
logging.maxSize |
PULSE_LOG_MAX_SIZE |
- | 100 | Max log file size in MB |
logging.maxBackups |
PULSE_LOG_MAX_BACKUPS |
- | 5 | Number of log files to keep |
logging.maxAge |
PULSE_LOG_MAX_AGE |
- | 30 | Max age in days for log files |
logging.compress |
PULSE_LOG_COMPRESS |
- | true | Compress rotated logs |
Security Settings
| Setting | ENV Variable | Default | Description |
|---|---|---|---|
security.apiToken |
PULSE_API_TOKEN |
"" | API authentication token |
security.allowedOrigins |
PULSE_ALLOWED_ORIGINS |
["*"] | CORS allowed origins (comma-separated) |
security.iframeEmbedding |
PULSE_IFRAME_EMBEDDING |
SAMEORIGIN | X-Frame-Options header |
security.enableAuthentication |
PULSE_ENABLE_AUTHENTICATION |
false | Enable authentication |
Docker Configuration
When running in Docker, you can use environment variables or mount a config file:
version: '3.8'
services:
pulse:
image: pulse:latest
environment:
- PULSE_SERVER_BACKEND_PORT=8080
- PULSE_SERVER_FRONTEND_PORT=8081
- PULSE_LOG_LEVEL=debug
volumes:
- ./pulse.yml:/etc/pulse/pulse.yml
ports:
- "8080:8080"
- "8081:8081"
Configuration Commands
Generate Example Configuration
# Generate YAML config (default)
./bin/pulse config init
# Generate JSON config
./bin/pulse config init --format=json --output=pulse.json
# Force overwrite existing file
./bin/pulse config init --force
Validate Configuration
# Validate default config file
./bin/pulse config validate
# Validate specific file
./bin/pulse config validate /path/to/pulse.yml
# Show effective configuration
./bin/pulse config validate --verbose
Port Configuration Notes
- Privileged Ports: Ports below 1024 require root privileges
- Port Conflicts: Pulse will check if ports are available before binding
- Firewall: Remember to update firewall rules when changing ports
Best Practices
- Production: Use a configuration file in
/etc/pulse/ - Development: Use environment variables or CLI arguments
- Docker: Use environment variables for flexibility
- Security: Always set
apiTokenin production environments - Logging: Use appropriate log levels (info for production, debug for development)
Troubleshooting
Configuration Not Loading
- Check file permissions:
ls -la /etc/pulse/pulse.yml - Validate syntax:
./bin/pulse config validate - Check logs for errors:
tail -f /opt/pulse/pulse.log
Port Already in Use
- Check what's using the port:
sudo lsof -i :PORT - Either stop the conflicting service or choose a different port
- Update firewall rules if needed
Environment Variables Not Working
- Ensure correct prefix:
PULSE_ - Check spelling and case sensitivity
- Export variables:
export PULSE_SERVER_BACKEND_PORT=8080
Migration from Old Configuration
If upgrading from an older version:
- Backend port was in main config, now in
server.backend.port - Polling interval now in milliseconds (was seconds)
- Node configuration remains in separate files (nodes.json)