diff --git a/__pycache__/django_tab.cpython-38.pyc b/__pycache__/django_tab.cpython-38.pyc index ebcc56b..f5086e5 100644 Binary files a/__pycache__/django_tab.cpython-38.pyc and b/__pycache__/django_tab.cpython-38.pyc differ diff --git a/__pycache__/gunicorn_tab.cpython-38.pyc b/__pycache__/gunicorn_tab.cpython-38.pyc index 4bbe000..a7cbbd5 100644 Binary files a/__pycache__/gunicorn_tab.cpython-38.pyc and b/__pycache__/gunicorn_tab.cpython-38.pyc differ diff --git a/__pycache__/remote_command_tab.cpython-38.pyc b/__pycache__/remote_command_tab.cpython-38.pyc index b670998..b76108d 100644 Binary files a/__pycache__/remote_command_tab.cpython-38.pyc and b/__pycache__/remote_command_tab.cpython-38.pyc differ diff --git a/__pycache__/threads.cpython-38.pyc b/__pycache__/threads.cpython-38.pyc index fbde459..0d5e2fb 100644 Binary files a/__pycache__/threads.cpython-38.pyc and b/__pycache__/threads.cpython-38.pyc differ diff --git a/app.2025-08-27_22-29-13_343332.log b/app.2025-08-27_22-29-13_343332.log new file mode 100644 index 0000000..aaa2968 --- /dev/null +++ b/app.2025-08-27_22-29-13_343332.log @@ -0,0 +1,410 @@ +2025-08-27 22:29:13.339 | INFO | __main__::2691 - 应用程序启动 +2025-08-27 22:29:13.376 | INFO | __main__:load_git_config:1257 - 已加载服务器 测试服务器(192.168.3.157) 的git配置 +2025-08-27 22:29:13.377 | INFO | __main__:load_django_config:1899 - 已加载服务器 测试服务器(192.168.3.157) 的Django配置 +2025-08-27 22:29:13.379 | INFO | __main__:load_gunicorn_config:2576 - 已加载服务器 测试服务器(192.168.3.157) 的Gunicorn配置 +2025-08-27 22:29:15.654 | INFO | __main__:on_tab_changed:2684 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-27 22:29:16.159 | WARNING | __main__:check_service_status:2587 - 未连接服务器,跳过Gunicorn服务状态检测 +2025-08-27 22:29:20.590 | INFO | __main__:run:69 - 尝试连接服务器: 192.168.3.157:22 +2025-08-27 22:29:20.678 | INFO | __main__:run:75 - 服务器连接成功 +2025-08-27 22:29:21.205 | INFO | __main__:on_tab_changed:2684 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-27 22:29:21.708 | INFO | __main__:check_service_status:2584 - 自动检测Gunicorn服务状态 +2025-08-27 22:29:21.708 | INFO | __main__:manage_service:2417 - 开始管理Gunicorn服务,操作: status +2025-08-27 22:29:21.947 | INFO | __main__:manage_service:2437 - ManageGunicornServiceThread已启动,操作: status +2025-08-27 22:29:21.954 | INFO | __main__:run:2075 - 开始执行Gunicorn服务操作: status +2025-08-27 22:29:26.166 | INFO | __main__:show_service_password_dialog:2469 - 用户已输入sudo密码 +2025-08-27 22:29:26.185 | DEBUG | __main__:run:2087 - 准备执行命令: sudo -S systemctl status gunicorn +2025-08-27 22:29:26.787 | DEBUG | __main__:run:2101 - 正在传递sudo密码... +2025-08-27 22:29:26.788 | DEBUG | __main__:run:2104 - 密码传递完成,等待命令执行... +2025-08-27 22:29:56.835 | ERROR | __main__:run:2119 - 命令执行超时: sudo -S systemctl status gunicorn +2025-08-27 22:30:37.721 | INFO | __main__:on_tab_changed:2684 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-27 22:30:38.215 | INFO | __main__:check_service_status:2584 - 自动检测Gunicorn服务状态 +2025-08-27 22:30:38.216 | INFO | __main__:manage_service:2417 - 开始管理Gunicorn服务,操作: status +2025-08-27 22:30:38.218 | INFO | __main__:manage_service:2437 - ManageGunicornServiceThread已启动,操作: status +2025-08-27 22:30:38.220 | INFO | __main__:run:2075 - 开始执行Gunicorn服务操作: status +2025-08-27 22:30:41.127 | INFO | __main__:show_service_password_dialog:2469 - 用户已输入sudo密码 +2025-08-27 22:30:41.134 | DEBUG | __main__:run:2087 - 准备执行命令: sudo -S systemctl status gunicorn +2025-08-27 22:30:41.727 | DEBUG | __main__:run:2101 - 正在传递sudo密码... +2025-08-27 22:30:41.727 | DEBUG | __main__:run:2104 - 密码传递完成,等待命令执行... +2025-08-27 22:31:11.761 | ERROR | __main__:run:2119 - 命令执行超时: sudo -S systemctl status gunicorn +2025-08-28 20:04:06.090 | INFO | __main__::2691 - 应用程序启动 +2025-08-28 20:04:06.159 | INFO | __main__:load_git_config:1257 - 已加载服务器 测试服务器(192.168.3.157) 的git配置 +2025-08-28 20:04:06.160 | INFO | __main__:load_django_config:1899 - 已加载服务器 测试服务器(192.168.3.157) 的Django配置 +2025-08-28 20:04:06.161 | INFO | __main__:load_gunicorn_config:2576 - 已加载服务器 测试服务器(192.168.3.157) 的Gunicorn配置 +2025-08-28 20:04:07.908 | INFO | __main__:run:69 - 尝试连接服务器: 192.168.3.157:22 +2025-08-28 20:04:08.017 | INFO | __main__:run:75 - 服务器连接成功 +2025-08-28 20:04:11.660 | INFO | __main__:on_tab_changed:2684 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 20:04:12.159 | INFO | __main__:check_service_status:2584 - 自动检测Gunicorn服务状态 +2025-08-28 20:04:12.159 | INFO | __main__:manage_service:2417 - 开始管理Gunicorn服务,操作: status +2025-08-28 20:04:12.161 | INFO | __main__:manage_service:2437 - ManageGunicornServiceThread已启动,操作: status +2025-08-28 20:04:12.162 | INFO | __main__:run:2075 - 开始执行Gunicorn服务操作: status +2025-08-28 20:04:15.634 | INFO | __main__:show_service_password_dialog:2469 - 用户已输入sudo密码 +2025-08-28 20:04:15.686 | DEBUG | __main__:run:2087 - 准备执行命令: sudo -S systemctl status gunicorn +2025-08-28 20:04:16.326 | DEBUG | __main__:run:2101 - 正在传递sudo密码... +2025-08-28 20:04:16.327 | DEBUG | __main__:run:2104 - 密码传递完成,等待命令执行... +2025-08-28 20:28:50.493 | INFO | __main__::114 - 应用程序启动 +2025-08-28 20:32:04.868 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 20:32:06.089 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 20:32:06.620 | ERROR | gunicorn_tab:on_manage_service_result:270 - 服务操作失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper +sudo: a password is required + +2025-08-28 20:32:06.620 | ERROR | threads:run:808 - 服务状态查询失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper +sudo: a password is required + +2025-08-28 20:32:29.596 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 20:32:30.115 | ERROR | threads:run:808 - 服务状态查询失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper +sudo: a password is required + +2025-08-28 20:32:30.115 | ERROR | gunicorn_tab:on_manage_service_result:270 - 服务操作失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper +sudo: a password is required + +2025-08-28 20:35:01.275 | ERROR | threads:run:808 - 服务状态查询失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper +sudo: a password is required + +2025-08-28 20:35:01.275 | ERROR | gunicorn_tab:on_manage_service_result:270 - 服务操作失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper +sudo: a password is required + +2025-08-28 20:37:01.109 | INFO | __main__::114 - 应用程序启动 +2025-08-28 20:41:24.800 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 20:51:01.943 | INFO | __main__::114 - 应用程序启动 +2025-08-28 20:51:04.428 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 20:51:05.201 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 20:51:05.730 | ERROR | threads:run:836 - 服务状态查询失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper +sudo: a password is required + +2025-08-28 20:51:05.734 | ERROR | gunicorn_tab:on_manage_service_result:285 - 服务操作失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper +sudo: a password is required + +2025-08-28 20:52:55.800 | INFO | __main__::114 - 应用程序启动 +2025-08-28 20:52:58.689 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 20:52:59.622 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 20:53:05.630 | ERROR | threads:run:836 - 服务状态查询失败: [sudo] password for xiaji: Unit django_gunicorn.service could not be found. + +2025-08-28 20:53:05.631 | ERROR | gunicorn_tab:on_manage_service_result:338 - 服务操作失败: [sudo] password for xiaji: Unit django_gunicorn.service could not be found. + +2025-08-28 20:54:39.385 | INFO | __main__::114 - 应用程序启动 +2025-08-28 20:54:45.328 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 20:54:46.326 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 20:54:53.497 | INFO | threads:run:862 - 执行服务管理命令: systemctl status django_gunicorn +2025-08-28 20:54:53.505 | ERROR | threads:run:871 - 服务文件不存在: /etc/systemd/system/django_gunicorn.service, 错误: ls: cannot access '/etc/systemd/system/django_gunicorn.service': No such file or directory + +2025-08-28 20:54:53.507 | ERROR | gunicorn_tab:on_manage_service_result:338 - 服务操作失败: 服务文件不存在: django_gunicorn.service +2025-08-28 21:00:17.337 | INFO | remote_command_tab:on_list_directory_result:186 - 目录列表成功 +2025-08-28 21:00:17.337 | INFO | threads:run:157 - 目录列表成功: /home/xiaji/ +2025-08-28 21:00:56.560 | ERROR | threads:run:559 - Django项目不存在: /home/xiaji/statuspage +2025-08-28 21:00:56.560 | ERROR | django_tab:on_check_django_status_result:274 - Django状态检查失败: Django项目不存在: /home/xiaji/statuspage +2025-08-28 21:01:14.969 | INFO | threads:run:157 - 目录列表成功: /home/xiaji/ +2025-08-28 21:01:14.969 | INFO | remote_command_tab:on_list_directory_result:186 - 目录列表成功 +2025-08-28 21:01:28.149 | ERROR | threads:run:559 - Django项目不存在: /home/xiaji/statuspage/ +2025-08-28 21:01:28.149 | ERROR | django_tab:on_check_django_status_result:274 - Django状态检查失败: Django项目不存在: /home/xiaji/statuspage/ +2025-08-28 21:01:32.368 | ERROR | threads:run:363 - Django项目不存在: /home/xiaji/statuspage/ +2025-08-28 21:01:32.370 | ERROR | django_tab:on_test_django_result:167 - Django测试启动失败: Django项目不存在: /home/xiaji/statuspage/ +2025-08-28 21:01:36.279 | INFO | threads:run:304 - Django已安装: 5.2.5 +2025-08-28 21:01:36.280 | INFO | django_tab:on_install_django_result:135 - Django安装成功: Django已安装: 5.2.5 +2025-08-28 21:01:39.699 | ERROR | threads:run:363 - Django项目不存在: /home/xiaji/statuspage/ +2025-08-28 21:01:39.700 | ERROR | django_tab:on_test_django_result:167 - Django测试启动失败: Django项目不存在: /home/xiaji/statuspage/ +2025-08-28 21:02:37.594 | INFO | server_connection_tab:save_config:34 - 配置文件保存成功 +2025-08-28 21:02:47.403 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:03:06.423 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 21:03:13.531 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:03:18.362 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 21:06:04.148 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:06:04.183 | ERROR | remote_command_tab:load_git_config:113 - 加载git配置失败: [Errno 2] No such file or directory: 'C:\\Users\\xiaji\\Documents\\个人文件夹\\夏骥\\config.json' +2025-08-28 21:06:32.121 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:06:32.155 | ERROR | remote_command_tab:load_git_config:113 - 加载git配置失败: 'gbk' codec can't decode byte 0xa8 in position 56: illegal multibyte sequence +2025-08-28 21:06:47.698 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:06:47.729 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 21:06:52.075 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 21:08:17.090 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:08:17.130 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 21:08:17.131 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/statuspage +2025-08-28 21:12:20.285 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 21:12:28.603 | ERROR | django_tab:on_test_django_result:184 - Django测试启动失败: Django项目不存在: /home/xiaji/statuspage +2025-08-28 21:12:28.603 | ERROR | threads:run:363 - Django项目不存在: /home/xiaji/statuspage +2025-08-28 21:13:22.162 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:13:22.202 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 21:13:22.203 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/statuspage +2025-08-28 21:13:27.903 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 21:13:39.808 | ERROR | threads:run:363 - Django项目不存在: /home/xiaji/statuspage +2025-08-28 21:13:39.809 | ERROR | django_tab:on_test_django_result:184 - Django测试启动失败: Django项目不存在: /home/xiaji/statuspage +2025-08-28 21:13:48.684 | INFO | threads:run:157 - 目录列表成功: /home/xiaji/ +2025-08-28 21:13:48.688 | INFO | remote_command_tab:on_list_directory_result:199 - 目录列表成功 +2025-08-28 21:16:20.769 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:16:20.810 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 21:16:20.811 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/statuspage +2025-08-28 21:16:22.780 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 21:16:25.519 | ERROR | threads:run:363 - Django项目不存在: /home/xiaji/statuspage +2025-08-28 21:16:25.519 | ERROR | django_tab:on_test_django_result:184 - Django测试启动失败: Django项目不存在: /home/xiaji/statuspage +2025-08-28 21:16:29.049 | INFO | threads:run:157 - 目录列表成功: /home/xiaji/ +2025-08-28 21:16:29.051 | INFO | remote_command_tab:on_list_directory_result:199 - 目录列表成功: +total 176 +drwxr-x--- 9 xiaji xiaji 4096 Aug 27 20:52 . +drwxr-xr-x 3 root root 4096 Aug 27 04:10 .. +drwx------ 3 xiaji xiaji 4096 Aug 26 22:21 .cache +-rw-rw-r-- 1 xiaji xiaji 135168 Aug 26 22:18 db.sqlite3 +drwxrwxr-x 8 xiaji xiaji 4096 Aug 26 22:18 .git +drwxrwxr-x 3 xiaji xiaji 4096 Aug 27 20:51 home +drwxrwxr-x 4 xiaji xiaji 4096 Aug 26 22:25 .local +-rw-rw-r-- 1 xiaji xiaji 666 Aug 26 22:18 manage.py +-rw-rw-r-- 1 xiaji xiaji 13 Aug 26 22:18 requirements.txt +drwxrwxr-x 3 xiaji xiaji 4096 Aug 27 20:52 static +drwxrwxr-x 5 xiaji xiaji 4096 Aug 26 22:18 status +drwxrwxr-x 3 xiaji xiaji 4096 Aug 28 04:20 statuspage +-rw-r--r-- 1 xiaji xiaji 0 Aug 27 20:03 .sudo_as_admin_successful + +2025-08-28 21:17:03.711 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:17:03.777 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 21:17:03.782 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/statuspage +2025-08-28 21:17:09.386 | INFO | server_connection_tab:save_config:34 - 配置文件保存成功 +2025-08-28 21:17:11.652 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 21:17:16.174 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ +2025-08-28 21:17:18.319 | ERROR | django_tab:on_test_django_result:184 - Django测试启动失败: 依赖安装失败: error: externally-managed-environment + +× This environment is externally managed +╰─> To install Python packages system-wide, try apt install + python3-xyz, where xyz is the package you are trying to + install. + + If you wish to install a non-Debian-packaged Python package, + create a virtual environment using python3 -m venv path/to/venv. + Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make + sure you have python3-full installed. + + If you wish to install a non-Debian packaged Python application, + it may be easiest to use pipx install xyz, which will manage a + virtual environment for you. Make sure you have pipx installed. + + See /usr/share/doc/python3.12/README.venv for more information. + +note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. +hint: See PEP 668 for the detailed specification. + +2025-08-28 21:17:18.319 | ERROR | threads:run:381 - 依赖安装失败: error: externally-managed-environment + +× This environment is externally managed +╰─> To install Python packages system-wide, try apt install + python3-xyz, where xyz is the package you are trying to + install. + + If you wish to install a non-Debian-packaged Python package, + create a virtual environment using python3 -m venv path/to/venv. + Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make + sure you have python3-full installed. + + If you wish to install a non-Debian packaged Python application, + it may be easiest to use pipx install xyz, which will manage a + virtual environment for you. Make sure you have pipx installed. + + See /usr/share/doc/python3.12/README.venv for more information. + +note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. +hint: See PEP 668 for the detailed specification. + +2025-08-28 21:17:50.278 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:17:50.317 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 21:17:50.319 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ +2025-08-28 21:18:00.995 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 21:18:02.871 | INFO | threads:run:304 - Django已安装: 5.2.5 +2025-08-28 21:18:02.873 | INFO | django_tab:on_install_django_result:152 - Django安装成功: Django已安装: 5.2.5 +2025-08-28 21:19:24.402 | ERROR | threads:run:381 - 依赖安装失败: +2025-08-28 21:19:36.038 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:19:36.077 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 21:19:36.079 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ +2025-08-28 21:19:39.142 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 21:21:54.132 | INFO | server_connection_tab:save_config:34 - 配置文件保存成功 +2025-08-28 21:23:22.197 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:23:22.228 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 21:23:22.229 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ +2025-08-28 21:23:24.309 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 21:26:27.449 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:26:27.484 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 21:26:27.485 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ +2025-08-28 21:26:29.358 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 21:26:39.130 | INFO | threads:run:397 - Django测试服务器启动成功 +2025-08-28 21:26:39.131 | INFO | django_tab:on_test_django_result:181 - Django测试启动成功: Django测试服务器启动成功 +2025-08-28 21:26:52.767 | INFO | threads:run:598 - Django状态检查完成 +2025-08-28 21:26:52.786 | INFO | django_tab:on_check_django_status_result:288 - Django状态检查成功 +2025-08-28 21:26:56.002 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 21:27:03.503 | INFO | threads:run:867 - 执行服务管理命令: systemctl status django_gunicorn +2025-08-28 21:27:03.511 | ERROR | threads:run:876 - 服务文件不存在: /etc/systemd/system/django_gunicorn.service, 错误: ls: cannot access '/etc/systemd/system/django_gunicorn.service': No such file or directory + +2025-08-28 21:27:03.512 | ERROR | gunicorn_tab:on_manage_service_result:338 - 服务操作失败: 服务文件不存在: django_gunicorn.service +2025-08-28 21:27:54.858 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 21:28:00.516 | INFO | threads:run:867 - 执行服务管理命令: systemctl status django_gunicorn +2025-08-28 21:28:00.525 | ERROR | threads:run:876 - 服务文件不存在: /etc/systemd/system/django_gunicorn.service, 错误: ls: cannot access '/etc/systemd/system/django_gunicorn.service': No such file or directory + +2025-08-28 21:28:00.527 | ERROR | gunicorn_tab:on_manage_service_result:338 - 服务操作失败: 服务文件不存在: django_gunicorn.service +2025-08-28 21:28:02.915 | ERROR | threads:run:702 - wsgi.py文件不存在: /home/xiaji///wsgi.py +2025-08-28 21:28:02.916 | ERROR | gunicorn_tab:on_test_gunicorn_result:265 - Gunicorn测试失败: wsgi.py文件不存在: /home/xiaji///wsgi.py +2025-08-28 21:45:10.338 | INFO | __main__::114 - 应用程序启动 +2025-08-28 21:45:10.373 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 21:45:10.374 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ +2025-08-28 21:45:12.542 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 21:45:14.597 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 21:45:18.259 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django +2025-08-28 21:45:18.269 | ERROR | threads:run:884 - 服务文件不存在: /etc/systemd/system/gunicorn_django.service, 错误: ls: cannot access '/etc/systemd/system/gunicorn_django.service': No such file or directory + +2025-08-28 21:45:18.270 | ERROR | gunicorn_tab:on_manage_service_result:386 - 服务操作失败: 服务文件不存在: gunicorn_django.service +2025-08-28 21:45:26.168 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 21:45:30.745 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django +2025-08-28 21:45:30.754 | ERROR | threads:run:884 - 服务文件不存在: /etc/systemd/system/gunicorn_django.service, 错误: ls: cannot access '/etc/systemd/system/gunicorn_django.service': No such file or directory + +2025-08-28 21:45:30.755 | ERROR | gunicorn_tab:on_manage_service_result:386 - 服务操作失败: 服务文件不存在: gunicorn_django.service +2025-08-28 22:01:41.803 | INFO | __main__::114 - 应用程序启动 +2025-08-28 22:01:41.845 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 22:01:41.846 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ +2025-08-28 22:01:43.842 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 22:01:44.537 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 22:01:48.082 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django +2025-08-28 22:01:48.090 | ERROR | threads:run:884 - 服务文件不存在: /etc/systemd/system/gunicorn_django.service, 错误: ls: cannot access '/etc/systemd/system/gunicorn_django.service': No such file or directory + +2025-08-28 22:01:48.091 | ERROR | gunicorn_tab:on_manage_service_result:386 - 服务操作失败: 服务文件不存在: gunicorn_django.service +2025-08-28 22:01:55.720 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 22:01:59.324 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django +2025-08-28 22:01:59.333 | ERROR | threads:run:884 - 服务文件不存在: /etc/systemd/system/gunicorn_django.service, 错误: ls: cannot access '/etc/systemd/system/gunicorn_django.service': No such file or directory + +2025-08-28 22:01:59.334 | ERROR | gunicorn_tab:on_manage_service_result:386 - 服务操作失败: 服务文件不存在: gunicorn_django.service +2025-08-28 22:04:31.027 | INFO | __main__::114 - 应用程序启动 +2025-08-28 22:04:31.062 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 22:04:31.063 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ +2025-08-28 22:05:26.599 | INFO | __main__::114 - 应用程序启动 +2025-08-28 22:05:26.631 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 22:05:26.632 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ +2025-08-28 22:05:28.618 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 22:05:29.755 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 +2025-08-28 22:05:34.219 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django +2025-08-28 22:05:34.227 | ERROR | threads:run:884 - 服务文件不存在: /etc/systemd/system/gunicorn_django.service, 错误: ls: cannot access '/etc/systemd/system/gunicorn_django.service': No such file or directory + +2025-08-28 22:05:34.229 | ERROR | gunicorn_tab:on_manage_service_result:424 - 服务操作失败: 服务文件不存在: gunicorn_django.service +2025-08-28 22:06:09.440 | INFO | threads:run:756 - 准备上传服务文件: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:06:09.454 | INFO | threads:run:763 - 临时服务文件创建成功: /tmp/gunicorn_django.service +2025-08-28 22:06:09.477 | INFO | threads:run:781 - 服务文件移动成功: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:06:09.538 | INFO | threads:run:799 - 服务文件权限设置成功: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:06:09.590 | INFO | threads:run:807 - 服务文件验证成功: -rw-r--r-- 1 xiaji xiaji 705 Aug 28 22:06 /etc/systemd/system/gunicorn_django.service +2025-08-28 22:06:09.888 | INFO | threads:run:831 - systemd重新加载成功 +2025-08-28 22:06:10.453 | INFO | threads:run:839 - 服务被systemd识别: gunicorn_django.service disabled enabled +2025-08-28 22:06:10.454 | INFO | threads:run:847 - 服务文件上传成功: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:06:10.456 | INFO | gunicorn_tab:on_upload_service_result:373 - 服务文件上传成功: 服务文件上传成功: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:06:20.044 | INFO | threads:run:875 - 执行服务管理命令: systemctl restart gunicorn_django +2025-08-28 22:06:20.059 | INFO | threads:run:889 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 705 Aug 28 22:06 /etc/systemd/system/gunicorn_django.service +2025-08-28 22:06:20.139 | INFO | threads:run:920 - 服务restart成功: gunicorn_django +2025-08-28 22:06:20.140 | INFO | gunicorn_tab:on_manage_service_result:421 - 服务操作成功: 服务restart成功: gunicorn_django +2025-08-28 22:07:59.648 | INFO | __main__::109 - 应用程序启动 +2025-08-28 22:07:59.692 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 22:07:59.697 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ +2025-08-28 22:08:02.096 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 22:10:45.949 | INFO | __main__::109 - 应用程序启动 +2025-08-28 22:10:45.986 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 22:10:45.987 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/ +2025-08-28 22:10:45.987 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-28 22:10:53.292 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 22:13:07.349 | INFO | __main__::109 - 应用程序启动 +2025-08-28 22:13:07.387 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 22:13:07.388 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/ +2025-08-28 22:13:07.390 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-28 22:13:07.391 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-28 22:13:09.561 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 22:13:22.767 | INFO | threads:run:756 - 准备上传服务文件: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:13:22.782 | INFO | threads:run:763 - 临时服务文件创建成功: /tmp/gunicorn_django.service +2025-08-28 22:13:22.803 | INFO | threads:run:781 - 服务文件移动成功: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:13:22.865 | INFO | threads:run:799 - 服务文件权限设置成功: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:13:22.917 | INFO | threads:run:807 - 服务文件验证成功: -rw-r--r-- 1 xiaji xiaji 778 Aug 28 22:13 /etc/systemd/system/gunicorn_django.service +2025-08-28 22:13:23.219 | INFO | threads:run:831 - systemd重新加载成功 +2025-08-28 22:13:23.845 | INFO | threads:run:839 - 服务被systemd识别: gunicorn_django.service disabled enabled +2025-08-28 22:13:23.846 | INFO | threads:run:847 - 服务文件上传成功: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:13:23.847 | INFO | gunicorn_tab:on_upload_service_result:377 - 服务文件上传成功: 服务文件上传成功: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:13:28.149 | INFO | threads:run:875 - 执行服务管理命令: systemctl restart gunicorn_django +2025-08-28 22:13:28.158 | INFO | threads:run:889 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 778 Aug 28 22:13 /etc/systemd/system/gunicorn_django.service +2025-08-28 22:13:28.228 | INFO | threads:run:920 - 服务restart成功: gunicorn_django +2025-08-28 22:13:28.230 | INFO | gunicorn_tab:on_manage_service_result:425 - 服务操作成功: 服务restart成功: gunicorn_django +2025-08-28 22:15:05.213 | INFO | __main__::109 - 应用程序启动 +2025-08-28 22:15:05.248 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 22:15:05.249 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/ +2025-08-28 22:15:05.249 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-28 22:15:05.250 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-28 22:15:08.328 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 22:18:00.966 | INFO | __main__::109 - 应用程序启动 +2025-08-28 22:18:01.005 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 22:18:01.007 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/ +2025-08-28 22:18:01.007 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-28 22:18:01.008 | INFO | gunicorn_tab:load_gunicorn_config:175 - 从当前服务器配置加载Gunicorn配置: django_path=/home/xiaji/, project_name=statuspage +2025-08-28 22:18:01.009 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-28 22:18:03.033 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 22:18:10.456 | INFO | threads:run:707 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py +/home/xiaji/.local/lib/python3.12/site-packages/django/core/handlers/wsgi.py +/home/xiaji/.local/lib/python3.12/site-packages/django/core/wsgi.py +/home/xiaji/.local/lib/python3.12/site-packages/asgiref/wsgi.py +2025-08-28 22:18:15.531 | ERROR | threads:run:732 - Gunicorn测试失败 +2025-08-28 22:18:15.531 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Gunicorn测试失败 +2025-08-28 22:18:21.513 | INFO | threads:run:707 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py +/home/xiaji/.local/lib/python3.12/site-packages/django/core/handlers/wsgi.py +/home/xiaji/.local/lib/python3.12/site-packages/django/core/wsgi.py +/home/xiaji/.local/lib/python3.12/site-packages/asgiref/wsgi.py +2025-08-28 22:18:26.582 | ERROR | threads:run:732 - Gunicorn测试失败 +2025-08-28 22:18:26.585 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Gunicorn测试失败 +2025-08-28 22:20:04.518 | INFO | __main__::109 - 应用程序启动 +2025-08-28 22:20:04.553 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 22:20:04.556 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/statuspage +2025-08-28 22:20:04.556 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-28 22:20:04.558 | INFO | gunicorn_tab:load_gunicorn_config:175 - 从当前服务器配置加载Gunicorn配置: django_path=/home/xiaji/statuspage, project_name=statuspage +2025-08-28 22:20:04.559 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-28 22:20:12.042 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 22:20:15.094 | ERROR | threads:run:689 - Django项目不存在: /home/xiaji/statuspage +2025-08-28 22:20:15.095 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Django项目不存在: /home/xiaji/statuspage +2025-08-28 22:20:24.016 | INFO | threads:run:707 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py +/home/xiaji/.local/lib/python3.12/site-packages/django/core/handlers/wsgi.py +/home/xiaji/.local/lib/python3.12/site-packages/django/core/wsgi.py +/home/xiaji/.local/lib/python3.12/site-packages/asgiref/wsgi.py +2025-08-28 22:20:59.164 | INFO | __main__::109 - 应用程序启动 +2025-08-28 22:20:59.201 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 22:20:59.203 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/statuspage +2025-08-28 22:20:59.203 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-28 22:20:59.204 | INFO | gunicorn_tab:load_gunicorn_config:175 - 从当前服务器配置加载Gunicorn配置: django_path=/home/xiaji/statuspage, project_name=statuspage +2025-08-28 22:20:59.204 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-28 22:21:00.318 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 22:21:07.110 | ERROR | threads:run:689 - Django项目不存在: /home/xiaji/statuspage +2025-08-28 22:21:07.112 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Django项目不存在: /home/xiaji/statuspage +2025-08-28 22:24:30.595 | INFO | __main__::109 - 应用程序启动 +2025-08-28 22:24:30.635 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 22:24:30.636 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/statuspage +2025-08-28 22:24:30.636 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-28 22:24:30.637 | INFO | gunicorn_tab:load_gunicorn_config:175 - 从当前服务器配置加载Gunicorn配置: django_path=/home/xiaji/statuspage, project_name=statuspage +2025-08-28 22:24:30.638 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-28 22:24:32.673 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 22:26:19.189 | INFO | __main__::109 - 应用程序启动 +2025-08-28 22:26:19.228 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-28 22:26:19.229 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/statuspage +2025-08-28 22:26:19.229 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-28 22:26:19.231 | INFO | gunicorn_tab:load_gunicorn_config:175 - 从当前服务器配置加载Gunicorn配置: django_path=/home/xiaji/statuspage, project_name=statuspage +2025-08-28 22:26:19.231 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-28 22:26:25.092 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-28 22:26:31.515 | INFO | threads:run:707 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py +/home/xiaji/.local/lib/python3.12/site-packages/django/core/handlers/wsgi.py +/home/xiaji/.local/lib/python3.12/site-packages/django/core/wsgi.py +/home/xiaji/.local/lib/python3.12/site-packages/asgiref/wsgi.py +2025-08-28 22:26:36.591 | ERROR | threads:run:732 - Gunicorn测试失败 +2025-08-28 22:26:36.592 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Gunicorn测试失败 +2025-08-28 22:27:18.620 | INFO | threads:run:756 - 准备上传服务文件: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:27:18.634 | INFO | threads:run:763 - 临时服务文件创建成功: /tmp/gunicorn_django.service +2025-08-28 22:27:18.654 | INFO | threads:run:781 - 服务文件移动成功: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:27:18.717 | INFO | threads:run:799 - 服务文件权限设置成功: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:27:18.768 | INFO | threads:run:807 - 服务文件验证成功: -rw-r--r-- 1 xiaji xiaji 703 Aug 28 22:27 /etc/systemd/system/gunicorn_django.service +2025-08-28 22:27:19.090 | INFO | threads:run:831 - systemd重新加载成功 +2025-08-28 22:27:19.712 | INFO | threads:run:839 - 服务被systemd识别: gunicorn_django.service disabled enabled +2025-08-28 22:27:19.714 | INFO | threads:run:847 - 服务文件上传成功: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:27:19.715 | INFO | gunicorn_tab:on_upload_service_result:408 - 服务文件上传成功: 服务文件上传成功: /etc/systemd/system/gunicorn_django.service +2025-08-28 22:27:24.287 | INFO | threads:run:875 - 执行服务管理命令: systemctl restart gunicorn_django +2025-08-28 22:27:24.295 | INFO | threads:run:889 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 703 Aug 28 22:27 /etc/systemd/system/gunicorn_django.service +2025-08-28 22:27:24.366 | INFO | threads:run:920 - 服务restart成功: gunicorn_django +2025-08-28 22:27:24.367 | INFO | gunicorn_tab:on_manage_service_result:456 - 服务操作成功: 服务restart成功: gunicorn_django +2025-08-28 22:27:28.045 | INFO | threads:run:875 - 执行服务管理命令: systemctl enable gunicorn_django +2025-08-28 22:27:28.054 | INFO | threads:run:889 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 703 Aug 28 22:27 /etc/systemd/system/gunicorn_django.service +2025-08-28 22:27:28.368 | INFO | threads:run:920 - 服务enable成功: gunicorn_django +2025-08-28 22:27:28.371 | INFO | gunicorn_tab:on_manage_service_result:456 - 服务操作成功: 服务enable成功: gunicorn_django +2025-08-28 22:27:32.509 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django +2025-08-28 22:27:32.518 | INFO | threads:run:889 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 703 Aug 28 22:27 /etc/systemd/system/gunicorn_django.service +2025-08-28 22:27:32.587 | ERROR | threads:run:907 - 服务状态查询失败: [sudo] password for xiaji: +2025-08-28 22:27:32.588 | ERROR | gunicorn_tab:on_manage_service_result:459 - 服务操作失败: [sudo] password for xiaji: +2025-08-28 22:27:52.590 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django +2025-08-28 22:27:52.599 | INFO | threads:run:889 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 703 Aug 28 22:27 /etc/systemd/system/gunicorn_django.service +2025-08-28 22:27:52.670 | ERROR | threads:run:907 - 服务状态查询失败: [sudo] password for xiaji: +2025-08-28 22:27:52.671 | ERROR | gunicorn_tab:on_manage_service_result:459 - 服务操作失败: [sudo] password for xiaji: diff --git a/app.log b/app.log index aaa2968..729e27e 100644 --- a/app.log +++ b/app.log @@ -1,410 +1,117 @@ -2025-08-27 22:29:13.339 | INFO | __main__::2691 - 应用程序启动 -2025-08-27 22:29:13.376 | INFO | __main__:load_git_config:1257 - 已加载服务器 测试服务器(192.168.3.157) 的git配置 -2025-08-27 22:29:13.377 | INFO | __main__:load_django_config:1899 - 已加载服务器 测试服务器(192.168.3.157) 的Django配置 -2025-08-27 22:29:13.379 | INFO | __main__:load_gunicorn_config:2576 - 已加载服务器 测试服务器(192.168.3.157) 的Gunicorn配置 -2025-08-27 22:29:15.654 | INFO | __main__:on_tab_changed:2684 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-27 22:29:16.159 | WARNING | __main__:check_service_status:2587 - 未连接服务器,跳过Gunicorn服务状态检测 -2025-08-27 22:29:20.590 | INFO | __main__:run:69 - 尝试连接服务器: 192.168.3.157:22 -2025-08-27 22:29:20.678 | INFO | __main__:run:75 - 服务器连接成功 -2025-08-27 22:29:21.205 | INFO | __main__:on_tab_changed:2684 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-27 22:29:21.708 | INFO | __main__:check_service_status:2584 - 自动检测Gunicorn服务状态 -2025-08-27 22:29:21.708 | INFO | __main__:manage_service:2417 - 开始管理Gunicorn服务,操作: status -2025-08-27 22:29:21.947 | INFO | __main__:manage_service:2437 - ManageGunicornServiceThread已启动,操作: status -2025-08-27 22:29:21.954 | INFO | __main__:run:2075 - 开始执行Gunicorn服务操作: status -2025-08-27 22:29:26.166 | INFO | __main__:show_service_password_dialog:2469 - 用户已输入sudo密码 -2025-08-27 22:29:26.185 | DEBUG | __main__:run:2087 - 准备执行命令: sudo -S systemctl status gunicorn -2025-08-27 22:29:26.787 | DEBUG | __main__:run:2101 - 正在传递sudo密码... -2025-08-27 22:29:26.788 | DEBUG | __main__:run:2104 - 密码传递完成,等待命令执行... -2025-08-27 22:29:56.835 | ERROR | __main__:run:2119 - 命令执行超时: sudo -S systemctl status gunicorn -2025-08-27 22:30:37.721 | INFO | __main__:on_tab_changed:2684 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-27 22:30:38.215 | INFO | __main__:check_service_status:2584 - 自动检测Gunicorn服务状态 -2025-08-27 22:30:38.216 | INFO | __main__:manage_service:2417 - 开始管理Gunicorn服务,操作: status -2025-08-27 22:30:38.218 | INFO | __main__:manage_service:2437 - ManageGunicornServiceThread已启动,操作: status -2025-08-27 22:30:38.220 | INFO | __main__:run:2075 - 开始执行Gunicorn服务操作: status -2025-08-27 22:30:41.127 | INFO | __main__:show_service_password_dialog:2469 - 用户已输入sudo密码 -2025-08-27 22:30:41.134 | DEBUG | __main__:run:2087 - 准备执行命令: sudo -S systemctl status gunicorn -2025-08-27 22:30:41.727 | DEBUG | __main__:run:2101 - 正在传递sudo密码... -2025-08-27 22:30:41.727 | DEBUG | __main__:run:2104 - 密码传递完成,等待命令执行... -2025-08-27 22:31:11.761 | ERROR | __main__:run:2119 - 命令执行超时: sudo -S systemctl status gunicorn -2025-08-28 20:04:06.090 | INFO | __main__::2691 - 应用程序启动 -2025-08-28 20:04:06.159 | INFO | __main__:load_git_config:1257 - 已加载服务器 测试服务器(192.168.3.157) 的git配置 -2025-08-28 20:04:06.160 | INFO | __main__:load_django_config:1899 - 已加载服务器 测试服务器(192.168.3.157) 的Django配置 -2025-08-28 20:04:06.161 | INFO | __main__:load_gunicorn_config:2576 - 已加载服务器 测试服务器(192.168.3.157) 的Gunicorn配置 -2025-08-28 20:04:07.908 | INFO | __main__:run:69 - 尝试连接服务器: 192.168.3.157:22 -2025-08-28 20:04:08.017 | INFO | __main__:run:75 - 服务器连接成功 -2025-08-28 20:04:11.660 | INFO | __main__:on_tab_changed:2684 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 20:04:12.159 | INFO | __main__:check_service_status:2584 - 自动检测Gunicorn服务状态 -2025-08-28 20:04:12.159 | INFO | __main__:manage_service:2417 - 开始管理Gunicorn服务,操作: status -2025-08-28 20:04:12.161 | INFO | __main__:manage_service:2437 - ManageGunicornServiceThread已启动,操作: status -2025-08-28 20:04:12.162 | INFO | __main__:run:2075 - 开始执行Gunicorn服务操作: status -2025-08-28 20:04:15.634 | INFO | __main__:show_service_password_dialog:2469 - 用户已输入sudo密码 -2025-08-28 20:04:15.686 | DEBUG | __main__:run:2087 - 准备执行命令: sudo -S systemctl status gunicorn -2025-08-28 20:04:16.326 | DEBUG | __main__:run:2101 - 正在传递sudo密码... -2025-08-28 20:04:16.327 | DEBUG | __main__:run:2104 - 密码传递完成,等待命令执行... -2025-08-28 20:28:50.493 | INFO | __main__::114 - 应用程序启动 -2025-08-28 20:32:04.868 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 20:32:06.089 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 20:32:06.620 | ERROR | gunicorn_tab:on_manage_service_result:270 - 服务操作失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper -sudo: a password is required - -2025-08-28 20:32:06.620 | ERROR | threads:run:808 - 服务状态查询失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper -sudo: a password is required - -2025-08-28 20:32:29.596 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 20:32:30.115 | ERROR | threads:run:808 - 服务状态查询失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper -sudo: a password is required - -2025-08-28 20:32:30.115 | ERROR | gunicorn_tab:on_manage_service_result:270 - 服务操作失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper -sudo: a password is required - -2025-08-28 20:35:01.275 | ERROR | threads:run:808 - 服务状态查询失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper -sudo: a password is required - -2025-08-28 20:35:01.275 | ERROR | gunicorn_tab:on_manage_service_result:270 - 服务操作失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper -sudo: a password is required - -2025-08-28 20:37:01.109 | INFO | __main__::114 - 应用程序启动 -2025-08-28 20:41:24.800 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 20:51:01.943 | INFO | __main__::114 - 应用程序启动 -2025-08-28 20:51:04.428 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 20:51:05.201 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 20:51:05.730 | ERROR | threads:run:836 - 服务状态查询失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper -sudo: a password is required - -2025-08-28 20:51:05.734 | ERROR | gunicorn_tab:on_manage_service_result:285 - 服务操作失败: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper -sudo: a password is required - -2025-08-28 20:52:55.800 | INFO | __main__::114 - 应用程序启动 -2025-08-28 20:52:58.689 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 20:52:59.622 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 20:53:05.630 | ERROR | threads:run:836 - 服务状态查询失败: [sudo] password for xiaji: Unit django_gunicorn.service could not be found. - -2025-08-28 20:53:05.631 | ERROR | gunicorn_tab:on_manage_service_result:338 - 服务操作失败: [sudo] password for xiaji: Unit django_gunicorn.service could not be found. - -2025-08-28 20:54:39.385 | INFO | __main__::114 - 应用程序启动 -2025-08-28 20:54:45.328 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 20:54:46.326 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 20:54:53.497 | INFO | threads:run:862 - 执行服务管理命令: systemctl status django_gunicorn -2025-08-28 20:54:53.505 | ERROR | threads:run:871 - 服务文件不存在: /etc/systemd/system/django_gunicorn.service, 错误: ls: cannot access '/etc/systemd/system/django_gunicorn.service': No such file or directory - -2025-08-28 20:54:53.507 | ERROR | gunicorn_tab:on_manage_service_result:338 - 服务操作失败: 服务文件不存在: django_gunicorn.service -2025-08-28 21:00:17.337 | INFO | remote_command_tab:on_list_directory_result:186 - 目录列表成功 -2025-08-28 21:00:17.337 | INFO | threads:run:157 - 目录列表成功: /home/xiaji/ -2025-08-28 21:00:56.560 | ERROR | threads:run:559 - Django项目不存在: /home/xiaji/statuspage -2025-08-28 21:00:56.560 | ERROR | django_tab:on_check_django_status_result:274 - Django状态检查失败: Django项目不存在: /home/xiaji/statuspage -2025-08-28 21:01:14.969 | INFO | threads:run:157 - 目录列表成功: /home/xiaji/ -2025-08-28 21:01:14.969 | INFO | remote_command_tab:on_list_directory_result:186 - 目录列表成功 -2025-08-28 21:01:28.149 | ERROR | threads:run:559 - Django项目不存在: /home/xiaji/statuspage/ -2025-08-28 21:01:28.149 | ERROR | django_tab:on_check_django_status_result:274 - Django状态检查失败: Django项目不存在: /home/xiaji/statuspage/ -2025-08-28 21:01:32.368 | ERROR | threads:run:363 - Django项目不存在: /home/xiaji/statuspage/ -2025-08-28 21:01:32.370 | ERROR | django_tab:on_test_django_result:167 - Django测试启动失败: Django项目不存在: /home/xiaji/statuspage/ -2025-08-28 21:01:36.279 | INFO | threads:run:304 - Django已安装: 5.2.5 -2025-08-28 21:01:36.280 | INFO | django_tab:on_install_django_result:135 - Django安装成功: Django已安装: 5.2.5 -2025-08-28 21:01:39.699 | ERROR | threads:run:363 - Django项目不存在: /home/xiaji/statuspage/ -2025-08-28 21:01:39.700 | ERROR | django_tab:on_test_django_result:167 - Django测试启动失败: Django项目不存在: /home/xiaji/statuspage/ -2025-08-28 21:02:37.594 | INFO | server_connection_tab:save_config:34 - 配置文件保存成功 -2025-08-28 21:02:47.403 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:03:06.423 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 21:03:13.531 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:03:18.362 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 21:06:04.148 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:06:04.183 | ERROR | remote_command_tab:load_git_config:113 - 加载git配置失败: [Errno 2] No such file or directory: 'C:\\Users\\xiaji\\Documents\\个人文件夹\\夏骥\\config.json' -2025-08-28 21:06:32.121 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:06:32.155 | ERROR | remote_command_tab:load_git_config:113 - 加载git配置失败: 'gbk' codec can't decode byte 0xa8 in position 56: illegal multibyte sequence -2025-08-28 21:06:47.698 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:06:47.729 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 21:06:52.075 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 21:08:17.090 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:08:17.130 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 21:08:17.131 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/statuspage -2025-08-28 21:12:20.285 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 21:12:28.603 | ERROR | django_tab:on_test_django_result:184 - Django测试启动失败: Django项目不存在: /home/xiaji/statuspage -2025-08-28 21:12:28.603 | ERROR | threads:run:363 - Django项目不存在: /home/xiaji/statuspage -2025-08-28 21:13:22.162 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:13:22.202 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 21:13:22.203 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/statuspage -2025-08-28 21:13:27.903 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 21:13:39.808 | ERROR | threads:run:363 - Django项目不存在: /home/xiaji/statuspage -2025-08-28 21:13:39.809 | ERROR | django_tab:on_test_django_result:184 - Django测试启动失败: Django项目不存在: /home/xiaji/statuspage -2025-08-28 21:13:48.684 | INFO | threads:run:157 - 目录列表成功: /home/xiaji/ -2025-08-28 21:13:48.688 | INFO | remote_command_tab:on_list_directory_result:199 - 目录列表成功 -2025-08-28 21:16:20.769 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:16:20.810 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 21:16:20.811 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/statuspage -2025-08-28 21:16:22.780 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 21:16:25.519 | ERROR | threads:run:363 - Django项目不存在: /home/xiaji/statuspage -2025-08-28 21:16:25.519 | ERROR | django_tab:on_test_django_result:184 - Django测试启动失败: Django项目不存在: /home/xiaji/statuspage -2025-08-28 21:16:29.049 | INFO | threads:run:157 - 目录列表成功: /home/xiaji/ -2025-08-28 21:16:29.051 | INFO | remote_command_tab:on_list_directory_result:199 - 目录列表成功: -total 176 -drwxr-x--- 9 xiaji xiaji 4096 Aug 27 20:52 . -drwxr-xr-x 3 root root 4096 Aug 27 04:10 .. -drwx------ 3 xiaji xiaji 4096 Aug 26 22:21 .cache --rw-rw-r-- 1 xiaji xiaji 135168 Aug 26 22:18 db.sqlite3 -drwxrwxr-x 8 xiaji xiaji 4096 Aug 26 22:18 .git -drwxrwxr-x 3 xiaji xiaji 4096 Aug 27 20:51 home -drwxrwxr-x 4 xiaji xiaji 4096 Aug 26 22:25 .local --rw-rw-r-- 1 xiaji xiaji 666 Aug 26 22:18 manage.py --rw-rw-r-- 1 xiaji xiaji 13 Aug 26 22:18 requirements.txt -drwxrwxr-x 3 xiaji xiaji 4096 Aug 27 20:52 static -drwxrwxr-x 5 xiaji xiaji 4096 Aug 26 22:18 status -drwxrwxr-x 3 xiaji xiaji 4096 Aug 28 04:20 statuspage --rw-r--r-- 1 xiaji xiaji 0 Aug 27 20:03 .sudo_as_admin_successful - -2025-08-28 21:17:03.711 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:17:03.777 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 21:17:03.782 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/statuspage -2025-08-28 21:17:09.386 | INFO | server_connection_tab:save_config:34 - 配置文件保存成功 -2025-08-28 21:17:11.652 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 21:17:16.174 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ -2025-08-28 21:17:18.319 | ERROR | django_tab:on_test_django_result:184 - Django测试启动失败: 依赖安装失败: error: externally-managed-environment - -× This environment is externally managed -╰─> To install Python packages system-wide, try apt install - python3-xyz, where xyz is the package you are trying to - install. - - If you wish to install a non-Debian-packaged Python package, - create a virtual environment using python3 -m venv path/to/venv. - Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make - sure you have python3-full installed. - - If you wish to install a non-Debian packaged Python application, - it may be easiest to use pipx install xyz, which will manage a - virtual environment for you. Make sure you have pipx installed. - - See /usr/share/doc/python3.12/README.venv for more information. - -note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. -hint: See PEP 668 for the detailed specification. - -2025-08-28 21:17:18.319 | ERROR | threads:run:381 - 依赖安装失败: error: externally-managed-environment - -× This environment is externally managed -╰─> To install Python packages system-wide, try apt install - python3-xyz, where xyz is the package you are trying to - install. - - If you wish to install a non-Debian-packaged Python package, - create a virtual environment using python3 -m venv path/to/venv. - Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make - sure you have python3-full installed. - - If you wish to install a non-Debian packaged Python application, - it may be easiest to use pipx install xyz, which will manage a - virtual environment for you. Make sure you have pipx installed. - - See /usr/share/doc/python3.12/README.venv for more information. - -note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. -hint: See PEP 668 for the detailed specification. - -2025-08-28 21:17:50.278 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:17:50.317 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 21:17:50.319 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ -2025-08-28 21:18:00.995 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 21:18:02.871 | INFO | threads:run:304 - Django已安装: 5.2.5 -2025-08-28 21:18:02.873 | INFO | django_tab:on_install_django_result:152 - Django安装成功: Django已安装: 5.2.5 -2025-08-28 21:19:24.402 | ERROR | threads:run:381 - 依赖安装失败: -2025-08-28 21:19:36.038 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:19:36.077 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 21:19:36.079 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ -2025-08-28 21:19:39.142 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 21:21:54.132 | INFO | server_connection_tab:save_config:34 - 配置文件保存成功 -2025-08-28 21:23:22.197 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:23:22.228 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 21:23:22.229 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ -2025-08-28 21:23:24.309 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 21:26:27.449 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:26:27.484 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 21:26:27.485 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ -2025-08-28 21:26:29.358 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 21:26:39.130 | INFO | threads:run:397 - Django测试服务器启动成功 -2025-08-28 21:26:39.131 | INFO | django_tab:on_test_django_result:181 - Django测试启动成功: Django测试服务器启动成功 -2025-08-28 21:26:52.767 | INFO | threads:run:598 - Django状态检查完成 -2025-08-28 21:26:52.786 | INFO | django_tab:on_check_django_status_result:288 - Django状态检查成功 -2025-08-28 21:26:56.002 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 21:27:03.503 | INFO | threads:run:867 - 执行服务管理命令: systemctl status django_gunicorn -2025-08-28 21:27:03.511 | ERROR | threads:run:876 - 服务文件不存在: /etc/systemd/system/django_gunicorn.service, 错误: ls: cannot access '/etc/systemd/system/django_gunicorn.service': No such file or directory - -2025-08-28 21:27:03.512 | ERROR | gunicorn_tab:on_manage_service_result:338 - 服务操作失败: 服务文件不存在: django_gunicorn.service -2025-08-28 21:27:54.858 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 21:28:00.516 | INFO | threads:run:867 - 执行服务管理命令: systemctl status django_gunicorn -2025-08-28 21:28:00.525 | ERROR | threads:run:876 - 服务文件不存在: /etc/systemd/system/django_gunicorn.service, 错误: ls: cannot access '/etc/systemd/system/django_gunicorn.service': No such file or directory - -2025-08-28 21:28:00.527 | ERROR | gunicorn_tab:on_manage_service_result:338 - 服务操作失败: 服务文件不存在: django_gunicorn.service -2025-08-28 21:28:02.915 | ERROR | threads:run:702 - wsgi.py文件不存在: /home/xiaji///wsgi.py -2025-08-28 21:28:02.916 | ERROR | gunicorn_tab:on_test_gunicorn_result:265 - Gunicorn测试失败: wsgi.py文件不存在: /home/xiaji///wsgi.py -2025-08-28 21:45:10.338 | INFO | __main__::114 - 应用程序启动 -2025-08-28 21:45:10.373 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 21:45:10.374 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ -2025-08-28 21:45:12.542 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 21:45:14.597 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 21:45:18.259 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django -2025-08-28 21:45:18.269 | ERROR | threads:run:884 - 服务文件不存在: /etc/systemd/system/gunicorn_django.service, 错误: ls: cannot access '/etc/systemd/system/gunicorn_django.service': No such file or directory - -2025-08-28 21:45:18.270 | ERROR | gunicorn_tab:on_manage_service_result:386 - 服务操作失败: 服务文件不存在: gunicorn_django.service -2025-08-28 21:45:26.168 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 21:45:30.745 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django -2025-08-28 21:45:30.754 | ERROR | threads:run:884 - 服务文件不存在: /etc/systemd/system/gunicorn_django.service, 错误: ls: cannot access '/etc/systemd/system/gunicorn_django.service': No such file or directory - -2025-08-28 21:45:30.755 | ERROR | gunicorn_tab:on_manage_service_result:386 - 服务操作失败: 服务文件不存在: gunicorn_django.service -2025-08-28 22:01:41.803 | INFO | __main__::114 - 应用程序启动 -2025-08-28 22:01:41.845 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 22:01:41.846 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ -2025-08-28 22:01:43.842 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 22:01:44.537 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 22:01:48.082 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django -2025-08-28 22:01:48.090 | ERROR | threads:run:884 - 服务文件不存在: /etc/systemd/system/gunicorn_django.service, 错误: ls: cannot access '/etc/systemd/system/gunicorn_django.service': No such file or directory - -2025-08-28 22:01:48.091 | ERROR | gunicorn_tab:on_manage_service_result:386 - 服务操作失败: 服务文件不存在: gunicorn_django.service -2025-08-28 22:01:55.720 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 22:01:59.324 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django -2025-08-28 22:01:59.333 | ERROR | threads:run:884 - 服务文件不存在: /etc/systemd/system/gunicorn_django.service, 错误: ls: cannot access '/etc/systemd/system/gunicorn_django.service': No such file or directory - -2025-08-28 22:01:59.334 | ERROR | gunicorn_tab:on_manage_service_result:386 - 服务操作失败: 服务文件不存在: gunicorn_django.service -2025-08-28 22:04:31.027 | INFO | __main__::114 - 应用程序启动 -2025-08-28 22:04:31.062 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 22:04:31.063 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ -2025-08-28 22:05:26.599 | INFO | __main__::114 - 应用程序启动 -2025-08-28 22:05:26.631 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 22:05:26.632 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ -2025-08-28 22:05:28.618 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 22:05:29.755 | INFO | __main__:on_tab_changed:107 - 切换到Gunicorn标签,自动检测服务状态 -2025-08-28 22:05:34.219 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django -2025-08-28 22:05:34.227 | ERROR | threads:run:884 - 服务文件不存在: /etc/systemd/system/gunicorn_django.service, 错误: ls: cannot access '/etc/systemd/system/gunicorn_django.service': No such file or directory - -2025-08-28 22:05:34.229 | ERROR | gunicorn_tab:on_manage_service_result:424 - 服务操作失败: 服务文件不存在: gunicorn_django.service -2025-08-28 22:06:09.440 | INFO | threads:run:756 - 准备上传服务文件: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:06:09.454 | INFO | threads:run:763 - 临时服务文件创建成功: /tmp/gunicorn_django.service -2025-08-28 22:06:09.477 | INFO | threads:run:781 - 服务文件移动成功: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:06:09.538 | INFO | threads:run:799 - 服务文件权限设置成功: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:06:09.590 | INFO | threads:run:807 - 服务文件验证成功: -rw-r--r-- 1 xiaji xiaji 705 Aug 28 22:06 /etc/systemd/system/gunicorn_django.service -2025-08-28 22:06:09.888 | INFO | threads:run:831 - systemd重新加载成功 -2025-08-28 22:06:10.453 | INFO | threads:run:839 - 服务被systemd识别: gunicorn_django.service disabled enabled -2025-08-28 22:06:10.454 | INFO | threads:run:847 - 服务文件上传成功: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:06:10.456 | INFO | gunicorn_tab:on_upload_service_result:373 - 服务文件上传成功: 服务文件上传成功: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:06:20.044 | INFO | threads:run:875 - 执行服务管理命令: systemctl restart gunicorn_django -2025-08-28 22:06:20.059 | INFO | threads:run:889 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 705 Aug 28 22:06 /etc/systemd/system/gunicorn_django.service -2025-08-28 22:06:20.139 | INFO | threads:run:920 - 服务restart成功: gunicorn_django -2025-08-28 22:06:20.140 | INFO | gunicorn_tab:on_manage_service_result:421 - 服务操作成功: 服务restart成功: gunicorn_django -2025-08-28 22:07:59.648 | INFO | __main__::109 - 应用程序启动 -2025-08-28 22:07:59.692 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 22:07:59.697 | INFO | django_tab:load_django_path:117 - 从配置文件加载django路径: /home/xiaji/ -2025-08-28 22:08:02.096 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 22:10:45.949 | INFO | __main__::109 - 应用程序启动 -2025-08-28 22:10:45.986 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 22:10:45.987 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/ -2025-08-28 22:10:45.987 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 -2025-08-28 22:10:53.292 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 22:13:07.349 | INFO | __main__::109 - 应用程序启动 -2025-08-28 22:13:07.387 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 22:13:07.388 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/ -2025-08-28 22:13:07.390 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 -2025-08-28 22:13:07.391 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 -2025-08-28 22:13:09.561 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 22:13:22.767 | INFO | threads:run:756 - 准备上传服务文件: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:13:22.782 | INFO | threads:run:763 - 临时服务文件创建成功: /tmp/gunicorn_django.service -2025-08-28 22:13:22.803 | INFO | threads:run:781 - 服务文件移动成功: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:13:22.865 | INFO | threads:run:799 - 服务文件权限设置成功: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:13:22.917 | INFO | threads:run:807 - 服务文件验证成功: -rw-r--r-- 1 xiaji xiaji 778 Aug 28 22:13 /etc/systemd/system/gunicorn_django.service -2025-08-28 22:13:23.219 | INFO | threads:run:831 - systemd重新加载成功 -2025-08-28 22:13:23.845 | INFO | threads:run:839 - 服务被systemd识别: gunicorn_django.service disabled enabled -2025-08-28 22:13:23.846 | INFO | threads:run:847 - 服务文件上传成功: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:13:23.847 | INFO | gunicorn_tab:on_upload_service_result:377 - 服务文件上传成功: 服务文件上传成功: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:13:28.149 | INFO | threads:run:875 - 执行服务管理命令: systemctl restart gunicorn_django -2025-08-28 22:13:28.158 | INFO | threads:run:889 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 778 Aug 28 22:13 /etc/systemd/system/gunicorn_django.service -2025-08-28 22:13:28.228 | INFO | threads:run:920 - 服务restart成功: gunicorn_django -2025-08-28 22:13:28.230 | INFO | gunicorn_tab:on_manage_service_result:425 - 服务操作成功: 服务restart成功: gunicorn_django -2025-08-28 22:15:05.213 | INFO | __main__::109 - 应用程序启动 -2025-08-28 22:15:05.248 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 22:15:05.249 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/ -2025-08-28 22:15:05.249 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 -2025-08-28 22:15:05.250 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 -2025-08-28 22:15:08.328 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 22:18:00.966 | INFO | __main__::109 - 应用程序启动 -2025-08-28 22:18:01.005 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 22:18:01.007 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/ -2025-08-28 22:18:01.007 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 -2025-08-28 22:18:01.008 | INFO | gunicorn_tab:load_gunicorn_config:175 - 从当前服务器配置加载Gunicorn配置: django_path=/home/xiaji/, project_name=statuspage -2025-08-28 22:18:01.009 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 -2025-08-28 22:18:03.033 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 22:18:10.456 | INFO | threads:run:707 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py +2025-08-29 20:42:22.374 | INFO | __main__::109 - 应用程序启动 +2025-08-29 20:42:22.446 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-29 20:42:22.447 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/statuspage +2025-08-29 20:42:22.448 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-29 20:42:22.449 | INFO | gunicorn_tab:load_gunicorn_config:175 - 从当前服务器配置加载Gunicorn配置: django_path=/home/xiaji/statuspage, project_name=statuspage +2025-08-29 20:42:22.450 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-29 20:43:31.191 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-29 20:43:33.025 | ERROR | threads:run:689 - Django项目不存在: /home/xiaji/statuspage +2025-08-29 20:43:33.026 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Django项目不存在: /home/xiaji/statuspage +2025-08-29 20:43:39.899 | INFO | threads:run:707 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py /home/xiaji/.local/lib/python3.12/site-packages/django/core/handlers/wsgi.py /home/xiaji/.local/lib/python3.12/site-packages/django/core/wsgi.py /home/xiaji/.local/lib/python3.12/site-packages/asgiref/wsgi.py -2025-08-28 22:18:15.531 | ERROR | threads:run:732 - Gunicorn测试失败 -2025-08-28 22:18:15.531 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Gunicorn测试失败 -2025-08-28 22:18:21.513 | INFO | threads:run:707 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py +2025-08-29 20:43:44.986 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Gunicorn测试失败 +2025-08-29 20:43:44.988 | ERROR | threads:run:732 - Gunicorn测试失败 +2025-08-29 20:44:02.266 | INFO | threads:run:707 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py /home/xiaji/.local/lib/python3.12/site-packages/django/core/handlers/wsgi.py /home/xiaji/.local/lib/python3.12/site-packages/django/core/wsgi.py /home/xiaji/.local/lib/python3.12/site-packages/asgiref/wsgi.py -2025-08-28 22:18:26.582 | ERROR | threads:run:732 - Gunicorn测试失败 -2025-08-28 22:18:26.585 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Gunicorn测试失败 -2025-08-28 22:20:04.518 | INFO | __main__::109 - 应用程序启动 -2025-08-28 22:20:04.553 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 22:20:04.556 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/statuspage -2025-08-28 22:20:04.556 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 -2025-08-28 22:20:04.558 | INFO | gunicorn_tab:load_gunicorn_config:175 - 从当前服务器配置加载Gunicorn配置: django_path=/home/xiaji/statuspage, project_name=statuspage -2025-08-28 22:20:04.559 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 -2025-08-28 22:20:12.042 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 22:20:15.094 | ERROR | threads:run:689 - Django项目不存在: /home/xiaji/statuspage -2025-08-28 22:20:15.095 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Django项目不存在: /home/xiaji/statuspage -2025-08-28 22:20:24.016 | INFO | threads:run:707 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py +2025-08-29 20:44:07.337 | ERROR | threads:run:732 - Gunicorn测试失败 +2025-08-29 20:44:07.339 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Gunicorn测试失败 +2025-08-29 20:45:36.393 | INFO | __main__::109 - 应用程序启动 +2025-08-29 20:45:36.429 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-29 20:45:36.430 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/statuspage +2025-08-29 20:45:36.430 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-29 20:45:36.431 | INFO | gunicorn_tab:load_gunicorn_config:175 - 从当前服务器配置加载Gunicorn配置: django_path=/home/xiaji/statuspage, project_name=statuspage +2025-08-29 20:45:36.432 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-29 20:45:38.281 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-29 20:58:02.111 | INFO | __main__::109 - 应用程序启动 +2025-08-29 20:58:02.147 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-29 20:58:02.148 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/statuspage +2025-08-29 20:58:02.149 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-29 20:58:02.150 | INFO | gunicorn_tab:load_gunicorn_config:176 - 从当前服务器配置加载Gunicorn配置: remote_directory=/home/xiaji/, project_name=statuspage +2025-08-29 20:58:02.151 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-29 20:58:04.133 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-29 20:58:08.184 | INFO | threads:run:707 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py /home/xiaji/.local/lib/python3.12/site-packages/django/core/handlers/wsgi.py /home/xiaji/.local/lib/python3.12/site-packages/django/core/wsgi.py /home/xiaji/.local/lib/python3.12/site-packages/asgiref/wsgi.py -2025-08-28 22:20:59.164 | INFO | __main__::109 - 应用程序启动 -2025-08-28 22:20:59.201 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 22:20:59.203 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/statuspage -2025-08-28 22:20:59.203 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 -2025-08-28 22:20:59.204 | INFO | gunicorn_tab:load_gunicorn_config:175 - 从当前服务器配置加载Gunicorn配置: django_path=/home/xiaji/statuspage, project_name=statuspage -2025-08-28 22:20:59.204 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 -2025-08-28 22:21:00.318 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 22:21:07.110 | ERROR | threads:run:689 - Django项目不存在: /home/xiaji/statuspage -2025-08-28 22:21:07.112 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Django项目不存在: /home/xiaji/statuspage -2025-08-28 22:24:30.595 | INFO | __main__::109 - 应用程序启动 -2025-08-28 22:24:30.635 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 22:24:30.636 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/statuspage -2025-08-28 22:24:30.636 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 -2025-08-28 22:24:30.637 | INFO | gunicorn_tab:load_gunicorn_config:175 - 从当前服务器配置加载Gunicorn配置: django_path=/home/xiaji/statuspage, project_name=statuspage -2025-08-28 22:24:30.638 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 -2025-08-28 22:24:32.673 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 22:26:19.189 | INFO | __main__::109 - 应用程序启动 -2025-08-28 22:26:19.228 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ -2025-08-28 22:26:19.229 | INFO | django_tab:load_django_path:115 - 从当前服务器配置加载django路径: /home/xiaji/statuspage -2025-08-28 22:26:19.229 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 -2025-08-28 22:26:19.231 | INFO | gunicorn_tab:load_gunicorn_config:175 - 从当前服务器配置加载Gunicorn配置: django_path=/home/xiaji/statuspage, project_name=statuspage -2025-08-28 22:26:19.231 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 -2025-08-28 22:26:25.092 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 -2025-08-28 22:26:31.515 | INFO | threads:run:707 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py -/home/xiaji/.local/lib/python3.12/site-packages/django/core/handlers/wsgi.py -/home/xiaji/.local/lib/python3.12/site-packages/django/core/wsgi.py -/home/xiaji/.local/lib/python3.12/site-packages/asgiref/wsgi.py -2025-08-28 22:26:36.591 | ERROR | threads:run:732 - Gunicorn测试失败 -2025-08-28 22:26:36.592 | ERROR | gunicorn_tab:on_test_gunicorn_result:367 - Gunicorn测试失败: Gunicorn测试失败 -2025-08-28 22:27:18.620 | INFO | threads:run:756 - 准备上传服务文件: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:27:18.634 | INFO | threads:run:763 - 临时服务文件创建成功: /tmp/gunicorn_django.service -2025-08-28 22:27:18.654 | INFO | threads:run:781 - 服务文件移动成功: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:27:18.717 | INFO | threads:run:799 - 服务文件权限设置成功: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:27:18.768 | INFO | threads:run:807 - 服务文件验证成功: -rw-r--r-- 1 xiaji xiaji 703 Aug 28 22:27 /etc/systemd/system/gunicorn_django.service -2025-08-28 22:27:19.090 | INFO | threads:run:831 - systemd重新加载成功 -2025-08-28 22:27:19.712 | INFO | threads:run:839 - 服务被systemd识别: gunicorn_django.service disabled enabled -2025-08-28 22:27:19.714 | INFO | threads:run:847 - 服务文件上传成功: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:27:19.715 | INFO | gunicorn_tab:on_upload_service_result:408 - 服务文件上传成功: 服务文件上传成功: /etc/systemd/system/gunicorn_django.service -2025-08-28 22:27:24.287 | INFO | threads:run:875 - 执行服务管理命令: systemctl restart gunicorn_django -2025-08-28 22:27:24.295 | INFO | threads:run:889 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 703 Aug 28 22:27 /etc/systemd/system/gunicorn_django.service -2025-08-28 22:27:24.366 | INFO | threads:run:920 - 服务restart成功: gunicorn_django -2025-08-28 22:27:24.367 | INFO | gunicorn_tab:on_manage_service_result:456 - 服务操作成功: 服务restart成功: gunicorn_django -2025-08-28 22:27:28.045 | INFO | threads:run:875 - 执行服务管理命令: systemctl enable gunicorn_django -2025-08-28 22:27:28.054 | INFO | threads:run:889 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 703 Aug 28 22:27 /etc/systemd/system/gunicorn_django.service -2025-08-28 22:27:28.368 | INFO | threads:run:920 - 服务enable成功: gunicorn_django -2025-08-28 22:27:28.371 | INFO | gunicorn_tab:on_manage_service_result:456 - 服务操作成功: 服务enable成功: gunicorn_django -2025-08-28 22:27:32.509 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django -2025-08-28 22:27:32.518 | INFO | threads:run:889 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 703 Aug 28 22:27 /etc/systemd/system/gunicorn_django.service -2025-08-28 22:27:32.587 | ERROR | threads:run:907 - 服务状态查询失败: [sudo] password for xiaji: -2025-08-28 22:27:32.588 | ERROR | gunicorn_tab:on_manage_service_result:459 - 服务操作失败: [sudo] password for xiaji: -2025-08-28 22:27:52.590 | INFO | threads:run:875 - 执行服务管理命令: systemctl status gunicorn_django -2025-08-28 22:27:52.599 | INFO | threads:run:889 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 703 Aug 28 22:27 /etc/systemd/system/gunicorn_django.service -2025-08-28 22:27:52.670 | ERROR | threads:run:907 - 服务状态查询失败: [sudo] password for xiaji: -2025-08-28 22:27:52.671 | ERROR | gunicorn_tab:on_manage_service_result:459 - 服务操作失败: [sudo] password for xiaji: +2025-08-29 20:58:13.252 | ERROR | threads:run:732 - Gunicorn测试失败 +2025-08-29 20:58:13.253 | ERROR | gunicorn_tab:on_test_gunicorn_result:369 - Gunicorn测试失败: Gunicorn测试失败 +2025-08-29 21:05:36.603 | INFO | __main__::109 - 应用程序启动 +2025-08-29 21:05:36.640 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-29 21:05:36.641 | INFO | django_tab:load_django_path:116 - 从当前服务器配置加载Django路径: /home/xiaji/ +2025-08-29 21:05:36.641 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-29 21:05:36.643 | INFO | gunicorn_tab:load_gunicorn_config:176 - 从当前服务器配置加载Gunicorn配置: remote_directory=/home/xiaji/, project_name=statuspage +2025-08-29 21:05:36.643 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-29 21:05:39.899 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-29 21:05:42.658 | INFO | threads:run:705 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py +2025-08-29 21:05:45.780 | INFO | threads:run:736 - Gunicorn测试成功 - 项目: statuspage +2025-08-29 21:05:45.781 | INFO | gunicorn_tab:on_test_gunicorn_result:366 - Gunicorn测试成功: Gunicorn测试成功 - 项目: statuspage +2025-08-29 21:07:44.908 | INFO | threads:run:893 - 执行服务管理命令: systemctl status gunicorn_django +2025-08-29 21:07:44.919 | INFO | threads:run:907 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 703 Aug 28 22:27 /etc/systemd/system/gunicorn_django.service +2025-08-29 21:07:44.989 | ERROR | threads:run:925 - 服务状态查询失败: [sudo] password for xiaji: +2025-08-29 21:07:44.991 | ERROR | gunicorn_tab:on_manage_service_result:461 - 服务操作失败: [sudo] password for xiaji: +2025-08-29 21:07:54.449 | INFO | threads:run:705 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py +2025-08-29 21:07:57.568 | INFO | threads:run:736 - Gunicorn测试成功 - 项目: statuspage +2025-08-29 21:07:57.570 | INFO | gunicorn_tab:on_test_gunicorn_result:366 - Gunicorn测试成功: Gunicorn测试成功 - 项目: statuspage +2025-08-29 21:10:40.320 | INFO | __main__::109 - 应用程序启动 +2025-08-29 21:10:40.356 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-29 21:10:40.357 | INFO | django_tab:load_django_path:116 - 从当前服务器配置加载Django路径: /home/xiaji/ +2025-08-29 21:10:40.358 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-29 21:10:40.359 | INFO | gunicorn_tab:load_gunicorn_config:176 - 从当前服务器配置加载Gunicorn配置: remote_directory=/home/xiaji/, project_name=statuspage +2025-08-29 21:10:40.360 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-29 21:10:43.746 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-29 21:11:11.413 | INFO | __main__::109 - 应用程序启动 +2025-08-29 21:11:11.449 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-29 21:11:11.450 | INFO | django_tab:load_django_path:116 - 从当前服务器配置加载Django路径: /home/xiaji/ +2025-08-29 21:11:11.450 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-29 21:11:11.452 | INFO | gunicorn_tab:load_gunicorn_config:176 - 从当前服务器配置加载Gunicorn配置: remote_directory=/home/xiaji/, project_name=statuspage +2025-08-29 21:11:11.452 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-29 21:11:15.075 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-29 21:11:23.009 | INFO | threads:run:705 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py +2025-08-29 21:11:26.135 | INFO | threads:run:736 - Gunicorn测试成功 - 项目: statuspage +2025-08-29 21:11:26.138 | INFO | gunicorn_tab:on_test_gunicorn_result:366 - Gunicorn测试成功: Gunicorn测试成功 - 项目: statuspage +2025-08-29 21:11:34.061 | INFO | __main__::109 - 应用程序启动 +2025-08-29 21:11:34.111 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-29 21:11:34.116 | INFO | django_tab:load_django_path:116 - 从当前服务器配置加载Django路径: /home/xiaji/ +2025-08-29 21:11:34.116 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-29 21:11:34.117 | INFO | gunicorn_tab:load_gunicorn_config:176 - 从当前服务器配置加载Gunicorn配置: remote_directory=/home/xiaji/, project_name=statuspage +2025-08-29 21:11:34.117 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-29 21:11:35.906 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-29 21:12:40.129 | INFO | __main__::109 - 应用程序启动 +2025-08-29 21:12:40.172 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-29 21:12:40.173 | INFO | django_tab:load_django_path:116 - 从当前服务器配置加载Django路径: /home/xiaji/ +2025-08-29 21:12:40.174 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-29 21:12:40.175 | INFO | gunicorn_tab:load_gunicorn_config:176 - 从当前服务器配置加载Gunicorn配置: remote_directory=/home/xiaji/, project_name=statuspage +2025-08-29 21:12:40.175 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-29 21:12:48.825 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-29 21:13:17.233 | INFO | __main__::109 - 应用程序启动 +2025-08-29 21:13:17.275 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-29 21:13:17.276 | INFO | django_tab:load_django_path:116 - 从当前服务器配置加载Django路径: /home/xiaji/ +2025-08-29 21:13:17.276 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-29 21:13:17.278 | INFO | gunicorn_tab:load_gunicorn_config:176 - 从当前服务器配置加载Gunicorn配置: remote_directory=/home/xiaji/, project_name=statuspage +2025-08-29 21:13:17.278 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-29 21:13:21.982 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-29 21:14:49.662 | INFO | __main__::109 - 应用程序启动 +2025-08-29 21:14:49.720 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-29 21:14:49.722 | INFO | django_tab:load_django_path:116 - 从当前服务器配置加载Django路径: /home/xiaji/ +2025-08-29 21:14:49.722 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-29 21:14:49.727 | INFO | gunicorn_tab:load_gunicorn_config:191 - 从当前服务器配置加载Gunicorn配置: remote_directory=/home/xiaji/, project_name=statuspage +2025-08-29 21:14:49.728 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-29 21:14:51.215 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-29 21:17:34.243 | INFO | __main__::109 - 应用程序启动 +2025-08-29 21:17:34.283 | INFO | remote_command_tab:load_git_config:109 - 从配置文件加载git配置: git_url=http://192.168.3.241:3000/xiaji/webstatus, project_path=/home/xiaji/ +2025-08-29 21:17:34.284 | INFO | django_tab:load_django_path:116 - 从当前服务器配置加载Django路径: /home/xiaji/ +2025-08-29 21:17:34.285 | INFO | django_tab:__init__:22 - Django标签已连接到服务器切换信号 +2025-08-29 21:17:34.289 | INFO | gunicorn_tab:load_gunicorn_config:191 - 从当前服务器配置加载Gunicorn配置: remote_directory=/home/xiaji/, project_name=statuspage +2025-08-29 21:17:34.289 | INFO | gunicorn_tab:__init__:50 - Gunicorn标签已连接到服务器切换信号 +2025-08-29 21:17:36.637 | INFO | threads:run:47 - SSH连接成功: 192.168.3.157 +2025-08-29 21:17:52.841 | INFO | threads:run:705 - 找到wsgi.py文件: /home/xiaji/statuspage/wsgi.py +2025-08-29 21:17:55.956 | INFO | threads:run:736 - Gunicorn测试成功 - 项目: statuspage +2025-08-29 21:17:55.958 | INFO | gunicorn_tab:on_test_gunicorn_result:381 - Gunicorn测试成功: Gunicorn测试成功 - 项目: statuspage +2025-08-29 21:18:18.740 | INFO | threads:run:893 - 执行服务管理命令: systemctl status gunicorn_django +2025-08-29 21:18:18.748 | INFO | threads:run:907 - 服务文件存在: -rw-r--r-- 1 xiaji xiaji 703 Aug 28 22:27 /etc/systemd/system/gunicorn_django.service +2025-08-29 21:18:18.818 | ERROR | threads:run:925 - 服务状态查询失败: [sudo] password for xiaji: +2025-08-29 21:18:18.819 | ERROR | gunicorn_tab:on_manage_service_result:476 - 服务操作失败: [sudo] password for xiaji: diff --git a/django_tab.py b/django_tab.py index 2c1487d..22799f7 100644 --- a/django_tab.py +++ b/django_tab.py @@ -105,14 +105,15 @@ class DjangoTab(QWidget): self.load_django_path() def load_django_path(self): - """从当前服务器配置加载Django路径""" + """从config.json加载Django路径""" try: if self.parent and hasattr(self.parent, 'get_current_config'): config = self.parent.get_current_config() if config: - django_path = config.get('django_path', '') + # 使用remote_directory而不是django_path + django_path = config.get('remote_directory', '') self.django_path_input.setText(django_path) - logger.info(f"从当前服务器配置加载django路径: {django_path}") + logger.info(f"从当前服务器配置加载Django路径: {django_path}") else: logger.warning("未找到当前服务器配置") else: @@ -123,11 +124,12 @@ class DjangoTab(QWidget): if config and 'servers' in config and len(config['servers']) > 0: server_config = config['servers'][0] - django_path = server_config.get('django_path', '') + # 使用remote_directory + django_path = server_config.get('remote_directory', '') self.django_path_input.setText(django_path) - logger.info(f"从配置文件加载django路径: {django_path}") + logger.info(f"从配置文件加载Django路径: {django_path}") except Exception as e: - logger.error(f"加载django路径失败: {str(e)}") + logger.error(f"加载Django路径失败: {str(e)}") # 不显示警告,避免影响用户体验 QMessageBox.warning(self, "警告", f"加载django路径失败: {str(e)}") diff --git a/gunicorn_tab.py b/gunicorn_tab.py index 1cc5e6f..253d952 100644 --- a/gunicorn_tab.py +++ b/gunicorn_tab.py @@ -146,6 +146,21 @@ class GunicornTab(QWidget): output_group.setLayout(output_layout) layout.addWidget(output_group) + # 日志查看组 + log_group = QGroupBox("日志查看") + log_layout = QGridLayout() + + self.view_access_log_btn = QPushButton("查看访问日志") + self.view_access_log_btn.clicked.connect(self.view_access_log) + log_layout.addWidget(self.view_access_log_btn, 0, 0) + + self.view_error_log_btn = QPushButton("查看错误日志") + self.view_error_log_btn.clicked.connect(self.view_error_log) + log_layout.addWidget(self.view_error_log_btn, 0, 1) + + log_group.setLayout(log_layout) + layout.addWidget(log_group) + layout.addStretch() self.setLayout(layout) @@ -158,7 +173,8 @@ class GunicornTab(QWidget): if self.parent and hasattr(self.parent, 'get_current_config'): config = self.parent.get_current_config() if config: - django_path = config.get('django_path', '') + # 使用remote_directory而不是django_path + django_path = config.get('remote_directory', '') project_name = config.get('project_name', 'myproject') username = config.get('username', 'www-data') @@ -172,7 +188,7 @@ class GunicornTab(QWidget): service_content = self.generate_service_file_from_config(config) self.service_editor.setText(service_content) - logger.info(f"从当前服务器配置加载Gunicorn配置: django_path={django_path}, project_name={project_name}") + logger.info(f"从当前服务器配置加载Gunicorn配置: remote_directory={django_path}, project_name={project_name}") else: logger.warning("未找到当前服务器配置") else: @@ -183,6 +199,7 @@ class GunicornTab(QWidget): if config and 'servers' in config and len(config['servers']) > 0: server_config = config['servers'][0] + # 使用remote_directory django_path = server_config.get('remote_directory', '') project_name = server_config.get('project_name', 'myproject') username = server_config.get('username', 'www-data') @@ -197,7 +214,7 @@ class GunicornTab(QWidget): service_content = self.generate_service_file_from_config(server_config) self.service_editor.setText(service_content) - logger.info(f"从配置文件加载Gunicorn配置: django_path={django_path}, project_name={project_name}") + logger.info(f"从配置文件加载Gunicorn配置: remote_directory={django_path}, project_name={project_name}") except Exception as e: logger.error(f"加载Gunicorn配置失败: {str(e)}") # 不显示警告,避免影响用户体验 @@ -209,7 +226,7 @@ class GunicornTab(QWidget): django_path = config.get('remote_directory', '/home/user') # 构建完整的项目路径 - project_path = f"{django_path.rstrip('/')}/{project_name}" + project_path = f"{django_path.rstrip('/')}" return f"""[Unit] Description=Gunicorn daemon for {project_name} @@ -478,4 +495,118 @@ WantedBy=multi-user.target""" # 使用gunicorn_[project_name].service格式作为服务名称 service_name = f"gunicorn_{project_name}" - self.manage_service("status") \ No newline at end of file + self.manage_service("status") + + def view_access_log(self): + """查看Gunicorn访问日志""" + if not self.check_ssh_connection(): + return + + # 获取config.json中的配置信息 + config = None + if self.parent and hasattr(self.parent, 'server_connection_tab'): + config = self.parent.server_connection_tab.get_current_config() + + if config: + project_path = config.get('remote_directory', '/home/xiaji') + else: + project_path = '/home/xiaji' + + # 使用动态路径 + access_log_path = f"{project_path.rstrip('/')}/logs/gunicorn_access.log" + + self.output_text.append(f"正在查看访问日志: {access_log_path}") + + # 获取密码 + password = self.get_password() + if password is None: + return + + try: + # 首先检查日志文件是否存在,如果不存在则创建 + log_dir = f"{project_path.rstrip('/')}/logs" + check_command = f"sudo test -f {access_log_path} || (sudo mkdir -p {log_dir} && sudo touch {access_log_path} && sudo chmod 644 {access_log_path})" + stdin, stdout, stderr = self.parent.ssh_client.exec_command(check_command) + stdin.write(password + '\n') + stdin.flush() + + # 使用tail命令查看日志的最后50行 + command = f"sudo tail -n 50 {access_log_path}" + stdin, stdout, stderr = self.parent.ssh_client.exec_command(command) + stdin.write(password + '\n') + stdin.flush() + + output = stdout.read().decode('utf-8') + error = stderr.read().decode('utf-8') + + if output: + self.output_text.append("=== Gunicorn访问日志 ===") + self.output_text.append(output) + logger.info(f"成功查看访问日志: {len(output)} 字符") + else: + self.output_text.append("访问日志为空") + + if error and "sudo" not in error.lower(): + self.output_text.append(f"错误信息: {error}") + logger.error(f"查看访问日志出错: {error}") + + except Exception as e: + self.output_text.append(f"查看访问日志失败: {str(e)}") + logger.error(f"查看访问日志失败: {str(e)}") + + def view_error_log(self): + """查看Gunicorn错误日志""" + if not self.check_ssh_connection(): + return + + # 获取config.json中的配置信息 + config = None + if self.parent and hasattr(self.parent, 'server_connection_tab'): + config = self.parent.server_connection_tab.get_current_config() + + if config: + project_path = config.get('remote_directory', '/home/xiaji') + else: + project_path = '/home/xiaji' + + # 使用动态路径 + error_log_path = f"{project_path.rstrip('/')}/logs/gunicorn_error.log" + + self.output_text.append(f"正在查看错误日志: {error_log_path}") + + # 获取密码 + password = self.get_password() + if password is None: + return + + try: + # 首先检查日志文件是否存在,如果不存在则创建 + log_dir = f"{project_path.rstrip('/')}/logs" + check_command = f"sudo test -f {error_log_path} || (sudo mkdir -p {log_dir} && sudo touch {error_log_path} && sudo chmod 644 {error_log_path})" + stdin, stdout, stderr = self.parent.ssh_client.exec_command(check_command) + stdin.write(password + '\n') + stdin.flush() + + # 使用tail命令查看日志的最后50行 + command = f"sudo tail -n 50 {error_log_path}" + stdin, stdout, stderr = self.parent.ssh_client.exec_command(command) + stdin.write(password + '\n') + stdin.flush() + + output = stdout.read().decode('utf-8') + error = stderr.read().decode('utf-8') + + if output: + self.output_text.append("=== Gunicorn错误日志 ===") + self.output_text.append(output) + logger.info(f"成功查看错误日志: {len(output)} 字符") + else: + self.output_text.append("错误日志为空") + + if error and "sudo" not in error.lower(): + self.output_text.append(f"错误信息: {error}") + logger.error(f"查看错误日志出错: {error}") + + except Exception as e: + self.output_text.append(f"查看错误日志失败: {str(e)}") + logger.error(f"查看错误日志失败: {str(e)}") \ No newline at end of file diff --git a/remote_command_tab.py b/remote_command_tab.py index 5708cf1..5434e91 100644 --- a/remote_command_tab.py +++ b/remote_command_tab.py @@ -134,38 +134,43 @@ class RemoteCommandTab(QWidget): logger.error(f"Git安装失败: {message}") def clone_git(self): + """克隆Git仓库到远程服务器""" if not self.check_ssh_connection(): return git_url = self.git_url_input.text().strip() - project_path = self.project_path_input.text().strip() - - if not git_url or not project_path: - QMessageBox.warning(self, "警告", "请填写Git仓库URL和项目路径") + if not git_url: + QMessageBox.warning(self, "警告", "请输入Git仓库地址") return - # 从config.json获取django_path作为克隆目标路径 - try: - config_path = os.path.join(os.path.dirname(__file__), 'config.json') - with open(config_path, 'r', encoding='utf-8') as f: - config = json.load(f) - - if config and 'servers' in config and len(config['servers']) > 0: - server_config = config['servers'][0] - django_path = server_config.get('django_path', '') - - if django_path: - project_path = django_path - logger.info(f"使用django_path作为克隆目标路径: {django_path}") - except Exception as e: - logger.error(f"获取django_path失败: {str(e)}") + # 获取当前服务器配置 + config = None + if self.parent and hasattr(self.parent, 'server_connection_tab'): + config = self.parent.server_connection_tab.get_current_config() - self.output_text.append(f"正在克隆 {git_url} 到 {project_path}...") - self.clone_btn.setEnabled(False) + if config: + # 使用remote_directory而不是django_path + target_path = config.get('remote_directory', '/home/user') + project_name = config.get('project_name', 'myproject') + else: + # 如果没有config,使用默认值 + target_path = '/home/user' + project_name = 'myproject' - self.git_clone_thread = GitCloneThread(self.parent.ssh_client, git_url, project_path) - self.git_clone_thread.result_ready.connect(self.on_git_clone_result) - self.git_clone_thread.start() + # 获取密码 + password = self.get_password() + if password is None: + return + + self.output_text.append(f"正在克隆Git仓库 {git_url} 到 {target_path}...") + self.clone_git_btn.setEnabled(False) + self.progress_bar.setVisible(True) + self.progress_bar.setValue(0) + + self.clone_thread = CloneGitThread(self.parent.ssh_client, git_url, target_path, project_name, password) + self.clone_thread.progress_updated.connect(self.update_progress) + self.clone_thread.result_ready.connect(self.on_clone_git_result) + self.clone_thread.start() def on_git_clone_result(self, success, message): self.clone_btn.setEnabled(True) diff --git a/threads.py b/threads.py index 7e694e0..161946b 100644 --- a/threads.py +++ b/threads.py @@ -691,45 +691,63 @@ class GunicornTestThread(QThread): self.progress_updated.emit(30) - # 检查wsgi.py文件 - project_name = os.path.basename(self.django_path.rstrip('/')) - wsgi_path = f"{self.django_path.rstrip('/')}/{project_name}/wsgi.py" - stdin, stdout, stderr = self.ssh_client.exec_command(f"ls -la {wsgi_path}") - exit_status = stdout.channel.recv_exit_status() + # 检查wsgi.py文件 - 先尝试项目根目录 + stdin, stdout, stderr = self.ssh_client.exec_command(f"find {self.django_path} -name wsgi.py -type f") + wsgi_files = stdout.read().decode().strip().split('\n') - if exit_status != 0: - # 尝试在Django项目根目录下查找wsgi.py文件 - stdin, stdout, stderr = self.ssh_client.exec_command(f"find {self.django_path} -name wsgi.py") - exit_status = stdout.channel.recv_exit_status() - - if exit_status == 0: - wsgi_path = stdout.read().decode().strip() - logger.info(f"找到wsgi.py文件: {wsgi_path}") - else: - self.result_ready.emit(False, f"wsgi.py文件不存在: {wsgi_path}") - logger.error(f"wsgi.py文件不存在: {wsgi_path}") - return + if not wsgi_files or wsgi_files == ['']: + self.result_ready.emit(False, f"未找到wsgi.py文件") + logger.error(f"未找到wsgi.py文件") + return + + # 使用第一个找到的wsgi.py文件 + wsgi_file = wsgi_files[0].strip() + logger.info(f"找到wsgi.py文件: {wsgi_file}") + + # 获取项目目录的相对路径 + project_dir = os.path.dirname(wsgi_file) + project_name = os.path.basename(project_dir) + + # 如果wsgi.py在子目录中,调整项目名 + if project_dir != self.django_path.rstrip('/'): + # wsgi.py在子目录中,使用子目录名作为项目名 + project_name = os.path.basename(project_dir) + else: + # wsgi.py在项目根目录中,使用manage.py所在目录名作为项目名 + project_name = os.path.basename(self.django_path.rstrip('/')) self.progress_updated.emit(50) # 测试Gunicorn启动 - stdin, stdout, stderr = self.ssh_client.exec_command(f"cd {self.django_path} && gunicorn --workers 2 --bind 0.0.0.0:8001 {project_name}.wsgi:application --timeout 10 &") - time.sleep(5) # 等待Gunicorn启动 + test_command = f"cd {self.django_path} && timeout 10 gunicorn --workers 1 --bind 0.0.0.0:8001 {project_name}.wsgi:application --timeout 5" + stdin, stdout, stderr = self.ssh_client.exec_command(test_command) + time.sleep(3) # 等待Gunicorn启动 # 检查Gunicorn是否运行 stdin, stdout, stderr = self.ssh_client.exec_command("ps aux | grep gunicorn") output = stdout.read().decode() - if "gunicorn" in output and "--bind 0.0.0.0:8001" in output: - # 停止测试进程 - stdin, stdout, stderr = self.ssh_client.exec_command("pkill -f 'gunicorn --bind 0.0.0.0:8001'") - + # 清理测试进程 + stdin, stdout, stderr = self.ssh_client.exec_command("pkill -f 'gunicorn.*8001'") + + if "gunicorn" in output and "8001" in output: self.progress_updated.emit(100) - self.result_ready.emit(True, "Gunicorn测试成功") - logger.info("Gunicorn测试成功") + self.result_ready.emit(True, f"Gunicorn测试成功 - 项目: {project_name}") + logger.info(f"Gunicorn测试成功 - 项目: {project_name}") else: - self.result_ready.emit(False, "Gunicorn测试失败") - logger.error("Gunicorn测试失败") + # 尝试更简单的测试方式 + self.progress_updated.emit(80) + test_command2 = f"cd {self.django_path} && python3 -c \"import {project_name}.wsgi; print('WSGI导入成功')\"" + stdin, stdout, stderr = self.ssh_client.exec_command(test_command2) + exit_status = stdout.channel.recv_exit_status() + + if exit_status == 0: + self.result_ready.emit(True, f"WSGI配置验证成功 - 项目: {project_name}") + logger.info(f"WSGI配置验证成功 - 项目: {project_name}") + else: + error_output = stderr.read().decode() + self.result_ready.emit(False, f"Gunicorn测试失败: {error_output}") + logger.error(f"Gunicorn测试失败: {error_output}") except Exception as e: error_msg = str(e)