[openstreetmap/openstreetmap-website] Add rate limiting for changeset comments (PR #4202)

Tom Hughes notifications at github.com
Fri Aug 25 18:30:14 UTC 2023


This inspired by but not identical to the algorithm proposed in #4196.

It ramps up to a specified maximum rate (default 60 per hour or 1 per minute) over the first two hundred changesets, subject to a configured minimum that defaults to 1 every 10 minutes with each unresolved report of the user halving the limit.

By my calculations this algorithm, with these defaults, will take just under 12 hours to reach the maximum limit if you constantly post as soon as you can - so that would be two hundred posts in 12 hours after which you can do 60 per hour and all assuming nobody has reported you.

Moderators have an arbitrary high limit of ten per second.

The down rating for reports might be a bit harsh but we can adjust it if that turns out the be the case.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4202

-- Commit Summary --

  * Add rate limiting for changeset comments

-- File Changes --

    M app/assets/javascripts/index/changeset.js (6)
    M app/controllers/api/changeset_comments_controller.rb (1)
    M app/models/user.rb (13)
    M app/views/browse/changeset.html.erb (2)
    M config/settings.yml (3)
    A db/migrate/20230825162137_restore_author_index_to_changeset_comments.rb (7)
    M db/structure.sql (7)
    M lib/osm.rb (7)
    M test/controllers/api/changeset_comments_controller_test.rb (21)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4202.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4202.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4202
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4202 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230825/39065949/attachment.htm>


More information about the rails-dev mailing list