-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: In gnodev, add option web-help-remote, use it in gnoweb #2135
base: master
Are you sure you want to change the base?
Conversation
…rver Signed-off-by: Jeff Thompson <jeff@thefirst.org>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2135 +/- ##
==========================================
- Coverage 49.14% 49.01% -0.14%
==========================================
Files 576 576
Lines 77616 77463 -153
==========================================
- Hits 38148 37971 -177
- Misses 36377 36411 +34
+ Partials 3091 3081 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thinking more about this, I'm not really sure about adding this. I don't want to have to duplicate every flag of |
@gfanton, I don't see an option in gnodev to not start gnoweb. What should we do if we run gnoweb separately? |
I think will should probably add an option to disable
If you run gnoweb separately, you can use the |
Thanks. Sounds good. Do you want me to change this PR to "Add an option to disable |
If I can argue, I think It's my opinion. |
Gnodev should be the go-to tool for developers to work locally and showcase their projects. Running multiple manual containers should be considered advanced, while using gnodev in Docker can be a standard method to isolate multiple services on a server. Therefore, I recommend enabling gnodev to configure gnoweb accordingly. People developing or running standalone Gnoweb should be experienced individuals or actual Gnoweb developers, in my opinion. |
maxGas int64 | ||
chainId string | ||
serverMode bool | ||
webHelpRemote string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Embed gnoweb.Config
instead of using individual gnoweb flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gnodev.Config
should include specific flags and embed configurations like gnoweb.Config
, gnoland.Config
, etc.
webConfig := gnoweb.NewDefaultConfig() | ||
webConfig.RemoteAddr = dnode.GetRemoteAddress() | ||
webConfig.HelpRemote = dnode.GetRemoteAddress() | ||
if cfg.webHelpRemote != "" { | ||
webConfig.HelpRemote = cfg.webHelpRemote | ||
} else { | ||
webConfig.HelpRemote = dnode.GetRemoteAddress() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialize webConfig
on the main struct and manage all flag updates using flags. In essence, inherit and share flag logic from subcomponents like gnoweb, gnoland, etc.
@@ -121,3 +121,4 @@ While `gnodev` is running, the following shortcuts are available: | |||
| --server-mode | disable interaction, and adjust logging for server use. | | |||
| --verbose | enable verbose output for development | | |||
| --web-listener | web server listening address | | |||
| --web-help-remote | web server help page's remote addr | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually, we can use --web-
or --gnoweb-
as prefixes for Gnoweb, and --node-
or --gnoland-
for the node.
gnodev starts gnoweb which can show a help page with the gnokey command for each function. The help for the gnokey command includes
-remote
which is the same as the gnodev listening address. But the gnokey command is meant to be used from a different computer, and the address which gnodev listens on can be different than the address to connect from outside. (In our use case, gnodev runs in a docker container behind a reverse proxy.)The gnoweb command already has an option
-help-remote
which is used on the help page. When gnodev starts gnoweb, it gives its own listening address. This PR adds a gnodev command line option-web-help-remote
. If supplied, this overrides and is used when starting gnoweb.