|
certbotbot
Reference documentation for a modular Bash project
|
Creates private workspaces and stages validated Certbot archives. More...
Functions | |
| int | certbotbot_workspace_create () |
| Creates a new owned 0700 workspace on the local filesystem. | |
| int | certbotbot_archive_restore (String archive, String workspace) |
| Restores supported archive bytes into an inactive config directory. | |
Creates private workspaces and stages validated Certbot archives.
This adapter implements the inactive restoration boundary in ADR-022. It never extracts into the host's /etc/letsencrypt directory, evaluates restored content, calls Certbot, or accesses S3. A preflighted archive is copied into a new private staging directory before GNU tar sees its bytes. The orchestrator owns removal of the workspace after the full operation.
| int certbotbot_archive_restore | ( | String | archive, |
| String | workspace | ||
| ) |
Restores supported archive bytes into an inactive config directory.
Accepts an owned, canonical, empty-target workspace with mode 0700. Copies the archive into a fresh 0700 child, validates that precise copy before extraction, and extracts it under an inactive staging root with GNU tar without stored ownership. Since archive validation has already rejected group/world-writable and unsafe member modes, safe original file/directory permissions are retained inside the private staging tree instead of being silently narrowed by the caller's umask on each restore/republication. This preserves unselected lineages' permission metadata under ADR-030. On success, a rename installs the staging directory at WORKSPACE/config; on any error only adapter-owned staging is removed. The workspace and unrelated files are preserved. No secret data or untrusted tar error text is printed.
The format validator accepts only constrained member types and links. The extractor confirms the resulting filesystem contains only regular files, directories, and resolvable symlinks, and no group/world-writable data. Caller must still verify registered ACME account and renewal configuration (including execution hooks and path remapping).
| archive | Readable non-symlink archive path. |
| workspace | Canonical new absolute directory, owned and mode 0700. |
| 0 | An isolated WORKSPACE/config directory was prepared. |
| 64 | Invalid workspace, arguments, or existing target. |
| 65 | Archive failed format or post-extraction checks. |
| 74 | Local extraction or staging failed. |
| int certbotbot_workspace_create | ( | ) |
Creates a new owned 0700 workspace on the local filesystem.
A fresh directory is allocated using mktemp, with a private umask. Ownership and final lifecycle cleanup belong to the invoking process. This helper does not delete any previously created workspace.
| 0 | The private workspace was created. |
| 74 | A private workspace could not be allocated. |