From f4672875610c9db72c750cdbd288f1ce1c88e8f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 3 Aug 2012 19:53:18 +0000 Subject: [PATCH] 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 --- application/hub/config.php | 3 +++ application/hub/main/tools/class_HubTools.php | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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 { -- 2.39.5