Commit Graph

20 Commits

Author SHA1 Message Date
agessaman
f525d2e1d0 Enhance message handling and web viewer with path information support
- Updated MessageHandler to extract and store path information from packet_info and routing_info, improving data tracking.
- Added a new API endpoint in the web viewer for decoding path hex strings to repeater names.
- Enhanced the contacts template to display path information with tooltips, improving user experience.
- Implemented tooltip functionality for path data in the web viewer, allowing users to view detailed repeater information on hover.
2025-12-13 14:41:56 -08:00
agessaman
d62e63cdb9 Apply code quality improvements to PR16 security enhancements
Security Improvements:
- Add DNS timeout (2.0s default) to validate_external_url() to prevent DoS
  attacks from malicious URLs causing DNS resolution to hang
- Make path validation OS-aware: supports Windows, macOS (Darwin), and Linux
  with platform-specific dangerous path detection
- Add validation for negative max_length values in sanitize_input()

Code Quality Improvements:
- Extract bot_root property in MeshCoreBot class to eliminate code duplication
  (was calculated twice in __init__ and setup_logging)
- Use explicit bot_root directory instead of '.' for predictable path validation
  in both database and log file path validation
- Make sanitize_input() max_length parameter Optional to allow disabling length
  check for radio messages (firmware enforces 150-char limit at hardware level)
- Update message_handler.py to use max_length=None for radio messages while
  preserving control character stripping for security
- Replace inline regex with centralized validate_pubkey_format() function in
  base_command.py for consistency and maintainability
- Improve documentation: add comments about socket timeout behavior and
  firmware-enforced message length limits

All improvements have been tested and verified:
- Syntax checks pass
- All functions work correctly
- No circular dependencies
- Bot initializes successfully with all attributes present

Files modified:
- modules/security_utils.py: DNS timeout, OS-aware paths, Optional max_length
- modules/core.py: bot_root property, explicit base directory usage
- modules/message_handler.py: max_length=None for radio messages
- modules/commands/base_command.py: centralized validation function
2025-12-09 21:44:42 -08:00
eddieoz
8a35dc8270 feat: Add security utilities for path validation, SQL injection prevention, and input sanitization. 2025-12-09 21:26:42 -08:00
agessaman
c151fba7a5 Enhance configuration and database management for feed and channel operations. Add channel refresh interval setting to config.ini.example, implement feed manager functionality with new database tables for feed subscriptions and activity tracking, and improve greeter command logic with human greeting detection and Levenshtein distance matching for user greetings. Update web viewer to include feed management pages and integrate global template variables for better user experience. 2025-12-06 10:18:12 -08:00
agessaman
5c2af1a014 added generic per-command channel configuration, allows commands to be mapped to different channels or dms only 2025-11-25 21:19:48 -08:00
agessaman
82aa5ee160 Add greeter command configuration to config.ini.example and implement greeter functionality in message handling. Introduce favorite status management for repeaters, allowing users to toggle favorite status via API. Update path command and test command to incorporate favorite bias in scoring. Enhance database schema to support star status tracking for repeaters and roomservers. 2025-11-25 17:26:40 -08:00
agessaman
732b7551ba Enhance message handling and repeater management by adding packet_hash support for tracking advertisements. Implement geocoding cache to prevent duplicate API calls based on packet_hash, improving efficiency in location data retrieval. Update relevant methods to accept packet_hash and ensure proper handling in geocoding logic. 2025-11-23 11:45:31 -08:00
agessaman
6c660dc14c Enhance configuration and command files to support new distance metrics in message responses. Updated Keywords section to include {path_distance} and {firstlast_distance} placeholders. Refactored distance calculation methods into utils and improved path command logic for better accuracy in distance reporting. Added detailed logging for packet hash calculations and message handling in multitest command. 2025-11-20 21:41:10 -08:00
agessaman
0ec60e48c2 Add multitest functionality to message handler for path collection and implement packet hash calculation for message tracking. Updated translations to support multitest commands. 2025-11-18 20:11:11 -08:00
agessaman
7e2c478662 Implement localization support across various commands and configuration. Added language settings in config.ini.example, integrated translation functionality in command responses, and enhanced error handling with localized messages. Improved fallback mechanisms for missing translations and updated help text for better user guidance. 2025-11-16 20:17:58 -08:00
agessaman
7bb51f219b Web Viewer Integration
- Add Flask + Flask-SocketIO web viewer with dashboard (modules/web_viewer/app.py and related)
- Add web viewer templates: index, realtime, tracking (contacts), cache, purging, stats (modules/web_viewer/templates/)
- Add integration hooks and utility functions for web viewer (modules/web_viewer/integration.py, modules/utils.py)
- Add command to launch web viewer from bot CLI (modules/commands/webviewer_command.py)
- Update .gitignore: ignore db/log files, test scripts, and web viewer artifacts
- Add restart_viewer.sh helper script for standalone web viewer restart/troubleshooting
- Add guidance and documentation for modern viewer in WEB_VIEWER.md and docs/
- Various code structure and import improvements to core bot and command modules to support integration
- Add ACL support for sensitive commands
- Example config updates

Benefits:
- Decouples monitoring/UI from bot core process
- Enables real-time browser dashboard and unified contact/repeater tracking
- Easier integration, dev, and troubleshooting
2025-10-21 21:57:00 -07:00
agessaman
4adf9fe301 Updated database schema for complete contact tracking and optimized handling of repeater commands. Revised method for removing contacts from the device to use meshcore.py. 2025-10-18 17:16:50 -07:00
agessaman
52c7e5fa31 added channel overrides for sports command; updated channels command; added stats command; consolidated t_phrase as a shortcut to test; added scheduled adverts 2025-10-05 16:09:39 -07:00
agessaman
d7eab28395 improved repeater purge, implement sports command, and improve message path detection. 2025-09-16 16:36:02 -07:00
agessaman
7445e2ad10 first draft of a sports command using the ESPN endpoints 2025-09-13 13:35:35 -07:00
agessaman
ef02529a4b make @ command work in public channels 2025-09-07 10:45:43 -07:00
agessaman
b17016087b Add sender name to routing info logs 2025-09-06 18:38:38 -07:00
agessaman
2206265e10 Update modules with latest development changes
- Enhanced command processing with exclamation mark handling
- Improved message handling and RF data correlation
- Updated repeater management functionality
- Enhanced command implementations across all modules
- Updated database manager and core functionality
- All changes maintain backward compatibility
2025-09-06 11:22:58 -07:00
agessaman
04b3542411 Enhance configuration and command structure for MeshCore Bot. Added RF data correlation settings in config.ini, implemented a BotTxRateLimiter for transmission control, and refactored command handling to support plugins. Removed obsolete scripts and improved command metadata for better usability. 2025-09-04 18:48:59 -07:00
agessaman
9fa8b02be6 Initial commit: MeshCore Bot project 2025-09-04 15:33:51 -07:00