Better admin IP management in .cfg (RIPD-820):

* Deprecate rpc_admin_allow section from configuration file
* New port-specific setting 'admin':
  * Comma-separated list of IP addresses that are allowed administrative
    privileges (subject to username & password authentication if configured)
  * 127.0.0.1 is no longer a default admin IP.
  * 0.0.0.0 may be specified to indicate "any IP" but cannot be combined
    with other IP addresses.
This commit is contained in:
Miguel Portilla
2015-03-11 19:02:54 -04:00
committed by Vinnie Falco
parent 97623d20c5
commit 6d79004d4f
12 changed files with 89 additions and 93 deletions

View File

@@ -201,8 +201,6 @@ Config::Config ()
WEBSOCKET_PING_FREQ = (5 * 60);
RPC_ADMIN_ALLOW.push_back (beast::IP::Endpoint::from_string("127.0.0.1"));
PEER_PRIVATE = false;
PEERS_MAX = 0; // indicates "use default"
@@ -431,14 +429,6 @@ void Config::loadFromString (std::string const& fileContents)
if (getSingleSection (secConfig, SECTION_PEERS_MAX, strTemp))
PEERS_MAX = beast::lexicalCastThrow <int> (strTemp);
if (auto s = getIniFileSection (secConfig, SECTION_RPC_ADMIN_ALLOW))
{
std::vector<beast::IP::Endpoint> parsedAddresses;
parseAddresses (parsedAddresses, (*s).cbegin(), (*s).cend());
RPC_ADMIN_ALLOW.insert (RPC_ADMIN_ALLOW.end(),
parsedAddresses.cbegin (), parsedAddresses.cend ());
}
if (getSingleSection (secConfig, SECTION_NODE_SIZE, strTemp))
{
if (strTemp == "tiny")