]> git.openstreetmap.org Git - chef.git/commitdiff
Apply signup rate limits to the main site
authorTom Hughes <tom@compton.nu>
Sun, 27 Aug 2023 08:50:40 +0000 (09:50 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 27 Aug 2023 08:51:21 +0000 (09:51 +0100)
cookbooks/web/recipes/rails.rb
cookbooks/web/resources/rails_port.rb

index 90411d552e8a6c38064c66b083af8b1f27179fc7..90bd16c0abbb9e62797a485a5347909af948d90a 100644 (file)
@@ -143,6 +143,10 @@ rails_port "www.openstreetmap.org" do
   trace_image_storage_url "https://openstreetmap-gps-images.s3.dualstack.eu-west-1.amazonaws.com"
   overpass_url "https://query.openstreetmap.org/query-features"
   overpass_credentials true
+  signup_ip_per_day 24
+  signup_ip_max_burst 48
+  signup_email_per_day 1
+  signup_email_max_burst 2
   imagery_blacklist [
     # Current Google imagery URLs have google or googleapis in the domain
     ".*\\.google(apis)?\\..*/.*",
index 34ae014587928b942d458ef2cade3a27f6ea65ef..3854235283769dcaff466a2834ab4d09254cd829 100644 (file)
@@ -86,6 +86,10 @@ property :trace_image_storage_url, String
 property :trace_icon_storage_url, String
 property :tile_cdn_url, String
 property :imagery_blacklist, Array
+property :signup_ip_per_day, Integer
+property :signup_ip_max_burst, Integer
+property :signup_email_per_day, Integer
+property :signup_email_max_burst, Integer
 
 action :create do
   package %W[
@@ -336,7 +340,11 @@ action :create do
     "trace_image_storage_url",
     "trace_icon_storage_url",
     "tile_cdn_url",
-    "imagery_blacklist"
+    "imagery_blacklist",
+    "signup_ip_per_day",
+    "signup_ip_max_burst",
+    "signup_email_per_day",
+    "signup_email_max_burst"
   ).compact.merge(
     "server_protocol" => "https",
     "server_url" => new_resource.site,