|
|
@ -6,6 +6,7 @@ use std::io::{self, Write}; |
|
|
|
|
|
|
|
use command_runner::CommandRunner;
|
|
|
|
use symbols::Symbol;
|
|
|
|
use resources::{FileResource, Resource};
|
|
|
|
|
|
|
|
pub struct AcmeCert<'a> {
|
|
|
|
domain: Cow<'a, str>,
|
|
|
@ -20,10 +21,6 @@ impl<'a> AcmeCert<'a> { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_key_path(&self) -> String {
|
|
|
|
format!("/etc/ssl/private/{}.key", self.domain)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_csr_path(&self) -> String {
|
|
|
|
format!("/etc/ssl/local_certs/{}.csr", self.domain)
|
|
|
|
}
|
|
|
@ -74,6 +71,10 @@ impl<'a> Symbol for AcmeCert<'a> { |
|
|
|
try!(file.write_all(&output.stdout));
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_prerequisites(&self) -> Vec<Box<Resource>> {
|
|
|
|
vec![Box::new(FileResource { path: self.get_csr_path().into() })]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|