-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
50 lines (43 loc) · 1.66 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
def setup():
global masscan_rate
dbFile = None
credentials = None
discordToken = None
webPort = None
dbType = input("Enter the database type (postgres, sqlite): ")
if dbType == "postgres":
credentials = {
'host': input("Enter the host: "),
'port': input("Enter the port: "),
'database': input("Enter the database name: "),
'user': input("Enter the username: "),
'password': input("Enter the password: ")
}
if dbType == "sqlite":
dbFile = input("Enter the database file name: ")
discordBool = input("Do you want to enable discord bot? (y/n): ")
if discordBool == "y":
discordToken = input("Enter the discord bot token: ")
webBool = input("Do you want to enable web server? (y/n): ")
if webBool == "y":
webPort = input("Enter the web server port: ")
scanning_method = input("Enter the scanning method (masscan, qubo): ")
if scanning_method == "masscan":
masscan_rate = input("Enter the masscan rate (default 1500): ")
if masscan_rate == "":
masscan_rate = 1500
with open(".env", "w") as f:
f.write(f"dbType={dbType}\n")
if credentials:
f.write(f"credentials={credentials}\n")
if dbFile:
f.write(f"dbFile={dbFile}\n")
if discordBool == "y":
f.write(f"discordToken={discordToken}\n")
if webBool == "y":
f.write(f"webPort={webPort}\n")
f.write(f"scanning_method={scanning_method}\n")
if scanning_method == "masscan":
f.write(f"masscan_rate={masscan_rate}\n")
if __name__ == "__main__":
setup()