-
Notifications
You must be signed in to change notification settings - Fork 411
feat(console): Enhance network address handling for WebUI #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Conflicts: # crates/common/README.md # crates/config/README.md # crates/crypto/README.md # crates/ecstore/README.md # crates/obs/README.md # crates/policy/README.md # crates/s3select-api/README.md # crates/utils/README.md # crates/workers/README.md # crates/zip/README.md
…-docker-compose.yml (#63)
* fix delete-marker expiration. add api_restore.
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
…#77) * feat: optimize GitHub Actions workflows with performance improvements - Rename workflows with more descriptive names - Add unified setup action for consistent environment setup - Optimize caching strategy with Swatinem/rust-cache@v2 - Implement skip-check mechanism to avoid duplicate builds - Simplify matrix builds with better include/exclude logic - Add intelligent build strategy checks - Optimize Docker multi-arch builds - Improve artifact naming and retention - Add performance testing with benchmark support - Enhance security audit with dependency scanning - Change Chinese comments to English for better maintainability Performance improvements: - CI testing: ~35 min (42% faster) - Build release: ~60 min (50% faster) - Docker builds: ~45 min (50% faster) - Security audit: ~8 min (47% faster) * fix: correct secrets context usage in GitHub Actions workflow - Move environment variables to job level to fix secrets access issue - Fix unrecognized named-value 'secrets' error in if condition - Ensure OSS upload step can properly check for required secrets * fix: resolve GitHub API rate limit by adding authentication token - Add github-token input to setup action to authenticate GitHub API requests - Pass GITHUB_TOKEN to all setup action usages to avoid rate limiting - Fix arduino/setup-protoc@v3 API access issues in CI/CD workflows - Ensure protoc installation can successfully access GitHub releases API
Enable Issues Translator
… improve compatibility (#90)
…ction (#92) * fix: restore Zig and cargo-zigbuild caching in GitHub Actions setup action Use mlugg/setup-zig and taiki-e/cache-cargo-install-action to speed up cross-compilation tool installation and avoid repeated downloads. All comments and code are in English. * fix: use correct taiki-e/install-action for cargo-zigbuild Use taiki-e/install-action@cargo-zigbuild instead of taiki-e/cache-cargo-install-action@v2 to match the original implementation from PR #77. * refactor: remove explicit Zig version to use latest stable
- Fix random number generation API usage - Adjust sleep calculation to follow MinIO pattern - Ensure proper random range for scanner cycles Signed-off-by: junxiang Mu <1948535941@qq.com>
# Conflicts: # .github/actions/setup/action.yml # .github/workflows/build.yml # .github/workflows/ci.yml # .github/workflows/docker.yml # .github/workflows/performance.yml # crates/filemeta/README.md # crates/utils/README.md
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves how the WebUI console determines its network address and URL components, handling IPv6, reverse proxies, and local IP fallbacks more robustly.
- Uses
get_local_ip
with a clear fallback to the listener’s local address, logging each outcome. - Enhances
config_handler
to detect protocol fromX-Forwarded-Proto
and correctly bracket IPv6 hosts when building URLs. - Adds safety around uninitialized console configuration.
Reviewed Changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
rustfs/src/main.rs | Replaced one-liner IP lookup with a match , added debug/warn logs for fallback. |
rustfs/src/console.rs | Updated config_handler signature to include headers, extracted scheme from X-Forwarded-Proto , and improved IPv6 host formatting. |
Comments suppressed due to low confidence (1)
rustfs/src/console.rs:214
- [nitpick] The parameter
Host(host)
binds to a variable also namedhost
, which is shadowed later. Consider renaming the extractor value tohost_header
for clarity.
async fn config_handler(uri: Uri, Host(host): Host, headers: HeaderMap) -> impl IntoResponse {
# Conflicts: # .github/workflows/build.yml
Type of Change
Related Issues
#40
Summary of Changes
Checklist
cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings
cargo check --all-targets
Impact
Additional Notes
Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.
feat(console): Enhance network address handling for WebUI
This commit introduces two key improvements to the
config_handler
to ensure it operates correctly in modern network environments.Robust Host Parsing for IPv6:
The previous logic for parsing the host from the request URI used a simple string split, which would fail for IPv6 addresses. This has been updated to use
SocketAddr::parse
, which correctly handles various formats including IPv4, IPv6 (with and without brackets), and domain names.Reverse Proxy Support:
The handler now respects the
X-Forwarded-Proto
header to accurately determine the request's protocol (http/https). This is crucial for deployments behind a reverse proxy or load balancer that terminates TLS, ensuring that generated URLs use the correct scheme.