Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to limit changeset size #413

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

mmd-osm
Copy link
Collaborator

@mmd-osm mmd-osm commented Jun 19, 2024

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)

@mmd-osm mmd-osm force-pushed the patch/issue_412 branch 4 times, most recently from 53b3989 to 772425a Compare June 19, 2024 21:11
@mmd-osm mmd-osm marked this pull request as ready for review June 19, 2024 21:11
Copy link
Contributor

@pnorman pnorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I note that we're returning a HTTP 413 error in PR #413.

src/api06/changeset_upload_handler.cpp Show resolved Hide resolved
src/api06/changeset_upload_handler.cpp Outdated Show resolved Hide resolved
@mmd-osm mmd-osm force-pushed the patch/issue_412 branch 2 times, most recently from b2a8e7c to 58c0823 Compare June 20, 2024 05:51
@simonpoole
Copy link

simonpoole commented Jun 20, 2024

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

  • we don't return 413 anywhere except for the user pref api currently (and I suspect that most editors don't use that) at least not documented and this may lead to breakage.
  • the error text is too verbose, just return something like "Changeset bounding box size limit exceeded" ("blocked" has negative associations).

@mmd-osm
Copy link
Collaborator Author

mmd-osm commented Jun 20, 2024

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
Copy link

simonpoole commented Jun 20, 2024

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
Copy link
Collaborator Author

mmd-osm commented Jun 20, 2024

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

@mmd-osm mmd-osm merged commit f5b3265 into zerebubuth:master Jun 20, 2024
5 checks passed
@mmd-osm mmd-osm deleted the patch/issue_412 branch July 8, 2024 17:31
@mmd-osm mmd-osm added this to the v2.0.0 milestone Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants