mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
Improved parsing of universal port configuration settings (RIPD-856)
This commit is contained in:
@@ -40,7 +40,7 @@ port_wss_admin
|
|||||||
[port_rpc]
|
[port_rpc]
|
||||||
port = 5005
|
port = 5005
|
||||||
ip = 127.0.0.1
|
ip = 127.0.0.1
|
||||||
admin = allow
|
admin = 127.0.0.1
|
||||||
protocol = https
|
protocol = https
|
||||||
|
|
||||||
[port_peer]
|
[port_peer]
|
||||||
@@ -51,7 +51,7 @@ protocol = peer
|
|||||||
[port_wss_admin]
|
[port_wss_admin]
|
||||||
port = 6006
|
port = 6006
|
||||||
ip = 127.0.0.1
|
ip = 127.0.0.1
|
||||||
admin = allow
|
admin = 127.0.0.1
|
||||||
protocol = wss
|
protocol = wss
|
||||||
|
|
||||||
#[port_ws_public]
|
#[port_ws_public]
|
||||||
|
|||||||
@@ -585,28 +585,25 @@ parse_Port (ParsedPort& port, Section const& section, std::ostream& log)
|
|||||||
port.admin_ip.emplace ();
|
port.admin_ip.emplace ();
|
||||||
while (std::getline (ss, ip, ','))
|
while (std::getline (ss, ip, ','))
|
||||||
{
|
{
|
||||||
beast::IP::Address const addr(
|
auto const addr = beast::IP::Endpoint::from_string_checked (ip);
|
||||||
beast::IP::Endpoint::from_string_altform (ip).address ());
|
if (! addr.second)
|
||||||
|
|
||||||
if (addr.is_any ())
|
|
||||||
{
|
|
||||||
has_any = true;
|
|
||||||
}
|
|
||||||
else if (is_unspecified (addr))
|
|
||||||
{
|
{
|
||||||
log << "Invalid value '" << ip << "' for key 'admin' in ["
|
log << "Invalid value '" << ip << "' for key 'admin' in ["
|
||||||
<< section.name() << "]\n";
|
<< section.name () << "]\n";
|
||||||
throw std::exception ();
|
throw std::exception ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_unspecified (addr.first))
|
||||||
|
has_any = true;
|
||||||
|
|
||||||
if (has_any && ! port.admin_ip->empty ())
|
if (has_any && ! port.admin_ip->empty ())
|
||||||
{
|
{
|
||||||
log << "IP specified with 0.0.0.0 '" << ip <<
|
log << "IP specified along with 0.0.0.0 '" << ip <<
|
||||||
"' for key 'admin' in [" << section.name () << "]\n";
|
"' for key 'admin' in [" << section.name () << "]\n";
|
||||||
throw std::exception ();
|
throw std::exception ();
|
||||||
}
|
}
|
||||||
|
|
||||||
port.admin_ip->emplace_back (addr);
|
port.admin_ip->emplace_back (addr.first.address ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,12 +63,12 @@ exports.servers = {
|
|||||||
|
|
||||||
'port_admin_http': lines('port = 5005',
|
'port_admin_http': lines('port = 5005',
|
||||||
'ip = 127.0.0.1',
|
'ip = 127.0.0.1',
|
||||||
'admin = allow',
|
'admin = 127.0.0.1',
|
||||||
'protocol = http'),
|
'protocol = http'),
|
||||||
|
|
||||||
'port_admin_ws': lines('port = 5006',
|
'port_admin_ws': lines('port = 5006',
|
||||||
'ip = 127.0.0.1',
|
'ip = 127.0.0.1',
|
||||||
'admin = allow',
|
'admin = 127.0.0.1',
|
||||||
'protocol = ws'),
|
'protocol = ws'),
|
||||||
|
|
||||||
'node_db': lines('type=memory',
|
'node_db': lines('type=memory',
|
||||||
|
|||||||
Reference in New Issue
Block a user