Updates based on Herman's feedback

This commit is contained in:
Carl Tashian 2022-04-05 10:59:25 -07:00
parent acc75bc679
commit 150eee70df
3 changed files with 11 additions and 6 deletions

View file

@ -80,7 +80,7 @@ type Authority struct {
adminMutex sync.RWMutex
}
type AuthorityInfo struct {
type Info struct {
StartTime time.Time
RootX509Certs []*x509.Certificate
SSHCAUserPublicKey []byte
@ -567,8 +567,8 @@ func (a *Authority) GetAdminDatabase() admin.DB {
return a.adminDB
}
func (a *Authority) GetInfo() AuthorityInfo {
ai := AuthorityInfo{
func (a *Authority) GetInfo() Info {
ai := Info{
StartTime: a.startTime,
RootX509Certs: a.rootX509Certs,
DNSNames: a.config.DNSNames,

View file

@ -301,14 +301,18 @@ func (ca *CA) Run() error {
if !ca.opts.quiet {
authorityInfo := ca.auth.GetInfo()
log.Printf("Welcome to step-ca.")
log.Printf("Starting %s", step.Version())
log.Printf("Documentation: https://u.step.sm/docs/ca")
log.Printf("Community Discord: https://u.step.sm/discord")
log.Printf("Current context: %s", step.Contexts().GetCurrent().Name)
if step.Contexts().GetCurrent() != nil {
log.Printf("Current context: %s", step.Contexts().GetCurrent().Name)
}
log.Printf("Config file: %s", ca.opts.configFile)
log.Printf("The primary server URL is https://%s%s",
baseURL := fmt.Sprintf("https://%s%s",
authorityInfo.DNSNames[0],
ca.config.Address[strings.LastIndex(ca.config.Address, ":"):])
log.Printf("The primary server URL is %s", baseURL)
log.Printf("Root certificates are available at %s/roots.pem", baseURL)
if len(authorityInfo.DNSNames) > 1 {
log.Printf("Additional configured hostnames: %s",
strings.Join(authorityInfo.DNSNames[1:], ", "))

View file

@ -61,6 +61,7 @@ certificate issuer private key used in the RA mode.`,
cli.BoolFlag{
Name: "quiet",
Usage: "disable startup information",
EnvVar: "STEP_CA_QUIET",
},
cli.StringFlag{
Name: "context",