Skip to main content

Lego Certificate

@zts/lego-certificatev2026.11.01.1· MIT· 20d agoBEHAVIORSACCEPTED WARNINGS
01README

One ACME certificate (Let's Encrypt, ZeroSSL, Google Trust Services or any ACME CA), issued and renewed with the lego v5 CLI through any of lego's DNS-01 providers. Swamp keeps lego's state: each run restores the account and certificate into a fresh temporary directory, runs lego, saves what changed (the private key as a sensitive field in a vault) and deletes the directory, so nothing persists on the host. apply issues or renews when due, status reports validity, revoke revokes with the issuing CA. DNS credentials reach lego only through its environment. Needs lego 5 on the host.

02Behaviors1
@zts/lego-certificatev2026.11.01.1lego_certificate.ts

Global Arguments

ArgumentTypeDescription
domainsarrayNames the certificate covers; wildcards such as *.example.com allowed
certName?stringlego's name for the certificate; default the first domain, * as _
email?emailACME account contact; also the account id. Without it the id is 'swamp'
server?urlACME directory URL (lego shortcodes are not accepted)
keyType?enumKey type of the certificate's private key
profile?stringACME profile to request, when the CA offers profiles
preferredChain?stringIssuer common name of the chain to prefer
renewDays?intRenew when fewer days than this remain; default lego's dynamic window
eabKid?stringExternal Account Binding key id, for CAs that require it
eabHmac?stringExternal Account Binding HMAC key; from a vault
dnsProviderstringlego DNS provider code, e.g. mythicbeasts, cloudflare, route53
dnsEnv?recordNon-secret provider settings, by environment variable name
dnsSecretEnv?recordProvider credentials, by environment variable name; from a vault
dnsResolvers?arrayResolvers for propagation checks, as host:port
dnsTimeout?intDNS query timeout in seconds
dnsPropagationWait?stringSkip propagation checks and wait this long instead, e.g. 90s
dnsPropagationDisableAns?booleanDo not wait for the authoritative name servers
dnsPropagationDisableRns?booleanDo not wait for the recursive resolvers
ambientCredentials?booleanGive lego swamp's whole environment, for credential chains
legoPath?stringThe lego 5 binary, by path or name on PATH
timeoutSeconds?intHow long one lego run may take
fn apply(forceRenew?: boolean)
Issue the certificate, or renew it when lego says it is due, and
ArgumentTypeDescription
forceRenew?booleanRenew now even when the certificate is not due
fn status()
Log the stored certificate's validity; calls nothing
fn revoke(reason?: int)
Revoke the stored certificate with the CA that issued it
ArgumentTypeDescription
reason?intRFC 5280 revocation reason code

Resources

account(infinite)— An ACME account lego registered, one per CA and account id
certificate(infinite)— The current certificate, its key and lego's files for it

Files

log(text/plain)— lego's output from the last run
03Stats
A
100 / 100
Downloads
23
Archive size
24.1 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned

05Platforms
06Labels