1{
2 lib,
3 asgiref,
4 buildPythonPackage,
5 certifi,
6 charset-normalizer,
7 cvss,
8 deepl,
9 django,
10 fetchFromGitHub,
11 gql,
12 idna,
13 markdown-it-py,
14 mdurl,
15 pygments,
16 pytestCheckHook,
17 pythonOlder,
18 pyyaml,
19 requests,
20 rich,
21 setuptools,
22 sqlparse,
23 termcolor,
24 tomli,
25 tomli-w,
26 tomlkit,
27 urllib3,
28 xmltodict,
29}:
30
31buildPythonPackage rec {
32 pname = "reptor";
33 version = "0.28";
34 pyproject = true;
35
36 disabled = pythonOlder "3.9";
37
38 src = fetchFromGitHub {
39 owner = "Syslifters";
40 repo = "reptor";
41 tag = version;
42 hash = "sha256-hzdgG2/bTkzTUPK/Rnch4q12R5kY+qlr6gRwx54vbcE=";
43 };
44
45 pythonRelaxDeps = true;
46
47 build-system = [ setuptools ];
48
49 dependencies = [
50 asgiref
51 certifi
52 charset-normalizer
53 cvss
54 django
55 idna
56 markdown-it-py
57 mdurl
58 pygments
59 pyyaml
60 requests
61 rich
62 sqlparse
63 termcolor
64 tomli
65 tomlkit
66 tomli-w
67 urllib3
68 xmltodict
69 ];
70
71 optional-dependencies = {
72 ghostwriter = [ gql ] ++ gql.optional-dependencies.aiohttp;
73 translate = [ deepl ];
74 };
75
76 nativeCheckInputs = [
77 pytestCheckHook
78 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
79
80 preCheck = ''
81 export HOME=$(mktemp -d)
82 export PATH="$PATH:$out/bin";
83 '';
84
85 pythonImportsCheck = [ "reptor" ];
86
87 disabledTestPaths = [
88 # Tests want to use pip install dependencies
89 "reptor/plugins/importers/GhostWriter/tests/test_ghostwriter.py"
90 ];
91
92 disabledTests = [
93 # Tests need network access
94 "TestDummy"
95 "TestIntegration"
96 ];
97
98 meta = with lib; {
99 description = "Module to do automated pentest reporting with SysReptor";
100 homepage = "https://github.com/Syslifters/reptor";
101 changelog = "https://github.com/Syslifters/reptor/releases/tag/${src.tag}";
102 license = licenses.mit;
103 maintainers = with maintainers; [ fab ];
104 mainProgram = "reptor";
105 };
106}