ACME TLS implementation using TLS-ALPN-01 - closes #160

This commit is contained in:
mdecimus
2024-01-05 18:44:22 +01:00
parent 172c8afae0
commit ffba9b5a61
43 changed files with 2285 additions and 464 deletions

View File

@@ -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,

View File

@@ -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)]

View File

@@ -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.");
}
}
}
}