docker-foswiki icon indicating copy to clipboard operation
docker-foswiki copied to clipboard

File attachment size

Open mmallejac opened this issue 5 years ago • 19 comments

Hello Tim,

Hope you're doing good. I've noticed that attachment size is limited to 1M, most probably the default value for Nginx. Is that on purpose ? I would set it to 10M to address our own needs.

What do you think ?

All the best, Michel

mmallejac avatar Jul 22 '20 12:07 mmallejac

Someone at work mentioned that recently. Its not limited on purpose. I would say 10 or 20 M would be fine. PR?

Tim

timlegge avatar Jul 24 '20 00:07 timlegge

Hi

Looking at

sed /client_max_body_size/s/1m/50m/g /etc/nginx/nginx.conf

TIm

timlegge avatar Jul 28 '20 01:07 timlegge

Hi Tim,

Yes ! Will do... soon :-)

Le mar. 28 juil. 2020 à 03:07, Timothy Legge [email protected] a écrit :

Hi

Looking at

sed /client_max_body_size/s/1m/50m/g /etc/nginx/nginx.conf

TIm

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/timlegge/docker-foswiki/issues/33#issuecomment-664717192, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZAG2LVI5R6DAFQGFKBAMDR5YQGLANCNFSM4PEUXVNA .

mmallejac avatar Jul 29 '20 09:07 mmallejac

fixed by e0164df

mmallejac avatar Jul 31 '20 07:07 mmallejac

Hi Tim,

Attaching files with size up to 50M works fine now, but something is not good here.

Within a new Docker instance, attaching a PDF file is ok but opening it afterwards leads to an error : the browser receives a zero size file, while the file within pub/web/topic is correct.

I see that in the Nginx errorlog file, but not sure to understand it :

172.20.0.1 - - [03/Aug/2020:12:40:34 +0000] "GET /pub/Main/WebHome/8H_AC04.pdf?_t=1596458422 HTTP/1.1" 200 5 "http://localhost:8765/Main/WebHome" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0"

==> foswiki-error.log <==
2020/08/03 12:40:34 [notice] 25#25: *63 "^/pub/(.*)$" matches "/pub/Main/WebHome/8H_AC04.pdf", client: 172.20.0.1, server: _, request: "GET /pub/Main/WebHome/8H_AC04.pdf?_t=1596458422 HTTP/1.1", host: "localhost:8765", referrer: "http://localhost:8765/Main/WebHome"
2020/08/03 12:40:34 [notice] 25#25: *63 rewritten data: "/bin/xsendfile/Main/WebHome/8H_AC04.pdf", args: "_t=1596458422", client: 172.20.0.1, server: _, request: "GET /pub/Main/WebHome/8H_AC04.pdf?_t=1596458422 HTTP/1.1", host: "localhost:8765", referrer: "http://localhost:8765/Main/WebHome"

I've also updated one of my instances, and on this one the behavior is slightly different : while opening the newly attached file, and instead of receiving an empty file, Foswiki answers :

image

On this one, the complete URL is : https://(myWiki)/pub/Cuisine/MielPissenlit/8H_AC04.pdf?_t=1596449443

If the attached file is a picture, it is correctly shown in the topic, the error occurs when trying to open the attached file from the topic.

Any idea ??

mmallejac avatar Aug 03 '20 12:08 mmallejac

Strange - it mentions rewritten data: "/bin/xsendfile/Main/WebHome/8H_AC04.pdf" I wonder if the xsendfile change is related. @MichaelDaum any thoughts?

timlegge avatar Aug 03 '20 22:08 timlegge

@mmallejac this version uses xfilesend do you have the XSendFileContrib enabled?

timlegge avatar Aug 04 '20 14:08 timlegge

not sure, I wasn't aware of this if this version uses xfilesend, shouldn't it be enabled by default within the Dockerfile ?

Le mar. 4 août 2020 à 16:17, Timothy Legge [email protected] a écrit :

@mmallejac https://github.com/mmallejac this version uses xfilesend do you have the XSendFileContrib enabled?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/timlegge/docker-foswiki/issues/33#issuecomment-668623545, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZAG2L7YGJJEPCHVU4WVJTR7AJ7NANCNFSM4PEUXVNA .

mmallejac avatar Aug 04 '20 14:08 mmallejac

yes, but is this an existing wiki? the volume would not have that change

On Tue, Aug 4, 2020 at 11:24 AM MichelMallejac [email protected] wrote:

not sure, I wasn't aware of this if this version uses xfilesend, shouldn't it be enabled by default within the Dockerfile ?

Le mar. 4 août 2020 à 16:17, Timothy Legge [email protected] a écrit :

@mmallejac https://github.com/mmallejac this version uses xfilesend do you have the XSendFileContrib enabled?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/timlegge/docker-foswiki/issues/33#issuecomment-668623545 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACZAG2L7YGJJEPCHVU4WVJTR7AJ7NANCNFSM4PEUXVNA

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/timlegge/docker-foswiki/issues/33#issuecomment-668627734, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH3N653GSJ2XPNUT22YO73R7AK3NANCNFSM4PEUXVNA .

timlegge avatar Aug 04 '20 14:08 timlegge

I removed xsendfilecontrib from my test volume and I get a 502 error. Reinstalling it and the attachment worked ine (refresh the page though with F5 or <Ctrl>+<F5>)

