The name. The name. The name!

This commit is contained in:
Jeff Mitchell committed 2020-08-10 17:15:02 -04:00
1 parent 1c836c430b
commit 6661117d4c
321 files changed
+1295 -1300

No files matched your search

+18 -18
View File
@@ -16,8 +16,8 @@ import (
"sync"
"syscall"
"github.com/hashicorp/watchtower/api"
"github.com/hashicorp/watchtower/api/authtokens"
"github.com/hashicorp/boundary/api"
"github.com/hashicorp/boundary/api/authtokens"
"github.com/mitchellh/cli"
"github.com/pkg/errors"
"github.com/posener/complete"
@@ -31,7 +31,7 @@ const (
// NotSetValue is a flag value for a not-set value
NotSetValue = "(not set)"
envTokenName = "WATCHTOWER_TOKEN_NAME"
envTokenName = "BOUNDARY_TOKEN_NAME"
)
// reRemoveWhitespace is a regular expression for stripping whitespace from
@@ -159,7 +159,7 @@ func (c *Command) Client() (*api.Client, error) {
}
// Turn off retries on the CLI
if os.Getenv(api.EnvWatchtowerMaxRetries) == "" {
if os.Getenv(api.EnvBoundaryMaxRetries) == "" {
c.client.SetMaxRetries(0)
}
@@ -169,7 +169,7 @@ func (c *Command) Client() (*api.Client, error) {
tokenName = c.FlagTokenName
}
if tokenName != "none" {
token, err := keyring.Get("HashiCorp Watchtower Auth Token", tokenName)
token, err := keyring.Get("HashiCorp Boundary Auth Token", tokenName)
if err != nil {
if err == keyring.ErrNotFound {
c.UI.Info("No saved credential found, continuing without")
@@ -235,16 +235,16 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
Name: FlagNameAddr,
Target: &c.flagAddr,
Default: NotSetValue,
EnvVar: api.EnvWatchtowerAddr,
EnvVar: api.EnvBoundaryAddr,
Completion: complete.PredictAnything,
Usage: "Addr of the Watchtower controller, as a complete URL (e.g. https://watchtower.example.com:9200).",
Usage: "Addr of the Boundary controller, as a complete URL (e.g. https://boundary.example.com:9200).",
})
f.StringVar(&StringVar{
Name: FlagNameScope,
Target: &c.flagScope,
Default: NotSetValue,
EnvVar: api.EnvWatchtowerScopeId,
EnvVar: api.EnvBoundaryScopeId,
Completion: complete.PredictAnything,
Usage: `Scope in which to make the request. If not specified, will default to the scope of a saved token (if found), otherwise will default to "global".`,
})
@@ -253,7 +253,7 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
Name: FlagNameCACert,
Target: &c.flagTLSCACert,
Default: NotSetValue,
EnvVar: api.EnvWatchtowerCACert,
EnvVar: api.EnvBoundaryCACert,
Completion: complete.PredictFiles("*"),
Usage: "Path on the local disk to a single PEM-encoded CA " +
"certificate to verify the Controller or Worker's server's SSL certificate. This " +
@@ -264,7 +264,7 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
Name: FlagNameCAPath,
Target: &c.flagTLSCAPath,
Default: NotSetValue,
EnvVar: api.EnvWatchtowerCAPath,
EnvVar: api.EnvBoundaryCAPath,
Completion: complete.PredictDirs("*"),
Usage: "Path on the local disk to a directory of PEM-encoded CA " +
"certificates to verify the SSL certificate of the Controller.",
@@ -274,10 +274,10 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
Name: FlagNameClientCert,
Target: &c.flagTLSClientCert,
Default: NotSetValue,
EnvVar: api.EnvWatchtowerClientCert,
EnvVar: api.EnvBoundaryClientCert,
Completion: complete.PredictFiles("*"),
Usage: "Path on the local disk to a single PEM-encoded CA " +
"certificate to use for TLS authentication to the Watchtower Controller. If " +
"certificate to use for TLS authentication to the Boundary Controller. If " +
"this flag is specified, -client-key is also required.",
})
@@ -285,7 +285,7 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
Name: FlagNameClientKey,
Target: &c.flagTLSClientKey,
Default: NotSetValue,
EnvVar: api.EnvWatchtowerClientKey,
EnvVar: api.EnvBoundaryClientKey,
Completion: complete.PredictFiles("*"),
Usage: "Path on the local disk to a single PEM-encoded private key " +
"matching the client certificate from -client-cert.",
@@ -295,19 +295,19 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
Name: FlagTLSServerName,
Target: &c.flagTLSServerName,
Default: NotSetValue,
EnvVar: api.EnvWatchtowerTLSServerName,
EnvVar: api.EnvBoundaryTLSServerName,
Completion: complete.PredictAnything,
Usage: "Name to use as the SNI host when connecting to the Watchtower " +
Usage: "Name to use as the SNI host when connecting to the Boundary " +
"server via TLS.",
})
f.BoolVar(&BoolVar{
Name: FlagNameTLSInsecure,
Target: &c.flagTLSInsecure,
EnvVar: api.EnvWatchtowerTLSInsecure,
EnvVar: api.EnvBoundaryTLSInsecure,
Usage: "Disable verification of TLS certificates. Using this option " +
"is highly discouraged as it decreases the security of data " +
"transmissions to and from the Watchtower server.",
"transmissions to and from the Boundary server.",
})
}
@@ -350,7 +350,7 @@ func (c *Command) FlagSet(bit FlagSetBit) *FlagSets {
Name: "format",
Target: &c.flagFormat,
Default: "table",
EnvVar: EnvWatchtowerCLIFormat,
EnvVar: EnvBoundaryCLIFormat,
Completion: complete.PredictSet("table", "json", "yaml"),
Usage: "Print the output in the given format. Valid formats " +
"are \"table\", \"json\", or \"yaml\".",
+3 -3
View File
@@ -2,7 +2,7 @@ package base
const (
// FlagNameAddr is the flag used in the base command to read in the
// address of the Watchtower server.
// address of the Boundary server.
FlagNameAddr = "addr"
// FlagNameScope is the flag used in the base command to read in the scope
// in which to make a request.
@@ -28,6 +28,6 @@ const (
)
const (
EnvWatchtowerCLINoColor = `WATCHTOWER_CLI_NO_COLOR`
EnvWatchtowerCLIFormat = `WATCHTOWER_CLI_FORMAT`
EnvBoundaryCLINoColor = `BOUNDARY_CLI_NO_COLOR`
EnvBoundaryCLIFormat = `BOUNDARY_CLI_FORMAT`
)
+2 -2
View File
@@ -398,11 +398,11 @@ var Formatters = map[string]Formatter{
func Format(ui cli.Ui) string {
switch t := ui.(type) {
case *WatchtowerUI:
case *BoundaryUI:
return t.Format
}
format := os.Getenv(EnvWatchtowerCLIFormat)
format := os.Getenv(EnvBoundaryCLIFormat)
if format == "" {
format = "table"
}
+1 -1
View File
@@ -96,7 +96,7 @@ func tcpListenerFactory(l *configutil.Listener, logger hclog.Logger, ui cli.Ui)
"addr": l.Address,
}
if _, ok := os.LookupEnv("WATCHTOWER_LOG_CONNECTION_MUXING"); !ok {
if _, ok := os.LookupEnv("BOUNDARY_LOG_CONNECTION_MUXING"); !ok {
logger = nil
}
alpnMux := alpnmux.New(ln, logger)
+1 -1
View File
@@ -13,7 +13,7 @@ import (
)
func StartMemProfiler(logger hclog.Logger) {
profileDir := filepath.Join(os.TempDir(), "watchtowerprof")
profileDir := filepath.Join(os.TempDir(), "boundaryprof")
if err := os.MkdirAll(profileDir, 0700); err != nil {
logger.Debug("could not create profile directory", "error", err)
return
+11 -11
View File
@@ -14,6 +14,11 @@ import (
"sync"
"github.com/armon/go-metrics"
"github.com/hashicorp/boundary/globals"
"github.com/hashicorp/boundary/internal/auth/password"
"github.com/hashicorp/boundary/internal/db"
"github.com/hashicorp/boundary/internal/iam"
"github.com/hashicorp/boundary/version"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/go-hclog"
wrapping "github.com/hashicorp/go-kms-wrapping"
@@ -25,11 +30,6 @@ import (
"github.com/hashicorp/vault/sdk/helper/logging"
"github.com/hashicorp/vault/sdk/helper/mlock"
"github.com/hashicorp/vault/sdk/logical"
"github.com/hashicorp/watchtower/globals"
"github.com/hashicorp/watchtower/internal/auth/password"
"github.com/hashicorp/watchtower/internal/db"
"github.com/hashicorp/watchtower/internal/iam"
"github.com/hashicorp/watchtower/version"
"github.com/jinzhu/gorm"
"github.com/mitchellh/cli"
"google.golang.org/grpc/grpclog"
@@ -107,7 +107,7 @@ func (b *Server) SetupLogging(flagLogLevel, flagLogFormat, configLogLevel, confi
namedGRPCLogFaker := b.Logger.Named("grpclogfaker")
grpclog.SetLogger(&GRPCLogFaker{
Logger: namedGRPCLogFaker,
Log: os.Getenv("WATCHTOWER_GRPC_LOGGING") != "",
Log: os.Getenv("BOUNDARY_GRPC_LOGGING") != "",
})
b.Info["log level"] = logLevel.String()
@@ -181,9 +181,9 @@ func (b *Server) SetupMetrics(ui cli.Ui, telemetry *configutil.Telemetry) error
b.InmemSink, _, b.PrometheusEnabled, err = configutil.SetupTelemetry(&configutil.SetupTelemetryOpts{
Config: telemetry,
Ui: ui,
ServiceName: "watchtower",
DisplayName: "Watchtower",
UserAgent: "watchtower",
ServiceName: "boundary",
DisplayName: "Boundary",
UserAgent: "boundary",
})
if err != nil {
return fmt.Errorf("Error initializing telemetry: %w", err)
@@ -209,7 +209,7 @@ func (b *Server) PrintInfo(ui cli.Ui, mode string) {
// Server configuration output
padding := 24
sort.Strings(b.InfoKeys)
ui.Output(fmt.Sprintf("==> Watchtower %s configuration:\n", mode))
ui.Output(fmt.Sprintf("==> Boundary %s configuration:\n", mode))
for _, k := range b.InfoKeys {
ui.Output(fmt.Sprintf(
"%s%s: %s",
@@ -221,7 +221,7 @@ func (b *Server) PrintInfo(ui cli.Ui, mode string) {
// Output the header that the server has started
if !b.CombineLogs {
ui.Output(fmt.Sprintf("==> Watchtower %s started! Log data will stream in below:\n", mode))
ui.Output(fmt.Sprintf("==> Boundary %s started! Log data will stream in below:\n", mode))
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"golang.org/x/crypto/ssh/terminal"
)
type WatchtowerUI struct {
type BoundaryUI struct {
cli.Ui
Format string
}