From: Michael Tremer Date: Thu, 25 Sep 2025 16:30:08 +0000 (+0000) Subject: Revert "downloads: Add document for the Raspberry Pi Imager" X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4c08830fbfb6dbe65f703e3f081645540b1d3c8;p=ipfire.org.git Revert "downloads: Add document for the Raspberry Pi Imager" This reverts commit bb86abb372366bc3293e7c2121a5b2ec6ea3b413. Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index b94d2b96..1886d9d3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1105,7 +1105,6 @@ static_img_DATA = \ src/static/img/default-avatar.jpg \ src/static/img/fdroid-logo.svg \ src/static/img/ipfire-tux.png \ - src/static/img/ipfire-tux-40x40.png \ src/static/img/iuse-not-found.png \ src/static/img/kyberio-logo.svg \ src/static/img/lightningwirelabs-logo.svg \ diff --git a/src/backend/releases.py b/src/backend/releases.py index 5990c4f6..895c6ca3 100644 --- a/src/backend/releases.py +++ b/src/backend/releases.py @@ -264,17 +264,10 @@ class Release(Object): def path(self): return self.__data.path - def get_file(self, type, arch=None): + def get_file(self, type): for file in self.files: - # Skip anything where the type does not match - if not file.type == type: - continue - - # Optionally skip the architecture - if arch and not file.arch == arch: - continue - - return file + if file.type == type: + return file def __file_hash(self, filename, algo="sha256"): h = hashlib.new(algo) @@ -361,37 +354,6 @@ class Release(Object): def netboot_args(self, arch, platform): return "" - # OS List (For Raspberry Pi Imager) - - def make_os_list(self, arch): - """ - Returns an object according to this spec: - - https://github.com/raspberrypi/rpi-imager/blob/qml/doc/json-schema/os-list-schema.json - https://github.com/raspberrypi/rpi-imager/blob/qml/doc/os-sublist-example.json - """ - # Fetch the flash image - file = self.get_file(type="flash", arch=arch) - - # Return an empty object if we could not find the image file - if not file: - return {} - - # Make the document - return { - "name" : self.name, - "description" : "The Open Source Linux-based Firewall Operating System" - " with a Comprehensive Feature Set", - "url" : file.url, - "icon" : "https://www.ipfire.org/static/img/ipfire-tux-40x40.png", - "website" : "https://www.ipfire.org/", - "release_date" : self.published.strftime("%Y-%m-%d"), - - # Image Metadata - "image_download_size" : file.size, - "image_download_sha256" : file.sha256, - } - @property def post(self): if self.__data.blog_id: diff --git a/src/static/img/ipfire-tux-40x40.png b/src/static/img/ipfire-tux-40x40.png deleted file mode 100644 index 44541162..00000000 Binary files a/src/static/img/ipfire-tux-40x40.png and /dev/null differ diff --git a/src/web/__init__.py b/src/web/__init__.py index b3d45f71..b042ac43 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -169,8 +169,6 @@ class Application(tornado.web.Application): (r"/downloads/mirrors", downloads.MirrorsHandler), (r"/downloads/thank-you", downloads.ThankYouHandler), (r"/downloads/([0-9a-z\-\.]+)", downloads.ReleaseHandler), - (r"/downloads/latest/os\-list\.json", downloads.LatestOSListHandler), - (r"/downloads/([0-9a-z\-\.]+)/os\-list\.json", downloads.OSListHandler), # Donate (r"/donate", donate.DonateHandler), diff --git a/src/web/downloads.py b/src/web/downloads.py index 623d0974..05f95994 100644 --- a/src/web/downloads.py +++ b/src/web/downloads.py @@ -84,30 +84,3 @@ class FileHandler(base.AnalyticsMixin, base.BaseHandler): we will have to redirect the user back to the main page """ self.redirect("https://www.ipfire.org/error/%s" % status_code) - - -class LatestOSListHandler(base.AnalyticsMixin, base.BaseHandler): - def get(self): - release = self.backend.releases.get_latest() - if not release: - raise tornado.web.HTTPError(404) - - # Redirect to latest release - self.redirect("/downloads/%s/os-list.json" % release.slug) - - -class OSListHandler(base.AnalyticsMixin, base.BaseHandler): - def get(self, slug): - release = self.backend.releases.get_by_sname(slug) - if not release: - raise tornado.web.HTTPError(404) - - # Create the document - json = release.make_os_list(arch="aarch64") - - # Fail if there was no image - if not json: - raise tornado.web.HTTPError(404, "Empty document") - - # Send the document to the client - self.finish(json)