Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / diffusion / config / PhabricatorDiffusionConfigOptions.php
blobbe889b4cc49ee345bd9ed794b69aae2fb024b4a0
1 <?php
3 final class PhabricatorDiffusionConfigOptions
4 extends PhabricatorApplicationConfigOptions {
6 public function getName() {
7 return pht('Diffusion');
10 public function getDescription() {
11 return pht('Configure Diffusion repository browsing.');
14 public function getIcon() {
15 return 'fa-code';
18 public function getGroup() {
19 return 'apps';
22 public function getOptions() {
23 $custom_field_type = 'custom:PhabricatorCustomFieldConfigOptionType';
25 $fields = array(
26 new PhabricatorCommitRepositoryField(),
27 new PhabricatorCommitBranchesField(),
28 new PhabricatorCommitTagsField(),
29 new PhabricatorCommitMergedCommitsField(),
32 $default_fields = array();
33 foreach ($fields as $field) {
34 $default_fields[$field->getFieldKey()] = array(
35 'disabled' => $field->shouldDisableByDefault(),
39 return array(
40 $this->newOption(
41 'metamta.diffusion.attach-patches',
42 'bool',
43 false)
44 ->setBoolOptions(
45 array(
46 pht('Attach Patches'),
47 pht('Do Not Attach Patches'),
49 ->setDescription(
50 pht(
51 'Set this to true if you want patches to be attached to commit '.
52 'notifications from Diffusion.')),
53 $this->newOption('metamta.diffusion.inline-patches', 'int', 0)
54 ->setSummary(pht('Include patches in Diffusion mail as body text.'))
55 ->setDescription(
56 pht(
57 'To include patches in Diffusion email bodies, set this to a '.
58 'positive integer. Patches will be inlined if they are at most '.
59 'that many lines. By default, patches are not inlined.')),
60 $this->newOption('metamta.diffusion.byte-limit', 'int', 1024 * 1024)
61 ->setDescription(pht('Hard byte limit on including patches in email.')),
62 $this->newOption('metamta.diffusion.time-limit', 'int', 60)
63 ->setDescription(pht('Hard time limit on generating patches.')),
65 $this->newOption(
66 'audit.can-author-close-audit',
67 'bool',
68 false)
69 ->setBoolOptions(
70 array(
71 pht('Enable Self-Accept'),
72 pht('Disable Self-Accept'),
74 ->setDescription(
75 pht(
76 'Allows the author of a commit to be an auditor and accept their '.
77 'own commits. Note that this behavior is different from the '.
78 'behavior implied by the name of the option: long ago, it did '.
79 'something else.')),
81 $this->newOption('bugtraq.url', 'string', null)
82 ->addExample('https://bugs.php.net/%BUGID%', pht('PHP bugs'))
83 ->addExample('/%BUGID%', pht('Local Maniphest URL'))
84 ->setDescription(
85 pht(
86 'URL of external bug tracker used by Diffusion. %s will be '.
87 'substituted by the bug ID.',
88 '%BUGID%')),
89 $this->newOption('bugtraq.logregex', 'list<regex>', array())
90 ->addExample(array('/\B#([1-9]\d*)\b/'), pht('Issue #123'))
91 ->addExample(
92 array('/[Ii]ssues?:?(\s*,?\s*#\d+)+/', '/(\d+)/'),
93 pht('Issue #123, #456'))
94 ->addExample(array('/(?<!#)\b(T[1-9]\d*)\b/'), pht('Task T123'))
95 ->addExample('/[A-Z]{2,}-\d+/', pht('JIRA-1234'))
96 ->setDescription(
97 pht(
98 'Regular expression to link external bug tracker. See '.
99 'http://tortoisesvn.net/docs/release/TortoiseSVN_en/'.
100 'tsvn-dug-bugtracker.html for further explanation.')),
101 $this->newOption('diffusion.allow-http-auth', 'bool', false)
102 ->setBoolOptions(
103 array(
104 pht('Allow HTTP Basic Auth'),
105 pht('Disallow HTTP Basic Auth'),
107 ->setSummary(pht('Enable HTTP Basic Auth for repositories.'))
108 ->setDescription(
109 pht(
110 "Phabricator can serve repositories over HTTP, using HTTP basic ".
111 "auth.\n\n".
112 "Because HTTP basic auth is less secure than SSH auth, it is ".
113 "disabled by default. You can enable it here if you'd like to use ".
114 "it anyway. There's nothing fundamentally insecure about it as ".
115 "long as Phabricator uses HTTPS, but it presents a much lower ".
116 "barrier to attackers than SSH does.\n\n".
117 "Consider using SSH for authenticated access to repositories ".
118 "instead of HTTP.")),
119 $this->newOption('diffusion.allow-git-lfs', 'bool', false)
120 ->setBoolOptions(
121 array(
122 pht('Allow Git LFS'),
123 pht('Disallow Git LFS'),
125 ->setLocked(true)
126 ->setSummary(pht('Allow Git Large File Storage (LFS).'))
127 ->setDescription(
128 pht(
129 'Phabricator supports Git LFS, a Git extension for storing large '.
130 'files alongside a repository. Activate this setting to allow '.
131 'the extension to store file data in Phabricator.')),
132 $this->newOption('diffusion.ssh-user', 'string', null)
133 ->setLocked(true)
134 ->setSummary(pht('Login username for SSH connections to repositories.'))
135 ->setDescription(
136 pht(
137 'When constructing clone URIs to show to users, Diffusion will '.
138 'fill in this login username. If you have configured a VCS user '.
139 'like `git`, you should provide it here.')),
140 $this->newOption('diffusion.ssh-port', 'int', null)
141 ->setLocked(true)
142 ->setSummary(pht('Port for SSH connections to repositories.'))
143 ->setDescription(
144 pht(
145 'When constructing clone URIs to show to users, Diffusion by '.
146 'default will not display a port assuming the default for your '.
147 'VCS. Explicitly declare when running on a non-standard port.')),
148 $this->newOption('diffusion.ssh-host', 'string', null)
149 ->setLocked(true)
150 ->setSummary(pht('Host for SSH connections to repositories.'))
151 ->setDescription(
152 pht(
153 'If you accept Phabricator SSH traffic on a different host '.
154 'from web traffic (for example, if you use different SSH and '.
155 'web load balancers), you can set the SSH hostname here. This '.
156 'is an advanced option.')),
157 $this->newOption('diffusion.fields', $custom_field_type, $default_fields)
158 ->setCustomData(
159 id(new PhabricatorRepositoryCommit())
160 ->getCustomFieldBaseClass())
161 ->setDescription(
162 pht('Select and reorder Diffusion fields.')),