feat: use SystemProfile path for sing-box config storage

This commit is contained in:
Zenaku 2026-05-23 03:03:23 +00:00
parent 89705bbab7
commit 8ef8f9e1c9

View file

@ -1,5 +1,6 @@
from urllib.parse import unquote from urllib.parse import unquote
from pathlib import Path from pathlib import Path
from core.Constants import Constants
from core.utils.encrypted_proxy.net import get_real_ip, verify_ip from core.utils.encrypted_proxy.net import get_real_ip, verify_ip
from core.utils.encrypted_proxy.singbox import SingboxRunner from core.utils.encrypted_proxy.singbox import SingboxRunner
@ -103,7 +104,7 @@ def enable_vless(vless_link: str, username: str, config_dir: Path,
real_ip = get_real_ip() real_ip = get_real_ip()
runner = SingboxRunner() runner = SingboxRunner()
runner.stop() runner.stop()
config_path = config_dir / f"{username}-sing-box.json" config_path = Path(Constants.HV_DATA_HOME) / f"{username}-sing-box.json"
config = build_vless_config(vless, socks5_port) config = build_vless_config(vless, socks5_port)
try: try:
runner.write_config(config_path, config) runner.write_config(config_path, config)