ctrlaltcoop / certbot-dns-hetzner

Certbot plugin enabling dns-01 challenge on the Hetzner DNS API
Other
155 stars 24 forks source link

OS packaged Certbot #23

Closed Giga-Pudding closed 4 months ago

Giga-Pudding commented 10 months ago

Hello,

for OS packaged versions of Certbot, there doesn't seem to be a python environment (in my case Debian 12). /usr/lib/python3/dist-packages/certbot/

Is there any way to use this plugin with packaged versions of certbot? Maybe by simply copying files to the correct location?

Thanks & best regards!

banchaa commented 4 months ago

You could install python3-pip directly within Debian and then run ''pip install certbot-dns-hetzner''. After installation add an additional parameter to the certbot command: "--plugin-dir /path/to/plugin/directory". BUT, that is not recommended, because you might introduce broken dependencies with packages already installed by the system.

The recommended way:

  1. Uninstall the Debian package: You can choose to uninstall the Debian package of Certbot to avoid confusion or conflicts, although this is not strictly necessary if you use a virtual environment. If you decide to uninstall it, you can do so with the following command:
    sudo apt-get remove certbot
  2. Install Python virtual environment tools: If you haven't already installed the virtualenv package, you can do so with:
    sudo apt-get install virtualenv
  3. Create a virtual environment: Choose a directory where you want to create your virtual environment and run:
    virtualenv -p python3 /path/to/your/virtualenv

    Replace /path/to/your/virtualenv with the path where you want to create the virtual environment.

  4. Activate the virtual environment: Before installing Certbot and the plugin, you need to activate the virtual environment:
    source /path/to/your/virtualenv/bin/activate
  5. Install Certbot and the plugin: Now that you're in the virtual environment, you can install Certbot and the Hetzner plugin using pip:
    pip install certbot certbot-dns-hetzner

Both, the Debian and PIP packages store the certificates in the same paths.