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 '. | '%s 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 %s can '. | ||||
'reject requests received on external interfaces.', | 'reject requests received on external interfaces.', | ||||
PhabricatorPlatformSite::getName(), | |||||
'SERVER_ADDR', | 'SERVER_ADDR', | ||||
'SERVER_ADDR')); | 'SERVER_ADDR', | ||||
PhabricatorPlatformSite::getName())); | |||||
} | } | ||||
} 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 '. | '%s 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.', | ||||
PhabricatorPlatformSite::getName(), | |||||
$server_addr)); | $server_addr)); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
$site = $this->buildSiteForRequest($request); | $site = $this->buildSiteForRequest($request); | ||||
if ($site->shouldRequireHTTPS()) { | if ($site->shouldRequireHTTPS()) { | ||||
▲ Show 20 Lines • Show All 435 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0