|
certbotbot
Reference documentation for a modular Bash project
|
Builds and validates one private portable Certbot archive candidate. More...
Functions | |
| int | certbotbot_archive_package (String workspace, String selected) |
| Builds one validated gzip tar candidate from selected durable state. | |
Builds and validates one private portable Certbot archive candidate.
Implements ADR-027: only a complete selected lineage, safe existing selected CA account, and all canonical renewal configurations can enter the candidate stage. Source state is never rewritten to validate paths. GNU tar/gzip serializes config contents, and the existing bounded archive validator checks the exact bytes before the candidate appears.
The builder does not execute Certbot, use S3, authorize publication, or decide whether a successful no-op must be uploaded. The lifecycle owns the private workspace, verifies certificate cryptography separately, and removes all local candidate material after the operation.
| int certbotbot_archive_package | ( | String | workspace, |
| String | selected | ||
| ) |
Builds one validated gzip tar candidate from selected durable state.
Requires a canonical owned mode-0700 workspace with a complete WORKSPACE/config tree and an absent WORKSPACE/candidate.tar.gz. The account/lineage preflight must find the selected lineage present, while permitting other complete lineages. Every archived lineage is validated canonically before serializing the full unchanged configuration tree. The existing renewal parser's verify mode requires the five persisted path values to refer to canonical /etc/letsencrypt, and rejects unsupported metadata without modifying any source file. Selected private-key PEMs may not be readable by anyone other than the owner.
GNU tar writes to an owned mode-0600 staging file using ustar headers, sorted member order and fixed numeric ownership. Only relative configuration contents are archived, retaining live PEM symlinks, versioned keys, account data and renewal configuration. Unsupported tar names, member types or permissions fail the shared pre-extraction validator. The temporary file is removed on failure; after successful validation it is renamed into the single fixed candidate path.
The final candidate has not been cryptographically validated as a certificate and has not been uploaded. Consumers must separately prove usable certificate material and enforce the single-key publication policy and remote error semantics.
| workspace | Canonical absolute caller-owned mode-0700 workspace. |
| selected | Stable selected non-wildcard certificate lineage name. |
| 0 | One verified private candidate is present. |
| 64 | Invalid workspace, name, or occupied candidate path. |
| 65 | Unsafe source account, lineage, metadata, or candidate format. |
| 74 | Local private staging or tar/gzip operation failed. |