Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/check/PhabricatorWebServerSetupCheck.php
- This file was added.
<?php | |||||
final class PhabricatorWebServerSetupCheck extends PhabricatorSetupCheck { | |||||
public function getDefaultGroup() { | |||||
return self::GROUP_OTHER; | |||||
} | |||||
protected function executeChecks() { | |||||
return; | |||||
epriestley: Debugging? | |||||
joshuaspenceUnsubmitted Done Inline ActionsOops, yeah. joshuaspence: Oops, yeah. | |||||
$base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri'); | |||||
$base_uri = new PhutilURI($base_uri); | |||||
// If `phabricator.base-uri` is not set then we can't really do anything. | |||||
if (!$base_uri) { | |||||
return; | |||||
} | |||||
// Make sure that we don't recursively call the setup check. | |||||
if (AphrontRequest::getHTTPHeader('X-Phabricator-Setup-Check')) { | |||||
return; | |||||
} | |||||
$base_uri | |||||
->setDomain('127.0.0.1') | |||||
epriestleyAuthorUnsubmitted Done Inline ActionsWhat's the reasoning for this? I'd expect us to just use the same domain? epriestley: What's the reasoning for this? I'd expect us to just use the same domain? | |||||
joshuaspenceUnsubmitted Done Inline ActionsI guess it's probably not worth it, but I figured that you might have to hit the web server directly instead of potentially going through a load balancer. joshuaspence: I guess it's probably not worth it, but I figured that you might have to hit the web server… | |||||
->setPath('/status/'); | |||||
$future = id(new HTTPSFuture($base_uri)) | |||||
->addHeader('Host', $base_uri->getDomain()) | |||||
->addHeader('Accept-Encoding', 'gzip') | |||||
->addHeader('Connection', 'Close') | |||||
->addHeader('X-Phabricator-Setup-Check', true) | |||||
->setTimeout(5); | |||||
list($status, $body, $headers) = $future->resolve(); | |||||
if (BaseHTTPFuture::getHeader($headers, 'Content-Encoding') != 'gzip') { | |||||
$this->newIssue('webserver.gzip') | |||||
->setName(pht('Enable gzip compression')) | |||||
->setMessage(pht('Enable gzip compression.')); | |||||
epriestleyAuthorUnsubmitted Done Inline ActionsWe should expand this but I can counter-diff you on that. epriestley: We should expand this but I can counter-diff you on that. | |||||
joshuaspenceUnsubmitted Done Inline ActionsYeah, I'll expand on this a bit but it's probably better that the copy comes from you. joshuaspence: Yeah, I'll expand on this a bit but it's probably better that the copy comes from you. | |||||
return; | |||||
} | |||||
} | |||||
} |
Debugging?