From 36acb5bce9388cc3997ce692072f08b9858e880a Mon Sep 17 00:00:00 2001 From: houseme Date: Wed, 9 Jul 2025 14:39:40 +0800 Subject: [PATCH] feat(console): Enhance network address handling for WebUI (#129) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add crates homepage,description,keywords,categories,documentation * add readme * modify version 0.0.3 * cargo fmt * fix: yaml.docker-compose.security.no-new-privileges.no-new-privileges-docker-compose.yml (#63) * Feature up/ilm (#61) * fix delete-marker expiration. add api_restore. * remove target return 204 * log level * fix: make lint build and clippy happy (#71) Signed-off-by: yihong0618 * fix: make ci and local use the same toolchain (#72) Signed-off-by: yihong0618 * feat: optimize GitHub Actions workflows with performance improvements (#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 * fix:make bucket err (#85) * Rename DEVELOPMENT.md to CONTRIBUTING.md * Create issue-translator.yml (#89) Enable Issues Translator * fix(dockerfile): correct env variable names for access/secret key and improve compatibility (#90) * fix: restore Zig and cargo-zigbuild caching in GitHub Actions setup action (#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 * Create CODE_OF_CONDUCT.md * Create SECURITY.md * Update issue templates * Create CLA.md * docs: update PR template to English version * fix: improve data scanner random sleep calculation - 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> * fix: soupprt ipv6 * improve log * add client ip log * Update rustfs/src/console.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * improve code * feat: unify package format to zip for all platforms --------- Signed-off-by: yihong0618 Signed-off-by: junxiang Mu <1948535941@qq.com> Co-authored-by: kira-offgrid Co-authored-by: likewu Co-authored-by: laoliu Co-authored-by: yihong Co-authored-by: 安正超 Co-authored-by: weisd Co-authored-by: Yone Co-authored-by: loverustfs <155562731+loverustfs@users.noreply.github.com> Co-authored-by: junxiang Mu <1948535941@qq.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Cargo.lock | 129 ++++++--------------------- Cargo.toml | 56 +++++++----- crates/appauth/Cargo.toml | 4 + crates/appauth/src/token.rs | 20 ++--- crates/common/Cargo.toml | 4 + crates/config/Cargo.toml | 4 + crates/crypto/Cargo.toml | 5 ++ crates/ecstore/Cargo.toml | 6 ++ crates/filemeta/Cargo.toml | 5 ++ crates/iam/Cargo.toml | 5 ++ crates/lock/Cargo.toml | 5 ++ crates/madmin/Cargo.toml | 5 ++ crates/notify/Cargo.toml | 5 ++ crates/obs/Cargo.toml | 5 ++ crates/policy/Cargo.toml | 5 ++ crates/protos/Cargo.toml | 8 ++ crates/rio/Cargo.toml | 5 ++ crates/s3select-api/Cargo.toml | 5 ++ crates/s3select-query/Cargo.toml | 5 ++ crates/signer/Cargo.toml | 5 ++ crates/utils/Cargo.toml | 4 + crates/utils/src/net.rs | 8 +- crates/workers/Cargo.toml | 7 +- crates/zip/Cargo.toml | 5 ++ rustfs/Cargo.toml | 5 ++ rustfs/README.md | 147 +++++++++++++++++++++++++------ rustfs/src/console.rs | 35 ++++++-- rustfs/src/main.rs | 12 ++- 28 files changed, 338 insertions(+), 176 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6f59b89f..b4ee6da3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1171,7 +1171,7 @@ dependencies = [ "bitflags 2.9.1", "cexpr", "clang-sys", - "itertools 0.12.1", + "itertools 0.11.0", "lazy_static", "lazycell", "log", @@ -3469,7 +3469,7 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "e2e_test" -version = "0.0.3" +version = "0.0.5" dependencies = [ "bytes", "flatbuffers 25.2.10", @@ -5023,15 +5023,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -5341,7 +5332,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.53.0", + "windows-targets 0.52.6", ] [[package]] @@ -7839,7 +7830,7 @@ dependencies = [ [[package]] name = "rustfs" -version = "0.0.3" +version = "0.0.5" dependencies = [ "async-trait", "atoi", @@ -7908,7 +7899,7 @@ dependencies = [ [[package]] name = "rustfs-appauth" -version = "0.0.3" +version = "0.0.5" dependencies = [ "base64-simd", "rsa", @@ -7918,7 +7909,7 @@ dependencies = [ [[package]] name = "rustfs-common" -version = "0.0.3" +version = "0.0.5" dependencies = [ "lazy_static", "tokio", @@ -7927,7 +7918,7 @@ dependencies = [ [[package]] name = "rustfs-config" -version = "0.0.3" +version = "0.0.5" dependencies = [ "const-str", "serde", @@ -7936,7 +7927,7 @@ dependencies = [ [[package]] name = "rustfs-crypto" -version = "0.0.3" +version = "0.0.5" dependencies = [ "aes-gcm", "argon2", @@ -7954,7 +7945,7 @@ dependencies = [ [[package]] name = "rustfs-ecstore" -version = "0.0.3" +version = "0.0.5" dependencies = [ "async-channel", "async-trait", @@ -8029,7 +8020,7 @@ dependencies = [ [[package]] name = "rustfs-filemeta" -version = "0.0.3" +version = "0.0.5" dependencies = [ "byteorder", "bytes", @@ -8050,7 +8041,7 @@ dependencies = [ [[package]] name = "rustfs-gui" -version = "0.0.3" +version = "0.0.5" dependencies = [ "chrono", "dioxus", @@ -8071,7 +8062,7 @@ dependencies = [ [[package]] name = "rustfs-iam" -version = "0.0.3" +version = "0.0.5" dependencies = [ "arc-swap", "async-trait", @@ -8095,7 +8086,7 @@ dependencies = [ [[package]] name = "rustfs-lock" -version = "0.0.3" +version = "0.0.5" dependencies = [ "async-trait", "lazy_static", @@ -8112,7 +8103,7 @@ dependencies = [ [[package]] name = "rustfs-madmin" -version = "0.0.3" +version = "0.0.5" dependencies = [ "chrono", "humantime", @@ -8124,7 +8115,7 @@ dependencies = [ [[package]] name = "rustfs-notify" -version = "0.0.3" +version = "0.0.5" dependencies = [ "async-trait", "axum", @@ -8153,7 +8144,7 @@ dependencies = [ [[package]] name = "rustfs-obs" -version = "0.0.3" +version = "0.0.5" dependencies = [ "async-trait", "chrono", @@ -8186,7 +8177,7 @@ dependencies = [ [[package]] name = "rustfs-policy" -version = "0.0.3" +version = "0.0.5" dependencies = [ "base64-simd", "ipnetwork", @@ -8205,7 +8196,7 @@ dependencies = [ [[package]] name = "rustfs-protos" -version = "0.0.3" +version = "0.0.5" dependencies = [ "flatbuffers 25.2.10", "prost", @@ -8216,7 +8207,7 @@ dependencies = [ [[package]] name = "rustfs-rio" -version = "0.0.3" +version = "0.0.5" dependencies = [ "aes-gcm", "bytes", @@ -8264,7 +8255,7 @@ dependencies = [ [[package]] name = "rustfs-s3select-api" -version = "0.0.3" +version = "0.0.5" dependencies = [ "async-trait", "bytes", @@ -8288,7 +8279,7 @@ dependencies = [ [[package]] name = "rustfs-s3select-query" -version = "0.0.3" +version = "0.0.5" dependencies = [ "async-recursion", "async-trait", @@ -8306,7 +8297,7 @@ dependencies = [ [[package]] name = "rustfs-signer" -version = "0.0.3" +version = "0.0.5" dependencies = [ "bytes", "http 1.3.1", @@ -8324,7 +8315,7 @@ dependencies = [ [[package]] name = "rustfs-utils" -version = "0.0.3" +version = "0.0.5" dependencies = [ "base64-simd", "blake3", @@ -8368,7 +8359,7 @@ dependencies = [ [[package]] name = "rustfs-workers" -version = "0.0.3" +version = "0.0.5" dependencies = [ "tokio", "tracing", @@ -8376,7 +8367,7 @@ dependencies = [ [[package]] name = "rustfs-zip" -version = "0.0.3" +version = "0.0.5" dependencies = [ "async-compression", "tokio", @@ -9847,9 +9838,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.46.0" +version = "1.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1140bb80481756a8cbe10541f37433b459c5aa1e727b4c020fbfebdc25bf3ec4" +checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" dependencies = [ "backtrace", "bytes", @@ -11129,29 +11120,13 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", + "windows_i686_gnullvm", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" -dependencies = [ - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", -] - [[package]] name = "windows-threading" version = "0.1.0" @@ -11188,12 +11163,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" - [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -11212,12 +11181,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" - [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -11236,24 +11199,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" - [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -11272,12 +11223,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -11296,12 +11241,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" - [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -11320,12 +11259,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" - [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -11344,12 +11277,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" - [[package]] name = "winnow" version = "0.5.40" diff --git a/Cargo.toml b/Cargo.toml index 79aee034..2d4741fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,11 @@ edition = "2024" license = "Apache-2.0" repository = "https://github.com/rustfs/rustfs" rust-version = "1.85" -version = "0.0.3" +version = "0.0.5" +homepage = "https://rustfs.com" +description = "RustFS is a high-performance distributed object storage software built using Rust, one of the most popular languages worldwide. " +keywords = ["RustFS", "Minio", "object-storage", "filesystem", "s3"] +categories = ["web-programming", "development-tools", "filesystem", "network-programming"] [workspace.lints.rust] unsafe_code = "deny" @@ -52,28 +56,33 @@ unsafe_code = "deny" [workspace.lints.clippy] all = "warn" +[patch.crates-io] +rustfs-utils = { path = "crates/utils" } +rustfs-filemeta = { path = "crates/filemeta" } +rustfs-rio = { path = "crates/rio" } + [workspace.dependencies] -rustfs-s3select-api = { path = "crates/s3select-api", version = "0.0.3" } -rustfs-appauth = { path = "crates/appauth", version = "0.0.3" } -rustfs-common = { path = "crates/common", version = "0.0.3" } -rustfs-crypto = { path = "crates/crypto", version = "0.0.3" } -rustfs-ecstore = { path = "crates/ecstore", version = "0.0.3" } -rustfs-iam = { path = "crates/iam", version = "0.0.3" } -rustfs-lock = { path = "crates/lock", version = "0.0.3" } -rustfs-madmin = { path = "crates/madmin", version = "0.0.3" } -rustfs-policy = { path = "crates/policy", version = "0.0.3" } -rustfs-protos = { path = "crates/protos", version = "0.0.3" } -rustfs-s3select-query = { path = "crates/s3select-query", version = "0.0.3" } -rustfs = { path = "./rustfs", version = "0.0.3" } -rustfs-zip = { path = "./crates/zip", version = "0.0.3" } -rustfs-config = { path = "./crates/config", version = "0.0.3" } -rustfs-obs = { path = "crates/obs", version = "0.0.3" } -rustfs-notify = { path = "crates/notify", version = "0.0.3" } -rustfs-utils = { path = "crates/utils", version = "0.0.3" } -rustfs-rio = { path = "crates/rio", version = "0.0.3" } -rustfs-filemeta = { path = "crates/filemeta", version = "0.0.3" } -rustfs-signer = { path = "crates/signer", version = "0.0.3" } -rustfs-workers = { path = "crates/workers", version = "0.0.3" } +rustfs-s3select-api = { path = "crates/s3select-api", version = "0.0.5" } +rustfs-appauth = { path = "crates/appauth", version = "0.0.5" } +rustfs-common = { path = "crates/common", version = "0.0.5" } +rustfs-crypto = { path = "crates/crypto", version = "0.0.5" } +rustfs-ecstore = { path = "crates/ecstore", version = "0.0.5" } +rustfs-iam = { path = "crates/iam", version = "0.0.5" } +rustfs-lock = { path = "crates/lock", version = "0.0.5" } +rustfs-madmin = { path = "crates/madmin", version = "0.0.5" } +rustfs-policy = { path = "crates/policy", version = "0.0.5" } +rustfs-protos = { path = "crates/protos", version = "0.0.5" } +rustfs-s3select-query = { path = "crates/s3select-query", version = "0.0.5" } +rustfs = { path = "./rustfs", version = "0.0.5" } +rustfs-zip = { path = "./crates/zip", version = "0.0.5" } +rustfs-config = { path = "./crates/config", version = "0.0.5" } +rustfs-obs = { path = "crates/obs", version = "0.0.5" } +rustfs-notify = { path = "crates/notify", version = "0.0.5" } +rustfs-utils = { path = "crates/utils", version = "0.0.5" } +rustfs-rio = { path = "crates/rio", version = "0.0.5" } +rustfs-filemeta = { path = "crates/filemeta", version = "0.0.5" } +rustfs-signer = { path = "crates/signer", version = "0.0.5" } +rustfs-workers = { path = "crates/workers", version = "0.0.5" } aes-gcm = { version = "0.10.3", features = ["std"] } arc-swap = "1.7.1" argon2 = { version = "0.5.3", features = ["std"] } @@ -171,7 +180,6 @@ pbkdf2 = "0.12.2" percent-encoding = "2.3.1" pin-project-lite = "0.2.16" prost = "0.13.5" -prost-build = "0.13.5" quick-xml = "0.37.5" rand = "0.9.1" rdkafka = { version = "0.37.0", features = ["tokio"] } @@ -225,7 +233,7 @@ time = { version = "0.3.41", features = [ "macros", "serde", ] } -tokio = { version = "1.46.0", features = ["fs", "rt-multi-thread"] } +tokio = { version = "1.46.1", features = ["fs", "rt-multi-thread"] } tokio-rustls = { version = "0.26.2", default-features = false } tokio-stream = { version = "0.1.17" } tokio-tar = "0.3.1" diff --git a/crates/appauth/Cargo.toml b/crates/appauth/Cargo.toml index 05f0d4c6..1d318042 100644 --- a/crates/appauth/Cargo.toml +++ b/crates/appauth/Cargo.toml @@ -19,6 +19,10 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "Application authentication and authorization for RustFS, providing secure access control and user management." +keywords = ["authentication", "authorization", "security", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "authentication"] [dependencies] base64-simd = { workspace = true } diff --git a/crates/appauth/src/token.rs b/crates/appauth/src/token.rs index ab6407dd..6fbec0c7 100644 --- a/crates/appauth/src/token.rs +++ b/crates/appauth/src/token.rs @@ -23,14 +23,14 @@ use std::io::{Error, Result}; #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct Token { - pub name: String, // 应用 ID - pub expired: u64, // 到期时间 (UNIX 时间戳) + pub name: String, // Application ID + pub expired: u64, // Expiry time (UNIX timestamp) } -// 公钥生成 Token -// [token] Token 对象 -// [key] 公钥字符串 -// 返回 base64 处理的加密字符串 +/// Public key generation Token +/// [token] Token object +/// [key] Public key string +/// Returns the encrypted string processed by base64 pub fn gencode(token: &Token, key: &str) -> Result { let data = serde_json::to_vec(token)?; let public_key = RsaPublicKey::from_public_key_pem(key).map_err(Error::other)?; @@ -38,10 +38,10 @@ pub fn gencode(token: &Token, key: &str) -> Result { Ok(base64_simd::URL_SAFE_NO_PAD.encode_to_string(&encrypted_data)) } -// 私钥解析 Token -// [token] base64 处理的加密字符串 -// [key] 私钥字符串 -// 返回 Token 对象 +/// Private key resolution Token +/// [token] Encrypted string processed by base64 +/// [key] Private key string +/// Return to the Token object pub fn parse(token: &str, key: &str) -> Result { let encrypted_data = base64_simd::URL_SAFE_NO_PAD .decode_to_vec(token.as_bytes()) diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index f6d9910c..834066ae 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -19,6 +19,10 @@ edition.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true +homepage.workspace = true +description = "Common utilities and data structures for RustFS, providing shared functionality across the project." +keywords = ["common", "utilities", "data-structures", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "data-structures"] [lints] workspace = true diff --git a/crates/config/Cargo.toml b/crates/config/Cargo.toml index ea6637e8..70524c95 100644 --- a/crates/config/Cargo.toml +++ b/crates/config/Cargo.toml @@ -19,6 +19,10 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "Configuration management for RustFS, providing a centralized way to manage application settings and features." +keywords = ["configuration", "settings", "management", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "config"] [dependencies] const-str = { workspace = true, optional = true } diff --git a/crates/crypto/Cargo.toml b/crates/crypto/Cargo.toml index 8b0943f9..ea68e22a 100644 --- a/crates/crypto/Cargo.toml +++ b/crates/crypto/Cargo.toml @@ -19,6 +19,11 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "Cryptography and security features for RustFS, providing encryption, hashing, and secure authentication mechanisms." +keywords = ["cryptography", "encryption", "hashing", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "cryptography"] +documentation = "https://docs.rs/rustfs-crypto/latest/rustfs_crypto/" [lints] workspace = true diff --git a/crates/ecstore/Cargo.toml b/crates/ecstore/Cargo.toml index 63e12bae..ec9e498c 100644 --- a/crates/ecstore/Cargo.toml +++ b/crates/ecstore/Cargo.toml @@ -19,6 +19,12 @@ edition.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true +homepage.workspace = true +description = "Erasure coding storage backend for RustFS, providing efficient data storage and retrieval with redundancy." +keywords = ["erasure-coding", "storage", "rustfs", "Minio", "solomon"] +categories = ["web-programming", "development-tools", "filesystem"] +documentation = "https://docs.rs/rustfs-ecstore/latest/rustfs_ecstore/" + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lints] diff --git a/crates/filemeta/Cargo.toml b/crates/filemeta/Cargo.toml index ef2d96a5..e3ed2bce 100644 --- a/crates/filemeta/Cargo.toml +++ b/crates/filemeta/Cargo.toml @@ -19,6 +19,11 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "File metadata management for RustFS, providing efficient storage and retrieval of file metadata in a distributed system." +keywords = ["file-metadata", "storage", "retrieval", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "filesystem"] +documentation = "https://docs.rs/rustfs-filemeta/latest/rustfs_filemeta/" [dependencies] crc32fast = { workspace = true } diff --git a/crates/iam/Cargo.toml b/crates/iam/Cargo.toml index 0dcf7077..5d4af280 100644 --- a/crates/iam/Cargo.toml +++ b/crates/iam/Cargo.toml @@ -19,6 +19,11 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "Identity and Access Management (IAM) for RustFS, providing user management, roles, and permissions." +keywords = ["iam", "identity", "access-management", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "authentication"] +documentation = "https://docs.rs/rustfs-iam/latest/rustfs_iam/" [lints] workspace = true diff --git a/crates/lock/Cargo.toml b/crates/lock/Cargo.toml index 1b934c97..d41fee32 100644 --- a/crates/lock/Cargo.toml +++ b/crates/lock/Cargo.toml @@ -19,6 +19,11 @@ edition.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true +homepage.workspace = true +description = "Distributed locking mechanism for RustFS, providing synchronization and coordination across distributed systems." +keywords = ["locking", "asynchronous", "distributed", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "asynchronous"] +documentation = "https://docs.rs/rustfs-lock/latest/rustfs_lock/" [lints] workspace = true diff --git a/crates/madmin/Cargo.toml b/crates/madmin/Cargo.toml index 36d4c221..ca346ebc 100644 --- a/crates/madmin/Cargo.toml +++ b/crates/madmin/Cargo.toml @@ -19,6 +19,11 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "Management and administration tools for RustFS, providing a web interface and API for system management." +keywords = ["management", "administration", "web-interface", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "config"] +documentation = "https://docs.rs/rustfs-madmin/latest/rustfs_madmin/" [lints] workspace = true diff --git a/crates/notify/Cargo.toml b/crates/notify/Cargo.toml index 6c427835..885ff841 100644 --- a/crates/notify/Cargo.toml +++ b/crates/notify/Cargo.toml @@ -19,6 +19,11 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "File system notification service for RustFS, providing real-time updates on file changes and events." +keywords = ["file-system", "notification", "real-time", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "filesystem"] +documentation = "https://docs.rs/rustfs-notify/latest/rustfs_notify/" [dependencies] rustfs-config = { workspace = true, features = ["notify"] } diff --git a/crates/obs/Cargo.toml b/crates/obs/Cargo.toml index 88726df9..1263e2cd 100644 --- a/crates/obs/Cargo.toml +++ b/crates/obs/Cargo.toml @@ -19,6 +19,11 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "Observability and monitoring tools for RustFS, providing metrics, logging, and tracing capabilities." +keywords = ["observability", "metrics", "logging", "tracing", "RustFS"] +categories = ["web-programming", "development-tools::profiling", "asynchronous", "api-bindings", "development-tools::debugging"] +documentation = "https://docs.rs/rustfs-obs/latest/rustfs_obs/" [lints] workspace = true diff --git a/crates/policy/Cargo.toml b/crates/policy/Cargo.toml index dd464026..2601465a 100644 --- a/crates/policy/Cargo.toml +++ b/crates/policy/Cargo.toml @@ -19,6 +19,11 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "Policy management for RustFS, providing a framework for defining and enforcing policies across the system." +keywords = ["policy", "management", "enforcement", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "accessibility"] +documentation = "https://docs.rs/rustfs-policy/latest/rustfs_policy/" [lints] workspace = true diff --git a/crates/protos/Cargo.toml b/crates/protos/Cargo.toml index 01068448..9f8ac0ac 100644 --- a/crates/protos/Cargo.toml +++ b/crates/protos/Cargo.toml @@ -16,6 +16,14 @@ name = "rustfs-protos" version.workspace = true edition.workspace = true +license.workspace = true +repository.workspace = true +rust-version.workspace = true +homepage.workspace = true +description = "Protocol definitions for RustFS, providing gRPC and FlatBuffers interfaces for communication between components." +keywords = ["protocols", "gRPC", "FlatBuffers", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "data-structures", "asynchronous"] +documentation = "https://docs.rs/rustfs-protos/latest/rustfs_protos/" [lints] workspace = true diff --git a/crates/rio/Cargo.toml b/crates/rio/Cargo.toml index 36c9cdea..60e46ef6 100644 --- a/crates/rio/Cargo.toml +++ b/crates/rio/Cargo.toml @@ -19,6 +19,11 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "Rio is a RustFS component that provides a high-performance, asynchronous I/O framework for building scalable and efficient applications." +keywords = ["asynchronous", "IO", "framework", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "asynchronous"] +documentation = "https://docs.rs/rustfs-rio/latest/rustfs_rio/" [lints] workspace = true diff --git a/crates/s3select-api/Cargo.toml b/crates/s3select-api/Cargo.toml index 93554009..bcb575b5 100644 --- a/crates/s3select-api/Cargo.toml +++ b/crates/s3select-api/Cargo.toml @@ -19,6 +19,11 @@ edition.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true +homepage.workspace = true +description = "S3 Select API implementation for RustFS, enabling efficient data retrieval from S3-compatible object stores." +keywords = ["s3-select", "api", "rustfs", "Minio", "object-store"] +categories = ["web-programming", "development-tools", "asynchronous"] +documentation = "https://docs.rs/rustfs-s3select-api/latest/rustfs_s3select_api/" [dependencies] async-trait.workspace = true diff --git a/crates/s3select-query/Cargo.toml b/crates/s3select-query/Cargo.toml index 1e6d8e27..5b05e6e5 100644 --- a/crates/s3select-query/Cargo.toml +++ b/crates/s3select-query/Cargo.toml @@ -19,6 +19,11 @@ edition.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true +homepage.workspace = true +description = "S3 Select query engine for RustFS, enabling efficient data retrieval from S3-compatible storage using SQL-like queries." +keywords = ["s3-select", "query-engine", "rustfs", "Minio", "data-retrieval"] +categories = ["web-programming", "development-tools", "data-structures"] +documentation = "https://docs.rs/rustfs-s3select-query/latest/rustfs_s3select_query/" [dependencies] rustfs-s3select-api = { workspace = true } diff --git a/crates/signer/Cargo.toml b/crates/signer/Cargo.toml index 9b79250c..464257ff 100644 --- a/crates/signer/Cargo.toml +++ b/crates/signer/Cargo.toml @@ -19,6 +19,11 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "Digital signature generation and verification for RustFS, ensuring data integrity and authenticity." +keywords = ["digital-signature", "verification", "integrity", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "cryptography"] +documentation = "https://docs.rs/rustfs-signer/latest/rustfs_signer/" [dependencies] tracing.workspace = true diff --git a/crates/utils/Cargo.toml b/crates/utils/Cargo.toml index f62d5712..472c77b5 100644 --- a/crates/utils/Cargo.toml +++ b/crates/utils/Cargo.toml @@ -19,6 +19,10 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "Utility functions and data structures for RustFS, providing essential features like hashing, compression, and network utilities." +keywords = ["utilities", "hashing", "compression", "network", "rustfs"] +categories = ["web-programming", "development-tools", "cryptography"] [dependencies] base64-simd = { workspace = true, optional = true } diff --git a/crates/utils/src/net.rs b/crates/utils/src/net.rs index 13d2df24..80ba148e 100644 --- a/crates/utils/src/net.rs +++ b/crates/utils/src/net.rs @@ -18,7 +18,7 @@ use futures::{Stream, StreamExt}; use hyper::client::conn::http2::Builder; use hyper_util::rt::TokioExecutor; use lazy_static::lazy_static; -use std::net::Ipv4Addr; +use std::net::Ipv6Addr; use std::{ collections::HashSet, fmt::Display, @@ -202,7 +202,7 @@ pub fn parse_and_resolve_address(addr_str: &str) -> std::io::Result } else { port }; - SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), final_port) + SocketAddr::new(IpAddr::V6(Ipv6Addr::UNSPECIFIED), final_port) } else { let mut addr = check_local_server_addr(addr_str)?; // assume check_local_server_addr is available here if addr.port() == 0 { @@ -478,12 +478,12 @@ mod test { fn test_parse_and_resolve_address() { // Test port-only format let result = parse_and_resolve_address(":8080").unwrap(); - assert_eq!(result.ip(), IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0))); + assert_eq!(result.ip(), IpAddr::V6(Ipv6Addr::UNSPECIFIED)); assert_eq!(result.port(), 8080); // Test port-only format with port 0 (should get available port) let result = parse_and_resolve_address(":0").unwrap(); - assert_eq!(result.ip(), IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0))); + assert_eq!(result.ip(), IpAddr::V6(Ipv6Addr::UNSPECIFIED)); assert!(result.port() > 0); // Test localhost with port diff --git a/crates/workers/Cargo.toml b/crates/workers/Cargo.toml index 0ffd3d30..bc72c9e4 100644 --- a/crates/workers/Cargo.toml +++ b/crates/workers/Cargo.toml @@ -19,10 +19,15 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "Workers for RustFS, providing background processing capabilities for tasks such as data synchronization, indexing, and more." +keywords = ["workers", "tasks", "rustfs", "Minio"] +categories = ["web-programming", "development-tools"] +documentation = "https://docs.rs/rustfs-workers/latest/rustfs_workers/" [lints] workspace = true [dependencies] -tokio.workspace = true +tokio = { workspace = true, features = ["sync"] } tracing.workspace = true diff --git a/crates/zip/Cargo.toml b/crates/zip/Cargo.toml index 19d144ef..9676e270 100644 --- a/crates/zip/Cargo.toml +++ b/crates/zip/Cargo.toml @@ -19,6 +19,11 @@ license.workspace = true repository.workspace = true rust-version.workspace = true version.workspace = true +homepage.workspace = true +description = "ZIP file handling for RustFS, providing support for reading and writing ZIP archives." +keywords = ["zip", "compression", "rustfs", "Minio"] +categories = ["web-programming", "development-tools", "compression"] +documentation = "https://docs.rs/rustfs-zip/latest/rustfs_zip/" [dependencies] diff --git a/rustfs/Cargo.toml b/rustfs/Cargo.toml index ddf79d30..2dc43351 100644 --- a/rustfs/Cargo.toml +++ b/rustfs/Cargo.toml @@ -19,6 +19,11 @@ edition.workspace = true license.workspace = true repository.workspace = true rust-version.workspace = true +homepage.workspace = true +description = "RustFS is a high-performance, distributed file system designed for modern cloud-native applications, providing efficient data storage and retrieval with advanced features like S3 Select, IAM, and policy management." +keywords.workspace = true +categories.workspace = true +documentation = "https://docs.rustfs.com/" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [[bin]] diff --git a/rustfs/README.md b/rustfs/README.md index 147e7ed7..d8be69b3 100644 --- a/rustfs/README.md +++ b/rustfs/README.md @@ -1,36 +1,129 @@ -# RustFS +[![RustFS](https://rustfs.com/images/rustfs-github.png)](https://rustfs.com) -RustFS is a simple file system written in Rust. It is designed to be a learning project for those who want to understand -how file systems work and how to implement them in Rust. +

RustFS is a high-performance distributed object storage software built using Rust

+ +

+ CI + Build and Push Docker Images + GitHub commit activity + Github Last Commit +

+ +

+ Getting Started + · Docs + · Bug reports + · Discussions +

+ +

+English | 简体中文 +

+ +RustFS is a high-performance distributed object storage software built using Rust, one of the most popular languages +worldwide. Along with MinIO, it shares a range of advantages such as simplicity, S3 compatibility, open-source nature, +support for data lakes, AI, and big data. Furthermore, it has a better and more user-friendly open-source license in +comparison to other storage systems, being constructed under the Apache license. As Rust serves as its foundation, +RustFS provides faster speed and safer distributed features for high-performance object storage. ## Features -- Simple file system structure -- Basic file operations (create, read, write, delete) -- Directory support -- File metadata (size, creation time, etc.) -- Basic error handling -- Unit tests for core functionality -- Documentation for public API -- Example usage -- License information -- Contributing guidelines -- Changelog -- Code of conduct -- Acknowledgements -- Contact information -- Links to additional resources +- **High Performance**: Built with Rust, ensuring speed and efficiency. +- **Distributed Architecture**: Scalable and fault-tolerant design for large-scale deployments. +- **S3 Compatibility**: Seamless integration with existing S3-compatible applications. +- **Data Lake Support**: Optimized for big data and AI workloads. +- **Open Source**: Licensed under Apache 2.0, encouraging community contributions and transparency. +- **User-Friendly**: Designed with simplicity in mind, making it easy to deploy and manage. -## Getting Started +## RustFS vs MinIO -To get started with RustFS, clone the repository and build the project: +Stress test server parameters -```bash -git clone git@github.com:rustfs/s3-rustfs.git -cd rustfs -cargo build -``` +| Type | parameter | Remark | +|---------|-----------|----------------------------------------------------------| +| CPU | 2 Core | Intel Xeon(Sapphire Rapids) Platinum 8475B , 2.7/3.2 GHz | | +| Memory | 4GB |   | +| Network | 15Gbp |   | +| Driver | 40GB x 4 | IOPS 3800 / Driver | -## Usage + -To use RustFS, you can create a new file system instance and perform basic file operations. Here is an example: +### RustFS vs Other object storage + +| RustFS | Other object storage | +|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------| +| Powerful Console | Simple and useless Console | +| Developed based on Rust language, memory is safer | Developed in Go or C, with potential issues like memory GC/leaks | +| Does not report logs to third-party countries | Reporting logs to other third countries may violate national security laws | +| Licensed under Apache, more business-friendly | AGPL V3 License and other License, polluted open source and License traps, infringement of intellectual property rights | +| Comprehensive S3 support, works with domestic and international cloud providers | Full support for S3, but no local cloud vendor support | +| Rust-based development, strong support for secure and innovative devices | Poor support for edge gateways and secure innovative devices | +| Stable commercial prices, free community support | High pricing, with costs up to $250,000 for 1PiB | +| No risk | Intellectual property risks and risks of prohibited uses | + +## Quickstart + +To get started with RustFS, follow these steps: + +1. **One-click installation script (Option 1)​​** + + ```bash + curl -O https://rustfs.com/install_rustfs.sh && bash install_rustfs.sh + ``` + +2. **Docker Quick Start (Option 2)​​** + + ```bash + podman run -d -p 9000:9000 -p 9001:9001 -v /data:/data quay.io/rustfs/rustfs + ``` + +3. **Access the Console**: Open your web browser and navigate to `http://localhost:9001` to access the RustFS console, + default username and password is `rustfsadmin` . +4. **Create a Bucket**: Use the console to create a new bucket for your objects. +5. **Upload Objects**: You can upload files directly through the console or use S3-compatible APIs to interact with your + RustFS instance. + +## Documentation + +For detailed documentation, including configuration options, API references, and advanced usage, please visit +our [Documentation](https://docs.rustfs.com). + +## Getting Help + +If you have any questions or need assistance, you can: + +- Check the [FAQ](https://github.com/rustfs/rustfs/discussions/categories/q-a) for common issues and solutions. +- Join our [GitHub Discussions](https://github.com/rustfs/rustfs/discussions) to ask questions and share your + experiences. +- Open an issue on our [GitHub Issues](https://github.com/rustfs/rustfs/issues) page for bug reports or feature + requests. + +## Links + +- [Documentation](https://docs.rustfs.com) - The manual you should read +- [Changelog](https://github.com/rustfs/rustfs/releases) - What we broke and fixed +- [GitHub Discussions](https://github.com/rustfs/rustfs/discussions) - Where the community lives + +## Contact + +- **Bugs**: [GitHub Issues](https://github.com/rustfs/rustfs/issues) +- **Business**: +- **Jobs**: +- **General Discussion**: [GitHub Discussions](https://github.com/rustfs/rustfs/discussions) +- **Contributing**: [CONTRIBUTING.md](CONTRIBUTING.md) + +## Contributors + +RustFS is a community-driven project, and we appreciate all contributions. Check out +the [Contributors](https://github.com/rustfs/rustfs/graphs/contributors) page to see the amazing people who have helped +make RustFS better. + + + + + +## License + +[Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +**RustFS** is a trademark of RustFS, Inc. All other trademarks are the property of their respective owners. diff --git a/rustfs/src/console.rs b/rustfs/src/console.rs index bc119b5f..5160f6b7 100644 --- a/rustfs/src/console.rs +++ b/rustfs/src/console.rs @@ -27,7 +27,7 @@ use std::io; use axum::response::Redirect; use axum_server::tls_rustls::RustlsConfig; -use http::{Uri, header}; +use http::{HeaderMap, HeaderName, Uri, header}; use mime_guess::from_path; use rust_embed::RustEmbed; use serde::Serialize; @@ -211,21 +211,40 @@ fn _is_private_ip(ip: IpAddr) -> bool { #[allow(clippy::const_is_empty)] #[instrument(fields(host))] -async fn config_handler(uri: Uri, Host(host): Host) -> impl IntoResponse { - let scheme = uri.scheme().map(|s| s.as_str()).unwrap_or("http"); +async fn config_handler(uri: Uri, Host(host): Host, headers: HeaderMap) -> impl IntoResponse { + // Get the scheme from the headers or use the URI scheme + let scheme = headers + .get(HeaderName::from_static("x-forwarded-proto")) + .and_then(|value| value.to_str().ok()) + .unwrap_or_else(|| uri.scheme().map(|s| s.as_str()).unwrap_or("http")); + + // Print logs for debugging + info!("Scheme: {}, ", scheme); // Get the host from the uri and use the value of the host extractor if it doesn't have one let host = uri.host().unwrap_or(host.as_str()); - let host = if host.contains(':') { - let (host, _) = host.split_once(':').unwrap_or((host, "80")); - host + let host = if let Ok(socket_addr) = host.parse::() { + // Successfully parsed, it's in IP:Port format. + // For IPv6, we need to enclose it in brackets to form a valid URL. + let ip = socket_addr.ip(); + if ip.is_ipv6() { format!("[{ip}]") } else { format!("{ip}") } } else { - host + // Failed to parse, it might be a domain name or a bare IP, use it as is. + host.to_string() }; // Make a copy of the current configuration - let mut cfg = CONSOLE_CONFIG.get().unwrap().clone(); + let mut cfg = match CONSOLE_CONFIG.get() { + Some(cfg) => cfg.clone(), + None => { + error!("Console configuration not initialized"); + return Response::builder() + .status(StatusCode::INTERNAL_SERVER_ERROR) + .body(Body::from("Console configuration not initialized")) + .unwrap(); + } + }; let url = format!("{}://{}:{}", scheme, host, cfg.port); cfg.api.base_url = format!("{url}{RUSTFS_ADMIN_PREFIX}"); diff --git a/rustfs/src/main.rs b/rustfs/src/main.rs index 7a6b50ce..673b8871 100644 --- a/rustfs/src/main.rs +++ b/rustfs/src/main.rs @@ -189,7 +189,17 @@ async fn run(opt: config::Opt) -> Result<()> { let listener = TcpListener::bind(server_address.clone()).await?; // Obtain the listener address let local_addr: SocketAddr = listener.local_addr()?; - let local_ip = rustfs_utils::get_local_ip().ok_or(local_addr.ip()).unwrap(); + debug!("Listening on: {}", local_addr); + let local_ip = match rustfs_utils::get_local_ip() { + Some(ip) => { + debug!("Obtained local IP address: {}", ip); + ip + } + None => { + warn!("Unable to obtain local IP address, using fallback IP: {}", local_addr.ip()); + local_addr.ip() + } + }; // For RPC let (endpoint_pools, setup_type) =