help-14 / mountain

Web-based file browser

Home Page:https://help-14.github.io/mountain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature request] Enable logs

c157fl opened this issue · comments

Hi there!

Any way we could enable logs? I'm having trouble downloading some files (pdf, epub). Some start on desktop, others on neither, others on both. I checked the console (container and browser) but no relevant information and neither on the network tab (browser). On mobile I do see that some would be appearing as json extension when attempting to download.

Cheers,

Hi, i'm adding more log to it too, some operation didn't show enough log quite hard to debug.

Hi,

Mostly getting epub and PDFs.
I think I have some more details on the failures. It seems to be platform specific. I could always download them on my Unix but not on my Windows machine. Used the same browser to be sure, Firefox and Brave.
If removing any special characters, I could download it on Brave but not on Firefox, both on the Windows machine.

Using dev docker image, just pulled today.

Hi,

Mostly getting epub and PDFs. I think I have some more details on the failures. It seems to be platform specific. I could always download them on my Unix but not on my Windows machine. Used the same browser to be sure, Firefox and Brave. If removing any special characters, I could download it on Brave but not on Firefox, both on the Windows machine.

Using dev docker image, just pulled today.

Hi, try update your docker-compose.yml like this to see what error it is: https://github.com/help-14/mountain/blob/main/docker-compose.yml
I'll show error to frontend later this week.

Hi,

Already updated my docker compose a couple of days ago when @nhanpt updated with part of the logger code.
Curiously, I cannot download come files directly, for example the log file, but if I zip the file then I can download it.
Could it be related to the reply type of the request? Browser flags it as "Network Error".

Hi, could you upload this file here so I can check it

Unfortunately I cannot update it publicly.
I can provide the logs, I renamed the file to have "---------" instead of many letters and still failed to download it like this:

GIN] 2022/12/23 - 14:55:12 | 200 | 610.907µs | 192.168.1.96 | GET "/api/get?path=/serve"
2022/12/23 14:55:14 Request to download from /serve/Ma----- ------ - -------_ ----------- ( (2021, --------).epub
[GIN] 2022/12/23 - 14:55:14 | 200 | 201.984µs | 192.168.1.96 | GET "/api/download?path=/serve/Ma-----%20------%20-%20-------_%20-----------%20(%20(2021,%20--------).epub"

While testing I figured out how to trigger it from an end-user perspective.
The issue is when encoding the filename. If I remove the "," from the filename then it downloads.

@c157fl try again with latest dev image

@help-14 Tried now on both brave and chrome. Not able to download on either and also neither with or without ",". For the one with "," I get "Failed - Network error" while for the one without, I get a 0 bytes file.

@help-14 Tried now on both brave and chrome. Not able to download on either and also neither with or without ",". For the one with "," I get "Failed - Network error" while for the one without, I get a 0 bytes file.

Strange, I changed file name as you suggest and still be able to download. Maybe it is a permission problem.

image

Regarding permissions, the container is running with the root user and the file is also as root/root.
My bad, apparently that file became corrupt somehow. I've gotten another file to test and the issue with the "," remains.
At this point the file name is either "Dav,.pdf" or "Dav.pdf". First one triggers the error, second one doesn't.

So, updated info:

  • Windows
    • Brave Browser does not download file with the ","
    • Firefox downloads both but for the one with "," does so at the cost of everything after the space (including file extension).
  • Android
    • Brave does not
  • Linux
    • Firefox works independently of the name.

okay, maybe I'll add filter special character from file name when download.

@c157fl Hi, try dev image again :)

Hi, did not notice any change :s, neither on windows nor on android.
Also, do you think you could put the build version/number under the about menu?

I did notice something new though. On mobile, when trying to rename, the file extension does not get sent as in, I get this in the logs:

2022/12/31 11:19:25 Request to rename from /serve/---/David to /serve/---/David,
2022/12/31 11:19:25 rename /serve/tor/David /serve/---/David,: no such file or directory

Filename is David.pdf though. In the mobile UI it does appear as renaming with the file extension but the text input field does not have the extension pre-filled.

Going to attach image of what I get on mobile when pressing to download.

Screenshot_20221231_112253_Brave - Nightly.jpg