From d852c21a9d83beeed2198e95ef5a1904f9cb467c Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Sat, 10 May 2025 23:29:05 +0330 Subject: [PATCH 1/4] Refactor QR code generation to use Python --- core/scripts/hysteria2/show_user_uri.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/core/scripts/hysteria2/show_user_uri.py b/core/scripts/hysteria2/show_user_uri.py index 11f142b..2e61ea1 100644 --- a/core/scripts/hysteria2/show_user_uri.py +++ b/core/scripts/hysteria2/show_user_uri.py @@ -6,6 +6,8 @@ import json import subprocess import argparse import re +import qrcode +from io import StringIO from typing import Tuple, Optional, Dict, List, Any from init_paths import * from paths import * @@ -83,17 +85,20 @@ def generate_uri(username: str, auth_password: str, ip: str, port: str, return f"{uri_base}?{params_str}#{username}-IPv{ip_version}" def generate_qr_code(uri: str) -> List[str]: - """Generate QR code for the URI using qrencode.""" + """Generate terminal-friendly ASCII QR code using pure Python.""" try: - result = subprocess.run( - ['qrencode', '-t', 'UTF8', '-s', '3', '-m', '2'], - input=uri.encode(), - capture_output=True, - check=True + qr = qrcode.QRCode( + version=1, + error_correction=qrcode.constants.ERROR_CORRECT_L, + box_size=1, + border=2, ) - return result.stdout.decode().splitlines() - except subprocess.CalledProcessError: - return ["QR Code generation failed. Is qrencode installed?"] + qr.add_data(uri) + qr.make(fit=True) + + output = StringIO() + qr.print_ascii(out=output, invert=True) + return output.getvalue().splitlines() except Exception as e: return [f"Error generating QR code: {str(e)}"] From 7605527d72633ed25ced49b1f96420dc5b6fbb7b Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Sat, 10 May 2025 23:31:54 +0330 Subject: [PATCH 2/4] Remove qrencode --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index c784024..bf6a652 100644 --- a/install.sh +++ b/install.sh @@ -76,7 +76,7 @@ check_os_version() { } install_packages() { - local REQUIRED_PACKAGES=("jq" "qrencode" "curl" "pwgen" "python3" "python3-pip" "python3-venv" "git" "bc" "zip" "cron" "lsof") + local REQUIRED_PACKAGES=("jq" "curl" "pwgen" "python3" "python3-pip" "python3-venv" "git" "bc" "zip" "cron" "lsof") local MISSING_PACKAGES=() log_info "Checking required packages..." From e766afcf48518e6f7b0d09e7c135ef7b7c86fd6e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 19:51:53 +0000 Subject: [PATCH 3/4] chore(deps): Bump fastapi from 0.115.6 to 0.115.12 Bumps [fastapi](https://github.com/fastapi/fastapi) from 0.115.6 to 0.115.12. - [Release notes](https://github.com/fastapi/fastapi/releases) - [Commits](https://github.com/fastapi/fastapi/compare/0.115.6...0.115.12) --- updated-dependencies: - dependency-name: fastapi dependency-version: 0.115.12 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7a650e1..f2123d3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,7 +25,7 @@ hysteria2-api==0.1.2 # webpanel annotated-types==0.7.0 anyio==4.8.0 -fastapi==0.115.6 +fastapi==0.115.12 h11==0.16.0 itsdangerous==2.2.0 Jinja2==3.1.6 From 4a05f82d1c58b392dfb5177e32d1c33507af32cd Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Tue, 13 May 2025 23:27:33 +0330 Subject: [PATCH 4/4] Remove Reviewers --- .github/dependabot.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ffcfbf9..41525d5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,8 +12,6 @@ updates: commit-message: prefix: "chore" include: "scope" - reviewers: - - "ReturnFI" labels: - "dependencies" - "python"