aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-03-15 09:28:43 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-03-15 09:28:43 +0100
commitf2727dffe1a81b73178079cc821450510216652b (patch)
tree9d35fc9b0f6edb0d9c0f3209eb65a5737dc54226 /cmd
parentd75d302ca16667dc518390ebb13741a8f5dfd803 (diff)
It's ok to join, when BaseDir is empty
Diffstat (limited to 'cmd')
-rw-r--r--cmd/acme/config.go17
1 files changed, 6 insertions, 11 deletions
diff --git a/cmd/acme/config.go b/cmd/acme/config.go
index 20416bb..91320e7 100644
--- a/cmd/acme/config.go
+++ b/cmd/acme/config.go
@@ -100,11 +100,9 @@ func LoadConfig(fname string) (*Config, error) {
return nil, errNoMail
}
if acc.KeyFile == "" {
- acc.KeyFile = path.Join(keyPath, acc.Mail+".key")
- }
- if c.BaseDir != "" {
- acc.KeyFile = path.Join(c.BaseDir, acc.KeyFile)
+ acc.KeyFile = acc.Mail + ".key"
}
+ acc.KeyFile = path.Join(c.BaseDir, keyPath, acc.KeyFile)
c.Account[i] = acc
for i, dom := range acc.Domain {
if dom.Gracetime != 0 {
@@ -117,17 +115,14 @@ func LoadConfig(fname string) (*Config, error) {
return nil, errNoAltNames
}
dom.Altnames = checkWWW(dom.Altnames)
- d := dom.Altnames[0]
if dom.KeyFile == "" {
- dom.KeyFile = path.Join(keyPath, d+".key")
+ dom.KeyFile = dom.Altnames[0] + ".key"
}
if dom.CrtFile == "" {
- dom.CrtFile = path.Join(crtPath, d+".pem")
- }
- if c.BaseDir != "" {
- dom.KeyFile = path.Join(c.BaseDir, dom.KeyFile)
- dom.CrtFile = path.Join(c.BaseDir, dom.CrtFile)
+ dom.CrtFile = dom.Altnames[0] + ".pem"
}
+ dom.KeyFile = path.Join(c.BaseDir, keyPath, dom.KeyFile)
+ dom.CrtFile = path.Join(c.BaseDir, crtPath, dom.CrtFile)
acc.Domain[i] = dom
}
}