Remove CA path from config dir.

This commit is contained in:
xenolf 2015-09-26 20:00:19 +02:00
parent 37b20117bf
commit 0f32c176d7
3 changed files with 32 additions and 42 deletions

10
cli.go
View file

@ -24,7 +24,7 @@ func main() {
app := cli.NewApp()
app.Name = "lego"
app.Usage = "Let's encrypt client to go!"
app.Version = "0.0.1"
app.Version = "0.0.2"
cwd, err := os.Getwd()
if err != nil {
@ -103,14 +103,6 @@ func main() {
Value: 2048,
Usage: "Size of the RSA key.",
},
cli.BoolFlag{
Name: "no-confirm",
Usage: "Turn off confirmation screens.",
},
cli.BoolFlag{
Name: "agree-tos, e",
Usage: "Skip the end user license agreement screen.",
},
cli.StringFlag{
Name: "path",
Usage: "Directory to use for storing the data",

View file

@ -49,12 +49,11 @@ func run(c *cli.Context) {
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.`, c.GlobalString("config-dir"))
backups of this folder is ideal.`, conf.AccountPath(c.GlobalString("email")))
}
if acc.Registration.Body.Agreement == "" {
if !c.GlobalBool("agree-tos") {
reader := bufio.NewReader(os.Stdin)
logger().Printf("Please review the TOS at %s", acc.Registration.TosURL)
@ -83,7 +82,6 @@ func run(c *cli.Context) {
logger().Println("Your input was invalid. Please answer with one of Y/y, n or by pressing enter.")
}
}
}
if !c.GlobalIsSet("domains") {
logger().Fatal("Please specify --domains")

View file

@ -31,7 +31,7 @@ func (c *Configuration) OptPort() string {
// ServerPath returns the OS dependent path to the data for a specific CA
func (c *Configuration) ServerPath() string {
srv, _ := url.Parse(c.context.GlobalString("server"))
srvStr := strings.Replace(srv.Host, ":", "_", -1) + srv.Path
srvStr := strings.Replace(srv.Host, ":", "_", -1)
return strings.Replace(srvStr, "/", string(os.PathSeparator), -1)
}