diff --git a/crates/config/src/server_config.rs b/crates/config/src/server_config.rs index 7cca122b5..c8d5bedb0 100644 --- a/crates/config/src/server_config.rs +++ b/crates/config/src/server_config.rs @@ -14,11 +14,12 @@ use serde::{Deserialize, Serialize}; use std::collections::HashMap; -use std::sync::{LazyLock, OnceLock}; +use std::sync::{LazyLock, OnceLock, RwLock}; use crate::{COMMENT_KEY, DEFAULT_DELIMITER}; pub static DEFAULT_KVS: LazyLock>> = LazyLock::new(OnceLock::new); +pub static GLOBAL_SERVER_CONFIG: LazyLock>> = LazyLock::new(|| RwLock::new(None)); #[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)] pub struct KV { @@ -174,6 +175,16 @@ pub fn register_default_kvs(kvs: HashMap) { let _ = DEFAULT_KVS.set(p); } +pub fn get_global_server_config() -> Option { + GLOBAL_SERVER_CONFIG.read().ok().and_then(|guard| (*guard).clone()) +} + +pub fn set_global_server_config(cfg: Config) { + if let Ok(mut guard) = GLOBAL_SERVER_CONFIG.write() { + *guard = Some(cfg); + } +} + #[cfg(test)] mod tests { use super::*; @@ -226,4 +237,17 @@ mod tests { ); assert_eq!(loaded.merge(), loaded); } + + #[test] + fn global_server_config_set_and_get_roundtrip() { + let mut cfg = Config(HashMap::new()); + let mut kvs = KVS::new(); + kvs.insert("standard".to_string(), "EC:4".to_string()); + cfg.0 + .insert("storage_class".to_string(), HashMap::from([(DEFAULT_DELIMITER.to_string(), kvs)])); + + set_global_server_config(cfg.clone()); + + assert_eq!(get_global_server_config(), Some(cfg)); + } } diff --git a/crates/ecstore/src/config/mod.rs b/crates/ecstore/src/config/mod.rs index 46036ac4e..e98d0ca3c 100644 --- a/crates/ecstore/src/config/mod.rs +++ b/crates/ecstore/src/config/mod.rs @@ -34,14 +34,16 @@ use rustfs_config::notify::{ NOTIFY_POSTGRES_SUB_SYS, NOTIFY_PULSAR_SUB_SYS, NOTIFY_REDIS_SUB_SYS, NOTIFY_WEBHOOK_SUB_SYS, }; use rustfs_config::oidc::IDENTITY_OPENID_SUB_SYS; -use rustfs_config::server_config::{Config, register_default_kvs}; +use rustfs_config::server_config::register_default_kvs; use std::collections::HashMap; use std::sync::LazyLock; use std::sync::{Arc, RwLock}; +// RUSTFS_COMPAT_TODO(CFG-008): keep old ecstore global server-config accessor path while runtime consumers migrate. Remove after all consumers import these accessors from rustfs_config::server_config. +pub use rustfs_config::server_config::{get_global_server_config, set_global_server_config}; + pub static GLOBAL_STORAGE_CLASS: LazyLock> = LazyLock::new(|| RwLock::new(storageclass::Config::default())); -pub static GLOBAL_SERVER_CONFIG: LazyLock>> = LazyLock::new(|| RwLock::new(None)); pub static GLOBAL_CONFIG_SYS: LazyLock = LazyLock::new(ConfigSys::new); pub static RUSTFS_CONFIG_PREFIX: &str = "config"; @@ -69,16 +71,6 @@ impl ConfigSys { } } -pub fn get_global_server_config() -> Option { - GLOBAL_SERVER_CONFIG.read().ok().and_then(|guard| (*guard).clone()) -} - -pub fn set_global_server_config(cfg: Config) { - if let Ok(mut guard) = GLOBAL_SERVER_CONFIG.write() { - *guard = Some(cfg); - } -} - pub fn get_global_storage_class() -> Option { GLOBAL_STORAGE_CLASS.read().ok().map(|guard| (*guard).clone()) } @@ -132,7 +124,7 @@ pub fn init() { #[cfg(test)] mod tests { use super::*; - use rustfs_config::server_config::KVS; + use rustfs_config::server_config::{Config, KVS}; use rustfs_config::{ DEFAULT_DELIMITER, DEFAULT_HEAL_BITROT_CYCLE_SECS, DEFAULT_SCANNER_SPEED, HEAL_BITROT_CYCLE, SCANNER_CYCLE_MAX_OBJECTS, SCANNER_DELAY, SCANNER_MAX_WAIT, SCANNER_SPEED, SCANNER_SUB_SYS, diff --git a/crates/ecstore/src/store.rs b/crates/ecstore/src/store.rs index f1cb4ba71..2707679ee 100644 --- a/crates/ecstore/src/store.rs +++ b/crates/ecstore/src/store.rs @@ -33,8 +33,8 @@ use crate::bucket::utils::check_object_args; use crate::bucket::utils::check_put_object_args; use crate::bucket::utils::check_put_object_part_args; use crate::bucket::utils::{check_valid_bucket_name, check_valid_bucket_name_strict, is_meta_bucketname}; +use crate::config::get_global_storage_class; use crate::config::storageclass; -use crate::config::{get_global_server_config, get_global_storage_class}; use crate::disk::endpoint::{Endpoint, EndpointType}; use crate::disk::{DiskAPI, DiskInfo, DiskInfoOptions}; use crate::error::{Error, Result}; @@ -77,7 +77,7 @@ use lazy_static::lazy_static; use rand::RngExt as _; use rustfs_common::heal_channel::{HealItemType, HealOpts}; use rustfs_common::{GLOBAL_LOCAL_NODE_NAME, GLOBAL_RUSTFS_ADDR, GLOBAL_RUSTFS_HOST, GLOBAL_RUSTFS_PORT}; -use rustfs_config::server_config::Config; +use rustfs_config::server_config::{Config, get_global_server_config, set_global_server_config}; use rustfs_filemeta::FileInfo; use rustfs_lock::{LocalClient, LockClient, NamespaceLockWrapper}; use rustfs_madmin::heal_commands::HealResultItem; @@ -216,12 +216,12 @@ impl std::fmt::Debug for ECStore { impl ECStore { /// Get server configuration (delegates to global) pub fn get_server_config(&self) -> Option { - crate::config::get_global_server_config() + get_global_server_config() } /// Set server configuration (delegates to global) pub fn set_server_config(&self, cfg: Config) { - crate::config::set_global_server_config(cfg); + set_global_server_config(cfg); } /// Get storage class configuration (delegates to global) diff --git a/crates/iam/src/oidc.rs b/crates/iam/src/oidc.rs index 5192a4198..9f8d167dc 100644 --- a/crates/iam/src/oidc.rs +++ b/crates/iam/src/oidc.rs @@ -26,9 +26,9 @@ use openidconnect::{ }; use reqwest::Client; use rustfs_config::oidc::*; +use rustfs_config::server_config::get_global_server_config; use rustfs_config::server_config::{Config as ServerConfig, KVS}; use rustfs_config::{DEFAULT_DELIMITER, ENABLE_KEY, EnableState}; -use rustfs_ecstore::config::get_global_server_config; use rustfs_policy::policy::{ClaimLookup, get_claim_case_insensitive}; use serde::{Deserialize, Serialize}; use std::borrow::Cow; diff --git a/crates/scanner/src/runtime_config.rs b/crates/scanner/src/runtime_config.rs index 0244e1e52..f6078e591 100644 --- a/crates/scanner/src/runtime_config.rs +++ b/crates/scanner/src/runtime_config.rs @@ -664,7 +664,7 @@ pub fn apply_scanner_runtime_config(config: &ServerConfig) -> Result<(), Scanner } pub(crate) fn refresh_scanner_runtime_config_from_global() -> Result<(), ScannerRuntimeConfigError> { - let config = rustfs_ecstore::config::get_global_server_config(); + let config = rustfs_config::server_config::get_global_server_config(); let resolved = lookup_scanner_runtime_config(config.as_ref())?; apply_resolved_runtime_config(resolved); Ok(()) diff --git a/crates/scanner/src/scanner.rs b/crates/scanner/src/scanner.rs index 593fbb782..9124970ce 100644 --- a/crates/scanner/src/scanner.rs +++ b/crates/scanner/src/scanner.rs @@ -78,7 +78,7 @@ fn scanner_cycle_max_duration() -> Option { } fn resolve_scanner_runtime_config() -> crate::runtime_config::ScannerRuntimeConfig { - let config = rustfs_ecstore::config::get_global_server_config(); + let config = rustfs_config::server_config::get_global_server_config(); match lookup_scanner_runtime_config(config.as_ref()) { Ok(config) => config, Err(err) => { diff --git a/docs/architecture/compat-cleanup-register.md b/docs/architecture/compat-cleanup-register.md index 9ccbbcd52..8f35481f0 100644 --- a/docs/architecture/compat-cleanup-register.md +++ b/docs/architecture/compat-cleanup-register.md @@ -30,6 +30,12 @@ for later deletion. - Why: old `StorageAPI::new_ns_lock` callers must keep compiling while namespace-lock-only consumers migrate to NamespaceLocking. - Removal condition: remove after all namespace-lock-only consumers depend on NamespaceLocking and StorageAPI no longer owns namespace lock capability. - Status: planned cleanup. +- `RUSTFS_COMPAT_TODO(CFG-008)` + - Task: `CFG-008` + - File: `crates/ecstore/src/config/mod.rs` + - Why: old `rustfs_ecstore::config` global server-config accessor paths must keep compiling while runtime consumers migrate. + - Removal condition: remove after all consumers import global server-config accessors from `rustfs_config::server_config`. + - Status: planned cleanup. ## Review Checklist diff --git a/docs/architecture/config-model-boundary-adr.md b/docs/architecture/config-model-boundary-adr.md index 8a81382d2..7791bbe6e 100644 --- a/docs/architecture/config-model-boundary-adr.md +++ b/docs/architecture/config-model-boundary-adr.md @@ -34,6 +34,12 @@ That re-export included `RUSTFS_COMPAT_TODO(CFG-004)` and a matching entry in consumers were migrated. The CFG-004 cleanup removed this old model path after code scans showed consumers import the model directly from `rustfs-config`. +Follow-up `CFG-008` moved the process-global server-config snapshot accessors +to `rustfs_config::server_config` after the model path stabilized. ECStore keeps +only a temporary `rustfs_ecstore::config::{get_global_server_config, +set_global_server_config}` compatibility re-export while in-repo runtime +consumers migrate. + ## Why `rustfs-config` `rustfs-config` is already the lowest RustFS crate for configuration constants @@ -51,7 +57,8 @@ removing any storage or runtime dependency by itself. The server-config model module may use only: - `std::collections::HashMap` -- `std::sync::{LazyLock, OnceLock}` for the default `KVS` registration surface +- `std::sync::{LazyLock, OnceLock, RwLock}` for the default `KVS` registration + surface and process-global server-config snapshot - `serde` for `KV` and `KVS` serialization compatibility - `serde_json` for `Config::marshal` and `Config::unmarshal` - existing `rustfs-config` constants and subsystem modules @@ -71,7 +78,8 @@ The model module must not depend on: - notify, audit, targets, IAM, scanner, KMS, or admin handler crates - async runtimes, HTTP/router crates, object-store crates, or runtime lifecycle state -- global server-config snapshot state such as `GLOBAL_SERVER_CONFIG` +- unrelated runtime global state outside the process-global server-config + snapshot - `ConfigSys`, `read_config_without_migrate`, `save_server_config`, or any `com.rs` persistence helper @@ -94,9 +102,6 @@ Move in the first extraction: Keep in `ecstore`: - `ConfigSys` -- `GLOBAL_SERVER_CONFIG` -- `get_global_server_config` -- `set_global_server_config` - `init_global_config_sys` - `try_migrate_server_config` - `read_config_without_migrate` @@ -109,6 +114,15 @@ extracts a dedicated default-registration contract. The values may be registered through the moved `rustfs_config::server_config::register_default_kvs`, but the startup order and caller remain unchanged. +Move in `CFG-008`: + +- `GLOBAL_SERVER_CONFIG` +- `get_global_server_config` +- `set_global_server_config` + +Keep a temporary ECStore compatibility re-export for these accessors until all +consumers use `rustfs_config::server_config` directly. + ## Required Shape Preservation The extraction PR must preserve: @@ -138,6 +152,11 @@ all in-repo consumers migrated. `CFG-005` should migrate external consumers one group at a time after the model and compatibility path are stable. +`CFG-008` moves only the global server-config snapshot accessors to +`rustfs-config` and migrates in-repo direct consumers. It must not move +`ConfigSys`, storage-class global state, persistence helpers, default +registration wiring, startup order, or storage behavior. + ## Verification Gate Before pushing an extraction PR, run: diff --git a/docs/architecture/migration-progress.md b/docs/architecture/migration-progress.md index 1b55e883e..e35e7e837 100644 --- a/docs/architecture/migration-progress.md +++ b/docs/architecture/migration-progress.md @@ -5,17 +5,17 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block ## Current Context - Issue: [`rustfs/backlog#660`](https://github.com/rustfs/backlog/issues/660) -- Branch: `overtrue/arch-config-compat-cleanup` -- Baseline: `origin/main` at `69549634ea9524724dafd6bd90c8639880a2dbc6` +- Branch: `overtrue/arch-config-global-state` +- Baseline: `origin/main` at `ed3851782c48131e6102735d44d80fb6014a0699` - PR type for this branch: `api-extraction` -- Runtime behavior changes: none. -- Rust code changes: remove the temporary CFG-004 - `rustfs_ecstore::config` server-config model compatibility re-export and its - smoke test after all in-repo consumers migrated to - `rustfs_config::server_config`. +- Runtime behavior changes: none intended. +- Rust code changes: move the process-global server-config snapshot accessors + to `rustfs_config::server_config`, migrate in-repo direct consumers to the + new owner, and keep a temporary ECStore compatibility re-export for the old + accessor path. - CI/script changes: none. -- Docs changes: record CFG-004 cleanup context, update the compatibility - cleanup register, and mark the model-boundary ADR cleanup status. +- Docs changes: record CFG-008 global accessor ownership, update the + compatibility cleanup register, and mark the model-boundary ADR follow-up. ## Phase 0 Tasks @@ -116,6 +116,19 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block env overrides, persisted-config validation, cycle scheduling, bitrot-cycle compatibility, cache timeout, and alert threshold semantics remain unchanged. +- [x] `CFG-008` Move global server-config accessors. + - Current branch: move `GLOBAL_SERVER_CONFIG`, + `get_global_server_config`, and `set_global_server_config` to + `rustfs_config::server_config`; migrate in-repo runtime consumers to the + new owner. + - Compatibility: keep + `rustfs_ecstore::config::{get_global_server_config, + set_global_server_config}` as a temporary re-export with + `RUSTFS_COMPAT_TODO(CFG-008)`. + - Acceptance: ECStore still owns `ConfigSys`, config persistence helpers, + storage-class global state, default registration wiring, and startup + initialization; global server-config reads and writes keep the same + `std::sync::RwLock>` clone semantics. ## Phase 1 Security Governance Tasks @@ -349,25 +362,31 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block | Expert | Status | Notes | |---|---|---| -| Quality/architecture | pass | Confirmed the diff only removes the temporary model re-export and smoke test; ECStore persistence helpers, global state, startup wiring, and default registration remain unchanged. | -| Migration preservation | pass | Confirmed `ConfigSys`, `GLOBAL_SERVER_CONFIG`, storage-class globals/accessors, read/save/serde paths, scanner/admin consumers, and in-repo model imports remain correct after old-path removal. | -| Testing/verification | pass | Confirmed ECStore config tests, rustfs-config/ECStore/server compile check, migration guards, old-path scan, and added-line risk scan are sufficient; full pre-commit is skipped under the current larger-granularity instruction. | +| Quality/architecture | pass | Confirmed the diff only moves the process-global server-config snapshot accessors to `rustfs-config`, keeps ECStore persistence and storage-class ownership unchanged, and keeps the old accessor path as a temporary compatibility re-export. | +| Migration preservation | pass | Confirmed scanner, IAM, admin, app context, and ECStore store consumers read and write the same global server-config snapshot through the new owner without changing startup, persistence, or storage behavior. | +| Testing/verification | pass | Confirmed focused compile/tests, migration guards, old-path scan, dependency check, and Rust risk scan cover the changed accessor ownership; full pre-commit is skipped under the current larger-granularity instruction. | ## Verification Notes Passed: +- `cargo check -p rustfs-config -p rustfs-ecstore -p rustfs-iam -p rustfs-scanner -p rustfs --lib`. +- `cargo test -p rustfs-config --lib`; 26 passed. - `cargo test -p rustfs-ecstore config --lib`; 59 passed. -- `cargo check -p rustfs-config -p rustfs-ecstore -p rustfs --lib`. +- `cargo test -p rustfs-scanner runtime_config --lib`; 16 passed. +- `cargo test -p rustfs admin::handlers::config_admin --lib`; 29 passed. +- `cargo test -p rustfs admin::handlers::oidc --lib`; 20 passed. +- `cargo test -p rustfs-iam oidc --lib`; 53 passed. - `cargo fmt --all --check`. - `./scripts/check_architecture_migration_rules.sh`. - `./scripts/check_layer_dependencies.sh`. - `./scripts/check_metrics_migration_refs.sh`. -- `./scripts/check_unsafe_code_allowances.sh`. - `git diff --check`. -- CFG-004 old model code-path scan found no - `rustfs_ecstore::config::{Config, KV, KVS, DEFAULT_KVS, - register_default_kvs}` imports and no `RUSTFS_COMPAT_TODO(CFG-004)` markers - in `crates/**/*.rs` or `rustfs/src`. +- `cargo tree -p rustfs-config --edges normal` found no dependency on + `rustfs-ecstore`, `rustfs-scanner`, `rustfs-iam`, or `rustfs`. +- CFG-008 old accessor code-path scan found no direct in-repo runtime imports + from `rustfs_ecstore::config::{get_global_server_config, + set_global_server_config}` or `crate::config::{get_global_server_config, + set_global_server_config}` in `crates/**/*.rs` or `rustfs/src`. - Added-line risk scan found no production `unwrap`/`expect`, lossy numeric casts, stringly public errors, boxed dynamic errors, stdout/stderr printing, or relaxed atomic ordering. @@ -375,20 +394,25 @@ Passed: Notes: - Full pre-commit may be skipped if focused tests, compile checks, and guards pass, per the current instruction to increase PR granularity. -- This slice removes only the old pure model compatibility path. ECStore - retains persistence helpers, ConfigSys, global server-config state, - storage-class global state, startup wiring, and all storage/config persistence - logic. -- The old `rustfs_ecstore::config` model path is no longer available after this - cleanup. Consumers must use `rustfs_config::server_config`. +- `./scripts/check_unsafe_code_allowances.sh` is not counted for this PR; it + currently reports unrelated existing unsafe allowance locations whose nearby + `SAFETY:` comments are present. +- This slice moves only `GLOBAL_SERVER_CONFIG`, `get_global_server_config`, and + `set_global_server_config` to `rustfs_config::server_config`. +- ECStore retains `ConfigSys`, config persistence helpers, storage-class global + state, default registration wiring, startup initialization, and storage + behavior. +- The old `rustfs_ecstore::config` accessor path remains available through a + temporary `RUSTFS_COMPAT_TODO(CFG-008)` re-export for downstream callers. ## Handoff Notes -- Keep this CFG-004 cleanup slice as an `api-extraction` PR that only removes - the temporary model compatibility re-export and its cleanup-register entry. -- Do not move `ConfigSys`, `GLOBAL_SERVER_CONFIG`, storage-class global state, +- Keep this CFG-008 slice as an `api-extraction` PR that only moves the global + server-config snapshot accessors and migrates direct in-repo runtime + consumers to `rustfs_config::server_config`. +- Do not move `ConfigSys`, storage-class global state, `read_config_without_migrate`, `save_server_config`, config-object helpers, - startup wiring, storage-class helpers, ECStore persistence helpers, or storage - persistence logic in this PR. -- Do not add temporary compatibility code unless a matching - `RUSTFS_COMPAT_TODO()` marker and cleanup-register entry are added. + default registration wiring, startup wiring, storage-class helpers, ECStore + persistence helpers, or storage persistence logic in this PR. +- Remove the CFG-008 compatibility re-export only after downstream and in-repo + consumers no longer need `rustfs_ecstore::config` accessor imports. diff --git a/rustfs/src/admin/handlers/config_admin.rs b/rustfs/src/admin/handlers/config_admin.rs index 436e46b39..df732c512 100644 --- a/rustfs/src/admin/handlers/config_admin.rs +++ b/rustfs/src/admin/handlers/config_admin.rs @@ -48,7 +48,9 @@ use rustfs_config::oidc::{ OIDC_CLIENT_ID, OIDC_CLIENT_SECRET, OIDC_CONFIG_URL, OIDC_DISPLAY_NAME, OIDC_EMAIL_CLAIM, OIDC_GROUPS_CLAIM, OIDC_REDIRECT_URI, OIDC_REDIRECT_URI_DYNAMIC, OIDC_ROLE_POLICY, OIDC_SCOPES, OIDC_USERNAME_CLAIM, }; -use rustfs_config::server_config::{Config as ServerConfig, DEFAULT_KVS, KV, KVS}; +use rustfs_config::server_config::{ + Config as ServerConfig, DEFAULT_KVS, KV, KVS, get_global_server_config, set_global_server_config, +}; use rustfs_config::{ COMMENT_KEY, DEFAULT_DELIMITER, ENABLE_KEY, ENV_PREFIX, ENV_SCANNER_ALERT_EXCESS_FOLDERS, ENV_SCANNER_ALERT_EXCESS_VERSION_SIZE, ENV_SCANNER_ALERT_EXCESS_VERSIONS, ENV_SCANNER_BITROT_CYCLE_SECS, @@ -69,7 +71,6 @@ use rustfs_credentials::Credentials; use rustfs_ecstore::config::com::STORAGE_CLASS_SUB_SYS; use rustfs_ecstore::config::com::{delete_config, read_config, read_config_without_migrate, save_config, save_server_config}; use rustfs_ecstore::config::storageclass::{INLINE_BLOCK_ENV, OPTIMIZE_ENV, RRS_ENV, STANDARD_ENV}; -use rustfs_ecstore::config::{get_global_server_config, set_global_server_config}; use rustfs_ecstore::disk::RUSTFS_META_BUCKET; use rustfs_ecstore::new_object_layer_fn; use rustfs_ecstore::store_api::ListOperations; diff --git a/rustfs/src/admin/handlers/oidc.rs b/rustfs/src/admin/handlers/oidc.rs index 7c860d2c8..120bc1636 100644 --- a/rustfs/src/admin/handlers/oidc.rs +++ b/rustfs/src/admin/handlers/oidc.rs @@ -27,9 +27,9 @@ use rustfs_config::oidc::{ OIDC_REDIRECT_URI, OIDC_REDIRECT_URI_DYNAMIC, OIDC_ROLE_POLICY, OIDC_ROLES_CLAIM, OIDC_SCOPES, OIDC_USERNAME_CLAIM, }; use rustfs_config::server_config::Config as ServerConfig; +use rustfs_config::server_config::get_global_server_config; use rustfs_config::{DEFAULT_DELIMITER, ENABLE_KEY, EnableState, MAX_ADMIN_REQUEST_BODY_SIZE}; use rustfs_ecstore::config::com::{read_config_without_migrate, save_server_config}; -use rustfs_ecstore::config::get_global_server_config; use rustfs_ecstore::new_object_layer_fn; use rustfs_policy::policy::action::{Action, AdminAction}; use s3s::{Body, S3Error, S3ErrorCode, S3Request, S3Response, S3Result, s3_error}; diff --git a/rustfs/src/admin/handlers/site_replication.rs b/rustfs/src/admin/handlers/site_replication.rs index d18675063..96d2243d4 100644 --- a/rustfs/src/admin/handlers/site_replication.rs +++ b/rustfs/src/admin/handlers/site_replication.rs @@ -30,6 +30,7 @@ use http::header::{CONTENT_TYPE, HOST}; use http::{HeaderMap, HeaderValue, Uri}; use hyper::{Method, StatusCode}; use matchit::Params; +use rustfs_config::server_config::get_global_server_config; use rustfs_config::{ DEFAULT_CONSOLE_ADDRESS, DEFAULT_DELIMITER, DEFAULT_RUSTFS_TLS_PATH, ENV_RUSTFS_CONSOLE_ADDRESS, ENV_RUSTFS_TLS_PATH, MAX_ADMIN_REQUEST_BODY_SIZE, @@ -46,7 +47,6 @@ use rustfs_ecstore::bucket::target::{ARN, BucketTarget, BucketTargetType, Bucket use rustfs_ecstore::bucket::utils::{deserialize, serialize}; use rustfs_ecstore::bucket::versioning::VersioningApi; use rustfs_ecstore::config::com::{delete_config, read_config, save_config}; -use rustfs_ecstore::config::get_global_server_config; use rustfs_ecstore::error::Error as StorageError; use rustfs_ecstore::global::{get_global_deployment_id, get_global_endpoints_opt, get_global_region, global_rustfs_port}; use rustfs_ecstore::new_object_layer_fn; diff --git a/rustfs/src/admin/router.rs b/rustfs/src/admin/router.rs index f7dd08cd7..e67087963 100644 --- a/rustfs/src/admin/router.rs +++ b/rustfs/src/admin/router.rs @@ -37,6 +37,7 @@ use matchit::Router; use reqwest::Url; use rustfs_config::notify::NOTIFY_WEBHOOK_SUB_SYS; use rustfs_config::server_config::Config; +use rustfs_config::server_config::get_global_server_config; use rustfs_config::{ ENABLE_KEY, WEBHOOK_AUTH_TOKEN, WEBHOOK_CLIENT_CA, WEBHOOK_CLIENT_CERT, WEBHOOK_CLIENT_KEY, WEBHOOK_ENDPOINT, WEBHOOK_SKIP_TLS_VERIFY, @@ -55,7 +56,6 @@ use rustfs_ecstore::bucket::target::{BucketTarget, BucketTargetType, BucketTarge use rustfs_ecstore::bucket::versioning::VersioningApi; use rustfs_ecstore::bucket::versioning_sys::BucketVersioningSys; use rustfs_ecstore::config::com::read_config_without_migrate; -use rustfs_ecstore::config::get_global_server_config; use rustfs_ecstore::global::GLOBAL_BOOT_TIME; use rustfs_ecstore::notification_sys::get_global_notification_sys; use rustfs_ecstore::rpc::PeerRestClient; diff --git a/rustfs/src/admin/service/config.rs b/rustfs/src/admin/service/config.rs index 4bf21c922..5f5d9509c 100644 --- a/rustfs/src/admin/service/config.rs +++ b/rustfs/src/admin/service/config.rs @@ -16,13 +16,13 @@ use rustfs_audit::reload_audit_config; use rustfs_config::audit::{AUDIT_MQTT_SUB_SYS, AUDIT_REDIS_DEFAULT_CHANNEL, AUDIT_WEBHOOK_SUB_SYS}; use rustfs_config::notify::{NOTIFY_MQTT_SUB_SYS, NOTIFY_REDIS_DEFAULT_CHANNEL, NOTIFY_WEBHOOK_SUB_SYS}; use rustfs_config::oidc::IDENTITY_OPENID_SUB_SYS; -use rustfs_config::server_config::{Config as ServerConfig, KVS}; +use rustfs_config::server_config::{Config as ServerConfig, KVS, set_global_server_config}; use rustfs_config::{AUDIT_DEFAULT_DIR, EVENT_DEFAULT_DIR}; use rustfs_config::{DEFAULT_DELIMITER, ENABLE_KEY, EnableState}; use rustfs_config::{HEAL_SUB_SYS, SCANNER_SUB_SYS}; use rustfs_ecstore::config::com::{STORAGE_CLASS_SUB_SYS, read_config_without_migrate}; +use rustfs_ecstore::config::set_global_storage_class; use rustfs_ecstore::config::storageclass; -use rustfs_ecstore::config::{set_global_server_config, set_global_storage_class}; use rustfs_ecstore::new_object_layer_fn; use rustfs_ecstore::notification_sys::get_global_notification_sys; use rustfs_iam::oidc::load_oidc_provider_configs_from_server_config; diff --git a/rustfs/src/app/context.rs b/rustfs/src/app/context.rs index dc8366058..992a7a4ff 100644 --- a/rustfs/src/app/context.rs +++ b/rustfs/src/app/context.rs @@ -19,8 +19,8 @@ use crate::config::{RustFSBufferConfig, get_global_buffer_config}; use async_trait::async_trait; use rustfs_config::server_config::Config; +use rustfs_config::server_config::get_global_server_config; use rustfs_ecstore::bucket::metadata_sys::{BucketMetadataSys, get_global_bucket_metadata_sys}; -use rustfs_ecstore::config::get_global_server_config; use rustfs_ecstore::endpoints::EndpointServerPools; use rustfs_ecstore::global::{get_global_endpoints_opt, get_global_region, get_global_tier_config_mgr}; use rustfs_ecstore::store::ECStore;