mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2025-10-08 12:56:31 +08:00
# Improvements - Support cross-platform binary builds (Linux/Windows/MacOS) - Adds desktop app installers (Linux/Windows/MacOS) - Container images for latest now pointed to newest version automatically (Fixes #897) - Enable automatic open of webUI in local installs - Add persistence toggling for webUI scheduler # Bug Fixes - Fix schedule.yml not loaded upon restarting Docker container (Fixes #906) - Fix bug where torrents were not being paused after share limits reached (Fixes #901) - Fix(api): prevent path traversal vulnerability in backup restore endpoint (Fixes CWE-22 Security Vulnerability) - Fix scheduler to run interval jobs immediately on startup **Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v4.5.3...v4.5.4 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
from pathlib import Path
|
|
|
|
# Define an empty version_info tuple
|
|
__version_info__ = ()
|
|
|
|
# Try to resolve VERSION in a PyInstaller-safe way first, then fall back to repo-relative
|
|
version_str = "0.0.0"
|
|
try:
|
|
# Prefer runtime-extracted path when bundled
|
|
try:
|
|
from .util import runtime_path # Safe relative import within package
|
|
|
|
version_path = runtime_path("VERSION")
|
|
if version_path.exists():
|
|
version_str = version_path.read_text(encoding="utf-8").strip()
|
|
else:
|
|
raise FileNotFoundError
|
|
except Exception:
|
|
# Fallback to repository structure: modules/../VERSION
|
|
project_dir = Path(__file__).resolve().parent
|
|
version_file_path = (project_dir / ".." / "VERSION").resolve()
|
|
with open(version_file_path, encoding="utf-8") as f:
|
|
version_str = f.read().strip()
|
|
except Exception:
|
|
# Last resort default (keeps package importable even if VERSION missing)
|
|
version_str = "0.0.0"
|
|
|
|
# Get only the first 3 digits
|
|
version_str_split = version_str.rsplit("-", 1)[0]
|
|
# Convert the version string to a tuple of integers
|
|
try:
|
|
__version_info__ = tuple(map(int, version_str_split.split(".")))
|
|
except Exception:
|
|
__version_info__ = (0, 0, 0)
|
|
|
|
# Define the version string using the version_info tuple
|
|
__version__ = ".".join(str(i) for i in __version_info__)
|