Self-update over HTTPS only

This commit is contained in:
sarah committed 2026-10-09 10:40:13 +02:00
1 parent 9025865a9b
commit 3998dfde74
2 files changed
+7 -2

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ import tomlkit
AppName = "SaraSuite" AppName = "SaraSuite"
# Compared with the latest Gitea release to offer self-updates (SelfUpdate.py). # Compared with the latest Gitea release to offer self-updates (SelfUpdate.py).
# Bump it, then run Packaging/Release.py, to publish a new SaraSuite. # Bump it, then run Packaging/Release.py, to publish a new SaraSuite.
AppVersion = "1.1.0" AppVersion = "1.1.1"
IsFrozen = bool(getattr(sys, "frozen", False)) # running from the AppImage IsFrozen = bool(getattr(sys, "frozen", False)) # running from the AppImage
# Bundled in assets/fonts and always registered, so it works as FontFamily # Bundled in assets/fonts and always registered, so it works as FontFamily
# without being installed. Any other FontFamily is looked up among the # without being installed. Any other FontFamily is looked up among the
+6 -1
View File
@@ -56,7 +56,12 @@ def LatestRelease() -> Optional[Release]:
except SourceError: except SourceError:
return None return None
Asset = next((Item for Item in Data.get("assets", []) if Item.get("name") == AssetName), None) Asset = next((Item for Item in Data.get("assets", []) if Item.get("name") == AssetName), None)
return Release(Data.get("tag_name", ""), Asset.get("browser_download_url", "") if Asset else "") AssetUrl = Asset.get("browser_download_url", "") if Asset else ""
# Gitea can hand out http:// download links; never fetch an executable
# over plain HTTP when the git host itself is HTTPS.
if Parts.scheme == "https" and AssetUrl.startswith("http://"):
AssetUrl = "https://" + AssetUrl.removeprefix("http://")
return Release(Data.get("tag_name", ""), AssetUrl)
def Install(Latest: Release, Log: Callable[[str], None]) -> Path: def Install(Latest: Release, Log: Callable[[str], None]) -> Path: