ACME TLS implementation using TLS-ALPN-01 - closes #160
This commit is contained in:
@@ -69,7 +69,7 @@ async fn main() -> std::io::Result<()> {
|
||||
Commands::Export(command) => {
|
||||
command.exec(client).await;
|
||||
}
|
||||
Commands::Database(command) => command.exec(client).await,
|
||||
Commands::Server(command) => command.exec(client).await,
|
||||
Commands::Account(command) => command.exec(client).await,
|
||||
Commands::Domain(command) => command.exec(client).await,
|
||||
Commands::List(command) => command.exec(client).await,
|
||||
|
||||
@@ -71,7 +71,7 @@ pub enum Commands {
|
||||
|
||||
/// Manage JMAP database
|
||||
#[clap(subcommand)]
|
||||
Database(DatabaseCommands),
|
||||
Server(ServerCommands),
|
||||
|
||||
/// Manage SMTP message queue
|
||||
#[clap(subcommand)]
|
||||
@@ -399,9 +399,11 @@ pub enum ExportCommands {
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
pub enum DatabaseCommands {
|
||||
pub enum ServerCommands {
|
||||
/// Perform database maintenance
|
||||
Maintenance {},
|
||||
DatabaseMaintenance {},
|
||||
/// Reload TLS certificates
|
||||
ReloadCertificates {},
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
|
||||
|
||||
@@ -24,17 +24,23 @@
|
||||
use reqwest::Method;
|
||||
use serde_json::Value;
|
||||
|
||||
use super::cli::{Client, DatabaseCommands};
|
||||
use super::cli::{Client, ServerCommands};
|
||||
|
||||
impl DatabaseCommands {
|
||||
impl ServerCommands {
|
||||
pub async fn exec(self, client: Client) {
|
||||
match self {
|
||||
DatabaseCommands::Maintenance {} => {
|
||||
ServerCommands::DatabaseMaintenance {} => {
|
||||
client
|
||||
.http_request::<Value, String>(Method::GET, "/admin/store/maintenance", None)
|
||||
.await;
|
||||
eprintln!("Success.");
|
||||
}
|
||||
ServerCommands::ReloadCertificates {} => {
|
||||
client
|
||||
.http_request::<Value, String>(Method::GET, "/admin/certificates/reload", None)
|
||||
.await;
|
||||
eprintln!("Success.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user