temporalio / cli

Command-line interface for running Temporal Server and interacting with Workflows, Activities, Namespaces, and other parts of Temporal
https://docs.temporal.io/cli
MIT License
241 stars 32 forks source link

[Bug] cannot bind ui to different IP using--ui-ip #602

Closed michael-doubez closed 5 days ago

michael-doubez commented 2 weeks ago

What are you really trying to do?

Trying to start a DEV server with the webui bound to a specific ip using the command line option --ui-ip.

Usage:
  temporal server start-dev [flags]

Flags:

      --ui-ip string                       IP address to bind the Web UI to. Default is same as --ip.
      --ui-port int                        Port for the Web UI. Default is --port + 1000.

Describe the bug

The webui is still bound to localhost:

$ ./temporal server start-dev --ui-ip 192.168.1.2
Temporal server: localhost:7233
Web UI:          http://localhost:8233
Metrics:         http://localhost:42455/metrics

Testing if log is incorrect:

$ curl -x "" http://192.168.1.2:8233
curl: (7) Failed to connect to 192.168.1.2 port 8233 after 2 ms: Connection refused

Minimal Reproduction

Tests as described in bug description:

Environment/Versions

Additional context

Rapidely looking into the code, UIIP is not initialized when building devserver.StartOptions from TemporalServerStartDevCommand (t.UiIp should be used): https://github.com/temporalio/cli/blob/dbf0a8549cb0fa135e77519ba233874ee74a6d7d/temporalcli/commands.server.go#L26

Since it is not initialized, it defaults to the IP of temporal service.

Note: the same applies to UI Port.