timlegge avatar Aug 04 '20 16:08 timlegge

Have you made a test with a fresh new install ?

Le mar. 4 août 2020 à 18:21, Timothy Legge [email protected] a écrit :

I removed xsendfilecontrib from my test volume and I get a 502 error. Reinstalling it and the attachment worked ine (refresh the page though with F5 or +)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/timlegge/docker-foswiki/issues/33#issuecomment-668693037, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZAG2K5OTAUS4LP4SWFDKTR7AYPNANCNFSM4PEUXVNA .

mmallejac avatar Aug 04 '20 19:08 mmallejac

I have not. Was your's a fresh install?

On Tue, Aug 4, 2020 at 4:01 PM MichelMallejac [email protected] wrote:

Have you made a test with a fresh new install ?

Le mar. 4 août 2020 à 18:21, Timothy Legge [email protected] a écrit :

I removed xsendfilecontrib from my test volume and I get a 502 error. Reinstalling it and the attachment worked ine (refresh the page though with F5 or +)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/timlegge/docker-foswiki/issues/33#issuecomment-668693037, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZAG2K5OTAUS4LP4SWFDKTR7AYPNANCNFSM4PEUXVNA .

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

timlegge avatar Aug 04 '20 19:08 timlegge

Yes : read my re-opening text of yesterday :-) I've met 2 different situations, with the new image or with existing volumes.

Le mar. 4 août 2020 à 21:05, Timothy Legge [email protected] a écrit :

I have not. Was your's a fresh install?

On Tue, Aug 4, 2020 at 4:01 PM MichelMallejac [email protected] wrote:

Have you made a test with a fresh new install ?

Le mar. 4 août 2020 à 18:21, Timothy Legge [email protected] a écrit :

I removed xsendfilecontrib from my test volume and I get a 502 error. Reinstalling it and the attachment worked ine (refresh the page though with F5 or +)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/timlegge/docker-foswiki/issues/33#issuecomment-668693037 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACZAG2K5OTAUS4LP4SWFDKTR7AYPNANCNFSM4PEUXVNA

.

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/timlegge/docker-foswiki/issues/33#issuecomment-668771795, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZAG2PJRTKGF3JS46MGTSLR7BLWTANCNFSM4PEUXVNA .

mmallejac avatar Aug 04 '20 19:08 mmallejac

I am tracking it down:

$Foswiki::cfg{XSendFileContrib}{Header} = 'X-Accel-Redirect'; $Foswiki::cfg{XSendFileContrib}{Location} = '/files';

Will have more info shortly and a patch

timlegge avatar Aug 05 '20 23:08 timlegge

The problem appears to be that I had the settings in the dockerfile before the Contrib was installed. However, right now the auuto builds at github are failing. If you want to try v1.18 at dockerhub it should be fine

timlegge avatar Aug 06 '20 11:08 timlegge

Hi Tim,

Si I've juste tested the new image (5797d249fe98).

With exiting data :

  • First I still get the same error " Missing or illegal web name - You are trying to view in a web that does not exist"
  • nothing worth mentioning in the volumes/foswiki_www/working/logs files (nothing about the download tentative)
  • the nginx error log mention xsendfile : 2020/08/06 13:59:19 [notice] 21#21: *50 rewritten data: "/bin/xsendfile/Myweb/MyTopic/Myfile.pdf", ...
  • So I install the XSendFileContrib
  • it looks better : the choosen attached file is sent to the browser, but size is 0
  • no error in the logs (Foswiki and Nginx)

With fresh install :

  • works like a charm

So in my existing instances, I am probably missing another contrib or ?

mmallejac avatar Aug 06 '20 12:08 mmallejac

Did you add the following settings in configure for your existing wiki

{XSendFileContrib}{Header} = 'X-Accel-Redirect'; {XSendFileContrib}{Location} = '/files';

On Thu, Aug 6, 2020 at 9:22 AM MichelMallejac [email protected] wrote:

Hi Tim,

Si I've juste tested the new image (5797d249fe98).

With exiting data :

  • First I still get the same error " Missing or illegal web name - You are trying to view in a web that does not exist"
  • nothing worth mentioning in the volumes/foswiki_www/working/logs files (nothing about the download tentative)
  • the nginx error log mention xsendfile : 2020/08/06 13:59:19 [notice] 21#21: *50 rewritten data: "/bin/xsendfile/Myweb/MyTopic/Myfile.pdf", ...
  • So I install the XSendFileContrib
  • it looks better : the choosen attached file is sent to the browser, but size is 0
  • no error in the logs (Foswiki and Nginx)

With fresh install :

  • works like a charm

So in my existing instances, I am probably missing another contrib or ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/timlegge/docker-foswiki/issues/33#issuecomment-669894291, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH3N67BXXEIBU6IUTPQHLTR7KOA5ANCNFSM4PEUXVNA .

timlegge avatar Aug 06 '20 13:08 timlegge

Hello Tim,

Just did it, and it now works fine with my existing instances ! thanks

Just one minor thing : when deleting an attachment, the "Deleting" message stays, I have then to refresh to have it gone. But that happens only on existing instances.

mmallejac avatar Aug 10 '20 09:08 mmallejac

@mmallejac Weird about the refresh. I take it the logs don't say much. I will try to reproduce

timlegge avatar Aug 10 '20 11:08 timlegge