aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-02-15 19:37:37 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-02-15 19:37:37 +0100
commit16b28db4e520af08c9fa3ce463e9a7e5b967ab6e (patch)
tree303e5def78556aba41f383aadd7eeb365649c506
parent213353385e78880c54f82ab61d3be5b590e51901 (diff)
Expand home
-rw-r--r--cmd/acme/config.go8
-rw-r--r--cmd/acme/dim13.yaml12
2 files changed, 12 insertions, 8 deletions
diff --git a/cmd/acme/config.go b/cmd/acme/config.go
index 326c8ff..e291f4b 100644
--- a/cmd/acme/config.go
+++ b/cmd/acme/config.go
@@ -3,6 +3,7 @@ package main
import (
"errors"
"io/ioutil"
+ "os/user"
"path"
"strings"
"time"
@@ -61,6 +62,13 @@ func LoadConfig(fname string) (*Config, error) {
if err != nil {
return nil, err
}
+ if c.Basedir != "" && strings.HasPrefix(c.Basedir, "~") {
+ usr, err := user.Current()
+ if err != nil {
+ return nil, err
+ }
+ c.Basedir = path.Join(usr.HomeDir, c.Basedir[1:])
+ }
// apply defaults
if c.KeySize == 0 {
c.KeySize = defKeySize
diff --git a/cmd/acme/dim13.yaml b/cmd/acme/dim13.yaml
index ce04367..d98f1cb 100644
--- a/cmd/acme/dim13.yaml
+++ b/cmd/acme/dim13.yaml
@@ -1,11 +1,8 @@
-defaults:
- listen: localhost:8080
- listentls: localhost:8443
- basedir: /home/demon/.acme
- keysize: 2048
+listen: localhost:8080
+listentls: localhost:8443
+basedir: ~/.acme
provider:
- letsencrypt:
- directory: https://acme-v01.api.letsencrypt.org/directory
+ letsencrypt: https://acme-v01.api.letsencrypt.org/directory
account:
postmaster:
mail: postmaster@dim13.org
@@ -35,4 +32,3 @@ desire:
- dim13.org
key: private/www_dim13_org.key
cert: certs/www_dim13_org.pem
-