use std::path::{Path, PathBuf}; use command_runner::CommandRunner; use symbols::acme::AcmeAccountKey; use symbols::dir::Dir; use symbols::file::File; use symbols::list::List; use symbols::owner::Owner; use symbols::Symbol; pub fn new<'a, R: CommandRunner, C: 'a + AsRef, U: 'a + AsRef + Clone, H: AsRef>( command_runner: &'a R, cert: C, user_name: U, home: H, ) -> impl Symbol + 'a { let path = |rel: &str| [home.as_ref(), rel.as_ref()].iter().collect::(); let account_key_file = path("account.key"); List::from(( AcmeAccountKey::new(account_key_file.clone(), command_runner), Owner::new( account_key_file, user_name.clone(), command_runner, ), Dir::new(path("challenges")), Owner::new( path("challenges"), user_name.clone(), command_runner, ), Dir::new("/etc/ssl/local_certs"), Owner::new("/etc/ssl/local_certs", user_name, command_runner), File::new(path("lets_encrypt_x3_cross_signed.pem"), cert), )) }