fix: Correct Pest grammar and update ItemService initialization
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
This commit is contained in:
@@ -396,6 +396,29 @@ impl Settings {
|
||||
}
|
||||
|
||||
|
||||
/// Get server password from password_file or directly from config if configured
|
||||
pub fn get_server_password(&self) -> Result<Option<String>> {
|
||||
if let Some(server) = &self.server {
|
||||
// First check for password_file
|
||||
if let Some(password_file) = &server.password_file {
|
||||
debug!("CONFIG: Reading password from file: {:?}", password_file);
|
||||
let password = fs::read_to_string(password_file)
|
||||
.with_context(|| format!("Failed to read password file: {:?}", password_file))?
|
||||
.trim()
|
||||
.to_string();
|
||||
return Ok(Some(password));
|
||||
}
|
||||
|
||||
// Fall back to direct password field
|
||||
if let Some(password) = &server.password {
|
||||
debug!("CONFIG: Using password from config");
|
||||
return Ok(Some(password.clone()));
|
||||
}
|
||||
}
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
|
||||
/// Get server password from password_file or directly from config if configured
|
||||
pub fn get_server_password(&self) -> Result<Option<String>> {
|
||||
if let Some(server) = &self.server {
|
||||
|
||||
Reference in New Issue
Block a user