Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/configuration/AphrontApplicationConfiguration.php
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | public function getPath() { | ||||
return $this->path; | return $this->path; | ||||
} | } | ||||
/** | /** | ||||
* @phutil-external-symbol class PhabricatorStartup | * @phutil-external-symbol class PhabricatorStartup | ||||
*/ | */ | ||||
public static function runHTTPRequest(AphrontHTTPSink $sink) { | public static function runHTTPRequest(AphrontHTTPSink $sink) { | ||||
if (isset($_SERVER['HTTP_X_PHABRICATOR_SELFCHECK'])) { | if (isset($_SERVER['HTTP_X_SETUP_SELFCHECK'])) { | ||||
$response = self::newSelfCheckResponse(); | $response = self::newSelfCheckResponse(); | ||||
return self::writeResponse($sink, $response); | return self::writeResponse($sink, $response); | ||||
} | } | ||||
PhabricatorStartup::beginStartupPhase('multimeter'); | PhabricatorStartup::beginStartupPhase('multimeter'); | ||||
$multimeter = MultimeterControl::newInstance(); | $multimeter = MultimeterControl::newInstance(); | ||||
$multimeter->setEventContext('<http-init>'); | $multimeter->setEventContext('<http-init>'); | ||||
$multimeter->setEventViewer('<none>'); | $multimeter->setEventViewer('<none>'); | ||||
▲ Show 20 Lines • Show All 319 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 |
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