CLI tool to build web site configuration and obtain SSL certificates from letsencrypt using certbot.
Also provide a simpler way to request SSL certificate over certbot.
#Install from pip
pip2 install sitegencli
#Install from sources
python2 setup.py install
Configuration should have been copied from /usr/local/etc/sitegen
to /etc/sitegen
at install time.
sitegen.json looks like:
{
"siteConfDir": "/etc/apache2/sites-available/",
"siteDir": "/var/",
"confDir": "/etc/sitegen/",
"certRenewTime": 5356800,
"letsencryptCommands": [
{
"patterns": [
"example.com",
"*.example.com"
],
"command": {
"letsencryptCommand": "certbot",
"letsencryptArgs": [
"--agree-tos",
"--text",
"--renew-by-default",
"--webroot",
"--webroot-path",
"/tmp/acme-challenge/",
"certonly"
]
}
},
{
"patterns": "*",
"command": {
"letsencryptCommand": "certbot",
"letsencryptArgs": [
"--agree-tos",
"--text",
"--renew-by-default",
"--authenticator",
"certbot-pdns:auth",
"certonly"
]
}
}
],
"letsencryptDir": "/etc/letsencrypt/live/",
"certDir": "/etc/ssl/private/"
}
Configuration keys:
There’s two types of hooks:
Hooks must be enabled/disabled using --hook-enable
and --hook-disable
arguments. By default, all hooks should be enabled.
Some hooks are provided:
extra/apache/sitegen.conf
, before request/renewal.Templates are used to generate apache site configuration. They are split in two files:
Default templates are default.include and https.conf. Templates can be specified when creating site by using the following syntax:
sitegen --site-create www.example.com:docker.rhttps
Where www.example.com
is the site to create, docker
is the docker.include
template and rhttps
is the rhttps.conf
template.
Generate a site with SSL:
sitegen --site-create example.com:default.https
Request a SSL certificate:
sitegen --cert-request example.com
See sitegen --help
for more.