1{
2 lib,
3 buildPythonPackage,
4 certifi,
5 cvss,
6 deepl,
7 django,
8 fetchFromGitHub,
9 fetchpatch,
10 gql,
11 pytestCheckHook,
12 pyyaml,
13 requests,
14 rich,
15 setuptools,
16 sqlparse,
17 termcolor,
18 tomli-w,
19 tomli,
20 tomlkit,
21 urllib3,
22 writableTmpDirAsHomeHook,
23 xmltodict,
24}:
25
26buildPythonPackage rec {
27 pname = "reptor";
28 version = "0.32";
29 pyproject = true;
30
31 src = fetchFromGitHub {
32 owner = "Syslifters";
33 repo = "reptor";
34 tag = version;
35 hash = "sha256-nNG4rQHloOqcPZPnvw3hbw0+wCbB2XAdQ5/XnJtCHnE=";
36 };
37
38 patches = [
39 # https://github.com/Syslifters/reptor/pull/221
40 (fetchpatch {
41 url = "https://github.com/Syslifters/reptor/commit/0fc43c246e2f99aaac9e78af818f360a3a951980.patch";
42 hash = "sha256-eakbI7hMJdshD0OA6n7dEO4+qPB21sYl09uZgepiWu0=";
43 })
44 ];
45
46 pythonRelaxDeps = true;
47
48 build-system = [ setuptools ];
49
50 dependencies = [
51 certifi
52 cvss
53 django
54 pyyaml
55 requests
56 rich
57 termcolor
58 tomli
59 tomli-w
60 tomlkit
61 urllib3
62 xmltodict
63 ];
64
65 optional-dependencies = {
66 ghostwriter = [ gql ] ++ gql.optional-dependencies.aiohttp;
67 translate = [ deepl ];
68 };
69
70 nativeCheckInputs = [
71 pytestCheckHook
72 ]
73 ++ lib.flatten (builtins.attrValues optional-dependencies);
74
75 preCheck = ''
76 export PATH="$PATH:$out/bin";
77 '';
78
79 pythonImportsCheck = [ "reptor" ];
80
81 disabledTestMarks = [
82 # Tests need network access
83 "integration"
84 ];
85
86 meta = with lib; {
87 description = "Module to do automated pentest reporting with SysReptor";
88 homepage = "https://github.com/Syslifters/reptor";
89 changelog = "https://github.com/Syslifters/reptor/releases/tag/${src.tag}";
90 license = licenses.mit;
91 maintainers = with maintainers; [ fab ];
92 mainProgram = "reptor";
93 };
94}