Skip to content

Commit

Permalink
add --public-path option to the command
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrebert committed Aug 22, 2024
1 parent a223850 commit 5050567
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions temporalcli/commands.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,7 @@ type TemporalServerStartDevCommand struct {
UiPort int
Headless bool
Ip string
PublicPath string
UiIp string
UiAssetPath string
UiCodecEndpoint string
Expand Down Expand Up @@ -1314,6 +1315,7 @@ func NewTemporalServerStartDevCommand(cctx *CommandContext, parent *TemporalServ
s.Command.Flags().BoolVar(&s.Headless, "headless", false, "Disable the Web UI.")
s.Command.Flags().StringVar(&s.Ip, "ip", "localhost", "IP address bound to the frontend Service.")
s.Command.Flags().StringVar(&s.UiIp, "ui-ip", "", "IP address bound to the WebUI. Default is same as '--ip' value.")
s.Command.Flags().StringVar(&s.PublicPath, "public-path", "", "The public path for the Web UI.")
s.Command.Flags().StringVar(&s.UiAssetPath, "ui-asset-path", "", "UI custom assets path.")
s.Command.Flags().StringVar(&s.UiCodecEndpoint, "ui-codec-endpoint", "", "UI remote codec HTTP endpoint.")
s.Command.Flags().StringArrayVar(&s.SqlitePragma, "sqlite-pragma", nil, "SQLite pragma statements in \"PRAGMA=VALUE\" format.")
Expand Down
4 changes: 2 additions & 2 deletions temporalcli/commands.server.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var defaultDynamicConfigValues = map[string]any{
// These numbers were chosen to maintain the ratio between the two that's
// established in the defaults.
"frontend.persistenceMaxQPS": 10000,
"history.persistenceMaxQPS": 45000,
"history.persistenceMaxQPS": 45000,
}

func (t *TemporalServerStartDevCommand) run(cctx *CommandContext, args []string) error {
Expand Down Expand Up @@ -81,7 +81,7 @@ func (t *TemporalServerStartDevCommand) run(cctx *CommandContext, args []string)
return fmt.Errorf("can't set UI port %d: %w", opts.UIPort, err)
}
}
opts.UIAssetPath, opts.UICodecEndpoint = t.UiAssetPath, t.UiCodecEndpoint
opts.UIAssetPath, opts.UICodecEndpoint, opts.PublicPath = t.UiAssetPath, t.UiCodecEndpoint, t.PublicPath
}
// Pragmas and dyn config
var err error
Expand Down
3 changes: 3 additions & 0 deletions temporalcli/commandsmd/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,9 @@ temporal server start-dev \
* `--ui-ip` (string) -
IP address bound to the WebUI.
Default is same as '--ip' value.
* `public-path` (string) -
The public base path for the Web UI.
Default is `/`
* `--ui-asset-path` (string) -
UI custom assets path.
* `--ui-codec-endpoint` (string) -
Expand Down
2 changes: 2 additions & 0 deletions temporalcli/devserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ type StartOptions struct {
UIPort int // Required if UIIP is non-empty
UIAssetPath string
UICodecEndpoint string
PublicPath string
DatabaseFile string
MetricsPort int
PProfPort int
Expand Down Expand Up @@ -156,6 +157,7 @@ func (s *StartOptions) buildUIServer() *uiserver.Server {
Port: s.UIPort,
TemporalGRPCAddress: fmt.Sprintf("%v:%v", MaybeEscapeIPv6(s.FrontendIP), s.FrontendPort),
EnableUI: true,
PublicPath: s.PublicPath,
UIAssetPath: s.UIAssetPath,
Codec: uiconfig.Codec{Endpoint: s.UICodecEndpoint},
CORS: uiconfig.CORS{CookieInsecure: true},
Expand Down

0 comments on commit 5050567

Please sign in to comment.