migrate to flit-core

This commit is contained in:
Branch Vincent
2026-01-27 20:44:51 -08:00
parent a1968f718d
commit d2cae0bea4
10 changed files with 17 additions and 114 deletions
+1 -1
View File
@@ -22,4 +22,4 @@ USER theharvester
EXPOSE 80
# Run the application as theharvester user
ENTRYPOINT ["python", "restfulHarvest.py", "-H", "0.0.0.0", "-p", "80"]
ENTRYPOINT ["restfulHarvest", "-H", "0.0.0.0", "-p", "80"]
+3 -41
View File
@@ -1,43 +1,5 @@
#!/usr/bin/env python3
import argparse
from theHarvester.restfulHarvest import main
import uvicorn
parser = argparse.ArgumentParser()
parser.add_argument(
"-H",
"--host",
default="127.0.0.1",
help="IP address to listen on default is 127.0.0.1",
)
parser.add_argument(
"-p",
"--port",
default=5000,
help="Port to bind the web server to, default is 5000",
type=int,
)
parser.add_argument(
"-l",
"--log-level",
default="info",
help="Set logging level, default is info but [critical|error|warning|info|debug|trace] can be set",
)
parser.add_argument(
"-r",
"--reload",
default=False,
help="Enable automatic reload used during development of the api",
action="store_true",
)
args = parser.parse_args()
if __name__ == "__main__":
uvicorn.run(
"theHarvester.lib.api.api:app",
host=args.host,
port=args.port,
log_level=args.log_level,
reload=args.reload,
)
if __name__ == '__main__':
main()
+5 -31
View File
@@ -1,38 +1,12 @@
#!/usr/bin/env python3
# Note: This script runs theHarvester
import asyncio
import sys
from theHarvester import __main__
from theHarvester.theHarvester import main
if sys.version_info.major < 3 or sys.version_info.minor < 11:
print(
"[!] Make sure you have Python 3.11+ installed, quitting.\n\n"
)
if sys.version_info.major < 3 or sys.version_info.minor < 10:
print('[!] Make sure you have Python 3.10+ installed, quitting.\n\n')
sys.exit(1)
if __name__ == "__main__":
platform = sys.platform
if platform == "win32":
# Required or things will break if trying to take screenshots
import multiprocessing
multiprocessing.freeze_support()
try:
# See if we have winloop as a performance enhancement on windows
import winloop
asyncio.DefaultEventLoopPolicy = winloop.EventLoopPolicy
except ModuleNotFoundError:
asyncio.DefaultEventLoopPolicy = asyncio.WindowsSelectorEventLoopPolicy
else:
import uvloop
uvloop.install()
if "linux" in platform:
import aiomultiprocess
# As we are not using Windows, we can change the spawn method to fork for greater performance
aiomultiprocess.set_context("fork")
asyncio.run(__main__.entry_point())
if __name__ == '__main__':
main()
+4 -16
View File
@@ -2,6 +2,7 @@
name = "theHarvester"
description = "theHarvester is a very simple, yet effective tool designed to be used in the early stages of a penetration test"
readme = "README.md"
license = "GPL-2.0-only"
authors = [
{ name = "Christian Martorella", email = "cmartorella@edge-security.com" },
{ name = "Jay Townsend", email = "jay@cybermon.uk" },
@@ -14,7 +15,6 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Operating System :: OS Independent",
]
dynamic = ["version"]
@@ -65,28 +65,16 @@ dev = [
theHarvester = "theHarvester.theHarvester:main"
restfulHarvest = "theHarvester.restfulHarvest:main"
[tool.setuptools.dynamic]
version = { attr = "theHarvester.lib.version.VERSION" }
[tool.setuptools.packages.find]
include = ["theHarvester*"]
[tool.setuptools.package-data]
"*" = ["*.txt", "*.yaml"]
[tool.pytest.ini_options]
minversion = "8.3.3"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
addopts = "--no-header"
testpaths = [
"tests",
"tests/discovery/",
]
testpaths = ["tests"]
[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"
requires = ["flit_core >=3.11,<4"]
build-backend = "flit_core.buildapi"
[tool.mypy]
python_version = "3.13"
-5
View File
@@ -1,5 +0,0 @@
#!/usr/bin/env python3
from theHarvester.restfulHarvest import main
if __name__ == '__main__':
main()
-12
View File
@@ -1,12 +0,0 @@
#!/usr/bin/env python3
# Note: This script runs theHarvester
import sys
from theHarvester.theHarvester import main
if sys.version_info.major < 3 or sys.version_info.minor < 10:
print('[!] Make sure you have Python 3.10+ installed, quitting.\n\n')
sys.exit(1)
if __name__ == '__main__':
main()
+1
View File
@@ -0,0 +1 @@
__version__ = '4.10.0'
+1 -1
View File
@@ -5,9 +5,9 @@ from censys.common.exceptions import (
)
from censys.search import CensysCerts
from theHarvester import __version__ as thehavester_version
from theHarvester.discovery.constants import MissingKey
from theHarvester.lib.core import Core
from theHarvester.lib.version import version as thehavester_version
class SearchCensys:
+2 -2
View File
@@ -15,7 +15,7 @@ import ujson as json_loader
import yaml
from aiohttp_socks import ProxyConnector
from .version import version
from theHarvester import __version__
if TYPE_CHECKING:
from collections.abc import Sized
@@ -203,7 +203,7 @@ class Core:
print(r'* | |_| | | | __/ / __ / (_| | | \ V / __/\__ \ || __/ | *')
print(r'* \__|_| |_|\___| \/ /_/ \__,_|_| \_/ \___||___/\__\___|_| *')
print('* *')
print('* theHarvester {version}{filler}*'.format(version=version(), filler=' ' * (51 - len(version()))))
print('* theHarvester {version}{filler}*'.format(version=__version__, filler=' ' * (51 - len(__version__))))
print('* Coded by Christian Martorella *')
print('* Edge-Security Research *')
print('* cmartorella@edge-security.com *')
-5
View File
@@ -1,5 +0,0 @@
VERSION = '4.10.0'
def version() -> str:
return VERSION