From 752d67a0db72fde389ccdb38a63b18c67c57be6f Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Tue, 22 Feb 2022 12:42:41 -0500 Subject: [PATCH] feat: add server host to config server host `SOFT_SERVE_HOST` is the broadcast address to the server --- config/config.go | 1 + internal/config/config.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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 {