diff --git a/src/acme.rs b/src/acme.rs index 43b02b8..28d4a20 100644 --- a/src/acme.rs +++ b/src/acme.rs @@ -4,8 +4,8 @@ use std::fs; use acme_lib::{create_p256_key, create_p384_key, create_rsa_key}; use acme_lib::persist::FilePersist; use acme_lib::Directory; -use aliyun_openapi_core_rust_sdk::RPClient; use rust_util::XResult; +use aliyun_openapi_core_rust_sdk::RPClient; use crate::util::parse_dns_record; use crate::network::{get_resolver, resolve_first_ipv4}; use crate::ali_dns::{add_txt_dns_record, build_dns_client, delete_dns_record, list_dns, simple_parse_aliyun_supplier}; diff --git a/src/ali_dns.rs b/src/ali_dns.rs index e921194..ab72274 100644 --- a/src/ali_dns.rs +++ b/src/ali_dns.rs @@ -1,6 +1,6 @@ +use rust_util::XResult; use serde::{Deserialize, Serialize}; use aliyun_openapi_core_rust_sdk::RPClient; -use rust_util::XResult; static ALI_DNS_ENDPOINT: &str = "https://alidns.aliyuncs.com"; static ALI_DNS_API_VERSION: &str = "2015-01-09"; diff --git a/src/config.rs b/src/config.rs index 9f42f37..3ba5912 100644 --- a/src/config.rs +++ b/src/config.rs @@ -5,9 +5,9 @@ use std::fs; use acme_lib::DirectoryUrl; use std::path::PathBuf; use std::str::FromStr; +use std::time::SystemTime; use crate::x509; use crate::x509::{X509PublicKeyAlgo, X509Certificate}; -use std::time::SystemTime; pub const CERT_NAME: &str = "cert.pem"; pub const KEY_NAME: &str = "key.pem"; diff --git a/src/dingtalk.rs b/src/dingtalk.rs index f80a2d4..7990e48 100644 --- a/src/dingtalk.rs +++ b/src/dingtalk.rs @@ -1,10 +1,10 @@ use std::io::{Error, ErrorKind}; -use serde::{Serialize, Deserialize}; use std::time::SystemTime; +use serde::{Serialize, Deserialize}; use rust_util::XResult; use hmac::{Hmac, Mac}; use sha2::Sha256; -use crate::CertConfig; +use crate::config::CertConfig; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct InnerTextMessageText { diff --git a/src/main.rs b/src/main.rs index 1b8d378..ab37ad6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,13 +20,12 @@ use std::str::FromStr; use tide::Request; use std::process::{Command, exit}; use std::time::{Duration, SystemTime}; +use std::path::PathBuf; use async_std::task; use async_std::channel; use async_std::channel::Sender; -use config::AcmeMode; -use std::path::PathBuf; use rust_util::util_cmd::run_command_and_wait; -use crate::config::{AcmeChallenge, CertConfig, CERT_NAME, KEY_NAME}; +use crate::config::{AcmeMode, AcmeChallenge, CertConfig, CERT_NAME, KEY_NAME}; use crate::x509::{X509PublicKeyAlgo}; use crate::dingtalk::send_dingtalk_message; use crate::statics::{AcmeStatics, AcmeStatus}; diff --git a/src/simple_thread_pool.rs b/src/simple_thread_pool.rs index 088812d..e28d8c8 100644 --- a/src/simple_thread_pool.rs +++ b/src/simple_thread_pool.rs @@ -1,9 +1,9 @@ -use rust_util::XResult; use std::thread; use std::thread::JoinHandle; use std::sync::atomic::{AtomicU32, Ordering}; use std::sync::Arc; use std::time::Duration; +use rust_util::XResult; pub struct SimpleThreadPool { max_pool_size: u32, diff --git a/src/x509.rs b/src/x509.rs index 4f8ae8a..8bca061 100644 --- a/src/x509.rs +++ b/src/x509.rs @@ -1,14 +1,14 @@ +use std::error::Error; +use std::str::FromStr; use serde::{Deserialize, Serialize}; +use rust_util::XResult; use x509_parser::parse_x509_certificate; use x509_parser::pem::parse_x509_pem; use x509_parser::extensions::{ParsedExtension, GeneralName}; use x509_parser::der_parser::oid::Oid; -use std::str::FromStr; -use rust_util::XResult; use x509_parser::der_parser::parse_der; use x509_parser::x509::SubjectPublicKeyInfo; use x509_parser::der_parser::ber::BerObjectContent; -use std::error::Error; lazy_static! { static ref OID_COMMON_NAME: Oid<'static> = Oid::from_str("2.5.4.3").unwrap();