Skip to content

Commit ffae354

Browse files
committed
Merge branch '302-local-ui-config' into 'master'
feat: configure IP address to listen HTTP connections for Local UI (#302) Closes #302 See merge request postgres-ai/database-lab!378
2 parents 46ffba8 + 322f199 commit ffae354

5 files changed

+23
-1
lines changed

Diff for: configs/config.example.logical_generic.yml

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ localUI:
3232
# Docker image of the UI application.
3333
dockerImage: "postgresai/basic-ui:latest"
3434

35+
# Host or IP address, from which the Local UI container accepts HTTP connections.
36+
# By default, use a loop-back to accept only local connections.
37+
# The empty string means "all available addresses".
38+
host: "127.0.0.1"
39+
3540
# HTTP port of the UI application. Default: 2346.
3641
port: 2346
3742

Diff for: configs/config.example.logical_rds_iam.yml

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ localUI:
3232
# Docker image of the UI application.
3333
dockerImage: "postgresai/basic-ui:latest"
3434

35+
# Host or IP address, from which the Local UI container accepts HTTP connections.
36+
# By default, use a loop-back to accept only local connections.
37+
# The empty string means "all available addresses".
38+
host: "127.0.0.1"
39+
3540
# HTTP port of the UI application. Default: 2346.
3641
port: 2346
3742

Diff for: configs/config.example.physical_generic.yml

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ localUI:
3232
# Docker image of the UI application.
3333
dockerImage: "postgresai/basic-ui:latest"
3434

35+
# Host or IP address, from which the Local UI container accepts HTTP connections.
36+
# By default, use a loop-back to accept only local connections.
37+
# The empty string means "all available addresses".
38+
host: "127.0.0.1"
39+
3540
# HTTP port of the UI application. Default: 2346.
3641
port: 2346
3742

Diff for: configs/config.example.physical_walg.yml

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ localUI:
3232
# Docker image of the UI application.
3333
dockerImage: "postgresai/basic-ui:latest"
3434

35+
# Host or IP address, from which the Local UI container accepts HTTP connections.
36+
# By default, use a loop-back to accept only local connections.
37+
# The empty string means "all available addresses".
38+
host: "127.0.0.1"
39+
3540
# HTTP port of the UI application. Default: 2346.
3641
port: 2346
3742

Diff for: internal/localui/local_ui.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const (
4242
type Config struct {
4343
Enabled bool `yaml:"enabled"`
4444
DockerImage string `yaml:"dockerImage"`
45+
Host string `yaml:"host"`
4546
Port int `yaml:"port"`
4647
}
4748

@@ -82,6 +83,7 @@ func (ui *UIManager) Reload(ctx context.Context, cfg Config) error {
8283
func (ui *UIManager) isConfigChanged(cfg Config) bool {
8384
return ui.cfg.Enabled != cfg.Enabled ||
8485
ui.cfg.DockerImage != cfg.DockerImage ||
86+
ui.cfg.Host != cfg.Host ||
8587
ui.cfg.Port != cfg.Port
8688
}
8789

@@ -113,7 +115,7 @@ func (ui *UIManager) Run(ctx context.Context) error {
113115
PortBindings: map[nat.Port][]nat.PortBinding{
114116
"80/tcp": {
115117
{
116-
HostIP: "127.0.0.1",
118+
HostIP: ui.cfg.Host,
117119
HostPort: strconv.Itoa(ui.cfg.Port),
118120
},
119121
},

0 commit comments

Comments
 (0)