Skip to content

Use static port for internal webinspector communication#1125

Merged
magomez merged 1 commit intoWebPlatformForEmbedded:wpe-2.38from
LibertyGlobal:jmanko/webinspector_internal_port
Jul 17, 2023
Merged

Use static port for internal webinspector communication#1125
magomez merged 1 commit intoWebPlatformForEmbedded:wpe-2.38from
LibertyGlobal:jmanko/webinspector_internal_port

Conversation

@jacek-manko-red
Copy link
Copy Markdown

With this port being dynamic, it's not possible to add specific iptables rules allowing this traffic - and with restrictive rules this traffic may be blocked. Allow selecting the port - controlled by WEBKIT_INSPECTOR_PORT env

if (port > std::numeric_limits<uint16_t>::max()) {
g_warning("WEBKIT_INSPECTOR_PORT is out of range: %s. Falling back to dynamic port", inspectorPortStr);
port = 0;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be replaced with:

String envVar = String::fromLatin1(getenv("WEBKIT_INSPECTOR_PORT"));
auto port = parseInteger<uint16_t>(envVar).value_or(0);

You can check whether port is 0 after this if you want to log the warning that we're falling back to a dynamic port.

You may need to include <wtf/text/StringToIntegerConversion.h> for it to work.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done.
port will also be 0 if env does not exist or if it's set to "0". Lets skip the log, it's unlikely anyway

With this port being dynamic, it's not possible to add specific iptables rules allowing this traffic -
and with restrictive rules this traffic may be blocked.
Allow selecting the port - controlled by WEBKIT_INSPECTOR_PORT env
@jacek-manko-red jacek-manko-red force-pushed the jmanko/webinspector_internal_port branch from faa40f1 to 21f55e4 Compare July 17, 2023 13:29
@magomez magomez merged commit 61315a4 into WebPlatformForEmbedded:wpe-2.38 Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants