Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3Packages.dirsearch: init at 0.4.3 #350550

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions pkgs/development/python-modules/dirsearch/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
lib,
fetchFromGitHub,
buildPythonPackage,
python,
# deps
/*
ntlm-auth is in the requirements.txt, however nixpkgs tells me
> ntlm-auth has been removed, because it relies on the md4 implementation provided by openssl. Use pyspnego instead.
Not sure if pyspnego is a drop in replacement.
The simple functionality dirsearch seems not to depend on this package.
*/
#ntlm-auth,
#pyspnego,
beautifulsoup4,
certifi,
cffi,
chardet,
charset-normalizer,
colorama,
cryptography,
defusedxml,
idna,
jinja2,
markupsafe,
pyopenssl,
pyparsing,
pysocks,
requests,
requests-ntlm,
setuptools,
urllib3,
}:

buildPythonPackage rec {
pname = "dirsearch";
version = "0.4.3";

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please set pyproject = true and build-system = [ setuptools ] to avoid legacy build.

pyproject: Whether the pyproject format should be used. As all other formats are deprecated, you are recommended to set this to true. When you do so, pypaBuildHook will be used, and you can add the required build dependencies from build-system.requires to build-system. Note that the pyproject format falls back to using setuptools, so you can use pyproject = true even if the package only has a setup.py. When set to false, you can use the existing hooks or provide your own logic to build the package. This can be useful for packages that don't support the pyproject format. When unset, the legacy setuptools hooks are used for backwards compatibility.

https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/python.section.md#buildpythonpackage-parameters-buildpythonpackage-parameters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in #365128

src = fetchFromGitHub {
owner = "maurosoria";
repo = "dirsearch";
rev = "v${version}";
hash = "sha256-eXB103qUB3m7V/9hlq2xv3Y3bIz89/pGJsbPZQ+AZXs=";
};

# setup.py does some weird stuff with mktemp
postPatch = ''
substituteInPlace setup.py \
--replace-fail 'os.chdir(env_dir)' "" \
--replace-fail 'shutil.copytree(os.path.abspath(os.getcwd()), os.path.join(env_dir, "dirsearch"))' ""
'';

dependencies = [
# maybe needed, see above
#pyspnego
#ntlm-auth
beautifulsoup4
certifi
cffi
chardet
charset-normalizer
colorama
cryptography
defusedxml
idna
jinja2
markupsafe
pyopenssl
pyparsing
pysocks
requests
requests-ntlm
setuptools
quantenzitrone marked this conversation as resolved.
Show resolved Hide resolved
urllib3
];

# the library files get installed in the wrong location
# and dirsearch.py, __init__.py and db/ are missing
postInstall = ''
dirsearchpath=$out/lib/python${lib.versions.majorMinor python.version}/site-packages/
mkdir -p $dirsearchpath/dirsearch
mv $dirsearchpath/{lib,dirsearch}
cp $src/{dirsearch,__init__}.py $dirsearchpath/dirsearch
cp -r $src/db $dirsearchpath/dirsearch
'';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meta = {
changelog = "https://github.com/maurosoria/dirsearch/releases/tag/${version}";
description = "command-line tool for brute-forcing directories and files in webservers, AKA a web path scanner";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "command-line tool for brute-forcing directories and files in webservers, AKA a web path scanner";
description = "Command-line tool for brute-forcing directories and files in webservers, AKA a web path scanner";

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in #365128

homepage = "https://github.com/maurosoria/dirsearch";
license = lib.licenses.gpl2Only;
mainProgram = "dirsearch";
maintainers = with lib.maintainers; [ quantenzitrone ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3194,6 +3194,8 @@ self: super: with self; {

dirigera = callPackage ../development/python-modules/dirigera { };

dirsearch = callPackage ../development/python-modules/dirsearch { };

dirty-equals = callPackage ../development/python-modules/dirty-equals { };

dirtyjson = callPackage ../development/python-modules/dirtyjson { };
Expand Down
Loading