Differential D21772 Diff 51908 src/applications/system/controller/PhabricatorSystemReadOnlyController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/system/controller/PhabricatorSystemReadOnlyController.php
Show All 10 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$reason = $request->getURIData('reason'); | $reason = $request->getURIData('reason'); | ||||
$body = array(); | $body = array(); | ||||
switch ($reason) { | switch ($reason) { | ||||
case PhabricatorEnv::READONLY_CONFIG: | case PhabricatorEnv::READONLY_CONFIG: | ||||
$title = pht('Administrative Read-Only Mode'); | $title = pht('Administrative Read-Only Mode'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'An administrator has placed Phabricator into read-only mode.'); | 'An administrator has placed this server into read-only mode.'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'This mode may be used to perform temporary maintenance, test '. | 'This mode may be used to perform temporary maintenance, test '. | ||||
'configuration, or archive an installation permanently.'); | 'configuration, or archive an installation permanently.'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'Read-only mode was enabled by the explicit action of a human '. | 'Read-only mode was enabled by the explicit action of a human '. | ||||
'administrator, so you can get more information about why it '. | 'administrator, so you can get more information about why it '. | ||||
'has been turned on by rolling your chair away from your desk and '. | 'has been turned on by rolling your chair away from your desk and '. | ||||
'yelling "Hey! Why is Phabricator in read-only mode??!" using '. | 'yelling "Hey! Why is %s in read-only mode??!" using '. | ||||
'your very loudest outside voice.'); | 'your very loudest outside voice.', | ||||
PlatformSymbols::getPlatformServerSymbol()); | |||||
$body[] = pht( | $body[] = pht( | ||||
'This mode is active because it is enabled in the configuration '. | 'This mode is active because it is enabled in the configuration '. | ||||
'option "%s".', | 'option "%s".', | ||||
phutil_tag('tt', array(), 'cluster.read-only')); | phutil_tag('tt', array(), 'cluster.read-only')); | ||||
$button = pht('Wait Patiently'); | $button = pht('Wait Patiently'); | ||||
break; | break; | ||||
case PhabricatorEnv::READONLY_MASTERLESS: | case PhabricatorEnv::READONLY_MASTERLESS: | ||||
$title = pht('No Writable Database'); | $title = pht('No Writable Database'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'Phabricator is currently configured with no writable ("master") '. | 'This server is currently configured with no writable ("master") '. | ||||
'database, so it can not write new information anywhere. '. | 'database, so it can not write new information anywhere. '. | ||||
'Phabricator will run in read-only mode until an administrator '. | 'This server will run in read-only mode until an administrator '. | ||||
'reconfigures it with a writable database.'); | 'reconfigures it with a writable database.'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'This usually occurs when an administrator is actively working on '. | 'This usually occurs when an administrator is actively working on '. | ||||
'fixing a temporary configuration or deployment problem.'); | 'fixing a temporary configuration or deployment problem.'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'This mode is active because no database has a "%s" role in '. | 'This mode is active because no database has a "%s" role in '. | ||||
'the configuration option "%s".', | 'the configuration option "%s".', | ||||
phutil_tag('tt', array(), 'master'), | phutil_tag('tt', array(), 'master'), | ||||
phutil_tag('tt', array(), 'cluster.databases')); | phutil_tag('tt', array(), 'cluster.databases')); | ||||
$button = pht('Wait Patiently'); | $button = pht('Wait Patiently'); | ||||
break; | break; | ||||
case PhabricatorEnv::READONLY_UNREACHABLE: | case PhabricatorEnv::READONLY_UNREACHABLE: | ||||
$title = pht('Unable to Reach Master'); | $title = pht('Unable to Reach Master'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'Phabricator was unable to connect to the writable ("master") '. | 'This server was unable to connect to the writable ("master") '. | ||||
'database while handling this request, and automatically degraded '. | 'database while handling this request, and automatically degraded '. | ||||
'into read-only mode.'); | 'into read-only mode.'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'This may happen if there is a temporary network anomaly on the '. | 'This may happen if there is a temporary network anomaly on the '. | ||||
'server side, like cosmic radiation or spooky ghosts. If this '. | 'server side, like cosmic radiation or spooky ghosts. If this '. | ||||
'failure was caused by a transient service interruption, '. | 'failure was caused by a transient service interruption, '. | ||||
'Phabricator will recover momentarily.'); | 'this server will recover momentarily.'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'This may also indicate that a more serious failure has occurred. '. | 'This may also indicate that a more serious failure has occurred. '. | ||||
'If this interruption does not resolve on its own, Phabricator '. | 'If this interruption does not resolve on its own, this server '. | ||||
'will soon detect the persistent disruption and degrade into '. | 'will soon detect the persistent disruption and degrade into '. | ||||
'read-only mode until the issue is resolved.'); | 'read-only mode until the issue is resolved.'); | ||||
$button = pht('Quite Unsettling'); | $button = pht('Quite Unsettling'); | ||||
break; | break; | ||||
case PhabricatorEnv::READONLY_SEVERED: | case PhabricatorEnv::READONLY_SEVERED: | ||||
$title = pht('Severed From Master'); | $title = pht('Severed From Master'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'Phabricator has consistently been unable to reach the writable '. | 'This server has consistently been unable to reach the writable '. | ||||
'("master") database while processing recent requests.'); | '("master") database while processing recent requests.'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'This likely indicates a severe misconfiguration or major service '. | 'This likely indicates a severe misconfiguration or major service '. | ||||
'interruption.'); | 'interruption.'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'Phabricator will periodically retry the connection and recover '. | 'This server will periodically retry the connection and recover '. | ||||
'once service is restored. Most causes of persistent service '. | 'once service is restored. Most causes of persistent service '. | ||||
'interruption will require administrative intervention in order '. | 'interruption will require administrative intervention in order '. | ||||
'to restore service.'); | 'to restore service.'); | ||||
$body[] = pht( | $body[] = pht( | ||||
'Although this may be the result of a misconfiguration or '. | 'Although this may be the result of a misconfiguration or '. | ||||
'operational error, this is also the state you reach if a '. | 'operational error, this is also the state you reach if a '. | ||||
'meteor recently obliterated a datacenter.'); | 'meteor recently obliterated a datacenter.'); | ||||
$button = pht('Panic!'); | $button = pht('Panic!'); | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |