Expand description
ACME automatic certificate management
Provides zero-config TLS via Let’s Encrypt and compatible CAs.
§Features
- Automatic certificate issuance and renewal
- HTTP-01 challenge handling
- DNS-01 challenge support for wildcard certificates
- Modular DNS provider system (Hetzner, webhook)
- Persistent storage for certificates and account credentials
- Background renewal scheduler
§Architecture
The ACME module consists of five main components:
AcmeClient- Wrapper aroundinstant-acmefor ACME protocol operationsCertificateStorage- Persistent storage for certificates and account keysChallengeManager- Manages pending HTTP-01 challenges for servingdns- DNS-01 challenge support with pluggable providersRenewalScheduler- Background task for checking and renewing certificates
§Example (HTTP-01)
listener "https" {
address "0.0.0.0:443"
protocol "https"
tls {
acme {
email "admin@example.com"
domains "example.com" "www.example.com"
staging false
storage "/var/lib/sentinel/acme"
renew-before-days 30
}
}
}§Example (DNS-01 for Wildcards)
listener "https" {
address "0.0.0.0:443"
protocol "https"
tls {
acme {
email "admin@example.com"
domains "example.com" "*.example.com"
challenge-type "dns-01"
dns-provider {
type "hetzner"
credentials-file "/etc/sentinel/secrets/hetzner-dns.json"
api-timeout-secs 30
propagation {
initial-delay-secs 10
check-interval-secs 5
timeout-secs 120
}
}
}
}
}§Challenge Flow (HTTP-01)
When a certificate needs to be obtained or renewed:
AcmeClientcreates a new order with the ACME server- For each domain, the ACME server provides a challenge token
ChallengeManagerregisters the token and key authorization- The ACME server validates by requesting
/.well-known/acme-challenge/<token> - Sentinel’s request filter intercepts and returns the key authorization
- Once validated,
AcmeClientfinalizes the order and receives the certificate CertificateStoragepersists the certificate and triggers TLS reload
§Challenge Flow (DNS-01)
For wildcard certificates or when HTTP-01 is not feasible:
AcmeClientcreates a new order with DNS-01 challenges- For each domain,
dns::Dns01ChallengeManagercreates TXT records via the DNS provider dns::PropagationCheckerwaits for DNS propagation- The ACME server validates by querying
_acme-challenge.{domain}TXT records - Once validated,
AcmeClientfinalizes the order and receives the certificate - DNS records are cleaned up, certificate is persisted
Modules§
- dns
- DNS-01 challenge support for ACME
Structs§
- Acme
Client - ACME client for automatic certificate management
- Certificate
Storage - Certificate storage manager
- Challenge
Manager - Manages pending ACME HTTP-01 challenges
- Renewal
Scheduler - Background certificate renewal scheduler
Enums§
- Acme
Error - Errors that can occur during ACME operations