BustByte / coronastatus

Anonymous crowd sourcing of COVID-19 symptoms all over the world (with public data sets)!
MIT License
173 stars 89 forks source link

Enhance rate limit handling, add email config param #483

Closed sbocinec closed 4 years ago

sbocinec commented 4 years ago

Changes

Details

Rate limit enhancements

The original express-rate-limit code returns default generic message on exceeding the configured rate limit: Too many requests, please try again later. (English only). What's worse, administrators don't have any clue this is happening.

Users often share their IPv4 IP address as operators are using IPv6 and provide a shared IPv4 IP for hundreds of users. I've already experienced this on the SK deployment when users were affected unable to submit their reports until one user notified me having no clue what's going on.

This PR tries to address this situation and brings new /limit route, that can provide more localized info for users and also give us (admins) information, the rate limit has been reached (seeing /limit route in the analytics).

Email as a config param

Twitter handler was the only configurable contact available on the site. There are countries where twitter is not very popular or used, or some people don't have twitter account unable to contact us.

fossecode commented 4 years ago

Since this a page that is not part of the ordinary flow, I guess it is ok to merge it without getting translations for all languages first. In the rare case where people hit the rate limit, it should be ok that it is in english.

fossecode commented 4 years ago

Could you fix the conflicts, and then we'll merge!

fossecode commented 4 years ago

Is this one ready to be merged?

sbocinec commented 4 years ago

Is this one ready to be merged?

Going to rebase and will be ready soon :-)