From: Roland Häder Date: Fri, 3 Aug 2012 19:53:18 +0000 (+0000) Subject: Added switch to disable (default=disable) publishing of internal (private) IP address... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f4672875610c9db72c750cdbd288f1ce1c88e8f3;p=hub.git Added switch to disable (default=disable) publishing of internal (private) IP address. You MUST use this when you run a bootstrap node on your LAN --- diff --git a/application/hub/config.php b/application/hub/config.php index ce94011bb..1eb266bb8 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -616,6 +616,9 @@ $cfg->setConfigEntry('internal_ip', ConsoleTools::acquireSelfIPAddress()); // CFG: EXTERNAL-IP $cfg->setConfigEntry('external_ip', ''); +// CFG: ALLOW-PUBLISH-INTERNAL-IP +$cfg->setConfigEntry('allow_publish_internal_ip', 'N'); + // CFG: NODE-STATUS $cfg->setConfigEntry('node_status', 'invalid'); diff --git a/application/hub/main/tools/class_HubTools.php b/application/hub/main/tools/class_HubTools.php index fec7d60c0..0d8b4f0d9 100644 --- a/application/hub/main/tools/class_HubTools.php +++ b/application/hub/main/tools/class_HubTools.php @@ -218,8 +218,11 @@ class HubTools extends BaseHubSystem { * @return $ip The determined external ip of this node */ public static function determineOwnInternalIp () { - // Is the external_ip config entry set? - if (FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_ip') != '') { + // Is the internal_ip config entry set? + if (FrameworkConfiguration::getSelfInstance()->getConfigEntry('allow_publish_internal_ip') == 'N') { + // Not allowed to publish internal IP, so use external + $ip = self::determineOwnExternalIp(); + } elseif (FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_ip') != '') { // Use it as internal ip $ip = FrameworkConfiguration::getSelfInstance()->getConfigEntry('internal_ip'); } else {