Skip to content

Commit

Permalink
Show error message if not possible to create CAs folder (#407)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
  • Loading branch information
Alevsk and dvaldivia committed Nov 19, 2020
1 parent 12e53a1 commit b6ac055
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/console/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ func startServer(ctx *cli.Context) error {
// Set all certs and CAs directories.
certs.GlobalCertsDir, _ = certs.NewConfigDirFromCtx(ctx, "certs-dir", certs.DefaultCertsDir.Get)
certs.GlobalCertsCADir = &certs.ConfigDir{Path: filepath.Join(certs.GlobalCertsDir.Get(), certs.CertsCADir)}
logger.FatalIf(certs.MkdirAllIgnorePerm(certs.GlobalCertsCADir.Get()), "Unable to create certs CA directory at %s", certs.GlobalCertsCADir.Get())

if err := certs.MkdirAllIgnorePerm(certs.GlobalCertsCADir.Get()); err != nil {
log.Println(fmt.Sprintf("Unable to create certs CA directory at %s", certs.GlobalCertsCADir.Get()))
}

// load all CAs from ~/.console/certs/CAs
restapi.GlobalRootCAs, err = certsx.GetRootCAs(certs.GlobalCertsCADir.Get())
Expand Down

0 comments on commit b6ac055

Please sign in to comment.