command/server: can set advertise addr

This commit is contained in:
Mitchell Hashimoto
2015-04-17 11:25:20 -07:00
parent 75a319d767
commit bac7049996
4 changed files with 17 additions and 7 deletions

View File

@@ -14,10 +14,11 @@ import (
// Config is the configuration for the vault server.
type Config struct {
Listeners []*Listener `hcl:"-"`
Backend *Backend `hcl:"-"`
StatsiteAddr string `hcl:"statsite_addr"`
StatsdAddr string `hcl:"statsd_addr"`
Listeners []*Listener `hcl:"-"`
Backend *Backend `hcl:"-"`
StatsiteAddr string `hcl:"statsite_addr"`
StatsdAddr string `hcl:"statsd_addr"`
}
// DevConfig is a Config that is used for dev mode of Vault.
@@ -50,8 +51,9 @@ func (l *Listener) GoString() string {
// Backend is the backend configuration for the server.
type Backend struct {
Type string
Config map[string]string
Type string
AdvertiseAddr string
Config map[string]string
}
func (b *Backend) GoString() string {
@@ -306,6 +308,11 @@ func loadBackend(os *hclobj.Object) (*Backend, error) {
err)
}
if v, ok := config["advertise_addr"]; ok {
result.AdvertiseAddr = v
delete(config, "advertise_addr")
}
result.Config = config
return &result, nil
}