1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-06-16 07:40:08 +00:00

Improve JWT key initialization and avoid saving public key (#4085)

This commit is contained in:
Daniel García 2024-03-17 15:11:20 +01:00 committed by GitHub
parent 2cbfe6fa5b
commit a1fbd6d729
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 48 additions and 87 deletions

View file

@ -1164,7 +1164,7 @@ impl Config {
}
pub fn delete_user_config(&self) -> Result<(), Error> {
crate::util::delete_file(&CONFIG_FILE)?;
std::fs::remove_file(&*CONFIG_FILE)?;
// Empty user config
let usr = ConfigBuilder::default();
@ -1189,9 +1189,6 @@ impl Config {
pub fn private_rsa_key(&self) -> String {
format!("{}.pem", CONFIG.rsa_key_filename())
}
pub fn public_rsa_key(&self) -> String {
format!("{}.pub.pem", CONFIG.rsa_key_filename())
}
pub fn mail_enabled(&self) -> bool {
let inner = &self.inner.read().unwrap().config;
inner._enable_smtp && (inner.smtp_host.is_some() || inner.use_sendmail)