diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 953dcfa..c65f5b1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/python { - "name": "DNSChef", + "name": "DNSChef-NG", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile "image": "mcr.microsoft.com/devcontainers/python:1-3.11", "features": { diff --git a/.github/workflows/python-publish-test.yml b/.github/workflows/python-publish-test.yml new file mode 100644 index 0000000..6546ddb --- /dev/null +++ b/.github/workflows/python-publish-test.yml @@ -0,0 +1,38 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Package to PyPi Testing + +on: + workflow_dispatch: + #release: + # types: [published] + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pipx + pipx install poetry + - name: Build and publish package + run: | + poetry config repositories.testpypi https://test.pypi.org/legacy/ + poetry publish -r testpypi --build \ No newline at end of file diff --git a/Makefile b/Makefile index 7d0f1ef..2794f0c 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ clean: find . -name '.pytest_cache' -exec rm -rf {} + tests: - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + ruff --select=E9,F63,F7,F82 --show-source . python -m pytest requirements: diff --git a/dnschef/__init__.py b/dnschef/__init__.py index cb1dd17..87a346d 100644 --- a/dnschef/__init__.py +++ b/dnschef/__init__.py @@ -1,3 +1,3 @@ import importlib.metadata -__version__ = importlib.metadata.version("dnschef") +__version__ = importlib.metadata.version("dnschef-ng") diff --git a/pyproject.toml b/pyproject.toml index b7a10ec..d5128d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,11 @@ [tool.poetry] -name = "dnschef" +name = "dnschef-ng" version = "0.7.0" description = "A highly configurable DNS proxy for Penetration Testers and Malware Analysts" authors = ["iphelix ","byt3bl33d3r "] readme = "README.md" license = "BSD-3-Clause" +packages = [{include = "dnschef"}] classifiers = [ "Environment :: Console", "Programming Language :: Python :: 3", diff --git a/tests/conftest.py b/tests/conftest.py index 34df6c0..9300ef4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -11,7 +11,7 @@ from dnschef.api import app from dnschef.protocols import start_server from dnschef.utils import parse_config_file -from dnschef.logger import log, debug_formatter, json_capture_formatter +from dnschef.logger import log, json_capture_formatter #,debug_formatter from fastapi.testclient import TestClient #log.setLevel(logging.DEBUG) diff --git a/tests/test_http_api.py b/tests/test_http_api.py index 8addf78..a9efe39 100644 --- a/tests/test_http_api.py +++ b/tests/test_http_api.py @@ -22,7 +22,6 @@ def test_delete_record(api_test_client): url="/", content=json.dumps({"type": "A", "domain": "*.nashvillenibblers.com", "value": "192.168.69.69"}).encode() ) - assert r.status_code == 200 r = api_test_client.get("/") @@ -44,7 +43,6 @@ def test_logs(api_test_client): "/logs", params={"name": "fuck.shit.com"} ) - assert r.status_code == 200 assert len(r.json()) @@ -52,6 +50,5 @@ def test_logs(api_test_client): "/logs", params={"name": "fuck.shit.com", "type": "A"} ) - assert r.status_code == 200 assert len(r.json()) diff --git a/tests/test_util.py b/tests/test_util.py index 2e6ec97..95c72c8 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -8,4 +8,4 @@ async def test_config_parse(config_file): @pytest.mark.asyncio async def test_header(): - assert __version__ in header \ No newline at end of file + assert __version__ in header