Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make host configurable #78

Merged
merged 1 commit into from
Dec 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Make host configurable
This enables optional binding to the loopback interface.
jlegrone committed Dec 18, 2021
commit bc46c3a243fbf0c42f44f4a2e88b7d5abb9d76e7
1 change: 1 addition & 0 deletions server/config/config.go
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ type (
// Config contains the configuration for the UI server
Config struct {
TemporalGRPCAddress string `yaml:"temporalGrpcAddress"`
Host string `yaml:"host"`
Port int `yaml:"port"`
UIRootPath string `yaml:"uiRootPath"`
Auth Auth `yaml:"auth"`
5 changes: 2 additions & 3 deletions server/server.go
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@ package server
import (
"embed"
"fmt"
"strconv"

"github.com/gorilla/securecookie"
"github.com/gorilla/sessions"
@@ -103,8 +102,8 @@ func NewServer(opts ...server_options.ServerOption) *Server {
// Start UI server.
func (s *Server) Start() error {
fmt.Println("Starting UI server...")
port := s.options.Config.Port
s.httpServer.Logger.Fatal(s.httpServer.Start(":" + strconv.Itoa(port)))
address := fmt.Sprintf("%s:%d", s.options.Config.Host, s.options.Config.Port)
s.httpServer.Logger.Fatal(s.httpServer.Start(address))
return nil
}