Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/option/PhabricatorCoreConfigOptions.php
Show All 32 Lines | public function getOptions() { | ||||
$path = getenv('PATH'); | $path = getenv('PATH'); | ||||
$proto_doc_href = PhabricatorEnv::getDoclink( | $proto_doc_href = PhabricatorEnv::getDoclink( | ||||
'User Guide: Prototype Applications'); | 'User Guide: Prototype Applications'); | ||||
$proto_doc_name = pht('User Guide: Prototype Applications'); | $proto_doc_name = pht('User Guide: Prototype Applications'); | ||||
$applications_app_href = '/applications/'; | $applications_app_href = '/applications/'; | ||||
$silent_description = $this->deformat(pht(<<<EOREMARKUP | $silent_description = $this->deformat(pht(<<<EOREMARKUP | ||||
This option allows you to stop Phabricator from sending data to most external | This option allows you to stop %s from sending data to most external | ||||
services: it will disable email, SMS, repository mirroring, remote builds, | services: it will disable email, SMS, repository mirroring, remote builds, | ||||
Doorkeeper writes, and webhooks. | Doorkeeper writes, and webhooks. | ||||
This option is intended to allow a Phabricator instance to be exported, copied, | This option is intended to allow a %s instance to be exported, copied, | ||||
imported, and run in a test environment without impacting users. For example, | imported, and run in a test environment without impacting users. For example, | ||||
if you are migrating to new hardware, you could perform a test migration first | if you are migrating to new hardware, you could perform a test migration first | ||||
with this flag set, make sure things work, and then do a production cutover | with this flag set, make sure things work, and then do a production cutover | ||||
later with higher confidence and less disruption. | later with higher confidence and less disruption. | ||||
Without making use of this flag to silence the temporary test environment, | Without making use of this flag to silence the temporary test environment, | ||||
users would receive duplicate email during the time the test instance and old | users would receive duplicate email during the time the test instance and old | ||||
production instance were both in operation. | production instance were both in operation. | ||||
EOREMARKUP | EOREMARKUP | ||||
)); | , | ||||
PhabricatorPlatformSite::getName(), | |||||
PhabricatorPlatformSite::getName())); | |||||
$timezone_description = $this->deformat(pht(<<<EOREMARKUP | $timezone_description = $this->deformat(pht(<<<EOREMARKUP | ||||
PHP date functions will emit a warning if they are called when no default | PHP date functions will emit a warning if they are called when no default | ||||
server timezone is configured. | server timezone is configured. | ||||
Usually, you configure a default timezone in `php.ini` by setting the | Usually, you configure a default timezone in `php.ini` by setting the | ||||
configuration value `date.timezone`. | configuration value `date.timezone`. | ||||
If you prefer, you can configure a default timezone here instead. To configure | If you prefer, you can configure a default timezone here instead. To configure | ||||
a default timezone, select a timezone from the | a default timezone, select a timezone from the | ||||
[[ %s | PHP List of Supported Timezones ]]. | [[ %s | PHP List of Supported Timezones ]]. | ||||
EOREMARKUP | EOREMARKUP | ||||
, | , | ||||
'https://php.net/manual/timezones.php')); | 'https://php.net/manual/timezones.php')); | ||||
return array( | return array( | ||||
$this->newOption('phabricator.base-uri', 'string', null) | $this->newOption('phabricator.base-uri', 'string', null) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setSummary(pht('URI where Phabricator is installed.')) | ->setSummary(pht('URI where %s is installed.', | ||||
PhabricatorPlatformSite::getName())) | |||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'Set the URI where Phabricator is installed. Setting this '. | 'Set the URI where %s is installed. Setting this '. | ||||
'improves security by preventing cookies from being set on other '. | 'improves security by preventing cookies from being set on other '. | ||||
'domains, and allows daemons to send emails with links that have '. | 'domains, and allows daemons to send emails with links that have '. | ||||
'the correct domain.')) | 'the correct domain.', | ||||
PhabricatorPlatformSite::getName())) | |||||
->addExample('http://phabricator.example.com/', pht('Valid Setting')), | ->addExample('http://phabricator.example.com/', pht('Valid Setting')), | ||||
$this->newOption('phabricator.production-uri', 'string', null) | $this->newOption('phabricator.production-uri', 'string', null) | ||||
->setSummary( | ->setSummary( | ||||
pht('Primary install URI, for multi-environment installs.')) | pht('Primary install URI, for multi-environment installs.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'If you have multiple Phabricator environments (like a '. | 'If you have multiple %s environments (like a '. | ||||
'development/staging environment for working on testing '. | 'development/staging environment for working on testing '. | ||||
'Phabricator, and a production environment for deploying it), '. | '%s, and a production environment for deploying it), '. | ||||
'set the production environment URI here so that emails and other '. | 'set the production environment URI here so that emails and other '. | ||||
'durable URIs will always generate with links pointing at the '. | 'durable URIs will always generate with links pointing at the '. | ||||
'production environment. If unset, defaults to `%s`. Most '. | 'production environment. If unset, defaults to `%s`. Most '. | ||||
'installs do not need to set this option.', | 'installs do not need to set this option.', | ||||
PhabricatorPlatformSite::getName(), | |||||
PhabricatorPlatformSite::getName(), | |||||
'phabricator.base-uri')) | 'phabricator.base-uri')) | ||||
->addExample('http://phabricator.example.com/', pht('Valid Setting')), | ->addExample('http://phabricator.example.com/', pht('Valid Setting')), | ||||
$this->newOption('phabricator.allowed-uris', 'list<string>', array()) | $this->newOption('phabricator.allowed-uris', 'list<string>', array()) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setSummary(pht('Alternative URIs that can access Phabricator.')) | ->setSummary(pht('Alternative URIs that can access %s.', | ||||
PhabricatorPlatformSite::getName())) | |||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
"These alternative URIs will be able to access 'normal' pages ". | "These alternative URIs will be able to access 'normal' pages ". | ||||
"on your Phabricator install. Other features such as OAuth ". | "on your %s install. Other features such as OAuth ". | ||||
"won't work. The major use case for this is moving installs ". | "won't work. The major use case for this is moving installs ". | ||||
"across domains.")) | "across domains.", | ||||
PhabricatorPlatformSite::getName())) | |||||
->addExample( | ->addExample( | ||||
"http://phabricator2.example.com/\n". | "http://phabricator2.example.com/\n". | ||||
"http://phabricator3.example.com/", | "http://phabricator3.example.com/", | ||||
pht('Valid Setting')), | pht('Valid Setting')), | ||||
$this->newOption('phabricator.timezone', 'string', null) | $this->newOption('phabricator.timezone', 'string', null) | ||||
->setSummary( | ->setSummary( | ||||
pht('The timezone Phabricator should use.')) | pht('The timezone %s should use.', | ||||
PhabricatorPlatformSite::getName())) | |||||
->setDescription($timezone_description) | ->setDescription($timezone_description) | ||||
->addExample('America/New_York', pht('US East (EDT)')) | ->addExample('America/New_York', pht('US East (EDT)')) | ||||
->addExample('America/Chicago', pht('US Central (CDT)')) | ->addExample('America/Chicago', pht('US Central (CDT)')) | ||||
->addExample('America/Boise', pht('US Mountain (MDT)')) | ->addExample('America/Boise', pht('US Mountain (MDT)')) | ||||
->addExample('America/Los_Angeles', pht('US West (PDT)')), | ->addExample('America/Los_Angeles', pht('US West (PDT)')), | ||||
$this->newOption('phabricator.cookie-prefix', 'string', null) | $this->newOption('phabricator.cookie-prefix', 'string', null) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setSummary( | ->setSummary( | ||||
pht( | pht( | ||||
'Set a string Phabricator should use to prefix cookie names.')) | 'Set a string %s should use to prefix cookie names.', | ||||
PhabricatorPlatformSite::getName())) | |||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'Cookies set for x.com are also sent for y.x.com. Assuming '. | 'Cookies set for x.com are also sent for y.x.com. Assuming '. | ||||
'Phabricator instances are running on both domains, this will '. | '%s instances are running on both domains, this will '. | ||||
'create a collision preventing you from logging in.')) | 'create a collision preventing you from logging in.', | ||||
PhabricatorPlatformSite::getName())) | |||||
->addExample('dev', pht('Prefix cookie with "%s"', 'dev')), | ->addExample('dev', pht('Prefix cookie with "%s"', 'dev')), | ||||
$this->newOption('phabricator.show-prototypes', 'bool', false) | $this->newOption('phabricator.show-prototypes', 'bool', false) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setBoolOptions( | ->setBoolOptions( | ||||
array( | array( | ||||
pht('Enable Prototypes'), | pht('Enable Prototypes'), | ||||
pht('Disable Prototypes'), | pht('Disable Prototypes'), | ||||
)) | )) | ||||
->setSummary( | ->setSummary( | ||||
pht( | pht( | ||||
'Install applications which are still under development.')) | 'Install applications which are still under development.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
"IMPORTANT: The upstream does not provide support for prototype ". | "IMPORTANT: The upstream does not provide support for prototype ". | ||||
"applications.". | "applications.". | ||||
"\n\n". | "\n\n". | ||||
"Phabricator includes prototype applications which are in an ". | "%s includes prototype applications which are in an ". | ||||
"**early stage of development**. By default, prototype ". | "**early stage of development**. By default, prototype ". | ||||
"applications are not installed, because they are often not yet ". | "applications are not installed, because they are often not yet ". | ||||
"developed enough to be generally usable. You can enable ". | "developed enough to be generally usable. You can enable ". | ||||
"this option to install them if you're developing Phabricator ". | "this option to install them if you're developing %s ". | ||||
"or are interested in previewing upcoming features.". | "or are interested in previewing upcoming features.". | ||||
"\n\n". | "\n\n". | ||||
"To learn more about prototypes, see [[ %s | %s ]].". | "To learn more about prototypes, see [[ %s | %s ]].". | ||||
"\n\n". | "\n\n". | ||||
"After enabling prototypes, you can selectively uninstall them ". | "After enabling prototypes, you can selectively uninstall them ". | ||||
"(like normal applications).", | "(like normal applications).", | ||||
PhabricatorPlatformSite::getName(), | |||||
PhabricatorPlatformSite::getName(), | |||||
$proto_doc_href, | $proto_doc_href, | ||||
$proto_doc_name)), | $proto_doc_name)), | ||||
$this->newOption('phabricator.serious-business', 'bool', false) | $this->newOption('phabricator.serious-business', 'bool', false) | ||||
->setBoolOptions( | ->setBoolOptions( | ||||
array( | array( | ||||
pht('Serious business'), | pht('Serious business'), | ||||
pht('Shenanigans'), // That should be interesting to translate. :P | pht('Shenanigans'), // That should be interesting to translate. :P | ||||
)) | )) | ||||
->setSummary( | ->setSummary( | ||||
pht('Allows you to remove levity and jokes from the UI.')) | pht('Allows you to remove levity and jokes from the UI.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'By default, Phabricator includes some flavor text in the UI, '. | 'By default, %s includes some flavor text in the UI, '. | ||||
'like a prompt to "Weigh In" rather than "Add Comment" in '. | 'like a prompt to "Weigh In" rather than "Add Comment" in '. | ||||
'Maniphest. If you\'d prefer more traditional UI strings like '. | 'Maniphest. If you\'d prefer more traditional UI strings like '. | ||||
'"Add Comment", you can set this flag to disable most of the '. | '"Add Comment", you can set this flag to disable most of the '. | ||||
'extra flavor.')), | 'extra flavor.', | ||||
PhabricatorPlatformSite::getName())), | |||||
$this->newOption( | $this->newOption( | ||||
'remarkup.ignored-object-names', | 'remarkup.ignored-object-names', | ||||
'string', | 'string', | ||||
// Q1, Q2, etc., are common abbreviations for "Quarter". | // Q1, Q2, etc., are common abbreviations for "Quarter". | ||||
// V1, V2, etc., are common abbreviations for "Version". | // V1, V2, etc., are common abbreviations for "Version". | ||||
// P1, P2, etc., are common abbreviations for "Priority". | // P1, P2, etc., are common abbreviations for "Priority". | ||||
// M1 is a computer chip manufactured by Apple. | // M1 is a computer chip manufactured by Apple. | ||||
// M2 (commonly spelled "M.2") is an expansion slot on motherboards. | // M2 (commonly spelled "M.2") is an expansion slot on motherboards. | ||||
// M4 is a carbine. | // M4 is a carbine. | ||||
// M8 is a phonetic spelling of "mate", used in culturally significant | // M8 is a phonetic spelling of "mate", used in culturally significant | ||||
// copypasta about navy seals. | // copypasta about navy seals. | ||||
'/^(Q|V|M|P)\d$/') | '/^(Q|V|M|P)\d$/') | ||||
->setSummary( | ->setSummary( | ||||
pht('Text values that match this regex and are also object names '. | pht('Text values that match this regex and are also object names '. | ||||
'will not be linked.')) | 'will not be linked.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'By default, Phabricator links object names in Remarkup fields '. | 'By default, %s links object names in Remarkup fields '. | ||||
'to the corresponding object. This regex can be used to modify '. | 'to the corresponding object. This regex can be used to modify '. | ||||
'this behavior; object names that match this regex will not be '. | 'this behavior; object names that match this regex will not be '. | ||||
'linked.')), | 'linked.', | ||||
PhabricatorPlatformSite::getName())), | |||||
$this->newOption('environment.append-paths', 'list<string>', $paths) | $this->newOption('environment.append-paths', 'list<string>', $paths) | ||||
->setSummary( | ->setSummary( | ||||
pht( | pht( | ||||
'These paths get appended to your %s environment variable.', | 'These paths get appended to your %s environment variable.', | ||||
'$PATH')) | '$PATH')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
"Phabricator occasionally shells out to other binaries on the ". | "%s occasionally shells out to other binaries on the ". | ||||
"server. An example of this is the `%s` command, used to ". | "server. An example of this is the `%s` command, used to ". | ||||
"syntax-highlight code written in languages other than PHP. By ". | "syntax-highlight code written in languages other than PHP. By ". | ||||
"default, it is assumed that these binaries are in the %s of the ". | "default, it is assumed that these binaries are in the %s of the ". | ||||
"user running Phabricator (normally 'apache', 'httpd', or ". | "user running %s (normally 'apache', 'httpd', or ". | ||||
"'nobody'). Here you can add extra directories to the %s ". | "'nobody'). Here you can add extra directories to the %s ". | ||||
"environment variable, for when these binaries are in ". | "environment variable, for when these binaries are in ". | ||||
"non-standard locations.\n\n". | "non-standard locations.\n\n". | ||||
"Note that you can also put binaries in `%s` (for example, by ". | "Note that you can also put binaries in `%s` (for example, by ". | ||||
"symlinking them).\n\n". | "symlinking them).\n\n". | ||||
"The current value of PATH after configuration is applied is:\n\n". | "The current value of PATH after configuration is applied is:\n\n". | ||||
" lang=text\n". | " lang=text\n". | ||||
" %s", | " %s", | ||||
PhabricatorPlatformSite::getName(), | |||||
'pygmentize', | 'pygmentize', | ||||
'$PATH', | '$PATH', | ||||
PhabricatorPlatformSite::getName(), | |||||
'$PATH', | '$PATH', | ||||
'phabricator/support/bin/', | 'phabricator/support/bin/', | ||||
$path)) | $path)) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->addExample('/usr/local/bin', pht('Add One Path')) | ->addExample('/usr/local/bin', pht('Add One Path')) | ||||
->addExample("/usr/bin\n/usr/local/bin", pht('Add Multiple Paths')), | ->addExample("/usr/bin\n/usr/local/bin", pht('Add Multiple Paths')), | ||||
$this->newOption('config.lock', 'set', array()) | $this->newOption('config.lock', 'set', array()) | ||||
->setLocked(true) | ->setLocked(true) | ||||
Show All 20 Lines | return array( | ||||
'href' => $applications_app_href, | 'href' => $applications_app_href, | ||||
), | ), | ||||
pht('Applications application')))) | pht('Applications application')))) | ||||
->setDescription( | ->setDescription( | ||||
pht('Array containing list of uninstalled applications.')), | pht('Array containing list of uninstalled applications.')), | ||||
$this->newOption('phabricator.application-settings', 'wild', array()) | $this->newOption('phabricator.application-settings', 'wild', array()) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setDescription( | ->setDescription( | ||||
pht('Customized settings for Phabricator applications.')), | pht('Customized settings for %s applications.', | ||||
PhabricatorPlatformSite::getName())), | |||||
$this->newOption('phabricator.cache-namespace', 'string', 'phabricator') | $this->newOption('phabricator.cache-namespace', 'string', 'phabricator') | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setDescription(pht('Cache namespace.')), | ->setDescription(pht('Cache namespace.')), | ||||
$this->newOption('phabricator.silent', 'bool', false) | $this->newOption('phabricator.silent', 'bool', false) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setBoolOptions( | ->setBoolOptions( | ||||
array( | array( | ||||
pht('Run Silently'), | pht('Run Silently'), | ||||
pht('Run Normally'), | pht('Run Normally'), | ||||
)) | )) | ||||
->setSummary(pht('Stop Phabricator from sending any email, etc.')) | ->setSummary(pht('Stop %s from sending any email, etc.', | ||||
PhabricatorPlatformSite::getName())) | |||||
->setDescription($silent_description), | ->setDescription($silent_description), | ||||
); | ); | ||||
} | } | ||||
protected function didValidateOption( | protected function didValidateOption( | ||||
PhabricatorConfigOption $option, | PhabricatorConfigOption $option, | ||||
$value) { | $value) { | ||||
Show All 27 Lines | if ($key == 'phabricator.base-uri' || | ||||
'http://example/')); | 'http://example/')); | ||||
} | } | ||||
$path = $uri->getPath(); | $path = $uri->getPath(); | ||||
if ($path !== '' && $path !== '/') { | if ($path !== '' && $path !== '/') { | ||||
throw new PhabricatorConfigValidationException( | throw new PhabricatorConfigValidationException( | ||||
pht( | pht( | ||||
"Config option '%s' is invalid. The URI must NOT have a path, ". | "Config option '%s' is invalid. The URI must NOT have a path, ". | ||||
"e.g. '%s' is OK, but '%s' is not. Phabricator must be installed ". | "e.g. '%s' is OK, but '%s' is not. %s must be installed ". | ||||
"on an entire domain; it can not be installed on a path.", | "on an entire domain; it can not be installed on a path.", | ||||
$key, | $key, | ||||
PhabricatorPlatformSite::getName(), | |||||
'http://phabricator.example.com/', | 'http://phabricator.example.com/', | ||||
'http://example.com/phabricator/')); | 'http://example.com/phabricator/')); | ||||
} | } | ||||
} | } | ||||
if ($key === 'phabricator.timezone') { | if ($key === 'phabricator.timezone') { | ||||
$old = date_default_timezone_get(); | $old = date_default_timezone_get(); | ||||
Show All 16 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