aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-02-16 14:02:01 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-02-16 14:02:01 +0100
commite8d3201087846b65f11d0687af91e6f9937a0413 (patch)
treef5b0f182100c42af3122eac95b04a1cf9c101f83
parent0c39b991e9289a41ef656220454aa08330209511 (diff)
Add default grace time
-rw-r--r--cmd/acme/config.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/acme/config.go b/cmd/acme/config.go
index 15c3403..e7a95a9 100644
--- a/cmd/acme/config.go
+++ b/cmd/acme/config.go
@@ -11,7 +11,10 @@ import (
"gopkg.in/yaml.v2"
)
-const defKeySize = 2048
+const (
+ defKeySize = 2048
+ defGrace = time.Hour * 24 * 7
+)
type Config struct {
Gracetime time.Duration
@@ -70,6 +73,9 @@ func LoadConfig(fname string) (*Config, error) {
c.BaseDir = path.Join(usr.HomeDir, c.BaseDir[1:])
}
// apply defaults
+ if c.Gracetime == 0 {
+ c.Gracetime = defGrace
+ }
if c.KeySize == 0 {
c.KeySize = defKeySize
}