pub enum AcmeMode {
Internal,
Anonymous,
WithEmail(String),
Byo {
cert: String,
key: String,
},
}Expand description
What ryra writes into tls.caddy on first install of caddy.
Modeled as an exhaustive enum so callers can’t smuggle a third
state via empty-string sentinels — match on this and the planner,
install message, and snippet renderer stay in agreement.
Variants§
Internal
Self-signed via Caddy’s internal CA (LAN-friendly default). Browsers warn unless ryra’s CA is trusted.
Anonymous
Let’s Encrypt with no registration email — real certs but no renewal-notice email tied to an account.
WithEmail(String)
Let’s Encrypt with a registration email for renewal notices.
Byo
Bring-your-own certificate: Caddy serves the given cert + key files directly, issuing nothing. The right mode behind an upstream proxy that terminates the public TLS (Cloudflare in Full-Strict with an Origin CA cert), or anywhere the operator manages certs out of band.
Implementations§
Source§impl AcmeMode
impl AcmeMode
Sourcepub fn from_email(email: &str) -> Self
pub fn from_email(email: &str) -> Self
Convert a user-supplied Let’s Encrypt email into the matching LE mode: empty (user hit Enter at the prompt) means anonymous LE, anything else means LE with that email for renewal notices.
Sourcepub fn detect_from_snippet(contents: &str) -> Option<Self>
pub fn detect_from_snippet(contents: &str) -> Option<Self>
Best-effort reverse of Self::snippet: looks at the contents
of tls.caddy and recognizes the three ryra-written shapes —
tls internal, tls <email>, or an empty body. Returns None
for user-customized snippets (Cloudflare DNS-01, BYO cert paths,
arbitrary directives) so the install message can fall back to
“user-managed” instead of misclassifying.
Trait Implementations§
impl Eq for AcmeMode
impl StructuralPartialEq for AcmeMode
Auto Trait Implementations§
impl Freeze for AcmeMode
impl RefUnwindSafe for AcmeMode
impl Send for AcmeMode
impl Sync for AcmeMode
impl Unpin for AcmeMode
impl UnsafeUnpin for AcmeMode
impl UnwindSafe for AcmeMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.