You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CorePropertyDefinitions.java 9.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2020 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonar.core.config;
  21. import java.util.ArrayList;
  22. import java.util.List;
  23. import org.sonar.api.CoreProperties;
  24. import org.sonar.api.PropertyType;
  25. import org.sonar.api.config.EmailSettings;
  26. import org.sonar.api.config.PropertyDefinition;
  27. import org.sonar.api.resources.Qualifiers;
  28. import static java.util.Arrays.asList;
  29. import static org.sonar.api.PropertyType.BOOLEAN;
  30. import static org.sonar.api.PropertyType.STRING;
  31. public class CorePropertyDefinitions {
  32. public static final String SONAR_ANALYSIS = "sonar.analysis.";
  33. private static final String CATEGORY_ORGANIZATIONS = "organizations";
  34. public static final String ORGANIZATIONS_ANYONE_CAN_CREATE = "sonar.organizations.anyoneCanCreate";
  35. public static final String ORGANIZATIONS_CREATE_PERSONAL_ORG = "sonar.organizations.createPersonalOrg";
  36. public static final String DISABLE_NOTIFICATION_ON_BUILT_IN_QPROFILES = "sonar.builtInQualityProfiles.disableNotificationOnUpdate";
  37. private CorePropertyDefinitions() {
  38. // only static stuff
  39. }
  40. public static List<PropertyDefinition> all() {
  41. List<PropertyDefinition> defs = new ArrayList<>();
  42. defs.addAll(IssueExclusionProperties.all());
  43. defs.addAll(ExclusionProperties.all());
  44. defs.addAll(SecurityProperties.all());
  45. defs.addAll(DebtProperties.all());
  46. defs.addAll(PurgeProperties.all());
  47. defs.addAll(EmailSettings.definitions());
  48. defs.addAll(ScannerProperties.all());
  49. defs.addAll(SvnProperties.all());
  50. defs.addAll(asList(
  51. PropertyDefinition.builder(CoreProperties.MODULE_LEVEL_ARCHIVED_SETTINGS)
  52. .name("Archived Sub-Projects Settings")
  53. .description("DEPRECATED - List of the properties that were previously configured at sub-project / module level. " +
  54. "These properties are not used anymore and should now be configured at project level. When you've made the " +
  55. "necessary changes, clear this setting to prevent analysis from showing a warning about it.")
  56. .category(CoreProperties.CATEGORY_GENERAL)
  57. .subCategory(CoreProperties.SUBCATEGORY_MODULES)
  58. .onlyOnQualifiers(Qualifiers.PROJECT)
  59. .type(PropertyType.TEXT)
  60. .build(),
  61. PropertyDefinition.builder(CoreProperties.SERVER_BASE_URL)
  62. .name("Server base URL")
  63. .description("HTTP URL of this SonarQube server, such as <i>http://yourhost.yourdomain/sonar</i>. This value is used i.e. to create links in emails.")
  64. .category(CoreProperties.CATEGORY_GENERAL)
  65. .build(),
  66. PropertyDefinition.builder(CoreProperties.ENCRYPTION_SECRET_KEY_PATH)
  67. .name("Encryption secret key path")
  68. .description("Path to a file that contains encryption secret key that is used to encrypting other settings.")
  69. .type(STRING)
  70. .hidden()
  71. .build(),
  72. PropertyDefinition.builder("sonar.authenticator.downcase")
  73. .name("Downcase login")
  74. .description("Downcase login during user authentication, typically for Active Directory")
  75. .type(BOOLEAN)
  76. .defaultValue(String.valueOf(false))
  77. .hidden()
  78. .build(),
  79. PropertyDefinition.builder(DISABLE_NOTIFICATION_ON_BUILT_IN_QPROFILES)
  80. .name("Avoid quality profiles notification")
  81. .description("Avoid sending email notification on each update of built-in quality profiles to quality profile administrators.")
  82. .defaultValue(Boolean.toString(false))
  83. .category(CoreProperties.CATEGORY_GENERAL)
  84. .type(BOOLEAN)
  85. .build(),
  86. // WEB LOOK&FEEL
  87. PropertyDefinition.builder(WebConstants.SONAR_LF_LOGO_URL)
  88. .deprecatedKey("sonar.branding.image")
  89. .name("Logo URL")
  90. .description("URL to logo image. Any standard format is accepted.")
  91. .category(CoreProperties.CATEGORY_GENERAL)
  92. .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL)
  93. .build(),
  94. PropertyDefinition.builder(WebConstants.SONAR_LF_LOGO_WIDTH_PX)
  95. .deprecatedKey("sonar.branding.image.width")
  96. .name("Width of image in pixels")
  97. .description("Width in pixels, given that the height of the the image is constrained to 30px.")
  98. .category(CoreProperties.CATEGORY_GENERAL)
  99. .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL)
  100. .build(),
  101. PropertyDefinition.builder(WebConstants.SONAR_LF_ENABLE_GRAVATAR)
  102. .name("Enable support of gravatars")
  103. .description("Gravatars are profile pictures of users based on their email.")
  104. .type(BOOLEAN)
  105. .defaultValue(String.valueOf(false))
  106. .category(CoreProperties.CATEGORY_GENERAL)
  107. .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL)
  108. .build(),
  109. PropertyDefinition.builder(WebConstants.SONAR_LF_GRAVATAR_SERVER_URL)
  110. .name("Gravatar URL")
  111. .description("Optional URL of custom Gravatar service. Accepted variables are {EMAIL_MD5} for MD5 hash of email and {SIZE} for the picture size in pixels.")
  112. .defaultValue("https://secure.gravatar.com/avatar/{EMAIL_MD5}.jpg?s={SIZE}&d=identicon")
  113. .category(CoreProperties.CATEGORY_GENERAL)
  114. .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL)
  115. .build(),
  116. PropertyDefinition.builder(WebConstants.SONAR_LF_ABOUT_TEXT)
  117. .name("About page text")
  118. .description("Optional text that is displayed on the About page. Supports html.")
  119. .category(CoreProperties.CATEGORY_GENERAL)
  120. .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL)
  121. .type(PropertyType.TEXT)
  122. .build(),
  123. // ISSUES
  124. PropertyDefinition.builder(CoreProperties.DEVELOPER_AGGREGATED_INFO_DISABLED)
  125. .name("Disable developer aggregated information")
  126. .description("Don't show issue facets aggregating information per developer")
  127. .category(CoreProperties.CATEGORY_GENERAL)
  128. .subCategory(CoreProperties.SUBCATEGORY_ISSUES)
  129. .onQualifiers(Qualifiers.PROJECT)
  130. .type(BOOLEAN)
  131. .defaultValue(Boolean.toString(false))
  132. .build(),
  133. PropertyDefinition.builder(CoreProperties.DEFAULT_ISSUE_ASSIGNEE)
  134. .name("Default Assignee")
  135. .description("New issues will be assigned to this user each time it is not possible to determine the user who is the author of the issue.")
  136. .category(CoreProperties.CATEGORY_GENERAL)
  137. .subCategory(CoreProperties.SUBCATEGORY_ISSUES)
  138. .onQualifiers(Qualifiers.PROJECT)
  139. .type(PropertyType.USER_LOGIN)
  140. .build(),
  141. // CPD
  142. PropertyDefinition.builder(CoreProperties.CPD_CROSS_PROJECT)
  143. .defaultValue(Boolean.toString(false))
  144. .name("Cross project duplication detection")
  145. .description("DEPRECATED - By default, SonarQube detects duplications at project level. This means that a block "
  146. + "duplicated on two different projects won't be reported. Setting this parameter to \"true\" "
  147. + "allows to detect duplicates across projects. Note that activating "
  148. + "this property will significantly increase each SonarQube analysis time, "
  149. + "and therefore badly impact the performances of report processing as more and more projects "
  150. + "are getting involved in this cross project duplication mechanism.")
  151. .onQualifiers(Qualifiers.PROJECT)
  152. .category(CoreProperties.CATEGORY_GENERAL)
  153. .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS)
  154. .type(BOOLEAN)
  155. .build(),
  156. PropertyDefinition.builder(CoreProperties.CPD_EXCLUSIONS)
  157. .defaultValue("")
  158. .name("Duplication Exclusions")
  159. .description("Patterns used to exclude some source files from the duplication detection mechanism. " +
  160. "See below to know how to use wildcards to specify this property.")
  161. .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE)
  162. .category(CoreProperties.CATEGORY_EXCLUSIONS)
  163. .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS_EXCLUSIONS)
  164. .multiValues(true)
  165. .build(),
  166. // ORGANIZATIONS
  167. PropertyDefinition.builder(ORGANIZATIONS_ANYONE_CAN_CREATE)
  168. .name("Allow any authenticated user to create organizations.")
  169. .defaultValue(Boolean.toString(false))
  170. .category(CATEGORY_ORGANIZATIONS)
  171. .type(BOOLEAN)
  172. .hidden()
  173. .build(),
  174. PropertyDefinition.builder(ORGANIZATIONS_CREATE_PERSONAL_ORG)
  175. .name("Create an organization for each new user.")
  176. .defaultValue(Boolean.toString(false))
  177. .category(CATEGORY_ORGANIZATIONS)
  178. .type(BOOLEAN)
  179. .hidden()
  180. .build()));
  181. return defs;
  182. }
  183. }