From ad7cd98d85e69f53ec9805d3a4bb2e665229526d Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 20 Jun 2024 23:56:43 +0900 Subject: [PATCH] WIP --- src/command/config/migrate/v20240701.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/command/config/migrate/v20240701.rs b/src/command/config/migrate/v20240701.rs index 1f97d9e..a14efbb 100644 --- a/src/command/config/migrate/v20240701.rs +++ b/src/command/config/migrate/v20240701.rs @@ -289,7 +289,7 @@ fn create_new_server_config( network: server::Network { protocol: match protocol.as_str() { "http" => Some(server::HttpProtocol::Http), - _ => Some(server::HttpProtocol::Https), + _ => None, }, host, port: default_yml @@ -342,20 +342,21 @@ fn create_new_server_config( None => None, }, password: match redis.get(&Yaml::String("pass".to_string())) { - Some(user) => Some( - user.as_str() + Some(pass) => Some( + pass.as_str() .ok_or(Error::InvalidConfig("redis.pass"))? .to_string(), ), None => None, }, index: match redis.get(&Yaml::String("db".to_string())) { - Some(user) => Some(user.as_i64().ok_or(Error::InvalidConfig("redis.db"))? as u8), + Some(db) => Some(db.as_i64().ok_or(Error::InvalidConfig("redis.db"))? as u8), None => None, }, prefix: match redis.get(&Yaml::String("prefix".to_string())) { - Some(user) => Some( - user.as_str() + Some(prefix) => Some( + prefix + .as_str() .ok_or(Error::InvalidConfig("redis.prefix"))? .to_string(), ), @@ -375,8 +376,8 @@ fn create_new_server_config( None => None, }, fingerprint: match id.get(&Yaml::String("fingerprint".to_string())) { - Some(length) => Some( - length + Some(fingerprint) => Some( + fingerprint .as_str() .ok_or(Error::InvalidConfig("cuid.fingerprint"))? .to_string(),