aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsando38 <sandomir@tutanota.com>2023-08-04 16:59:49 +0200
committerKevin Daudt <kdaudt@alpinelinux.org>2023-08-06 19:55:29 +0000
commite4569540b9bbb55b6f6741273ac72d2808b15bbb (patch)
tree6c1a326690c0ae83f73dc6f68a3c67fd27e75a35
parentca46e5488cf0faddb3eb3c02c93d3aa3ca91dbbb (diff)
eturnal: update to 1.11.1
-rw-r--r--community/eturnal/0-eturnal.yml.patch (renamed from community/eturnal/eturnal.yml.patch)0
-rw-r--r--community/eturnal/001-fix-tests.patch39
-rw-r--r--community/eturnal/002-fix-tests.patch175
-rw-r--r--community/eturnal/003-fix-prometheus.patch55
-rw-r--r--community/eturnal/004-add-stun-client.patch167
-rw-r--r--community/eturnal/1-eturnalctl.patch36
-rw-r--r--community/eturnal/2-eturnalctl.patch13
-rw-r--r--community/eturnal/APKBUILD30
-rw-r--r--community/eturnal/build.config.patch14
-rw-r--r--community/eturnal/fix-tests.patch39
10 files changed, 28 insertions, 540 deletions
diff --git a/community/eturnal/eturnal.yml.patch b/community/eturnal/0-eturnal.yml.patch
index 3d64f580cbd..3d64f580cbd 100644
--- a/community/eturnal/eturnal.yml.patch
+++ b/community/eturnal/0-eturnal.yml.patch
diff --git a/community/eturnal/001-fix-tests.patch b/community/eturnal/001-fix-tests.patch
deleted file mode 100644
index 4700f28f6e0..00000000000
--- a/community/eturnal/001-fix-tests.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff --git a/doc/overview.edoc b/doc/overview.edoc
-index 769e5fd..21736c5 100644
---- a/doc/overview.edoc
-+++ b/doc/overview.edoc
-@@ -368,7 +368,7 @@ This option defines the shared authentication secret used to derive the
- passwords for ephemeral TURN user names as described in the <a
- href="https://tools.ietf.org/html/draft-uberti-behave-turn-rest-00">REST API for
- Access to TURN Services</a> specification. If this option isn't defined, the
--value of the environment variable {@section ETURNAL_SECRET}) is used instead. If
-+value of the environment variable {@section ETURNAL_SECRET} is used instead. If
- this environment variable is unset as well, a pseudorandom secret (which is
- <em>not</em> cryptographically secure) is used. If a list of secrets is
- specified, credentials derived from any of those will be accepted. This allows
-diff --git a/src/eturnal_ctl.erl b/src/eturnal_ctl.erl
-index 9f2e1ff..2810050 100644
---- a/src/eturnal_ctl.erl
-+++ b/src/eturnal_ctl.erl
-@@ -443,7 +443,7 @@ nl() ->
-
- -spec call(term()) -> ok | {ok | error, term()}.
- call(Request) ->
-- try gen_server:call(eturnal, Request) of
-+ try gen_server:call(eturnal, Request, timer:minutes(1)) of
- ok ->
- ?LOG_DEBUG("eturnal call (~p) returned ok", [Request]),
- ok;
-diff --git a/test/eturnal_SUITE.erl b/test/eturnal_SUITE.erl
-index 8a0cfce..d41e3b5 100644
---- a/test/eturnal_SUITE.erl
-+++ b/test/eturnal_SUITE.erl
-@@ -31,7 +31,7 @@
-
- -spec suite() -> [info()].
- suite() ->
-- [{timetrap, {seconds, 30}}].
-+ [{timetrap, {seconds, 120}}].
-
- -spec init_per_suite(config()) -> config().
- init_per_suite(Config) ->
diff --git a/community/eturnal/002-fix-tests.patch b/community/eturnal/002-fix-tests.patch
deleted file mode 100644
index cb453fb3aa9..00000000000
--- a/community/eturnal/002-fix-tests.patch
+++ /dev/null
@@ -1,175 +0,0 @@
-diff --git a/rebar.config b/rebar.config
-index 676736e..7fedfd3 100644
---- a/rebar.config
-+++ b/rebar.config
-@@ -11,7 +11,6 @@
- [{release, {eturnal, {cmd, "scripts/get-version"}},
- [eturnal,
- sasl,
-- runtime_tools,
- recon,
- % For mod_stats_influx:
- {influx_udp, none},
-@@ -21,9 +20,10 @@
- {prometheus_httpd, none},
- {prometheus, none},
- {accept, none},
-- {inets, none}]},
-+ {inets, none},
-+ {ssl, none}]},
- % We don't use {mode, dev}: https://github.com/erlang/rebar3/issues/2598
-- {dev_mode, true},
-+ {dev_mode, false}, % See: https://github.com/erlang/rebar3/issues/2739
- {debug_info, keep},
- {include_erts, false},
- {include_src, true},
-@@ -120,10 +120,12 @@
- filter => "*.erl",
- ruleset => erl_files,
- rules =>
-- [{elvis_style, no_if_expression, disable},
-+ [{elvis_style, no_import, disable},
-+ {elvis_style, no_if_expression, disable},
- {elvis_style, no_catch_expressions, #{ignore => [{eturnal, log_control_listener}]}},
- {elvis_style, no_spec_with_records, #{ignore => [eturnal_cert]}},
- {elvis_style, atom_naming_convention, #{ignore => [eturnal_cert]}},
-+ {elvis_style, export_used_types, #{ignore => [eturnal_misc]}},
- {elvis_style, macro_names, #{ignore => [eturnal_module]}},
- {elvis_text_style, line_length, #{limit => 80}}]},
- #{dirs => ["."],
-@@ -139,43 +141,19 @@
- [{config, "config/shell.config"}]}.
-
- {profiles,
-+ % Production release:
- [{prod,
- [{relx,
-- [{mode, prod},
-- {overlay,
-- [{template, "scripts/stun", "bin/stun"}]}]}]},
-- % Stripped-down binary release:
-- {stripped,
-- [{relx,
-- [{mode, prod},
-- {overlay,
-- [{template, "scripts/stun", "bin/stun"}]},
-- {exclude_apps,
-- [sasl,
-- runtime_tools,
-- recon,
-- compiler, % Unused 'p1_utils' dependency.
-- quantile_estimator]}]}, % Unused 'prometheus' dependency.
-- {erl_opts,
-- [no_debug_info,
-- deterministic]}]},
-- % Cross compilation:
-- {cross,
-- [{relx,
-- % We don't use {mode, prod}: https://github.com/erlang/rebar3/issues/2598
- [{dev_mode, false},
- {debug_info, strip},
-- {include_erts, "lib/erlang"},
-- {system_libs, "lib/erlang/lib"},
-+ {system_libs, true},
-+ {include_erts, true},
- {include_src, false},
- {overlay,
-- [{template, "scripts/stun", "bin/stun"}]},
-+ [{template, "client/stun", "bin/stun"}]},
- {exclude_apps,
-- [sasl,
-- runtime_tools,
-- recon,
-- compiler, % Unused 'p1_utils' dependency.
-- quantile_estimator]}]}, % Unused 'prometheus' dependency.
-+ [compiler, % Unused 'p1_utils' dependency.
-+ quantile_estimator]}]}, % Unused 'prometheus' dependency.
- {erl_opts,
- [no_debug_info,
- deterministic]}]},
-@@ -221,11 +199,15 @@
- {plugins, [{rebar3_archive_plugin, "0.0.2"}]}]}]}.
-
- {pre_hooks,
-- [{release, "chmod o-rw config/eturnal.yml"},
-+ [{clean, "rm -f client/stun"},
-+ {release, "escript client/build client/stun"},
-+ {release, "chmod o-rw config/eturnal.yml"},
-+ {tar, "escript client/build client/stun"},
- {tar, "chmod o-rw config/eturnal.yml"}]}.
-
- {plugins,
-- [rebar3_lint]}.
-+ [rebar3_appup_plugin,
-+ rebar3_lint]}.
-
- {alias,
- [{check,
-diff --git a/rebar.lock b/rebar.lock
-index 9277535..1a7a403 100644
---- a/rebar.lock
-+++ b/rebar.lock
-@@ -1,47 +1,47 @@
- {"1.2.0",
- [{<<"accept">>,{pkg,<<"accept">>,<<"0.3.5">>},1},
- {<<"conf">>,{pkg,<<"conf">>,<<"0.2.6">>},0},
-- {<<"fast_tls">>,{pkg,<<"fast_tls">>,<<"1.1.15">>},1},
-- {<<"fast_yaml">>,{pkg,<<"fast_yaml">>,<<"1.0.33">>},1},
-+ {<<"fast_tls">>,{pkg,<<"fast_tls">>,<<"1.1.16">>},1},
-+ {<<"fast_yaml">>,{pkg,<<"fast_yaml">>,<<"1.0.36">>},1},
- {<<"influx_udp">>,{pkg,<<"influx_udp">>,<<"1.1.2">>},0},
- {<<"p1_utils">>,{pkg,<<"p1_utils">>,<<"1.0.25">>},1},
- {<<"poolboy">>,{pkg,<<"poolboy">>,<<"1.5.2">>},1},
-- {<<"prometheus">>,{pkg,<<"prometheus">>,<<"4.8.2">>},1},
-+ {<<"prometheus">>,{pkg,<<"prometheus">>,<<"4.10.0">>},1},
- {<<"prometheus_httpd">>,{pkg,<<"prometheus_httpd">>,<<"2.1.11">>},0},
- {<<"quantile_estimator">>,{pkg,<<"quantile_estimator">>,<<"0.2.1">>},2},
-- {<<"recon">>,{pkg,<<"recon">>,<<"2.5.2">>},0},
-- {<<"stun">>,{pkg,<<"stun">>,<<"1.2.5">>},0},
-+ {<<"recon">>,{pkg,<<"recon">>,<<"2.5.3">>},0},
-+ {<<"stun">>,{pkg,<<"stun">>,<<"1.2.7">>},0},
- {<<"ulitos">>,{pkg,<<"ulitos">>,<<"0.4.0">>},1},
- {<<"yval">>,{pkg,<<"yval">>,<<"1.0.10">>},1}]}.
- [
- {pkg_hash,[
- {<<"accept">>, <<"B33B127ABCA7CC948BBE6CAA4C263369ABF1347CFA9D8E699C6D214660F10CD1">>},
- {<<"conf">>, <<"EE45DBA0F258309294AA47973711959ED4FC9428F44EB6CD3DBA9499183D0533">>},
-- {<<"fast_tls">>, <<"398E7BA1076DB139307EBEA839428E2836AB682E4DAC61D95B4705A26AFF06B7">>},
-- {<<"fast_yaml">>, <<"5C735DA21A4D23B7ED592603B1CD7ABA25F91A735D3C0A8DF2816D335A8DEF6E">>},
-+ {<<"fast_tls">>, <<"85FA7F3112EA4FF5CCB4F3ABADC130A8C855AD74EB00869487399CB0C322D208">>},
-+ {<<"fast_yaml">>, <<"65413A34A570FD4E205A460BA602E4EE7A682F35C22D2E1C839025DBF515105C">>},
- {<<"influx_udp">>, <<"105FD7DFF2FCCC2FFD910094401440D24A6A0F7136F54E7E70A52EA52574FE3C">>},
- {<<"p1_utils">>, <<"2D39B5015A567BBD2CC7033EEB93A7C60D8C84EFE1EF69A3473FAA07FA268187">>},
- {<<"poolboy">>, <<"392B007A1693A64540CEAD79830443ABF5762F5D30CF50BC95CB2C1AAAFA006B">>},
-- {<<"prometheus">>, <<"B88F24279DD7A1F512CB090595FF6C88B50AAD0A6B394A4C4983725723DCD834">>},
-+ {<<"prometheus">>, <<"792ADBF0130FF61B5FA8826F013772AF24B6E57B984445C8D602C8A0355704A1">>},
- {<<"prometheus_httpd">>, <<"F616ED9B85B536B195D94104063025A91F904A4CFC20255363F49A197D96C896">>},
- {<<"quantile_estimator">>, <<"EF50A361F11B5F26B5F16D0696E46A9E4661756492C981F7B2229EF42FF1CD15">>},
-- {<<"recon">>, <<"CBA53FA8DB83AD968C9A652E09C3ED7DDCC4DA434F27C3EAA9CA47FFB2B1FF03">>},
-- {<<"stun">>, <<"9EE4B0589D129ABF227859FD6DE6055613446AA8914AF69F60402FFD1C54B353">>},
-+ {<<"recon">>, <<"739107B9050EA683C30E96DE050BC59248FD27EC147696F79A8797FF9FA17153">>},
-+ {<<"stun">>, <<"D6BDCF0AA72C927FBE8B779FC4EF1F3916C5450B2FF136C800A7A0361FB1DDFF">>},
- {<<"ulitos">>, <<"BCDF0528AF4B59F1CB7D710E4B056688751C600833F31F504FEC4BAA88F0F42B">>},
- {<<"yval">>, <<"DE3073183A612C39612EE2970C8B40B465D64A5316D320105E308E011F8646B0">>}]},
- {pkg_hash_ext,[
- {<<"accept">>, <<"11B18C220BCC2EAB63B5470C038EF10EB6783BCB1FCDB11AA4137DEFA5AC1BB8">>},
- {<<"conf">>, <<"C1539AD3420E18A57E92AEA16F5E43A21E3E120F45B937011952634DDCB13287">>},
-- {<<"fast_tls">>, <<"EF516AA226DE9A4605704C18499284CD4FC115A73BD72490341972CE0C2B4D30">>},
-- {<<"fast_yaml">>, <<"EFA60A2ACBCD2C2E72EB5E16F1475726B9D88AFCA3AD6DBB4BC549266863E7C8">>},
-+ {<<"fast_tls">>, <<"AA08CCA89B4044E74F1F12E399817D8BEAEAE3EE006C98A893C0BFB1D81FBA51">>},
-+ {<<"fast_yaml">>, <<"1ABE8F758FC2A86B08EDFF80BBC687CFD41EBC1412CFEC0EF4A0ACFCD032052F">>},
- {<<"influx_udp">>, <<"740DCC6B0F0F376B929A9270E5F4F6EEFD5061635E76C8FCC0508F8B336F1A82">>},
- {<<"p1_utils">>, <<"9219214428F2C6E5D3187FF8EB9A8783695C2427420BE9A259840E07ADA32847">>},
- {<<"poolboy">>, <<"DAD79704CE5440F3D5A3681C8590B9DC25D1A561E8F5A9C995281012860901E3">>},
-- {<<"prometheus">>, <<"C3ABD6521E52CEC4F0D8ECA603CF214DFC84D8A27AA85946639F1424B8554D98">>},
-+ {<<"prometheus">>, <<"2A99BB6DCE85E238C7236FDE6B0064F9834DC420DDBD962AAC4EA2A3C3D59384">>},
- {<<"prometheus_httpd">>, <<"0BBE831452CFDF9588538EB2F570B26F30C348ADAE5E95A7D87F35A5910BCF92">>},
- {<<"quantile_estimator">>, <<"282A8A323CA2A845C9E6F787D166348F776C1D4A41EDE63046D72D422E3DA946">>},
-- {<<"recon">>, <<"2C7523C8DEE91DFF41F6B3D63CBA2BD49EB6D2FE5BF1EEC0DF7F87EB5E230E1C">>},
-- {<<"stun">>, <<"63BB44264EAD2963BEB84BE62352CD9082F02661059BCBAD20AC6710380710E1">>},
-+ {<<"recon">>, <<"6C6683F46FD4A1DFD98404B9F78DCABC7FCD8826613A89DCB984727A8C3099D7">>},
-+ {<<"stun">>, <<"3FB1F07AAA630B2276E83D267557D1CEB3D2CE52D1145DE71864160210655852">>},
- {<<"ulitos">>, <<"AFDCE50A77081EB8D931799A6E015458482EABF9BA8AF367C50CD8660A749B88">>},
- {<<"yval">>, <<"0F7EFF50CB24F5F6CC3549FC54BFE4AF58B3FC4553B0829325BAA199C48BA276">>}]}
- ].
-
diff --git a/community/eturnal/003-fix-prometheus.patch b/community/eturnal/003-fix-prometheus.patch
deleted file mode 100644
index 9535c1bf5da..00000000000
--- a/community/eturnal/003-fix-prometheus.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-diff --git a/src/eturnal_module.erl b/src/eturnal_module.erl
-index 51e6049..c5195e5 100644
---- a/src/eturnal_module.erl
-+++ b/src/eturnal_module.erl
-@@ -81,18 +81,19 @@
- options/1,
- get_opt/2,
- ensure_deps/2]).
---export_type([event/0,
-+-export_type([dep/0,
-+ event/0,
- events/0,
- info/0,
- option/0,
- options/0]).
-
-+-type dep() :: atom().
- -type event() :: atom().
- -type events() :: [event()].
- -type info() :: #{atom() => term()}.
- -type option() :: atom().
- -type options() :: {yval:validators(), [yval:validator_option()]}.
---type dep() :: atom().
-
- -callback start() -> ok | {ok, event() | [event()]}.
- -callback stop() -> ok.
-diff --git a/src/mod_stats_prometheus.erl b/src/mod_stats_prometheus.erl
-index b61343b..aac56d3 100644
---- a/src/mod_stats_prometheus.erl
-+++ b/src/mod_stats_prometheus.erl
-@@ -74,7 +74,7 @@ start() ->
- % startup.
- ?LOG_ERROR("New 'vm_metrics' setting requires restart")
- end,
-- ok = eturnal_module:ensure_deps(?MODULE, [prometheus_httpd]),
-+ ok = eturnal_module:ensure_deps(?MODULE, get_deps()),
- ok = declare_metrics(),
- Addr = eturnal_module:get_opt(?MODULE, ip),
- Port = eturnal_module:get_opt(?MODULE, port),
-@@ -213,6 +213,15 @@ socket_opts() ->
- {socket_type, ip_comm}
- end.
-
-+-spec get_deps() -> [eturnal_module:dep()].
-+get_deps() ->
-+ case eturnal_module:get_opt(?MODULE, tls) of
-+ true ->
-+ [ssl, prometheus_httpd];
-+ false ->
-+ [prometheus_httpd]
-+ end.
-+
- -spec get_pem_files() -> {file:filename(), file:filename()}.
- get_pem_files() ->
- case get_module_or_global_opt(tls_crt_file) of
diff --git a/community/eturnal/004-add-stun-client.patch b/community/eturnal/004-add-stun-client.patch
deleted file mode 100644
index d71b17f6e14..00000000000
--- a/community/eturnal/004-add-stun-client.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-diff --git a/client/build b/client/build
-new file mode 100755
-index 0000000..ab02e3a
---- /dev/null
-+++ b/client/build
-@@ -0,0 +1,63 @@
-+#!/usr/bin/env escript
-+
-+%%% Build escript(s) to be included with an eturnal release.
-+%%%
-+%%% Copyright (c) 2022 Holger Weiss <holger@zedat.fu-berlin.de>.
-+%%% Copyright (c) 2022 ProcessOne, SARL.
-+%%% All rights reserved.
-+%%%
-+%%% Licensed under the Apache License, Version 2.0 (the "License");
-+%%% you may not use this file except in compliance with the License.
-+%%% You may obtain a copy of the License at
-+%%%
-+%%% http://www.apache.org/licenses/LICENSE-2.0
-+%%%
-+%%% Unless required by applicable law or agreed to in writing, software
-+%%% distributed under the License is distributed on an "AS IS" BASIS,
-+%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+%%% See the License for the specific language governing permissions and
-+%%% limitations under the License.
-+
-+-define(SHEBANG, "{{eturnal_prefix}}/erts-{{release_erts_version}}/bin/escript").
-+-define(DEFAULT_LIB_DIR, "_build/default/lib").
-+-define(COMPILE_OPTS, [binary, deterministic | include_opts()]).
-+
-+-spec main([string()]) -> ok.
-+main(Files) ->
-+ ok = maybe_compile_deps(),
-+ ok = lists:foreach(fun(File) -> ok = create_escript(File) end, Files).
-+
-+-spec maybe_compile_deps() -> ok.
-+maybe_compile_deps() ->
-+ case os:getenv("REBAR_DEPS_DIR") of
-+ Dir when is_list(Dir) ->
-+ ok;
-+ false ->
-+ ok = io:put_chars(os:cmd("rebar3 compile"))
-+ end.
-+
-+-spec create_escript(file:filename()) -> ok.
-+create_escript(File) ->
-+ {ok, _Mod, Code} = compile:file(File ++ ".erl", ?COMPILE_OPTS),
-+ ok = escript:create(File, [{shebang, ?SHEBANG}, {beam, Code}]),
-+ ok = file:change_mode(File, 8#00755).
-+
-+-spec include_opts() -> [{i, string()}].
-+include_opts() ->
-+ LibDir = lib_dir(),
-+ CheckoutsDir = filename:join([filename:dirname(LibDir), "checkouts"]),
-+ case filelib:is_dir(CheckoutsDir) of
-+ true ->
-+ [{i, LibDir}, {i, CheckoutsDir}];
-+ false ->
-+ [{i, LibDir}]
-+ end.
-+
-+-spec lib_dir() -> string().
-+lib_dir() ->
-+ case os:getenv("REBAR_DEPS_DIR") of
-+ Dir when is_list(Dir) ->
-+ Dir;
-+ false ->
-+ ?DEFAULT_LIB_DIR
-+ end.
-diff --git a/client/stun.erl b/client/stun.erl
-new file mode 100644
-index 0000000..d5b304e
---- /dev/null
-+++ b/client/stun.erl
-@@ -0,0 +1,92 @@
-+%%% Simple STUN client (UDP-only).
-+%%%
-+%%% Copyright (c) 2022 Holger Weiss <holger@zedat.fu-berlin.de>.
-+%%% Copyright (c) 2022 ProcessOne, SARL.
-+%%% All rights reserved.
-+%%%
-+%%% Licensed under the Apache License, Version 2.0 (the "License");
-+%%% you may not use this file except in compliance with the License.
-+%%% You may obtain a copy of the License at
-+%%%
-+%%% http://www.apache.org/licenses/LICENSE-2.0
-+%%%
-+%%% Unless required by applicable law or agreed to in writing, software
-+%%% distributed under the License is distributed on an "AS IS" BASIS,
-+%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+%%% See the License for the specific language governing permissions and
-+%%% limitations under the License.
-+
-+-module(stun).
-+-export([main/1]).
-+
-+-include_lib("stun/include/stun.hrl").
-+-define(STUN_TIMEOUT, timer:seconds(5)).
-+-define(STUN_PORT, "3478").
-+-define(STUN_FAMILY, inet).
-+
-+-spec main([string()]) -> any().
-+main(["-4", Server, Port]) ->
-+ query(Server, Port, inet);
-+main(["-6", Server, Port]) ->
-+ query(Server, Port, inet6);
-+main(["-4", Server]) ->
-+ query(Server, ?STUN_PORT, inet);
-+main(["-6", Server]) ->
-+ query(Server, ?STUN_PORT, inet6);
-+main([Server, Port]) ->
-+ query(Server, Port, ?STUN_FAMILY);
-+main([Server]) ->
-+ query(Server, ?STUN_PORT, ?STUN_FAMILY);
-+main(_Args) ->
-+ abort("Usage: stun [-4|-6] <server> [<port>]").
-+
-+-spec query(inet:hostname(), string(), inet:family()) -> any().
-+query(Server0, Port0, Family) ->
-+ try
-+ {ok, Server} = inet:getaddr(Server0, Family),
-+ Port = list_to_integer(Port0),
-+ TrID = rand:uniform(1 bsl 96),
-+ Msg = #stun{method = ?STUN_METHOD_BINDING,
-+ class = request,
-+ trid = TrID},
-+ {ok, Sock} = gen_udp:open(0, [Family, binary, {active, false}]),
-+ PktOut = stun_codec:encode(Msg),
-+ ok = gen_udp:send(Sock, Server, Port, PktOut),
-+ {ok, {_, _, PktIn}} = gen_udp:recv(Sock, 0, ?STUN_TIMEOUT),
-+ ok = gen_udp:close(Sock),
-+ case stun_codec:decode(PktIn, datagram) of
-+ {ok, #stun{trid = TrID, 'XOR-MAPPED-ADDRESS' = {Addr, _}}} ->
-+ print_addr(Addr);
-+ {ok, #stun{trid = TrID, 'MAPPED-ADDRESS' = {Addr, _}}} ->
-+ print_addr(Addr);
-+ _ ->
-+ exit({error, bad_response})
-+ end
-+ catch _:Err ->
-+ abort("Cannot query ~s:~s: ~s", [Server0, Port0, format_error(Err)])
-+ end.
-+
-+-spec print_addr(inet:ip_address()) -> ok.
-+print_addr(Addr) ->
-+ ok = io:put_chars(inet:ntoa(Addr)),
-+ ok = io:nl().
-+
-+-spec format_error(any()) -> string().
-+format_error({error, bad_response}) ->
-+ "invalid STUN response";
-+format_error({_, {error, timeout}}) ->
-+ "request timed out";
-+format_error({_, {error, Reason}}) ->
-+ inet:format_error(Reason);
-+format_error(Err) ->
-+ unicode:characters_to_list(io_lib:format("~p", [Err])).
-+
-+-spec abort(iolist() | binary() | atom()) -> no_return().
-+abort(Msg) ->
-+ abort("~s", [Msg]).
-+
-+-spec abort(io:format(), [term()]) -> no_return().
-+abort(Format, Data) ->
-+ ok = io:format(standard_error, Format, Data),
-+ ok = io:nl(standard_error),
-+ halt(1).
diff --git a/community/eturnal/1-eturnalctl.patch b/community/eturnal/1-eturnalctl.patch
index 5b81d0f52d5..619b00d39bb 100644
--- a/community/eturnal/1-eturnalctl.patch
+++ b/community/eturnal/1-eturnalctl.patch
@@ -1,11 +1,11 @@
-diff --git a/scripts/eturnalctl b/scripts/eturnalctl
-index e249c48..77cb16b 100755
---- a/scripts/eturnalctl
-+++ b/scripts/eturnalctl
-@@ -31,6 +31,15 @@ config_file="${ETURNAL_ETC_PREFIX-}/etc/eturnalctl.cfg"
-
+diff --git a/overlay/eturnalctl b/overlay/eturnalctl
+index 01fcac3..9895efe 100755
+--- a/overlay/eturnalctl
++++ b/overlay/eturnalctl
+@@ -32,6 +32,15 @@ config_file="${etc_dir:-/etc}/eturnalctl.cfg"
+
# END OF CONFIGURATION SECTION.
-
+
+if [ -z "${LOGS_DIRECTORY+x}" ]
+then
+ export LOGS_DIRECTORY='/var/log/eturnal'
@@ -18,14 +18,14 @@ index e249c48..77cb16b 100755
unsupported='credentials
upgrade
downgrade
-@@ -149,6 +158,10 @@ else
- if [ "$(id -u)" = '0' ]
- then
- cd '/'
-+ if ! [ -d "$RUNTIME_DIRECTORY" ]
-+ then
-+ install -d -m 755 -o "$user" -g "$user" "$RUNTIME_DIRECTORY"
-+ fi
- arg="$(printf '%s' "$*" | sed 's/[^[:alnum:][:space:]]/\\&/g')"
- exec su "$user" -c "$cmd $arg"
- else
+@@ -154,6 +163,10 @@ then
+ elif [ "$(id -u)" = '0' ]
+ then
+ cd '/'
++ if ! [ -d "$RUNTIME_DIRECTORY" ]
++ then
++ install -d -m 755 -o "$user" -g "$user" "$RUNTIME_DIRECTORY"
++ fi
+ arg="$(printf '%s' "$*" | sed 's/[^[:alnum:][:space:]]/\\&/g')"
+ case $(uname -s) in
+ Linux|OpenBSD)
diff --git a/community/eturnal/2-eturnalctl.patch b/community/eturnal/2-eturnalctl.patch
deleted file mode 100644
index 361de0d1836..00000000000
--- a/community/eturnal/2-eturnalctl.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/scripts/eturnalctl b/scripts/eturnalctl
-index 77cb16b..064ab96 100755
---- a/scripts/eturnalctl
-+++ b/scripts/eturnalctl
-@@ -163,7 +163,7 @@ else
- install -d -m 755 -o "$user" -g "$user" "$RUNTIME_DIRECTORY"
- fi
- arg="$(printf '%s' "$*" | sed 's/[^[:alnum:][:space:]]/\\&/g')"
-- exec su "$user" -c "$cmd $arg"
-+ exec su -s '/bin/sh' "$user" -c "$cmd $arg"
- else
- exec "$cmd" "$@"
- fi
diff --git a/community/eturnal/APKBUILD b/community/eturnal/APKBUILD
index f1e533c4ed5..ac3b9f73a36 100644
--- a/community/eturnal/APKBUILD
+++ b/community/eturnal/APKBUILD
@@ -2,8 +2,8 @@
# Contributor: Saarko Sandomir <sandomir@tutanota.com>
# Contributor: Holger Weiss <holger@zedat.fu-berlin.de>
pkgname=eturnal
-pkgver=1.10.1
-pkgrel=3
+pkgver=1.11.1
+pkgrel=0
pkgdesc="STUN/TURN server"
url="https://eturnal.net"
arch="all"
@@ -40,7 +40,7 @@ _prometheus=4.10.0
_prometheus_httpd=2.1.11
_quantile_estimator=0.2.1
_recon=2.5.3
-_stun=1.2.7
+_stun=1.2.8
_ulitos=0.4.0
_yval=1.0.10
_profile="prod"
@@ -64,14 +64,8 @@ source="
https://repo.hex.pm/tarballs/stun-$_stun.tar
https://repo.hex.pm/tarballs/ulitos-$_ulitos.tar
https://repo.hex.pm/tarballs/yval-$_yval.tar
- 001-fix-tests.patch
- 002-fix-tests.patch
- 003-fix-prometheus.patch
- 004-add-stun-client.patch
- build.config.patch
- eturnal.yml.patch
+ 0-eturnal.yml.patch
1-eturnalctl.patch
- 2-eturnalctl.patch
eturnal.logrotate
eturnal.initd
eturnal.confd
@@ -96,6 +90,8 @@ prepare() {
}
build() {
+ export ETURNAL_PREFIX="/usr/lib/eturnal"
+ export ERL_EPMD_ADDRESS=""
./rebar3 as $_profile release
}
@@ -142,7 +138,7 @@ package() {
}
sha512sums="
-92d271319393249a45f4ee7c64b3ffedda9378d446dcefa9e3836e6f5ddb39c441c47c062087868b3c6d1d9653512eec76e93d39bc0683673cdf9f244d57a759 eturnal-1.10.1.tar.gz
+77f746cd5cbcb0c7456dce02018f1748e93cfca9d261f3f4561d84581235355ea2f799f25bf92c7795973d401d883bb12fd71860025b9008ebbbbb3878f5312d eturnal-1.11.1.tar.gz
97e42f8f903a87adca02676765cff20eb15ae4807ce63768e9942a379347cc0b574d926e540f60a4c5ff7359e5e850a3d31c03dd69b786dfc5b97200e669462a accept-0.3.5.tar
25628322f77b2d5f359d4197a4da8578159f26d960fc73781839b91da3206591e2613d34fb91dc0443c32c2135ba9f56ed82b85fc613170f97a78efe931eb90e conf-0.2.6.tar
d01605ebfa6ebce548cd619d8e67cd057b97bfb9ef8d90ab7f889613c0bb84986a171a7aee1dee1abd73b58bc64622a8dee31bf10ac1c2ffc67aaddc80173e4a fast_tls-1.1.16.tar
@@ -154,17 +150,11 @@ ad47d77d1532404fd4e43370be021865a971277c507fc4fd21bd58309511244429c26eb1dbaec3e3
1c847b1e7496ab95bce8320b5b43ee83c3d4f622d321e1c66fb2e554ad9430ab422270ac73b6853ce9f7dc52517bdf51093de6c99551ccc2e8593e5a42ca4d33 prometheus_httpd-2.1.11.tar
c7845a715d6ee8b4d67f751690c5def7a35bfed7cfe8c147b12dcf4e3a9048e35254a38e7f51b3059c54d4b780498b8e8ef2cec9195e5d0f431006d04a721518 quantile_estimator-0.2.1.tar
dc171edc4f4b4589e0c10b01f682d65cde5bdd39e6095a716a7fed49e575cbe33478437cacf5b48d13801a344a303ea5a402a272233c81ff8250530f5a6a8816 recon-2.5.3.tar
-f4120ec3f91dacd398aa53ea52f4149340929a994915c47fa7c34f49bad8f5bf7809af91d0b11643d2bd3aeb69e32b50452bc13e7251f2ddb8765ed9d167a22d stun-1.2.7.tar
+48e1f92e173e8b2fa23492eef4a544ea97a726e912aa3b4a6b6cad6b418fede8a9b2216c932164b1aef6361f425d4a1f047ac7af4b686235ba34680bba3f06a5 stun-1.2.8.tar
06f28e7ef6e6505d6adc2240c847ef53f908ab83fd100f022ef8c364aa31c579fe4567994c1bf6f1151c1d25e4738600e74edcce4d8447eebe1f527252a609ca ulitos-0.4.0.tar
25f815c751ce0dd1d045cdae92d8c5697ac07b88eae1a47b9381e2efc1eabc2c02e4d0a5347fa9ddf8de0f3df9aba04ccc35d54fae4829af655ee6e1183bde7a yval-1.0.10.tar
-28e0e811b96fea1fa367e9387cdc874ba42f5994ac197560b7cadca78e165a43cb3d90847e3a752d47d46ca88711fb21a6ca0a35c64bc4a87e51cd462dbd05d2 001-fix-tests.patch
-89ea5cb834033a410b06db5bf9a48da55f2714c3e80eb916df757469506ae00e047e3e35c618f54e7e397f9d60bad62984c2cdc21f83878f3dc6dbb4d3aa3139 002-fix-tests.patch
-8859e2eb03816ee09d10e88b42c7314b56d2176629d296d52b4d8ff915cc5dfbd173e31056c7ccc69df6397c5196c63421bfcedd028043c24b76ea342778557a 003-fix-prometheus.patch
-b604dbcbe49eba1afb6e5fad9d998444067c37d6bf34254a111ce2596d182634fd033cac948ff89558ec7a23d369a3adb4036318f25f9abe88b291f50dd7002d 004-add-stun-client.patch
-96a49a1e7dbf55939958c432b0235f8fcfb1319482cb71165dd885862654f2eda3bc34ca560bbdd6365131c0e82a7998f2bc3480f0643e021b6ee347cd1cbd50 build.config.patch
-e9658ac03f6205312ef216c4b08702639adf8a6f1837c2bfc9fbbd1e9b81998062d88ff1fc3ee586e1378c4e9964123956e87ff5ac4373448920351a53270e96 eturnal.yml.patch
-64bf9a14d2ba9d78f0d631a53b2bb461c852b827d0c9ff441aecca2c3f45e1b4c6b19eb498befdce976e232999b76c109e0918c00feafc4fb023699675d3f559 1-eturnalctl.patch
-54b5174e5c3f1cff3761df9d0834ed8d33f2f28417703c05e3302df916b3209d323b768a02d6a6058d0ab25884136ea5d434bdc59c60dfee24e5d8f11f403089 2-eturnalctl.patch
+e9658ac03f6205312ef216c4b08702639adf8a6f1837c2bfc9fbbd1e9b81998062d88ff1fc3ee586e1378c4e9964123956e87ff5ac4373448920351a53270e96 0-eturnal.yml.patch
+cdf20cad2b07acf50a31aafe4ab2cd3b1a1ca2e4feb226296a040466fa801ab5073025c6c16b87651b44bb7ebbba56f4ed020828b4ab5b82bafe75fe4709f403 1-eturnalctl.patch
ac7be5b7bb7be2d51b52b3dadd5976f45e0980b43ac43451043756543cbcf954f54eacc66ada7e5c2f9cf9630755d75065f4eb194ee1f7ad6a2199dcec322f04 eturnal.logrotate
b0dd673fa2165c2d238e1edb18bdeabbed69140bd3d16b50d8bda54131671c482279902c5f7c545c887136a9d26dbb216968e8896f55f08343a2a6d5575578c0 eturnal.initd
29338c6cf5c79c5c4b0cc739f479f42a8af7c654ce4f5f945f973026256666cc152cf049e6caf7ae2e3f9fb456851fa6e29bb2b39fbf33d2cae094e3a05289a5 eturnal.confd
diff --git a/community/eturnal/build.config.patch b/community/eturnal/build.config.patch
deleted file mode 100644
index ffec9c60b5c..00000000000
--- a/community/eturnal/build.config.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/build.config b/build.config
-index 657d89b..ed8957c 100644
---- a/build.config
-+++ b/build.config
-@@ -1,7 +1,7 @@
- %%% eturnal build configuration.
-
- {eturnal_user, "eturnal"}. % The user running eturnal.
--{eturnal_prefix, "/opt/eturnal"}. % The installation directory.
--{erl_epmd_address, "127.0.0.1"}. % See <https://erlang.org/doc/man/epmd.html>.
-+{eturnal_prefix, "/usr/lib/eturnal"}. % The installation directory.
-+{erl_epmd_address, ""}. % See <https://erlang.org/doc/man/epmd.html>.
- {erl_dist_port, ""}. % Specify a port number to avoid spawning EPMD.
- {code_loading, "static"}. % Specify "dynamic" to avoid hard-coded dep versions.
diff --git a/community/eturnal/fix-tests.patch b/community/eturnal/fix-tests.patch
deleted file mode 100644
index 4700f28f6e0..00000000000
--- a/community/eturnal/fix-tests.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff --git a/doc/overview.edoc b/doc/overview.edoc
-index 769e5fd..21736c5 100644
---- a/doc/overview.edoc
-+++ b/doc/overview.edoc
-@@ -368,7 +368,7 @@ This option defines the shared authentication secret used to derive the
- passwords for ephemeral TURN user names as described in the <a
- href="https://tools.ietf.org/html/draft-uberti-behave-turn-rest-00">REST API for
- Access to TURN Services</a> specification. If this option isn't defined, the
--value of the environment variable {@section ETURNAL_SECRET}) is used instead. If
-+value of the environment variable {@section ETURNAL_SECRET} is used instead. If
- this environment variable is unset as well, a pseudorandom secret (which is
- <em>not</em> cryptographically secure) is used. If a list of secrets is
- specified, credentials derived from any of those will be accepted. This allows
-diff --git a/src/eturnal_ctl.erl b/src/eturnal_ctl.erl
-index 9f2e1ff..2810050 100644
---- a/src/eturnal_ctl.erl
-+++ b/src/eturnal_ctl.erl
-@@ -443,7 +443,7 @@ nl() ->
-
- -spec call(term()) -> ok | {ok | error, term()}.
- call(Request) ->
-- try gen_server:call(eturnal, Request) of
-+ try gen_server:call(eturnal, Request, timer:minutes(1)) of
- ok ->
- ?LOG_DEBUG("eturnal call (~p) returned ok", [Request]),
- ok;
-diff --git a/test/eturnal_SUITE.erl b/test/eturnal_SUITE.erl
-index 8a0cfce..d41e3b5 100644
---- a/test/eturnal_SUITE.erl
-+++ b/test/eturnal_SUITE.erl
-@@ -31,7 +31,7 @@
-
- -spec suite() -> [info()].
- suite() ->
-- [{timetrap, {seconds, 30}}].
-+ [{timetrap, {seconds, 120}}].
-
- -spec init_per_suite(config()) -> config().
- init_per_suite(Config) ->