|
certbotbot
Reference documentation for a modular Bash project
|
Implements explicit desired-lineage pruning in an isolated archive. More...
Functions | |
| int | certbotbot_orphans_selected_validate (String selected) |
| Confirms the explicit selected identity belongs to the desired set. | |
| int | certbotbot_orphans_survivors_fingerprint (String config, String selected) |
| Fingerprints all retained unselected lineages without archive mutation. | |
| int | certbotbot_orphans_account_fingerprint (String config) |
| Snapshots all existing account material around local pruning only. | |
| int | certbotbot_orphans_material_preflight (String workspace, String name) |
| Checks an original archived certificate without requiring nonexpiry. | |
| int | certbotbot_orphans_plan (String workspace, String config, String selected) |
| Establishes immutable authorized prune targets before provider work. | |
| int | certbotbot_orphans_apply (String workspace, String config, String selected) |
| Deletes only confirmed orphan triplets after successful selected work. | |
Variables | |
| IndexedArray | CERTBOTBOT_ORPHANS_TO_REMOVE |
| Exact confirmed original archived identities excluded from desired set. | |
Implements explicit desired-lineage pruning in an isolated archive.
ADR-059 authorizes bounded deletion of only complete, independently classified orphan certificate lineages from one restored, mode-0700 owned workspace. The desired set is not inferred from SANs, selected identity, existing archive members, or implicit defaults. Complete preflight precedes provider action; a selected operation and its unselected-state integrity check precede pruning. The existing validated one-key publisher is the only remote writer. No host-global Certbot deletion is performed.
No state path in this module comes directly from an unvalidated archive string or a shell glob. The expected post-state is a complete, exact nonempty set and account state is verified to survive local pruning.
| int certbotbot_orphans_account_fingerprint | ( | String | config | ) |
Snapshots all existing account material around local pruning only.
The selected Certbot action may lawfully update account metadata. This function is invoked after that action, and again after local deletion, which itself has no authority to mutate any account directory or files.
| config | Restored owned configuration root. |
| 0 | Existing account tree fingerprinted. |
| 1 | Missing account directory or required hash tooling. |
| int certbotbot_orphans_apply | ( | String | workspace, |
| String | config, | ||
| String | selected | ||
| ) |
Deletes only confirmed orphan triplets after successful selected work.
Receives the immutable plan calculated from the original archive. The selected lifecycle has already verified its provider result, all original nonselected fingerprints, and the selected certificate. This function snapshots retained and account state, checks each deletion boundary against the still-canonical complete workspace, removes literal matching paths only, and validates the exact requested post-inventory. Any failure discards the local candidate and prohibits publication by the caller.
| workspace | Owned isolated private workspace. |
| config | Canonical private Certbot config root. |
| selected | Exact verified selected certificate lineage name. |
| 0 | Pruned state exactly matches desired members, all valid. |
| 65 | Unsafe deletion boundary or post-state mutation. |
| 74 | Local filesystem deletion, fingerprint or verification failed. |
| int certbotbot_orphans_material_preflight | ( | String | workspace, |
| String | name | ||
| ) |
Checks an original archived certificate without requiring nonexpiry.
Expired but structurally authentic certificates remain eligible for an explicitly selected due-renewal or deliberate orphan removal. This read-only preflight validates X.509 PEM syntax, leaf/public-key identity, syntactic chain, and the fullchain's leaf without requiring current validity. Canonical archive state and persisted DNS SANs are checked separately before this call. Temporary comparison files live under the invocation-owned workspace and are removed on every result.
| workspace | Fresh private mode-0700 workspace. |
| name | One original validated non-wildcard archived lineage name. |
| 0 | All original archived certificate material is structurally valid. |
| 65 | Malformed or inconsistent leaf, key or chain. |
| 69 | OpenSSL or compare command is unavailable. |
| int certbotbot_orphans_plan | ( | String | workspace, |
| String | config, | ||
| String | selected | ||
| ) |
Establishes immutable authorized prune targets before provider work.
Inventories and canonicalizes the complete original state, verifies the selected identity and every required nonselected desired identity, then treats only original complete lineages absent from the explicit set as orphans. All existing leaves and private keys are independently checked before destructive authority can proceed. Account-only first issuance is allowed when the explicitly selected name is the sole desired identity. A malformed or unreadable candidate fails rather than being deleted.
| workspace | Owned private restored invocation workspace. |
| config | Canonical private Certbot configuration root. |
| selected | Validated exact selected lineage. |
| 0 | All desired members and orphan candidates are unambiguous. |
| 65 | Missing desired identity or invalid original lineage material. |
| int certbotbot_orphans_selected_validate | ( | String | selected | ) |
Confirms the explicit selected identity belongs to the desired set.
Only a fully valid ordinary selected certificate may anchor a destructive reconciliation. This guard runs after the identity resolver and before the first external S3 operation.
| selected | Resolved non-wildcard selected Certbot lineage name. |
| 0 | Selected identity is an explicitly retained desired member. |
| 64 | Missing, invalid or contradictory destructive authority. |
| int certbotbot_orphans_survivors_fingerprint | ( | String | config, |
| String | selected | ||
| ) |
Fingerprints all retained unselected lineages without archive mutation.
A stable GNU tar stream includes file content, modes, relative symlinks, and historical private-key generations. A selected lineage is deliberately omitted because its ordinary provider operation may modify it.
| config | Restored owned configuration root. |
| selected | Exact selected lineage name to exclude. |
| 0 | Complete digest was calculated. |
| 1 | Invalid input or absent required tooling. |
| CERTBOTBOT_ORPHANS_TO_REMOVE |
Exact confirmed original archived identities excluded from desired set.
Bash variable: read-write indexed_array