folded default user into default host
This commit is contained in:
parent
2bf27f8cf7
commit
d32428bf51
|
@ -213,12 +213,8 @@ insert_default_data() ->
|
||||||
{ok, DefaultPass} = application:get_env(default_pass),
|
{ok, DefaultPass} = application:get_env(default_pass),
|
||||||
{ok, DefaultVHost} = application:get_env(default_vhost),
|
{ok, DefaultVHost} = application:get_env(default_vhost),
|
||||||
ok = rabbit_access_control:add_vhost(DefaultVHost),
|
ok = rabbit_access_control:add_vhost(DefaultVHost),
|
||||||
ok = insert_default_user(DefaultUser, DefaultPass, DefaultVHost),
|
ok = rabbit_access_control:add_user(DefaultUser, DefaultPass),
|
||||||
ok.
|
ok = rabbit_access_control:map_user_vhost(DefaultUser, DefaultVHost),
|
||||||
|
|
||||||
insert_default_user(Username, Password, VHostPath) ->
|
|
||||||
ok = rabbit_access_control:add_user(Username, Password),
|
|
||||||
ok = rabbit_access_control:map_user_vhost(Username, VHostPath),
|
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
start_builtin_amq_applications() ->
|
start_builtin_amq_applications() ->
|
||||||
|
|
|
@ -173,10 +173,8 @@ add_vhost(VHostPath) ->
|
||||||
case mnesia:read({vhost, VHostPath}) of
|
case mnesia:read({vhost, VHostPath}) of
|
||||||
[] ->
|
[] ->
|
||||||
ok = mnesia:write(#vhost{virtual_host = VHostPath}),
|
ok = mnesia:write(#vhost{virtual_host = VHostPath}),
|
||||||
#exchange{} = rabbit_exchange:declare(rabbit_misc:r(VHostPath, exchange, <<"">>), direct, true, false, []),
|
[ rabbit_exchange:declare(rabbit_misc:r(VHostPath, exchange, Name), Type, true, false, []) || {Name,Type}
|
||||||
#exchange{} = rabbit_exchange:declare(rabbit_misc:r(VHostPath, exchange, <<"amq.direct">>), direct, true, false, []),
|
<- [{<<"">>, direct}, { <<"amq.direct">>, direct}, {<<"amq.topic">>, topic}, {<<"amq.fanout">>, fanout}]],
|
||||||
#exchange{} = rabbit_exchange:declare(rabbit_misc:r(VHostPath, exchange, <<"amq.topic">>), topic, true, false, []),
|
|
||||||
#exchange{} = rabbit_exchange:declare(rabbit_misc:r(VHostPath, exchange, <<"amq.fanout">>), fanout, true, false, []),
|
|
||||||
ok;
|
ok;
|
||||||
[_] ->
|
[_] ->
|
||||||
mnesia:abort({vhost_already_exists, VHostPath})
|
mnesia:abort({vhost_already_exists, VHostPath})
|
||||||
|
|
|
@ -66,9 +66,7 @@
|
||||||
-spec(get_config/2 :: (atom(), A) -> A).
|
-spec(get_config/2 :: (atom(), A) -> A).
|
||||||
-spec(set_config/2 :: (atom(), any()) -> 'ok').
|
-spec(set_config/2 :: (atom(), any()) -> 'ok').
|
||||||
-spec(dirty_read/1 :: ({atom(), any()}) -> {'ok', any()} | not_found()).
|
-spec(dirty_read/1 :: ({atom(), any()}) -> {'ok', any()} | not_found()).
|
||||||
-spec(r/3 :: (#resource{virtual_host :: vhost(),
|
-spec(r/3 :: (#resource{virtual_host :: vhost()} | vhost(), K, name()) ->
|
||||||
kind :: K,
|
|
||||||
name :: '_' | vhost(), K, name()) ->
|
|
||||||
r(K) when is_subtype(K, atom())).
|
r(K) when is_subtype(K, atom())).
|
||||||
-spec(r/2 :: (vhost(), K) -> #resource{virtual_host :: vhost(),
|
-spec(r/2 :: (vhost(), K) -> #resource{virtual_host :: vhost(),
|
||||||
kind :: K,
|
kind :: K,
|
||||||
|
|
Loading…
Reference in New Issue