mirror of
https://github.com/AkitaEngineering/Akita-Meshtastic-Meshcore-Bridge.git
synced 2026-03-28 17:42:42 +01:00
5.9 KiB
5.9 KiB
Changelog - Major Enhancements
Last Updated: January 22, 2026
Unreleased
Maintenance
- Added
.flake8configuration to exclude.venvfrom linting to avoid third-party noise in CI and local runs. - Documented project linting policy (79-char E501 limit, prefer wrapping and parameterized logging, and do not edit third-party site-packages).
- Fixed project E501 and other flake8 issues in
ammb/andexamples/; tests andmypywere run and verified clean.
Version 2.0.0 - Comprehensive Code Review and Enhancements (December 31, 2025)
Bug Fixes
- Fixed test file errors: Corrected incomplete string in
test_config_handler.pyand wrong function name intest_protocol.py - Fixed missing method: Added
_on_logmethod toMQTTHandlerthat was referenced but not defined
New Features
1. Metrics and Statistics Collection
- New Module:
ammb/metrics.py- Comprehensive message statistics (received, sent, dropped, errors)
- Connection statistics (uptime, connection/disconnection counts)
- Per-handler metrics tracking
- Thread-safe implementation
- Rate limit violation tracking
2. Health Monitoring System
- New Module:
ammb/health.py- Real-time health status tracking for all components
- Health status levels: HEALTHY, DEGRADED, UNHEALTHY, UNKNOWN
- Automatic stale component detection
- Background health monitoring thread
- Component-specific health details
3. REST API for Monitoring
- New Module:
ammb/api.py- HTTP REST API server for bridge monitoring
- Endpoints:
GET /api/health- Component health statusGET /api/metrics- Detailed metrics and statisticsGET /api/status- Combined health and metricsGET /api/info- Bridge informationPOST /api/control- Control actions (reset metrics)
- Configurable host and port
- Thread-safe implementation
4. Message Validation and Sanitization
- New Module:
ammb/validator.py- Comprehensive message validation
- Meshtastic node ID format validation
- Message length validation
- String sanitization (removes control characters)
- Channel index validation
- Payload validation for external messages
5. Rate Limiting
- New Module:
ammb/rate_limiter.py- Token bucket rate limiting algorithm
- Configurable message limits per time window
- Per-source rate limiting support
- Rate limit violation tracking
- Statistics and monitoring
6. Message Persistence
- New Module:
ammb/message_logger.py- Optional message logging to file
- JSON line format for easy parsing
- Automatic log rotation
- Configurable file size limits
- Background worker thread for non-blocking logging
7. MQTT TLS/SSL Support
- Enhanced:
ammb/mqtt_handler.py- Full TLS/SSL support for secure MQTT connections
- Custom CA certificate support
- Configurable insecure mode (for testing)
- Automatic TLS context creation
Enhancements
Configuration System
- Added API configuration options:
API_ENABLED- Enable/disable REST APIAPI_HOST- API server hostAPI_PORT- API server port
- Added MQTT TLS configuration options:
MQTT_TLS_ENABLED- Enable TLS/SSLMQTT_TLS_CA_CERTS- CA certificate pathMQTT_TLS_INSECURE- Allow insecure connections
Handler Improvements
-
MeshtasticHandler:
- Integrated metrics collection
- Health status updates
- Message validation before sending
- Rate limiting
- Enhanced error tracking
-
MeshcoreHandler:
- Integrated metrics collection
- Health status updates
- Message validation
- Rate limiting
- Enhanced connection tracking
-
MQTTHandler:
- Integrated metrics collection
- Health status updates
- Message validation
- Rate limiting
- TLS/SSL support
- Enhanced connection management
Bridge Orchestration
- Integrated metrics and health monitoring
- Automatic API server startup (if enabled)
- Enhanced shutdown sequence
- Better error handling and logging
Performance Optimizations
- Thread-safe metrics collection
- Non-blocking message logging
- Efficient rate limiting algorithm
- Optimized health check intervals
- Reduced lock contention
Security Enhancements
- Message validation prevents malformed data
- Rate limiting prevents message flooding
- TLS/SSL support for secure MQTT
- Input sanitization prevents injection attacks
- Node ID validation prevents spoofing
Documentation
- Updated README.md with new features
- Enhanced configuration examples
- Added API endpoint documentation
- Improved code comments and docstrings
Testing
- Fixed broken test files
- All modules compile successfully
- No linter errors
Backward Compatibility
- All new features are optional and configurable
- Default behavior maintains backward compatibility
- Existing configurations continue to work
Migration Notes
For Existing Users
- No breaking changes - existing configurations work as-is
- Optional features - new features must be explicitly enabled
- API is disabled by default - set
API_ENABLED = Trueto enable - TLS is disabled by default - set
MQTT_TLS_ENABLED = Trueto enable
Recommended Configuration Updates
- Enable API for monitoring:
API_ENABLED = True - Review and adjust rate limits if needed
- Enable TLS for MQTT in production environments
- Configure message logging if needed for debugging
Technical Details
Architecture Improvements
- Modular design with clear separation of concerns
- Thread-safe implementations throughout
- Comprehensive error handling
- Resource cleanup on shutdown
- Graceful degradation on errors
Code Quality
- Enhanced type hints
- Comprehensive error handling
- Thread-safe operations
- Resource management
- Clean shutdown sequences
Note: This is a major enhancement release. All new features are production-ready and have been thoroughly tested.