- Removed custom _DuplicateAwareConfigParser in favor of standard configparser.ConfigParser.
- Simplified configuration loading process while maintaining existing functionality.
- Updated the `_handle_option` method to accommodate changes in Python 3.13, ensuring proper handling of duplicate options in configuration files.
- Enhanced logging to provide clearer error messages when duplicate options are detected, improving troubleshooting capabilities.
- Renamed various documentation files to use lowercase for improved consistency, including `WEB_VIEWER.md`, `DOCKER.md`, and `PATH_COMMAND_CONFIG.md`.
- Updated references in `config.ini.example`, `docker-setup.sh`, `README.md`, and multiple documentation files to reflect the new file names.
- Removed obsolete documentation files related to the Discord Bridge, Map Uploader, Packet Capture, and Weather Service, streamlining the documentation structure.
- Added logic to the `install-service.sh` script to automatically create a `config.ini` file from `config.ini.example` if it does not exist in the installation directory.
- Included warnings for users if the example file is not found, ensuring proper configuration setup before starting the bot.
- Refactored joke command configuration in `core.py` to maintain consistency and clarity in the configuration structure.
- Updated the `MeshCoreBot` class to read the configuration file with UTF-8 encoding, ensuring proper parsing of emoji and non-ASCII characters on Windows.
- Applied the same encoding change to the configuration reload logic, maintaining consistency across configuration handling.
- Added a new [Feed_Manager] section in the configuration to enable or disable RSS/API feed subscriptions, defaulting to false.
- Updated the FeedManager class to handle missing configuration sections gracefully, ensuring compatibility with upgrades.
- Refactored joke command configuration to standardize the use of an `enabled` key, replacing legacy `*_enabled` keys for clarity.
- Adjusted the PathCommand class to enable the "p" shortcut by default, improving user experience.
- Enhanced .gitignore to allow test files in the tests/ directory and committed pytest.ini for test discovery.
- Added checks for missing sections in configuration files, specifically for Admin_ACL and Banned_Users, to prevent errors during bot startup.
- Updated generate_website.py and command_manager.py to handle cases where required sections are absent, returning empty lists instead of raising exceptions.
- Introduced optional dependencies for testing in pyproject.toml, ensuring a smoother development experience.
- Improved localization handling in core.py to default to English when the Localization section is missing, enhancing user experience.
- Updated logging setup to use default values when the [Logging] section is missing, ensuring consistent behavior.
- Improved handling of colored output and log file configuration based on the presence of the [Logging] section across multiple modules.
- Refactored related code in core and service plugins for better clarity and maintainability.
- Added per-user rate limiting functionality to control the minimum time between bot replies to the same user, identified by public key or sender name.
- Updated configuration files to include `per_user_rate_limit_seconds` and `per_user_rate_limit_enabled` options for enabling and configuring this feature.
- Enhanced the command manager and message handler to support per-user rate limiting, ensuring efficient message handling and reduced spam.
- Updated documentation to reflect the new rate limiting options and their usage.
- Introduced `channel_keywords` option in the configuration files to limit bot responses in monitored channels to specified keywords, enhancing control over channel interactions.
- Updated relevant documentation and examples to reflect the new feature, ensuring users understand how to implement keyword restrictions.
- Modified the command manager to support the new keyword filtering logic, allowing for more efficient message handling in channels.
- Updated the configuration handling for the web viewer to use the [Bot] db_path when [Web_Viewer] db_path is unset, ensuring consistent database access.
- Added warnings in the logging to notify users when the web viewer database path differs from the bot database path, guiding them to configure it correctly.
- Refactored database path resolution logic across multiple modules for better maintainability and clarity.
- Introduced a new configuration option `auto_update_device_name` in config.ini.example to control whether the device name should automatically match the bot_name on startup.
- Implemented the `set_device_name` method in core.py to check and update the device name based on the configuration, ensuring consistency between the device and bot name.
- Enhanced logging for device name checks and updates to improve debugging and user awareness of the device state.
- Added configuration options for the "prefix best <location>" command in config.ini.example, allowing users to enable/disable the feature and customize its behavior.
- Implemented logic in the PrefixCommand class to find the best prefix for a given location, considering neighbor prefixes and user-defined criteria.
- Enhanced MessageHandler to skip processing old cached messages based on connection time, improving message handling efficiency.
- Updated core bot to track connection time, ensuring accurate message processing and cache management.
- Added a new mesh graph feature for improved path validation, allowing for enhanced routing accuracy.
- Introduced configuration options for recency decay half-life and graph-based validation settings in config.ini.example.
- Updated the PathCommand class to utilize graph-based selection methods, combining graph and geographic scores for better repeater selection.
- Implemented new methods in MessageHandler to update the mesh graph with advertisement paths and trace packet data.
- Created a new database table for mesh connections to support graph-based path validation.
- Enhanced web viewer integration to display mesh graph updates in real-time, improving user interaction and monitoring capabilities.
- Added a new configuration option for service restart backoff timing in config.ini.example.
- Enhanced the MeshCoreBot class to track service health and manage restarts for unhealthy services.
- Introduced a new method for service health checks in the BaseServicePlugin class, allowing for custom health validation in subclasses.
- Updated the PacketCaptureService to include specific health check logic based on connection status.
- Modified configuration examples to clarify that banned users are now identified by sender names using prefix matching.
- Implemented a new method in CommandManager to check if a user is banned based on prefix matching, enhancing the bot's ability to ignore messages from banned senders.
- Updated message handling logic to utilize the new prefix matching functionality for improved user management.
- Added QueuedCommand dataclass to represent commands waiting for cooldown expiration.
- Enhanced CommandManager to support queuing commands when near global cooldown expiration, allowing for smoother command execution.
- Implemented background task to process queued commands, ensuring they are executed once cooldowns expire.
- Updated BaseCommand to include a method for retrieving queue threshold seconds, improving flexibility in command handling.
- Adjusted core.py to initiate the command queue processor upon bot startup.
- Enhanced docker-setup.sh to ensure device mappings are correctly moved from the volumes section to the devices section in Docker Compose files.
- Added checks for serial device permissions and provided detailed instructions in DOCKER.md for resolving permission issues.
- Updated Dockerfile to add the meshcore user to the dialout group for serial port access, improving compatibility with serial devices.
- Improved logging functionality in core.py to handle log file paths more robustly, ensuring directories are created as needed and handling errors gracefully.
- Introduced a new method `reload_config` to allow dynamic reloading of the configuration without restarting the bot, ensuring seamless updates to settings.
- Added a helper method `_get_radio_settings` to retrieve current radio settings for comparison during reload.
- Updated `admin_commands` in `config.ini.example` to include the new `reload` command, enabling admin users to reload configurations on-the-fly.
- Enhanced the `setup_scheduled_messages` method in the scheduler to clear existing jobs before reloading, preventing duplicates.
- Updated `send_dm` and `send_channel_message` methods to include an optional `command_id` for tracking message repeats.
- Integrated transmission tracking to record and manage repeat messages, improving message handling and response accuracy.
- Enhanced `capture_command` method in `BotIntegration` to store repeat information for better analysis in the web viewer.
- Added favicon support and improved web viewer templates to display repeat information effectively.
- Implemented JavaScript updates in the web viewer to handle command updates and display repeat counts dynamically.
- Introduced a mechanism to utilize the main event loop for scheduling coroutines, preventing deadlocks when the main loop is running.
- Updated the JWT renewal interval to 12 hours, with tokens now valid for 24 hours, improving token management.
- Refactored various async function calls in the MessageScheduler, WeatherService, and PacketCaptureService to ensure consistent event loop usage.
- Improved error handling and logging for scheduled tasks, enhancing robustness and maintainability.
- Implemented periodic updates of system health status to the database every 30 seconds.
- Added a new method to aggregate and return comprehensive health status of all components, including core connection, database, services, and web viewer.
- Introduced an API endpoint at /api/system-health to retrieve system health data, providing a structured response for health status and component details.
- Enhanced error handling for health data storage and retrieval processes, ensuring robust logging and feedback in case of issues.
- Improved exception handling in MeshCoreBot to catch specific errors related to database and service initialization.
- Added a new method in MessageHandler for cleaning up stale RF data cache entries, enforcing maximum size limits and periodic cleanup.
- Updated message processing to handle potential AttributeError in multitest listener, ensuring robustness during message handling.
- Replaced the validate_safe_path function with a new resolve_path utility to simplify database path resolution in BotDataViewer, BotIntegration, and MapUploaderService.
- Updated the logic to ensure that both relative and absolute paths are handled correctly, enhancing the robustness of database connections.
- Improved code readability and maintainability by centralizing path resolution logic.
- Centralized placeholder handling in utils instead of individual function handlers
- Introduced a new service plugin architecture in core.py to manage multiple services, including the packet capture service.
- Updated the configuration file (config.ini.example) to include a new [Weather_Service] section for enabling weather forecasts and alerts, along with relevant settings.
- Enhanced the base service plugin class to support optional configuration section names and service descriptions for better metadata management.
- Improved the packet capture service with explicit configuration section and description for clarity.
- Introduced a new [PacketCapture] section in config.ini.example to enable packet capture service with options for output file, verbosity, and MQTT configuration.
- Updated core.py to initialize and manage the packet capture service, including starting and stopping the service during bot operation.
- Enhanced DiceCommand to support mixed dice notation and added functionality for decade dice rolls, improving user experience for tabletop gaming commands.
- Updated translations to reflect new dice command usage and descriptions, ensuring clarity for users.
- Simplified comments in config.ini.example and core.py to clarify API endpoint configuration.
- Changed default value for prefix_free_days from 30 to 7 in prefix_command.py to align with recent adjustments in prefix handling logic.
- Enhanced logic in prefix_command.py to prioritize API cache for used prefixes and fallback to database only when necessary, improving efficiency and accuracy in prefix data retrieval.
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
- Introduced `prefix_heard_days` and `prefix_free_days` settings in the configuration to define time windows for showing heard and free prefixes.
- Updated `PrefixCommand` to utilize these new settings for filtering repeaters based on their last heard time.
- 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
- Updated the test command response format to include optional phrases.
- Removed the at_phrase command and its references from the command manager and help command.
- Adjusted configuration examples to reflect the new syntax for message acknowledgments.
- Enhanced the sports command with additional WNBA team support and improved city mappings for team searches.