diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/acme/config.go | 6 | ||||
-rw-r--r-- | cmd/acme/main.go | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/cmd/acme/config.go b/cmd/acme/config.go index 3e3cf40..9b15088 100644 --- a/cmd/acme/config.go +++ b/cmd/acme/config.go @@ -105,7 +105,7 @@ func LoadConfig(fname string) (*Config, error) { des.KeyFile = path.Join(c.BaseDir, keyPath, des.KeyFile) c.Desire[i] = des for i, dom := range des.Domain { - if dom.Gracetime != 0 { + if dom.Gracetime == 0 { dom.Gracetime = c.Gracetime } if dom.KeySize == 0 { @@ -155,3 +155,7 @@ func checkWWW(altnames []string) []string { } return altnames } + +func (c Config) dump() ([]byte, error) { + return yaml.Marshal(c) +} diff --git a/cmd/acme/main.go b/cmd/acme/main.go index 4155404..b722d05 100644 --- a/cmd/acme/main.go +++ b/cmd/acme/main.go @@ -3,6 +3,7 @@ package main import ( "flag" + "fmt" "log" "time" @@ -12,6 +13,7 @@ import ( var ( confName = flag.String("conf", "", "configuration file") forceRenew = flag.Bool("force", false, "force renew") + dumpConfig = flag.Bool("dump", false, "dump parsed configuration") httpSol, tlsSol acme.Solver ) @@ -125,6 +127,15 @@ func main() { log.Fatal(err) } + if *dumpConfig { + out, err := conf.dump() + if err != nil { + log.Fatal(err) + } + fmt.Println(string(out)) + return + } + httpSol, err = acme.NewHTTPSolver(conf.Listen) if err != nil { log.Println("HTTP Solver", err) |