PageRenderTime 43ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/src/main/java/com/searchcode/app/config/Values.java

https://github.com/boyter/searchcode-server
Java | 233 lines | 184 code | 21 blank | 28 comment | 0 complexity | aef829ea2bf4295b4e44702ea4462fa8 MD5 | raw file
  1. /*
  2. * Copyright (c) 2016 Boyter Online Services
  3. *
  4. * Use of this software is governed by the Fair Source License included
  5. * in the LICENSE.TXT file, but will be eventually open under GNU General Public License Version 3
  6. * see the README.md for when this clause will take effect
  7. *
  8. * Version 1.3.15
  9. */
  10. package com.searchcode.app.config;
  11. import java.text.DecimalFormat;
  12. /**
  13. * Contains any static values we need locations, names etc....
  14. */
  15. public class Values {
  16. public Values() {}
  17. // Property values used for looking up values
  18. // in the properties file
  19. public static final String PROPERTIES_FILE_NAME = "searchcode.properties";
  20. public static final String SQLITE_FILE = "sqlite_file";
  21. public static final String DEFAULT_SQLITE_FILE = "searchcode.sqlite";
  22. public static final String SERVER_PORT = "server_port";
  23. public static final String DEFAULT_SERVER_PORT = "8080";
  24. public static final String INDEXLOCATION = "index_location";
  25. public static final String DEFAULTINDEXLOCATION = "./index/";
  26. public static final String FACETSLOCATION = "facets_location";
  27. public static final String DEFAULTFACETSLOCATION = "./index/facet/";
  28. public static final String TIMEINDEXLOCATION = "timeindex_location";
  29. public static final String DEFAULTTIMEINDEXLOCATION = "./index/time/";
  30. public static final String TIMEINDEXFACETLOCATION = "timeindex_facets_location";
  31. public static final String DEFAULTTIMEINDEXFACETLOCATION = "./index/time/facet/";
  32. public static final String REPOSITORYLOCATION = "repository_location";
  33. public static final String DEFAULTREPOSITORYLOCATION = "./repo/";
  34. public static final String CHECKREPOCHANGES = "check_repo_chages";
  35. public static final String DEFAULTCHECKREPOCHANGES = "600";
  36. public static final String CHECKFILEREPOCHANGES = "check_filerepo_changes";
  37. public static final String DEFAULTCHECKFILEREPOCHANGES = "600";
  38. public static final String INDEXTIME = "index_time";
  39. public static final String DEFAULTINDEXTIME = "5";
  40. public static final String SPELLINGCORRECTORSIZE = "spelling_corrector_size";
  41. public static final String DEFAULTSPELLINGCORRECTORSIZE = "10000";
  42. public static final String ONLYLOCALHOST = "only_localhost";
  43. public static final String DEFAULTONLYLOCALHOST = "false";
  44. public static final String LOWMEMORY = "low_memory";
  45. public static final String DEFAULTLOWMEMORY = "false";
  46. public static final String GITBINARYPATH = "git_binary_path";
  47. public static final String DEFAULTGITBINARYPATH = "/usr/bin/git";
  48. public static final String USESYSTEMGIT = "use_system_git";
  49. public static final String DEFAULTUSESYSTEMGIT = "false";
  50. public static final String APIENABLED = "api_enabled";
  51. public static final String DEFAULTAPIENABLED = "false";
  52. public static final String APIKEYAUTH = "api_key_authentication";
  53. public static final String DEFAULTAPIKEYAUTH = "true";
  54. public static final String SVNENABLED = "svn_enabled";
  55. public static final String DEFAULTSVNENABLED = "false";
  56. public static final String SVNBINARYPATH = "svn_binary_path";
  57. public static final String DEFAULTSVNBINARYPATH = "/usr/bin/svn";
  58. public static final String MAXDOCUMENTQUEUESIZE = "max_document_queue_size";
  59. public static final String DEFAULTMAXDOCUMENTQUEUESIZE = "1000";
  60. public static final String MAXDOCUMENTQUEUELINESIZE = "max_document_queue_line_size";
  61. public static final String DEFAULTMAXDOCUMENTQUEUELINESIZE = "100000";
  62. public static final String MAXFILELINEDEPTH = "max_file_line_depth";
  63. public static final String DEFAULTMAXFILELINEDEPTH = "10000";
  64. public static final String MAX_FILE_LENGTH_READ = "max_file_length_read";
  65. public static final String DEFAULT_MAX_FILE_LENGTH_READ = "30000000";
  66. public static final String OWASPDATABASELOCATION = "owasp_database_location";
  67. public static final String DEFAULTOWASPDATABASELOCATION = "./include/owasp/database.json";
  68. public static final String CLASSIFIER_DATABASE_LOCATION = "classifier_database_location";
  69. public static final String DEFAULT_CLASSIFIER_DATABASE_LOCATION = "./include/classifier/database.json";
  70. public static final String LICENSE_DATABASE_LOCATION = "license_database_location";
  71. public static final String DEFAULT_LICENSE_DATABASE_LOCATION = "./include/license/license.json";
  72. public static final String SOURCE_DATABASE_LOCATION = "source_database_location";
  73. public static final String DEFAULT_SOURCE_DATABASE_LOCATION = "./include/source/database.json";
  74. public static final String HIGHLIGHT_LINE_LIMIT = "highlight_lines_limit";
  75. public static final String DEFAULT_HIGHLIGHT_LINE_LIMIT = "3000";
  76. public static final String BINARY_WHITE_LIST = "binary_extension_white_list";
  77. public static final String DEFAULT_BINARY_WHITE_LIST = "";
  78. public static final String BINARY_BLACK_LIST = "binary_extension_black_list";
  79. public static final String DEFAULT_BINARY_BLACK_LIST = "";
  80. public static final String DIRECTORY_BLACK_LIST = "directory_black_list";
  81. public static final String DEFAULT_DIRECTORY_BLACK_LIST = "";
  82. public static final String GUESS_BINARY = "binary_guess";
  83. public static final String DEFAULT_GUESS_BINARY = "true";
  84. public static final String NUMBER_GIT_PROCESSORS = "number_git_processors";
  85. public static final String DEFAULT_NUMBER_GIT_PROCESSORS = "2";
  86. public static final String NUMBER_SVN_PROCESSORS = "number_svn_processors";
  87. public static final String DEFAULT_NUMBER_SVN_PROCESSORS = "2";
  88. public static final String NUMBER_FILE_PROCESSORS = "number_file_processors";
  89. public static final String DEFAULT_NUMBER_FILE_PROCESSORS = "1";
  90. public static final String AND_MATCH = "default_and_match";
  91. public static final String DEFAULT_AND_MATCH = "true";
  92. public static final String LOG_INDEXED = "log_indexed";
  93. public static final String DEFAULT_LOG_INDEXED = "false";
  94. public static final String LOG_COUNT = "log_count";
  95. public static final String DEFAULT_LOG_COUNT = "10";
  96. public static final String LOG_LEVEL = "log_level";
  97. public static final String DEFAULT_LOG_LEVEL = "SEVERE";
  98. public static final String TRASH_LOCATION = "trash_location";
  99. public static final String DEFAULT_TRASH_LOCATION = "./trash/";
  100. public static final String LOG_PATH = "log_path";
  101. public static final String DEFAULT_LOG_PATH = "./logs/";
  102. public static final String ENCRYPTION_KEY = "encryption_key";
  103. public static final String DEFAULT_ENCRYPTION_KEY = "39dc5f2168e412be3a9faf9d08482114";
  104. public static final String FOLLOW_LINKS = "follow_links";
  105. public static final String DEFAULT_FOLLOW_LINKS = "false";
  106. public static final String DEEP_GUESS_FILES = "deep_guess_files";
  107. public static final String DEFAULT_DEEP_GUESS_FILES = "false";
  108. public static final String HOST_NAME = "host_name";
  109. public static final String DEFAULT_HOST_NAME = "localhost:8080";
  110. // Used for both searchcoee server and searchcode.com
  111. public static final String DEFAULT_HIGHLIGHTER = "javascript";
  112. public static final String HIGHLIGHTER = "highlighter";
  113. public static final String HIGHLIGHTER_BINARY_LOCATION = "highlighter_binary_location";
  114. public static final String DEFAULT_HIGHLIGHTER_BINARY_LOCATION = "./include/binaries/";
  115. // Mostly used for changing over to distributed searchcode.com index
  116. public static final String DELETE_REPO_AFTER_PROCESS = "delete_repo_after_process";
  117. public static final String DEFAULT_DELETE_REPO_AFTER_PROCESS = "false";
  118. public static final String INDEX_SERVICE = "index_service";
  119. public static final String DEFAULT_INDEX_SERVICE = "internal";
  120. public static final String SPHINX_SERVERS_SHARDS = "sphinx_servers_shards";
  121. public static final String DEFAULT_SPHINX_SERVERS_SHARDS = "localhost:1";
  122. public static final String INDEX_ALL_FIELDS = "index_all_fields";
  123. public static final String DEFAULT_INDEX_ALL_FIELDS = "content,filename,filenamereverse,path,interesting";
  124. // Lucene stored values for indexing / searching
  125. public static final String CONTENTS = "contents";
  126. public static final String PATH = "path"; // The primary key for everything in the index
  127. public static final String FILELOCATION = "filelocation";
  128. public static final String FILELOCATIONFILENAME = "filelocationfilename";
  129. public static final String FILENAME = "filename";
  130. public static final String MD5HASH = "md5hash";
  131. public static final String LINES = "lines";
  132. public static final String CODELINES = "codelines";
  133. public static final String BLANKLINES = "blanklines";
  134. public static final String COMMENTLINES = "commentlines";
  135. public static final String COMPLEXITY = "complexity";
  136. public static final String REPOLOCATION = "repolocation";
  137. public static final String MODIFIED = "modified";
  138. public static final String REVISION = "revision";
  139. public static final String DATEYEARMONTHDAY = "datedaymonthyear"; // EG 20160523 reversed as test
  140. public static final String DATEYEARMONTH = "datemonthyear"; // EG 201605
  141. public static final String DATEYEAR = "dateyear"; // EG 2016
  142. public static final String MESSAGE = "message"; // Contains git commit message
  143. public static final String DELETED = "deleted";
  144. public static final String CODEID = "codeid";
  145. public static final String SCHASH = "schash"; // Not a real simhash but custom one
  146. public static final String DISPLAY_LOCATION = "displaylocation";
  147. // Facets
  148. public static final String LANGUAGENAME = "languagename";
  149. public static final String REPONAME = "reponame";
  150. public static final String CODEOWNER = "codeowner";
  151. public static final String SOURCE = "source";
  152. // Lucene values for literal search
  153. public static final String FILE_NAME_LITERAL = "fn";
  154. public static final String REPO_NAME_LITERAL = "rn";
  155. public static final String LANGUAGE_NAME_LITERAL = "ln";
  156. public static final String OWNER_NAME_LITERAL = "on";
  157. public static final String DISPLAY_LOCATION_LITERAL = "fl";
  158. // Random
  159. public static final String USERSESSIONID = "admin_user";
  160. public static final String EMPTYSTRING = "";
  161. public static final String SINGLE_SPACE = " ";
  162. public static final String GIT = "git";
  163. public static final String SVN = "svn";
  164. public static final String FILE = "file";
  165. public static final String PAUSED = "paused";
  166. public static final String RUNNING = "running";
  167. public static final String UNKNOWN_LANGUAGE = "Unknown";
  168. // API Endpoint Values
  169. public static final String PUB = "pub";
  170. public static final String SIG = "sig";
  171. public static final String HMAC = "hmac";
  172. // CacheSingleton lookup values
  173. public static final String CACHE_TOTAL_SEARCH = "statsservice-totalsearch";
  174. // Used for things stored in data table
  175. public static final String PERSISTENT_DELETE_QUEUE = "persistent-delete-queue";
  176. // Job values used in the quartz jobs
  177. // Used for lookups from the data database table
  178. public static final String SYNTAXHIGHLIGHTER = "syntax_highlighter";
  179. public static final String AVERAGESALARY = "average_salary";
  180. public static final String MATCHLINES = "match_lines";
  181. public static final String MAXLINEDEPTH = "max_line_depth";
  182. public static final String MINIFIEDLENGTH = "minified_length";
  183. public static final String OWASPENABLED = "owasp_enabled";
  184. public static final String LOGO = "logo";
  185. public static final String BACKOFFVALUE = "backoff_value";
  186. public static final String EMBED = "embed";
  187. public static final String INDEX_READ = "index_read"; // Used to know which index we are referring to
  188. public static final String INDEX_WRITE = "index_write"; // Used to know which index we are referring to
  189. public static final String DEFAULTSYNTAXHIGHLIGHTER = "github";
  190. public static final String DEFAULTAVERAGESALARY = "56000";
  191. public static final String DEFAULTMATCHLINES = "15";
  192. public static final String DEFAULTMAXLINEDEPTH = "10000";
  193. public static final String DEFAULTMINIFIEDLENGTH = "255";
  194. public static final String DEFAULTBACKOFFVALUE = "0";
  195. public static final String INDEX_A = "A";
  196. public static final String INDEX_B = "B";
  197. // Used for job status
  198. public static final String REPO_STATUS_INDEXING = "INDEXING";
  199. public static final String REPO_STATUS_FINISHED = "FINISHED";
  200. public static final String CHARSET_UTF8 = "UTF8";
  201. public static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#.##");
  202. public static final String ALL_NEWLINE = "\\r?\\n";
  203. // Various HTML
  204. public static final String LINE_BREAK = "<br>";
  205. public static final String NBSP = "&nbsp;";
  206. // Used to control cache
  207. public static final int DEFAULT_CACHE_SIZE = 10_000;
  208. public static final int SMALL_CACHE_SIZE = 1_000;
  209. public static final int LOW_CACHE_DAYS = 5;
  210. public static final int HIGH_CACHE_DAYS = 30;
  211. public static final int LOW_CACHE_MINUTES = 5;
  212. }