Compare commits

...

1 commit
v1.2.0 ... main

Author SHA1 Message Date
2634d43bcb chore: switch update-check and release URLs to self-hosted Forgejo
GitHub-репо заморожены; релизы теперь на git.engelgardt23.ru.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 03:46:56 +03:00
3 changed files with 4 additions and 5 deletions

View file

@ -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. a release; CI reads the tag, the code reads this constant.
""" """
__version__ = "1.2.0" __version__ = "1.2.1"
GITHUB_REPO = "Engelgardt23/netswitch" GITHUB_REPO = "engel/netswitch" # на Forgejo (git.engelgardt23.ru)

View file

@ -69,7 +69,7 @@ def main() -> None:
title = f"[bold cyan]netswitch v{__version__}[/] {t('tagline')}" title = f"[bold cyan]netswitch v{__version__}[/] {t('tagline')}"
latest = check_for_update() latest = check_for_update()
if latest: 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) notice = t("update_available", tag=latest)
header = Table.grid(expand=True) header = Table.grid(expand=True)
header.add_column(justify="left", ratio=1) header.add_column(justify="left", ratio=1)

View file

@ -21,9 +21,8 @@ def _parse_version(s: str) -> tuple[int, int, int]:
def check_for_update() -> str | None: def check_for_update() -> str | None:
try: 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={ req = urllib.request.Request(url, headers={
"Accept": "application/vnd.github+json",
"User-Agent": f"netswitch/{__version__}", "User-Agent": f"netswitch/{__version__}",
}) })
with urllib.request.urlopen(req, timeout=3) as r: with urllib.request.urlopen(req, timeout=3) as r: