From acf9360ad79aa630eb396a4c689b04935bb502d8 Mon Sep 17 00:00:00 2001 From: Petro1990 Date: Mon, 24 Nov 2025 23:24:27 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20PWA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 7 ------- mihomo_editor.py | 23 +++-------------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/install.sh b/install.sh index b0e3ce2..5ed69a7 100644 --- a/install.sh +++ b/install.sh @@ -1,12 +1,5 @@ #!/bin/sh -# Проверка наличия openssl -if ! command -v openssl &> /dev/null; then - echo "openssl not found. Please install it first." - # opkg update && opkg install openssl-utils (example for OpenWrt) - exit 1 -fi - # Определяем директорию, в которой находится скрипт SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) diff --git a/mihomo_editor.py b/mihomo_editor.py index cea264b..52b2507 100644 --- a/mihomo_editor.py +++ b/mihomo_editor.py @@ -12,7 +12,6 @@ import time import shutil import glob import json -import ssl from datetime import datetime # --- НАСТРОЙКИ --- @@ -1028,23 +1027,7 @@ class H(http.server.SimpleHTTPRequestHandler): try: - # Создаем самоподписанный сертификат "на лету" - certfile = '/tmp/mihomo_cert.pem' - keyfile = '/tmp/mihomo_key.pem' - if not os.path.exists(certfile): - subprocess.call('openssl req -new -x509 -keyout {k} -out {c} -days 365 -nodes -subj "/C=US/ST=CA/L=./O=./CN=localhost"'.format(k=keyfile, c=certfile), shell=True, stderr=subprocess.DEVNULL) - - server_address = ('', PORT) - httpd = http.server.HTTPServer(server_address, H) - httpd.socket = ssl.wrap_socket(httpd.socket, - server_side=True, - certfile=certfile, - keyfile=keyfile, - ssl_version=ssl.PROTOCOL_TLS) - print(f"Server running on https://localhost:{PORT}") - httpd.serve_forever() -except Exception as e: - print(f"Failed to start HTTPS server: {e}") - print("Fallback to HTTP...") socketserver.TCPServer.allow_reuse_address = True - socketserver.TCPServer(("", PORT), H).serve_forever() \ No newline at end of file + socketserver.TCPServer(("", PORT), H).serve_forever() +except Exception as e: + print(e) \ No newline at end of file