diff --git a/apps/epp_proxy/src/epp_proxy_sup.erl b/apps/epp_proxy/src/epp_proxy_sup.erl index d01cd0d..a8c7bfe 100644 --- a/apps/epp_proxy/src/epp_proxy_sup.erl +++ b/apps/epp_proxy/src/epp_proxy_sup.erl @@ -14,6 +14,7 @@ -export([init/1]). -define(SERVER, ?MODULE). +-define(DevMode, application:get_env(epp_proxy, dev_mode)). -define(TCPPort, case application:get_env(epp_proxy, tcp_port) of undefined -> undefined; @@ -56,7 +57,11 @@ init([]) -> type => supervisor, modules => [epp_pool_supervisor], start => {epp_pool_supervisor, start_link, []}}, - {ok, {SupFlags, [TCPAcceptor, TLSAcceptor, PoolSupervisor]}}. + ChildrenSpec = case ?DevMode of + {ok, true} -> [TCPAcceptor, TLSAcceptor, PoolSupervisor]; + _ -> [TLSAcceptor, PoolSupervisor] + end, + {ok, {SupFlags, ChildrenSpec}}. %%==================================================================== %% Internal functions diff --git a/config/sys.config b/config/sys.config index 6a65ff1..6d5dfa1 100644 --- a/config/sys.config +++ b/config/sys.config @@ -1,5 +1,6 @@ [ - {epp_proxy, [{tcp_port, 1700}, + {epp_proxy, [{dev_mode, false}, + {tcp_port, 1700}, {tls_port, 700}, {epp_session_url, "https://registry.test/epp/session/"}, {epp_command_url, "https://registry.test/epp/command/"}, diff --git a/config/test.config b/config/test.config index 7274b21..5492d79 100644 --- a/config/test.config +++ b/config/test.config @@ -1,5 +1,6 @@ [ - {epp_proxy, [{tcp_port, 3333}, + {epp_proxy, [{dev_mode, false}, + {tcp_port, 3333}, {tls_port, 4444}, {epp_session_url, "https://registry.test/epp/session/"}, {epp_command_url, "https://registry.test/epp/command/"},