First dispatcher

- Create (sub)command structure.
- First experimental dispatcher to start the daemon.
This commit is contained in:
Malte Meiboom
2026-02-22 12:51:05 +01:00
parent 2d072bf10b
commit c33feb1ee7
14 changed files with 323 additions and 35 deletions
+5
View File
@@ -0,0 +1,5 @@
//
// Some defaults
//
pub const CONFIG_FILE_LOCATION: &'static str = "/etc/husk/config.toml";
+2 -2
View File
@@ -8,7 +8,7 @@ use anyhow;
use sequoia_openpgp::policy::StandardPolicy;
use std::path::PathBuf;
use sequoia_openpgp::Cert;
use sequoia_cert_store::{CertStore, StoreUpdate};
use sequoia_cert_store::CertStore;
use sequoia_directories::Home;
use crate::{config::HuskConfig, crypto};
@@ -58,7 +58,7 @@ impl<'hc> HuskContext<'hc> {
}
pub async fn add_recipient(&mut self, rcpt: String) {
let certs = crypto::get_certificates(&self, rcpt.as_str()).await;
self.mail.add_recipient(rcpt, certs)
+3 -2
View File
@@ -6,7 +6,8 @@
use sequoia_wot as wot;
use wot::{CertSynopsis, Certification};
use sequoia_openpgp::{policy::StandardPolicy, Cert, KeyID};
use sequoia_openpgp::policy::StandardPolicy;
use sequoia_openpgp::Cert;
#[derive(Debug, Clone)]
pub struct Introducer {
@@ -44,7 +45,7 @@ impl Introducer {
u.certifications().for_each(|s| {
if s.signature_alive(None, None).is_ok() {
s.issuers().for_each(|i| {
if i == &my_keyid { result = true; }
if i == &my_keyid { result = true; }
});
}
})
+2
View File
@@ -1,5 +1,7 @@
pub mod defaults;
pub mod husk_context;
pub mod mail_context;
pub mod errors;
pub mod recipient;
pub mod introducer;