forked from TrueCloudLab/certificates
Updates based on Herman's feedback
This commit is contained in:
parent
acc75bc679
commit
150eee70df
3 changed files with 11 additions and 6 deletions
|
@ -80,7 +80,7 @@ type Authority struct {
|
||||||
adminMutex sync.RWMutex
|
adminMutex sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
type AuthorityInfo struct {
|
type Info struct {
|
||||||
StartTime time.Time
|
StartTime time.Time
|
||||||
RootX509Certs []*x509.Certificate
|
RootX509Certs []*x509.Certificate
|
||||||
SSHCAUserPublicKey []byte
|
SSHCAUserPublicKey []byte
|
||||||
|
@ -567,8 +567,8 @@ func (a *Authority) GetAdminDatabase() admin.DB {
|
||||||
return a.adminDB
|
return a.adminDB
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Authority) GetInfo() AuthorityInfo {
|
func (a *Authority) GetInfo() Info {
|
||||||
ai := AuthorityInfo{
|
ai := Info{
|
||||||
StartTime: a.startTime,
|
StartTime: a.startTime,
|
||||||
RootX509Certs: a.rootX509Certs,
|
RootX509Certs: a.rootX509Certs,
|
||||||
DNSNames: a.config.DNSNames,
|
DNSNames: a.config.DNSNames,
|
||||||
|
|
10
ca/ca.go
10
ca/ca.go
|
@ -301,14 +301,18 @@ func (ca *CA) Run() error {
|
||||||
|
|
||||||
if !ca.opts.quiet {
|
if !ca.opts.quiet {
|
||||||
authorityInfo := ca.auth.GetInfo()
|
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("Documentation: https://u.step.sm/docs/ca")
|
||||||
log.Printf("Community Discord: https://u.step.sm/discord")
|
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("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],
|
authorityInfo.DNSNames[0],
|
||||||
ca.config.Address[strings.LastIndex(ca.config.Address, ":"):])
|
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 {
|
if len(authorityInfo.DNSNames) > 1 {
|
||||||
log.Printf("Additional configured hostnames: %s",
|
log.Printf("Additional configured hostnames: %s",
|
||||||
strings.Join(authorityInfo.DNSNames[1:], ", "))
|
strings.Join(authorityInfo.DNSNames[1:], ", "))
|
||||||
|
|
|
@ -61,6 +61,7 @@ certificate issuer private key used in the RA mode.`,
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "quiet",
|
Name: "quiet",
|
||||||
Usage: "disable startup information",
|
Usage: "disable startup information",
|
||||||
|
EnvVar: "STEP_CA_QUIET",
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "context",
|
Name: "context",
|
||||||
|
|
Loading…
Reference in a new issue