feat: rm acme config
This commit is contained in:
23
src/main.rs
23
src/main.rs
@@ -23,7 +23,7 @@ use async_std::channel;
|
||||
use async_std::channel::Sender;
|
||||
use config::AcmeAlgo;
|
||||
use config::AcmeMode;
|
||||
use crate::config::{CertConfig, CERT_NAME, KEY_NAME, load_acme_config};
|
||||
use crate::config::{CertConfig, CERT_NAME, KEY_NAME};
|
||||
|
||||
const NAME: &str = env!("CARGO_PKG_NAME");
|
||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
@@ -65,8 +65,7 @@ async fn main() -> tide::Result<()> {
|
||||
.arg(Arg::with_name("timeout").long("timeout").takes_value(true).default_value("5000").help("Timeout (ms)"))
|
||||
.arg(Arg::with_name("mode").short("m").long("mode").takes_value(true).default_value("prod").help("Mode"))
|
||||
.arg(Arg::with_name("dir").long("dir").takes_value(true).default_value("acme_dir").help("Account key dir"))
|
||||
.arg(Arg::with_name("config").short("c").long("config").takes_value(true).help("Acme config"))
|
||||
.arg(Arg::with_name("cert-config").long("cert-config").takes_value(true).help("Cert config"))
|
||||
.arg(Arg::with_name("config").short("c").long("config").takes_value(true).help("Cert config"))
|
||||
.get_matches();
|
||||
|
||||
if matches.is_present("version") {
|
||||
@@ -125,26 +124,18 @@ async fn main() -> tide::Result<()> {
|
||||
};
|
||||
let account_dir = matches.value_of("dir").unwrap_or("acme_dir");
|
||||
|
||||
let domains_val = matches.values_of("domain").unwrap_or_else(|| {
|
||||
failure!("Domains is not assigned.");
|
||||
exit(1);
|
||||
});
|
||||
|
||||
let (s, r) = channel::bounded(1);
|
||||
startup_http_server(s, port);
|
||||
r.recv().await.ok();
|
||||
task::sleep(Duration::from_millis(500)).await;
|
||||
|
||||
// TODO ......
|
||||
let config = matches.value_of("config");
|
||||
let _acme_config = load_acme_config(config, true).unwrap_or_else(|e| {
|
||||
failure!("Load acme config failed: {}", e);
|
||||
exit(1);
|
||||
});
|
||||
|
||||
let cert_config = matches.value_of("cert-config");
|
||||
let cert_config = matches.value_of("config");
|
||||
match cert_config {
|
||||
None => { // cert config is not assigned
|
||||
let domains_val = matches.values_of("domain").unwrap_or_else(|| {
|
||||
failure!("Domains is not assigned.");
|
||||
exit(1);
|
||||
});
|
||||
let domains: Vec<&str> = domains_val.collect::<Vec<_>>();
|
||||
let primary_name = domains[0];
|
||||
let alt_names: Vec<&str> = domains.into_iter().skip(1).collect();
|
||||
|
||||
Reference in New Issue
Block a user