0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00

letsencrypt: Email prompt includes link to SA

This commit is contained in:
Matthew Holt 2015-10-31 13:15:47 -06:00
parent 3843cea959
commit e4028b23c7
2 changed files with 8 additions and 5 deletions

View file

@ -30,10 +30,12 @@ import (
// if that is not available it will check the command line // if that is not available it will check the command line
// argument. If absent, it will use the most recent email // argument. If absent, it will use the most recent email
// address from last time. If there isn't one, the user // address from last time. If there isn't one, the user
// will be prompted. If the user leaves email blank, <TODO>. // will be prompted and shown SA link.
// //
// Also note that calling this function activates asset // Also note that calling this function activates asset
// management automatically, which <TODO>. // management automatically, which keeps certificates
// renewed and OCSP stapling updated. This has the effect
// of causing restarts when assets are updated.
// //
// Activate returns the updated list of configs, since // Activate returns the updated list of configs, since
// some may have been appended, for example, to redirect // some may have been appended, for example, to redirect
@ -41,7 +43,6 @@ import (
func Activate(configs []server.Config) ([]server.Config, error) { func Activate(configs []server.Config) ([]server.Config, error) {
// just in case previous caller forgot... // just in case previous caller forgot...
Deactivate() Deactivate()
// TODO: Is multiple activation (before a deactivation) an error?
// reset cached ocsp statuses from any previous activations // reset cached ocsp statuses from any previous activations
ocspStatus = make(map[*[]byte]int) ocspStatus = make(map[*[]byte]int)

View file

@ -143,11 +143,12 @@ func getEmail(cfg server.Config) string {
} }
} }
if leEmail == "" { if leEmail == "" {
// Alas, we must bother the user and ask for an email address // Alas, we must bother the user and ask for an email address;
// if they proceed they also agree to the SA.
reader := bufio.NewReader(stdin) reader := bufio.NewReader(stdin)
fmt.Println("Your sites will be served over HTTPS automatically using Let's Encrypt.") fmt.Println("Your sites will be served over HTTPS automatically using Let's Encrypt.")
fmt.Println("By continuing, you agree to the Let's Encrypt Subscriber Agreement at:") fmt.Println("By continuing, you agree to the Let's Encrypt Subscriber Agreement at:")
fmt.Println(" <TODO: link>") fmt.Println(" https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf") // TODO: Show current SA link
fmt.Println("Please enter your email address so you can recover your account if needed.") fmt.Println("Please enter your email address so you can recover your account if needed.")
fmt.Println("You can leave it blank, but you lose the ability to recover your account.") fmt.Println("You can leave it blank, but you lose the ability to recover your account.")
fmt.Print("Email address: ") fmt.Print("Email address: ")
@ -157,6 +158,7 @@ func getEmail(cfg server.Config) string {
return "" return ""
} }
DefaultEmail = leEmail DefaultEmail = leEmail
Agreed = true
} }
return strings.TrimSpace(leEmail) return strings.TrimSpace(leEmail)
} }