Commit Graph

19 Commits

Author SHA1 Message Date
agessaman
64e0ffac40 refactor: Change packet logging level from INFO to DEBUG
- Updated the logging level for captured packets to DEBUG to reduce verbosity in service lifecycle logs.
- Maintained detailed packet information output for debugging purposes while ensuring INFO level is reserved for lifecycle events.
2026-01-31 08:16:06 -08:00
agessaman
ba33fed1a8 feat: Implement service health checks and restart logic
- 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.
2026-01-20 20:35:29 -08:00
agessaman
7ee77c16c0 feat: Implement message queuing and rate limiting for Discord webhook posts
- Introduced a QueuedMessage dataclass to manage messages queued for posting to Discord.
- Added a background task to process message queues, handling rate limits and retries.
- Updated message posting methods to support queuing and retry logic, ensuring robust message delivery.
- Implemented proactive rate limiting to prevent exceeding Discord's message limits.
2026-01-09 16:03:30 -08:00
agessaman
578fa2caa4 fix: Prevent potential segfaults by deep copying event payloads
- Added deep copy of event payloads in multiple modules to avoid segmentation faults when events are freed.
- Updated the handling of payloads in ChannelManager, MessageHandler, DiscordBridgeService, MapUploaderService, and PacketCaptureService to ensure safe access to event data.
- Enhanced logging for cases where payloads are missing, improving error handling and debugging capabilities.
2026-01-05 17:20:15 -08:00
agessaman
5b06289ac1 feat: Add Discord bridge configuration to example and update README
- Introduced a new section in `config.ini.example` for the Discord bridge service, including options for enabling the service and configuring avatar styles and channel mappings.
- Updated `README.md` to document the new Discord bridge service and its integration, enhancing the overall service plugin section with relevant details.
2026-01-04 10:30:14 -08:00
agessaman
2cf2fd6ce7 feat: Enhance link extraction and conversion in WeatherService
- Improved the link extraction logic to prioritize HTML links over CAP XML links, ensuring more user-friendly URLs are used.
- Added a new method to convert CAP XML URLs to a more readable API format, accommodating changes in the NWS alerts webpage.
- Enhanced fallback mechanisms for link retrieval to ensure reliable access to alert information.
2026-01-02 16:24:49 -08:00
agessaman
50724d1fed feat: Enhance asyncio event loop handling across modules
- 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.
2026-01-02 09:25:31 -08:00
agessaman
a32fe0dcfd docs: Add docstrings and type hints across modules for improved clarity and maintainability. 2026-01-01 20:12:49 -08:00
agessaman
c729e4efb6 Refactor logging setup and MQTT connection handling in PacketCaptureService
- Simplified logger handler setup to prevent duplicates by checking if handlers already exist.
- Introduced a new method to check for MQTT availability, improving error logging when MQTT support is not available.
- Enhanced MQTT connection handling to streamline the connection process and improve logging clarity.
2026-01-01 12:23:56 -08:00
agessaman
80b6bcceea Refactor database connection handling in web viewer and improve error logging; fix keyword reporting to web viewer
- Simplified database connection management by using context managers to ensure connections are properly closed.
- Enhanced error handling during MQTT client disconnection in packet capture service, logging specific exceptions.
- Updated message handling in MessageHandler to capture command data for web viewer integration, improving response tracking.
2026-01-01 12:16:22 -08:00
agessaman
afda22f0fe Refactor database path and placeholder handling across modules
- 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
2025-12-29 15:42:35 -08:00
agessaman
3cdeae8a0d Implement caching for location name in WeatherService to optimize reverse geocoding 2025-12-27 10:23:46 -08:00
agessaman
d7f16f31e4 Refactor MQTT connection handling in PacketCaptureService and WeatherService to be non-blocking
- Updated connection and reconnection logic in PacketCaptureService to use asyncio's run_in_executor, preventing blocking of the event loop during MQTT operations.
- Enhanced WeatherService to implement non-blocking connection and subscription handling, ensuring smoother operation and improved error logging for connection failures.
2025-12-27 09:35:34 -08:00
agessaman
35bc6260a4 Enhance command configuration and logging for joke commands
- Added configuration sections for joke and dadjoke commands in config.ini.example, allowing channel restrictions for command usage.
- Updated BaseCommand to derive configuration section names for commands, improving consistency in command management.
- Implemented channel access checks in can_execute methods for JokeCommand and DadJokeCommand to ensure commands are only executed in allowed channels.
- Improved error logging in FeedManager and MessageScheduler to include database path information for better debugging.
2025-12-27 08:21:51 -08:00
agessaman
b200c3f500 Enhance WxCommand logic for period handling and improve map uploader service memory management
- Updated WxCommand to better handle period identification for tomorrow's weather, ensuring accurate retrieval of daytime and nighttime periods based on current conditions.
- Added a cleanup mechanism in MapUploaderService to manage memory usage by periodically removing old entries from seen_adverts, preventing unbounded growth and improving performance.
- Optimized packet capture service to utilize indexed lookups for faster data retrieval and ensure fallback mechanisms for backward compatibility.
2025-12-22 23:33:17 -08:00
agessaman
43c217fb0d Update map uploader service documentation for coordinate validation
- Clarified comments in config.ini.example and map_uploader_service.py to specify that adverts with any coordinate exactly 0.0 are considered invalid and will be skipped during uploads. This enhances understanding of the coordinate validation logic in the map uploader service.
2025-12-22 12:02:56 -08:00
agessaman
7e80dedb6d Add map uploader configuration and update requirements
- Introduced a new [MapUploader] section in config.ini.example to configure the map uploader service, including options for enabling the service, API endpoint, private key path, re-upload interval, and verbose logging.
- Updated requirements.txt to include cryptography and pynacl packages for enhanced security features in the map uploader service.
2025-12-22 11:43:25 -08:00
agessaman
c3d3c85f01 Implement service plugin architecture and enhance weather service configuration
- 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.
2025-12-22 10:29:43 -08:00
agessaman
d6aec8ce29 Add service plugins configuration and packet capture integration
- 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.
2025-12-21 15:44:46 -08:00