summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Wiger <ulf@feuerlabs.com>2015-06-29 19:39:02 +0200
committerUlf Wiger <ulf@feuerlabs.com>2015-06-29 19:39:02 +0200
commita4b7bf8ca342796e78eef0d641c4defc95d0b0c3 (patch)
tree21af865e42dbe91b2e6b86879fa5c2de6f85a4c6
parentc415dbf4299d4fb694a7a1bf01bf52f344092484 (diff)
downloadrvi_core-a4b7bf8ca342796e78eef0d641c4defc95d0b0c3.tar.gz
minor fixes rvi -> rvi_core + usable defaults
-rwxr-xr-xcomponents/authorize/authorbin0 -> 392621 bytes
-rw-r--r--components/authorize/src/authorize_keys.erl12
-rw-r--r--components/rvi_common/src/rvi_common.erl13
-rw-r--r--components/rvi_common/src/rvi_common_app.erl2
-rw-r--r--rvi_backend.config2
-rw-r--r--src/rvi_core.app.src11
6 files changed, 27 insertions, 13 deletions
diff --git a/components/authorize/author b/components/authorize/author
new file mode 100755
index 0000000..5eac34f
--- /dev/null
+++ b/components/authorize/author
Binary files differ
diff --git a/components/authorize/src/authorize_keys.erl b/components/authorize/src/authorize_keys.erl
index a4e7473..c52c028 100644
--- a/components/authorize/src/authorize_keys.erl
+++ b/components/authorize/src/authorize_keys.erl
@@ -302,12 +302,12 @@ match_dest_(_, _) ->
false.
get_env(K) ->
- case application:get_env(rvi_core, K) of
- {ok, V} ->
- V;
- _ ->
- undefined
- end.
+ Res = case application:get_env(rvi_core, K) of
+ {ok, V} -> V;
+ _ -> undefined
+ end,
+ lager:debug("get_env(~p) -> ~p", [K, Res]),
+ Res.
get_key_pair_from_pem(openssl, Pem) ->
case file:read_file(Pem) of
diff --git a/components/rvi_common/src/rvi_common.erl b/components/rvi_common/src/rvi_common.erl
index 130bddb..0dee848 100644
--- a/components/rvi_common/src/rvi_common.erl
+++ b/components/rvi_common/src/rvi_common.erl
@@ -449,6 +449,11 @@ get_component_config_(Component, Default, CompList) ->
end.
get_component_specification() ->
+ CS = get_component_specification_(),
+ lager:debug("CompSpec = ~p", [CS]),
+ CS.
+
+get_component_specification_() ->
case application:get_env(rvi_core, components, undefined) of
undefined ->
#component_spec {
@@ -514,7 +519,7 @@ get_component_modules(_, _) ->
get_module_specification(Component, Module, CompSpec) ->
case get_component_modules(Component, CompSpec) of
undefined ->
- ?debug("get_module_specification(): Missing: rvi:component: ~p: ~p",
+ ?debug("get_module_specification(): Missing: rvi_core:component: ~p: ~p",
[Component, CompSpec]),
undefined;
@@ -522,7 +527,7 @@ get_module_specification(Component, Module, CompSpec) ->
case lists:keyfind(Module, 1, Modules ) of
false ->
?debug("get_module_specification(): Missing component spec: "
- "rvi:component:~p:~p:{...}: ~p", [Component, Module, Modules]),
+ "rvi_core:component:~p:~p:{...}: ~p", [Component, Module, Modules]),
{error, {not_found, Module}};
{ Module, Type, ModConf } ->
@@ -545,7 +550,7 @@ get_module_config(Component, Module, Key, CompSpec) ->
case proplists:get_value(Key, ModConf, undefined ) of
undefined ->
?debug("get_module_config(): Missing component spec: "
- "rvi:component:~p:~p:~p{...}: ~p",
+ "rvi_core:component:~p:~p:~p{...}: ~p",
[Component, Module, Key, ModConf]),
{error, {not_found, Component, Module, Key}};
@@ -591,7 +596,7 @@ get_module_json_rpc_address(Component, Module, CompSpec) ->
CompSpec) of
{ok, undefined } ->
?debug("get_module_json_rpc_address(): Missing component spec: "
- "rvi:component:~p:~p:json_rpc_address, {...}", [Component, Module]),
+ "rvi_core:component:~p:~p:json_rpc_address, {...}", [Component, Module]),
{error, {not_found, Component, Module, json_rpc_address}};
{ok, { IP, Port }} ->
diff --git a/components/rvi_common/src/rvi_common_app.erl b/components/rvi_common/src/rvi_common_app.erl
index 0a986a5..998b921 100644
--- a/components/rvi_common/src/rvi_common_app.erl
+++ b/components/rvi_common/src/rvi_common_app.erl
@@ -24,7 +24,7 @@ start(_StartType, _StartArgs) ->
rvi_common_sup:start_link().
start_phase(setup_config, _, _) ->
- rvi_config:setup_substitution(rvi),
+ rvi_config:setup_substitution(rvi_core),
ok.
stop(_State) ->
diff --git a/rvi_backend.config b/rvi_backend.config
index fab77cd..0d8ed46 100644
--- a/rvi_backend.config
+++ b/rvi_backend.config
@@ -32,7 +32,7 @@ IPPort = fun(IP, Port) ->
LogLevel = Env("RVI_LOGLEVEL", notice).
[
- {include_lib, "rvi/priv/config/rvi_common.config"},
+ {include_lib, "rvi_core/priv/config/rvi_common.config"},
{env,
[
diff --git a/src/rvi_core.app.src b/src/rvi_core.app.src
index ee85629..e188134 100644
--- a/src/rvi_core.app.src
+++ b/src/rvi_core.app.src
@@ -1,3 +1,4 @@
+%% -*- erlang -*-
%%
%% Copyright (C) 2014, Jaguar Land Rover
%%
@@ -28,5 +29,13 @@
proto_json,
proto_bert
]},
- {mod, { rvi_app, []}}
+ {mod, { rvi_app, []}},
+ {env,
+ [
+ %% The following settings default to a self-signing node (good for testing)
+ %% Override these values in the setup config.
+ {provisioning_key, "$PRIV_DIR/keys/self_provisioning_key.pem"},
+ {authorize_jwt, "$PRIV_DIR/keys/authorize.jwt"},
+ {cert_dir, "$DATA_DIR/certs"}
+ ]}
]}.