-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zimwriterfs: created zim-file triggers download dialog when trying to open any extensionless html page in Kiwix Desktop #371
Comments
You are proposed to download the main_page because the mimetype is not supported. A
You have mwoffliner for that. |
Could you, please, try reproducing the wrong behavior and decide if it's a bug or a mistake on my side? |
It works on my side. See example.com.zip -- What is the output of |
# file -i main_page
main_page: text/html; charset=us-ascii
# zimwriterfs -V
zim-tools 3.2.0
libzim 8.2.1
+ libzstd 1.5.2
+ liblzma 5.2.6
+ libxapian 1.4.22
+ libicu 58.2.0 Your zim file works as expected. |
Works correctly on my machine for version 3.1.0 from repos of Linux Mint XFCE Edition: # zimwriterfs -V
zim-tools 3.1.0
libzim 7.2.0
+ libzstd 1.4.8
+ liblzma 5.2.5
+ libxapian 1.4.18
+ libicu 70.1.0
# lsb_release -a
No LSB modules are available.
Distributor ID: Linuxmint
Description: Linux Mint 21.2
Release: 21.2
Codename: victoria
# uname -a
Linux X220-LINUX 5.15.0-84-generic #93-Ubuntu SMP Tue Sep 5 17:16:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux I'm going to stick with 3.1.0 for now. |
This is probably a missing package/library in docker. |
The docker image uses the static build binary of zim-tools. As far as I understand, those binaries should be self-sufficient so if there's a runtime dependency to libmagic, it's a packaging bug and it should be staticaly linked. Adding libmagic would not work with those binaries. |
@rgaudin @mgautierfr Might that be that libmagic relies on some kind of data file? |
no, |
@rgaudin OK, weird... |
@rgaudin Their is no |
I confirm the issue: Running a zimwriterfs in the docker create a example.com.zim broken:
Workaround :
Then
We need to add the |
If this is Debian based, apt-file will give the answer. |
mgc is already included with The issue is that our use of libmagic is not defaulting to that folder as does Simply running container with This can be fixed easily in the Dockerfile but the fact that we rely on this file at runtime (with varying results depending on it being present) while using a static binary is disturbing. Can we acknowledge this? |
@rgaudin Yes, would be better to include it in the binary. |
Added libmagic explicitly as a way to document that this is a required runtime dependency and because the `MAGIC` environ is meant for it but it was already included indirectly.
OK, created #372 in case we want a short-term fix |
Maybe the solution would be to check if magic.mgc is available at start? |
What if it's not? Exit? Only solves the unpredictability of results. Still requires a runtime library (and be presented as such). |
At this stage, I would:
Ultimatively:
... But maybe the ultimate solution is overkill... |
Yes, it's more of a principle issue than a practical one. I am surprised that |
Note that
I would say we should print a warning or at least propose an option to continue even if the file is not present.
This can be a solution yes.
Indeed. I think that :
is good enough. |
Works for me 👍 |
I've created a small zim package that includes an extensionless welcome html page.
If I try to open it in
kiwix-desktop_x86_64_2.3.1-4.appimage
, it triggers a download dialog instead of rendering the page.Expected:
main_page
must be rendered as html.Actual: it is offered to be downloaded as file.
If I download https://www.mirrorservice.org/sites/download.kiwix.org/zim/wikipedia/wikipedia_ru_chemistry_mini_2023-08.zim and dump its content then I see it has extensionless html files such as
A/Яд
which are rendered correctly by Kiwix Desktop. I want to reproduce the same behavior for my zim-file.My higher objective is to save a media-wiki site to a zim.
Thanks.
The text was updated successfully, but these errors were encountered: