Skip to content

Conversation

houseme
Copy link
Contributor

@houseme houseme commented Jul 9, 2025

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

#40

Summary of Changes

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Code is formatted with cargo fmt --all
  • Passed cargo clippy --all-targets --all-features -- -D warnings
  • Passed cargo check --all-targets
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CI/CD passed (if applicable)

Impact

  • Breaking change (compatibility)
  • Requires doc/config/deployment update
  • Other 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.

  1. 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.

  2. 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.

houseme and others added 25 commits July 4, 2025 15:06
# 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
* 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
…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
@houseme houseme requested a review from Copilot July 9, 2025 04:33
@CLAassistant
Copy link

CLAassistant commented Jul 9, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 5 committers have signed the CLA.

✅ likewu
❌ kira-offgrid
❌ lygn128
❌ xzyone
❌ yihong0618
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot

This comment was marked as outdated.

@houseme houseme requested a review from Copilot July 9, 2025 05:04
Copilot

This comment was marked as outdated.

houseme and others added 2 commits July 9, 2025 13:10
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@houseme houseme requested a review from Copilot July 9, 2025 05:18
Copy link
Contributor

@Copilot Copilot AI left a 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 from X-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 named host, which is shadowed later. Consider renaming the extractor value to host_header for clarity.
async fn config_handler(uri: Uri, Host(host): Host, headers: HeaderMap) -> impl IntoResponse {

@overtrue overtrue merged commit 36acb5b into main Jul 9, 2025
7 of 8 checks passed
@overtrue overtrue deleted the feature/crates branch July 9, 2025 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants