Combine controller and worker commands (#415)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-09-23 01:23:10 -04:00
1 parent 0a4669e96d
commit 38ce9d9eac
12 files changed
+320 -579

No files matched your search

-3
View File
@@ -73,9 +73,6 @@ type Command struct {
FlagDescription string
FlagVersion int
FlagDevPassthroughDirectory string
FlagDevRecoveryKey string
client *api.Client
}
-23
View File
@@ -1,23 +0,0 @@
// +build dev
package base
func init() {
DevOnlyControllerFlags = addDevOnlyControllerFlags
}
func addDevOnlyControllerFlags(c *Command, f *FlagSet) {
f.StringVar(&StringVar{
Name: "dev-passthrough-directory",
Target: &c.FlagDevPassthroughDirectory,
EnvVar: "BOUNDARY_DEV_PASSTHROUGH_DIRECTORY",
Usage: "Enables a passthrough directory in the webserver at /",
})
f.StringVar(&StringVar{
Name: "dev-recovery-key",
Target: &c.FlagDevRecoveryKey,
EnvVar: "BOUNDARY_DEV_RECOVERY_KEY",
Usage: "Specifies the base64'd 256-bit AES key to use for recovery operations",
})
}
+9
View File
@@ -100,6 +100,15 @@ func tcpListenerFactory(l *configutil.Listener, logger hclog.Logger, ui cli.Ui)
return nil, nil, nil, errors.New("could not determine port")
}
switch purpose {
case "cluster":
l.TLSDisable = true
case "proxy":
// TODO: Eventually we'll support bringing your own cert, and we'd only
// want to disable if you aren't actually bringing your own
l.TLSDisable = true
}
bindProto := "tcp"
// If they've passed 0.0.0.0, we only want to bind on IPv4
+14 -8
View File
@@ -68,9 +68,15 @@ type Server struct {
Listeners []*ServerListener
DevAuthMethodId string
DevLoginName string
DevPassword string
DevAuthMethodId string
DevLoginName string
DevPassword string
DevOrgId string
DevProjectId string
DevHostCatalogId string
DevHostSetId string
DevHostId string
DevTargetId string
DatabaseUrl string
DevDatabaseCleanupFunc func() error
@@ -198,7 +204,7 @@ func (b *Server) SetupMetrics(ui cli.Ui, telemetry *configutil.Telemetry) error
return nil
}
func (b *Server) PrintInfo(ui cli.Ui, mode string) {
func (b *Server) PrintInfo(ui cli.Ui) {
b.InfoKeys = append(b.InfoKeys, "version")
verInfo := version.Get()
b.Info["version"] = verInfo.FullVersionNumber(false)
@@ -221,7 +227,7 @@ func (b *Server) PrintInfo(ui cli.Ui, mode string) {
}
}
sort.Strings(b.InfoKeys)
ui.Output(fmt.Sprintf("==> Boundary %s configuration:\n", mode))
ui.Output(fmt.Sprintf("==> Boundary server configuration:\n"))
for _, k := range b.InfoKeys {
ui.Output(fmt.Sprintf(
"%s%s: %s",
@@ -233,7 +239,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("==> Boundary %s started! Log data will stream in below:\n", mode))
ui.Output(fmt.Sprintf("==> Boundary server started! Log data will stream in below:\n"))
}
}
@@ -341,8 +347,8 @@ func (b *Server) SetupKMSes(ui cli.Ui, config *config.Config) error {
return errors.New("KMS block missing 'purpose'")
case "root", "worker-auth", "config":
case "recovery":
if config.Controller != nil && config.Controller.DevRecoveryKey != "" {
kms.Config["key"] = config.Controller.DevRecoveryKey
if config.Controller != nil && config.DevRecoveryKey != "" {
kms.Config["key"] = config.DevRecoveryKey
}
default:
return fmt.Errorf("Unknown KMS purpose %q", kms.Purpose)