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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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(asList(
  50. PropertyDefinition.builder(CoreProperties.MODULE_LEVEL_ARCHIVED_SETTINGS)
  51. .name("Archived Sub-Projects Settings")
  52. .description("DEPRECATED - List of the properties that were previously configured at sub-project / module level. " +
  53. "These properties are not used anymore and should now be configured at project level. When you've made the " +
  54. "necessary changes, clear this setting to prevent analysis from showing a warning about it.")
  55. .category(CoreProperties.CATEGORY_GENERAL)
  56. .subCategory(CoreProperties.SUBCATEGORY_MODULES)
  57. .onlyOnQualifiers(Qualifiers.PROJECT)
  58. .type(PropertyType.TEXT)
  59. .build(),
  60. PropertyDefinition.builder(CoreProperties.SERVER_BASE_URL)
  61. .name("Server base URL")
  62. .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.")
  63. .category(CoreProperties.CATEGORY_GENERAL)
  64. .build(),
  65. PropertyDefinition.builder(CoreProperties.ENCRYPTION_SECRET_KEY_PATH)
  66. .name("Encryption secret key path")
  67. .description("Path to a file that contains encryption secret key that is used to encrypting other settings.")
  68. .type(STRING)
  69. .hidden()
  70. .build(),
  71. PropertyDefinition.builder("sonar.authenticator.downcase")
  72. .name("Downcase login")
  73. .description("Downcase login during user authentication, typically for Active Directory")
  74. .type(BOOLEAN)
  75. .defaultValue(String.valueOf(false))
  76. .hidden()
  77. .build(),
  78. PropertyDefinition.builder(DISABLE_NOTIFICATION_ON_BUILT_IN_QPROFILES)
  79. .name("Avoid quality profiles notification")
  80. .description("Avoid sending email notification on each update of built-in quality profiles to quality profile administrators.")
  81. .defaultValue(Boolean.toString(false))
  82. .category(CoreProperties.CATEGORY_GENERAL)
  83. .type(BOOLEAN)
  84. .build(),
  85. // WEB LOOK&FEEL
  86. PropertyDefinition.builder(WebConstants.SONAR_LF_LOGO_URL)
  87. .deprecatedKey("sonar.branding.image")
  88. .name("Logo URL")
  89. .description("URL to logo image. Any standard format is accepted.")
  90. .category(CoreProperties.CATEGORY_GENERAL)
  91. .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL)
  92. .build(),
  93. PropertyDefinition.builder(WebConstants.SONAR_LF_LOGO_WIDTH_PX)
  94. .deprecatedKey("sonar.branding.image.width")
  95. .name("Width of image in pixels")
  96. .description("Width in pixels, given that the height of the the image is constrained to 30px.")
  97. .category(CoreProperties.CATEGORY_GENERAL)
  98. .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL)
  99. .build(),
  100. PropertyDefinition.builder(WebConstants.SONAR_LF_ENABLE_GRAVATAR)
  101. .name("Enable support of gravatars")
  102. .description("Gravatars are profile pictures of users based on their email.")
  103. .type(BOOLEAN)
  104. .defaultValue(String.valueOf(false))
  105. .category(CoreProperties.CATEGORY_GENERAL)
  106. .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL)
  107. .build(),
  108. PropertyDefinition.builder(WebConstants.SONAR_LF_GRAVATAR_SERVER_URL)
  109. .name("Gravatar URL")
  110. .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.")
  111. .defaultValue("https://secure.gravatar.com/avatar/{EMAIL_MD5}.jpg?s={SIZE}&d=identicon")
  112. .category(CoreProperties.CATEGORY_GENERAL)
  113. .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL)
  114. .build(),
  115. PropertyDefinition.builder(WebConstants.SONAR_LF_ABOUT_TEXT)
  116. .name("About page text")
  117. .description("Optional text that is displayed on the About page. Supports html.")
  118. .category(CoreProperties.CATEGORY_GENERAL)
  119. .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL)
  120. .type(PropertyType.TEXT)
  121. .build(),
  122. // ISSUES
  123. PropertyDefinition.builder(CoreProperties.DEVELOPER_AGGREGATED_INFO_DISABLED)
  124. .name("Disable developer aggregated information")
  125. .description("Don't show issue facets aggregating information per developer")
  126. .category(CoreProperties.CATEGORY_GENERAL)
  127. .subCategory(CoreProperties.SUBCATEGORY_ISSUES)
  128. .onQualifiers(Qualifiers.PROJECT)
  129. .type(BOOLEAN)
  130. .defaultValue(Boolean.toString(false))
  131. .build(),
  132. PropertyDefinition.builder(CoreProperties.DEFAULT_ISSUE_ASSIGNEE)
  133. .name("Default Assignee")
  134. .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.")
  135. .category(CoreProperties.CATEGORY_GENERAL)
  136. .subCategory(CoreProperties.SUBCATEGORY_ISSUES)
  137. .onQualifiers(Qualifiers.PROJECT)
  138. .type(PropertyType.USER_LOGIN)
  139. .build(),
  140. // CPD
  141. PropertyDefinition.builder(CoreProperties.CPD_CROSS_PROJECT)
  142. .defaultValue(Boolean.toString(false))
  143. .name("Cross project duplication detection")
  144. .description("DEPRECATED - By default, SonarQube detects duplications at project level. This means that a block "
  145. + "duplicated on two different projects won't be reported. Setting this parameter to \"true\" "
  146. + "allows to detect duplicates across projects. Note that activating "
  147. + "this property will significantly increase each SonarQube analysis time, "
  148. + "and therefore badly impact the performances of report processing as more and more projects "
  149. + "are getting involved in this cross project duplication mechanism.")
  150. .onQualifiers(Qualifiers.PROJECT)
  151. .category(CoreProperties.CATEGORY_GENERAL)
  152. .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS)
  153. .type(BOOLEAN)
  154. .build(),
  155. PropertyDefinition.builder(CoreProperties.CPD_EXCLUSIONS)
  156. .defaultValue("")
  157. .name("Duplication Exclusions")
  158. .description("Patterns used to exclude some source files from the duplication detection mechanism. " +
  159. "See below to know how to use wildcards to specify this property.")
  160. .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE)
  161. .category(CoreProperties.CATEGORY_EXCLUSIONS)
  162. .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS_EXCLUSIONS)
  163. .multiValues(true)
  164. .build(),
  165. // ORGANIZATIONS
  166. PropertyDefinition.builder(ORGANIZATIONS_ANYONE_CAN_CREATE)
  167. .name("Allow any authenticated user to create organizations.")
  168. .defaultValue(Boolean.toString(false))
  169. .category(CATEGORY_ORGANIZATIONS)
  170. .type(BOOLEAN)
  171. .hidden()
  172. .build(),
  173. PropertyDefinition.builder(ORGANIZATIONS_CREATE_PERSONAL_ORG)
  174. .name("Create an organization for each new user.")
  175. .defaultValue(Boolean.toString(false))
  176. .category(CATEGORY_ORGANIZATIONS)
  177. .type(BOOLEAN)
  178. .hidden()
  179. .build()));
  180. return defs;
  181. }
  182. }