diff --git a/MANIFEST.in b/MANIFEST.in index 7b61d8b..f17236f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1 @@ -include LICENSE README.md -recursive-include s3recon * -recursive-include data * +include LICENSE README.md s3recon/s3recon.yml data/*.txt diff --git a/s3recon/__init__.py b/s3recon/__init__.py index 6c8e6b9..5becc17 100644 --- a/s3recon/__init__.py +++ b/s3recon/__init__.py @@ -1 +1 @@ -__version__ = "0.0.0" +__version__ = "1.0.0" diff --git a/s3recon/s3recon.py b/s3recon/s3recon.py index a535522..cc0970d 100644 --- a/s3recon/s3recon.py +++ b/s3recon/s3recon.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 - from asyncio import get_event_loop, gather from collections import defaultdict from datetime import datetime from json import dumps +from logging import getLogger, basicConfig, INFO from os import environ from pathlib import Path from random import choice @@ -32,6 +32,11 @@ filterwarnings("ignore", category=InsecureRequestWarning) +logger = getLogger(__name__) + +# TODO: opt to change log-level +basicConfig(format="%(message)s", level=INFO) + def bucket_exists(url, timeout): exists = False @@ -60,7 +65,7 @@ def find_bucket(url, timeout): if exists: access = public_key if public else private_key access_word = public_text if public else private_text - print(f"{access} {access_word} {url}", end="\n") + logger.info(f"{access} {access_word} {url}") return access, url return None @@ -88,7 +93,6 @@ def read_config(): for c in config_hierarchy: try: - print(c) c = load(open(c, "r")) merge(config, c) except IOError: @@ -123,8 +127,8 @@ def main(words, timeout, output): private, public = collect_results(r) stop = datetime.now() - print(f"Complete after: {stop - start}") - print(f"Output written to: {output.name}") + logger.info(f"Complete after: {stop - start}") + logger.info(f"Output written to: {output.name}") output.write( dumps( diff --git a/setup.py b/setup.py index 7c32b3c..f8474c4 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,7 @@ def open_local(paths, mode="r", encoding="utf8"): long_description_content_type="text/markdown", url="https://github.com/clarketm/s3recon", packages=setuptools.find_packages(), + include_package_data=True, install_requires=install_requires, entry_points={"console_scripts": ["s3recon=s3recon.s3recon:cli"]}, classifiers=(