#pragma once #include #include "release_info.h" #include "version_compare.h" namespace roro::release { // Where the project's releases are (Q164). A fork changes these, and its own signing key. constexpr const char* kGiteaHost = "git.twis.la"; constexpr const char* kGiteaRepo = "twisla/roro9stack"; inline bool versionNewer(const std::string& a, const std::string& b) { return versionOlder(b, a); } // Is `release` a newer one than what runs? inline bool isNewer(const Release& release, const std::string& running) { return release.usable() && versionNewer(release.tag, running); } // Should the background check say so (Q166, Q168)? Not for a version that failed on this device // before (it rolled back), and not twice for the same one. inline bool shouldAnnounce(const Release& latest, const std::string& running, const std::string& failed, const std::string& announced) { return isNewer(latest, running) && latest.tag != failed && latest.tag != announced; } // Is `url` a download this device takes from the project's server, for this repository? Whatever // the API says, the device only fetches from where it asked (a redirected or rewritten answer // can't send it elsewhere). bool trustedAssetUrl(const std::string& url, const std::string& host = kGiteaHost, const std::string& repo = kGiteaRepo); } // namespace roro::release