|  | 8 vuotta sitten | |
|---|---|---|
| .idea | 8 vuotta sitten | |
| extra | 8 vuotta sitten | |
| sitegencli | 8 vuotta sitten | |
| tests | 8 vuotta sitten | |
| .gitignore | 8 vuotta sitten | |
| README.md | 8 vuotta sitten | |
| TODO | 8 vuotta sitten | |
| install | 8 vuotta sitten | |
| requirements.txt | 9 vuotta sitten | |
| setup.cfg | 8 vuotta sitten | |
| setup.py | 8 vuotta sitten | 
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 must be copied from /usr/local/etc/sitegen to /etc/sitegen:
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.
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.