kiwix / operations

Kiwix Kubernetes Cluster
http://charts.k8s.kiwix.org/
5 stars 0 forks source link

Direct APK download is buggy on kiwix.org #137

Closed jayb-g closed 8 months ago

jayb-g commented 8 months ago

Describe the bug

The direct download link for kiwix android listed on https://kiwix.org/en/applications as Direct APK sometimes starts download as kiwix-3.7.1.txt sometimes as kiwix-3.7.1.zip and sometimes as kiwix-3.7.1.apk

Expected behavior

Should download latest version as .apk file every time.

Steps to reproduce the behavior:

  1. Open https://kiwix.org/en/applications on latest versions of firefox and android(14) (I'm using Firefox, but maybe same behavior for chrome)
  2. In the 'Kiwix for Android' section, click on 'Direct APK' button
  3. The download prompt will show the filename before starting the download.
  4. Make note of the filename and extension, cancel the download and repeat from step 2

    Environment

    • Version of Kiwix Android : kiwix web (kiwix.org)
    • Device :
    • OS version :

    Logs I have the screen recorded but don't know how to upload here. It just shows option to link to online media file.

kelson42 commented 8 months ago

@jayb-g Thx.... very very weird. I will try to reproduce.

jayb-g commented 8 months ago

Although now that i try to reproduce it, its not happening. Giving .apk every time. Forgot to mention earlier that file size was always correct even though extensions were different.

How do I share the screen recording ?

jayb-g commented 8 months ago

Also why fdroid version is so old? v2.4 ? And github apk releases are discontinued after version 3.6.0

Should I create a separate request for that?

gouri-panda commented 8 months ago

How do I share the screen recording ?

@jayb-g you can just drop the file here in your prompt. I tried to reproduce it with Firefox but it always gives .apk.

kelson42 commented 8 months ago

Transferring to the « operations » repository.

rgaudin commented 8 months ago

Probably one or several mirrors not serving APK with the appropriate Content-Type

rgaudin commented 8 months ago

Indeed

https://md.mirrors.hacktegic.com/kiwix-md/release/kiwix-android/kiwix-3.7.1.apk Missing CT

https://mirrors.dotsrc.org/kiwix/release/kiwix-android/kiwix-3.7.1.apk content-type: text/plain

https://ftp.nluug.nl/pub/kiwix/release/kiwix-android/kiwix-3.7.1.apk Content-Type: text/plain; charset=UTF-8

https://ftp.fau.de/kiwix/release/kiwix-android/kiwix-3.7.1.apk Content-Type: application/vnd.android.package-archive

https://mirror.download.kiwix.org/release/kiwix-android/kiwix-3.7.1.apk content-type: application/vnd.android.package-archive

https://mirror-sites-in.mblibrary.info/mirror-sites/download.kiwix.org/release/kiwix-android/kiwix-3.7.1.apk Content-Type: application/vnd.android.package-archive

https://mirror-sites-fr.mblibrary.info/mirror-sites/download.kiwix.org/release/kiwix-android/kiwix-3.7.1.apk Content-Type: application/vnd.android.package-archive

https://mirror-sites-ca.mblibrary.info/mirror-sites/download.kiwix.org/release/kiwix-android/kiwix-3.7.1.apk Content-Type: application/vnd.android.package-archive

I suppose the culprit is ftp.nluug.nl. I'll contact them. @jayb-g @gouri-panda can you test the first two mirrors (those not setting a Content-Type at all) to see how it behaves?

kelson42 commented 8 months ago

can you test the first two mirrors (those not setting a Content-Type at all) to see how it behaves?

On iOS, download starts properly.

gouri-panda commented 8 months ago

@rgaudin it works with the firefox(mac) but it doesn't work with the firefox(android). The first content type shows zip and the second content type is .txt.

rgaudin commented 8 months ago

Thank you @gouri-panda ; I am writing to them as well then

artiommocrenco commented 8 months ago

For the hacktegic mirror, I added these two lines to Caddyfile (the config):

@apk path *.apk
header @apk Content-Type "application/vnd.android.package-archive"

Apologies for the inconsistency it was introducing.

artiommocrenco commented 8 months ago

Still, for Firefox Focus on iOS I get this for all the mirrors.

image

rgaudin commented 8 months ago

Works fine with every other browser I tested on iOS (including Firefox). Looks like a FF Focus bug. You shall report it.

jayb-g commented 8 months ago

@rgaudin all first 3 links return .apk download now on chrome.

2nd link still results into .txt download on firefox

AndersTrier commented 8 months ago

I just fixed it for dotsrc.org:

$ curl --silent --head https://mirrors.dotsrc.org/kiwix/release/kiwix-android/kiwix-3.7.1.apk | grep content-type
content-type: application/vnd.android.package-archive
jayb-g commented 8 months ago

@AndersTrier Now its downloading apk on FF

rgaudin commented 8 months ago

Thank you @AndersTrier ; we're all good now.