diff --git a/config/config.go b/config/config.go index 580bcb479..dc60e2dad 100644 --- a/config/config.go +++ b/config/config.go @@ -17,6 +17,7 @@ type Callbacks interface { // Config is the configuration for Soft Serve. type Config struct { BindAddr string `env:"SOFT_SERVE_BIND_ADDRESS" envDefault:""` + Host string `env:"SOFT_SERVE_HOST" envDefault:"localhost"` Port int `env:"SOFT_SERVE_PORT" envDefault:"23231"` KeyPath string `env:"SOFT_SERVE_KEY_PATH"` RepoPath string `env:"SOFT_SERVE_REPO_PATH" envDefault:".repos"` diff --git a/internal/config/config.go b/internal/config/config.go index ef96c9549..cf2f58f92 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -53,7 +53,7 @@ func NewConfig(cfg *config.Config) (*Config, error) { var anonAccess string var yamlUsers string var displayHost string - host := cfg.BindAddr + host := cfg.Host port := cfg.Port pks := make([]string, 0) @@ -76,7 +76,7 @@ func NewConfig(cfg *config.Config) (*Config, error) { c := &Config{ Cfg: cfg, } - c.Host = cfg.BindAddr + c.Host = cfg.Host c.Port = port c.Source = rs if len(pks) == 0 {