Commit Graph

5 Commits

Author SHA1 Message Date
b67824c1f6 Fix command executor timeout handling and add detached mode
- Add detached mode for long-running processes via detached=true config
- Fix process termination on timeout using process groups and kill -TERM/-KILL
- Remove double shell wrapping that was breaking command execution
- Track PIDs via wrapper script to enable proper process cleanup
- Flush port messages after timeout to prevent Tortoise MQTT errors
- Update example config to demonstrate detached command usage

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 17:18:39 -07:00
2d948073b2 Fix commands 2025-08-10 20:34:22 -07:00
4ab0972870 Add Home Assistant MQTT auto-discovery integration
- Implement `Systant.HaDiscovery` module for automatic device registration
- Add comprehensive sensor discovery: CPU, memory, GPU, disk, network, temperature
- Update MQTT client to publish discovery messages on startup
- Add HomeAssistant configuration section to systant.toml
- Create example configuration file with localhost MQTT broker
- Update CLAUDE.md with complete HA integration documentation
- Add mosquitto to development dependencies for testing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-08 20:38:34 -07:00
168b3558f7 Implement secure MQTT command execution system
- Add comprehensive command configuration to systant.toml with user-defined commands
- Create Systant.CommandExecutor module with strict security validation:
  * Whitelist-only command execution (no arbitrary shell commands)
  * Parameter validation against allowed lists
  * Command timeouts and confirmation requirements
  * Full audit logging and response tracking
- Implement Systant.MqttHandler for processing command messages:
  * JSON command parsing and validation
  * Response publishing to systant/{hostname}/responses topic
  * Built-in "list" command to show available commands
  * Error handling with detailed response messages
- Update MqttClient to use custom handler instead of Logger
- Security features:
  * Only predefined commands from TOML config
  * Parameter substitution with validation ($SERVICE, $PATH, etc.)
  * Execution timeouts and comprehensive logging
  * Structured response format with request tracking

Example commands configured: restart services, system info, disk usage, process status, network tests.
Users can customize commands in their systant.toml file.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 21:21:23 -07:00
b1cd085f6b Implement comprehensive TOML-based configuration system
- Add Systant.Config module for TOML configuration with environment overrides
- Create systant.toml template with all metric module controls
- Update SystemMetrics to use configuration-driven collection
- Add filtering for disks, network interfaces, and processes
- Implement per-module enable/disable controls
- Update MqttClient to use new configuration system
- Add Hivemind/Just development workflow integration
- Update dashboard with graphical metrics display and raw data toggle
- Comprehensive documentation updates in CLAUDE.md

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 21:02:02 -07:00