Don't prompt for email when user is not there to provide one

Also don't bother showing stdout output in same situation
This commit is contained in:
Matthew Holt
2016-08-10 23:46:04 -06:00
parent 46bc0d5c4e
commit 68be4a9161
2 changed files with 29 additions and 3 deletions

View File

@ -10,7 +10,9 @@ import (
)
func activateHTTPS(cctx caddy.Context) error {
if !caddy.Quiet {
operatorPresent := !caddy.Started()
if !caddy.Quiet && operatorPresent {
fmt.Print("Activating privacy features...")
}
@ -21,7 +23,7 @@ func activateHTTPS(cctx caddy.Context) error {
// place certificates and keys on disk
for _, c := range ctx.siteConfigs {
err := c.TLS.ObtainCert(true)
err := c.TLS.ObtainCert(operatorPresent)
if err != nil {
return err
}
@ -44,9 +46,10 @@ func activateHTTPS(cctx caddy.Context) error {
return err
}
if !caddy.Quiet {
if !caddy.Quiet && operatorPresent {
fmt.Println(" done.")
}
return nil
}