Robin Thoni b72028cb6d removed unused import | 7 anos atrás | |
---|---|---|
.idea | 8 anos atrás | |
extra | 7 anos atrás | |
sitegencli | 7 anos atrás | |
tests | 7 anos atrás | |
.gitignore | 7 anos atrás | |
README.md | 7 anos atrás | |
TODO | 8 anos atrás | |
install | 8 anos atrás | |
requirements.txt | 8 anos atrás | |
setup.cfg | 7 anos atrás | |
setup.py | 7 anos atrás |
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.