Skip to content

Commit

Permalink
Clarify that host 'n port settings in config are for display purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm authored and toby committed Dec 16, 2021
1 parent 4d1fd7d commit 2a1313d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ The Soft Serve configuration is simple and straightforward:
# The name of the server to show in the TUI.
name: Soft Serve

# The host and port to listen on. Defaults to 0.0.0.0:23231.
# The host and port to display in the TUI. You may want to change this if your
# server is accessible from a different host and/or port that what it's
# actually listening on (for example, if it's behind a reverse proxy).
host: localhost
port: 23231

Expand Down
4 changes: 3 additions & 1 deletion internal/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ const defaultReadme = "# Soft Serve\n\n Welcome! You can configure your Soft Ser
const defaultConfig = `# The name of the server to show in the TUI.
name: Soft Serve
# The host and port to listen on. Defaults to 0.0.0.0:23231.
# The host and port to display in the TUI. You may want to change this if your
# server is accessible from a different host and/or port that what it's
# actually listening on (for example, if it's behind a reverse proxy).
host: %s
port: %d
Expand Down
11 changes: 0 additions & 11 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@ func NewServer(cfg *config.Config) *Server {
if err != nil {
log.Fatal(err)
}

// If the host and port are set in config.yaml, and they weren't set in the
// environment, update the environment level config accordingly, which is
// the config used to start the server.
if cfg.Host == "" {
cfg.Host = ac.Host
}
if cfg.Port == 0 {
cfg.Port = ac.Port
}

mw := []wish.Middleware{
bm.Middleware(tui.SessionHandler(ac)),
gm.Middleware(cfg.RepoPath, ac),
Expand Down

0 comments on commit 2a1313d

Please sign in to comment.