1 /*
2 * Copyright (C) 2017-2019 Centre National d'Etudes Spatiales (CNES).
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 3.0 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301 USA
18 */
19 package fr.cnes.doi.settings;
20
21 /**
22 * Consts contains all configuration variables, which are possible to use in the
23 * config.properties.
24 *
25 * @author Jean-Christophe Malapert (jean-christophe.malapert@cnes.fr)
26 */
27 public final class Consts {
28
29 /**
30 * Application's name.
31 */
32 public static final String APP_NAME = "Starter.APP_NAME";
33
34 /**
35 * Application's version.
36 */
37 public static final String VERSION = "Starter.VERSION";
38
39 /**
40 * Name of the configuration file.
41 */
42 public static final String NAME = "Starter.NAME";
43
44 /**
45 * Application's copyright.
46 */
47 public static final String COPYRIGHT = "Starter.COPYRIGHT";
48
49 /**
50 * Context (DEV, POST_DEV, PRE_PROD, PROD) of the use.
51 */
52 public static final String CONTEXT_MODE = "Starter.CONTEXT_MODE";
53
54 /**
55 * DOI prefix, which is given by INIST.
56 */
57 public static final String INIST_DOI = "Starter.Inist.doi";
58
59 /**
60 * INIST login to use DATACITE's web services. The login is encrypted.
61 */
62 public static final String INIST_LOGIN = "Starter.Inist.login";
63
64 /**
65 * INIST password to use DATACITE's web services. The password is encrypted.
66 */
67 public static final String INIST_PWD = "Starter.Inist.pwd";
68
69 /**
70 * HTTP port number.
71 */
72 public static final String SERVER_HTTP_PORT = "Starter.Server.HTTP.Port";
73
74 /**
75 * HTTPS password for this application. The password is encrypted.
76 */
77 public static final String SERVER_HTTPS_SECRET_KEY = "Starter.Server.HTTPS.SecretKey";
78
79 /**
80 * HTTPS port number.
81 */
82 public static final String SERVER_HTTPS_PORT = "Starter.Server.HTTPS.Port";
83
84 /**
85 * HTTPS keystore path.
86 */
87 public static final String SERVER_HTTPS_KEYSTORE_PATH = "Starter.Server.HTTPS.KeystorePath";
88
89 /**
90 * HTTPS keystore password. The password is encrypted
91 */
92 public static final String SERVER_HTTPS_KEYSTORE_PASSWD
93 = "Starter.Server.HTTPS.keystorePassword";
94
95 /**
96 * Trust store path.
97 */
98 public static final String SERVER_HTTPS_TRUST_STORE_PATH
99 = "Starter.Server.HTTPS.TrustStorePath";
100
101 /**
102 * Trust store password. The password is encrypted
103 */
104 public static final String SERVER_HTTPS_TRUST_STORE_PASSWD
105 = "Starter.Server.HTTPS.TrustStorePassword";
106
107 /**
108 * Type of proxy. It can be one of the following values NO_PROXY,
109 * PROXY_BASIC, PROXY_SPNEGO_API, PROXY_SPNEGO_JAAS.
110 */
111 public static final String SERVER_PROXY_TYPE = "Starter.Proxy.type";
112
113 /**
114 * Proxy host name.
115 */
116 public static final String SERVER_PROXY_HOST = "Starter.Proxy.host";
117
118 /**
119 * Proxy port number.
120 */
121 public static final String SERVER_PROXY_PORT = "Starter.Proxy.port";
122
123 /**
124 * Proxy login.
125 */
126 public static final String SERVER_PROXY_LOGIN = "Starter.Proxy.login";
127
128 /**
129 * Proxy password. The password is encrypted
130 */
131 public static final String SERVER_PROXY_PWD = "Starter.Proxy.pwd";
132
133 /**
134 * Set of hostname on which the authentication to the proxy is disabled.
135 */
136 public static final String SERVER_NONPROXY_HOSTS = "Starter.NoProxy.hosts";
137
138 /**
139 * TODO.
140 */
141 public static final String SERVER_PROXY_JAAS_SPN = "Starter.Proxy.Jass.Spn";
142
143 /**
144 * TODO.
145 */
146 public static final String SERVER_PROXY_JAAS_FILE = "Starter.Proxy.Jass.File";
147
148 /**
149 * TODO.
150 */
151 public static final String SERVER_PROXY_JAAS_CONTEXT = "Starter.Proxy.Jass.Context";
152
153 /**
154 * Set token expiration delay during creation
155 */
156 public static final String TOKEN_EXPIRATION_DELAY = "Starter.Token.Delay";
157
158 /**
159 * Set token expiration unit during creation
160 */
161 public static final String TOKEN_EXPIRATION_UNIT = "Starter.Token.Unit";
162
163 /**
164 * LOG format.
165 */
166 public static final String LOG_FORMAT = "Starter.Server.Log.format";
167
168 /**
169 * Email of the administrator.
170 */
171 public static final String SERVER_CONTACT_ADMIN = "Starter.Server.contactAdmin";
172
173 /**
174 * Protocol name.
175 */
176 public static final String SMTP_PROTOCOL = "Starter.mail.send.protocol";
177 /**
178 * SMTP URL.
179 */
180 public static final String SMTP_URL = "Starter.mail.send.server";
181 /**
182 * TLS.
183 */
184 public static final String SMTP_STARTTLS_ENABLE = "Starter.mail.send.tls";
185
186 /**
187 * SMTP login.
188 */
189 public static final String SMTP_AUTH_USER = "Starter.mail.send.identifier";
190
191 /**
192 * SMTP password. The password is encrypted.
193 */
194 public static final String SMTP_AUTH_PWD = "Starter.mail.send.secret";
195
196 // Jetty contants
197 /**
198 * Jetty : Thread pool minimum threads.
199 */
200 public static final String JETTY_MIN_THREADS = "Starter.MIN_THREADS";
201
202 /**
203 * Jetty : Thread pool max threads.
204 */
205 public static final String JETTY_MAX_THREADS = "Starter.MAX_THREADS";
206
207 /**
208 * Jetty : Thread pool threads priority.
209 */
210 public static final String JETTY_THREADS_PRIORITY = "Starter.THREADS_PRIORITY";
211
212 /**
213 * Jetty : Thread pool idle timeout in milliseconds; threads that are idle
214 * for longer than this period may be stopped.
215 */
216 public static final String JETTY_THREAD_MAX_IDLE_TIME_MS = "Starter.THREAD_MAX_IDLE_TIME_MS";
217
218 /**
219 * Thread pool stop timeout in milliseconds; the maximum time allowed for
220 * the service to shutdown.
221 */
222 public static final String JETTY_THREAD_STOP_TIME_MS = "Starter.THREAD_MAX_STOP_TIME_MS";
223
224 /**
225 * Time in ms that connections will persist if listener is low on resources.
226 */
227 public static final String JETTY_LOW_RESOURCES_MAX_IDLE_TIME_MS
228 = "Starter.LOW_RESOURCES_MAX_IDLE_TIME_MS";
229
230 /**
231 * Low resource monitor period in milliseconds; when 0, low resource
232 * monitoring is disabled.
233 */
234 public static final String JETTY_LOW_RESOURCES_PERIOD = "Starter.LOW_RESOURCES_PERIOD";
235
236 /**
237 * Low resource monitor max memory in bytes; when 0, the check disabled;
238 * memory used is calculated as (totalMemory-freeMemory).
239 */
240 public static final String JETTY_LOW_RESOURCES_MAX_MEMORY = "Starter.LOW_RESOURCES_MAX_MEMORY";
241
242 /**
243 * Low resource monitor max connections; when 0, the check is disabled.
244 */
245 public static final String JETTY_LOW_RESOURCES_MAX_CONNECTIONS
246 = "Starter.LOW_RESOURCES_MAX_CONNECTIONS";
247
248 /**
249 * Low resource monitor, whether to check if we're low on threads.
250 */
251 public static final String JETTY_LOW_RESOURCES_THREADS = "Starter.LOW_RESOURCES_THREADS";
252
253 /**
254 * Connector acceptor thread count; when -1, Jetty will default to
255 * Runtime.availableProcessors() / 2, with a minimum of 1.
256 */
257 public static final String JETTY_ACCEPTOR_THREADS = "Starter.ACCEPTOR_THREADS";
258
259 /**
260 * Connector selector thread count; when -1, Jetty will default to
261 * Runtime.availableProcessors().
262 */
263 public static final String JETTY_SELECTOR_THREADS = "Starter.SELECTOR_THREADS";
264 /**
265 * Connector accept queue size; also known as accept backlog.
266 */
267 public static final String JETTY_ACCEPT_QUEUE_SIZE = "Starter.ACCEPT_QUEUE_SIZE";
268 /**
269 * HTTP request header size in bytes; larger headers will allow for more
270 * and/or larger cookies plus larger form content encoded in a URL; however,
271 * larger headers consume more memory and can make a server more vulnerable
272 * to denial of service attacks.
273 */
274 public static final String JETTY_REQUEST_HEADER_SIZE = "Starter.REQUEST_HEADER_SIZE";
275 /**
276 * HTTP response header size in bytes; larger headers will allow for more
277 * and/or larger cookies and longer HTTP headers (e.g. for redirection);
278 * however, larger headers will also consume more memory
279 */
280 public static final String JETTY_RESPONSE_HEADER_SIZE = "Starter.RESPONSE_HEADER_SIZE";
281 /**
282 * HTTP header cache size in bytes.
283 */
284 public static final String JETTY_REQUEST_BUFFER_SIZE = "Starter.REQUEST_BUFFER_SIZE";
285 /**
286 * HTTP output buffer size in bytes; a larger buffer can improve performance
287 * by allowing a content producer to run without blocking, however larger
288 * buffers consume more memory and may induce some latency before a client
289 * starts processing the content.
290 */
291 public static final String JETTY_RESPONSE_BUFFER_SIZE = "Starter.RESPONSE_BUFFER_SIZE";
292 /**
293 * Connector idle timeout in milliseconds; see Socket.setSoTimeout(int);
294 * this value is interpreted as the maximum time between some progress being
295 * made on the connection; so if a single byte is read or written, then the
296 * timeout is reset.
297 */
298 public static final String JETTY_IO_MAX_IDLE_TIME_MS = "Starter.IO_MAX_IDLE_TIME_MS";
299 /**
300 * Connector TCP/IP SO linger time in milliseconds; when -1 is disabled; see
301 * Socket.setSoLinger(boolean, int).
302 */
303 public static final String JETTY_SO_LINGER_TIME = "Starter.SO_LINGER_TIME";
304 /**
305 * Connector stop timeout in milliseconds; the maximum time allowed for the
306 * service to shutdown
307 */
308 public static final String JETTY_GRACEFUL_SHUTDOWN = "Starter.GRACEFUL_SHUTDOWN";
309 /**
310 * key for token signature encoded with the algorithm HS256 in base64
311 */
312 public static final String TOKEN_KEY = "Starter.Token.key";
313
314 /**
315 * Plugin to load the list of users and to fill group with users
316 */
317 public static final String PLUGIN_USER_GROUP_MGT = "Starter.Plugin.UserGroupMgt";
318
319 /**
320 * Plugin to load the project suffix database.
321 */
322 public static final String PLUGIN_PROJECT_SUFFIX = "Starter.Plugin.ProjectSuffix";
323
324 /**
325 * Plugin to load the token database.
326 */
327 public static final String PLUGIN_TOKEN = "Starter.Plugin.Token";
328
329 /**
330 * Plugin to load the authentication system.
331 */
332 public static final String PLUGIN_AUTHENTICATION = "Starter.Plugin.Authentication";
333
334 /**
335 * Allowed IPs for the administration application.
336 */
337 public static final String ADMIN_IP_ALLOWER = "Starter.admin.IP.allower";
338
339 /**
340 * Level for which an alert must be send.
341 */
342 public static final String THRESHOLD_SPEED_PERCENT = "Starter.Monitoring.Threshold_speed";
343
344 /**
345 * Tunning connection for Restlet.
346 */
347 public static final String RESTLET_MAX_TOTAL_CONNECTIONS = "Starter.maxTotalConnections";
348
349 /**
350 * Tunning Connection for Restlet
351 */
352 public static final String RESTLET_MAX_CONNECTIONS_PER_HOST = "Starter.maxConnectionsPerHost";
353
354 /**
355 * DataCite schema.
356 */
357 public static final String DATACITE_SCHEMA = "Starter.dataciteSchema";
358
359 /**
360 * Update Database job period
361 */
362 public static final String DB_UPDATE_JOB_PERIOD = "Starter.updateDatabaseJob.period";
363
364 /**
365 * Attributes name in LDAP for fullname.
366 */
367 public static final String ATTRIBUTION = "Starter.attribution";
368
369 /**
370 * True when login/password are encoded otherwise false.
371 */
372 public static final String ENCRYPTED_FIELDS = "Starter.encrypted_fields";
373
374 /**
375 * Option to configure IP client.
376 */
377 public static final String USE_FORWARDED_FOR_HEADER = "useForwardedForHeader";
378
379 /**
380 * Get IP client forwarded to proxy.
381 */
382 public static final String PROXIFIED_IP = "X-Forwarded-For";
383
384 /**
385 * Log for IP client forwarded to proxy.
386 */
387 public static final String LOG_IP_ADDRESS = "ipAddress";
388
389 /**
390 * "Static" class cannot be instantiated
391 */
392 private Consts() {
393 }
394
395 }