Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/option/PhabricatorClusterConfigOptions.php
<?php | <?php | ||||
final class PhabricatorClusterConfigOptions | final class PhabricatorClusterConfigOptions | ||||
extends PhabricatorApplicationConfigOptions { | extends PhabricatorApplicationConfigOptions { | ||||
public function getName() { | public function getName() { | ||||
return pht('Cluster Setup'); | return pht('Cluster Setup'); | ||||
} | } | ||||
public function getDescription() { | public function getDescription() { | ||||
return pht('Configure Phabricator to run on a cluster of hosts.'); | return pht('Configure services to run on a cluster of hosts.'); | ||||
} | } | ||||
public function getIcon() { | public function getIcon() { | ||||
return 'fa-sitemap'; | return 'fa-sitemap'; | ||||
} | } | ||||
public function getGroup() { | public function getGroup() { | ||||
return 'core'; | return 'core'; | ||||
} | } | ||||
public function getOptions() { | public function getOptions() { | ||||
$databases_type = 'cluster.databases'; | $databases_type = 'cluster.databases'; | ||||
$databases_help = $this->deformat(pht(<<<EOTEXT | $databases_help = $this->deformat(pht(<<<EOTEXT | ||||
WARNING: This is a prototype option and the description below is currently pure | WARNING: This is a prototype option and the description below is currently pure | ||||
fantasy. | fantasy. | ||||
This option allows you to make Phabricator aware of database read replicas so | This option allows you to make this service aware of database read replicas so | ||||
it can monitor database health, spread load, and degrade gracefully to | it can monitor database health, spread load, and degrade gracefully to | ||||
read-only mode in the event of a failure on the primary host. For help with | read-only mode in the event of a failure on the primary host. For help with | ||||
configuring cluster databases, see **[[ %s | %s ]]** in the documentation. | configuring cluster databases, see **[[ %s | %s ]]** in the documentation. | ||||
EOTEXT | EOTEXT | ||||
, | , | ||||
PhabricatorEnv::getDoclink('Cluster: Databases'), | PhabricatorEnv::getDoclink('Cluster: Databases'), | ||||
pht('Cluster: Databases'))); | pht('Cluster: Databases'))); | ||||
Show All 13 Lines | EOTEXT | ||||
pht('Cluster: Search'))); | pht('Cluster: Search'))); | ||||
return array( | return array( | ||||
$this->newOption('cluster.addresses', 'list<string>', array()) | $this->newOption('cluster.addresses', 'list<string>', array()) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setSummary(pht('Address ranges of cluster hosts.')) | ->setSummary(pht('Address ranges of cluster hosts.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'Define a Phabricator cluster by providing a whitelist of host '. | 'Define a cluster by providing a whitelist of host '. | ||||
'addresses that are part of the cluster.'. | 'addresses that are part of the cluster.'. | ||||
"\n\n". | "\n\n". | ||||
'Hosts on this whitelist have special powers. These hosts are '. | 'Hosts on this whitelist have special powers. These hosts are '. | ||||
'permitted to bend security rules, and misconfiguring this list '. | 'permitted to bend security rules, and misconfiguring this list '. | ||||
'can make your install less secure. For more information, '. | 'can make your install less secure. For more information, '. | ||||
'see **[[ %s | %s ]]**.'. | 'see **[[ %s | %s ]]**.'. | ||||
"\n\n". | "\n\n". | ||||
'Define a list of CIDR blocks which whitelist all hosts in the '. | 'Define a list of CIDR blocks which whitelist all hosts in the '. | ||||
'cluster and no additional hosts. See the examples below for '. | 'cluster and no additional hosts. See the examples below for '. | ||||
'details.'. | 'details.'. | ||||
"\n\n". | "\n\n". | ||||
'When cluster addresses are defined, Phabricator hosts will also '. | 'When cluster addresses are defined, hosts will also '. | ||||
'reject requests to interfaces which are not whitelisted.', | 'reject requests to interfaces which are not whitelisted.', | ||||
$intro_href, | $intro_href, | ||||
$intro_name)) | $intro_name)) | ||||
->addExample( | ->addExample( | ||||
array( | array( | ||||
'23.24.25.80/32', | '23.24.25.80/32', | ||||
'23.24.25.81/32', | '23.24.25.81/32', | ||||
), | ), | ||||
Show All 17 Lines | return array( | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setSummary(pht('Instance identifier for multi-tenant clusters.')) | ->setSummary(pht('Instance identifier for multi-tenant clusters.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'WARNING: This is a very advanced option, and only useful for '. | 'WARNING: This is a very advanced option, and only useful for '. | ||||
'hosting providers running multi-tenant clusters.'. | 'hosting providers running multi-tenant clusters.'. | ||||
"\n\n". | "\n\n". | ||||
'If you provide an instance identifier here (normally by '. | 'If you provide an instance identifier here (normally by '. | ||||
'injecting it with a `%s`), Phabricator will pass it to '. | 'injecting it with a `%s`), the server will pass it to '. | ||||
'subprocesses and commit hooks in the `%s` environmental variable.', | 'subprocesses and commit hooks in the `%s` environmental variable.', | ||||
'PhabricatorConfigSiteSource', | 'PhabricatorConfigSiteSource', | ||||
'PHABRICATOR_INSTANCE')), | 'PHABRICATOR_INSTANCE')), | ||||
$this->newOption('cluster.read-only', 'bool', false) | $this->newOption('cluster.read-only', 'bool', false) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setSummary( | ->setSummary( | ||||
pht( | pht( | ||||
'Activate read-only mode for maintenance or disaster recovery.')) | 'Activate read-only mode for maintenance or disaster recovery.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'WARNING: This is a prototype option and the description below '. | 'WARNING: This is a prototype option and the description below '. | ||||
'is currently pure fantasy.'. | 'is currently pure fantasy.'. | ||||
"\n\n". | "\n\n". | ||||
'Switch Phabricator to read-only mode. In this mode, users will '. | 'Switch the service to read-only mode. In this mode, users will '. | ||||
'be unable to write new data. Normally, the cluster degrades '. | 'be unable to write new data. Normally, the cluster degrades '. | ||||
'into this mode automatically when it detects that the database '. | 'into this mode automatically when it detects that the database '. | ||||
'master is unreachable, but you can activate it manually in '. | 'master is unreachable, but you can activate it manually in '. | ||||
'order to perform maintenance or test configuration.')), | 'order to perform maintenance or test configuration.')), | ||||
$this->newOption('cluster.databases', $databases_type, array()) | $this->newOption('cluster.databases', $databases_type, array()) | ||||
->setHidden(true) | ->setHidden(true) | ||||
->setSummary( | ->setSummary( | ||||
pht('Configure database read replicas.')) | pht('Configure database read replicas.')) | ||||
Show All 20 Lines |