Skip to content

Commit

Permalink
feat: add server host to config
Browse files Browse the repository at this point in the history
server host `SOFT_SERVE_HOST` is the broadcast address to the server
  • Loading branch information
aymanbagabas committed Feb 22, 2022
1 parent 22a98f9 commit 752d67a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
4 changes: 2 additions & 2 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down

0 comments on commit 752d67a

Please sign in to comment.