447 Commits

Author SHA1 Message Date
agessaman
4d9cdcba50 Update configuration and documentation for Repeater Prefix Collision Service
- Removed MQTT configuration from `config.ini.example` to streamline settings.
- Added new section for Repeater Prefix Collision Service in `config.ini.example`, including options for enabling notifications, alert channels, and prefix handling.
- Updated `service-plugins.md` to include documentation for the new Repeater Prefix Collision Service, enhancing user awareness of available plugins.
2026-03-29 08:36:45 -07:00
agessaman
e037046400 Enhance weather service forecast output with high/low temperature display
- Added today's high and low temperatures to the weather forecast output, improving clarity for users.
- Updated formatting to include labels for high and low temperatures, ensuring better readability of the forecast information.
2026-03-25 20:26:22 -07:00
agessaman
cebf2cbc8b Implement locking mechanism for message processing in FeedManager
- Introduced a lock to serialize access to the message processing queue, preventing concurrent executions that could lead to race conditions.
- Updated the process_message_queue method to utilize the new lock, ensuring safe access to the inner processing logic.
- Increased the timeout for awaiting feed message queue processing in the MessageScheduler to 600 seconds, accommodating longer processing times for queued items.
2026-03-22 13:16:00 -07:00
agessaman
c23dda61c0 Enhance feed message formatting with auto field functionality
- Introduced `{field|auto}` placeholder in message formats to fill remaining characters up to `max_message_length`, improving message customization.
- Implemented logic in `FeedManager` to handle multiple `{field|auto}` placeholders, logging a warning if more than one is present.
- Updated `BotDataViewer` to utilize the new auto field feature, ensuring compatibility with existing message formatting.
- Added unit tests to validate the behavior of the new auto field functionality, including handling of message length constraints and multiple placeholders.
2026-03-21 20:11:19 -07:00
agessaman
21718ba438 Implement URL shortening functionality in feed manager and related components
- Added configuration options for URL shortening in `config.ini.example` and updated documentation in `FEEDS.md`.
- Enhanced `FeedManager` to support URL shortening based on new settings, allowing for both global and per-link shortening.
- Refactored message formatting logic to incorporate URL shortening features, ensuring compatibility with existing link handling.
- Introduced new utility functions for encoding path length bytes in `utils.py`, improving path management in message handling.
- Added unit tests to validate the new URL shortening functionality and ensure proper behavior under various conditions.
2026-03-21 18:24:59 -07:00
agessaman
8653f8c23d Enhance channel management functionality in web viewer
- Updated `pyproject.toml` to include JavaScript files for the web viewer.
- Added a new script reference in `base.html` for channel operations.
- Improved the channel creation process in `feeds.html` with enhanced UI elements and error handling.
- Refactored channel index retrieval in `radio.html` to utilize a centralized method for better maintainability.
- Implemented asynchronous channel statistics loading to improve responsiveness during channel operations.
2026-03-21 17:19:51 -07:00
agessaman
d36e956120 Enhance filter configuration with new date-based operators
- Introduced `within_days` and `within_weeks` operators for filtering items based on their timestamps, allowing for more dynamic date range conditions.
- Updated documentation in `FEEDS.md` to include examples and usage of the new operators.
- Refactored filter evaluation logic in `FeedManager` and `BotDataViewer` to utilize a shared function for condition checking, improving code maintainability.
- Added unit tests to validate the new date-based filtering functionality.
2026-03-21 16:42:39 -07:00
agessaman
20c4ea4353 Update example configuration to clarify channel monitoring options
- Modified the `monitor_channels` setting in `config.ini.example` to specify the use of hashtags for channel names, enhancing clarity for users configuring the bot's channel monitoring.
2026-03-21 13:59:06 -07:00
agessaman
022053a674 Implement bot location fallback in weather commands when no location is provided
- Added a new configuration option `use_bot_location_when_no_location` to allow the use of bot's configured coordinates if no companion location is available.
- Updated `wx_command.py` and `wx_international.py` to utilize the new configuration, enhancing the user experience by providing a fallback mechanism for location-based commands.
- Improved logging to reflect the usage of bot coordinates and handle cases where bot location is not set.
2026-03-21 10:56:24 -07:00
agessaman
5020120273 Enhance weather command functionality to support extended multiday forecasts
- Introduced support for multiday forecasts up to 16 days, allowing users to specify days in various formats (e.g., Nd, 7day).
- Updated usage documentation and parameter descriptions to reflect new options for both US and international weather commands.
- Adjusted internal logic to validate and parse new forecast formats, ensuring compatibility with the extended range.
2026-03-21 10:50:39 -07:00
agessaman
32fd416df8 Update admin commands to include channelpause functionality
- Added `channelpause` and `channelresume` commands to the admin commands list in configuration files, allowing admins to pause or resume bot responses on public channels via DM.
- Updated documentation to reflect the new command functionality and its implications for channel responses.
- Modified validation and message handling to incorporate the new channel response control feature.
2026-03-19 19:53:27 -07:00
agessaman
0cd23e8bbe Enhance Discord bridge configuration to support multiple webhooks per channel
- Updated config.ini.example and discord-bridge.md to reflect the ability to fan out a single MeshCore channel to multiple Discord servers using a comma- or whitespace-separated list of webhook URLs.
- Modified DiscordBridgeService to handle multiple webhooks per channel, including validation and logging improvements for better monitoring of configured webhooks.
2026-03-18 18:05:20 -07:00
agessaman
a76c17bb02 Update .gitignore and enhance install-service.sh for virtual environment management
- Added patterns to .gitignore to exclude log files and local configuration files.
- Improved the install-service.sh script to verify the integrity of the virtual environment and ensure pip is available and up to date before installing dependencies.
2026-03-18 18:05:20 -07:00
agessaman
581b2c771d Merge main into dev: resolve DOCKER.md -> docker.md 2026-03-11 20:50:22 -07:00
Adam Gessaman
8d72c9a034 Update funding information in FUNDING.yml
Updated GitHub Sponsors username and commented out other funding options.
2026-03-11 20:48:18 -07:00
Jeroen Vermeulen
1264f49410 Fixed repeater and webviewer usage like #50.
Fixed webviewer responses.
2026-03-11 20:48:18 -07:00
agessaman
53c8b40364 Update Docker documentation to include instructions for connecting COM ports on Windows 11. Added detailed steps for installing USB bridge, binding devices, and configuring Docker to use Linux device names. 2026-03-11 20:48:18 -07:00
agessaman
d28a8b0d1d Fix documentation links 2026-03-11 20:44:47 -07:00
agessaman
2178a80dca Refactor cleanup methods in core.py and mesh_graph.py to suppress logging during shutdown
- Updated the _cleanup_web_viewer and _cleanup_mesh_graph methods to avoid logging errors during shutdown, as the logger's stream may be closed at that time.
- Modified the shutdown method in MeshGraph to prevent logging of flushing errors, enhancing stability during the atexit process.
- Adjusted test configurations to use Path objects for bot_root and local_root, improving path handling in tests.
2026-03-11 20:41:44 -07:00
agessaman
6ee4639ab7 Update test_checkin_service.py to skip tests when checkin_service plugin is not present
- Modified the test file to include a conditional import for the CheckInService, allowing tests to be skipped if the plugin is not installed. This change improves test reliability and clarity regarding plugin dependencies.
2026-03-11 20:29:03 -07:00
agessaman
43a36dd6d7 Update meshcore dependency version in requirements.txt
- Changed the meshcore dependency from a fixed version (2.2.14) to a minimum version (2.2.31) to ensure compatibility with newer features and improvements.
2026-03-10 10:45:33 -07:00
agessaman
58deb123b9 Update RepeaterManager to respect auto-manage contacts configuration
- Modified the RepeaterManager class to enable or disable auto-purge based on the 'auto_manage_contacts' setting from the bot's configuration.
- This change allows for more flexible management of contacts, aligning with the bot's operational mode.
2026-03-10 10:31:39 -07:00
agessaman
8b363afed7 Update IATA code in configuration files and packet capture service
- Changed the default IATA code from 'LOC' to 'XYZ' in `config.ini.example` and `packet-capture.md` to reflect updated routing requirements.
- Updated the `PacketCaptureService` to use 'XYZ' as the fallback IATA code, ensuring consistency across the application.
2026-03-09 22:09:39 -07:00
agessaman
0b58d9fed6 Update ServicePluginLoader to include modules directory in service path
- Enhanced the ServicePluginLoader to add the modules directory to the path for local services, ensuring that utility modules can be resolved correctly.
- This change improves the loading mechanism for service plugins by allowing better integration of local utilities.
2026-03-09 18:07:53 -07:00
agessaman
f908395834 Enhance ServicePluginLoader to support dynamic service paths
- Updated the ServicePluginLoader to include a built-in services directory in the module path, improving the loading mechanism for service plugins.
- Modified the class to accept BaseServicePlugin from both built-in and local services, allowing for greater flexibility in service integration.
- Enhanced the logic for identifying service classes, ensuring compatibility with multiple base service implementations.
2026-03-09 16:26:06 -07:00
agessaman
5a96dec558 Refactor TraceCommand to improve hop labeling logic
- Updated the TraceCommand class to enhance the labeling of hops in the trace output.
- Replaced direct hash retrieval with a conditional approach to determine the source label for each hop, improving clarity in the output format.
- Ensured consistent labeling for the first and last hops, enhancing the readability of the trace results.
2026-03-09 15:56:07 -07:00
agessaman
d084c6bd29 Enhance PrefixCommand to support multi-byte hex prefix lookups
- Updated the command to handle 1-, 2-, or 3-byte hex prefixes, with longer input truncated to 3 bytes.
- Improved usage instructions and examples to clarify accepted prefix formats (2, 4, or 6 hex characters).
- Enhanced validation logic for prefix format, ensuring proper handling of hex strings and truncation.
- Updated documentation strings to reflect changes in prefix handling and expected input formats.
2026-03-09 14:54:23 -07:00
agessaman
6c8151389b Enhance MeshGraph edge promotion logic and update BotDataViewer API
- Updated the MeshGraph class to prevent promoting a 1-byte edge to a 3-byte edge when the existing 1-byte edge lacks public keys, ensuring accurate observation attribution.
- Added a new test case to verify the behavior of edge promotion under specific conditions.
- Modified the BotDataViewer API to return the prefix length dynamically based on the edges, improving data consistency and user experience in the web viewer.
- Enhanced the mesh.html template to support displaying prefix byte counts, providing clearer information on node connections.
2026-03-09 09:43:49 -07:00
agessaman
6df2da5083 Add support for dynamic local services module
- Introduced a check in `load_service_from_path` to ensure the `local_services` module is created in `sys.modules` if it doesn't exist, facilitating proper relative and absolute imports for service plugins.
- This enhancement improves the loading mechanism for local service plugins, ensuring smoother integration and functionality.
2026-03-08 12:51:32 -07:00
agessaman
6b4e6351c4 Enhance logging configuration and documentation
- Added support for rotating log files in `core.py` using `RotatingFileHandler`, with a maximum size of 5 MB and up to 3 backup files.
- Updated `config.ini.example`, `config.ini.minimal-example`, and `config.ini.quickstart` to include descriptions of the new log rotation feature.
- Enhanced `data-retention.md` to clarify log file management and retention policies.
2026-03-08 12:41:15 -07:00
Adam Gessaman
d1f915c256 Update funding information in FUNDING.yml
Updated GitHub Sponsors username and commented out other funding options.
2026-03-08 10:23:32 -07:00
agessaman
adf5bc191e Enhance stats collection for web viewer dashboard
- Updated documentation in `data-retention.md` and `web-viewer.md` to clarify how stats are collected and displayed, including the new `collect_stats` configuration option.
- Modified `StatsCommand` in `stats_command.py` to introduce `collect_stats`, allowing message and command statistics to be recorded even when the `stats` command is disabled.
- Adjusted logic in `record_message`, `record_command_stats`, and `record_path_stats` methods to utilize the new `collect_stats` setting for improved flexibility in stats tracking.
2026-03-07 13:23:37 -08:00
agessaman
f86fe0b140 Add support for local plugins configuration and directory handling
- Updated `config.ini.example` and `config.ini.minimal-example` to include optional `local_dir_path` for specifying a custom local plugins directory.
- Enhanced `install-service.sh` to preserve the `local/` directory during installation and create its structure if it doesn't exist.
- Modified `CommandManager` and `MeshCoreBot` to resolve the local commands and services directory based on the new configuration.
- Added validation in `config_validation.py` to check the existence and readability of the specified local plugins path.
- Improved documentation in `local-plugins.md` to clarify the usage of local plugins and the new configuration options.
2026-03-07 12:31:54 -08:00
agessaman
e9f17ec48e Enhance shutdown process with scheduler thread handling and improved meshcore disconnect logic
- Added a `join` method in `MessageScheduler` to wait for the scheduler thread to finish during shutdown.
- Updated the shutdown sequence in `core.py` to include a timeout for the `meshcore.disconnect()` method, with error handling for potential timeouts and exceptions.
- Improved logging to provide clearer information during the shutdown process.
2026-03-07 11:21:43 -08:00
agessaman
0c060a515b Implement chunked message sending for improved rate limit handling
- Added `send_channel_messages_chunked` method to `CommandManager` for sending multiple messages with appropriate rate-limit spacing.
- Introduced `send_response_chunked` method in `BaseCommand` to facilitate chunked responses in both channels and DMs.
- Updated `GreeterCommand` to utilize the new chunked response functionality, simplifying the greeting message sending process.
- Enhanced documentation in `local-plugins.md` with examples for using chunked message sending, improving clarity on handling long messages and rate limits.
2026-03-07 09:02:12 -08:00
agessaman
69ac3ccdfb Update requirements and enhance documentation for service installation and message handling
- Changed `meshcore` dependency version in `requirements.txt` from `>=2.2.14` to `==2.2.14` for consistency.
- Added detailed instructions in `SERVICE-INSTALLATION.md` regarding Python version compatibility and potential f-string issues with Python 3.11.
- Introduced a new section in `local-plugins.md` explaining how to handle message chunking and bot rate limits, providing code examples for better clarity.
2026-03-06 22:03:13 -08:00
agessaman
f57f480c9f Enhance MeshGraph and BotDataViewer for multi-byte support and improved edge handling
- Updated MeshGraph to support multi-resolution storage and node identity, allowing for better handling of 1-byte, 2-byte, and 3-byte edges.
- Implemented logic for merging and promoting edges based on observation counts and specificity.
- Enhanced BotDataViewer API to dynamically adjust prefix length based on configuration, improving data representation.
- Updated mesh.html template to display prefix byte counts, enhancing user experience with clearer information on node connections.
2026-03-06 16:57:57 -08:00
agessaman
a4d1f678cf Enhance path handling in BotDataViewer and ModernContactsManager
- Added support for bytes per hop in the BotDataViewer, allowing for better path data representation.
- Updated the contacts template to display bytes per hop and adjusted path formatting based on this value.
- Improved the decode path functionality to utilize the correct bytes per hop for decoding paths, enhancing overall path handling and user experience.
2026-03-06 10:02:45 -08:00
agessaman
7d76ed443b Update dependencies and enhance path handling for multi-byte support
- Updated `meshcore` dependency version to `2.2.14` in both `pyproject.toml` and `requirements.txt`.
- Added multi-byte path support in the `PathCommand`, allowing for 1-, 2-, and 3-byte-per-hop paths.
- Enhanced `MessageHandler` to utilize `routing_info` for accurate path extraction and validation.
- Improved path extraction methods in `MultitestCommand` and `TestCommand` to prefer `routing_info` for node IDs.
- Refactored path handling logic across various commands to ensure consistent multi-byte path processing.
2026-03-05 13:37:38 -08:00
agessaman
4e5addd5df Add support for local plugins and services
- Updated `.gitignore` to include local configuration and plugin directories, allowing users to add custom commands and services without modifying core code.
- Enhanced `config.ini.example` with instructions for using local plugins and added sections for local service configurations.
- Refactored `PluginLoader` and `ServicePluginLoader` to support loading local commands and services from specified directories, improving extensibility.
- Updated `mkdocs.yml` to include documentation for local plugins and the check-in API.
- Added tests to verify the discovery and loading of local plugins, ensuring functionality and preventing name collisions with built-in plugins.
2026-03-04 18:33:45 -08:00
agessaman
1474174ba5 Refactor path handling in TraceCommand to prevent truncation of return paths
- Updated the logic in `TraceCommand` to avoid capping the `path_nodes` after building the reciprocal path, ensuring that the return path is preserved.
- Improved clarity in the code by adding a comment to explain the rationale behind the change.
2026-03-03 18:55:44 -08:00
agessaman
83dea195a4 Add hops placeholder for Keywords.
- Added support for `{hops}` and `{hops_label}` placeholders in `config.ini.example` and `core.py`, allowing for dynamic display of total hop count and pluralized labels in messages.
- Updated `format_keyword_response_with_placeholders` function in `utils.py` to extract and format hop count from message data, improving message clarity and detail.
- Ensured backward compatibility by providing default values for hop-related placeholders when not set.
2026-03-03 18:51:05 -08:00
agessaman
f789b72b92 Implement bot response bridging for Discord and Telegram
- Added configuration options to bridge the bot's own channel responses to Discord and Telegram, allowing command replies to be sent to respective channels.
- Updated `DiscordBridgeService` and `TelegramBridgeService` to register listeners for bot-sent messages, ensuring they are included in the bridging process.
- Enhanced `CommandManager` to invoke listeners with a synthetic event when a message is successfully sent, providing context about the message.
- Updated `config.ini.example` to reflect the new `bridge_bot_responses` option for both services.
- Added tests to verify the correct invocation of listeners upon successful message sending.
2026-03-02 16:39:30 -08:00
agessaman
d2f63c1025 Implement channel-specific triggers for random lines
- Added support for channel-specific triggers in the CommandManager, allowing triggers to be restricted to designated channels via `channel.<key>` or `channels.<key>` configuration.
- Updated `config.ini.example` to include examples of channel restrictions for triggers.
- Enhanced tests to verify that triggers only match in specified channels, ensuring proper functionality of the new feature.
2026-03-02 16:04:12 -08:00
agessaman
e348fd8d53 Enhance profanity filtering to include hate symbol detection and censorship
- Updated the profanity filter to check for hate symbols (e.g., swastika Unicode) in addition to word-based profanity, ensuring comprehensive message filtering.
- Modified the `censor` function to replace hate symbols with `***`, maintaining functionality even when the `better-profanity` package is unavailable.
- Updated documentation in `discord-bridge.md` and `telegram-bridge.md` to reflect the new hate symbol handling features.
- Added tests to verify detection and censorship of hate symbols, ensuring robustness of the profanity filter.
2026-03-01 21:56:13 -08:00
agessaman
3c56cbb69d Add profanity filter options for Discord and Telegram bridges
- Introduced `filter_profanity` configuration option in `config.ini.example` to handle profanity in bridged messages: options include `drop` (default), `censor`, or `off`.
- Updated `requirements.txt` to include `better-profanity` for profanity filtering functionality.
- Enhanced `DiscordBridgeService` and `TelegramBridgeService` to implement the profanity filter logic, allowing messages with profanity to be dropped or censored before bridging.
- Updated documentation in `discord-bridge.md` and `telegram-bridge.md` to reflect the new profanity handling feature.
2026-03-01 21:47:53 -08:00
agessaman
4982ba482d Enhance mesh graph handling for multi-resolution prefix support
- Updated `MeshGraph` to support multi-resolution storage of edges, allowing prefixes of 2, 4, or 6 hex chars without truncation.
- Implemented prefix matching logic to ensure distinct links are maintained and accurately retrieved based on prefix queries.
- Refactored methods in `MessageHandler` and `PathCommand` to accommodate variable prefix lengths during graph lookups.
- Enhanced tests to validate prefix match functionality and edge management in the mesh graph.
2026-03-01 20:42:06 -08:00
agessaman
1ac1060c18 Update config example and refactor prefix handling in BotDataViewer
- Commented out the 'help' command output in `config.ini.example` for clarity on overrides.
- Refactored prefix handling in `BotDataViewer` to use a dynamically retrieved `prefix_hex_chars` value instead of a hardcoded reference, improving flexibility and maintainability.
- Ensured consistent prefix handling across multiple instances in the `BotDataViewer` class.
2026-03-01 17:19:49 -08:00
agessaman
5c8ee3564e Fix time zone handling in format_elapsed_display function -- issue #75
- Updated the import statement for time zone handling in the `format_elapsed_display` function to use `timezone.utc` instead of `UTC` from `datetime`.
- Improved clarity and consistency in time zone management within the function.
2026-03-01 17:00:32 -08:00
Adam Gessaman
1cc41bc48a Merge pull request #67 from jeroenvermeulen/fix_repeater_usage_webviewer_responses
Fixed repeater and webviewer usage, fixed webviewer responses.
2026-03-01 16:50:24 -08:00