server: read mysql password from file
All checks were successful
Build and test / check (push) Successful in 1m33s
Build and test / build (push) Successful in 2m46s
Build and test / test (push) Successful in 3m11s
Build and test / check-license (push) Successful in 5m50s
Build and test / docs (push) Successful in 4m39s

This commit is contained in:
2025-12-02 15:40:54 +09:00
parent 7e1383609d
commit 25c4c6f3e9

View File

@@ -41,7 +41,15 @@ impl MysqlConfig {
options = options.username(username); options = options.username(username);
} }
if let Some(password) = &self.password { if let Some(password_file) = &self.password_file {
let password = fs::read_to_string(password_file)
.with_context(|| {
format!("Failed to read MySQL password file at {:?}", password_file)
})?
.trim()
.to_owned();
options = options.password(&password);
} else if let Some(password) = &self.password {
options = options.password(password); options = options.password(password);
} }