zerebubuth / openstreetmap-cgimap

A C++ implementation of the OpenStreetMap API map call.
http://wiki.openstreetmap.org/wiki/Cgimap
GNU General Public License v2.0
73 stars 38 forks source link

Add the ability to limit changeset size #413

Closed mmd-osm closed 5 months ago

mmd-osm commented 5 months ago

See #412 for details.

For reviewers out there, please add inline comments as needed. Thanks!

Introduces a new config option: bbox-size-limit-upload (boolean value)

simonpoole commented 5 months ago

[this fits a bit better here] 1st reaction:

mmd-osm commented 5 months ago

HTTP status code 413 is matching the Rails implementation. If there's some issue with it, it would have to be changed there as well. I'm using HTTP 413 at the moment to reject large uploads (>50MB), a feature which is not present on Rails. It's not unlikely that some editing apps have no idea how to deal with this status code.

simonpoole commented 5 months ago

It's not unlikely that some editing apps have no idea how to deal with this status code.

Well I assume that they will simply display the text message, but that is -very- different than its use being documented and displaying a translated message appropriate to the situation.

Note that this is not about informing vandals, but giving unsuspecting normal users a hint they can understand what caused the problem and what is the best action to take.

mmd-osm commented 5 months ago

I'm going to merge this now, to open up testing for everyone on the dev instance https://master.apis.dev.openstreetmap.org

Once it is merged and new binaries are built, can you (@tomhughes) please add a new config setting in https://github.com/openstreetmap/chef/blob/master/cookbooks/dev/templates/default/cgimap.environment.erb

CGIMAP_BBOX_SIZE_LIMIT_UPLOAD="true"

for this new parameter?

  --bbox-size-limit-upload arg  enable bbox size limit for changeset upload