Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

certbot_deployer_ssh-1.0.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

certbot_deployer_ssh-1.0.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file certbot_deployer_ssh-1.0.0.tar.gz.

File metadata

  • Download URL: certbot_deployer_ssh-1.0.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for certbot_deployer_ssh-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b614082fdb11a951ad02d7b6475d23c35d690cad15319e8c7a13cb0051258ac4
MD5 6881216db04a31df7df19cd462520aea
BLAKE2b-256 121c354b8df135725a320dbc87647daf3959fdc6db84187d0e744cddbe7644f7

See more details on using hashes here.

File details

Details for the file certbot_deployer_ssh-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for certbot_deployer_ssh-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6dcf8b589458c4e967863e5b7f6c57b68eae42d4de59c2f53d8eb647e64ead03
MD5 0b3048c5e510f4b3626d9d62e325dede
BLAKE2b-256 73ad28f87617415e1171062958f4b9356c7f393eadae59241678560bf60cd38f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page