aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/config/Keys.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/config/Keys.java')
-rw-r--r--src/main/java/org/traccar/config/Keys.java91
1 files changed, 57 insertions, 34 deletions
diff --git a/src/main/java/org/traccar/config/Keys.java b/src/main/java/org/traccar/config/Keys.java
index d346084bd..91d5dac5d 100644
--- a/src/main/java/org/traccar/config/Keys.java
+++ b/src/main/java/org/traccar/config/Keys.java
@@ -23,7 +23,7 @@ public final class Keys {
}
/**
- * Network interface for a the protocol. If not specified, server will bind all interfaces.
+ * Network interface for the protocol. If not specified, server will bind all interfaces.
*/
public static final ConfigSuffix<String> PROTOCOL_ADDRESS = new StringConfigSuffix(
".address",
@@ -33,7 +33,7 @@ public final class Keys {
* Port number for the protocol. Most protocols use TCP on the transport layer. Some protocols use UDP. Some
* support both TCP and UDP.
*/
- public static final ConfigSuffix<Integer> PROTOCOL_PORT = new IntegerConfigSuffix(
+ public static final ConfigSuffix<Integer> PROTOCOL_PORT = new PortConfigSuffix(
".port",
List.of(KeyType.CONFIG));
@@ -320,7 +320,8 @@ public final class Keys {
*/
public static final ConfigKey<String> SERVER_STATISTICS = new StringConfigKey(
"server.statistics",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ "https://www.traccar.org/analytics/");
/**
* Fuel drop threshold value. When fuel level drops from one position to another for more the value, an event is
@@ -397,7 +398,8 @@ public final class Keys {
*/
public static final ConfigKey<Boolean> EVENT_IGNORE_DUPLICATE_ALERTS = new BooleanConfigKey(
"event.ignoreDuplicateAlerts",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ true);
/**
* If set to true, invalid positions will be considered for motion logic.
@@ -472,7 +474,8 @@ public final class Keys {
*/
public static final ConfigKey<String> DATABASE_CHANGELOG = new StringConfigKey(
"database.changelog",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ "./schema/changelog-master.xml");
/**
* Database connection pool size. Default value is defined by the HikariCP library.
@@ -598,7 +601,7 @@ public final class Keys {
"uid");
/**
- * LDAP attribute used as user name. Default value is 'cn'.
+ * LDAP attribute used as username. Default value is 'cn'.
*/
public static final ConfigKey<String> LDAP_NAME_ATTRIBUTE = new StringConfigKey(
"ldap.nameAttribute",
@@ -671,7 +674,7 @@ public final class Keys {
/**
* OpenID Connect Authorization URL.
* This can usually be found in the documentation of your identity provider or by using the well-known
- * configuration endpoint, e.g. https://auth.example.com//.well-known/openid-configuration
+ * configuration endpoint, e.g. https://auth.example.com/.well-known/openid-configuration
* Required to enable SSO if openid.issuerUrl is not set.
*/
public static final ConfigKey<String> OPENID_AUTH_URL = new StringConfigKey(
@@ -736,7 +739,8 @@ public final class Keys {
*/
public static final ConfigKey<String> MEDIA_PATH = new StringConfigKey(
"media.path",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ "./media");
/**
* Optional parameter to specify network interface for web interface to bind to. By default server will bind to all
@@ -747,12 +751,13 @@ public final class Keys {
List.of(KeyType.CONFIG));
/**
- * Web interface TCP port number. By default Traccar uses port 8082. To avoid specifying port in the browser you
+ * Web interface TCP port number. By default, Traccar uses port 8082. To avoid specifying port in the browser you
* can set it to 80 (default HTTP port).
*/
public static final ConfigKey<Integer> WEB_PORT = new IntegerConfigKey(
"web.port",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ 8082);
/**
* Maximum API requests per second. Above this limit requests and delayed and throttled.
@@ -770,26 +775,20 @@ public final class Keys {
600);
/**
- * Sanitize all strings returned via API. This is needed to fix XSS issues in the old web interface. New React-based
- * interface doesn't require this.
- */
- public static final ConfigKey<Boolean> WEB_SANITIZE = new BooleanConfigKey(
- "web.sanitize",
- List.of(KeyType.CONFIG));
-
- /**
* Path to the web app folder.
*/
public static final ConfigKey<String> WEB_PATH = new StringConfigKey(
"web.path",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ "./web");
/**
* Path to a folder with overrides. It can be used for branding to keep custom logos in a separate place.
*/
public static final ConfigKey<String> WEB_OVERRIDE = new StringConfigKey(
"web.override",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ "./override");
/**
* WebSocket connection timeout in milliseconds. Default timeout is 5 minutes.
@@ -1172,7 +1171,8 @@ public final class Keys {
*/
public static final ConfigKey<String> NOTIFICATOR_TYPES = new StringConfigKey(
"notificator.types",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ "web,mail,command");
/**
* If the event time is too old, we should not send notifications. This parameter is the threshold value in
@@ -1261,6 +1261,13 @@ public final class Keys {
List.of(KeyType.CONFIG));
/**
+ * Block notifications for specific users. The value should be a comma-separated list of internal user ids.
+ */
+ public static final ConfigKey<String> NOTIFICATION_BLOCK_USERS = new StringConfigKey(
+ "notification.block.users",
+ List.of(KeyType.CONFIG));
+
+ /**
* Maximum time period for reports in seconds. Can be useful to prevent users to request unreasonably long reports.
* By default, there is no limit.
*/
@@ -1331,7 +1338,8 @@ public final class Keys {
*/
public static final ConfigKey<Boolean> FILTER_ENABLE = new BooleanConfigKey(
"filter.enable",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ true);
/**
* Filter invalid (valid field is set to false) positions.
@@ -1369,7 +1377,8 @@ public final class Keys {
*/
public static final ConfigKey<Long> FILTER_FUTURE = new LongConfigKey(
"filter.future",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ 86400L);
/**
* Filter records with fix time in the past. The value is specified in seconds. Records that have fix time more
@@ -1426,13 +1435,20 @@ public final class Keys {
List.of(KeyType.CONFIG));
/**
- * Filter position if the daily limit is exceeded for the device.
+ * Throttle positions if the daily limit is exceeded for the device.
*/
public static final ConfigKey<Integer> FILTER_DAILY_LIMIT = new IntegerConfigKey(
"filter.dailyLimit",
List.of(KeyType.CONFIG));
/**
+ * Throttling interval if the limit exceeded. The value is in seconds.
+ */
+ public static final ConfigKey<Integer> FILTER_DAILY_LIMIT_INTERVAL = new IntegerConfigKey(
+ "filter.dailyLimitInterval",
+ List.of(KeyType.CONFIG));
+
+ /**
* If false, the server expects all locations to come sequentially (for each device). Filter checks for duplicates,
* distance, speed, or time period only against the location that was last received by server.
* If true, the server expects locations to come at random order (since tracking device might go offline).
@@ -1580,15 +1596,16 @@ public final class Keys {
*/
public static final ConfigKey<Boolean> GEOCODER_ENABLE = new BooleanConfigKey(
"geocoder.enable",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ true);
/**
- * Reverse geocoder type. Check reverse geocoding documentation for more info. By default (if the value is not
- * specified) server uses Google API.
+ * Reverse geocoder type. Check reverse geocoding documentation for more info.
*/
public static final ConfigKey<String> GEOCODER_TYPE = new StringConfigKey(
"geocoder.type",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ "locationiq");
/**
* Geocoder server URL. Applicable only to Nominatim and Gisgraphy providers.
@@ -1602,7 +1619,8 @@ public final class Keys {
*/
public static final ConfigKey<String> GEOCODER_KEY = new StringConfigKey(
"geocoder.key",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ "pk.689d849289c8c63708068b2ff1f63b2d");
/**
* Language parameter for providers that support localization (e.g. Google and Nominatim).
@@ -1630,7 +1648,8 @@ public final class Keys {
*/
public static final ConfigKey<Boolean> GEOCODER_IGNORE_POSITIONS = new BooleanConfigKey(
"geocoder.ignorePositions",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ true);
/**
* Boolean flag to apply reverse geocoding to invalid positions.
@@ -1652,7 +1671,8 @@ public final class Keys {
*/
public static final ConfigKey<Boolean> GEOCODER_ON_REQUEST = new BooleanConfigKey(
"geocoder.onRequest",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ true);
/**
* Boolean flag to enable LBS location resolution. Some devices send cell towers information and WiFi point when GPS
@@ -1853,7 +1873,8 @@ public final class Keys {
*/
public static final ConfigKey<String> LOGGER_FILE = new StringConfigKey(
"logger.file",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ "./logs/tracker-server.log");
/**
* Logging level. Default value is 'info'.
@@ -1861,7 +1882,8 @@ public final class Keys {
*/
public static final ConfigKey<String> LOGGER_LEVEL = new StringConfigKey(
"logger.level",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ "info");
/**
* Print full exception traces. Useful for debugging. By default shortened traces are logged.
@@ -1876,7 +1898,8 @@ public final class Keys {
*/
public static final ConfigKey<Boolean> LOGGER_ROTATE = new BooleanConfigKey(
"logger.rotate",
- List.of(KeyType.CONFIG));
+ List.of(KeyType.CONFIG),
+ true);
/**
* Log file rotation interval, the default rotation interval is once a day.