Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/configuration/AphrontApplicationConfiguration.php
Show First 20 Lines • Show All 413 Lines • ▼ Show 20 Lines | if ($cluster_addresses) { | ||||
if (!$server_addr) { | if (!$server_addr) { | ||||
if (php_sapi_name() == 'cli') { | if (php_sapi_name() == 'cli') { | ||||
// This is a command line script (probably something like a unit | // This is a command line script (probably something like a unit | ||||
// test) so it's fine that we don't have SERVER_ADDR defined. | // test) so it's fine that we don't have SERVER_ADDR defined. | ||||
} else { | } else { | ||||
throw new AphrontMalformedRequestException( | throw new AphrontMalformedRequestException( | ||||
pht('No %s', 'SERVER_ADDR'), | pht('No %s', 'SERVER_ADDR'), | ||||
pht( | pht( | ||||
'Phabricator is configured to operate in cluster mode, but '. | 'This service is configured to operate in cluster mode, but '. | ||||
'%s is not defined in the request context. Your webserver '. | '%s is not defined in the request context. Your webserver '. | ||||
'configuration needs to forward %s to PHP so Phabricator can '. | 'configuration needs to forward %s to PHP so the software can '. | ||||
'reject requests received on external interfaces.', | 'reject requests received on external interfaces.', | ||||
'SERVER_ADDR', | 'SERVER_ADDR', | ||||
'SERVER_ADDR')); | 'SERVER_ADDR')); | ||||
} | } | ||||
} else { | } else { | ||||
if (!PhabricatorEnv::isClusterAddress($server_addr)) { | if (!PhabricatorEnv::isClusterAddress($server_addr)) { | ||||
throw new AphrontMalformedRequestException( | throw new AphrontMalformedRequestException( | ||||
pht('External Interface'), | pht('External Interface'), | ||||
pht( | pht( | ||||
'Phabricator is configured in cluster mode and the address '. | 'This service is configured in cluster mode and the address '. | ||||
'this request was received on ("%s") is not whitelisted as '. | 'this request was received on ("%s") is not whitelisted as '. | ||||
'a cluster address.', | 'a cluster address.', | ||||
$server_addr)); | $server_addr)); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
$site = $this->buildSiteForRequest($request); | $site = $this->buildSiteForRequest($request); | ||||
▲ Show 20 Lines • Show All 437 Lines • Show Last 20 Lines |