From 8fe1e679935688676f7139bb9ed6dc61838d0e2f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 29 Dec 2020 22:20:03 -0800 Subject: Migrate SMS config keys --- src/main/java/org/traccar/config/Keys.java | 47 ++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) (limited to 'src/main/java/org/traccar/config/Keys.java') diff --git a/src/main/java/org/traccar/config/Keys.java b/src/main/java/org/traccar/config/Keys.java index ebe496c4f..96ed7773b 100644 --- a/src/main/java/org/traccar/config/Keys.java +++ b/src/main/java/org/traccar/config/Keys.java @@ -439,8 +439,7 @@ public final class Keys { */ public static final ConfigKey WEB_PORT = new ConfigKey<>( "web.port", - Collections.singletonList(KeyType.GLOBAL), - 8082); + Collections.singletonList(KeyType.GLOBAL)); /** * WebSocket connection timeout in milliseconds. Default timeout is 10 minutes. @@ -544,6 +543,50 @@ public final class Keys { "forward.retry.limit", Collections.singletonList(KeyType.GLOBAL)); + /** + * SMS API service full URL. Enables SMS commands and notifications. + */ + public static final ConfigKey SMS_HTTP_URL = new ConfigKey<>( + "sms.http.url", + Collections.singletonList(KeyType.GLOBAL)); + + /** + * SMS API authorization header name. Default value is 'Authorization'. + */ + public static final ConfigKey SMS_HTTP_AUTHORIZATION_HEADER = new ConfigKey<>( + "sms.http.authorizationHeader", + Collections.singletonList(KeyType.GLOBAL), + "Authorization"); + + /** + * SMS API authorization header value. This value takes precedence over user and password. + */ + public static final ConfigKey SMS_HTTP_AUTHORIZATION = new ConfigKey<>( + "sms.http.authorization", + Collections.singletonList(KeyType.GLOBAL)); + + /** + * SMS API basic authentication user. + */ + public static final ConfigKey SMS_HTTP_USER = new ConfigKey<>( + "sms.http.user", + Collections.singletonList(KeyType.GLOBAL)); + + /** + * SMS API basic authentication password. + */ + public static final ConfigKey SMS_HTTP_PASSWORD = new ConfigKey<>( + "sms.http.password", + Collections.singletonList(KeyType.GLOBAL)); + + /** + * SMS API body template. Placeholders {phone} and {message} can be used in the template. + * If value starts with '{' or '[', server automatically assumes JSON format. + */ + public static final ConfigKey SMS_HTTP_TEMPLATE = new ConfigKey<>( + "sms.http.template", + Collections.singletonList(KeyType.GLOBAL)); + /** * Maximum time period for reports in seconds. Can be useful to prevent users to request unreasonably long reports. * By default there is no limit. -- cgit v1.2.3