about summary refs log tree commit diff
path: root/pkgs/by-name/wi/witnessme/package.nix
blob: de83d1475360af36c1f342cb56fcb589ae3b6b26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{ lib
, fetchFromGitHub
, fetchpatch
, python3
}:

python3.pkgs.buildPythonApplication rec {
  pname = "witnessme";
  version = "0-unstable-2023-12-06";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "byt3bl33d3r";
    repo = "WitnessMe";
    # https://github.com/byt3bl33d3r/WitnessMe/issues/47
    rev = "16d4a377eba653315e827b0af686b948681be301";
    hash = "sha256-CMbeGLwXqpeB31x1j8qU8Bbi3EHEmLokDtqbQER1gEA=";
  };

  patches = [
    # Switch to poetry-core, https://github.com/byt3bl33d3r/WitnessMe/pull/48
    (fetchpatch {
      name = "switch-poetry-core.patch";
      url = "https://github.com/byt3bl33d3r/WitnessMe/commit/147ce9fc7c9ac84712aa1ba2f7073bc2f29c8afe.patch";
      hash = "sha256-ZcIt/ueLgVlZePgxYljRFtvF5t2zlB80HsNyjheCnxI=";
    })
  ];

  pythonRelaxDeps = true;

  build-system = with python3.pkgs; [
    poetry-core
  ];

  dependencies = with python3.pkgs; [
    aiodns
    aiofiles
    aiosqlite
    fastapi
    imgcat
    jinja2
    lxml
    prompt-toolkit
    pydantic
    pyppeteer
    python-multipart
    pyyaml
    terminaltables
    uvicorn
    xmltodict
  ];

  nativeCheckInputs = with python3.pkgs; [
    httpx
    pytest-asyncio
    pytestCheckHook
    setuptools
  ];

  pythonImportsCheck = [
    "witnessme"
  ];

  disabledTestPaths = [
    # Tests require network access
    "tests/test_api.py"
    "tests/test_grab.py"
    "tests/test_scan.py"
    "tests/test_target_parsing.py"
  ];

  meta = with lib; {
    description = "Web Inventory tool";
    homepage = "https://github.com/byt3bl33d3r/WitnessMe";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ fab ];
    mainProgram = "witnessme";
  };
}