turn-rs: 4.0.1 -> 4.1.2 (#516459)
This commit is contained in:
+15
-10
@@ -23,23 +23,23 @@
|
||||
USER_1_CREDS="foobar"
|
||||
'';
|
||||
settings = {
|
||||
turn = {
|
||||
server = {
|
||||
realm = "localhost";
|
||||
interfaces = [
|
||||
{
|
||||
transport = "udp";
|
||||
bind = "127.0.0.1:3478";
|
||||
listen = "127.0.0.1:3478";
|
||||
external = "127.0.0.1:3478";
|
||||
}
|
||||
{
|
||||
transport = "tcp";
|
||||
bind = "127.0.0.1:3478";
|
||||
listen = "127.0.0.1:3478";
|
||||
external = "127.0.0.1:3478";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
auth.static_credentials.user1 = "$USER_1_CREDS";
|
||||
auth."static-credentials".user1 = "$USER_1_CREDS";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -47,15 +47,20 @@
|
||||
|
||||
testScript = # python
|
||||
''
|
||||
import json
|
||||
|
||||
start_all()
|
||||
server.wait_for_unit('turn-rs.service')
|
||||
server.wait_for_open_port(3000, "127.0.0.1")
|
||||
server.wait_for_open_port(3478, "127.0.0.1")
|
||||
|
||||
info = server.succeed('curl http://localhost:3000/info')
|
||||
jsonInfo = json.loads(info)
|
||||
assert len(jsonInfo['interfaces']) == 2, f'Interfaces doesn\'t contain two entries:\n{json.dumps(jsonInfo, indent=2)}'
|
||||
base = (
|
||||
"${pkgs.coturn}/bin/turnutils_uclient"
|
||||
" -L 127.0.0.1 -e 127.0.0.1 -u user1 -w foobar -X -y -t"
|
||||
)
|
||||
for extra in ["", "-s", "-t", "-t -s"]:
|
||||
out = server.succeed(f"{base} {extra} 127.0.0.1")
|
||||
assert "ERROR" not in out, f"turnutils_uclient errors:\n{out}"
|
||||
assert "Total lost packets 0 (0.000000%)" in out, (
|
||||
f"turnutils_uclient reported packet loss or did not finish:\n{out}"
|
||||
)
|
||||
|
||||
config = server.succeed('cat /run/turn-rs/config.toml')
|
||||
assert 'foobar' in config, f'Secrets are not properly injected:\n{config}'
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
fetchFromGitHub,
|
||||
# Dependencies
|
||||
protobuf,
|
||||
coturn,
|
||||
# Tests
|
||||
versionCheckHook,
|
||||
nix-update-script,
|
||||
@@ -12,16 +13,16 @@
|
||||
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "turn-rs";
|
||||
version = "4.0.1";
|
||||
version = "4.1.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mycrl";
|
||||
repo = "turn-rs";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-CtDlkHHOkU0mwNiyP9PNw/40szBNKeGYvVep9Z/aoDg=";
|
||||
hash = "sha256-YZPKcLePLX+Mdu4J31VNofiX/qCLjcxydc4iVhonhkU=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-x45GDuhxqoB/DZvccdzxBoS/7nnFvHtjkRgfM/LOOE8=";
|
||||
cargoHash = "sha256-vvhj0B/KYdOeddALh38MvAwrg8sIAIlEzTj0yFNEjFk=";
|
||||
|
||||
# By default, no features are enabled
|
||||
# https://github.com/mycrl/turn-rs?tab=readme-ov-file#features-1
|
||||
@@ -31,6 +32,10 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
protobuf
|
||||
];
|
||||
|
||||
# Fix coturn needed
|
||||
nativeCheckInputs = [ coturn ];
|
||||
env.COTURN_UCLIENT_PATH = lib.getExe' coturn "turnutils_uclient";
|
||||
|
||||
nativeInstallCheckInputs = [
|
||||
versionCheckHook
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user