mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-07-09 12:41:05 +02:00
## ℹ️ Description `diagnose_browser_issues()` previously hardcoded `127.0.0.1` for port-open and `/json/version` API probes. When Chrome's remote debugging is exposed on a different host (Docker, LAN, CI), the diagnostics miss the running browser entirely. This PR makes diagnostics host-aware by parsing `--remote-debugging-host` from `browser_config.arguments` and using the configured host instead of the hardcoded `127.0.0.1`. All diagnostics probes (port, API, Chrome version) now respect the configured host. ## 📋 Changes Summary - Added `_diagnostic_remote_debugging_endpoint()` — private diagnostics parser with first-wins semantics for both host and port, defaults to `127.0.0.1:0` - Added `_format_url_host()` — IPv6-safe URL bracketing helper - Threaded configured host into `net.is_port_open()`, `_remote_debugging_api_browser()`, and `_diagnose_chrome_version_issues()` - Emit `LOG.warning` before probing a non-loopback configured host (security/documentation guard) - Updated German translations for changed log message strings - Added tests: configured host `10.0.0.5` and `192.168.1.100`, host-after-port ordering, IPv6 URL formatting, Chrome-version host propagation - Default behavior (no `--remote-debugging-host` argument) unchanged — probes remain `127.0.0.1` ### ⚙️ Type of Change - [ ] 🐞 Bug fix (non-breaking change which fixes an issue) - [x] ✨ New feature (adds new functionality without breaking existing usage) - [ ] 💥 Breaking change (changes that might break existing user setups, scripts, or configurations) ## ✅ Checklist - [x] I have reviewed my changes to ensure they meet the project's standards. - [x] I have tested my changes and ensured that all tests pass (`pdm run test`). - [x] I have formatted the code (`pdm run format`). - [x] I have verified that linting passes (`pdm run lint`). - [x] I have updated documentation where necessary. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved remote browser debugging diagnostics to work with non-local hosts, including correct IPv6-safe URL formatting. * Added host-aware reachability checks and clearer warnings when the configured remote host may not be loopback. * Enhanced diagnostic messaging to report the configured host and port during remote debugging checks. * **Tests** * Expanded unit test coverage for configured remote-debugging hosts (including IPv6) and updated expectations for host-specific diagnostic outputs. <!-- end of auto-generated comment: release notes by coderabbit.ai -->