2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2024-04-21 15:54:59 +00:00
|
|
|
, setuptools
|
2021-06-28 23:13:55 +00:00
|
|
|
, async-timeout
|
|
|
|
, attrs
|
|
|
|
, buildPythonPackage
|
|
|
|
, cryptography
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pytest-aiohttp
|
|
|
|
, pytestCheckHook
|
2023-04-12 12:48:02 +00:00
|
|
|
, pythonAtLeast
|
2023-03-15 16:39:30 +00:00
|
|
|
, pythonOlder
|
2020-05-03 17:38:23 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "snitun";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.36.2";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NabuCasa";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "snitun";
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-ViNsmTq1iLxNujA71b9JZB5AZ79ZbiqdTyDeBGd4gUA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
async-timeout
|
|
|
|
attrs
|
|
|
|
cryptography
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
pytest-aiohttp
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
disabledTests = [
|
2024-04-21 15:54:59 +00:00
|
|
|
# AssertionError: Expected 'fileno' to not have been called. Called 1 times.
|
2023-08-10 07:59:29 +00:00
|
|
|
"test_client_stop_no_wait"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2020-05-03 17:38:23 +00:00
|
|
|
"test_multiplexer_data_channel_abort_full" # https://github.com/NabuCasa/snitun/issues/61
|
|
|
|
# port binding conflicts
|
|
|
|
"test_snitun_single_runner_timeout"
|
|
|
|
"test_snitun_single_runner_throttling"
|
2021-04-12 18:23:04 +00:00
|
|
|
# ConnectionResetError: [Errno 54] Connection reset by peer
|
|
|
|
"test_peer_listener_timeout"
|
2024-04-21 15:54:59 +00:00
|
|
|
] ++ lib.optionals (pythonAtLeast "3.12") [
|
|
|
|
# blocking
|
|
|
|
"test_flow_client_peer"
|
|
|
|
"test_close_client_peer"
|
|
|
|
"test_init_connector"
|
|
|
|
"test_flow_connector"
|
|
|
|
"test_close_connector_remote"
|
|
|
|
"test_init_connector_whitelist"
|
|
|
|
"test_init_multiplexer_server"
|
|
|
|
"test_init_multiplexer_client"
|
|
|
|
"test_init_multiplexer_server_throttling"
|
|
|
|
"test_init_multiplexer_client_throttling"
|
|
|
|
"test_multiplexer_ping"
|
|
|
|
"test_multiplexer_ping_error"
|
|
|
|
"test_multiplexer_init_channel_full"
|
|
|
|
"test_multiplexer_close_channel_full"
|
|
|
|
"test_init_dual_peer_with_multiplexer"
|
2020-05-03 17:38:23 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
pythonImportsCheck = [ "snitun" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/NabuCasa/snitun/releases/tag/${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/nabucasa/snitun";
|
|
|
|
description = "SNI proxy with TCP multiplexer";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = licenses.gpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ Scriptkiddi ];
|
2021-06-28 23:13:55 +00:00
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|