summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/cl/cloudhunter/package.nix
blob: 144194c6f665178edd63e1a089578d8ffad2fedc (plain)
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
{
  lib,
  python3,
  fetchFromGitHub,
}:

python3.pkgs.buildPythonApplication (finalAttrs: {
  pname = "cloudhunter";
  version = "0.7.1";
  pyproject = false;

  src = fetchFromGitHub {
    owner = "belane";
    repo = "CloudHunter";
    tag = "v${finalAttrs.version}";
    hash = "sha256-7iT4vr0kcNXEyJJdBbJsllIcbZRGY3T5t/FjEONkuq0=";
  };

  postPatch = ''
    substituteInPlace cloudhunter.py \
      --replace "'permutations.txt'" "'$out/share/permutations.txt'" \
      --replace "'resolvers.txt'" "'$out/share/resolvers.txt'"
  '';

  propagatedBuildInputs = with python3.pkgs; [
    beautifulsoup4
    dnspython
    requests
    tldextract
    urllib3
    xmltodict
  ];

  installPhase = ''
    runHook preInstall
    install -vD cloudhunter.py $out/bin/cloudhunter
    install -vD  permutations-big.txt permutations.txt resolvers.txt -t $out/share
    install -vd $out/${python3.sitePackages}/
    runHook postInstall
  '';

  # Project has no tests
  doCheck = false;

  meta = {
    description = "Cloud bucket scanner";
    mainProgram = "cloudhunter";
    homepage = "https://github.com/belane/CloudHunter";
    changelog = "https://github.com/belane/CloudHunter/releases/tag/v${finalAttrs.version}";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ fab ];
  };
})