From 2634d43bcbe71fab01538e60bab69e186501af80 Mon Sep 17 00:00:00 2001 From: engelgardt Date: Tue, 19 May 2026 03:46:56 +0300 Subject: [PATCH] chore: switch update-check and release URLs to self-hosted Forgejo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub-репо заморожены; релизы теперь на git.engelgardt23.ru. Co-Authored-By: Claude Opus 4.7 --- src/netswitch/__init__.py | 4 ++-- src/netswitch/app.py | 2 +- src/netswitch/update_check.py | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/netswitch/__init__.py b/src/netswitch/__init__.py index cbe925a..9d3a336 100644 --- a/src/netswitch/__init__.py +++ b/src/netswitch/__init__.py @@ -6,5 +6,5 @@ The single source of truth for the project version. Bump this before tagging a release; CI reads the tag, the code reads this constant. """ -__version__ = "1.2.0" -GITHUB_REPO = "Engelgardt23/netswitch" +__version__ = "1.2.1" +GITHUB_REPO = "engel/netswitch" # на Forgejo (git.engelgardt23.ru) diff --git a/src/netswitch/app.py b/src/netswitch/app.py index bbe7fa5..41b5d20 100644 --- a/src/netswitch/app.py +++ b/src/netswitch/app.py @@ -69,7 +69,7 @@ def main() -> None: title = f"[bold cyan]netswitch v{__version__}[/] {t('tagline')}" latest = check_for_update() if latest: - release_url = f"https://github.com/{GITHUB_REPO}/releases/latest" + release_url = f"https://git.engelgardt23.ru/{GITHUB_REPO}/releases/latest" notice = t("update_available", tag=latest) header = Table.grid(expand=True) header.add_column(justify="left", ratio=1) diff --git a/src/netswitch/update_check.py b/src/netswitch/update_check.py index 7499dc4..f305567 100644 --- a/src/netswitch/update_check.py +++ b/src/netswitch/update_check.py @@ -21,9 +21,8 @@ def _parse_version(s: str) -> tuple[int, int, int]: def check_for_update() -> str | None: try: - url = f"https://api.github.com/repos/{GITHUB_REPO}/releases/latest" + url = f"https://git.engelgardt23.ru/api/v1/repos/{GITHUB_REPO}/releases/latest" req = urllib.request.Request(url, headers={ - "Accept": "application/vnd.github+json", "User-Agent": f"netswitch/{__version__}", }) with urllib.request.urlopen(req, timeout=3) as r: