Add example plugin from certbot source, and notes for running with certbot docker container

master
Michael Porter 2018-03-12 16:22:04 +00:00
commit 0e2e4c9be7
4 changed files with 57 additions and 0 deletions

6
.gitignore vendored 100644
View File

@ -0,0 +1,6 @@
*.pyc
*.pyo
*.swp
*.swo
*.egg-info

View File

@ -0,0 +1,31 @@
"""Example Certbot plugins.
For full examples, see `certbot.plugins`.
"""
import zope.interface
from certbot import interfaces
from certbot.plugins import common
@zope.interface.implementer(interfaces.IAuthenticator)
@zope.interface.provider(interfaces.IPluginFactory)
class Authenticator(common.Plugin):
"""Example Authenticator."""
description = "Example Authenticator plugin"
# Implement all methods from IAuthenticator, remembering to add
# "self" as first argument, e.g. def prepare(self)...
@zope.interface.implementer(interfaces.IInstaller)
@zope.interface.provider(interfaces.IPluginFactory)
class Installer(common.Plugin):
"""Example Installer."""
description = "Example Installer plugin"
# Implement all methods from IInstaller, remembering to add
# "self" as first argument, e.g. def get_all_names(self)...

View File

@ -0,0 +1,17 @@
from setuptools import setup
setup(
name='certbot-example-plugins',
package='certbot_example_plugins.py',
install_requires=[
'certbot',
'zope.interface',
],
entry_points={
'certbot.plugins': [
'example_authenticator = certbot_example_plugins:Authenticator',
'example_installer = certbot_example_plugins:Installer',
],
},
)

3
notes.txt 100644
View File

@ -0,0 +1,3 @@
docker run -it --rm --entrypoint /bin/sh -v "$(pwd)/certbot-example-plugins:/tmp/certbot-example-plugins" certbot/certbot:v0.22.0
certbot plugins
pip install -e /tmp/certbot-example-plugins