Opened 10 years ago

Closed 8 years ago

#118 closed enhancement (fixed)

Provide option to limit upload size

Reported by: joar Owned by:
Priority: minor Milestone:
Component: programming Keywords:
Cc: Parent Tickets:

Description (last modified by Christopher Allan Webber)

Due to the possibility to overload a server by sending it HUGE POST
requests, we should provide an option to instance-owners to limit
the possible media upload size.

Presumably, we should put this option in ``mediagoblin.ini``.

We should also display this information to the end-user by
providing a notice in ``mediagoblin/submit/forms.py``.

Here's a handy snippet provided by cwebber/paroneayea that might
aid anyone pursuing this ticket's completion:
`http://wiki.pylonshq.com/display/pylonscookbook/A+Better+Way+To+Limit+File+Upload+Size <http://wiki.pylonshq.com/display/pylonscookbook/A+Better+Way+To+Limit+File+Upload+Size>`_



Subtickets

Change History (26)

comment:1 Changed 10 years ago by joar

Milestone: 0.0.4

comment:2 Changed 10 years ago by joar

Owner: set to Joar Wandborg

comment:3 Changed 10 years ago by joar

Owner: set to Joar Wandborg

comment:1 Changed 10 years ago by Christopher Allan Webber

Owner: set to Chris Moylan
Assigning to Chris Moylan!



comment:2 Changed 10 years ago by Christopher Allan Webber

Ping me on IRC if you have questions.



comment:3 Changed 10 years ago by Will Kahn-Greene

Milestone: 0.0.40.0.5
We release 0.0.4, so I'm bumping this to 0.0.5.



comment:4 Changed 10 years ago by Christopher Allan Webber

Milestone: 0.0.50.1.0

comment:4 Changed 10 years ago by Christopher Allan Webber

Hey Chris,

Still interested in working on this?



comment:5 Changed 10 years ago by Chris Moylan

Yes, I am still interested. I'm guessing this check can go right in
submit\_start in submit/views.py?



comment:6 Changed 10 years ago by Christopher Allan Webber

Totally lame for not responding... sorry, I was sent on a work trip
that threw me way off on my ability to reply to mediagoblin bugs.
But now I'm back, and for quite a while!

And the answer to your question is "yes, that sounds right, worst
comes to worst we'll shuffle things around after looking at it."



comment:7 Changed 10 years ago by Christopher Allan Webber

Milestone: 0.1.00.2.0

comment:8 Changed 10 years ago by Elrond

Milestone: 0.2.00.2.1

comment:7 Changed 10 years ago by Will Kahn-Greene

The original url for this bug was http://bugs.foocorp.net/issues/408 .
Relations:
#342: blocks

comment:8 Changed 10 years ago by Christopher Allan Webber

Hm hm.

So the current way we "handle" this is in the docs we tell people how to adjust the nginx file limit. That's fine for one-at-a-time submissions enough for now (though it doesn't give anything remotely near a useful error message once that limit is hit).

So I guess there are three things to consider still:

  • Is file uploading limits via apache/nginx way we're doing it currently enough?
  • Even if it is, it doesn't provide an error page if things go badly. Is there a way to handle that, at least with javascript? (I guess this ties into whether or not we're going to build a more ajaxy submission page)
  • Cumulative uploads: I'm actually much more interested in this at the moment, and if someone wants to take it on, it would be great. It would be good if we could set "upload limits" to say "X user is currently limited to 5GB of uploads" or whatever. Maybe that deserves a new ticket though. It also might be something that should wait till we have a plugin architecture.

comment:9 Changed 10 years ago by Christopher Allan Webber

Description: modified (diff)
Milestone: 0.2.1

I doubt we can get this done for 0.2.2 so I've taken it off that milestone.

comment:10 Changed 9 years ago by Aleksej

Type: defectenhancement

comment:11 Changed 9 years ago by Christopher Allan Webber

Owner: Chris Moylan deleted

I am assuming this isn't being presently coded on so I'm removing ownership, but would be happy to see this one claimed!

comment:12 Changed 8 years ago by rodney757

Status: acceptedreview

Branched from #89
https://github.com/rodney757/mediagoblin/tree/file_limits

A javascript check on the client side would be a nice addition.

comment:13 Changed 8 years ago by rodney757

When merged, can close #342

comment:14 Changed 8 years ago by rodney757

I updated the branch with my attempt of a js validation of the file and upload limits. Feel free not to use the js part if it's not correct. First time using the language :)

comment:15 Changed 8 years ago by Christopher Allan Webber

Assuming #89 is good, I think this should be merged with it also.

I like the approach you took... it's very clean!

The branches seem to have diverged in history though since this one was rebased and the other wasn't? I'd recommend making this the canonical one.

comment:16 Changed 8 years ago by rodney757

So I made the changes in your review of #89 and pushed them to this branch. We just need to have the cloud storage tested and I believe it is good to merge.

comment:17 Changed 8 years ago by rodney757

so joar tested the cloud storage and said that it was working

comment:18 Changed 8 years ago by Christopher Allan Webber

Resolution: fixed
Status: reviewclosed

Merged!

comment:19 Changed 8 years ago by Christopher Allan Webber

Resolution: fixed
Status: closedaccepted

Wait, I'm a doofus. I merged the one in #89 and not the one in here. I think I was supposed to do the reverse ;)

Anyway, pulling in the commits from this one also.

comment:20 Changed 8 years ago by Christopher Allan Webber

Resolution: fixed
Status: acceptedclosed

Okay, now I merged the right branch. That one Just Worked. Whew! Okay, done. :)

Note: See TracTickets for help on using tickets.