feat(server): warn when listener binds loopback inside a container - #4218
kunaldevxxx wants to merge 8 commits into
Conversation
|
Thanks for the PR. It is labeled Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
|
/request-review @hubcio |
|
Thanks @kunaldevxxx for this PR. I ran the validator tests on your branch and all 53 passed, so that behaviour looks to be unchanged. The warning(s) reach the log. A few things before a more thorough review:
|
|
Sure @justinmclean i done please review |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4218 +/- ##
=============================================
- Coverage 87.54% 73.70% -13.85%
Complexity 1575 1575
=============================================
Files 1283 1278 -5
Lines 223353 202586 -20767
Branches 186716 165950 -20766
=============================================
- Hits 195535 149309 -46226
- Misses 23110 48645 +25535
+ Partials 4708 4632 -76
🚀 New features to boost your workflow:
|
|
two notes outside the diff.
dropping the |
|
Thanks for the thorough review, @hubcio! All points have been addressed in the latest commit:
All local checks passed ( |
|
it looks like you didn't push the changes @kunaldevxxx |
|
yes sorry it didnt got push give few min @hubcio |
|
please review now @hubcio sorry for last time |
|
CI is still failing. once you are done fixing it, please read #4218 (comment) and act accordingly - without that maintainers won't start checking this again :) |
|
/ready |
|
@kunaldevxxx i added clippy for macOS to CI in #4248 and rebased your PR. please fix :) |
Which issue does this PR address?
Closes #4209
Rationale
When starting the server in a container with default settings (e.g.
docker run -p 8090:8090 apache/iggy), the client-facing listener binds127.0.0.1:8090, which only listens on the container's isolated loopback interface and is unreachable from the host.What changed?
In
validate_client_facing_address, check whether the client-facing listener binds a loopback IP inside a container. If so, emit a warning guiding the operator to setIGGY_TCP_ADDRESS=0.0.0.0:8090together withIGGY_NODE_ADVERTISED_ADDRESS(or bind a concrete address).Container detection inspects sentinel files (
/.dockerenv,/run/.containerenv), environment variables (container,KUBERNETES_SERVICE_HOST), and Linux cgroups.Tests were added to assert that the warning fires with the expected environment variables inside a container, does not fire outside a container, and detects container markers without reading ambient pod environments.
Local Execution
Ran:
cargo fmt --all -- --checkcargo clippy -p configs --all-features --all-targets -- -D warningscargo test -p configs(270 passed, 0 failed)AI Usage
Antigravity AI assistant.
Assisted in drafting unit test cases.
Ran
cargo fmt,cargo clippy --all-features --all-targets -- -D warnings, and the completeconfigstest suite verifying all 270 tests pass.Yes.