pupcloud icon indicating copy to clipboard operation
pupcloud copied to clipboard

Pupcloud in docker will not show (in browser) content of files < 512b (bytes)

Open marioscube opened this issue 3 years ago • 7 comments

When trying to show a file in a browser that is smaller than 512 bytes, the content will not be shown.

Screenshot 2022-05-17 at 11 33 15 511b.txt 512b.txt

I do not know if this is a pupcloud or docker limitation (i fear the last).

marioscube avatar May 17 '22 09:05 marioscube

Could you fire up a quick install of filebrowser and see if that displays the file? Rules out Docker if so (if it worked).

I'd check for you but not by a machine to start moving stuff with ease.

On Tue, 17 May 2022 at 12:36, marioscube @.***> wrote:

When trying to show a file in a browser that is smaller than 512 bytes, the content will not be shown.

[image: Screenshot 2022-05-17 at 11 33 15] https://user-images.githubusercontent.com/20281601/168779771-d6d552cc-2ec3-4ea2-b0a1-8eb57fd1d2ae.png 511b.txt https://github.com/proofrock/pupcloud/files/8707079/511b.txt 512b.txt https://github.com/proofrock/pupcloud/files/8707081/512b.txt

I do not know if this is a pupcloud or docker limitation (i fear the last).

— Reply to this email directly, view it on GitHub https://github.com/proofrock/pupcloud/issues/49, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABV5MAEPENHIXWGXBZLFPY3VKNSATANCNFSM5WEI3H5A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

DarrenPIngram avatar May 17 '22 10:05 DarrenPIngram

Installed filebrowser in docker.......... Not very logical installation.

In filebrowser I can "view" the 511b file. However I have the impression that filebrowser does NOT work the same as pupcloud.

I cannot rule out Docker.

marioscube avatar May 17 '22 11:05 marioscube

The file is there, but the mime type resolution fails. I use the internal Golang routines, that already gave proof not to be the most reliable of all (I even wrote it in the README). In our case, I suspect it offloads resolution to the operating system, that of course inside Docker is a different one (Alpine Linux) and may fail. It's strange that it happens only for <512bytes... anyway. Two possible solutions:

  • revert to mime type resolution only based on file extension
  • adopt a "more regular" linux distro for the docker image, but this would make for a huge image

...I have to re-check the go routines, however; I'll open a ticket in Go's language issue tracker to get more details.

proofrock avatar May 17 '22 11:05 proofrock

Dunno. It seemed ok here.

Taken from an old file with commented out options

filebrowser5:

container_name: filebrowser5

restart: unless-stopped

ports:

- "2053:80"

volumes:

- /home/capture-au/folder1:/srv

- /home/capture-au/filebrowser-config/filebrowser5.db:/database.db

- /home/capture-au/filebrowser-config/filebrowser.json:/.filebrowser.json

- /etc/letsencrypt/live/a1.blackjackanderson.download/fullchain.pem:/fullchain.pem

- /etc/letsencrypt/live/a1.blackjackanderson.download/privkey.pem:/privkey.pem

image: filebrowser/filebrowser

Can't say about underlying system differences. —- Via iPad. Hopefully with not too many typos.

On 17. May 2022, at 14.46, marioscube @.***> wrote:

 Installed filebrowser in docker.......... Not very logical installation.

In filebrowser I can "view" the 511b file. However I have the impression that filebrowser does NOT work the same as pupcloud.

I cannot rule out Docker.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

DarrenPIngram avatar May 17 '22 11:05 DarrenPIngram

Can't say about underlying system differences.

See my explanation above

proofrock avatar May 17 '22 11:05 proofrock

Yes, think our messages crossed. I don't pretend to know what fb is written in.

—- Via iPad. Hopefully with not too many typos.

On 17. May 2022, at 14.53, Germano Rizzo @.***> wrote:

 Can't say about underlying system differences.

See my explanation above

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

DarrenPIngram avatar May 17 '22 12:05 DarrenPIngram

In Go. But probably it simply uses a different resolution method.

proofrock avatar May 17 '22 12:05 proofrock