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

@@ -1,7 +1,7 @@
package authenticate
import (
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/mitchellh/cli"
"github.com/mitchellh/go-wordwrap"
)
@@ -13,18 +13,18 @@ type Command struct {
}
func (c *Command) Synopsis() string {
return wordwrap.WrapString("Authenticate the Watchtower commandline client", base.TermWidth)
return wordwrap.WrapString("Authenticate the Boundary commandline client", base.TermWidth)
}
func (c *Command) Help() string {
return base.WrapForHelpText([]string{
"Usage: watchtower authenticate [sub command] [options] [args]",
"Usage: boundary authenticate [sub command] [options] [args]",
"",
" This command authenticates the Watchtower commandline client using a specified auth method. Examples:",
" This command authenticates the Boundary commandline client using a specified auth method. Examples:",
"",
" Authenticate with password auth method:",
"",
" $ watchtower authenticate password -name foo -password bar",
" $ boundary authenticate password -name foo -password bar",
"",
" Please see the auth method subcommand help for detailed usage information.",
})
+11 -11
View File
@@ -8,9 +8,9 @@ import (
"strings"
"time"
"github.com/hashicorp/boundary/api/authmethods"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/hashicorp/vault/sdk/helper/password"
"github.com/hashicorp/watchtower/api/authmethods"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/kr/pretty"
"github.com/mitchellh/cli"
"github.com/mitchellh/go-wordwrap"
@@ -21,9 +21,9 @@ import (
var _ cli.Command = (*PasswordCommand)(nil)
var _ cli.CommandAutocomplete = (*PasswordCommand)(nil)
var envPassword = "WATCHTOWER_AUTHENTICATE_PASSWORD"
var envName = "WATCHTOWER_AUTHENTICATE_NAME"
var envMethodId = "WATCHTOWER_AUTHENTICATE_METHOD_ID"
var envPassword = "BOUNDARY_AUTHENTICATE_PASSWORD"
var envName = "BOUNDARY_AUTHENTICATE_NAME"
var envMethodId = "BOUNDARY_AUTHENTICATE_METHOD_ID"
type PasswordCommand struct {
*base.Command
@@ -34,20 +34,20 @@ type PasswordCommand struct {
}
func (c *PasswordCommand) Synopsis() string {
return wordwrap.WrapString("Invoke the password auth method to authenticate with Watchtower", base.TermWidth)
return wordwrap.WrapString("Invoke the password auth method to authenticate with Boundary", base.TermWidth)
}
func (c *PasswordCommand) Help() string {
return base.WrapForHelpText([]string{
"Usage: watchtower authenticate password [options] [args]",
"Usage: boundary authenticate password [options] [args]",
"",
" Invoke the password auth method to authenticate the Watchtower CLI:",
" Invoke the password auth method to authenticate the Boundary CLI:",
"",
" $ watchtower authenticate password -name=foo -password=bar",
" $ boundary authenticate password -name=foo -password=bar",
"",
" If more than one instance of the password auth method exists, use the -method-id flag:",
"",
` $ watchtower authenticate password -method-id am_12345 -name foo -password "bar"`,
` $ boundary authenticate password -method-id am_12345 -name foo -password "bar"`,
}) + c.Flags().Help()
}
@@ -156,7 +156,7 @@ func (c *PasswordCommand) Run(args []string) int {
c.UI.Error(fmt.Sprintf("Error marshaling auth token to save to system credential store: %s", err))
return 1
}
if err := keyring.Set("HashiCorp Watchtower Auth Token", tokenName, base64.RawStdEncoding.EncodeToString(marshaled)); err != nil {
if err := keyring.Set("HashiCorp Boundary Auth Token", tokenName, base64.RawStdEncoding.EncodeToString(marshaled)); err != nil {
c.UI.Error(fmt.Sprintf("Error saving auth token to system credential store: %s", err))
return 1
}
+6 -6
View File
@@ -3,7 +3,7 @@ package config
import (
"strings"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/mitchellh/cli"
)
@@ -14,23 +14,23 @@ type Command struct {
}
func (c *Command) Synopsis() string {
return "Manage sensitive values in Watchtower's configuration files"
return "Manage sensitive values in Boundary's configuration files"
}
func (c *Command) Help() string {
helpText := `
Usage: watchtower config <subcommand> [options] [args]
Usage: boundary config <subcommand> [options] [args]
This command groups subcommands for operators interacting with Watchtower's
This command groups subcommands for operators interacting with Boundary's
config files. Here are a few examples of config commands:
Encrypt sensitive values in a config file:
$ watchtower config encrypt config.hcl
$ boundary config encrypt config.hcl
Decrypt sensitive values in a config file:
$ watchtower config decrypt config.hcl
$ boundary config decrypt config.hcl
Please see the individual subcommand help for detailed usage information.`
@@ -6,9 +6,9 @@ import (
"os"
"strings"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/hashicorp/vault/internalshared/configutil"
"github.com/hashicorp/vault/sdk/helper/strutil"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/mitchellh/cli"
"github.com/posener/complete"
)
@@ -38,9 +38,9 @@ func (c *EncryptDecryptCommand) Help() string {
subCmd = "Encrypt"
}
helpText := `
Usage: watchtower config %s [options] [args]
Usage: boundary config %s [options] [args]
%s sensitive values in a Watchtower's configuration file. These values must be marked
%s sensitive values in a Boundary's configuration file. These values must be marked
with {{%s()}} as appropriate. This can only be used with string parameters, and
the markers must be inside the quote marks delimiting the string; as an example:
@@ -49,7 +49,7 @@ Usage: watchtower config %s [options] [args]
By default this will print the new configuration out. To overwrite into the same
file use the -overwrite flag.
$ watchtower config %s -overwrite config.hcl
$ boundary config %s -overwrite config.hcl
`
helpText = fmt.Sprintf(helpText, strings.ToLower(subCmd), subCmd, strings.ToLower(subCmd), strings.ToLower(subCmd))
@@ -9,7 +9,7 @@ import (
"strings"
"testing"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/mitchellh/cli"
"github.com/stretchr/testify/assert"
)
+16 -16
View File
@@ -6,16 +6,16 @@ import (
"strings"
"sync"
"github.com/hashicorp/boundary/globals"
"github.com/hashicorp/boundary/internal/auth/password"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/hashicorp/boundary/internal/cmd/config"
"github.com/hashicorp/boundary/internal/servers/controller"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/vault/internalshared/configutil"
"github.com/hashicorp/vault/sdk/helper/mlock"
"github.com/hashicorp/vault/sdk/helper/strutil"
"github.com/hashicorp/watchtower/globals"
"github.com/hashicorp/watchtower/internal/auth/password"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/hashicorp/watchtower/internal/cmd/config"
"github.com/hashicorp/watchtower/internal/servers/controller"
"github.com/mitchellh/cli"
"github.com/posener/complete"
)
@@ -55,16 +55,16 @@ type Command struct {
}
func (c *Command) Synopsis() string {
return "Start a Watchtower controller"
return "Start a Boundary controller"
}
func (c *Command) Help() string {
helpText := `
Usage: watchtower controller [options]
Usage: boundary controller [options]
Start a controller with a configuration file:
$ watchtower controller -config=/etc/watchtower/controller.hcl
$ boundary controller -config=/etc/boundary/controller.hcl
For a full list of examples, please see the documentation.
@@ -91,7 +91,7 @@ func (c *Command) Flags() *base.FlagSets {
Name: "log-level",
Target: &c.flagLogLevel,
Default: base.NotSetValue,
EnvVar: "WATCHTOWER_LOG_LEVEL",
EnvVar: "BOUNDARY_LOG_LEVEL",
Completion: complete.PredictSet("trace", "debug", "info", "warn", "err"),
Usage: "Log verbosity level. Supported values (in order of more detail to less) are " +
"\"trace\", \"debug\", \"info\", \"warn\", and \"err\".",
@@ -149,14 +149,14 @@ func (c *Command) Flags() *base.FlagSets {
f.StringVar(&base.StringVar{
Name: "dev-api-listen-address",
Target: &c.flagDevControllerAPIListenAddr,
EnvVar: "WATCHTOWER_DEV_CONTROLLER_API_LISTEN_ADDRESS",
EnvVar: "BOUNDARY_DEV_CONTROLLER_API_LISTEN_ADDRESS",
Usage: "Address to bind the controller to in \"dev\" mode for \"api\" purpose.",
})
f.StringVar(&base.StringVar{
Name: "dev-cluster-listen-address",
Target: &c.flagDevControllerClusterListenAddr,
EnvVar: "WATCHTOWER_DEV_CONTROLLER_CLUSTER_LISTEN_ADDRESS",
EnvVar: "BOUNDARY_DEV_CONTROLLER_CLUSTER_LISTEN_ADDRESS",
Usage: "Address to bind the controller to in \"dev\" mode for \"cluster\" purpose.",
})
@@ -216,14 +216,14 @@ func (c *Command) Run(args []string) int {
}
// If mlockall(2) isn't supported, show a warning. We disable this in dev
// because it is quite scary to see when first using Watchtower. We also disable
// because it is quite scary to see when first using Boundary. We also disable
// this if the user has explicitly disabled mlock in configuration.
if !c.flagDev && !c.Config.DisableMlock && !mlock.Supported() {
c.UI.Warn(base.WrapAtLength(
"WARNING! mlock is not supported on this system! An mlockall(2)-like " +
"syscall to prevent memory from being swapped to disk is not " +
"supported on this system. For better security, only run Watchtower on " +
"systems where this call is supported. If you are running Watchtower" +
"supported on this system. For better security, only run Boundary on " +
"systems where this call is supported. If you are running Boundary" +
"in a Docker container, provide the IPC_LOCK cap to the container."))
}
@@ -452,7 +452,7 @@ func (c *Command) WaitForInterrupt() int {
for !shutdownTriggered {
select {
case <-shutdownCh:
c.UI.Output("==> Watchtower controller shutdown triggered")
c.UI.Output("==> Boundary controller shutdown triggered")
if err := c.controller.Shutdown(); err != nil {
c.UI.Error(fmt.Errorf("Error with controller shutdown: %w", err).Error())
@@ -461,7 +461,7 @@ func (c *Command) WaitForInterrupt() int {
shutdownTriggered = true
case <-c.SighupCh:
c.UI.Output("==> Watchtower controller reload triggered")
c.UI.Output("==> Boundary controller reload triggered")
// Check for new log level
var level hclog.Level
@@ -2,7 +2,7 @@
package controller
import "github.com/hashicorp/watchtower/internal/cmd/base"
import "github.com/hashicorp/boundary/internal/cmd/base"
func init() {
devOnlyControllerFlags = addDevOnlyControllerFlags
@@ -12,7 +12,7 @@ func addDevOnlyControllerFlags(c *Command, f *base.FlagSet) {
f.StringVar(&base.StringVar{
Name: "dev-passthrough-directory",
Target: &c.flagDevPassthroughDirectory,
EnvVar: "WATCHTOWER_DEV_PASSTHROUGH_DIRECTORY",
EnvVar: "BOUNDARY_DEV_PASSTHROUGH_DIRECTORY",
Usage: "Enables a passthrough directory in the webserver at /",
})
}
+13 -13
View File
@@ -6,11 +6,11 @@ import (
"strings"
"sync"
"github.com/hashicorp/watchtower/internal/auth/password"
"github.com/hashicorp/watchtower/internal/cmd/base"
controllercmd "github.com/hashicorp/watchtower/internal/cmd/commands/controller"
workercmd "github.com/hashicorp/watchtower/internal/cmd/commands/worker"
"github.com/hashicorp/watchtower/internal/cmd/config"
"github.com/hashicorp/boundary/internal/auth/password"
"github.com/hashicorp/boundary/internal/cmd/base"
controllercmd "github.com/hashicorp/boundary/internal/cmd/commands/controller"
workercmd "github.com/hashicorp/boundary/internal/cmd/commands/worker"
"github.com/hashicorp/boundary/internal/cmd/config"
"github.com/mitchellh/cli"
"github.com/posener/complete"
)
@@ -45,16 +45,16 @@ type Command struct {
}
func (c *Command) Synopsis() string {
return "Start a Watchtower dev environment"
return "Start a Boundary dev environment"
}
func (c *Command) Help() string {
helpText := `
Usage: watchtower dev [options]
Usage: boundary dev [options]
Start a dev environment:
$ watchtower dev
$ boundary dev
For a full list of examples, please see the documentation.
@@ -71,7 +71,7 @@ func (c *Command) Flags() *base.FlagSets {
Name: "log-level",
Target: &c.flagLogLevel,
Default: base.NotSetValue,
EnvVar: "WATCHTOWER_LOG_LEVEL",
EnvVar: "BOUNDARY_LOG_LEVEL",
Completion: complete.PredictSet("trace", "debug", "info", "warn", "err"),
Usage: "Log verbosity level. Supported values (in order of more detail to less) are " +
"\"trace\", \"debug\", \"info\", \"warn\", and \"err\".",
@@ -122,14 +122,14 @@ func (c *Command) Flags() *base.FlagSets {
f.StringVar(&base.StringVar{
Name: "dev-api-listen-address",
Target: &c.flagDevControllerAPIListenAddr,
EnvVar: "WATCHTOWER_DEV_CONTROLLER_API_LISTEN_ADDRESS",
EnvVar: "BOUNDARY_DEV_CONTROLLER_API_LISTEN_ADDRESS",
Usage: "Address to bind to for controller \"api\" purpose.",
})
f.StringVar(&base.StringVar{
Name: "dev-cluster-listen-address",
Target: &c.flagDevControllerClusterListenAddr,
EnvVar: "WATCHTOWER_DEV_CONTROLLER_CLUSTER_LISTEN_ADDRESS",
EnvVar: "BOUNDARY_DEV_CONTROLLER_CLUSTER_LISTEN_ADDRESS",
Usage: "Address to bind to for controller \"cluster\" purpose.",
})
@@ -321,7 +321,7 @@ func (c *Command) Run(args []string) int {
for !shutdownTriggered {
select {
case <-c.ShutdownCh:
c.UI.Output("==> Watchtower dev environment shutdown triggered")
c.UI.Output("==> Boundary dev environment shutdown triggered")
childShutdownCh <- struct{}{}
childShutdownCh <- struct{}{}
@@ -329,7 +329,7 @@ func (c *Command) Run(args []string) int {
shutdownTriggered = true
case <-c.SighupCh:
c.UI.Output("==> Watchtower dev environment reload triggered")
c.UI.Output("==> Boundary dev environment reload triggered")
for _, v := range c.childSighupCh {
v <- struct{}{}
}
+2 -2
View File
@@ -2,7 +2,7 @@
package dev
import "github.com/hashicorp/watchtower/internal/cmd/base"
import "github.com/hashicorp/boundary/internal/cmd/base"
func init() {
devOnlyControllerFlags = addDevOnlyControllerFlags
@@ -12,7 +12,7 @@ func addDevOnlyControllerFlags(c *Command, f *base.FlagSet) {
f.StringVar(&base.StringVar{
Name: "dev-passthrough-directory",
Target: &c.flagDevPassthroughDirectory,
EnvVar: "WATCHTOWER_DEV_PASSTHROUGH_DIRECTORY",
EnvVar: "BOUNDARY_DEV_PASSTHROUGH_DIRECTORY",
Usage: "Enables a passthrough directory in the webserver at /",
})
}
+4 -4
View File
@@ -4,8 +4,8 @@ import (
"fmt"
"strings"
"github.com/hashicorp/watchtower/api/hosts"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/hashicorp/boundary/api/hosts"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/kr/pretty"
"github.com/mitchellh/cli"
"github.com/posener/complete"
@@ -29,14 +29,14 @@ func (c *CreateCommand) Synopsis() string {
func (c *CreateCommand) Help() string {
helpText := `
Usage: watchtower hosts create
Usage: boundary hosts create
Creates a host in the given host catalog. This command will result in an
error for any catalog that does not support manual host creation.
Example:
$ watchtower hosts create -catalog-id=<id> -address=<addr> -name=<name>
$ boundary hosts create -catalog-id=<id> -address=<addr> -name=<name>
` + c.Flags().Help()
+25 -25
View File
@@ -6,16 +6,16 @@ import (
"strings"
"time"
"github.com/hashicorp/watchtower/api/roles"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/hashicorp/boundary/api/roles"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/mitchellh/go-wordwrap"
)
func synopsisFunc(inFunc string) string {
if inFunc == "" {
return wordwrap.WrapString("Manage Watchtower roles", base.TermWidth)
return wordwrap.WrapString("Manage Boundary roles", base.TermWidth)
}
return wordwrap.WrapString(fmt.Sprintf("%s a role within Watchtower", textproto.CanonicalMIMEHeaderKey(inFunc)), base.TermWidth)
return wordwrap.WrapString(fmt.Sprintf("%s a role within Boundary", textproto.CanonicalMIMEHeaderKey(inFunc)), base.TermWidth)
}
func principalsGrantsSynopsisFunc(inFunc string, principals bool) string {
@@ -32,22 +32,22 @@ func principalsGrantsSynopsisFunc(inFunc string, principals bool) string {
case strings.HasPrefix(inFunc, "remove"):
in = fmt.Sprintf("Remove %s from", switchStr)
}
return wordwrap.WrapString(fmt.Sprintf("%s a role within Watchtower", in), base.TermWidth)
return wordwrap.WrapString(fmt.Sprintf("%s a role within Boundary", in), base.TermWidth)
}
func baseHelp() string {
return base.WrapForHelpText([]string{
"Usage: watchtower roles [sub command] [options] [args]",
"Usage: boundary roles [sub command] [options] [args]",
"",
" This command allows operations on Watchtower roles. Examples:",
" This command allows operations on Boundary roles. Examples:",
"",
" Create a role:",
"",
` $ watchtower roles create -name foo -description "For ProdOps usage"`,
` $ boundary roles create -name foo -description "For ProdOps usage"`,
"",
" Add a grant to a role:",
"",
` $ watchtower roles add-grants -id r_1234567890 -grant "type=host-catalog;actions=create,delete"`,
` $ boundary roles add-grants -id r_1234567890 -grant "type=host-catalog;actions=create,delete"`,
"",
" Please see the role subcommand help for detailed usage information.",
})
@@ -55,11 +55,11 @@ func baseHelp() string {
func createHelp() string {
return base.WrapForHelpText([]string{
"Usage: watchtower roles create [options] [args]",
"Usage: boundary roles create [options] [args]",
"",
" Create a role. Example:",
"",
` $ watchtower roles create -name ops -description "Role for ops grants"`,
` $ boundary roles create -name ops -description "Role for ops grants"`,
"",
"",
})
@@ -67,71 +67,71 @@ func createHelp() string {
func updateHelp() string {
return base.WrapForHelpText([]string{
"Usage: watchtower roles update [options] [args]",
"Usage: boundary roles update [options] [args]",
"",
" Update a role given its ID. Example:",
"",
` $ watchtower roles update -id r_1234567890 -description "Development host grants"`,
` $ boundary roles update -id r_1234567890 -description "Development host grants"`,
})
}
func readHelp() string {
return base.WrapForHelpText([]string{
"Usage: watchtower roles read [options] [args]",
"Usage: boundary roles read [options] [args]",
"",
" Read a role given its ID. Example:",
"",
` $ watchtower roles read -id r_1234567890`,
` $ boundary roles read -id r_1234567890`,
})
}
func deleteHelp() string {
return base.WrapForHelpText([]string{
"Usage: watchtower roles delete [options] [args]",
"Usage: boundary roles delete [options] [args]",
"",
" Delete a role given its ID. Example:",
"",
` $ watchtower roles delete -id r_1234567890`,
` $ boundary roles delete -id r_1234567890`,
})
}
func listHelp() string {
return base.WrapForHelpText([]string{
"Usage: watchtower roles list [options] [args]",
"Usage: boundary roles list [options] [args]",
"",
" List roles within a scope. Example:",
"",
` $ watchtower roles list -org o_1234567890`,
` $ boundary roles list -org o_1234567890`,
})
}
func addPrincipalsHelp() string {
return base.WrapForHelpText([]string{
"Usage: watchtower roles add-principals [options] [args]",
"Usage: boundary roles add-principals [options] [args]",
"",
` Adds principals (users, groups) to a role given its ID. The "user" and "group" flags can be specified multiple times. Example:`,
"",
` $ watchtower roles add-principals -id r_1234567890 -user u_1234567890`,
` $ boundary roles add-principals -id r_1234567890 -user u_1234567890`,
})
}
func setPrincipalsHelp() string {
return base.WrapForHelpText([]string{
"Usage: watchtower roles set-principals [options] [args]",
"Usage: boundary roles set-principals [options] [args]",
"",
` Sets the complete set of principals (users, groups) on a role given its ID. The "user" and "group" flags can be specified multiple times. Example:`,
"",
` $ watchtower roles set-principals -id r_1234567890 -user u_anon -group sg_1234567890`,
` $ boundary roles set-principals -id r_1234567890 -user u_anon -group sg_1234567890`,
})
}
func removePrincipalsHelp() string {
return base.WrapForHelpText([]string{
"Usage: watchtower roles remove-principals [options] [args]",
"Usage: boundary roles remove-principals [options] [args]",
"",
` Removes principals (users, groups) from a role given its ID. The "user" and "group" flags can be specified multiple times. Example:`,
"",
` $ watchtower roles remove-principals -id r_1234567890 -group sg_1234567890`,
` $ boundary roles remove-principals -id r_1234567890 -group sg_1234567890`,
})
}
+5 -5
View File
@@ -3,11 +3,11 @@ package roles
import (
"fmt"
"github.com/hashicorp/boundary/api"
"github.com/hashicorp/boundary/api/roles"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/hashicorp/boundary/internal/perms"
"github.com/hashicorp/vault/sdk/helper/strutil"
"github.com/hashicorp/watchtower/api"
"github.com/hashicorp/watchtower/api/roles"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/hashicorp/watchtower/internal/perms"
"github.com/kr/pretty"
"github.com/mitchellh/cli"
"github.com/posener/complete"
@@ -39,7 +39,7 @@ func (c *Command) Synopsis() string {
case "add-grants", "set-grants", "remove-grants":
return principalsGrantsSynopsisFunc(c.Func, false)
}
return "Manage Watchtower roles"
return "Manage Boundary roles"
}
var helpMap = map[string]func() string{
+4 -4
View File
@@ -4,8 +4,8 @@ import (
"fmt"
"strings"
"github.com/hashicorp/watchtower/api/scopes"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/hashicorp/boundary/api/scopes"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/kr/pretty"
"github.com/mitchellh/cli"
"github.com/posener/complete"
@@ -27,14 +27,14 @@ func (c *CreateScopeCommand) Synopsis() string {
func (c *CreateScopeCommand) Help() string {
helpText := `
Usage: watchtower scopes create
Usage: boundary scopes create
Creates a new scope within the scope specified by the ID from the
"scope" parameter or the associated environment variable.
Example:
$ watchtower scopes create -scope=<scope_id> -name=<name>
$ boundary scopes create -scope=<scope_id> -name=<name>
` + c.Flags().Help()
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"fmt"
"time"
"github.com/hashicorp/watchtower/api/scopes"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/hashicorp/boundary/api/scopes"
"github.com/hashicorp/boundary/internal/cmd/base"
)
func printScope(in *scopes.Scope) string {
+4 -4
View File
@@ -4,8 +4,8 @@ import (
"fmt"
"strings"
"github.com/hashicorp/watchtower/api/scopes"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/hashicorp/boundary/api/scopes"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/kr/pretty"
"github.com/mitchellh/cli"
"github.com/posener/complete"
@@ -26,13 +26,13 @@ func (c *ReadScopeCommand) Synopsis() string {
func (c *ReadScopeCommand) Help() string {
helpText := `
Usage: watchtower scopes read
Usage: boundary scopes read
Returns information about a scope specified by the ID. The request will take place within the scope of the caller's authentication token.
Example:
$ watchtower scopes read -id=<scope_id>
$ boundary scopes read -id=<scope_id>
` + c.Flags().Help()
+13 -13
View File
@@ -6,13 +6,13 @@ import (
"strings"
"sync"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/hashicorp/boundary/internal/cmd/config"
"github.com/hashicorp/boundary/internal/servers/worker"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/vault/internalshared/configutil"
"github.com/hashicorp/vault/sdk/helper/mlock"
"github.com/hashicorp/watchtower/internal/cmd/base"
"github.com/hashicorp/watchtower/internal/cmd/config"
"github.com/hashicorp/watchtower/internal/servers/worker"
"github.com/mitchellh/cli"
"github.com/posener/complete"
)
@@ -44,16 +44,16 @@ type Command struct {
}
func (c *Command) Synopsis() string {
return "Start a Watchtower worker"
return "Start a Boundary worker"
}
func (c *Command) Help() string {
helpText := `
Usage: watchtower worker [options]
Usage: boundary worker [options]
Start a worker with a configuration file:
$ watchtower worker -config=/etc/watchtower/worker.hcl
$ boundary worker -config=/etc/boundary/worker.hcl
For a full list of examples, please see the documentation.
@@ -80,7 +80,7 @@ func (c *Command) Flags() *base.FlagSets {
Name: "log-level",
Target: &c.flagLogLevel,
Default: base.NotSetValue,
EnvVar: "WATCHTOWER_LOG_LEVEL",
EnvVar: "BOUNDARY_LOG_LEVEL",
Completion: complete.PredictSet("trace", "debug", "info", "warn", "err"),
Usage: "Log verbosity level. Supported values (in order of more detail to less) are " +
"\"trace\", \"debug\", \"info\", \"warn\", and \"err\".",
@@ -106,7 +106,7 @@ func (c *Command) Flags() *base.FlagSets {
f.StringVar(&base.StringVar{
Name: "dev-listen-address",
Target: &c.flagDevWorkerListenAddr,
EnvVar: "WATCHTOWER_DEV_WORKER_LISTEN_ADDRESS",
EnvVar: "BOUNDARY_DEV_WORKER_LISTEN_ADDRESS",
Usage: "Address to bind the worker to in \"dev\" mode.",
})
@@ -157,14 +157,14 @@ func (c *Command) Run(args []string) int {
}
// If mlockall(2) isn't supported, show a warning. We disable this in dev
// because it is quite scary to see when first using Watchtower. We also disable
// because it is quite scary to see when first using Boundary. We also disable
// this if the user has explicitly disabled mlock in configuration.
if !c.flagDev && !c.Config.DisableMlock && !mlock.Supported() {
c.UI.Warn(base.WrapAtLength(
"WARNING! mlock is not supported on this system! An mlockall(2)-like " +
"syscall to prevent memory from being swapped to disk is not " +
"supported on this system. For better security, only run Watchtower on " +
"systems where this call is supported. If you are running Watchtower" +
"supported on this system. For better security, only run Boundary on " +
"systems where this call is supported. If you are running Boundary" +
"in a Docker container, provide the IPC_LOCK cap to the container."))
}
@@ -287,7 +287,7 @@ func (c *Command) WaitForInterrupt() int {
for !shutdownTriggered {
select {
case <-shutdownCh:
c.UI.Output("==> Watchtower worker shutdown triggered")
c.UI.Output("==> Boundary worker shutdown triggered")
if err := c.worker.Shutdown(); err != nil {
c.UI.Error(fmt.Errorf("Error with worker shutdown: %w", err).Error())
@@ -296,7 +296,7 @@ func (c *Command) WaitForInterrupt() int {
shutdownTriggered = true
case <-c.SighupCh:
c.UI.Output("==> Watchtower worker reload triggered")
c.UI.Output("==> Boundary worker reload triggered")
// Check for new log level
var level hclog.Level