From 348fdc1d3b55fbf8ff371303b472f9b652738d16 Mon Sep 17 00:00:00 2001 From: denisonbarbosa Date: Tue, 19 Sep 2023 06:51:36 -0400 Subject: [PATCH] Adjust env variables naming --- nss/Cargo.toml | 2 +- nss/src/lib.rs | 6 +++--- nss/src/logs/mod.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nss/Cargo.toml b/nss/Cargo.toml index a5ad94559..4eb517e62 100644 --- a/nss/Cargo.toml +++ b/nss/Cargo.toml @@ -11,7 +11,7 @@ name = "nss_authd" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -# Allows to override the socket path used to connect to the grpc server, through the NSS_AUTHD_SOCKET env variable. +# Allows to override the socket path used to connect to the grpc server, through the AUTHD_NSS_SOCKET env variable. custom_socket = [] [dependencies] diff --git a/nss/src/lib.rs b/nss/src/lib.rs index 2a3f3b69f..99b4f08fa 100644 --- a/nss/src/lib.rs +++ b/nss/src/lib.rs @@ -33,15 +33,15 @@ fn init_logger() { /// socket_path returns the socket path to connect to the gRPC server. /// -/// It uses the NSS_AUTHD_SOCKET env value if set and the custom_socket feature is enabled, +/// It uses the AUTHD_NSS_SOCKET env value if set and the custom_socket feature is enabled, /// otherwise it uses the default path. fn socket_path() -> String { #[cfg(feature = "custom_socket")] - match std::env::var("NSS_AUTHD_SOCKET") { + match std::env::var("AUTHD_NSS_SOCKET") { Ok(s) => return s, Err(err) => { debug!( - "NSS_AUTHD_SOCKET not set or badly configured, using default value: {}", + "AUTHD_NSS_SOCKET not set or badly configured, using default value: {}", err ); } diff --git a/nss/src/logs/mod.rs b/nss/src/logs/mod.rs index 3c8972a58..65c640b6d 100644 --- a/nss/src/logs/mod.rs +++ b/nss/src/logs/mod.rs @@ -22,14 +22,14 @@ macro_rules! error { /// init_logger initialize the global logger with a default level set to info. This function is only /// required to be called once and is a no-op on subsequent calls. /// -/// The log level can be set to debug by setting the environment variable NSS_AUTHD_DEBUG. +/// The log level can be set to debug by setting the environment variable AUTHD_NSS_DEBUG. pub fn init_logger() { if log::logger().enabled(&Metadata::builder().build()) { return; } let mut level = LevelFilter::Info; - if let Ok(target) = env::var("NSS_AUTHD_DEBUG") { + if let Ok(target) = env::var("AUTHD_NSS_DEBUG") { level = LevelFilter::Debug; match target { s if s == *"stderr" => init_stderr_logger(level),