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