add option for custom nmap args #28

This commit is contained in:
Maxi Quoß
2022-12-04 11:00:46 +01:00
parent 375abd0c42
commit 87915b2dd3
4 changed files with 6 additions and 2 deletions

View File

@@ -225,7 +225,8 @@ class WSConsumer(AsyncWebsocketConsumer):
day_of_week=dow,
day_of_month=dom,
month_of_year=month,
timezone = pytz.timezone(os.getenv("DJANGO_TIME_ZONE", "UTC"))
timezone=pytz.timezone(
os.getenv("DJANGO_TIME_ZONE", "UTC"))
)
PeriodicTask.objects.update_or_create(
name=f"{data['name']}-{action}",
@@ -297,7 +298,7 @@ class WSConsumer(AsyncWebsocketConsumer):
return
p = subprocess.Popen(
["nmap", "-sP", conf.scan_address], stdout=subprocess.PIPE)
["nmap", os.getenv("NMAP_ARGS", "-sP"), conf.scan_address], stdout=subprocess.PIPE)
out = p.communicate()[0].decode("utf-8")
ip_line = "Nmap scan report for"
mac_line = "MAC Address:"

View File

@@ -24,6 +24,7 @@ services:
#- DJANGO_DEBUG=True # optional (default: False)
#- DJANGO_LANGUAGE_CODE=de # optional (default: en)
#- DJANGO_TIME_ZONE=Europe/Berlin # optional (default: UTC)
#- NMAP_ARGS=-sP # optional, set this if your devices need special nmap args so they can be found (default: -sP)
depends_on:
redis:
condition: service_healthy

View File

@@ -24,6 +24,7 @@ services:
#- DJANGO_DEBUG=True # optional (default: False)
#- DJANGO_LANGUAGE_CODE=de # optional (default: en)
#- DJANGO_TIME_ZONE=Europe/Berlin # optional (default: UTC)
#- NMAP_ARGS=-sP # optional, set this if your devices need special nmap args so they can be found (default: -sP)
depends_on:
redis:
condition: service_healthy

View File

@@ -19,6 +19,7 @@ services:
#- DJANGO_DEBUG=True # optional (default: False)
#- DJANGO_LANGUAGE_CODE=de # optional (default: en)
#- DJANGO_TIME_ZONE=Europe/Berlin # optional (default: UTC)
#- NMAP_ARGS=-sP # optional, set this if your devices need special nmap args so they can be found (default: -sP)
volumes:
- ./db/:/app/backend/db/
depends_on: