Hi! I'm trying to develop a certbot plugin to automate the process of getting wildcard certificates for domains provided by DreamHost.
I have already wrote the plugin and released it to pypi:
- GitHub - goncalo-leal/certbot-dns-dreamhost: Certbot plugin to authenticate DreamHost domains
- certbot-dns-dreamhost · PyPI
I guess that my problem must be in setup.py
, but I can't understand whats wrong.
I have based my plugin on others such as:
- GitHub - vshosting/certbot-dns-clouddns: CloudDNS Authenticator plugin for Certbot
- certbot/certbot-dns-cloudflare at master · certbot/certbot · GitHub
I have installed certbot using snapd:
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -sf /snap/bin/certbot /usr/bin/certbot
Then I installed my package using sudo pip install certbot-dns-dreamhost
Until this point I think I made no mistakes in the instalation, but when I run sudo certbot plugins
to check if my plugin has installed correctly I get the error:
An unexpected error occurred:
ModuleNotFoundError: No module named 'certbot_dns_dreamhost'
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /tmp/certbot-log-g7d5c__k/log or re-run Certbot with -v for more details.
And if I check the content from the file with cat /tmp/certbot-log-g7d5c__k/log
2022-11-18 20:44:38,355:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
File "/usr/local/bin/certbot", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/dist-packages/certbot/main.py", line 19, in main
return internal_main.main(cli_args)
File "/usr/local/lib/python3.10/dist-packages/certbot/_internal/main.py", line 1705, in main
plugins = plugins_disco.PluginsRegistry.find_all()
File "/usr/local/lib/python3.10/dist-packages/certbot/_internal/plugins/disco.py", line 241, in find_all
plugin_ep = cls._load_entry_point(entry_point, plugins, with_prefix=False)
File "/usr/local/lib/python3.10/dist-packages/certbot/_internal/plugins/disco.py", line 261, in _load_entry_point
plugin_ep = PluginEntryPoint(entry_point, with_prefix)
File "/usr/local/lib/python3.10/dist-packages/certbot/_internal/plugins/disco.py", line 60, in __init__
self.plugin_cls: Type[interfaces.Plugin] = entry_point.load()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2465, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2471, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'certbot_dns_dreamhost'
2022-11-18 20:44:38,355:ERROR:certbot._internal.log:An unexpected error occurred:
I think the problem is in the setup.py file:
from setuptools import setup
from setuptools import find_packages
VERSION = "0.2.2"
install_requires = [
"acme>=0.29.0",
"certbot>=0.34.0",
"setuptools",
"requests",
"mock",
"requests-mock",
]
setup(
name="certbot-dns-dreamhost",
version=VERSION,
description="DreamHost DNS Authenticator plugin for Certbot",
url="https://github.com/goncalo-leal/certbot-dns-dreamhost",
author="Gonçalo Leal",
author_email="goncalolealsilva@ua.pt",
license="Apache License 2.0",
package="src/certbot_dns_dreamhost",
include_package_data=True,
install_requires=install_requires,
entry_points={
"certbot.plugins": [
"dns-dreamhost = certbot_dns_dreamhost.dns_dreamhost:Authenticator"
]
},
)
Maybe my question is stupid, but I really can't understand what I'm doing wrong.
Hope someone can help me