aboutsummaryrefslogtreecommitdiff
path: root/cmd/acme/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/acme/config.go')
-rw-r--r--cmd/acme/config.go20
1 files changed, 12 insertions, 8 deletions
diff --git a/cmd/acme/config.go b/cmd/acme/config.go
index ebdcb76..6a0dc4b 100644
--- a/cmd/acme/config.go
+++ b/cmd/acme/config.go
@@ -46,12 +46,13 @@ type account struct {
}
type domain struct {
- Altnames []string
- KeySize int
- KeyFile string
- CrtFile string
- Webroot string
- Hook []string
+ Gracetime time.Duration
+ Altnames []string
+ KeySize int
+ KeyFile string
+ CrtFile string
+ Webroot string
+ Hook []string
}
var (
@@ -115,6 +116,9 @@ func LoadConfig(fname string) (*Config, error) {
}
pro.Account[i] = acc
for i, dom := range acc.Domain {
+ if dom.Gracetime != 0 {
+ dom.Gracetime = c.Gracetime
+ }
if dom.KeySize == 0 {
dom.KeySize = c.KeySize
}
@@ -167,6 +171,6 @@ func checkWWW(altnames []string) []string {
return altnames
}
-func (c Config) renew(cert *x509.Certificate) bool {
- return time.Now().Add(c.Gracetime).After(cert.NotAfter)
+func (d domain) renew(cert *x509.Certificate) bool {
+ return time.Now().Add(d.Gracetime).After(cert.NotAfter)
}