|
certbotbot
Reference documentation for a modular Bash project
|
Renews only one restored Certbot lineage and classifies local changes. More...
Functions | |
| int | certbotbot_renew_sans_read (String cert) |
| Reads a certificate's strict DNS-only SAN set without changing state. | |
| int | certbotbot_renew_sans_match (String cert, String arg) |
| Compares validated actual DNS SANs with the desired set exactly. | |
| int | certbotbot_renew_fingerprint (String config) |
| Computes a stable private digest of all persistent config state. | |
| int | certbotbot_provider_renew (String workspace, String selected, String arg) |
| Renews one existing lineage when due, preserving ordinary no-ops. | |
Variables | |
| IndexedArray | CERTBOTBOT_EXISTING_SANS |
| Canonical DNS names read from a validated existing leaf extension. | |
Renews only one restored Certbot lineage and classifies local changes.
ADR-025 permits normal due-renewal only for an already selected and fully restored lineage with exactly matching current and desired DNS SANs. Path mapping is reversible, and returned result variables reflect only verified local state, never remote S3 publication. ADR-029 broadens valid same-lineage SAN drift while malformed leaf SAN extensions fail closed. The installed Certbot and Route53 plugin retain ACME/DNS authority.
| int certbotbot_provider_renew | ( | String | workspace, |
| String | selected, | ||
| String | arg | ||
| ) |
Renews one existing lineage when due, preserving ordinary no-ops.
A private canonical workspace and its one restored selected lineage must pass local preflight. DNS SANs in the leaf PEM must match requested SANs. A mismatch is an explicit policy failure, not an implicit reissue.
Installed Certbot must list dns-route53 and recognize the exact restored account. The provider maps five canonical renewal path fields to private paths, then invokes 'certbot renew –cert-name NAME' with explicit private directories, account, selected ACME server, noninteractive mode, and hook suppression. It validates resulting lineage and SANs, returns renewal paths to canonical form, and compares durable state fingerprints. It never invokes global renew, register, forced renewal or publication.
CERTBOTBOT_RENEWAL_OCCURRED and CERTBOTBOT_DURABLE_CHANGED are cleared at entry and on failure; on success they are set to true or false. The first indicates whether selected certificate content/link changed. The second detects any changed restored configuration bytes, links or permissions. The caller must still validate a candidate archive prior to remote writes.
| workspace | Owned canonical mode-0700 private runner directory. |
| selected | Stable non-wildcard selected Certbot certificate name. |
| arg | Exact desired distinct literal DNS SANs (one to 100). |
| 0 | Selected-only renewal completed and local state is coherent. |
| 64 | Unsafe workspace, identity or requested SAN set. |
| 65 | Mismatched SANs or inconsistent/unsafe local renewal state. |
| 69 | Installed provider unavailable or account not recognized. |
| 74 | Failed Certbot invocation or local snapshot/staging. |
| int certbotbot_renew_fingerprint | ( | String | config | ) |
Computes a stable private digest of all persistent config state.
GNU tar recursively serializes configuration in name order with fixed modification time, owner and group metadata; permissions, file bytes and symbolic-link targets remain part of the digest. GNU sha256sum hashes the byte stream; neither stream nor hash is emitted outside the caller. This is local change detection, not a filesystem transaction or lock.
| config | Private Certbot configuration directory to inspect. |
| 0 | Snapshot completed successfully. |
| 1 | A required tool or tar/hash stage failed. |
| int certbotbot_renew_sans_match | ( | String | cert, |
| String | arg | ||
| ) |
Compares validated actual DNS SANs with the desired set exactly.
A strict structural read occurs before set comparison. DNS identities may belong to unrelated apexes, with ordering irrelevant. This predicate is not sufficient to distinguish malformed from merely different old SANs; callers authorizing reconciliation MUST first use certbotbot_renew_sans_read.
| cert | Absolute readable existing leaf PEM path. |
| arg | One to 100 distinct canonical desired DNS SAN strings. |
| 0 | Actual and requested DNS SAN sets match. |
| 1 | Invalid leaf/desired SANs or differing sets. |
| int certbotbot_renew_sans_read | ( | String | cert | ) |
Reads a certificate's strict DNS-only SAN set without changing state.
A supported OpenSSL extension has an exact ordinary or critical SAN header and one comma-separated line of DNS entries. Missing, unsupported, duplicated, malformed, excessive or non-DNS entries are rejected before certificate mutation. The parser does not compare against requested SANs: valid-but-different and invalid-existing state must remain distinguishable during reconciliation.
| cert | Absolute readable existing leaf PEM path. |
| 0 | Existing SAN list is canonical, DNS-only, nonempty and distinct. |
| 1 | No valid supported SAN extension was available. |
| CERTBOTBOT_EXISTING_SANS |
Canonical DNS names read from a validated existing leaf extension.
Reset on every read. No private certificate bytes are printed to the caller. This array is an internal transient result, not durable state.
Bash variable: read-write indexed_array