java.lang.Object
com.renomad.minum.state.Constants
Very important system design decisions are made here. All
developers on this project should look through each of these.
-
Field Summary
Modifier and TypeFieldDescriptionfinal String
This is the root directory of our databaseThese are key-value pairs for mappings between a file suffix and a mime type.final String
This is returned as the "host:" attribute in an HTTP requestfinal boolean
TheBrig is what puts client ip's in jail, if we feel they are attacking us.final int
We include this value in the keep-alive header.final String
The password of the keystore, used for TLSfinal String
The path to the keystore, required for encrypted TLS communicationfinal List
<LoggingLevel> The default logging levelsfinal int
final int
this is the most bytes we'll read on a single line, when reading by line.final int
this is the most bytes we'll read while parsing the Request bodyfinal int
The port for our encrypted serverfinal int
The port for our regular, non-encrypted serverfinal int
How long will we let a socket live before we crash it closed? SeeSocket.setSoTimeout(int)
final long
This value is the result of running System.currentTimeMillis() when this class gets instantiated, and that is done at the very beginning.final long
Length of time, in seconds, for static files to be cached, per the provisions of the Cache-Control header, e.g.final String
Root directory of static filesThese are a list of error messages that often indicate unusual behavior, maybe an attackerThese are a list of paths that often indicate unusual behavior, maybe an attackerfinal boolean
Whether we will use caching for the static files.final int
If a client does something that we consider an indicator for attacking, put them in jail for a longer duration. -
Constructor Summary
-
Method Summary
-
Field Details
-
serverPort
public final int serverPortThe port for our regular, non-encrypted server -
secureServerPort
public final int secureServerPortThe port for our encrypted server -
hostName
This is returned as the "host:" attribute in an HTTP request -
dbDirectory
This is the root directory of our database -
staticFilesDirectory
Root directory of static files -
logLevels
The default logging levels -
keystorePath
The path to the keystore, required for encrypted TLS communication -
keystorePassword
The password of the keystore, used for TLS -
maxReadSizeBytes
public final int maxReadSizeBytesthis is the most bytes we'll read while parsing the Request body -
maxReadLineSizeBytes
public final int maxReadLineSizeBytesthis is the most bytes we'll read on a single line, when reading by line. This is especially relevant when reading headers and request lines, which can bulk up with jwt's or query strings, respectively. -
socketTimeoutMillis
public final int socketTimeoutMillisHow long will we let a socket live before we crash it closed? SeeSocket.setSoTimeout(int)
-
keepAliveTimeoutSeconds
public final int keepAliveTimeoutSecondsWe include this value in the keep-alive header. It lets the browser know how long to hold the socket open, in seconds, before it decides we aren't sending anything else and closes it. -
vulnSeekingJailDuration
public final int vulnSeekingJailDurationIf a client does something that we consider an indicator for attacking, put them in jail for a longer duration. -
isTheBrigEnabled
public final boolean isTheBrigEnabledTheBrig is what puts client ip's in jail, if we feel they are attacking us. If this is disabled, that functionality is removed. -
suspiciousErrors
These are a list of error messages that often indicate unusual behavior, maybe an attacker -
suspiciousPaths
These are a list of paths that often indicate unusual behavior, maybe an attacker -
startTime
public final long startTimeThis value is the result of running System.currentTimeMillis() when this class gets instantiated, and that is done at the very beginning. -
extraMimeMappings
These are key-value pairs for mappings between a file suffix and a mime type.These are read by our system in the StaticFilesCache as key-1,value-1,key-2,value-2,... and so on.
- See Also:
-
staticFileCacheTime
public final long staticFileCacheTimeLength of time, in seconds, for static files to be cached, per the provisions of the Cache-Control header, e.g.Cache-Control: max-age=300
-
useCacheForStaticFiles
public final boolean useCacheForStaticFilesWhether we will use caching for the static files.When a user requests a path we don't recognize, we go looking for it. If we have already found it for someone else, it will be in a cache.
However, if we are doing development, it helps to not have caching enabled - it can confuse.
-
maxElementsLruCacheStaticFiles
public final int maxElementsLruCacheStaticFilesThis constant controls the maximum number of elements for theLRUCache
we create for use byFileUtils
. As files are read by FileUtil's methods, they will be stored in this cache, to avoid reading from disk. However, caching can certainly complicate things, so if you would prefer not to store these values in a cache, setuseCacheForStaticFiles
to false.The unit here is the number of elements to store in the cache. Be aware: elements can be of any size, so two caches each having a max size of 1000 elements could be drastically different sizes.
-
-
Constructor Details
-
Constants
public Constants() -
Constants
-
-
Method Details