Skip to content

Commit fd7703a

Browse files
committed
Switched color's library. Now is colorama
1 parent df82ad1 commit fd7703a

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed
-28 Bytes
Binary file not shown.
-28 Bytes
Binary file not shown.
26 Bytes
Binary file not shown.
-28 Bytes
Binary file not shown.

main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import ssh_connection
33
import page_with_not_installed_xray
44
import page_with_installed_xray
5-
from termcolor import colored
5+
from colorama import init, Fore
66

77
logged = False
88

@@ -19,12 +19,12 @@
1919

2020
if xray_installed:
2121
logged = True # Mark as logged in
22-
print(colored("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", 'yellow'))
22+
print(Fore.YELLOW + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + Fore.RESET)
2323
print("""1. Добавить пользователя
2424
2. Удалить пользователя
2525
3. Список пользователей
2626
4. Сгенерировать/Перегенерировать ключи (все пользователи будут удалены)""")
27-
print(colored("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", 'yellow'))
27+
print(Fore.YELLOW + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + Fore.RESET)
2828

2929
digit = page_with_installed_xray.digit_input()
3030

@@ -73,8 +73,8 @@
7373
ssh_connection.generate_keys(ssh)
7474

7575
logged = True # Mark successful installation
76-
print(colored("XRay успешно установлен и настроен!", "green"))
76+
print(Fore.GREEN + "XRay успешно установлен и настроен!" + Fore.RESET)
7777

7878
except Exception as e:
79-
print(colored(f"Ошибка: {str(e)}", "red"))
79+
print(Fore.RED + f"Ошибка: {str(e)}" + Fore.RESET)
8080
logged = False

ssh_connection.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import paramiko
22
import re
3-
import json
4-
from termcolor import colored, cprint
5-
3+
from colorama import init, Fore
64

75
@staticmethod
86
def connect_ssh(server):
@@ -144,7 +142,7 @@ def add_user(ssh, server_ip):
144142
public_key = stdout.read().decode('utf-8')
145143

146144
print("Необходимо вставить конфиг в VLESS клиент:")
147-
print(colored(f"vless://{uuid}@{server_ip}:443?security=reality&sni=google.com&alpn=h2&fp=chrome&pbk={public_key}&pbk=su1LPoVoA44umUYDWskmuEwAvGvx9bg8nVfiSgK3Fiw&sid=aabbccdd&type=tcp&flow=xtls-rprx-vision&encryption=none#manul",'green'))
145+
print(Fore.GREEN + f"vless://{uuid}@{server_ip}:443?security=reality&sni=google.com&alpn=h2&fp=chrome&pbk={public_key}&pbk=su1LPoVoA44umUYDWskmuEwAvGvx9bg8nVfiSgK3Fiw&sid=aabbccdd&type=tcp&flow=xtls-rprx-vision&encryption=none#manul" + Fore.RESET)
148146

149147
stdin, stdout, stderr = ssh.exec_command("systemctl restart xray")
150148

0 commit comments

Comments
 (0)