From 10cb221408b10362c74b41393cdd06c3532b9db7 Mon Sep 17 00:00:00 2001 From: Codepy <1942171924@qq.com> Date: Sat, 1 Jun 2024 17:44:15 +0800 Subject: [PATCH 1/7] =?UTF-8?q?bugfix=EF=BC=9A=E4=BF=AE=E5=A4=8DUbuntu?= =?UTF-8?q?=E7=8E=AF=E5=A2=83No=20Module=20Named=20'ntsecurityco'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/utils/File.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/utils/File.py b/app/utils/File.py index 520acfe..3256a5e 100644 --- a/app/utils/File.py +++ b/app/utils/File.py @@ -2,7 +2,7 @@ import os import json import time import stat -import ntsecuritycon + @@ -57,6 +57,7 @@ def SetAuthority(path, system): if system == "Windows": import win32file import win32security + import ntsecuritycon """import subprocess # 构建命令 command = ['icacls', path, '/grant', 'administrators:(F)', '/deny', 'Everyone:(RD)'] -- Gitee From b3a1257841fd7748f297f77a7278211a0a5595e8 Mon Sep 17 00:00:00 2001 From: Codepy <1942171924@qq.com> Date: Sat, 1 Jun 2024 18:27:18 +0800 Subject: [PATCH 2/7] =?UTF-8?q?bugfix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/utils/Shell.py | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/app/utils/Shell.py b/app/utils/Shell.py index edb7f83..5cf93d2 100644 --- a/app/utils/Shell.py +++ b/app/utils/Shell.py @@ -3,12 +3,12 @@ import time import _thread from app.utils import Config -cfg = Config.get_config()["ssh_config"] -hostname = cfg['ip'] -port = cfg['port'] -username = cfg['name'] -password = cfg['pw'] -timeout = 10 +cfg = "" +hostname = "" +port = "" +username = "" +password = "" +timeout = "" web_socket = None chan = None @@ -16,6 +16,21 @@ chan = None def recvThread(): # 开启一个多线程负责读取返回信息 global chan global web_socket + global cfg + global hostname + global port + global username + global password + global timeout + cfg = Config.get_config()["ssh_config"] + hostname = cfg['ip'] + port = cfg['port'] + username = cfg['name'] + password = cfg['pw'] + timeout = 10 + + web_socket = None + chan = None while True: while chan.recv_ready(): info = chan.recv(1024).decode('utf-8') @@ -27,6 +42,19 @@ def recvThread(): # 开启一个多线程负责读取返回信息 def Shell(command, ws, id, list): global web_socket global chan + global cfg + global hostname + global port + global username + global password + global timeout + cfg = Config.get_config()["ssh_config"] + hostname = cfg['ip'] + port = cfg['port'] + username = cfg['name'] + password = cfg['pw'] + timeout = 10 + web_socket = ws if id not in list: ssh = paramiko.SSHClient() -- Gitee From 37033bc244086e0ae072eb4530d2b934f5c154a4 Mon Sep 17 00:00:00 2001 From: CodeKpy <1942171924@qq.com> Date: Sat, 1 Jun 2024 10:36:04 +0000 Subject: [PATCH 3/7] rename app/controller/install.py to app/controller/Install.py. Signed-off-by: CodeKpy <1942171924@qq.com> --- app/controller/{install.py => Install.py} | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename app/controller/{install.py => Install.py} (98%) diff --git a/app/controller/install.py b/app/controller/Install.py similarity index 98% rename from app/controller/install.py rename to app/controller/Install.py index c8faa86..69cee43 100644 --- a/app/controller/install.py +++ b/app/controller/Install.py @@ -1,11 +1,10 @@ import app.utils.System as sy -import os import json import random import string import hashlib from app.utils import Service, File -import ntsecuritycon + def PanelInstall(ROOT_PATH): system = sy.get_system_name() -- Gitee From 5e5d225b62754b45560416274415756efc2da588 Mon Sep 17 00:00:00 2001 From: CodeKpy <1942171924@qq.com> Date: Sat, 1 Jun 2024 10:39:09 +0000 Subject: [PATCH 4/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20data?= =?UTF-8?q?/config/panel.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/config/panel.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 data/config/panel.json diff --git a/data/config/panel.json b/data/config/panel.json deleted file mode 100644 index 272fcc5..0000000 --- a/data/config/panel.json +++ /dev/null @@ -1 +0,0 @@ -{"AJAOg": "ee33d8f9f918f841653a8cabe75c08648c8757960fc158ba7d0bf64ac04240c9", "port": 8976, "safe_entry": "fSZng", "secret_key": "pzAjZp0oz"} \ No newline at end of file -- Gitee From 0b624aa1798c6aaa808e1743291f3ae9e96fa4c6 Mon Sep 17 00:00:00 2001 From: Codepy <1942171924@qq.com> Date: Sat, 1 Jun 2024 18:50:11 +0800 Subject: [PATCH 5/7] =?UTF-8?q?bugfix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/utils/File.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/app/utils/File.py b/app/utils/File.py index 3256a5e..05374df 100644 --- a/app/utils/File.py +++ b/app/utils/File.py @@ -58,20 +58,7 @@ def SetAuthority(path, system): import win32file import win32security import ntsecuritycon - """import subprocess - # 构建命令 - command = ['icacls', path, '/grant', 'administrators:(F)', '/deny', 'Everyone:(RD)'] - - # 执行命令 - process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - output, error = process.communicate() - - # 打印输出结果 - if process.returncode == 0: - print("文件权限设置成功") - else: - print("文件权限设置失败:", error) - return False""" + # 获取管理员权限SID admins_sid = win32security.LookupAccountName("", "Administrators")[0] filename = path @@ -100,7 +87,7 @@ def SetAuthority(path, system): win32security.SetFileSecurity(filename, win32security.DACL_SECURITY_INFORMATION, security_descriptor) else: # 设置文件权限为root可读写,其它用户无法读写 - os.chmod("./data/config/panel.json", 0o600) + os.chmod(path, 0o600) def get_file_info(path): -- Gitee From 714609068ae9db7607e1868440ed46a372a7f0bd Mon Sep 17 00:00:00 2001 From: Codepy <1942171924@qq.com> Date: Sat, 1 Jun 2024 18:51:56 +0800 Subject: [PATCH 6/7] =?UTF-8?q?bugfix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/Install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controller/Install.py b/app/controller/Install.py index 69cee43..0d67a4b 100644 --- a/app/controller/Install.py +++ b/app/controller/Install.py @@ -22,7 +22,7 @@ def PanelInstall(ROOT_PATH): } with open("./data/config/ssh.json", 'w') as file: json.dump(json_data, file) - File.SetAuthority(ROOT_PATH +"./data/config/ssh.json", system) + File.SetAuthority(ROOT_PATH + "/data/config/ssh.json", system) # 生成数据 # 生成随机字母 @@ -46,7 +46,7 @@ def PanelInstall(ROOT_PATH): with open("./data/config/panel.json", 'w') as file: json.dump(json_data, file) - File.SetAuthority(ROOT_PATH + "./data/config/panel.json", system) + File.SetAuthority(ROOT_PATH + "/data/config/panel.json", system) # 设置开机自启动 service_name = "QPanel_Service" -- Gitee From fdf1703796c178017ee626152ff9771d817acc9d Mon Sep 17 00:00:00 2001 From: Codepy <1942171924@qq.com> Date: Sat, 1 Jun 2024 19:47:02 +0800 Subject: [PATCH 7/7] =?UTF-8?q?upd=EF=BC=9A=E6=8E=A8=E9=80=81win=5F1.2.0?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/workspace.xml | 76 +- app/controller/index.py | 4 +- app/utils/WordsImg.py | 10 + build/main/Analysis-00.toc | 6979 ++++- build/main/COLLECT-00.toc | 3167 +- build/main/EXE-00.toc | 11 +- build/main/PKG-00.toc | 9 + build/main/PYZ-00.pyz | Bin 2486525 -> 5719134 bytes build/main/PYZ-00.toc | 2915 +- build/main/base_library.zip | Bin 843810 -> 843810 bytes build/main/main.exe | Bin 2837631 -> 6073232 bytes build/main/main.pkg | Bin 2505855 -> 5741456 bytes build/main/warn-main.txt | 122 +- build/main/xref-main.html | 40034 ++++++++++++++++++++----- dist/main/_internal/base_library.zip | Bin 843810 -> 843810 bytes dist/main/main.exe | Bin 2837631 -> 6073232 bytes install.bat | 4 +- main.py | 1 + pid.txt | 2 +- 19 files changed, 45079 insertions(+), 8255 deletions(-) create mode 100644 app/utils/WordsImg.py diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 81c5bf1..d674a8e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,27 +4,26 @@