From 4fe3bcfc6f778ea463e5b0a05e045c5dea138feb Mon Sep 17 00:00:00 2001 From: Dominik Menke Date: Mon, 27 Apr 2020 19:23:17 +0200 Subject: [PATCH] Fix account storage location warning message (#1127) --- cmd/cmd_run.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/cmd/cmd_run.go b/cmd/cmd_run.go index fe2c3774..e71437f2 100644 --- a/cmd/cmd_run.go +++ b/cmd/cmd_run.go @@ -43,6 +43,17 @@ func createRun() cli.Command { } } +const rootPathWarningMessage = `!!!! HEADS UP !!!! + +Your account credentials have been saved in your Let's Encrypt +configuration directory at "%s". + +You should make a secure backup of this folder now. This +configuration directory will also contain certificates and +private keys obtained from Let's Encrypt so making regular +backups of this folder is ideal. +` + func run(ctx *cli.Context) error { accountsStorage := NewAccountsStorage(ctx) @@ -56,19 +67,11 @@ func run(ctx *cli.Context) error { } account.Registration = reg - if err = accountsStorage.Save(account); err != nil { log.Fatal(err) } - fmt.Println("!!!! HEADS UP !!!!") - fmt.Printf(` - Your account credentials have been saved in your Let's Encrypt - configuration directory at "%s". - You should make a secure backup of this folder now. This - configuration directory will also contain certificates and - private keys obtained from Let's Encrypt so making regular - backups of this folder is ideal.`, accountsStorage.GetRootPath()) + fmt.Printf(rootPathWarningMessage, accountsStorage.GetRootPath()) } certsStorage := NewCertificatesStorage(ctx)