diff options
Diffstat (limited to 'statsserver/src/statsserver_sup.erl')
-rw-r--r-- | statsserver/src/statsserver_sup.erl | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/statsserver/src/statsserver_sup.erl b/statsserver/src/statsserver_sup.erl deleted file mode 100644 index 6b92e35..0000000 --- a/statsserver/src/statsserver_sup.erl +++ /dev/null @@ -1,42 +0,0 @@ -%%% Copyright (c) 2017, NORDUnet A/S. -%%% See LICENSE for licensing information. - --module(statsserver_sup). --behaviour(supervisor). - --export([start_link/1, init/1]). - -start_link(_Args) -> - supervisor:start_link({local, ?MODULE}, ?MODULE, []). - -gen_http_config(Config, SSLOptions, SSLFlag) -> - {ChildName, IpAddress, Port, Module} = Config, - {ok, IPv4Address} = inet:parse_ipv4strict_address(IpAddress), - WebConfig = [{ip, IPv4Address}, - {port, Port}, - {ssl, SSLFlag}, - {acceptor_pool_size, - application:get_env(catlfish, http_server_pool_size, 16)}, - {ssl_opts, SSLOptions} - ], - {ChildName, - {catlfish_web, start, [WebConfig, Module, ChildName]}, - permanent, 5000, worker, dynamic}. - - -init([]) -> - SSLOptions = - [{certfile, application:get_env(plop, https_certfile, none)}, - {keyfile, application:get_env(plop, https_keyfile, none)}, - {cacertfile, application:get_env(plop, https_cacertfile, none)}], - Servers = - lists:map(fun (Config) -> - gen_http_config(Config, SSLOptions, true) - end, application:get_env(plop, https_servers, [])) ++ - lists:map(fun (Config) -> - gen_http_config(Config, SSLOptions, false) - end, application:get_env(plop, http_servers, [])), - lager:debug("Starting servers ~p", [Servers]), - {ok, - {{one_for_one, 3, 10}, - Servers}}. |