From 5398909661343f39adfe88cc10a3bcd3e22a04a1 Mon Sep 17 00:00:00 2001 From: Ali Razmjoo Date: Wed, 11 Aug 2021 23:12:03 +0200 Subject: [PATCH] enhacements --- .github/workflows/CI.yml | 3 +++ Dockerfile | 1 + config.py | 2 +- docker-compose.yml | 2 ++ lib/messages/en.yaml | 2 +- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 643761e1..cf7fde0e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -57,6 +57,9 @@ jobs: - name: lint check with flake8 run: flake8 --extend-exclude '*.txt,*.js,*.md,*.html' --count --select=E9,F63,F7,F82 --show-source + - name: create .data directory + run: mkdir -p .data/results .data/tmp + - name: Build the code with docker run: docker build . -t nettacker diff --git a/Dockerfile b/Dockerfile index 590e3ae1..41e9e80b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,5 @@ RUN cat requirements-apt-get.txt | xargs aptitude install -y RUN pip3 install --upgrade pip RUN pip3 install -r requirements.txt RUN pip3 install -r requirements-dev.txt +ENV docker_env=true CMD [ "python3", "./nettacker.py" ] diff --git a/config.py b/config.py index 24e17aff..d809c28a 100644 --- a/config.py +++ b/config.py @@ -40,7 +40,7 @@ def nettacker_api_config(): """ return { # OWASP Nettacker API Default Configuration "start_api_server": False, - "api_hostname": "nettacker-api.z3r0d4y.com", # pointed to 127.0.0.1 + "api_hostname": "0.0.0.0" if os.environ.get("docker_env") == "true" else "nettacker-api.z3r0d4y.com", "api_port": 5000, "api_debug_mode": False, "api_access_key": generate_random_token(32), diff --git a/docker-compose.yml b/docker-compose.yml index aff6fba1..7da8faa4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,3 +10,5 @@ services: - 5000:5000 volumes: - ./:/usr/src/owaspnettacker + environment: + - docker_env=true diff --git a/lib/messages/en.yaml b/lib/messages/en.yaml index 612484c0..025b244d 100644 --- a/lib/messages/en.yaml +++ b/lib/messages/en.yaml @@ -219,7 +219,7 @@ API_port_int: API port must be an integer! unknown_ip_input: unknown input type, accepted types are SINGLE_IPv4, RANGE_IPv4, CIDR_IPv4 -API_key: " * API Key: {0}\n" +API_key: " * API is accessible from http://nettacker-api.z3r0d4y.com/ via API Key: {0}\n" ports_int: ports must be integers! (e.g. 80 || 80,1080 || 80,1080-1300,9000,12000-15000) through_API: Through the OWASP Nettacker API API_invalid: invalid API key