From 72a96999dfb1d4f28040349b4b3dc3154d52fc23 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Tue, 11 Mar 2025 01:01:08 +0330 Subject: [PATCH 01/16] feat: Add version checking and display Integrated version checking into `cli_api.py` and `cli.py` --- core/cli.py | 25 ++++++++++++++ core/cli_api.py | 12 +++++++ core/scripts/hysteria2/version.sh | 57 +++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 core/scripts/hysteria2/version.sh diff --git a/core/cli.py b/core/cli.py index 779e3a6..5679ea0 100644 --- a/core/cli.py +++ b/core/cli.py @@ -485,6 +485,31 @@ def get_services_status(): click.echo('Error: Services status not available.') except Exception as e: click.echo(f'{e}', err=True) + + +@cli.command('show-version') +def show_version(): + """Displays the currently installed version of the panel.""" + try: + if version_info := cli_api.show_version(): + click.echo(version_info) + else: + click.echo("Error retrieving version") + except Exception as e: + click.echo(f"An unexpected error occurred: {e}", err=True) + + +@cli.command('check-version') +def check_version(): + """Checks if the current version is up-to-date and displays changelog if not.""" + try: + if version_info := cli_api.check_version(): + click.echo(version_info) + else: + click.echo("Error retrieving version") + except Exception as e: + click.echo(f"An unexpected error occurred: {e}", err=True) + # endregion diff --git a/core/cli_api.py b/core/cli_api.py index d602d17..3615905 100644 --- a/core/cli_api.py +++ b/core/cli_api.py @@ -47,6 +47,7 @@ class Command(Enum): CONFIGURE_WARP = os.path.join(SCRIPT_DIR, 'warp', 'configure.sh') STATUS_WARP = os.path.join(SCRIPT_DIR, 'warp', 'status.sh') SERVICES_STATUS = os.path.join(SCRIPT_DIR, 'services_status.sh') + VERSION = os.path.join(SCRIPT_DIR, 'hysteria2', 'version.sh') # region Custom Exceptions @@ -500,5 +501,16 @@ def get_services_status() -> dict[str, bool] | None: '''Gets the status of all project services.''' if res := run_cmd(['bash', Command.SERVICES_STATUS.value]): return json.loads(res) + + +def show_version() -> str | None: + """Displays the currently installed version of the panel.""" + return run_cmd(['bash', Command.VERSION.value, 'show-version']) + + +def check_version() -> str | None: + """Checks if the current version is up-to-date and displays changelog if not.""" + return run_cmd(['bash', Command.VERSION.value, 'check-version']) + # endregion # endregion diff --git a/core/scripts/hysteria2/version.sh b/core/scripts/hysteria2/version.sh new file mode 100644 index 0000000..754307c --- /dev/null +++ b/core/scripts/hysteria2/version.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +source /etc/hysteria/core/scripts/path.sh + +version_greater_equal() { + IFS='.' read -r -a local_version_parts <<< "$1" + IFS='.' read -r -a latest_version_parts <<< "$2" + + for ((i=0; i<${#local_version_parts[@]}; i++)); do + if [[ -z ${latest_version_parts[i]} ]]; then + latest_version_parts[i]=0 + fi + + if ((10#${local_version_parts[i]} > 10#${latest_version_parts[i]})); then + return 0 + elif ((10#${local_version_parts[i]} < 10#${latest_version_parts[i]})); then + return 1 + fi + done + + return 0 +} + +check_version() { + local_version=$(cat $LOCALVERSION) + latest_version=$(curl -s $LATESTVERSION) + latest_changelog=$(curl -s $LASTESTCHANGE) + + + if version_greater_equal "$local_version" "$latest_version"; then + echo "Panel Version: $local_version" + else + echo "Panel Version: $local_version" + echo "Latest Version: $latest_version" + echo "${yellow}$latest_version Version Change Log:" + echo "$latest_changelog" + fi +} + +show_version() { + + local_version=$(cat "$LOCALVERSION") + echo "Panel Version: $local_version" + +} + + +if [ "$1" == "check-version" ]; then + check_version +elif [ "$1" == "show-version" ]; then + show_version +else + echo "Usage: $0 [check|show]" >&2 + exit 1 +fi + +exit 0 \ No newline at end of file From 3439503f8d9ecb5a457f44f1757847c7f139567f Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Tue, 11 Mar 2025 01:02:26 +0330 Subject: [PATCH 02/16] Created Pydantic schemas for version API responses --- core/scripts/webpanel/routers/api/v1/schema/server.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/scripts/webpanel/routers/api/v1/schema/server.py b/core/scripts/webpanel/routers/api/v1/schema/server.py index 9372c52..393f0bc 100644 --- a/core/scripts/webpanel/routers/api/v1/schema/server.py +++ b/core/scripts/webpanel/routers/api/v1/schema/server.py @@ -23,3 +23,13 @@ class ServerServicesStatusResponse(BaseModel): hysteria_normal_sub: bool hysteria_telegram_bot: bool hysteria_warp: bool + +class VersionInfoResponse(BaseModel): + current_version: str + + +class VersionCheckResponse(BaseModel): + is_latest: bool + current_version: str + latest_version: str + changelog: str \ No newline at end of file From 1f8bc93aa98bb5be19da4938bf7dc9f0d68c335a Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Tue, 11 Mar 2025 01:03:23 +0330 Subject: [PATCH 03/16] Added API endpoints for getting version info and checking for updates --- .../scripts/webpanel/routers/api/v1/server.py | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/core/scripts/webpanel/routers/api/v1/server.py b/core/scripts/webpanel/routers/api/v1/server.py index 2ef99b0..5639d9b 100644 --- a/core/scripts/webpanel/routers/api/v1/server.py +++ b/core/scripts/webpanel/routers/api/v1/server.py @@ -1,6 +1,6 @@ from fastapi import APIRouter, HTTPException import cli_api -from .schema.server import ServerStatusResponse, ServerServicesStatusResponse +from .schema.server import ServerStatusResponse, ServerServicesStatusResponse, VersionCheckResponse, VersionInfoResponse router = APIRouter() @@ -144,3 +144,40 @@ def __parse_services_status(services_status: dict[str, bool]) -> ServerServicesS elif 'wg-quick' in service: parsed_services_status['hysteria_warp'] = status return ServerServicesStatusResponse(**parsed_services_status) + +@router.get('/version', response_model=VersionInfoResponse) +async def get_version_info(): + """Retrieves the current version of the panel.""" + try: + version_output = cli_api.show_version() + if version_output: + current_version = version_output.split(": ")[1].strip() + return VersionInfoResponse(current_version=current_version) + raise HTTPException(status_code=404, detail="Version information not found") + except Exception as e: + raise HTTPException(status_code=500, detail=str(e)) + + +@router.get('/version/check', response_model=VersionCheckResponse) +async def check_version_info(): + """Checks for updates and retrieves version information.""" + try: + check_output = cli_api.check_version() + if check_output: + lines = check_output.splitlines() + current_version = lines[0].split(": ")[1].strip() + + if len(lines) > 1 and "Latest Version" in lines[1]: + latest_version = lines[1].split(": ")[1].strip() + is_latest = current_version == latest_version + changelog_start_index = 3 + changelog = "\n".join(lines[changelog_start_index:]).strip() + return VersionCheckResponse(is_latest=is_latest, current_version=current_version, + latest_version=latest_version, changelog=changelog) + else: + return VersionCheckResponse(is_latest=True, current_version=current_version) + + raise HTTPException(status_code=404, detail="Version information not found") + + except Exception as e: + raise HTTPException(status_code=500, detail=str(e)) \ No newline at end of file From 4274a20b05149666b66e27e5e7c7c38406bfd707 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Tue, 11 Mar 2025 01:09:26 +0330 Subject: [PATCH 04/16] Improved footer design and add version display Updated `base.html` to display current version and show update notifications Adde github and telegram link in footer --- core/scripts/webpanel/templates/base.html | 81 +++++++++++++++++++---- 1 file changed, 69 insertions(+), 12 deletions(-) diff --git a/core/scripts/webpanel/templates/base.html b/core/scripts/webpanel/templates/base.html index f327d32..f3115b1 100644 --- a/core/scripts/webpanel/templates/base.html +++ b/core/scripts/webpanel/templates/base.html @@ -15,6 +15,8 @@ + + {% block stylesheets %}{% endblock %} @@ -114,11 +116,26 @@ {% block content %}{% endblock %} - - + + @@ -127,16 +144,18 @@ + + {% block javascripts %}{% endblock %} - + \ No newline at end of file From 7157ab9d87db233242cd9faac5be02d269855389 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Tue, 11 Mar 2025 10:37:55 +0330 Subject: [PATCH 05/16] Fix: typo --- core/scripts/hysteria2/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/scripts/hysteria2/version.sh b/core/scripts/hysteria2/version.sh index 754307c..3f6b71d 100644 --- a/core/scripts/hysteria2/version.sh +++ b/core/scripts/hysteria2/version.sh @@ -50,7 +50,7 @@ if [ "$1" == "check-version" ]; then elif [ "$1" == "show-version" ]; then show_version else - echo "Usage: $0 [check|show]" >&2 + echo "Usage: $0 [check-version|show-version]" >&2 exit 1 fi From 02b276ac8e4ea85e008be5ab231b8c30dc326043 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Tue, 11 Mar 2025 10:39:31 +0330 Subject: [PATCH 06/16] Removed color --- core/scripts/hysteria2/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/scripts/hysteria2/version.sh b/core/scripts/hysteria2/version.sh index 3f6b71d..2d33b0e 100644 --- a/core/scripts/hysteria2/version.sh +++ b/core/scripts/hysteria2/version.sh @@ -32,7 +32,7 @@ check_version() { else echo "Panel Version: $local_version" echo "Latest Version: $latest_version" - echo "${yellow}$latest_version Version Change Log:" + echo "$latest_version Version Change Log:" echo "$latest_changelog" fi } From 85c6a3116cf527f53f463ed76915d2db98a36625 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Tue, 11 Mar 2025 11:04:35 +0330 Subject: [PATCH 07/16] Refactor: Replace version.sh with version.py --- core/cli_api.py | 5 +-- core/scripts/hysteria2/version.py | 75 +++++++++++++++++++++++++++++++ core/scripts/hysteria2/version.sh | 57 ----------------------- 3 files changed, 77 insertions(+), 60 deletions(-) create mode 100644 core/scripts/hysteria2/version.py delete mode 100644 core/scripts/hysteria2/version.sh diff --git a/core/cli_api.py b/core/cli_api.py index 3615905..9f20d07 100644 --- a/core/cli_api.py +++ b/core/cli_api.py @@ -502,15 +502,14 @@ def get_services_status() -> dict[str, bool] | None: if res := run_cmd(['bash', Command.SERVICES_STATUS.value]): return json.loads(res) - def show_version() -> str | None: """Displays the currently installed version of the panel.""" - return run_cmd(['bash', Command.VERSION.value, 'show-version']) + return run_cmd(['python3', Command.VERSION.value, 'show-version']) def check_version() -> str | None: """Checks if the current version is up-to-date and displays changelog if not.""" - return run_cmd(['bash', Command.VERSION.value, 'check-version']) + return run_cmd(['python3', Command.VERSION.value, 'check-version']) # endregion # endregion diff --git a/core/scripts/hysteria2/version.py b/core/scripts/hysteria2/version.py new file mode 100644 index 0000000..dafe699 --- /dev/null +++ b/core/scripts/hysteria2/version.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python3 + +import os +import sys +import requests +from pathlib import Path + +LOCALVERSION = "/etc/hysteria/VERSION" +LATESTVERSION = "https://raw.githubusercontent.com/ReturnFI/Hysteria2/main/VERSION" +LASTESTCHANGE = "https://raw.githubusercontent.com/ReturnFI/Hysteria2/main/changelog" + +def version_greater_equal(version1, version2): + version1_parts = [int(part) for part in version1.strip().split('.')] + version2_parts = [int(part) for part in version2.strip().split('.')] + + max_length = max(len(version1_parts), len(version2_parts)) + version1_parts.extend([0] * (max_length - len(version1_parts))) + version2_parts.extend([0] * (max_length - len(version2_parts))) + + for i in range(max_length): + if version1_parts[i] > version2_parts[i]: + return True + elif version1_parts[i] < version2_parts[i]: + return False + + # If we get here, they're equal + return True + +def check_version(): + try: + with open(LOCALVERSION, 'r') as f: + local_version = f.read().strip() + + latest_version = requests.get(LATESTVERSION).text.strip() + latest_changelog = requests.get(LASTESTCHANGE).text + + print(f"Panel Version: {local_version}") + + if not version_greater_equal(local_version, latest_version): + print(f"Latest Version: {latest_version}") + print(f"{latest_version} Version Change Log:") + print(latest_changelog) + except Exception as e: + print(f"Error checking version: {e}", file=sys.stderr) + sys.exit(1) + +def show_version(): + try: + with open(LOCALVERSION, 'r') as f: + local_version = f.read().strip() + + print(f"Panel Version: {local_version}") + except Exception as e: + print(f"Error showing version: {e}", file=sys.stderr) + sys.exit(1) + +def main(): + if len(sys.argv) != 2: + print(f"Usage: {sys.argv[0]} [check-version|show-version]", file=sys.stderr) + sys.exit(1) + + command = sys.argv[1] + + if command == "check-version": + check_version() + elif command == "show-version": + show_version() + else: + print(f"Usage: {sys.argv[0]} [check-version|show-version]", file=sys.stderr) + sys.exit(1) + + sys.exit(0) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/core/scripts/hysteria2/version.sh b/core/scripts/hysteria2/version.sh deleted file mode 100644 index 2d33b0e..0000000 --- a/core/scripts/hysteria2/version.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -source /etc/hysteria/core/scripts/path.sh - -version_greater_equal() { - IFS='.' read -r -a local_version_parts <<< "$1" - IFS='.' read -r -a latest_version_parts <<< "$2" - - for ((i=0; i<${#local_version_parts[@]}; i++)); do - if [[ -z ${latest_version_parts[i]} ]]; then - latest_version_parts[i]=0 - fi - - if ((10#${local_version_parts[i]} > 10#${latest_version_parts[i]})); then - return 0 - elif ((10#${local_version_parts[i]} < 10#${latest_version_parts[i]})); then - return 1 - fi - done - - return 0 -} - -check_version() { - local_version=$(cat $LOCALVERSION) - latest_version=$(curl -s $LATESTVERSION) - latest_changelog=$(curl -s $LASTESTCHANGE) - - - if version_greater_equal "$local_version" "$latest_version"; then - echo "Panel Version: $local_version" - else - echo "Panel Version: $local_version" - echo "Latest Version: $latest_version" - echo "$latest_version Version Change Log:" - echo "$latest_changelog" - fi -} - -show_version() { - - local_version=$(cat "$LOCALVERSION") - echo "Panel Version: $local_version" - -} - - -if [ "$1" == "check-version" ]; then - check_version -elif [ "$1" == "show-version" ]; then - show_version -else - echo "Usage: $0 [check-version|show-version]" >&2 - exit 1 -fi - -exit 0 \ No newline at end of file From 4873b41008ff51042724d3cc3f13a77d7c7733cf Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Wed, 12 Mar 2025 09:48:49 +0330 Subject: [PATCH 08/16] Clone Beta --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5bdefb8..bd2b6d0 100644 --- a/install.sh +++ b/install.sh @@ -53,7 +53,7 @@ else echo "All required packages are already installed." fi -git clone https://github.com/ReturnFI/Hysteria2 /etc/hysteria +git clone -b beta https://github.com/ReturnFI/Hysteria2 /etc/hysteria cd /etc/hysteria python3 -m venv hysteria2_venv From de1f366dc513b2186e64a3c2e03a0fe0d68d135f Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Wed, 12 Mar 2025 10:08:15 +0330 Subject: [PATCH 09/16] Replace version.sh with version.py --- core/cli_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/cli_api.py b/core/cli_api.py index 9f20d07..ddf0d66 100644 --- a/core/cli_api.py +++ b/core/cli_api.py @@ -47,7 +47,7 @@ class Command(Enum): CONFIGURE_WARP = os.path.join(SCRIPT_DIR, 'warp', 'configure.sh') STATUS_WARP = os.path.join(SCRIPT_DIR, 'warp', 'status.sh') SERVICES_STATUS = os.path.join(SCRIPT_DIR, 'services_status.sh') - VERSION = os.path.join(SCRIPT_DIR, 'hysteria2', 'version.sh') + VERSION = os.path.join(SCRIPT_DIR, 'hysteria2', 'version.py') # region Custom Exceptions From 82c736b26107b0072a330b5911451fadcaa84427 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Wed, 12 Mar 2025 10:13:46 +0330 Subject: [PATCH 10/16] Added Release URL --- core/scripts/webpanel/templates/base.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/scripts/webpanel/templates/base.html b/core/scripts/webpanel/templates/base.html index f3115b1..273531b 100644 --- a/core/scripts/webpanel/templates/base.html +++ b/core/scripts/webpanel/templates/base.html @@ -130,9 +130,11 @@ Telegram - + + + @@ -224,4 +226,4 @@ {% block javascripts %}{% endblock %} - \ No newline at end of file + From 93037d280f28935ebdc09c445782c07ce760ba49 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Wed, 12 Mar 2025 11:11:54 +0330 Subject: [PATCH 11/16] feat: Add version check and notification new releases --- core/scripts/telegrambot/tbot.py | 3 +++ .../telegrambot/utils/check_version.py | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 core/scripts/telegrambot/utils/check_version.py diff --git a/core/scripts/telegrambot/tbot.py b/core/scripts/telegrambot/tbot.py index 6c06904..eb44865 100644 --- a/core/scripts/telegrambot/tbot.py +++ b/core/scripts/telegrambot/tbot.py @@ -8,6 +8,7 @@ from utils.edituser import * from utils.search import * from utils.serverinfo import * from utils.cpu import * +from utils.check_version import * import threading import time @@ -27,4 +28,6 @@ def monitoring_thread(): if __name__ == '__main__': monitor_thread = threading.Thread(target=monitoring_thread, daemon=True) monitor_thread.start() + version_thread = threading.Thread(target=version_monitoring, daemon=True) + version_thread.start() bot.polling(none_stop=True) diff --git a/core/scripts/telegrambot/utils/check_version.py b/core/scripts/telegrambot/utils/check_version.py new file mode 100644 index 0000000..c47a754 --- /dev/null +++ b/core/scripts/telegrambot/utils/check_version.py @@ -0,0 +1,23 @@ +import telebot +import subprocess +import shlex +import time +from utils.command import * + +def check_version(): + command = f"python3 {CLI_PATH} check-version" + try: + args = shlex.split(command) + result = subprocess.check_output(args, stderr=subprocess.STDOUT).decode("utf-8").strip() + notify_admins(result) + except subprocess.CalledProcessError as e: + print(f"Error checking version: {e.output.decode('utf-8')}") + +def notify_admins(message): + for admin_id in ADMIN_USER_IDS: + bot.send_message(admin_id, message) + +def version_monitoring(): + while True: + check_version() + time.sleep(86400) From 242701c793460dbb9451f40c39d1e5741fcc27a8 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Wed, 12 Mar 2025 11:13:29 +0330 Subject: [PATCH 12/16] refactor: Improve utils package structure with cleaner imports --- core/scripts/telegrambot/tbot.py | 11 +---------- core/scripts/telegrambot/utils/__init__.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/core/scripts/telegrambot/tbot.py b/core/scripts/telegrambot/tbot.py index eb44865..a61bec1 100644 --- a/core/scripts/telegrambot/tbot.py +++ b/core/scripts/telegrambot/tbot.py @@ -1,14 +1,5 @@ from telebot import types -from utils.common import create_main_markup -from utils.adduser import * -from utils.backup import * -from utils.command import * -from utils.deleteuser import * -from utils.edituser import * -from utils.search import * -from utils.serverinfo import * -from utils.cpu import * -from utils.check_version import * +from utils import * import threading import time diff --git a/core/scripts/telegrambot/utils/__init__.py b/core/scripts/telegrambot/utils/__init__.py index e69de29..49f6c6c 100644 --- a/core/scripts/telegrambot/utils/__init__.py +++ b/core/scripts/telegrambot/utils/__init__.py @@ -0,0 +1,10 @@ +from .common import * +from .adduser import * +from .backup import * +from .command import * +from .deleteuser import * +from .edituser import * +from .search import * +from .serverinfo import * +from .cpu import * +from .check_version import * From 39fecd942e15306c5ac16aa3b33d0f8592bae54d Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Wed, 12 Mar 2025 11:23:26 +0330 Subject: [PATCH 13/16] Improve version checker to notify only on new versions --- .../telegrambot/utils/check_version.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/core/scripts/telegrambot/utils/check_version.py b/core/scripts/telegrambot/utils/check_version.py index c47a754..58fb4e0 100644 --- a/core/scripts/telegrambot/utils/check_version.py +++ b/core/scripts/telegrambot/utils/check_version.py @@ -2,22 +2,33 @@ import telebot import subprocess import shlex import time +import re from utils.command import * def check_version(): command = f"python3 {CLI_PATH} check-version" try: args = shlex.split(command) - result = subprocess.check_output(args, stderr=subprocess.STDOUT).decode("utf-8").strip() - notify_admins(result) + result = subprocess.check_output(args, stderr=subprocess.STDOUT).decode("utf-8").strip() + panel_version = re.search(r'Panel Version: (\d+\.\d+\.\d+)', result) + latest_version = re.search(r'Latest Version: (\d+\.\d+\.\d+)', result) + + if panel_version and latest_version and panel_version.group(1) != latest_version.group(1): + notify_admins(f"🔔 New version available!\n\n{result}") + except subprocess.CalledProcessError as e: + error_message = f"Error checking version: {e.output.decode('utf-8')}" print(f"Error checking version: {e.output.decode('utf-8')}") + notify_admins(error_message) def notify_admins(message): for admin_id in ADMIN_USER_IDS: - bot.send_message(admin_id, message) + try: + bot.send_message(admin_id, message) + except Exception as e: + print(f"Failed to notify admin {admin_id}: {str(e)}") def version_monitoring(): while True: check_version() - time.sleep(86400) + time.sleep(86400) \ No newline at end of file From e64c34bbd8f5542f88dc771dc3d6e4242d3bcb3f Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Wed, 12 Mar 2025 11:24:55 +0330 Subject: [PATCH 14/16] Update changelog --- changelog | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/changelog b/changelog index 029b0ed..797e5d9 100644 --- a/changelog +++ b/changelog @@ -1,3 +1 @@ -🚀 feat: Improve Hysteria2 IP detection with fallbacks - -⚙️ Enhance: SNI entry handling in CONFIG_ENV file +🚀 feat: Add version check and notification new releases From 569c6dba266e560230a1fe36d6293d6aa07f7a98 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Wed, 12 Mar 2025 12:00:46 +0330 Subject: [PATCH 15/16] Update changelog --- changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog b/changelog index 797e5d9..a1270a5 100644 --- a/changelog +++ b/changelog @@ -1 +1,3 @@ 🚀 feat: Add version check and notification new releases +🛠️ refactor: Improve utils package structure with cleaner imports +🐛 fix: IPv6 validation pattern From 769b7480d53fa7f4159bb7bee9df7a838e09c5f1 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Wed, 12 Mar 2025 12:02:01 +0330 Subject: [PATCH 16/16] Clone Main --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index bd2b6d0..5bdefb8 100644 --- a/install.sh +++ b/install.sh @@ -53,7 +53,7 @@ else echo "All required packages are already installed." fi -git clone -b beta https://github.com/ReturnFI/Hysteria2 /etc/hysteria +git clone https://github.com/ReturnFI/Hysteria2 /etc/hysteria cd /etc/hysteria python3 -m venv hysteria2_venv