From 586ced4e84a5831cef9870194ee2f94efa026492 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 7 Dec 2015 11:49:49 +0100 Subject: Alternative config format --- acme.conf | 42 ++++++++++++++++++++++++++++++++++++++++++ acme.toml | 6 +++--- cmd/acme/config.go | 4 ++-- 3 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 acme.conf diff --git a/acme.conf b/acme.conf new file mode 100644 index 0000000..7c2205c --- /dev/null +++ b/acme.conf @@ -0,0 +1,42 @@ +# provider definitions +provider lev1 \ + directory https://acme-v01.api.letsencrypt.org/directory +provider les \ + directory https://acme-staging.api.letsencrypt.org/directory + +# account definitions +account another@example.com \ + key /etc/another.key \ + provider les + +# domain definitions +domain www.example.com \ + altnames { example.com, www2.example.com } \ + key "/etc/ssl/private/www_example_com.key" \ + cert "/etc/ssl/cert/www_example_com.pem" \ + webroot "/var/www/htdocs" \ + account another@example.com \ + gracetime 1 week \ + hook nginx + + +# domains with prefix www imply altname without www +domain www.example.net \ + key "/etc/ssl/private/www_example_net.key" \ + cert "/etc/ssl/cert/www_example_net.pem" \ + account another@example.com + +domain mail.example.com \ + key "/etc/ssl/private/mail_example_com.key" \ + cert "/etc/ssl/cert/mail_example_com.pem" \ + account another@example.com \ + gracetime 1 week \ + hook dovecot + +# hook definitions +hook nginx \ + cmd "sudo service nginx reload" + +hook dovecot \ + cmd "sudo service dovecot reload" + diff --git a/acme.toml b/acme.toml index eb801ce..9791fb0 100644 --- a/acme.toml +++ b/acme.toml @@ -3,16 +3,16 @@ mail = "another@example.com" key = "/etc/acme.key" provider = "https://acme-staging.api.letsencrypt.org/directory" -[[account.want]] +[[want]] domains = [ "www.example.com", "example.com" ] cert = "/etc/certs/www_example_com.pem" key = "/etc/private/www_example_com.key" # webroot = /var/www/htdocs -[[account.want]] +[[want]] domains = [ "www.example.net", "example.net" ] cert = "/etc/certs/www_example_net.pem" key = "/etc/private/www_example_net.key" -[[account.hook]] +[[hook]] cmd = "sudo service nginx reload" diff --git a/cmd/acme/config.go b/cmd/acme/config.go index b4d09ad..46305d6 100644 --- a/cmd/acme/config.go +++ b/cmd/acme/config.go @@ -8,14 +8,14 @@ import ( type Config struct { Account []Account + Want []Want + Hook []Hook } type Account struct { Mail string Key string Provider string - Want []Want - Hook []Hook } type Want struct { -- cgit v1.2.3