temporalio / ui

Temporal UI
https://docs.temporal.io/web-ui
MIT License
188 stars 69 forks source link

[Feature Request] Support ui-server running over https #1266

Open tengfmu opened 1 year ago

tengfmu commented 1 year ago

Is your feature request related to a problem? Please describe.

Currently when start ui-server through command line or docker image, it always running over http. To make it running from more production env, it would be better to support running the server over https.

As a workaround, we could setup reverse proxy to provide https access to ui server, but still it would be great if we could support https natively.

Describe the solution you'd like

Through config or minor code change, ui server should be running over https in addition to http.

Additional context

adammy123 commented 1 year ago

Suggested small code tweak which worked for me (required re-building of binary):

// Start UI server.
func (s *Server) Start() error {
    fmt.Println("Starting UI server...")
    cfg, err := s.cfgProvider.GetConfig()
    if err != nil {
        return err
    }

    address := fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)
    if cfg.TLS.CertFile != "" && cfg.TLS.KeyFile != "" {
        fmt.Println("Starting UI server with TLS...")
        s.httpServer.Logger.Fatal(s.httpServer.StartTLS(address, cfg.TLS.CertFile, cfg.TLS.KeyFile)) //<-- start serving over https
    } else {
        fmt.Println("Starting UI server without TLS...")
        s.httpServer.Logger.Fatal(s.httpServer.Start(address)) //<-- original line
    }
    return nil
}