2021-09-29 15:27:01 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonApplication
|
|
|
|
, substituteAll
|
|
|
|
, fetchFromGitHub
|
|
|
|
, isPy3k
|
|
|
|
, colorama
|
|
|
|
, flask
|
|
|
|
, flask-httpauth
|
|
|
|
, flask-socketio
|
|
|
|
, stem
|
|
|
|
, psutil
|
|
|
|
, pyqt5
|
|
|
|
, pycrypto
|
|
|
|
, pynacl
|
|
|
|
, pyside2
|
|
|
|
, pytestCheckHook
|
|
|
|
, qrcode
|
|
|
|
, qt5
|
|
|
|
, requests
|
|
|
|
, unidecode
|
|
|
|
, tor
|
|
|
|
, obfs4
|
2020-04-21 21:57:48 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-09-29 15:27:01 +01:00
|
|
|
version = "2.4";
|
2020-04-21 21:57:48 +01:00
|
|
|
src = fetchFromGitHub {
|
2021-09-29 15:27:01 +01:00
|
|
|
owner = "onionshare";
|
2020-04-21 21:57:48 +01:00
|
|
|
repo = "onionshare";
|
|
|
|
rev = "v${version}";
|
2021-09-29 15:27:01 +01:00
|
|
|
sha256 = "sha256-Lclm7mIkaAkQpWcNILTRJtLA43dpiyHtWAeHS2r3+ZQ=";
|
2020-04-21 21:57:48 +01:00
|
|
|
};
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Securely and anonymously send and receive files";
|
|
|
|
longDescription = ''
|
2021-09-29 15:27:01 +01:00
|
|
|
OnionShare is an open source tool for securely and anonymously sending
|
|
|
|
and receiving files using Tor onion services. It works by starting a web
|
|
|
|
server directly on your computer and making it accessible as an
|
|
|
|
unguessable Tor web address that others can load in Tor Browser to
|
|
|
|
download files from you, or upload files to you. It doesn't require
|
|
|
|
setting up a separate server, using a third party file-sharing service,
|
|
|
|
or even logging into an account.
|
|
|
|
|
|
|
|
Unlike services like email, Google Drive, DropBox, WeTransfer, or nearly
|
|
|
|
any other way people typically send files to each other, when you use
|
|
|
|
OnionShare you don't give any companies access to the files that you're
|
|
|
|
sharing. So long as you share the unguessable web address in a secure way
|
|
|
|
(like pasting it in an encrypted messaging app), no one but you and the
|
|
|
|
person you're sharing with can access the files.
|
2020-04-21 21:57:48 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
homepage = "https://onionshare.org/";
|
|
|
|
|
|
|
|
license = licenses.gpl3Plus;
|
2020-04-22 10:14:38 +01:00
|
|
|
maintainers = with maintainers; [ lourkeur ];
|
2020-04-21 21:57:48 +01:00
|
|
|
};
|
2021-09-29 15:27:01 +01:00
|
|
|
stem' = stem.overrideAttrs (_: rec {
|
|
|
|
version = "1.8.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "onionshare";
|
|
|
|
repo = "stem";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "Dzpvx7CgAr5OtGmfubWAYDLqq5LkGqcwjr3bxpfL/3A=";
|
|
|
|
};
|
|
|
|
});
|
2020-04-21 21:57:48 +01:00
|
|
|
|
2021-09-29 15:27:01 +01:00
|
|
|
in
|
|
|
|
rec {
|
2020-11-14 21:43:49 +00:00
|
|
|
onionshare = buildPythonApplication {
|
2020-12-28 10:19:37 +00:00
|
|
|
pname = "onionshare-cli";
|
2020-11-14 21:43:49 +00:00
|
|
|
inherit version meta;
|
|
|
|
src = "${src}/cli";
|
|
|
|
patches = [
|
|
|
|
# hardcode store paths of dependencies
|
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-paths.patch;
|
|
|
|
inherit tor obfs4;
|
|
|
|
inherit (tor) geoip;
|
|
|
|
})
|
|
|
|
];
|
2020-04-21 21:57:48 +01:00
|
|
|
disable = !isPy3k;
|
|
|
|
propagatedBuildInputs = [
|
2021-06-02 08:51:09 +01:00
|
|
|
colorama
|
2020-04-21 21:57:48 +01:00
|
|
|
flask
|
|
|
|
flask-httpauth
|
2020-11-14 21:43:49 +00:00
|
|
|
flask-socketio
|
2021-09-29 15:27:01 +01:00
|
|
|
stem'
|
2020-11-14 21:43:49 +00:00
|
|
|
psutil
|
2020-04-21 21:57:48 +01:00
|
|
|
pycrypto
|
2021-09-29 15:27:01 +01:00
|
|
|
pynacl
|
2020-04-21 21:57:48 +01:00
|
|
|
requests
|
2020-11-14 21:43:49 +00:00
|
|
|
unidecode
|
2020-04-21 21:57:48 +01:00
|
|
|
];
|
2020-11-14 21:43:49 +00:00
|
|
|
|
2020-04-21 21:57:48 +01:00
|
|
|
buildInputs = [
|
|
|
|
tor
|
|
|
|
obfs4
|
|
|
|
];
|
|
|
|
|
2020-11-14 21:43:49 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# Tests use the home directory
|
|
|
|
export HOME="$(mktemp -d)"
|
|
|
|
'';
|
2021-08-20 23:41:36 +01:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_firefox_like_behavior"
|
|
|
|
"test_if_unmodified_since"
|
2021-09-29 15:27:01 +01:00
|
|
|
"test_get_tor_paths_linux" # expects /usr instead of /nix/store
|
2021-08-20 23:41:36 +01:00
|
|
|
];
|
2020-11-14 21:43:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
onionshare-gui = buildPythonApplication {
|
2020-12-28 10:19:37 +00:00
|
|
|
pname = "onionshare";
|
2020-11-14 21:43:49 +00:00
|
|
|
inherit version meta;
|
|
|
|
src = "${src}/desktop/src";
|
2020-04-21 21:57:48 +01:00
|
|
|
patches = [
|
2020-11-14 21:43:49 +00:00
|
|
|
# hardcode store paths of dependencies
|
2020-04-21 21:57:48 +01:00
|
|
|
(substituteAll {
|
2020-11-14 21:43:49 +00:00
|
|
|
src = ./fix-paths-gui.patch;
|
2020-04-21 21:57:48 +01:00
|
|
|
inherit tor obfs4;
|
|
|
|
inherit (tor) geoip;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-11-14 21:43:49 +00:00
|
|
|
disable = !isPy3k;
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
onionshare
|
|
|
|
pyqt5
|
|
|
|
pyside2
|
|
|
|
psutil
|
|
|
|
qrcode
|
|
|
|
];
|
2020-04-21 21:57:48 +01:00
|
|
|
|
2020-11-14 21:43:49 +00:00
|
|
|
nativeBuildInputs = [ qt5.wrapQtAppsHook ];
|
2020-04-21 21:57:48 +01:00
|
|
|
|
2020-11-14 21:43:49 +00:00
|
|
|
preFixup = ''
|
|
|
|
wrapQtApp $out/bin/onionshare
|
2020-04-21 21:57:48 +01:00
|
|
|
'';
|
|
|
|
|
2020-11-14 21:43:49 +00:00
|
|
|
doCheck = false;
|
2020-04-21 21:57:48 +01:00
|
|
|
|
2020-11-14 21:43:49 +00:00
|
|
|
pythonImportsCheck = [ "onionshare" ];
|
2020-04-21 21:57:48 +01:00
|
|
|
};
|
|
|
|
}
|