mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-27 02:41:53 +00:00
* refactor project structure * environment-based default registry * fix tests * update build container * use docker platform for iso build emulation * simplify compat * Fix docker platform spec in run-compat.sh * handle riscv compat * fix bug with dep error exists attr * undo removal of sorting * use qemu for iso stage --------- Co-authored-by: Mariusz Kogen <k0gen@pm.me> Co-authored-by: Matt Hill <mattnine@protonmail.com>
31 lines
821 B
Rust
31 lines
821 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::account::AccountInfo;
|
|
use crate::net::acme::AcmeCertStore;
|
|
use crate::net::ssl::CertStore;
|
|
use crate::net::tor::OnionStore;
|
|
use crate::prelude::*;
|
|
|
|
#[derive(Debug, Deserialize, Serialize, HasModel)]
|
|
#[model = "Model<Self>"]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct KeyStore {
|
|
pub onion: OnionStore,
|
|
pub local_certs: CertStore,
|
|
#[serde(default)]
|
|
pub acme: AcmeCertStore,
|
|
}
|
|
impl KeyStore {
|
|
pub fn new(account: &AccountInfo) -> Result<Self, Error> {
|
|
let mut res = Self {
|
|
onion: OnionStore::new(),
|
|
local_certs: CertStore::new(account)?,
|
|
acme: AcmeCertStore::new(),
|
|
};
|
|
for tor_key in account.tor_keys.iter().cloned() {
|
|
res.onion.insert(tor_key);
|
|
}
|
|
Ok(res)
|
|
}
|
|
}
|