|
certbotbot
Reference documentation for a modular Bash project
|
Performs guarded, opt-in dated S3 backup publication. More...
Functions | |
| int | certbotbot_backup_error (String message, String status) |
| Report a static backup failure without exposing AWS or secret data. | |
| int | certbotbot_backup_scope (String current) |
| Build nonsecret v1 metadata binding the current key and UTC date. | |
| int | certbotbot_backup_head (String workspace, String bucket, String key) |
| Inspect one exact key and return seven bounded tab-delimited fields. | |
| int | certbotbot_backup_head_valid (String row, String expected_size) |
| Validate the S3 v1 managed-object identity and payload length. | |
| int | certbotbot_backup_prepare (String workspace, String bucket, String current, String backup) |
| Validate destination and conditional-write capability before current PUT. | |
| int | certbotbot_backup_publish (String workspace, String bucket, String backup, String candidate, String content_type) |
| Write and verify the identical validated current candidate. | |
Performs guarded, opt-in dated S3 backup publication.
Implements ADR-033. The selected existing archive remains authoritative. This module verifies managed metadata, conditions every backup PUT on the exact destination's prior identity, and confirms the resulting object size and metadata through HEAD. It never lists, deletes or migrates objects. S3 metadata is untrusted; IAM protections and externally serialized writers are essential. No two-object transaction is promised.
| int certbotbot_backup_error | ( | String | message, |
| String | status | ||
| ) |
Report a static backup failure without exposing AWS or secret data.
| message | Fixed nonsecret diagnostic text. |
| status | 64 for local settings, 69 for inspection, 74 for partial PUT. |
| 64 | Local configuration error. |
| 69 | Uncertain remote preflight. |
| 74 | Current accepted but backup failed/uncertain. |
| int certbotbot_backup_head | ( | String | workspace, |
| String | bucket, | ||
| String | key | ||
| ) |
Inspect one exact key and return seven bounded tab-delimited fields.
Uses a fixed JMESPath query over S3 metadata, never eval or shell parsing of untrusted expressions. A 404 is available privately to the caller; unknown, malformed or multi-line responses must not authorize mutation.
| workspace | Existing private workspace. |
| bucket | Exact selected bucket. |
| key | Exact resolved backup key. |
| 0 | One bounded nonempty row. |
| 1 | HeadObject failed, private stderr contains reason. |
| 2 | Invalid output or occupied private paths. |
| int certbotbot_backup_head_valid | ( | String | row, |
| String | expected_size | ||
| ) |
Validate the S3 v1 managed-object identity and payload length.
| row | Untrusted AWS metadata row. |
| expected_size | 0 for positive-size preflight or exact post-PUT size. |
| 0 | Identity, nonzero size, and safe ETag are confirmed. |
| 1 | Unverified, mismatched or malformed fields. |
| int certbotbot_backup_prepare | ( | String | workspace, |
| String | bucket, | ||
| String | current, | ||
| String | backup | ||
| ) |
Validate destination and conditional-write capability before current PUT.
A 404 plus HeadBucket success authorizes only conditional creation. Present same-date managed metadata authorizes only ETag-conditional replacement. All other identities, CLI capabilities or AWS errors fail before the authoritative current object is modified.
| workspace | Private workspace. |
| bucket | Current/backup bucket. |
| current | Authoritative exact key. |
| backup | Validated dated key. |
| 0 | Guarded backup conditions prepared. |
| 64 | Invalid local values. |
| 69 | Missing capability or uncertain destination. |
| int certbotbot_backup_publish | ( | String | workspace, |
| String | bucket, | ||
| String | backup, | ||
| String | candidate, | ||
| String | content_type | ||
| ) |
Write and verify the identical validated current candidate.
The current authoritative PUT must already have succeeded. A failed PUT, lost response, conflicting conditional request, missing or uncertain HEAD results in a nonzero partial-success outcome and stops all later work.
| workspace | Caller-owned private workspace. |
| bucket | Selected existing S3 bucket. |
| backup | Frozen dated key. |
| candidate | Exact locally verified candidate file. |
| content_type | Existing publisher's matching MIME type. |
| 0 | Accepted backup PUT and matching HEAD metadata/size. |
| 74 | Accepted current but failed or uncertain backup publication. |
| int certbotbot_backup_scope | ( | String | current | ) |
Build nonsecret v1 metadata binding the current key and UTC date.
| current | Frozen authoritative object key. |
| 0 | Complete metadata prepared. |
| 64 | Invalid identity or missing trusted hashing tool. |