diff --git a/crates/arti-client/src/config.rs b/crates/arti-client/src/config.rs index cb628e031..4c77a87ab 100644 --- a/crates/arti-client/src/config.rs +++ b/crates/arti-client/src/config.rs @@ -171,7 +171,7 @@ impl TorClientConfig { /// Returns a `TorClientConfig` using reasonably sane defaults. /// /// This gies the same result as using `tor_config`'s definitions - /// for `APP_LOCAL_DATA` and `APP_CACHE` for the state and cache + /// for `ARTI_LOCAL_DATA` and `ARTI_CACHE` for the state and cache /// directories respectively. /// /// (On unix, this usually works out to `~/.local/share/arti` and diff --git a/crates/arti-config/src/arti_defaults.toml b/crates/arti-config/src/arti_defaults.toml index 2c41542ac..0a5f8f6af 100644 --- a/crates/arti-config/src/arti_defaults.toml +++ b/crates/arti-config/src/arti_defaults.toml @@ -32,16 +32,16 @@ trace_filter = "debug" # These paths can use ~ to indicate the user's home directory, or a set # of shell-style variables to indicate platform-specific paths. # -# Supported variables are APP_CACHE, APP_CONFIG, APP_SHARED_DATA, -# APP_LOCAL_DATA, and USER_HOME. +# Supported variables are ARTI_CACHE, ARTI_CONFIG, ARTI_SHARED_DATA, +# ARTI_LOCAL_DATA, and USER_HOME. # # Multiple processes can share the same cache_dir. If they do, one of them # will download directory information for all of the others. # # The state directory is not yet used. [storage] -cache_dir = "${APP_CACHE}" -state_dir = "${APP_LOCAL_DATA}" +cache_dir = "${ARTI_CACHE}" +state_dir = "${ARTI_LOCAL_DATA}" # Replacement values for consensus parameters. This is an advanced option # and you probably should leave it alone. Not all parameters are supported. diff --git a/crates/arti-config/src/lib.rs b/crates/arti-config/src/lib.rs index f9dd7fc50..74a4e364d 100644 --- a/crates/arti-config/src/lib.rs +++ b/crates/arti-config/src/lib.rs @@ -91,7 +91,7 @@ fn load_mut>( /// Return a filename for the default user configuration file. pub fn default_config_file() -> Option { - CfgPath::new("${APP_CONFIG}/arti.toml".into()).path().ok() + CfgPath::new("${ARTI_CONFIG}/arti.toml".into()).path().ok() } #[cfg(test)] diff --git a/crates/tor-config/src/path.rs b/crates/tor-config/src/path.rs index 7dc56174a..2aefb81ee 100644 --- a/crates/tor-config/src/path.rs +++ b/crates/tor-config/src/path.rs @@ -13,11 +13,11 @@ use serde::Deserialize; /// with expansion of certain variables. /// /// The supported variables are: -/// * `APP_CACHE`: an arti-specific cache directory. -/// * `APP_CONFIG`: an arti-specific configuration directory. -/// * `APP_SHARED_DATA`: an arti-specific directory in the user's "shared +/// * `ARTI_CACHE`: an arti-specific cache directory. +/// * `ARTI_CONFIG`: an arti-specific configuration directory. +/// * `ARTI_SHARED_DATA`: an arti-specific directory in the user's "shared /// data" space. -/// * `APP_LOCAL_DATA`: an arti-specific directory in the user's "local +/// * `ARTI_LOCAL_DATA`: an arti-specific directory in the user's "local /// data" space. /// * `USER_HOME`: the user's home directory. /// @@ -108,10 +108,10 @@ fn get_home() -> Option<&'static Path> { #[cfg(feature = "expand-paths")] fn get_env(var: &str) -> Result, CfgPathError> { let path = match var { - "APP_CACHE" => project_dirs()?.cache_dir(), - "APP_CONFIG" => project_dirs()?.config_dir(), - "APP_SHARED_DATA" => project_dirs()?.data_dir(), - "APP_LOCAL_DATA" => project_dirs()?.data_local_dir(), + "ARTI_CACHE" => project_dirs()?.cache_dir(), + "ARTI_CONFIG" => project_dirs()?.config_dir(), + "ARTI_SHARED_DATA" => project_dirs()?.data_dir(), + "ARTI_LOCAL_DATA" => project_dirs()?.data_local_dir(), "USER_HOME" => base_dirs()?.home_dir(), _ => return Err(CfgPathError::UnknownVar(var.to_owned())), }; @@ -188,8 +188,8 @@ mod test { #[test] fn expand_cache() { - let p = CfgPath::new("${APP_CACHE}/example".to_string()); - assert_eq!(p.to_string(), "${APP_CACHE}/example".to_string()); + let p = CfgPath::new("${ARTI_CACHE}/example".to_string()); + assert_eq!(p.to_string(), "${ARTI_CACHE}/example".to_string()); let expected = project_dirs().unwrap().cache_dir().join("example"); assert_eq!(p.path().unwrap().to_str(), expected.to_str()); @@ -197,8 +197,8 @@ mod test { #[test] fn expand_bogus() { - let p = CfgPath::new("${APP_WOMBAT}/example".to_string()); - assert_eq!(p.to_string(), "${APP_WOMBAT}/example".to_string()); + let p = CfgPath::new("${ARTI_WOMBAT}/example".to_string()); + assert_eq!(p.to_string(), "${ARTI_WOMBAT}/example".to_string()); assert!(p.path().is_err()); }