1
0
mirror of https://github.com/smallstep/cli.git synced 2025-08-09 03:22:43 +03:00

Solicit feedback from users

* step
* step help
* step ca init
This commit is contained in:
max furman
2019-08-27 18:11:09 -07:00
parent 043a79a76c
commit ad0e89fd56
3 changed files with 34 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ func initCommand() cli.Command {
Action: cli.ActionFunc(initAction), Action: cli.ActionFunc(initAction),
Usage: "initialize the CA PKI", Usage: "initialize the CA PKI",
UsageText: `**step ca init** UsageText: `**step ca init**
[**--root**=<path>] [**--key**=<path>] [**--pki**] [**--name**=<name>] [**--root**=<path>] [**--key**=<path>] [**--pki**] [**--name**=<name>]
[**dns**=<dns>] [**address**=<address>] [**provisioner**=<name>] [**dns**=<dns>] [**address**=<address>] [**provisioner**=<name>]
[**provisioner-password-file**=<path>] [**password-file**=<path>] [**provisioner-password-file**=<path>] [**password-file**=<path>]
[**with-ca-url**=<url>] [**no-db**]`, [**with-ca-url**=<url>] [**no-db**]`,

View File

@@ -7,9 +7,11 @@ import (
"encoding/json" "encoding/json"
"encoding/pem" "encoding/pem"
"fmt" "fmt"
"html"
"net" "net"
"os" "os"
"path/filepath" "path/filepath"
"strconv"
"strings" "strings"
"github.com/pkg/errors" "github.com/pkg/errors"
@@ -270,10 +272,27 @@ func (p *PKI) GenerateIntermediateCertificate(name string, rootCrt *x509.Certifi
return err return err
} }
func (p *PKI) askFeedback() {
ui.Println()
ui.Printf("\033[1mFEEDBACK\033[0m %s %s\n",
html.UnescapeString("&#"+strconv.Itoa(128525)+";"),
html.UnescapeString("&#"+strconv.Itoa(127867)+";"))
ui.Println(" The \033[1mstep\033[0m utility is not instrumented for usage statistics. It does not")
ui.Println(" phone home. But your feedback is extremely valuable. Any information you")
ui.Println(" can provide regarding how youre using `step` helps. Please send us a")
ui.Println(" sentence or two, good or bad: \033[1mfeedback@smallstep.com\033[0m or join")
ui.Println(" \033[1mhttps://gitter.im/smallstep/community\033[0m.")
}
// TellPKI outputs the locations of public and private keys generated // TellPKI outputs the locations of public and private keys generated
// generated for a new PKI. Generally this will consist of a root certificate // generated for a new PKI. Generally this will consist of a root certificate
// and key and an intermediate certificate and key. // and key and an intermediate certificate and key.
func (p *PKI) TellPKI() { func (p *PKI) TellPKI() {
p.tellPKI()
p.askFeedback()
}
func (p *PKI) tellPKI() {
ui.Println() ui.Println()
ui.PrintSelected("Root certificate", p.root) ui.PrintSelected("Root certificate", p.root)
ui.PrintSelected("Root private key", p.rootKey) ui.PrintSelected("Root private key", p.rootKey)
@@ -316,7 +335,7 @@ func WithoutDB() Option {
// Save stores the pki on a json file that will be used as the certificate // Save stores the pki on a json file that will be used as the certificate
// authority configuration. // authority configuration.
func (p *PKI) Save(opt ...Option) error { func (p *PKI) Save(opt ...Option) error {
p.TellPKI() p.tellPKI()
key, err := p.ottPrivateKey.CompactSerialize() key, err := p.ottPrivateKey.CompactSerialize()
if err != nil { if err != nil {
@@ -401,5 +420,7 @@ func (p *PKI) Save(opt ...Option) error {
ui.Println() ui.Println()
ui.Println("Your PKI is ready to go. To generate certificates for individual services see 'step help ca'.") ui.Println("Your PKI is ready to go. To generate certificates for individual services see 'step help ca'.")
p.askFeedback()
return nil return nil
} }

View File

@@ -3,6 +3,8 @@ package usage
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"html"
"strconv"
"strings" "strings"
"text/template" "text/template"
) )
@@ -116,6 +118,15 @@ This documentation is available online at https://smallstep.com/docs/cli
## COPYRIGHT ## COPYRIGHT
{{.Copyright}} {{.Copyright}}
## FEEDBACK ` +
html.UnescapeString("&#"+strconv.Itoa(128525)+";") + " " +
html.UnescapeString("&#"+strconv.Itoa(127867)+";") +
`
The **step** utility is not instrumented for usage statistics. It does not phone home.
But your feedback is extremely valuable. Any information you can provide regarding how youre using 'step' helps.
Please send us a sentence or two, good or bad: **feedback@smallstep.com** or join https://gitter.im/smallstep/community.
{{end}} {{end}}
` `