Certbot Deployer plugin for deploying certificate bundles over SSH
Project description
certbot_deployer_ssh
Certbot Deployer plugin for deploying certificate bundles over SSH via Certbot "deploy hook."
Requires
- Python 3.9+
Installation
You can install with pip:
python3 -m pip install certbot_deployer_ssh
Or install from source:
git clone <url>
pip install certbot_deployer_ssh
Usage
This tool expects to run as a Certbot deploy hook, and for the environment variable RENEWED_LINEAGE to point to the live certificate directory just updated/created by Certbot.
Any existing certificate bundle under the same Common Name on the remote will be overwritten.
Examples
## Deposit the certificate bundle directory into a remote path on a host
certbot-deployer ssh --host host.domain.tld --destination-path=/path/to/wherever
## Upload the certificate bundle directory
and run arbitrary commands before and after
certbot-deployer ssh --pre-cmd "touch /some/file" --host host.domain.tld \
--post-cmd "chown user:grp /path/to/file"
Config
Arguments can be passed directly when calling this tool or configured in the Certbot Deployer configuration file (/etc/certbot_deployer/certbot_deployer.conf)
Reference
usage: certbot-deployer ssh [-h] [--host HOST] [--remote-dir REMOTE_DIR]
[--pre-cmd PRE_CMD] [--post-cmd POST_CMD]
[--mode MODE]
BIG-IP subcommand
Certbot Deployer plugin for deploying certificate bundles over SSH
options:
-h, --help show this help message and exit
--host, -H HOST SSH host to target
--remote-dir, -d REMOTE_DIR
Remote destination path in which to drop the
certificate bundle directory. This tool will not
attempt to create the path if it does not exist. If
not provided, it will be up to the server - that
usually ends up being the user's home directory.
--pre-cmd PRE_CMD A command to run before uploading the certificate
bundle. Can be passed multiple times.
--post-cmd POST_CMD A command to run after uploading the certificate
bundle. Can be passed multiple times.
--mode, -m MODE Mode to apply to the remote certificate bundle
directory on upload. Defaults to `0700`.
This tool expects to run as a Certbot deploy hook, and for the
environment variable `RENEWED_LINEAGE` to point to the live
certificate directory just updated/created by Certbot.
Any existing certificate bundle under the same Common Name on the
remote will be overwritten.
# Credentials
SSH credentials should be determined by the user's SSH config, e.g.:
# /home/user/.ssh/config
Host host.domain.tld
user deploy_user
IdentityFile /path/to/key
See the Fabric library's documentation on SSH configuration for more:
https://docs.fabfile.org/en/latest/concepts/configuration.html
Contributing
Merge requests are welcome. You should probably open an issue first to discuss what you would like to change.
To run the test suite:
# Dependent targets create venv and install dependencies
make
Please make sure to add/update tests along with any changes.
License
License :: OSI Approved :: MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file certbot_deployer_ssh-0.1.0.tar.gz.
File metadata
- Download URL: certbot_deployer_ssh-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d31e9392e0a76c6033ee0fb3d20fc2182a96015a70f5e65d4d3f304c1221317
|
|
| MD5 |
918c34f67f054f81a124b2372fa172d3
|
|
| BLAKE2b-256 |
9aeffe94b41ed4a9cc35df222fa958c2ee89c90682e496f3b1324074fcc5140a
|
File details
Details for the file certbot_deployer_ssh-0.1.0-py3-none-any.whl.
File metadata
- Download URL: certbot_deployer_ssh-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15cbd7a048a97a635396bb6fcf2fa96cebd78c10d95081adb72a554242fda175
|
|
| MD5 |
b78337cc78b1e4f27d1fb867528b8ed5
|
|
| BLAKE2b-256 |
612cf5ba830a471596a516341f946efde5fe0f018bca3ec34e270d8fb37e8d1d
|