gui-listen fix (#12013)

* gui-listen fix

* fix test

---------

Co-authored-by: LexLuthr <lexluthr@curiostorage.org>
This commit is contained in:
Andrew Jackson (Ajax)
2024-05-22 11:54:51 +02:00
committed by GitHub
co-authored by LexLuthr
parent 7e3846c669
commit 75ca4dec4e
5 changed files with 14 additions and 6 deletions
+3
View File
@@ -291,6 +291,9 @@ func (deps *Deps) PopulateRemainingDeps(ctx context.Context, cctx *cli.Context,
} }
} }
} }
if cctx.IsSet("gui-listen") {
deps.Cfg.Subsystems.GuiAddress = cctx.String("gui-listen")
}
if deps.LocalStore == nil { if deps.LocalStore == nil {
deps.LocalStore, err = paths.NewLocal(ctx, deps.LocalPaths, deps.Si, []string{"http://" + deps.ListenAddr + "/remote"}) deps.LocalStore, err = paths.NewLocal(ctx, deps.LocalPaths, deps.Si, []string{"http://" + deps.ListenAddr + "/remote"})
if err != nil { if err != nil {
+8 -3
View File
@@ -37,6 +37,11 @@ var runCmd = &cli.Command{
Value: "0.0.0.0:12300", Value: "0.0.0.0:12300",
EnvVars: []string{"CURIO_LISTEN"}, EnvVars: []string{"CURIO_LISTEN"},
}, },
&cli.StringFlag{
Name: "gui-listen",
Usage: "host address and port the gui will listen on",
Hidden: true,
},
&cli.BoolFlag{ &cli.BoolFlag{
Name: "nosync", Name: "nosync",
Usage: "don't check full-node sync status", Usage: "don't check full-node sync status",
@@ -157,9 +162,9 @@ var webCmd = &cli.Command{
This creates the 'web' layer if it does not exist, then calls run with that layer.`, This creates the 'web' layer if it does not exist, then calls run with that layer.`,
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.StringFlag{ &cli.StringFlag{
Name: "listen", Name: "gui-listen",
Usage: "Address to listen on", Usage: "Address to listen for the GUI on",
Value: "127.0.0.1:4701", Value: "0.0.0.0:4701",
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: "nosync", Name: "nosync",
+1 -1
View File
@@ -469,7 +469,7 @@ DESCRIPTION:
This creates the 'web' layer if it does not exist, then calls run with that layer. This creates the 'web' layer if it does not exist, then calls run with that layer.
OPTIONS: OPTIONS:
--listen value Address to listen on (default: "127.0.0.1:4701") --gui-listen value Address to listen for the GUI on (default: "0.0.0.0:4701")
--nosync don't check full-node sync status (default: false) --nosync don't check full-node sync status (default: false)
--layers value [ --layers value ] list of layers to be interpreted (atop defaults). Default: base --layers value [ --layers value ] list of layers to be interpreted (atop defaults). Default: base
--help, -h show help --help, -h show help
+1 -1
View File
@@ -179,7 +179,7 @@
# The address that should listen for Web GUI requests. # The address that should listen for Web GUI requests.
# #
# type: string # type: string
#GuiAddress = ":4701" #GuiAddress = "0.0.0.0:4701"
[Fees] [Fees]
+1 -1
View File
@@ -331,7 +331,7 @@ const (
func DefaultCurioConfig() *CurioConfig { func DefaultCurioConfig() *CurioConfig {
return &CurioConfig{ return &CurioConfig{
Subsystems: CurioSubsystemsConfig{ Subsystems: CurioSubsystemsConfig{
GuiAddress: ":4701", GuiAddress: "0.0.0.0:4701",
BoostAdapters: []string{}, BoostAdapters: []string{},
RequireActivationSuccess: true, RequireActivationSuccess: true,
RequireNotificationSuccess: true, RequireNotificationSuccess: true,