summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorMagnus Feuer <mfeuer@jaguarlandrover.com>2015-11-22 19:45:30 -0800
committerMagnus Feuer <mfeuer@jaguarlandrover.com>2015-11-22 19:45:30 -0800
commite79bcd3b8d6a116f38b97825874abf0b7167faf7 (patch)
tree18301f0d411b02057ed89a6775f5e0aa8e73b691 /priv
parent7932e5903de9ddcb389e585b63e63a831ad1fd35 (diff)
downloadrvi_core-e79bcd3b8d6a116f38b97825874abf0b7167faf7.tar.gz
mfeuer-new_scripts: Merged and modified release-0.4.0-yocto_makefile
Diffstat (limited to 'priv')
-rw-r--r--priv/config/rvi_backend.config100
-rw-r--r--priv/config/rvi_sample.config351
-rw-r--r--priv/config/rvi_yocto.config351
-rw-r--r--priv/sample_certs/insecure_default_cert.json24
-rw-r--r--priv/sample_certs/insecure_default_cert.jwt1
-rw-r--r--priv/sample_keys/insecure_device_key_priv.pem51
-rw-r--r--priv/sample_keys/insecure_device_key_pub.pem14
-rw-r--r--priv/sample_keys/insecure_device_key_pub_sign.jwt1
-rw-r--r--priv/sample_keys/insecure_root_key_priv.pem51
-rw-r--r--priv/sample_keys/insecure_root_key_pub.pem14
-rw-r--r--priv/test_config/backend.config17
-rw-r--r--priv/test_config/basic_backend.config6
-rw-r--r--priv/test_config/basic_sample.config6
-rw-r--r--priv/test_config/bt_backend.config16
-rw-r--r--priv/test_config/bt_sample.config17
-rw-r--r--priv/test_config/sample.config20
-rw-r--r--priv/test_config/sms_backend.config25
-rw-r--r--priv/test_config/sms_sample.config25
-rw-r--r--priv/test_config/tls_backend.config14
-rw-r--r--priv/test_config/tls_sample.config16
20 files changed, 1120 insertions, 0 deletions
diff --git a/priv/config/rvi_backend.config b/priv/config/rvi_backend.config
new file mode 100644
index 0000000..4c2ed57
--- /dev/null
+++ b/priv/config/rvi_backend.config
@@ -0,0 +1,100 @@
+%% -*- erlang -*-
+
+%% Copyright (C) 2014, Jaguar Land Rover
+%%
+%% This program is licensed under the terms and conditions of the
+%% Mozilla Public License, version 2.0. The full text of the
+%% Mozilla Public License is at https://www.mozilla.org/MPL/2.0/
+%%
+%% Configuration file for the (in-vehicle) IVI used by the hvac_demo
+%%
+%% See ../hvac_demo/README.md for details on the demo.
+%%
+%% See ../CONFIGURE.md for a details on the configuration process
+%% itself.
+%%
+
+%% Parameters for simpler modification
+Env = fun(V, Def) ->
+ case os:getenv(V) of
+ false -> Def;
+ Str when is_integer(Def) -> list_to_integer(Str);
+ Str when is_atom(Def) -> list_to_atom(Str);
+ Str -> Str
+ end
+ end.
+MyPort = Env("RVI_MYPORT", 8800).
+MyIP = Env("RVI_MYIP", "38.129.64.31").
+IPPort = fun(IP, Port) ->
+ IP ++ ":" ++ integer_to_list(Port)
+ end.
+LogLevel = Env("RVI_LOGLEVEL", notice).
+
+[
+ %% All erlang apps needed to fire up a node. Do not touch.
+ {include_lib, "rvi_core/priv/config/rvi_common.config"},
+
+ %%
+ %% Custom environment settings
+ %% for all apps running on the node.
+ %%
+ {env,
+ [
+ {rvi_core,
+ [
+
+ {key_pair, {openssl_pem, "test_keys/insecure_device_key_priv.pem"}},
+ {provisioning_key, "test_keys/insecure_root_key_pub.pem"},
+ {authorize_jwt, "test_keys/insecure_device_key_pub_sign.jwt"},
+ {cert_dir, "test_certs"},
+
+ { node_address, IPPort(MyIP, MyPort+7) },
+
+ { node_service_prefix, "jlr.com/backend"},
+
+ { routing_rules,
+ [
+ { "",
+ [
+ { proto_json_rpc, dlink_tcp_rpc}
+ ]
+ }
+ ]
+ },
+ { components,
+ [
+ {service_edge,
+ [
+ %% Service_edge_rpc component is used as a gen_server
+ { service_edge_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+1 } },
+ { websocket, [ { port, MyPort+8}]}
+ ]
+ }
+ ]
+ },
+ { rvi_common, [{ rvi_log, gen_server, [{json_rpc_address, MyPort+9}]}]},
+ { service_discovery, [ { service_discovery_rpc, gen_server, [] } ] },
+ { schedule, [ { schedule_rpc, gen_server, [] } ] },
+ { authorize, [ { authorize_rpc, gen_server, [] } ] },
+ { protocol, [ { proto_json_rpc, gen_server, [] } ] },
+ { data_link,
+ [
+ { dlink_tcp_rpc, gen_server,
+ [
+ { server_opts, [ { port, MyPort + 7 }]}
+ ]
+ },
+ { dlink_tls_rpc, gen_server,
+ [
+ { server_opts, [ {port, MyPort + 10} ]}
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]}
+ ]}
+].
diff --git a/priv/config/rvi_sample.config b/priv/config/rvi_sample.config
new file mode 100644
index 0000000..a871a0f
--- /dev/null
+++ b/priv/config/rvi_sample.config
@@ -0,0 +1,351 @@
+%% -*- erlang -*-
+
+%% Copyright (C) 2014, Jaguar Land Rover
+%%
+%% This program is licensed under the terms and conditions of the
+%% Mozilla Public License, version 2.0. The full text of the
+%% Mozilla Public License is at https://www.mozilla.org/MPL/2.0/
+%%
+%% Configuration file for the (in-vehicle) IVI used by the hvac_demo
+%%
+%% See ../hvac_demo/README.md for details on the demo.
+%%
+%% See ../CONFIGURE.md for a details on the configuration process
+%% itself.
+%%
+
+%% Parameters for simpler modification
+Env = fun(V, Def) ->
+ case os:getenv(V) of
+ false -> Def;
+ Str when is_integer(Def) -> list_to_integer(Str);
+ Str when is_atom(Def) -> list_to_atom(Str);
+ Str -> Str
+ end
+ end.
+MyPort = Env("RVI_PORT", 9000).
+MyIP = Env("RVI_MYIP", "127.0.0.1").
+MyNodeAddr = Env("RVI_MY_NODE_ADDR", "0.0.0.0:0").
+BackendIP = Env("RVI_BACKEND", "38.129.64.31").
+BackendPort = Env("RVI_BACKEND_PORT", 8807).
+IPPort = fun(IP, Port) ->
+ IP ++ ":" ++ integer_to_list(Port)
+ end.
+LogLevel = Env("RVI_LOGLEVEL", notice).
+
+[
+ %% All erlang apps needed to fire up a node. Do not touch.
+ {include_lib, "rvi_core/rvi_common.config"},
+
+ %%
+ %% Custom environment settings
+ %% for all apps running on the node.
+ %%
+ {env,
+ [
+
+ %% All RVI configuration is done here.
+ %%
+ %% Please note that the rvi_node.sh launch script
+ %% can still override the port range and static nodes
+ %% through its command line parameters.
+ %%
+ %% Value substitution:
+ %% All string values under the rvi tuple tree are scanned
+ %% for specific dokens during startup. If a token is
+ %% found, it will be replaced with a value referenced by it.
+ %% Tokens can one of the following:
+ %%
+ %% $rvi_file(FileName,Default) - File content
+ %% When an $rvi_file() token is encountered, the first line of
+ %% the referenced file is read. The line (without the newline)
+ %% replaces the token.
+ %%
+ %% Example:
+ %% { node_service_prefix, "jlr.com/vin/$rvi_file(/etc/vin,default_vin)"},
+ %%
+ %% will be substituted with the first line from the file
+ %% /etc/vin:
+ %%
+ %% { node_service_prefix, "jlr.com/vin/2GKEG25HXP4093669"},
+ %%
+ %% If /etc/vin cannot be opened, the value default_vin
+ %% will be used instead.
+ %%
+ %%
+ %% $rvi_env(EnvironemtnName,Default) - Environment variable
+ %% When an $rvi_env() token is encountered, the value of
+ %% the Linux process environment variable (such as $HOME) is read
+ %% to replace the token.
+ %%
+ %% Example:
+ %% { node_service_prefix, "jlr.com/vin/$rvi_env(VIN,default_vin)"},
+ %%
+ %% will be substituted with the value of the $VIN environment
+ %% variable:
+ %%
+ %% { node_service_prefix, "jlr.com/vin/2GKEG25HXP4093669"},
+ %%
+ %% If VIN is not a defined environment variable, the value
+ %% default_vin will be used instead.
+ %%
+ %%
+ %% $rvi_uuid(Default) - Unique machine identifier
+ %% When an $rvi_uuid() token is encountered, the UUID of the root
+ %% disk used by the system is read to replace the token.
+ %% The UUID of the root disk is retrieved by opening /proc/cmdline
+ %% and extracting the root=UUID=[DiskUUID] value.
+ %% This value is generated at system install time and is reasonably
+ %% world wide unique.
+ %%
+ %% Example:
+ %% { node_service_prefix, "jlr.com/vin/$uuid(default_vin)"},
+ %%
+ %% will be substituted with the value of the root disk UUID:
+ %%
+ %% { node_service_prefix,
+ %% "jlr.com/vin/afc0a6d8-0264-4f8a-bb3e-51ff8655b51c"},
+ %%
+ %% If the root UUID cannot be retrieved, the value default_vin
+ %% will be used instead.
+ %%
+
+ {rvi_core,
+ [
+
+ {key_pair, {openssl_pem, "rvi_core/priv/sample_keys/insecure_device_bkey_priv.pem"}},
+ {provisioning_key, "rvi_core/priv/sample_keys/insecure_root_key_pub.pem"},
+ {authorize_jwt, "rvi_core/priv/sample_keys/insecure_device_key_pub_sign.jwt"},
+ {cert_dir, "rvi_core/priv/sample_certs"},
+
+ %% Specify the node address that data_link uses to listen to
+ %% incoming traffic from other rvi nodes.
+ %%
+ %% This is the address that is announced to
+ %% other rvi nodes during service discovery and should be
+ %% forwarded through firewalls and port forwarding to to the port
+ %% specified by the configuration entry rvi -> components ->
+ %% data_link ->json_rpc_server (see below).
+ %%
+ %% If this node is sitting behind a firewall and cannot
+ %% receive incomign connections on any address, its
+ %% node_address should be set to "0.0.0.0:0" to inform
+ %% the remote node that it should not attempt to
+ %% connect back to self.
+ { node_address, MyNodeAddr },
+
+ %% Specify the prefix of all services that this rvi node is hosting.
+ %%
+ %% All local services regsitering with service edge will be prefixed with
+ %% the string below when they are announced to remote rvi nodes
+ %% that connect to this node (using the address specified
+ %% by node_address above).
+ %%
+ %% If a locally connected service registers itself as
+ %% "hvac/fan_speed", and the node_service_prefix is
+ %% "jlr.com/vin/1234/", this node will announce the service
+ %% "jlr.com/vin/1234/hvac/fan_speed" as being available
+ %% to remotely connected rvi nodes.
+ %%
+ %% Two rvi nodes should never have the same node_service_prefix
+ %% value unless all services add a system-wide unique name
+ %% to it.
+ %%
+ { node_service_prefix, "jlr.com/vin/$rvi_uuid(default_vin)/"},
+
+
+ %% Routing rules determine how to get a message targeting a specific
+ %% service to its destination.
+ %%
+ %% Please note that if a remotely initiated (== client) data link is
+ %% available and has announced that the targeted service is available,
+ %% that data link will be used regardless of what it is.
+ %%
+ %% In other words, if you setup routing rules for how to reach out
+ %% to a vehicle using SMS, and that vehicle happens to have a 3G
+ %% connection up when the message is sent, the 3G connection will be used.
+ %%
+ %% We will add a blacklist feature in the future to optionally block
+ %% such opportunistic routing in the future.
+ %%
+ { routing_rules,
+ [
+ %% Service name prefix that rules are specified for
+ %% The service prefix with the longest match against the service targeted
+ %% by the message will be used.
+ %%
+ %% Example: Targeted service = jlr.com/backend/sota/get_updates
+ %%
+ %% Prefix1: { "jlr.com/backend", [...]}
+ %% Prefix2: { "jlr.com/backend/sota", [...]}
+ %%
+ %% Prefix2 will be used.
+ %%
+ %% This allows you, for example, to setup different servers
+ %% for different types of services (SOTA, remote door unlock,
+ %% HVAC etc).
+ %%
+
+ %% Make sure to have a default if you don't want your message
+ %% to error out immediately. With a default the message will
+ %% be queued until it times out, waiting for a remote node
+ %% to connect and announce that it can handle the targeted service.
+ { "",
+ [
+ { proto_json_rpc, dlink_tcp_rpc}
+ ]
+ },
+
+ { "jlr.com/backend/",
+ %% Which protocol and data link pair to use when transmitting the message
+ %% to the targeted service. If a pair reports a failure, the next pair is tried.
+ [
+ { proto_json_rpc, { dlink_tcp_rpc,
+ % {"38.129.64.13", 8807}
+ [ { target, IPPort(BackendIP, BackendPort) } ]}}
+ ]
+ },
+
+ %% Used to communicate with vehicles
+ { "jlr.com/vin/",
+ [
+ { proto_json_rpc, { dlink_tcp_rpc, [ broadcast, { interface, "wlan0" } ] } },
+ { proto_json_rpc, { server_3g, [ initiate_outbound ]} },
+
+ %% Protocols can have hinting as well.
+ %% In this case JSON-RPC should only be used if the
+ %% resulting message size can fit in an SMS (140 bytes).
+
+ { { proto_json_rpc, [ { max_msg_size, 140 } ] } , server_sms }
+ ]
+ }
+ ]
+ },
+
+ { components,
+ [
+ %% A note about JSON-RPC calls vs gen_server calls:
+ %%
+ %% All locally connected services communicate with Service Edge
+ %% through JSON-RPC.
+ %%
+ %% Communication between the internal RVI components, however,
+ %% can be either JSON-RPC or gen_server calls.
+ %%
+ %% JSON-RPC calls provide compatability with replacement components
+ %% written in languages other than Erlang.
+ %%
+ %% Gen_server calls provide native erlang inter-process calls that
+ %% are about 4x faster than JSON-RPC when transmitting large data volumes.
+ %%
+ %% If one or more of the components below are replaced with external
+ %% components, use JSON-RPC by specifying IP address and port in
+ %% json_rpc_address for all interfaced by the external components.
+ %%
+ %% If you are running an all-native erlang system, use gen_server calls
+ %% by specifying gen_server for all components
+ %%
+ %% Please note that communication between two RVI nodes are
+ %% not affected by this since dlink_tcp will use
+ %% JSON-RPC to communicate ( using the address/port specified
+ %% by proto_json_rpc).
+ %%
+
+ {rvi_common,
+ [
+ {rvi_log, gen_server,
+ [{json_rpc_address, MyPort+9}]
+ }
+ ]},
+ %% Service_edge.
+ %% The service_edge tuple is a top level configuration
+ %% container for everything about service edge.
+ %% In theory, we can support multiple different service edge
+ %% components (written in different languages).
+ %%
+ %% However, until we've sorted out internal routing, we will
+ %% only support the native service_edge_rpc component,
+ %% accessed either as a gen_server or through JSON-RPC.
+ %%
+ {service_edge,
+ [
+ %% Service_edge_rpc component is used as a gen_server
+ { service_edge_rpc, gen_server,
+ [
+ %% JSON-RPC address will be translated to
+ %% an URL looking like this:
+ %% http://127.0.0.1:8801
+ %%
+ %% This URL is used both for communication with
+ %% locally connected services and for intra-component
+ %% communication in case the access method for
+ %% service_edge_rpc is specified as json_rpc.
+ { json_rpc_address, { MyIP, MyPort+1 } }, % {"127.0.0.1",8801}
+
+ %% Websocket is used for websocket access, preferably
+ %% through the rvi.js package available for Javascript
+ %% apps in browsers and crosswalk who wants to interface
+ %% RVI.
+ { websocket, [ { port, MyPort+8}]} % 9008
+ ]
+ }
+ ]
+ },
+ { service_discovery,
+ [ { service_discovery_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+2 }} % {"127.0.0.1",9002}
+ ]
+ }
+ ]
+ },
+ { schedule,
+ [ { schedule_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+3 }} % {"127.0.0.1",9003}
+ ]
+ }
+ ]
+ },
+ { authorize,
+ [ { authorize_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+4 } } % {"127.0.0.1",9004}
+ ]
+ }
+ ]
+ },
+ { protocol,
+ [ { proto_json_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+5 } } % {"127.0.0.1",9005}
+ ]
+ }
+ ]
+ },
+ { data_link,
+ [ { dlink_tcp_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+6 } }, % 9006
+ %% data link TCP server specifies the port we should
+ %% listen to for incoming connections
+ %% from other rvi nodes.
+ %% A specific NIC address can also be specified
+ %% through the {ip, "192.168.0.1" } tuple.
+ { server_opts, [ { port, MyPort+7 }]},
+ { persistent_connections, [ IPPort(BackendIP, BackendPort) ]}
+ ]
+ },
+ { dlink_tls_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+11} },
+ { server_opts, [ {port, MyPort+10} ]}
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]}
+ ]}
+].
diff --git a/priv/config/rvi_yocto.config b/priv/config/rvi_yocto.config
new file mode 100644
index 0000000..a871a0f
--- /dev/null
+++ b/priv/config/rvi_yocto.config
@@ -0,0 +1,351 @@
+%% -*- erlang -*-
+
+%% Copyright (C) 2014, Jaguar Land Rover
+%%
+%% This program is licensed under the terms and conditions of the
+%% Mozilla Public License, version 2.0. The full text of the
+%% Mozilla Public License is at https://www.mozilla.org/MPL/2.0/
+%%
+%% Configuration file for the (in-vehicle) IVI used by the hvac_demo
+%%
+%% See ../hvac_demo/README.md for details on the demo.
+%%
+%% See ../CONFIGURE.md for a details on the configuration process
+%% itself.
+%%
+
+%% Parameters for simpler modification
+Env = fun(V, Def) ->
+ case os:getenv(V) of
+ false -> Def;
+ Str when is_integer(Def) -> list_to_integer(Str);
+ Str when is_atom(Def) -> list_to_atom(Str);
+ Str -> Str
+ end
+ end.
+MyPort = Env("RVI_PORT", 9000).
+MyIP = Env("RVI_MYIP", "127.0.0.1").
+MyNodeAddr = Env("RVI_MY_NODE_ADDR", "0.0.0.0:0").
+BackendIP = Env("RVI_BACKEND", "38.129.64.31").
+BackendPort = Env("RVI_BACKEND_PORT", 8807).
+IPPort = fun(IP, Port) ->
+ IP ++ ":" ++ integer_to_list(Port)
+ end.
+LogLevel = Env("RVI_LOGLEVEL", notice).
+
+[
+ %% All erlang apps needed to fire up a node. Do not touch.
+ {include_lib, "rvi_core/rvi_common.config"},
+
+ %%
+ %% Custom environment settings
+ %% for all apps running on the node.
+ %%
+ {env,
+ [
+
+ %% All RVI configuration is done here.
+ %%
+ %% Please note that the rvi_node.sh launch script
+ %% can still override the port range and static nodes
+ %% through its command line parameters.
+ %%
+ %% Value substitution:
+ %% All string values under the rvi tuple tree are scanned
+ %% for specific dokens during startup. If a token is
+ %% found, it will be replaced with a value referenced by it.
+ %% Tokens can one of the following:
+ %%
+ %% $rvi_file(FileName,Default) - File content
+ %% When an $rvi_file() token is encountered, the first line of
+ %% the referenced file is read. The line (without the newline)
+ %% replaces the token.
+ %%
+ %% Example:
+ %% { node_service_prefix, "jlr.com/vin/$rvi_file(/etc/vin,default_vin)"},
+ %%
+ %% will be substituted with the first line from the file
+ %% /etc/vin:
+ %%
+ %% { node_service_prefix, "jlr.com/vin/2GKEG25HXP4093669"},
+ %%
+ %% If /etc/vin cannot be opened, the value default_vin
+ %% will be used instead.
+ %%
+ %%
+ %% $rvi_env(EnvironemtnName,Default) - Environment variable
+ %% When an $rvi_env() token is encountered, the value of
+ %% the Linux process environment variable (such as $HOME) is read
+ %% to replace the token.
+ %%
+ %% Example:
+ %% { node_service_prefix, "jlr.com/vin/$rvi_env(VIN,default_vin)"},
+ %%
+ %% will be substituted with the value of the $VIN environment
+ %% variable:
+ %%
+ %% { node_service_prefix, "jlr.com/vin/2GKEG25HXP4093669"},
+ %%
+ %% If VIN is not a defined environment variable, the value
+ %% default_vin will be used instead.
+ %%
+ %%
+ %% $rvi_uuid(Default) - Unique machine identifier
+ %% When an $rvi_uuid() token is encountered, the UUID of the root
+ %% disk used by the system is read to replace the token.
+ %% The UUID of the root disk is retrieved by opening /proc/cmdline
+ %% and extracting the root=UUID=[DiskUUID] value.
+ %% This value is generated at system install time and is reasonably
+ %% world wide unique.
+ %%
+ %% Example:
+ %% { node_service_prefix, "jlr.com/vin/$uuid(default_vin)"},
+ %%
+ %% will be substituted with the value of the root disk UUID:
+ %%
+ %% { node_service_prefix,
+ %% "jlr.com/vin/afc0a6d8-0264-4f8a-bb3e-51ff8655b51c"},
+ %%
+ %% If the root UUID cannot be retrieved, the value default_vin
+ %% will be used instead.
+ %%
+
+ {rvi_core,
+ [
+
+ {key_pair, {openssl_pem, "rvi_core/priv/sample_keys/insecure_device_bkey_priv.pem"}},
+ {provisioning_key, "rvi_core/priv/sample_keys/insecure_root_key_pub.pem"},
+ {authorize_jwt, "rvi_core/priv/sample_keys/insecure_device_key_pub_sign.jwt"},
+ {cert_dir, "rvi_core/priv/sample_certs"},
+
+ %% Specify the node address that data_link uses to listen to
+ %% incoming traffic from other rvi nodes.
+ %%
+ %% This is the address that is announced to
+ %% other rvi nodes during service discovery and should be
+ %% forwarded through firewalls and port forwarding to to the port
+ %% specified by the configuration entry rvi -> components ->
+ %% data_link ->json_rpc_server (see below).
+ %%
+ %% If this node is sitting behind a firewall and cannot
+ %% receive incomign connections on any address, its
+ %% node_address should be set to "0.0.0.0:0" to inform
+ %% the remote node that it should not attempt to
+ %% connect back to self.
+ { node_address, MyNodeAddr },
+
+ %% Specify the prefix of all services that this rvi node is hosting.
+ %%
+ %% All local services regsitering with service edge will be prefixed with
+ %% the string below when they are announced to remote rvi nodes
+ %% that connect to this node (using the address specified
+ %% by node_address above).
+ %%
+ %% If a locally connected service registers itself as
+ %% "hvac/fan_speed", and the node_service_prefix is
+ %% "jlr.com/vin/1234/", this node will announce the service
+ %% "jlr.com/vin/1234/hvac/fan_speed" as being available
+ %% to remotely connected rvi nodes.
+ %%
+ %% Two rvi nodes should never have the same node_service_prefix
+ %% value unless all services add a system-wide unique name
+ %% to it.
+ %%
+ { node_service_prefix, "jlr.com/vin/$rvi_uuid(default_vin)/"},
+
+
+ %% Routing rules determine how to get a message targeting a specific
+ %% service to its destination.
+ %%
+ %% Please note that if a remotely initiated (== client) data link is
+ %% available and has announced that the targeted service is available,
+ %% that data link will be used regardless of what it is.
+ %%
+ %% In other words, if you setup routing rules for how to reach out
+ %% to a vehicle using SMS, and that vehicle happens to have a 3G
+ %% connection up when the message is sent, the 3G connection will be used.
+ %%
+ %% We will add a blacklist feature in the future to optionally block
+ %% such opportunistic routing in the future.
+ %%
+ { routing_rules,
+ [
+ %% Service name prefix that rules are specified for
+ %% The service prefix with the longest match against the service targeted
+ %% by the message will be used.
+ %%
+ %% Example: Targeted service = jlr.com/backend/sota/get_updates
+ %%
+ %% Prefix1: { "jlr.com/backend", [...]}
+ %% Prefix2: { "jlr.com/backend/sota", [...]}
+ %%
+ %% Prefix2 will be used.
+ %%
+ %% This allows you, for example, to setup different servers
+ %% for different types of services (SOTA, remote door unlock,
+ %% HVAC etc).
+ %%
+
+ %% Make sure to have a default if you don't want your message
+ %% to error out immediately. With a default the message will
+ %% be queued until it times out, waiting for a remote node
+ %% to connect and announce that it can handle the targeted service.
+ { "",
+ [
+ { proto_json_rpc, dlink_tcp_rpc}
+ ]
+ },
+
+ { "jlr.com/backend/",
+ %% Which protocol and data link pair to use when transmitting the message
+ %% to the targeted service. If a pair reports a failure, the next pair is tried.
+ [
+ { proto_json_rpc, { dlink_tcp_rpc,
+ % {"38.129.64.13", 8807}
+ [ { target, IPPort(BackendIP, BackendPort) } ]}}
+ ]
+ },
+
+ %% Used to communicate with vehicles
+ { "jlr.com/vin/",
+ [
+ { proto_json_rpc, { dlink_tcp_rpc, [ broadcast, { interface, "wlan0" } ] } },
+ { proto_json_rpc, { server_3g, [ initiate_outbound ]} },
+
+ %% Protocols can have hinting as well.
+ %% In this case JSON-RPC should only be used if the
+ %% resulting message size can fit in an SMS (140 bytes).
+
+ { { proto_json_rpc, [ { max_msg_size, 140 } ] } , server_sms }
+ ]
+ }
+ ]
+ },
+
+ { components,
+ [
+ %% A note about JSON-RPC calls vs gen_server calls:
+ %%
+ %% All locally connected services communicate with Service Edge
+ %% through JSON-RPC.
+ %%
+ %% Communication between the internal RVI components, however,
+ %% can be either JSON-RPC or gen_server calls.
+ %%
+ %% JSON-RPC calls provide compatability with replacement components
+ %% written in languages other than Erlang.
+ %%
+ %% Gen_server calls provide native erlang inter-process calls that
+ %% are about 4x faster than JSON-RPC when transmitting large data volumes.
+ %%
+ %% If one or more of the components below are replaced with external
+ %% components, use JSON-RPC by specifying IP address and port in
+ %% json_rpc_address for all interfaced by the external components.
+ %%
+ %% If you are running an all-native erlang system, use gen_server calls
+ %% by specifying gen_server for all components
+ %%
+ %% Please note that communication between two RVI nodes are
+ %% not affected by this since dlink_tcp will use
+ %% JSON-RPC to communicate ( using the address/port specified
+ %% by proto_json_rpc).
+ %%
+
+ {rvi_common,
+ [
+ {rvi_log, gen_server,
+ [{json_rpc_address, MyPort+9}]
+ }
+ ]},
+ %% Service_edge.
+ %% The service_edge tuple is a top level configuration
+ %% container for everything about service edge.
+ %% In theory, we can support multiple different service edge
+ %% components (written in different languages).
+ %%
+ %% However, until we've sorted out internal routing, we will
+ %% only support the native service_edge_rpc component,
+ %% accessed either as a gen_server or through JSON-RPC.
+ %%
+ {service_edge,
+ [
+ %% Service_edge_rpc component is used as a gen_server
+ { service_edge_rpc, gen_server,
+ [
+ %% JSON-RPC address will be translated to
+ %% an URL looking like this:
+ %% http://127.0.0.1:8801
+ %%
+ %% This URL is used both for communication with
+ %% locally connected services and for intra-component
+ %% communication in case the access method for
+ %% service_edge_rpc is specified as json_rpc.
+ { json_rpc_address, { MyIP, MyPort+1 } }, % {"127.0.0.1",8801}
+
+ %% Websocket is used for websocket access, preferably
+ %% through the rvi.js package available for Javascript
+ %% apps in browsers and crosswalk who wants to interface
+ %% RVI.
+ { websocket, [ { port, MyPort+8}]} % 9008
+ ]
+ }
+ ]
+ },
+ { service_discovery,
+ [ { service_discovery_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+2 }} % {"127.0.0.1",9002}
+ ]
+ }
+ ]
+ },
+ { schedule,
+ [ { schedule_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+3 }} % {"127.0.0.1",9003}
+ ]
+ }
+ ]
+ },
+ { authorize,
+ [ { authorize_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+4 } } % {"127.0.0.1",9004}
+ ]
+ }
+ ]
+ },
+ { protocol,
+ [ { proto_json_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+5 } } % {"127.0.0.1",9005}
+ ]
+ }
+ ]
+ },
+ { data_link,
+ [ { dlink_tcp_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+6 } }, % 9006
+ %% data link TCP server specifies the port we should
+ %% listen to for incoming connections
+ %% from other rvi nodes.
+ %% A specific NIC address can also be specified
+ %% through the {ip, "192.168.0.1" } tuple.
+ { server_opts, [ { port, MyPort+7 }]},
+ { persistent_connections, [ IPPort(BackendIP, BackendPort) ]}
+ ]
+ },
+ { dlink_tls_rpc, gen_server,
+ [
+ { json_rpc_address, { MyIP, MyPort+11} },
+ { server_opts, [ {port, MyPort+10} ]}
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]}
+ ]}
+].
diff --git a/priv/sample_certs/insecure_default_cert.json b/priv/sample_certs/insecure_default_cert.json
new file mode 100644
index 0000000..f39f80b
--- /dev/null
+++ b/priv/sample_certs/insecure_default_cert.json
@@ -0,0 +1,24 @@
+{
+ "create_timestamp": 1439925416,
+ "destinations": [
+ "jlr.com"
+ ],
+ "id": "insecure_cert",
+ "iss": "jaguarlandrover.com",
+ "keys": [
+ {
+ "alg": "RS256",
+ "e": "AQAB",
+ "kty": "RSA",
+ "n": "pkRFT75OhNvLGZixkslWk6bVXWwMRXx5rj46HqOOp9AW3rGtEqwbXHGPDONY9ur7RBIRHi9lFTjG_V4Ycvduzwt3cr7YqgrGW7bIYitgXYrv8ymveX0ZVeBRwv2Ij96Ybh1P7BReq0oiAJNYsXpLwrPX24Bxz27I2oL6ZWLu79EtNXnGdkDiWbWXdjwxN5A8MgBkn-qzBDvEMpvClNV5s3dOtBrFUiFHY99jwznCN8tpuMReASHjcM46lmFHDEUyUmiBby4pSGpQVTg_QhO08RrTNDHytvH_xMdrD99I4HrBHgM6eGJYSzfuoyI3lyKZlkOxFlYt88znCYVz2uluurjwDqEGzuqZ3TC-WbBnmdQrYuvgh0xyFXZa3DHS8dCorUMt0W9vWsB7maC-KZgB40P_I_jsFC1DlYNIzRYJ3Ua4nnj8IbaXvbyMdDoQ5tQPmbnoKxo6ZIM3hv-K196OG3iP8c1TdzdAmRhjFEoXLShp1Y3Ek5O_ifPc6nY-IDgbyOFCo0MpFWCjRODKgh51aY1nfJ00sFc86IAmtgQYyjdFUbBx_Tpdhz2h7E7s9wm48I2WQ8Klv1KSEW_nuIdrH-nmab0V5CSYFsUs0ZzI3iTRbodT53vyJ-SbB4xK3vhXxp7mJaBm4xHjc0cnypUaAUMXTi0cduJ6Zt68ieVRc3M",
+ "use": "sig"
+ }
+ ],
+ "sources": [
+ "jlr.com"
+ ],
+ "validity": {
+ "start": 1420099200,
+ "stop": 1925020799
+ }
+}
diff --git a/priv/sample_certs/insecure_default_cert.jwt b/priv/sample_certs/insecure_default_cert.jwt
new file mode 100644
index 0000000..647eb84
--- /dev/null
+++ b/priv/sample_certs/insecure_default_cert.jwt
@@ -0,0 +1 @@
+eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXlzIjpbeyJhbGciOiJSUzI1NiIsInVzZSI6InNpZyIsImUiOiJBUUFCIiwia3R5IjoiUlNBIiwibiI6InBrUkZUNzVPaE52TEdaaXhrc2xXazZiVlhXd01SWHg1cmo0NkhxT09wOUFXM3JHdEVxd2JYSEdQRE9OWTl1cjdSQklSSGk5bEZUakdfVjRZY3ZkdXp3dDNjcjdZcWdyR1c3YklZaXRnWFlydjh5bXZlWDBaVmVCUnd2MklqOTZZYmgxUDdCUmVxMG9pQUpOWXNYcEx3clBYMjRCeHoyN0kyb0w2WldMdTc5RXRO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zXy4bYpS0sBO6EfRN1trQe7bojbBf0yL-kRjbO9Fmj7OFvCUr47KkZCZehkpt4Jtl6WGxmUg7_SM8h4HUGVvzO9iDKUFPpgUmt4kqfa7wZUvPYQzT4KsePxiXfmehQ6Axx9LjE7nZ-BhWrKctiU2LbtymsL2svPuaWblW7z39O3vNW4OQEOzXmcvXXMIXLxSA77aZOqffYBgV51ybpsZt8HJySF5nUO_JSMJEwdMOUuNfiBZZpUs44IXnQ26DKzIGHSJAzsEdBdux_QXgCMFr-bmdI8usMojRPAZZKpVO8WFGdie8yn8GfRTPp2VfxpXDCDeqs2R33WWAaFgsyvpWPt0mn6nKgUGJ-GnBHtycTZoMs5ZcsG07Z-f_HpwaAW056gqkni2jm2WyA3QtkcVfMDJOhwenwQA5LPb5Otji_qeuxuTyMGSY80-9G9LNJR0Ut-bAXkBXUbbMfrOAEi4Z-JIUOPJH7O6ndx-t30FcGT0RCqdqe_8vr_B_H5xAcD6xDo0jRIunemXVt4vrX4ASoLTik \ No newline at end of file
diff --git a/priv/sample_keys/insecure_device_key_priv.pem b/priv/sample_keys/insecure_device_key_priv.pem
new file mode 100644
index 0000000..89d47b4
--- /dev/null
+++ b/priv/sample_keys/insecure_device_key_priv.pem
@@ -0,0 +1,51 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIJKAIBAAKCAgEApkRFT75OhNvLGZixkslWk6bVXWwMRXx5rj46HqOOp9AW3rGt
+EqwbXHGPDONY9ur7RBIRHi9lFTjG/V4Ycvduzwt3cr7YqgrGW7bIYitgXYrv8ymv
+eX0ZVeBRwv2Ij96Ybh1P7BReq0oiAJNYsXpLwrPX24Bxz27I2oL6ZWLu79EtNXnG
+dkDiWbWXdjwxN5A8MgBkn+qzBDvEMpvClNV5s3dOtBrFUiFHY99jwznCN8tpuMRe
+ASHjcM46lmFHDEUyUmiBby4pSGpQVTg/QhO08RrTNDHytvH/xMdrD99I4HrBHgM6
+eGJYSzfuoyI3lyKZlkOxFlYt88znCYVz2uluurjw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xxM/+7YLDDrAxn1IDLt5f8GA+GhzEkk5hrPibquISZHpAt0VntGx
+55UbLa7X9OZ61GAE+PcudGpvwbGaMkdHQJjhkx29ytZz38TRUJ7FFOJNR50YKaea
+7u2C+YIBHrA2s5KDQHZUpgLmulCtRh3UDjbZlrQoEhG4gWq3MAtSSbjWAE97FAYz
+yMbOlNeoqYalWBGXiBq/W6qkLQIcfy8kLXpnqHykc5CdBKeJ90PKmAfcn7ENmgs1
+ObgSsLxM0qY1fKCrM3aNQCZ0QnOskpVVPd/EusFxSKquoIeDvAyZuUgc8uxyQ/+l
+zNzzNEmNebVSNfYI6yOA2u9sSnWiQ85BAoIBABzg/noD+YqIqODORsMd9QZ+nv2V
+G11+z+lnKBSCAp61hvKNzK1ClB8OaVpZ29rvZZivXqfKekXULPbEdNgN33IVvmK+
+/msQ0oUoz5Elazh3rHREYCWO7dX6RSvvizlyzvVnrUkPzO05TWYJP5jaGl266MGi
+EQMiucyBlzJRU5aiAPV9khH2VAL9oovAJquwIrVz/nPHI6P8ZHVnCqwkGO+0cxzI
+H6oDMjKuUD+zLUU6QAWn1+ziLQ+7hCNk+3ZidCg1cs+yf5TsHQYu8borfb9gE4fs
+fD2R3pi8LDwNS8RFG5W4fdO46DzzmAp+oSvoN6c/Z8C3jdtnwHOVEDCKMi8=
+-----END RSA PRIVATE KEY----- \ No newline at end of file
diff --git a/priv/sample_keys/insecure_device_key_pub.pem b/priv/sample_keys/insecure_device_key_pub.pem
new file mode 100644
index 0000000..6d82a7e
--- /dev/null
+++ b/priv/sample_keys/insecure_device_key_pub.pem
@@ -0,0 +1,14 @@
+-----BEGIN PUBLIC KEY-----
+MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEApkRFT75OhNvLGZixkslW
+k6bVXWwMRXx5rj46HqOOp9AW3rGtEqwbXHGPDONY9ur7RBIRHi9lFTjG/V4Ycvdu
+zwt3cr7YqgrGW7bIYitgXYrv8ymveX0ZVeBRwv2Ij96Ybh1P7BReq0oiAJNYsXpL
+wrPX24Bxz27I2oL6ZWLu79EtNXnGdkDiWbWXdjwxN5A8MgBkn+qzBDvEMpvClNV5
+s3dOtBrFUiFHY99jwznCN8tpuMReASHjcM46lmFHDEUyUmiBby4pSGpQVTg/QhO0
+8RrTNDHytvH/xMdrD99I4HrBHgM6eGJYSzfuoyI3lyKZlkOxFlYt88znCYVz2ulu
+urjwDqEGzuqZ3TC+WbBnmdQrYuvgh0xyFXZa3DHS8dCorUMt0W9vWsB7maC+KZgB
+40P/I/jsFC1DlYNIzRYJ3Ua4nnj8IbaXvbyMdDoQ5tQPmbnoKxo6ZIM3hv+K196O
+G3iP8c1TdzdAmRhjFEoXLShp1Y3Ek5O/ifPc6nY+IDgbyOFCo0MpFWCjRODKgh51
+aY1nfJ00sFc86IAmtgQYyjdFUbBx/Tpdhz2h7E7s9wm48I2WQ8Klv1KSEW/nuIdr
+H+nmab0V5CSYFsUs0ZzI3iTRbodT53vyJ+SbB4xK3vhXxp7mJaBm4xHjc0cnypUa
+AUMXTi0cduJ6Zt68ieVRc3MCAwEAAQ==
+-----END PUBLIC KEY----- \ No newline at end of file
diff --git a/priv/sample_keys/insecure_device_key_pub_sign.jwt b/priv/sample_keys/insecure_device_key_pub_sign.jwt
new file mode 100644
index 0000000..32871fe
--- /dev/null
+++ b/priv/sample_keys/insecure_device_key_pub_sign.jwt
@@ -0,0 +1 @@
+eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXlzIjpbeyJhbGciOiJSUzI1NiIsInVzZSI6InNpZyIsImUiOiJBUUFCIiwia3R5IjoiUlNBIiwibiI6InBrUkZUNzVPaE52TEdaaXhrc2xXazZiVlhXd01SWHg1cmo0NkhxT09wOUFXM3JHdEVxd2JYSEdQRE9OWTl1cjdSQklSSGk5bEZUakdfVjRZY3ZkdXp3dDNjcjdZcWdyR1c3YklZaXRnWFlydjh5bXZlWDBaVmVCUnd2MklqOTZZYmgxUDdCUmVxMG9pQUpOWXNYcEx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EGxSSPhE8spkzA24ErZMyUUMrhVtW8s2XEUz5ySK_8Nj_cSLwsnNrX3va3yulcq8X3ocLbis7s87zBaGmU9BYU660fA4yvHeAOxcPc-YYPrkCTlpJoecfOGQ8mmtvdRz0wgiUaw78UpVndPEZStEae4g91QZRNDpBms5_G9Xj4mnMkObMFMGLlt-CzBVc9QPpvysPI-GGnzbi7ep6enGRlLyRFXEmtnPHwI2mk1HwA9yVaCLQdIXWtfs7tn0xywoOs73fVt9Gtz7NLuVb3SYNWhWzjmvsm-qyo8qanlAU849ZMg9aGz0VjhGIJzCbuF4J8 \ No newline at end of file
diff --git a/priv/sample_keys/insecure_root_key_priv.pem b/priv/sample_keys/insecure_root_key_priv.pem
new file mode 100644
index 0000000..a81e8be
--- /dev/null
+++ b/priv/sample_keys/insecure_root_key_priv.pem
@@ -0,0 +1,51 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIJJwIBAAKCAgEAqA2MbZ+mPUo68SB2Hp4AFgMHua74QJRlhQyFcDQQSs5umvDJ
+i9QMM+k1V7WHlPKM5nOXGVhpFAjeHlxKwM9ezz42yHsbG20YOf3DT0HlJ2blkLCm
+JrWLb9POeiJARumQ92NbPX57SJjlPmHtzadVGk/xS58qURNl1qK9a56bOrZNNtXg
+OW6uAQkaVDctIzIcHH+Mv3a72ZcaTWX6UuMt1QK6meQ1rdqGKblFpgOfFzp/jRwx
+8qo5bG9D4Vk0umao0o5PjHVssscqEaS3YLQD+HmzTV9R4OgauGFogHQIAjtgAchH
+sHJ/w3mb/j3AKsMvyBkPk3J/DG1gVNK+8+Iu2AYWwY2iZnYB8nGQipO6WUsohpMO
+sQ1ayu5bwS7Mpu+BFaOdc4UUUU3XU+YNyhyYnv9kCZJThulYLnU7gYaVPJL3rJBj
+yiEfWe3X033k9R4+HCGpEh6RksqHAytw+v0xLtDKr0IYPLjMXYXAHU0abnCRdx8Z
+Qa64TsKEoFicVUo8AdgR5boAclKaVWADab/WUEVJL8uIvutEvisNNqMv57C95f/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KLyDykMH0t587l80s+mpfrbZK9r8X05sdkyq35H9T9ZWiQxQK+qPNpfjDm
+i9ANOtMycqsBT/gzR3cXhYFMPUo9X/lFaayHZos09WL8PvVyknAz/eqJLLSF4+lk
+OE1bFRk2rNyYxjr4Xd6JWHleV9/oXPUCggEAOHCvPonfaZNOilKGzRYd967JxH5V
+n/gLxdYrOJx6+Vv8qzhNq+sozOBEgLxJ7xUNHo0r9TqB8Mpv6Q9hMYvXgqnf+j58
+lcie9vDwaTa0yPFymvD/47C5nc6w2Hd8nRc0D3wzOPSdIu7tExxv44911OlQuH/z
+01L8WARunxjyzQkbe4DL+L/5A6DgYWrNiWV/SqMv0j/UaaGVNlm3uTsh77EqxXwL
+4XSDE1NztW/9k+7SdtQv9hxPR1uM4qoE4qW0LXo/IlCSTf1BvGXk5cvH/3DINaQI
+Ik5mQP9/uCfnnniqLrCyF/c5zY+nUAjVbiIW8RF7kd3h5QGzCzGI1PCA1A==
+-----END RSA PRIVATE KEY-----
diff --git a/priv/sample_keys/insecure_root_key_pub.pem b/priv/sample_keys/insecure_root_key_pub.pem
new file mode 100644
index 0000000..bd203ef
--- /dev/null
+++ b/priv/sample_keys/insecure_root_key_pub.pem
@@ -0,0 +1,14 @@
+-----BEGIN PUBLIC KEY-----
+MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqA2MbZ+mPUo68SB2Hp4A
+FgMHua74QJRlhQyFcDQQSs5umvDJi9QMM+k1V7WHlPKM5nOXGVhpFAjeHlxKwM9e
+zz42yHsbG20YOf3DT0HlJ2blkLCmJrWLb9POeiJARumQ92NbPX57SJjlPmHtzadV
+Gk/xS58qURNl1qK9a56bOrZNNtXgOW6uAQkaVDctIzIcHH+Mv3a72ZcaTWX6UuMt
+1QK6meQ1rdqGKblFpgOfFzp/jRwx8qo5bG9D4Vk0umao0o5PjHVssscqEaS3YLQD
++HmzTV9R4OgauGFogHQIAjtgAchHsHJ/w3mb/j3AKsMvyBkPk3J/DG1gVNK+8+Iu
+2AYWwY2iZnYB8nGQipO6WUsohpMOsQ1ayu5bwS7Mpu+BFaOdc4UUUU3XU+YNyhyY
+nv9kCZJThulYLnU7gYaVPJL3rJBjyiEfWe3X033k9R4+HCGpEh6RksqHAytw+v0x
+LtDKr0IYPLjMXYXAHU0abnCRdx8ZQa64TsKEoFicVUo8AdgR5boAclKaVWADab/W
+UEVJL8uIvutEvisNNqMv57C95f/0sBG+0rJ2W+ix3+DIwkSnZl+7FwXSMtCbV33l
+a2Rz+Jv/G9OtRYUXyXo3WtrshntiOd3f6KVd18uEE/dpkmWoCnM3AJObp+LH0Qty
+yj9u7yiE/oH0TGxYaxN0AFUCAwEAAQ==
+-----END PUBLIC KEY-----
diff --git a/priv/test_config/backend.config b/priv/test_config/backend.config
new file mode 100644
index 0000000..fe60836
--- /dev/null
+++ b/priv/test_config/backend.config
@@ -0,0 +1,17 @@
+%% -*- erlang -*-
+{ok, CurDir} = file:get_cwd().
+[
+ {include_lib, "rvi_core/priv/config/rvi_backend.config"},
+ {set_env,
+ [
+ {rvi_core,
+ [{key_pair, {openssl_pem, filename:join(
+ CurDir, "../basic_backend_keys/dev_priv.pem")}},
+ {provisioning_key,
+ {openssl_pem, filename:join(CurDir, "../root_keys/root_pub.pem")}},
+ {authorize_jwt, filename:join(
+ CurDir, "../basic_backend_keys/dev_pub_sign.jwt")},
+ {cert_dir, filename:join(CurDir, "../basic_backend_certs")}
+ ]}
+ ]}
+].
diff --git a/priv/test_config/basic_backend.config b/priv/test_config/basic_backend.config
new file mode 100644
index 0000000..2a60627
--- /dev/null
+++ b/priv/test_config/basic_backend.config
@@ -0,0 +1,6 @@
+%% -*- erlang -*-
+{ok, CurDir} = file:get_cwd().
+[
+ {include_lib, "rvi_core/priv/test_config/backend.config"},
+ {remove_apps, [bt, dlink_bt]}
+].
diff --git a/priv/test_config/basic_sample.config b/priv/test_config/basic_sample.config
new file mode 100644
index 0000000..56f9a4c
--- /dev/null
+++ b/priv/test_config/basic_sample.config
@@ -0,0 +1,6 @@
+%% -*- erlang -*-
+{ok, CurDir} = file:get_cwd().
+[
+ {include_lib, "rvi_core/priv/test_config/sample.config"},
+ {remove_apps, [bt, dlink_bt]}
+].
diff --git a/priv/test_config/bt_backend.config b/priv/test_config/bt_backend.config
new file mode 100644
index 0000000..dfa7645
--- /dev/null
+++ b/priv/test_config/bt_backend.config
@@ -0,0 +1,16 @@
+%% -*- erlang -*-
+[
+ {include_lib, "rvi_core/priv/test_config/backend.config"},
+ {remove_apps, [dlink_tcp, dlink_tls]},
+
+ {set_env,
+ [
+ {rvi_core,
+ [
+ { [routing_rules, ""], [{proto_json, dlink_bt_rpc}] },
+ { [components, data_link], [{dlink_bt_rpc, gen_server,
+ [{server_opts, [{test_mode, tcp},
+ {port, 8007}]}]}]}
+ ]}
+ ]}
+].
diff --git a/priv/test_config/bt_sample.config b/priv/test_config/bt_sample.config
new file mode 100644
index 0000000..0159992
--- /dev/null
+++ b/priv/test_config/bt_sample.config
@@ -0,0 +1,17 @@
+%% -*- erlang -*-
+[
+ {include_lib, "rvi_core/priv/test_config/sample.config"},
+ {remove_apps, [dlink_tcp, dlink_tls]},
+ {set_env,
+ [
+ {rvi_core,
+ [
+ { [routing_rules, ""], {proto_json, dlink_bt_rpc} },
+ { [components, data_link], [{dlink_bt_rpc, gen_server,
+ [{server_opts, [{test_mode, tcp},
+ {port, 9007}]},
+ {persistent_connections,
+ ["localhost:8007"]}]}]}
+ ]}
+ ]}
+].
diff --git a/priv/test_config/sample.config b/priv/test_config/sample.config
new file mode 100644
index 0000000..6a7c41c
--- /dev/null
+++ b/priv/test_config/sample.config
@@ -0,0 +1,20 @@
+%% -*- erlang -*-
+{ok, CurDir} = file:get_cwd().
+[
+ {include_lib, "rvi_core/priv/config/rvi_sample.config"},
+ {remove_apps, [bt, dlink_bt]},
+ {set_env,
+ [
+ {rvi_core,
+ [
+ {node_service_prefix, "jlr.com/vin/abc"},
+ {key_pair, {openssl_pem, filename:join(
+ CurDir, "../basic_sample_keys/dev_priv.pem")}},
+ {provisioning_key,
+ {openssl_pem, filename:join(CurDir, "../root_keys/root_pub.pem")}},
+ {authorize_jwt, filename:join(
+ CurDir, "../basic_sample_keys/dev_pub_sign.jwt")},
+ {cert_dir, filename:join(CurDir, "../basic_sample_certs")}
+ ]}
+ ]}
+].
diff --git a/priv/test_config/sms_backend.config b/priv/test_config/sms_backend.config
new file mode 100644
index 0000000..0958667
--- /dev/null
+++ b/priv/test_config/sms_backend.config
@@ -0,0 +1,25 @@
+%% -*- erlang -*-
+[
+ {include_lib, "rvi_core/priv/test_config/backend.config"},
+ {set_env,
+ [
+ {gsms,
+ [{interfaces,
+ [{gsms_plivo, plivo1, [{acct, acct1},
+ {auth_id, "acct1"},
+ {auth_token, "auth1"},
+ {src_number, "+111"},
+ {recv_port, 9200},
+ {send_uri, "http://localhost:9100"},
+ {recv_uri, "http://localhost:9200"}]}
+ ]}
+ ]},
+ {rvi_core,
+ [
+ { [routing_rules, ""], {proto_json, dlink_sms_rpc} },
+ { [components, data_link], [{dlink_sms_rpc, gen_server,
+ [{server_opts, [{port, 9007}]}]}]}
+ ]}
+ ]}
+].
+
diff --git a/priv/test_config/sms_sample.config b/priv/test_config/sms_sample.config
new file mode 100644
index 0000000..336b806
--- /dev/null
+++ b/priv/test_config/sms_sample.config
@@ -0,0 +1,25 @@
+%% -*- erlang -*-
+[
+ {include_lib, "rvi_core/priv/test_config/sample.config"},
+ {set_env,
+ [
+ {gsms,
+ [{interfaces,
+ [{gsms_plivo, plivo2, [{acct, acct2},
+ {auth_id, "acct2"},
+ {auth_token, "auth2"},
+ {src_number, "+222"},
+ {recv_port, 9300},
+ {send_uri, "http://localhost:9100"},
+ {recv_uri, "http://localhost:9300"}]}]
+ }]
+ },
+ {rvi_core,
+ [
+ { [routing_rules, ""], {proto_json, dlink_sms_rpc} },
+ { [components, data_link], [{dlink_sms_rpc, gen_server,
+ [{server_opts, [{port, 9007}]}]}]}
+ ]}
+ ]}
+].
+
diff --git a/priv/test_config/tls_backend.config b/priv/test_config/tls_backend.config
new file mode 100644
index 0000000..c5709ed
--- /dev/null
+++ b/priv/test_config/tls_backend.config
@@ -0,0 +1,14 @@
+%% -*- erlang -*-
+[
+ {include_lib, "rvi_core/priv/test_config/backend.config"},
+ {set_env,
+ [
+ {rvi_core,
+ [
+ { [routing_rules, ""], [{proto_msgpack_rpc, dlink_tls_rpc}] },
+ { [components, data_link], [{dlink_tls_rpc, gen_server,
+ [{server_opts, [{port, 8007}]}]}]},
+ { [components, protocol], [{proto_msgpack_rpc, gen_server, []}] }
+ ]}
+ ]}
+].
diff --git a/priv/test_config/tls_sample.config b/priv/test_config/tls_sample.config
new file mode 100644
index 0000000..318bc27
--- /dev/null
+++ b/priv/test_config/tls_sample.config
@@ -0,0 +1,16 @@
+%% -*- erlang -*-
+[
+ {include_lib, "rvi_core/priv/test_config/sample.config"},
+ {set_env,
+ [
+ {rvi_core,
+ [
+ { [routing_rules, ""], [{proto_json, dlink_tls_rpc}] },
+ { [components, data_link], [{dlink_tls_rpc, gen_server,
+ [{server_opts, [{port, 9007}]},
+ {persistent_connections,
+ ["localhost:8007"]}]}]},
+ { [components, protocol], [{ proto_msgpack, gen_server, [] }] }
+ ]}
+ ]}
+].