|
certbotbot
Reference documentation for a modular Bash project
|
Verifies local ACME account presence and selected-lineage coherence. More...
Functions | |
| int | certbotbot_ca_select () |
| Binds the ordinary issuer to exactly one supported Let's Encrypt CA. | |
| int | certbotbot_state_account (String config) |
| Requires one unambiguous account for the selected ACME environment. | |
| int | certbotbot_state_hooks (String config) |
| Rejects archived hook configuration and executable hook directories. | |
| int | certbotbot_state_lineage_one (String config, String name) |
| Verifies one complete lineage's relative links and local member types. | |
| int | certbotbot_state_lineage (String config, String selected) |
| Inventories every valid lineage and classifies one selected target. | |
| int | certbotbot_state_inventory (String config, String selected) |
| Inventories and canonically validates every archived lineage. | |
| int | certbotbot_state_canonical_all (String config, String selected) |
| Verifies canonical renewal metadata for every stored certificate. | |
| int | certbotbot_state_unselected_fingerprint (String config, String selected) |
| Hashes unchanged lineage payloads outside the selected namespace. | |
| int | certbotbot_state_preflight (String config, String selected) |
| Verifies restored account and selected lineage without side effects. | |
Variables | |
| IndexedArray | CERTBOTBOT_ARCHIVED_NAMES |
| Sorted exact identities from the validated restored archive. | |
Verifies local ACME account presence and selected-lineage coherence.
This module enforces the read-only preflight contract in ADR-023. Archive format verification and safe extraction must already have completed. No restored scripts or configuration are executed or sourced. The checks deliberately do not claim that the account is registered remotely or that canonical renewal metadata has been mapped into a private Certbot runtime.
| int certbotbot_ca_select | ( | ) |
Binds the ordinary issuer to exactly one supported Let's Encrypt CA.
ADR-042 permits an explicit staging selection and retains production as the compatibility default. The selected host and server are derived only from the bounded environment, never from untrusted archive content.
| 0 | Selected host and server are bound. |
| 64 | Invalid CA environment. |
| int certbotbot_state_account | ( | String | config | ) |
Requires one unambiguous account for the selected ACME environment.
The account must occupy the explicitly selected CA directory and contain nonempty, regular registration, key and metadata files. No other account endpoints or competing IDs are allowed in the single-account MVP. The key must have no group/other permissions. Content is never printed or parsed.
| config | Canonical private restored Certbot configuration root. |
| 0 | One local account has the required expected structure. |
| 1 | Account selection or on-disk structure is unsuitable. |
| int certbotbot_state_canonical_all | ( | String | config, |
| String | selected | ||
| ) |
Verifies canonical renewal metadata for every stored certificate.
The selected name is an operation target, not a filter for state safety. Before provider execution and before publication, verify all persisted renewal files against the selected CA account/Route53 dialect. This function must only run when renewal paths are canonical: never between selected prepare/finalize operations. The read-only mapper uses ordinary structural preflight and does not rewrite any renewal file in verify mode.
| config | Canonical owned restored configuration directory. |
| selected | Exact validated current selected lineage name. |
| 0 | Every archived lineage has canonical supported metadata. |
| 65 | Any incomplete or noncanonical archive state. |
| int certbotbot_state_hooks | ( | String | config | ) |
Rejects archived hook configuration and executable hook directories.
Archived hook command execution is excluded from the MVP. A cli.ini file can inject arbitrary Certbot options and is therefore refused. Empty renewal-hooks directories may exist, but no non-directory members are allowed. A later version may add reviewed compatibility for specific inert options; this version fails closed.
| config | Canonical private restored configuration root. |
| 0 | No disallowed global hook options or scripts were found. |
| 1 | Unexpected hook content or unsafe configuration was found. |
| int certbotbot_state_inventory | ( | String | config, |
| String | selected | ||
| ) |
Inventories and canonically validates every archived lineage.
Derives case-sensitive names from regular renewal configuration members, then requires the existing full account, hook, triplet and canonical renewal-metadata preflight to accept the whole workspace. The selected identity is an optional already-validated target; when omitted, the first archived identity is used only as a read-only preflight reference. No synthetic certificate identity is created. An account-only archive is supported only with an explicit selected identity for issuance. Runs in C locale to produce a deterministic lexical order independent of runner configuration; no raw archive material is emitted.
| config | Private restored mode-0700 Certbot configuration root. |
| selected | Exact ordinary selected name or empty for domainless bulk. |
| 0 | All archived identities and account metadata are valid. |
| 64 | Invalid selected identity or configuration root. |
| 65 | Malformed state or zero lineages in domainless bulk mode. |
| int certbotbot_state_lineage | ( | String | config, |
| String | selected | ||
| ) |
Inventories every valid lineage and classifies one selected target.
An account-only archive may omit all lineage trees. All non-README members in renewal/, live/ and archive/ must have complete matching triplets. Every name is validated separately, so an unrelated existing certificate cannot be silently dropped or chosen by SAN overlap. This read-only check validates the local structure of every stored lineage and reports whether the exact selected lineage is present or absent; canonical renewal metadata is separately verified using certbotbot_state_canonical_all.
| config | Private restored configuration root. |
| selected | Validated non-wildcard certificate name. |
| 0 | Every stored lineage is complete; selected is absent or present. |
| 1 | Unsupported, ambiguous or partial stored lineage inventory. |
| int certbotbot_state_lineage_one | ( | String | config, |
| String | name | ||
| ) |
Verifies one complete lineage's relative links and local member types.
The caller has inventoried all top-level renewal/live/archive names. This read-only check never uses contents of archived renewal configuration as shell code. Every live link must target its own matching archive subtree, not another certificate's versioned PEM or an absolute path.
| config | Private restored configuration root. |
| name | Validated non-wildcard Certbot lineage name. |
| 0 | Complete and safe supported lineage structure. |
| 1 | Partial or unsafe files, links, hooks or member types. |
| int certbotbot_state_preflight | ( | String | config, |
| String | selected | ||
| ) |
Verifies restored account and selected lineage without side effects.
This function is valid only after a private archive restoration. It checks canonical ownership/privacy, a single recognized ACME account, absence of archived hook execution, and one coherent selected lineage. Result is set in CERTBOTBOT_LINEAGE_STATE and cleared on all failures. It never invokes Certbot/AWS, reads the host account, or writes to S3.
| config | Absolute canonical path of the private restored config root. |
| selected | Validated non-wildcard certificate name. |
| 0 | Local account structure and selected lineage are unambiguous. |
| 64 | Invalid caller path or certificate name. |
| 65 | Local restored state is missing, ambiguous, or unsafe. |
| int certbotbot_state_unselected_fingerprint | ( | String | config, |
| String | selected | ||
| ) |
Hashes unchanged lineage payloads outside the selected namespace.
Includes all other lineages' renewal configs, versioned PEMs, private-key permissions and live symlink targets. A normalized tar stream is hashed without writing or logging certificate or account material. This digest detects unintended changes to unselected state across a selected provider call; it is not a lock or cryptographic proof of remote S3 atomicity.
| config | Restored private Certbot configuration tree. |
| selected | Selected lineage name to exclude from this digest. |
| 0 | Stable digest calculated for complete archive inventory. |
| 1 | Tooling or state inspection unavailable. |
| CERTBOTBOT_ARCHIVED_NAMES |
Sorted exact identities from the validated restored archive.
This transient array is only used by explicit ADR-058 bulk maintenance. Names come from complete renewal/live/archive triplets; the ordinary selected-only lifecycle does not use it.
Bash variable: read-write indexed_array