Skip to content

Commit

Permalink
Merge pull request #5 from hadriansecurity/olivier/docker
Browse files Browse the repository at this point in the history
Add Docker
  • Loading branch information
klaasmeinke authored Nov 21, 2024
2 parents 0d2ca52 + 90ad8e6 commit 64f32ed
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 5 deletions.
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# usage:
# change example_input.txt to your input file on line 14
# docker build -t subwiz .
# docker run subwiz (optionally add any subwiz arguments)

FROM python:3.12-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY subwiz subwiz
COPY example_input.txt input_domains.txt

ENTRYPOINT ["python", "-m", "subwiz.cli", "-i", "/app/input_domains.txt"]
CMD []
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"

[project]
name = "subwiz"
version = "0.1.4"
version = "0.1.5"
description = "A recon tool that uses AI to predict subdomains. Then returns those that resolve."
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.9, <3.13"
authors = [{name = "Klaas Meinke", email = "[email protected]"}]
keywords = ["machine learning", "recon", "subdomains", "transformers"]
license = {text = "MIT License"}
Expand Down
6 changes: 6 additions & 0 deletions subwiz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import subwiz

known_subdomains = ['test1.example.com', 'test2.example.com']
new_subdomains = subwiz.run(input_domains=known_subdomains, no_resolve=True)

print(new_subdomains)
2 changes: 1 addition & 1 deletion subwiz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
run_inference,
run_resolution,
)
from subwiz.types import (
from subwiz.type import (
device_type,
input_domains_file_type,
output_file_type,
Expand Down
2 changes: 1 addition & 1 deletion subwiz/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from subwiz.model import GPT
from subwiz.resolve import is_registered_bulk
from subwiz.types import (
from subwiz.type import (
Domain,
input_domains_type,
device_type,
Expand Down
2 changes: 2 additions & 0 deletions subwiz/model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
This code is largely copied from the nanogpt repository by Andrej Karpathy.
The generate method has been modified to output many sequences.
https://github.com/karpathy/nanoGPT
Full definition of a GPT Language Model, all of it in this single file.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_domain_inputs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from argparse import ArgumentTypeError
import os

from subwiz.types import input_domains_file_type
from subwiz.type import input_domains_file_type


def test_file_doesnt_exist():
Expand Down

0 comments on commit 64f32ed

Please sign in to comment.