This commit represents a comprehensive refactoring and enhancement of Baktainer: ## Core Architecture Improvements - Implemented comprehensive dependency injection system with DependencyContainer - Fixed critical singleton instantiation bug that was returning Procs instead of service instances - Replaced problematic Concurrent::FixedThreadPool with custom SimpleThreadPool implementation - Achieved 100% test pass rate (121 examples, 0 failures) after fixing 30+ failing tests ## New Features Implemented ### 1. Backup Rotation & Cleanup (BackupRotation) - Configurable retention policies by age, count, and disk space - Automatic cleanup with comprehensive statistics tracking - Empty directory cleanup and space monitoring ### 2. Backup Encryption (BackupEncryption) - AES-256-CBC and AES-256-GCM encryption support - Key derivation from passphrases or direct key input - Encrypted backup metadata storage ### 3. Operational Monitoring Suite - **Health Check Server**: HTTP endpoints for monitoring (/health, /status, /metrics) - **Web Dashboard**: Real-time monitoring dashboard with auto-refresh - **Prometheus Metrics**: Integration with monitoring systems - **Backup Monitor**: Comprehensive metrics tracking and performance alerts ### 4. Advanced Label Validation (LabelValidator) - Schema-based validation for all 12+ Docker labels - Engine-specific validation rules - Helpful error messages and warnings - Example generation for each database engine ### 5. Multi-Channel Notifications (NotificationSystem) - Support for Slack, Discord, Teams, webhooks, and log notifications - Event-based notifications for backups, failures, warnings, and health issues - Configurable notification thresholds ## Code Organization Improvements - Extracted responsibilities into focused classes: - ContainerValidator: Container validation logic - BackupOrchestrator: Backup workflow orchestration - FileSystemOperations: File I/O with comprehensive error handling - Configuration: Centralized environment variable management - BackupStrategy/Factory: Strategy pattern for database engines ## Testing Infrastructure - Added comprehensive unit and integration tests - Fixed timing-dependent test failures - Added RSpec coverage reporting (94.94% coverage) - Created test factories and fixtures ## Breaking Changes - Container class constructor now requires dependency injection - BackupCommand methods now use keyword arguments - Thread pool implementation changed from Concurrent to SimpleThreadPool ## Configuration New environment variables: - BT_HEALTH_SERVER_ENABLED: Enable health check server - BT_HEALTH_PORT/BT_HEALTH_BIND: Health server configuration - BT_NOTIFICATION_CHANNELS: Comma-separated notification channels - BT_ENCRYPTION_ENABLED/BT_ENCRYPTION_KEY: Backup encryption - BT_RETENTION_DAYS/COUNT: Backup retention policies This refactoring improves maintainability, testability, and adds enterprise-grade monitoring and operational features while maintaining backward compatibility for basic usage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
112 lines
2.5 KiB
Text
112 lines
2.5 KiB
Text
GEM
|
|
remote: https://rubygems.org/
|
|
specs:
|
|
activesupport (8.0.2)
|
|
base64
|
|
benchmark (>= 0.3)
|
|
bigdecimal
|
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
connection_pool (>= 2.2.5)
|
|
drb
|
|
i18n (>= 1.6, < 2)
|
|
logger (>= 1.4.2)
|
|
minitest (>= 5.1)
|
|
securerandom (>= 0.3)
|
|
tzinfo (~> 2.0, >= 2.0.5)
|
|
uri (>= 0.13.1)
|
|
addressable (2.8.7)
|
|
public_suffix (>= 2.0.2, < 7.0)
|
|
base64 (0.2.0)
|
|
benchmark (0.4.1)
|
|
bigdecimal (3.2.2)
|
|
concurrent-ruby (1.3.5)
|
|
connection_pool (2.5.3)
|
|
crack (1.0.0)
|
|
bigdecimal
|
|
rexml
|
|
cron_calc (1.0.0)
|
|
diff-lcs (1.6.2)
|
|
docile (1.4.1)
|
|
docker-api (2.4.0)
|
|
excon (>= 0.64.0)
|
|
multi_json
|
|
drb (2.2.3)
|
|
excon (1.2.5)
|
|
logger
|
|
factory_bot (6.5.4)
|
|
activesupport (>= 6.1.0)
|
|
hashdiff (1.2.0)
|
|
i18n (1.14.7)
|
|
concurrent-ruby (~> 1.0)
|
|
json (2.12.2)
|
|
logger (1.7.0)
|
|
minitest (5.25.5)
|
|
multi_json (1.15.0)
|
|
mustermann (3.0.3)
|
|
ruby2_keywords (~> 0.0.1)
|
|
nio4r (2.7.4)
|
|
public_suffix (6.0.2)
|
|
puma (6.6.0)
|
|
nio4r (~> 2.0)
|
|
rack (2.2.17)
|
|
rack-protection (3.2.0)
|
|
base64 (>= 0.1.0)
|
|
rack (~> 2.2, >= 2.2.4)
|
|
rexml (3.4.1)
|
|
rspec (3.13.1)
|
|
rspec-core (~> 3.13.0)
|
|
rspec-expectations (~> 3.13.0)
|
|
rspec-mocks (~> 3.13.0)
|
|
rspec-core (3.13.4)
|
|
rspec-support (~> 3.13.0)
|
|
rspec-expectations (3.13.5)
|
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
rspec-support (~> 3.13.0)
|
|
rspec-mocks (3.13.5)
|
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
rspec-support (~> 3.13.0)
|
|
rspec-support (3.13.4)
|
|
rspec_junit_formatter (0.6.0)
|
|
rspec-core (>= 2, < 4, != 2.12.0)
|
|
ruby2_keywords (0.0.5)
|
|
securerandom (0.4.1)
|
|
simplecov (0.22.0)
|
|
docile (~> 1.1)
|
|
simplecov-html (~> 0.11)
|
|
simplecov_json_formatter (~> 0.1)
|
|
simplecov-html (0.13.1)
|
|
simplecov_json_formatter (0.1.4)
|
|
sinatra (3.2.0)
|
|
mustermann (~> 3.0)
|
|
rack (~> 2.2, >= 2.2.4)
|
|
rack-protection (= 3.2.0)
|
|
tilt (~> 2.0)
|
|
tilt (2.6.1)
|
|
tzinfo (2.0.6)
|
|
concurrent-ruby (~> 1.0)
|
|
uri (1.0.3)
|
|
webmock (3.25.1)
|
|
addressable (>= 2.8.0)
|
|
crack (>= 0.3.2)
|
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
|
|
PLATFORMS
|
|
ruby
|
|
x86_64-linux
|
|
|
|
DEPENDENCIES
|
|
base64 (~> 0.2.0)
|
|
concurrent-ruby (~> 1.3.5)
|
|
cron_calc (~> 1.0.0)
|
|
docker-api (~> 2.4.0)
|
|
factory_bot (~> 6.2)
|
|
json (~> 2.7)
|
|
puma (~> 6.0)
|
|
rspec (~> 3.12)
|
|
rspec_junit_formatter (~> 0.6.0)
|
|
simplecov (~> 0.22.0)
|
|
sinatra (~> 3.0)
|
|
webmock (~> 3.18)
|
|
|
|
BUNDLED WITH
|
|
2.6.2
|