]> git.openstreetmap.org Git - rails.git/commitdiff
Merge branch 'pull/5209'
authorAnton Khorev <tony29@yandex.ru>
Wed, 18 Sep 2024 12:28:13 +0000 (15:28 +0300)
committerAnton Khorev <tony29@yandex.ru>
Wed, 18 Sep 2024 12:28:13 +0000 (15:28 +0300)
43 files changed:
.rubocop_todo.yml
Gemfile.lock
app/assets/images/key/opnvkarte/bus_stop13.svg [deleted file]
app/assets/images/key/opnvkarte/bus_stop15.svg [deleted file]
app/assets/images/key/opnvkarte/rail17.svg [deleted file]
app/assets/images/key/opnvkarte/stop13.svg [deleted file]
app/assets/images/key/opnvkarte/stop15.svg [deleted file]
app/assets/javascripts/embed.js.erb
app/assets/javascripts/user.js
app/controllers/application_controller.rb
app/controllers/users_controller.rb
app/helpers/browse_helper.rb
app/models/user.rb
app/views/changeset_comments/feeds/timeout.atom.builder [deleted file]
app/views/changeset_comments/feeds/timeout.html.erb [deleted file]
app/views/changeset_comments/feeds/timeout.rss.builder [new file with mode: 0644]
app/views/changesets/_paging_nav.html.erb
app/views/nodes/timeout.html.erb [new file with mode: 0644]
app/views/old_nodes/timeout.html.erb [new file with mode: 0644]
app/views/old_relations/timeout.html.erb [new file with mode: 0644]
app/views/old_ways/timeout.html.erb [new file with mode: 0644]
app/views/relations/timeout.html.erb [new file with mode: 0644]
app/views/user_mailer/friendship_notification.html.erb
app/views/user_mailer/friendship_notification.text.erb
app/views/users/_user.html.erb
app/views/users/show.html.erb
app/views/ways/timeout.html.erb [new file with mode: 0644]
config/i18n-tasks.yml
config/key.yml
config/locales/en.yml
db/migrate/20240912181413_backfill_user_creation_address.rb [new file with mode: 0644]
db/migrate/20240913171951_drop_user_creation_ip.rb [new file with mode: 0644]
db/structure.sql
script/update-spam-blocks
test/controllers/changeset_comments/feeds_controller_test.rb
test/controllers/nodes_controller_test.rb
test/controllers/old_nodes_controller_test.rb
test/controllers/old_relations_controller_test.rb
test/controllers/old_ways_controller_test.rb
test/controllers/relations_controller_test.rb
test/controllers/users_controller_test.rb
test/controllers/ways_controller_test.rb
test/system/users_test.rb [new file with mode: 0644]

index dc10923603bf422cd8cdff017f488fc4a40e3e29..7384a8d95fee5c43c197b7abebd7767f95779702 100644 (file)
@@ -26,6 +26,7 @@ FactoryBot/ExcessiveCreateList:
     - 'test/controllers/notes_controller_test.rb'
     - 'test/controllers/traces_controller_test.rb'
     - 'test/controllers/user_blocks_controller_test.rb'
+    - 'test/system/users_test.rb'
 
 # Offense count: 635
 # This cop supports safe autocorrection (--autocorrect).
index f496e5a98cdd0dd726e0ddf1d6bc40b3db085c03..1012a09dba6bf77628932b1f2afbcb9f7705f31d 100644 (file)
@@ -95,17 +95,17 @@ GEM
     autoprefixer-rails (10.4.19.0)
       execjs (~> 2)
     aws-eventstream (1.3.0)
-    aws-partitions (1.972.0)
-    aws-sdk-core (3.203.0)
+    aws-partitions (1.976.0)
+    aws-sdk-core (3.205.0)
       aws-eventstream (~> 1, >= 1.3.0)
       aws-partitions (~> 1, >= 1.651.0)
       aws-sigv4 (~> 1.9)
       jmespath (~> 1, >= 1.6.1)
-    aws-sdk-kms (1.89.0)
-      aws-sdk-core (~> 3, >= 3.203.0)
+    aws-sdk-kms (1.91.0)
+      aws-sdk-core (~> 3, >= 3.205.0)
       aws-sigv4 (~> 1.5)
-    aws-sdk-s3 (1.160.0)
-      aws-sdk-core (~> 3, >= 3.203.0)
+    aws-sdk-s3 (1.162.0)
+      aws-sdk-core (~> 3, >= 3.205.0)
       aws-sdk-kms (~> 1)
       aws-sigv4 (~> 1.5)
     aws-sigv4 (1.9.1)
@@ -265,7 +265,7 @@ GEM
       reline
     htmlentities (4.3.4)
     http_accept_language (2.1.1)
-    i18n (1.14.5)
+    i18n (1.14.6)
       concurrent-ruby (~> 1.0)
     i18n-js (3.9.2)
       i18n (>= 0.6.6)
@@ -299,7 +299,7 @@ GEM
     irb (1.14.0)
       rdoc (>= 4.0.0)
       reline (>= 0.4.2)
-    jbuilder (2.12.0)
+    jbuilder (2.13.0)
       actionview (>= 5.0.0)
       activesupport (>= 5.0.0)
     jmespath (1.6.2)
@@ -308,7 +308,7 @@ GEM
       railties (>= 4.2.0)
       thor (>= 0.14, < 2.0)
     json (2.7.2)
-    jwt (2.8.2)
+    jwt (2.9.0)
       base64
     kgio (2.11.4)
     kramdown (2.4.0)
@@ -384,8 +384,8 @@ GEM
     omniauth-github (2.0.1)
       omniauth (~> 2.0)
       omniauth-oauth2 (~> 1.8)
-    omniauth-google-oauth2 (1.1.3)
-      jwt (>= 2.0)
+    omniauth-google-oauth2 (1.2.0)
+      jwt (>= 2.9)
       oauth2 (~> 2.0)
       omniauth (~> 2.0)
       omniauth-oauth2 (~> 1.8)
@@ -499,7 +499,7 @@ GEM
     rexml (3.3.7)
     rinku (2.0.6)
     rotp (6.3.0)
-    rouge (4.3.0)
+    rouge (4.4.0)
     rtlcss (0.2.1)
       mini_racer (>= 0.6.3)
     rubocop (1.66.1)
@@ -521,7 +521,7 @@ GEM
     rubocop-minitest (0.36.0)
       rubocop (>= 1.61, < 2.0)
       rubocop-ast (>= 1.31.1, < 2.0)
-    rubocop-performance (1.21.1)
+    rubocop-performance (1.22.1)
       rubocop (>= 1.48.1, < 2.0)
       rubocop-ast (>= 1.31.1, < 2.0)
     rubocop-rails (2.26.1)
@@ -581,13 +581,13 @@ GEM
     thor (1.3.2)
     tilt (2.4.0)
     timeout (0.4.1)
-    turbo-rails (2.0.6)
+    turbo-rails (2.0.7)
       actionpack (>= 6.0.0)
       activejob (>= 6.0.0)
       railties (>= 6.0.0)
     tzinfo (2.0.6)
       concurrent-ruby (~> 1.0)
-    unicode-display_width (2.5.0)
+    unicode-display_width (2.6.0)
     uri (0.13.1)
     validates_email_format_of (1.8.2)
       i18n (>= 0.8.0)
diff --git a/app/assets/images/key/opnvkarte/bus_stop13.svg b/app/assets/images/key/opnvkarte/bus_stop13.svg
deleted file mode 100644 (file)
index ae4ffee..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns='http://www.w3.org/2000/svg' width='5' height='5'>
-<circle cx='2.5' cy='2.5' r='2.15' stroke='black' fill='#ffffff' />
-</svg>
diff --git a/app/assets/images/key/opnvkarte/bus_stop15.svg b/app/assets/images/key/opnvkarte/bus_stop15.svg
deleted file mode 100644 (file)
index a259919..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns='http://www.w3.org/2000/svg' width='9' height='9'>
-<circle cx='4.5' cy='4.5' r='4' stroke='black' fill='#ffffff' />
-</svg>
diff --git a/app/assets/images/key/opnvkarte/rail17.svg b/app/assets/images/key/opnvkarte/rail17.svg
deleted file mode 100644 (file)
index 8cada29..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<svg xmlns='http://www.w3.org/2000/svg' width='52' height='12' stroke='#999999' stroke-dashoffset='-1'>
-  <g stroke-dasharray='2 4'>
-    <line x2='100%' y1='1' y2='1' stroke-width='2' />
-    <line x2='100%' y1='6' y2='6' stroke-width='4' />
-    <line x2='100%' y1='11' y2='11' stroke-width='2' />
-  </g>
-  <line x2='100%' y1='2.5' y2='2.5' stroke-width='1' />
-  <line x2='100%' y1='9.5' y2='9.5' stroke-width='1' />
-</svg>
diff --git a/app/assets/images/key/opnvkarte/stop13.svg b/app/assets/images/key/opnvkarte/stop13.svg
deleted file mode 100644 (file)
index cfe65b3..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns='http://www.w3.org/2000/svg' width='5' height='5'>
-<circle cx='2.5' cy='2.5' r='2.15' stroke='black' fill='#e23148' />
-</svg>
diff --git a/app/assets/images/key/opnvkarte/stop15.svg b/app/assets/images/key/opnvkarte/stop15.svg
deleted file mode 100644 (file)
index 3ae6267..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns='http://www.w3.org/2000/svg' width='9' height='9'>
-<circle cx='4.5' cy='4.5' r='4' stroke='black' fill='#e23148' />
-</svg>
index 9a0ec07d31d85855c06a02d0179d29f7a298d207..66cd02b98b6e3199161b6baee64c24ef8a3a46e0 100644 (file)
@@ -37,18 +37,16 @@ window.onload = function () {
   map.attributionControl.setPrefix('');
   map.removeControl(map.attributionControl);
 
-  if (!args.layer || args.layer === "mapnik" || args.layer === "osmarender" || args.layer === "mapquest") {
-    new L.OSM.Mapnik(mapnikOptions).addTo(map);
-  } else if (args.layer === "cyclosm") {
+  if (args.layer === "cyclosm") {
     new L.OSM.CyclOSM().addTo(map);
   } else if (args.layer === "cyclemap" || args.layer === "cycle map") {
     new L.OSM.CycleMap(thunderforestOptions).addTo(map);
   } else if (args.layer === "transportmap") {
     new L.OSM.TransportMap(thunderforestOptions).addTo(map);
-  } else if (args.layer === "opnvkarte") {
-    new L.OSM.OPNVKarte().addTo(map);
   } else if (args.layer === "hot") {
     new L.OSM.HOT().addTo(map);
+  } else {
+    new L.OSM.Mapnik(mapnikOptions).addTo(map);
   }
 
   if (args.marker) {
index 495470f2fd10ea35281b5f0377d9d19130bc8099..681ec3ace82470b0caa52b7fd87562dbefa17f6a 100644 (file)
@@ -1,5 +1,11 @@
 //= require leaflet.locatecontrol/src/L.Control.Locate
 
+(function () {
+  $(document).on("change", "#user_all", function () {
+    $("#user_list input[type=checkbox]").prop("checked", $("#user_all").prop("checked"));
+  });
+}());
+
 $(document).ready(function () {
   var defaultHomeZoom = 12;
   var map, marker, deleted_lat, deleted_lon;
@@ -200,10 +206,6 @@ $(document).ready(function () {
     enableAuth();
   }
 
-  $("#user_all").change(function () {
-    $("#user_list input[type=checkbox]").prop("checked", $("#user_all").prop("checked"));
-  });
-
   $("#content.user_confirm").each(function () {
     $(this).hide();
     $(this).find("#confirm").submit();
index 4b36607bb00a988b671ce3f2da760633f0aabeba..fdc2ac4e8694191790ffadab11ae9bbe5e55dc54 100644 (file)
@@ -216,20 +216,25 @@ class ApplicationController < ActionController::Base
   ##
   # wrap a web page in a timeout
   def web_timeout(&block)
+    raise Timeout::Error if Settings.web_timeout.negative?
+
     Timeout.timeout(Settings.web_timeout, &block)
   rescue ActionView::Template::Error => e
     e = e.cause
 
     if e.is_a?(Timeout::Error) ||
        (e.is_a?(ActiveRecord::StatementInvalid) && e.message.include?("execution expired"))
-      ActiveRecord::Base.connection.raw_connection.cancel
-      render :action => "timeout"
+      respond_to_timeout
     else
       raise
     end
   rescue Timeout::Error
+    respond_to_timeout
+  end
+
+  def respond_to_timeout
     ActiveRecord::Base.connection.raw_connection.cancel
-    render :action => "timeout"
+    render :action => "timeout", :status => :gateway_timeout
   end
 
   ##
index fc893c9c3194f6c40a65ce61e1d73e9824ba0747..63a83ad1da8ad9803c3980ade89dbe0755398bea 100644 (file)
@@ -36,7 +36,7 @@ class UsersController < ApplicationController
 
       users = User.all
       users = users.where(:status => @params[:status]) if @params[:status]
-      users = users.where(:creation_ip => @params[:ip]) if @params[:ip]
+      users = users.where(:creation_address => @params[:ip]) if @params[:ip]
 
       @users_count = users.limit(501).count
       @users_count = I18n.t("count.at_least_pattern", :count => 500) if @users_count > 500
@@ -268,7 +268,6 @@ class UsersController < ApplicationController
   def save_new_user(email_hmac, referer = nil)
     current_user.data_public = true
     current_user.description = "" if current_user.description.nil?
-    current_user.creation_ip = request.remote_ip
     current_user.creation_address = request.remote_ip
     current_user.languages = http_accept_language.user_preferred_languages
     current_user.terms_agreed = Time.now.utc
index 0ea10e219080812e79a94e07d415fdfdb4bfff07..9ea38481137d77afeb46ccfe615860e4b2cecf24 100644 (file)
@@ -86,13 +86,13 @@ module BrowseHelper
     max_width_for_default_padding = 35
 
     width = 0
-    pagination_items(pages, {}).each do |body|
+    pagination_items(pages, {}).each do |(body)|
       width += 2 # padding width
       width += body.length
     end
     link_classes = ["page-link", { "px-1" => width > max_width_for_default_padding }]
 
-    tag.ul :class => "pagination pagination-sm mb-1 ms-auto" do
+    tag.ul :class => "pagination pagination-sm mb-2" do
       pagination_items(pages, {}).each do |body, page_or_class|
         linked = !(page_or_class.is_a? String)
         link = if linked
index 441805f390e4c4a206aff7bb5bf23ba9bed41173..6b54182569415d58040cb738b6b93766ce93bcf1 100644 (file)
@@ -15,7 +15,6 @@
 #  pass_salt            :string
 #  email_valid          :boolean          default(FALSE), not null
 #  new_email            :string
-#  creation_ip          :string
 #  languages            :string
 #  status               :enum             default("pending"), not null
 #  terms_agreed         :datetime
@@ -50,6 +49,8 @@ class User < ApplicationRecord
   require "digest"
   include AASM
 
+  self.ignored_columns += ["creation_ip"]
+
   has_many :traces, -> { where(:visible => true) }
   has_many :diary_entries, -> { order(:created_at => :desc) }, :inverse_of => :user
   has_many :diary_comments, -> { order(:created_at => :desc) }, :inverse_of => :user
diff --git a/app/views/changeset_comments/feeds/timeout.atom.builder b/app/views/changeset_comments/feeds/timeout.atom.builder
deleted file mode 100644 (file)
index b5eeeed..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-atom_feed(:language => I18n.locale, :schema_date => 2009,
-          :id => url_for(params.merge(:only_path => false)),
-          :root_url => url_for(params.merge(:only_path => false, :format => nil)),
-          "xmlns:georss" => "http://www.georss.org/georss") do |feed|
-  feed.title @title
-
-  feed.subtitle :type => "xhtml" do |xhtml|
-    xhtml.p do |p|
-      p << t(".sorry")
-    end
-  end
-end
diff --git a/app/views/changeset_comments/feeds/timeout.html.erb b/app/views/changeset_comments/feeds/timeout.html.erb
deleted file mode 100644 (file)
index 641b1df..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<p><%= t ".sorry" %></p>
diff --git a/app/views/changeset_comments/feeds/timeout.rss.builder b/app/views/changeset_comments/feeds/timeout.rss.builder
new file mode 100644 (file)
index 0000000..c56ebb8
--- /dev/null
@@ -0,0 +1,12 @@
+xml.rss("version" => "2.0",
+        "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
+  xml.channel do
+    if params[:changeset_id]
+      xml.title t("changeset_comments.feeds.show.title_particular", :changeset_id => params[:changeset_id])
+    else
+      xml.title t("changeset_comments.feeds.show.title_all")
+    end
+    xml.link root_url
+    xml.description t(".sorry")
+  end
+end
index fbdf1d50773c1e1d728e1877c982efe3f5a8801c..0587382222de27d64af44dc64dbc04ffff8c1a03 100644 (file)
@@ -1,11 +1,9 @@
-<div class="d-flex flex-wrap gap-2">
-  <h4 class="fs-5 mb-0"><%= type_and_paginated_count(type, pages) %></h4>
-  <% if pages.page_count > 1 %>
-    <%= sidebar_classic_pagination(pages, "#{type}_page") do |page|
-          {
-            :title => type_and_paginated_count(type, pages, page),
-            :data => { :turbo => "true" }
-          }
-        end %>
-  <% end %>
-</div>
+<h4 class="fs-5"><%= type_and_paginated_count(type, pages) %></h4>
+<% if pages.page_count > 1 %>
+  <%= sidebar_classic_pagination(pages, "#{type}_page") do |page|
+        {
+          :title => type_and_paginated_count(type, pages, page),
+          :data => { :turbo => "true" }
+        }
+      end %>
+<% end %>
diff --git a/app/views/nodes/timeout.html.erb b/app/views/nodes/timeout.html.erb
new file mode 100644 (file)
index 0000000..61415c6
--- /dev/null
@@ -0,0 +1,5 @@
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
diff --git a/app/views/old_nodes/timeout.html.erb b/app/views/old_nodes/timeout.html.erb
new file mode 100644 (file)
index 0000000..61415c6
--- /dev/null
@@ -0,0 +1,5 @@
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
diff --git a/app/views/old_relations/timeout.html.erb b/app/views/old_relations/timeout.html.erb
new file mode 100644 (file)
index 0000000..61415c6
--- /dev/null
@@ -0,0 +1,5 @@
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
diff --git a/app/views/old_ways/timeout.html.erb b/app/views/old_ways/timeout.html.erb
new file mode 100644 (file)
index 0000000..61415c6
--- /dev/null
@@ -0,0 +1,5 @@
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
diff --git a/app/views/relations/timeout.html.erb b/app/views/relations/timeout.html.erb
new file mode 100644 (file)
index 0000000..61415c6
--- /dev/null
@@ -0,0 +1,5 @@
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
index ee2dea2ebfad31cb0bfc5a19c54cda347b0eda77..40af762d70ff6f0698c0e2bb28c6e6b3b0f62c27 100644 (file)
@@ -1,3 +1,5 @@
+<p><%= t ".hi", :to_user => @friendship.befriendee.display_name %></p>
+
 <p><%= t ".had_added_you", :user => @friendship.befriender.display_name %></p>
 
 <%= message_body do %>
index 22c2bbfe7e6efcf14845bb4ec87843d6abc2b3c1..104b0f1c925f63a2c4820974c69dd986249647b7 100644 (file)
@@ -1,3 +1,5 @@
+<%= t ".hi", :to_user => @friendship.befriendee.display_name %>
+
 <%= t '.had_added_you', :user => @friendship.befriender.display_name %>
 
 <%= t '.see_their_profile', :userurl => @viewurl %>
index ef50ccaf2fb4bffa27c19ce8950fbbd6b7e13209..2fb14b6bdf7056f2196e4c476905f49480e0d758 100644 (file)
@@ -4,10 +4,10 @@
   </td>
   <td>
     <p>
-      <% if user.creation_ip %>
+      <% if user.creation_address %>
         <%= t "users.index.summary_html",
               :name => link_to(user.display_name, user),
-              :ip_address => link_to(user.creation_ip, :ip => user.creation_ip),
+              :ip_address => link_to(user.creation_address, :ip => user.creation_address),
               :date => l(user.created_at, :format => :friendly) %>
       <% else %>
         <%= t "users.index.summary_no_ip_html",
index c73581b25a8493d4d6edcbbc43dbfd4cf4afdf71..d479b1d56dad13e0ab1e94e5188f8b6331ccf2cd 100644 (file)
               <%= link_to t(".comments"), diary_comments_path(@user) %>
               <span class='badge count-number'><%= number_with_delimiter(@user.diary_comments.size) %></span>
             </li>
-            <li>
-              <% if current_user and current_user.friends_with?(@user) %>
-                <%= link_to t(".remove as friend"), remove_friend_path(:display_name => @user.display_name), :method => :post %>
-              <% elsif current_user %>
-                <%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name), :method => :post %>
-              <% else %>
-                <%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name) %>
-              <% end %>
-            </li>
+            <% if current_user %>
+              <li>
+                <% if current_user.friends_with?(@user) %>
+                  <%= link_to t(".remove as friend"), remove_friend_path(:display_name => @user.display_name), :method => :post %>
+                <% else %>
+                  <%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name), :method => :post %>
+                <% end %>
+              </li>
+            <% end %>
 
             <% if @user.blocks.exists? %>
               <li>
             <dl class="list-inline">
               <dt class="list-inline-item m-0"><%= t ".email address" %></dt>
               <dd class="list-inline-item"><%= @user.email %></dd>
-              <% unless @user.creation_ip.nil? -%>
+              <% unless @user.creation_address.nil? -%>
                 <dt class="list-inline-item m-0"><%= t ".created from" %></dt>
-                <dd class="list-inline-item"><%= link_to @user.creation_ip, users_path(:ip => @user.creation_ip) %></dd>
+                <dd class="list-inline-item"><%= link_to @user.creation_address, users_path(:ip => @user.creation_address) %></dd>
               <% end -%>
               <dt class="list-inline-item m-0"><%= t ".status" %></dt>
               <dd class="list-inline-item"><%= link_to @user.status.capitalize, users_path(:status => @user.status) %></dd>
diff --git a/app/views/ways/timeout.html.erb b/app/views/ways/timeout.html.erb
new file mode 100644 (file)
index 0000000..61415c6
--- /dev/null
@@ -0,0 +1,5 @@
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
index 225078a515e380b5a7ddf48f2f14ef809277f015..2ed3b2e91d41919de31ccddd9a5a2b132565e2a9 100644 (file)
@@ -123,6 +123,7 @@ ignore_unused:
   - 'geocoder.search_osm_nominatim.prefix.*'
   - 'javascripts.*'
   - 'doorkeeper.*'
+  - 'users.auth_failure.*'   # OmniAuth provider callback error messages
   - 'activerecord.attributes.*'
   - 'activerecord.models.*'
   - 'activerecord.help.*'
index 032a2470465df5ad9d3b271b9e748da2aaf41c77..798d9ca546db80f0b82960bb79f0db13078615f0 100644 (file)
@@ -158,57 +158,3 @@ cyclemap:
   - { min_zoom: 15, name: bicycle_parking, image: bicycle_parking.png }
   - { min_zoom: 16, name: bicycle_parking_small, image: bicycle_parking_small.svg }
   - { min_zoom: 16, name: toilets, image: toilets.png }
-opnvkarte:
-  - { min_zoom:  6, name: rail, width: 52, height: 1, fill: "#868686" }
-  - { min_zoom:  8, name: rail, width: 52, height: 2, fill: "#868686" }
-  - { min_zoom: 11, name: rail, width: 52, height: 3, fill: "#868686", line: "#eeeeee", line-dasharray: 10, line-dashoffset: 9 }
-  - { min_zoom: 15, name: rail, width: 52, height: 4, fill: "#868686", line: "#eeeeee", line-dasharray: 10, line-dashoffset: 9, line-width: 2 }
-  - { min_zoom: 17, name: rail, image: rail17.svg }
-  - { min_zoom:  6, name: train, width: 52, height:  2, fill: "#ffc366" }
-  - { min_zoom: 10, name: train, width: 52, height:  3, fill: "#ffc366" }
-  - { min_zoom: 12, name: train, width: 52, height:  4, fill: "#ffc366" }
-  - { min_zoom: 14, name: train, width: 52, height:  8, fill: "#ffc366" }
-  - { min_zoom: 16, name: train, width: 52, height: 10, fill: "#ffc366" }
-  - { min_zoom: 10, name: light_rail, width: 52, height:  3, fill: "#66ff66" }
-  - { min_zoom: 12, name: light_rail, width: 52, height:  4, fill: "#66ff66" }
-  - { min_zoom: 14, name: light_rail, width: 52, height:  8, fill: "#66ff66" }
-  - { min_zoom: 16, name: light_rail, width: 52, height: 10, fill: "#66ff66" }
-  - { min_zoom: 10, name: tram, width: 52, height:  3, fill: "#3333fe" }
-  - { min_zoom: 12, name: tram, width: 52, height:  4, fill: "#3333fe" }
-  - { min_zoom: 14, name: tram, width: 52, height:  8, fill: "#3333fe" }
-  - { min_zoom: 16, name: tram, width: 52, height: 10, fill: "#3333fe" }
-  - { min_zoom: 10, name: subway, width: 52, height:  3, fill: "#33339f" }
-  - { min_zoom: 12, name: subway, width: 52, height:  4, fill: "#33339f" }
-  - { min_zoom: 14, name: subway, width: 52, height:  8, fill: "#33339f" }
-  - { min_zoom: 16, name: subway, width: 52, height: 10, fill: "#33339f" }
-  - { min_zoom:  9, name: ferry, width: 52, height: 2, fill: "#9f339f" }
-  - { min_zoom: 14, name: ferry, width: 52, height: 3, fill: "#9f339f" }
-  - { min_zoom: 10, name: trolleybus, width: 52, height:  3, fill: "#9f3333" }
-  - { min_zoom: 12, name: trolleybus, width: 52, height:  4, fill: "#9f3333" }
-  - { min_zoom: 14, name: trolleybus, width: 52, height:  8, fill: "#9f3333" }
-  - { min_zoom: 16, name: trolleybus, width: 52, height: 10, fill: "#9f3333" }
-  - { min_zoom: 11, name: bus, width: 52, height:  1, fill: "#fe3333" }
-  - { min_zoom: 12, name: bus, width: 52, height:  2, fill: "#fe3333" }
-  - { min_zoom: 13, name: bus, width: 52, height:  3, fill: "#fe3333" }
-  - { min_zoom: 14, name: bus, width: 52, height:  4, fill: "#fe3333" }
-  - { min_zoom: 16, name: bus, width: 52, height: 10, fill: "#fe3333" }
-  - { min_zoom: 13, name: bus_stop, image: bus_stop13.svg }
-  - { min_zoom: 15, name: bus_stop, image: bus_stop15.svg }
-  - { min_zoom: 13, name: stop, image: stop13.svg }
-  - { min_zoom: 15, name: stop, image: stop15.svg }
-  - { min_zoom:  8, name: motorway, width: 52, height:  4, fill: "#dddddd", casing: "#6d6d6d" }
-  - { min_zoom: 13, name: motorway, width: 52, height:  8, fill: "#dddddd", casing: "#6d6d6d" }
-  - { min_zoom: 15, name: motorway, width: 52, height: 13, fill: "#dddddd", casing: "#6d6d6d", line: "#ffffff", line-dasharray: 12, line-dashoffset: 4 }
-  - { min_zoom: 17, name: motorway, width: 52, height: 17, fill: "#dddddd", casing: "#6d6d6d", line: "#ffffff", line-dasharray: 12, line-dashoffset: 4, casing-width: 2 }
-  - { min_zoom:  8, name: main_road, width: 52, height:  1, fill: "#5c6d6d88" }
-  - { min_zoom: 11, name: main_road, width: 52, height:  4, fill: "#dddddd", casing: "#a1968b" }
-  - { min_zoom: 13, name: main_road, width: 52, height:  8, fill: "#dddddd", casing: "#a1968b" }
-  - { min_zoom: 15, name: main_road, width: 52, height: 13, fill: "#dddddd", casing: "#a1968b" }
-  - { min_zoom: 17, name: main_road, width: 52, height: 17, fill: "#dddddd", casing: "#a1968b" }
-  # landcover
-  - { min_zoom:  0, name: [lake, reservoir], width: 26, height: 10, fill: "#a1cbea" }
-  - { min_zoom:  8, name: [lake, reservoir], width: 26, height: 10, fill: "#bfd3ef" }
-  - { min_zoom:  4, name: [forest, wood], width: 26, height: 10, fill: "#b9c5a3" }
-  - { min_zoom:  4, name: built_up, width: 26, height: 10, fill: "#d8d8d8" }
-  - { min_zoom:  9, name: farmland, width: 26, height: 10, fill: "#eae8d6" }
-  - { min_zoom: 12, name: [park, allotments], width: 26, height: 10, fill: "#c2d89a" }
index feacfcf12d613a24c1942652f631bbd77d57d910..fc2ab125e42414fb5c71d83098d5a4fb9e37632f 100644 (file)
@@ -369,7 +369,7 @@ en:
         note: note
     timeout:
       title: Timeout Error
-      sorry: "Sorry, the data for the %{type} with the id %{id}, took too long to retrieve."
+      sorry: "Sorry, the data for the %{type} with the id %{id} took too long to retrieve."
       type:
         node: node
         way: way
@@ -403,15 +403,30 @@ en:
       introduction: "Click on the map to find nearby features."
       nearby: "Nearby features"
       enclosing: "Enclosing features"
+  nodes:
+    timeout:
+      sorry: "Sorry, the data for the node with the id %{id} took too long to retrieve."
   old_nodes:
     not_found:
       sorry: "Sorry, node #%{id} version %{version} could not be found."
+    timeout:
+      sorry: "Sorry, the history of the node with the id %{id} took too long to retrieve."
+  ways:
+    timeout:
+      sorry: "Sorry, the data for the way with the id %{id} took too long to retrieve."
   old_ways:
     not_found:
       sorry: "Sorry, way #%{id} version %{version} could not be found."
+    timeout:
+      sorry: "Sorry, the history of the way with the id %{id} took too long to retrieve."
+  relations:
+    timeout:
+      sorry: "Sorry, the data for the relation with the id %{id} took too long to retrieve."
   old_relations:
     not_found:
       sorry: "Sorry, relation #%{id} version %{version} could not be found."
+    timeout:
+      sorry: "Sorry, the history of the relation with the id %{id} took too long to retrieve."
   changeset_comments:
     feeds:
       comment:
@@ -1434,10 +1449,6 @@ en:
         level9: "Village Boundary"
         level10: "Suburb Boundary"
         level11: "Neighbourhood Boundary"
-      types:
-        cities: Cities
-        towns: Towns
-        places: Places
     results:
       no_results: "No results found"
       more_results: "More results"
@@ -1672,7 +1683,6 @@ en:
     changeset_comment_notification:
       description: "OpenStreetMap Changeset #%{id}"
       hi: "Hi %{to_user},"
-      greeting: "Hi,"
       commented:
         subject_own: "[OpenStreetMap] %{commenter} has commented on one of your changesets"
         subject_other: "[OpenStreetMap] %{commenter} has commented on a changeset you are interested in"
@@ -2384,7 +2394,6 @@ en:
           destination: "Destination access"
           construction: "Roads under construction"
           bus_stop: "Bus stop"
-          stop: "Stop"
           bicycle_shop: "Bicycle shop"
           bicycle_rental: "Bicycle rental"
           bicycle_parking: "Bicycle parking"
@@ -2685,7 +2694,6 @@ en:
         contributor_terms_url: "https://wiki.osmfoundation.org/wiki/Licence/Contributor_Terms"
         contributor_terms: "contributor terms"
       tou: "terms of use"
-      external auth: "Third Party Authentication:"
       continue: Sign Up
       terms accepted: "Thanks for accepting the new contributor terms!"
       email_help:
diff --git a/db/migrate/20240912181413_backfill_user_creation_address.rb b/db/migrate/20240912181413_backfill_user_creation_address.rb
new file mode 100644 (file)
index 0000000..3cc14f2
--- /dev/null
@@ -0,0 +1,14 @@
+class BackfillUserCreationAddress < ActiveRecord::Migration[7.1]
+  class User < ApplicationRecord
+  end
+
+  def up
+    User
+      .where(:creation_address => nil)
+      .where.not(:creation_ip => nil)
+      .in_batches(:of => 1000)
+      .update_all("creation_address = creation_ip::inet")
+  end
+
+  def down; end
+end
diff --git a/db/migrate/20240913171951_drop_user_creation_ip.rb b/db/migrate/20240913171951_drop_user_creation_ip.rb
new file mode 100644 (file)
index 0000000..7915f6e
--- /dev/null
@@ -0,0 +1,5 @@
+class DropUserCreationIp < ActiveRecord::Migration[7.1]
+  def change
+    safety_assured { remove_column :users, :creation_ip, :string }
+  end
+end
index 9318185c6a22980ea96fe6689addd10c7f492f2a..25b2f173fc6f2a42d00856e3b94c7bec45818b4c 100644 (file)
@@ -1482,7 +1482,6 @@ CREATE TABLE public.users (
     pass_salt character varying,
     email_valid boolean DEFAULT false NOT NULL,
     new_email character varying,
-    creation_ip character varying,
     languages character varying,
     status public.user_status_enum DEFAULT 'pending'::public.user_status_enum NOT NULL,
     terms_agreed timestamp without time zone,
@@ -3357,6 +3356,8 @@ INSERT INTO "schema_migrations" (version) VALUES
 ('23'),
 ('22'),
 ('21'),
+('20240913171951'),
+('20240912181413'),
 ('20240910175616'),
 ('20240822121603'),
 ('20240813070506'),
index b5656f6ac0b5b7aad20208084b990789985fdc9b..7d665454582a842ebb09d6bf2d313dcee955a64d 100755 (executable)
@@ -8,7 +8,7 @@ addresses = User.count(
     :status => %w[suspended deleted],
     :creation_time => Time.now.utc - 28.days..Time.now.utc
   },
-  :group => :creation_ip
+  :group => :creation_address
 )
 
 addresses.each do |address, count|
index 20db62cefce8479bb56951aeebbb4135ab938459..4858eb085c417a72cb0763ed96d7870a47676829 100644 (file)
@@ -68,5 +68,25 @@ module ChangesetComments
       get changesets_comments_feed_path(:format => "rss", :limit => 100001)
       assert_response :bad_request
     end
+
+    def test_feed_timeout
+      with_settings(:web_timeout => -1) do
+        get changesets_comments_feed_path
+      end
+      assert_response :error
+      assert_equal "application/rss+xml; charset=utf-8", @response.header["Content-Type"]
+      assert_dom "rss>channel>title", :text => "OpenStreetMap changeset discussion"
+      assert_dom "rss>channel>description", :text => /the list of changeset comments you requested took too long to retrieve/
+    end
+
+    def test_feed_changeset_timeout
+      with_settings(:web_timeout => -1) do
+        get changeset_comments_feed_path(123)
+      end
+      assert_response :error
+      assert_equal "application/rss+xml; charset=utf-8", @response.header["Content-Type"]
+      assert_dom "rss>channel>title", :text => "OpenStreetMap changeset #123 discussion"
+      assert_dom "rss>channel>description", :text => /the list of changeset comments you requested took too long to retrieve/
+    end
   end
 end
index 5bb08ea7104ba3ad21e531e1a9901ccb8a47a2ed..a294327231d78ca0b54b5e5f338ae305f27221d6 100644 (file)
@@ -90,4 +90,15 @@ class NodesControllerTest < ActionDispatch::IntegrationTest
     assert_select ".secondary-actions a", :text => "View History", :count => 1
     assert_select ".secondary-actions a", :text => "View Unredacted History", :count => 1
   end
+
+  def test_show_timeout
+    node = create(:node)
+    with_settings(:web_timeout => -1) do
+      get node_path(node)
+    end
+    assert_response :error
+    assert_template :layout => "map"
+    assert_dom "h2", "Timeout Error"
+    assert_dom "p", /#{Regexp.quote("the node with the id #{node.id}")}/
+  end
 end
index bb4dffdc6e74636fd8c118e9bcc8207ceb7c775a..abaf30d62e68563e5f694e0a015b7e57668f77b4 100644 (file)
@@ -218,6 +218,17 @@ class OldNodesControllerTest < ActionDispatch::IntegrationTest
     assert_select "#sidebar_content", /node #0 version 0 could not be found/
   end
 
+  def test_show_timeout
+    node = create(:node, :with_history)
+    with_settings(:web_timeout => -1) do
+      get old_node_path(node, 1)
+    end
+    assert_response :error
+    assert_template :layout => "map"
+    assert_dom "h2", "Timeout Error"
+    assert_dom "p", /#{Regexp.quote("the node with the id #{node.id}")}/
+  end
+
   private
 
   def create_redacted_node
index a766f8b8db113178edf13a4504c8f8a622d6f646..f5de706cf59e92220e4ec5c2348e6dd9e06c7a9c 100644 (file)
@@ -177,6 +177,17 @@ class OldRelationsControllerTest < ActionDispatch::IntegrationTest
     assert_select "#sidebar_content", /relation #0 version 0 could not be found/
   end
 
+  def test_show_timeout
+    relation = create(:relation, :with_history)
+    with_settings(:web_timeout => -1) do
+      get old_relation_path(relation, 1)
+    end
+    assert_response :error
+    assert_template :layout => "map"
+    assert_dom "h2", "Timeout Error"
+    assert_dom "p", /#{Regexp.quote("the relation with the id #{relation.id}")}/
+  end
+
   private
 
   def create_redacted_relation
index 6455343cfa63af9b1e4c43cb28bab6b9bbb021a6..fcc2281b85753cec329c579cf81366a76a171fd2 100644 (file)
@@ -182,6 +182,17 @@ class OldWaysControllerTest < ActionDispatch::IntegrationTest
     assert_select "#sidebar_content", /way #0 version 0 could not be found/
   end
 
+  def test_show_timeout
+    way = create(:way, :with_history)
+    with_settings(:web_timeout => -1) do
+      get old_way_path(way, 1)
+    end
+    assert_response :error
+    assert_template :layout => "map"
+    assert_dom "h2", "Timeout Error"
+    assert_dom "p", /#{Regexp.quote("the way with the id #{way.id}")}/
+  end
+
   private
 
   def create_redacted_way
index 926d9502638c1650b46ae44182e6e723b045e933..bdcbd2fd7bf386df6d0e49887761394808fbff1f 100644 (file)
@@ -36,4 +36,15 @@ class RelationsControllerTest < ActionDispatch::IntegrationTest
     sidebar_browse_check :relation_path, member.id, "browse/feature"
     assert_select "a[href='#{relation_path relation}']", :count => 1
   end
+
+  def test_show_timeout
+    relation = create(:relation)
+    with_settings(:web_timeout => -1) do
+      get relation_path(relation)
+    end
+    assert_response :error
+    assert_template :layout => "map"
+    assert_dom "h2", "Timeout Error"
+    assert_dom "p", /#{Regexp.quote("the relation with the id #{relation.id}")}/
+  end
 end
index 4f4edf10b034a82ad562b995bbb5328ab6db0382..dda157f01552cbcbc62664b64183d9e83ed56ae8 100644 (file)
@@ -476,7 +476,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
     moderator_user = create(:moderator_user)
     administrator_user = create(:administrator_user)
     _suspended_user = create(:user, :suspended)
-    _ip_user = create(:user, :creation_ip => "1.2.3.4")
+    _ip_user = create(:user, :creation_address => "1.2.3.4")
 
     # There are now 7 users - the five above, plus two extra "granters" for the
     # moderator_user and administrator_user
index e198f7cf6091f08af424b110955c86e6420d1739..995004cb4179236a95c8998263b90e872ae9366b 100644 (file)
@@ -36,4 +36,15 @@ class WaysControllerTest < ActionDispatch::IntegrationTest
     sidebar_browse_check :way_path, member.id, "browse/feature"
     assert_select "a[href='#{relation_path relation}']", :count => 1
   end
+
+  def test_show_timeout
+    way = create(:way)
+    with_settings(:web_timeout => -1) do
+      get way_path(way)
+    end
+    assert_response :error
+    assert_template :layout => "map"
+    assert_dom "h2", "Timeout Error"
+    assert_dom "p", /#{Regexp.quote("the way with the id #{way.id}")}/
+  end
 end
diff --git a/test/system/users_test.rb b/test/system/users_test.rb
new file mode 100644 (file)
index 0000000..5d5bf56
--- /dev/null
@@ -0,0 +1,28 @@
+require "application_system_test_case"
+
+class UsersTest < ApplicationSystemTestCase
+  def setup
+    admin = create(:administrator_user)
+    sign_in_as(admin)
+  end
+
+  test "all users can be selected" do
+    create_list(:user, 100)
+
+    visit users_path
+
+    assert_css "tbody input[type=checkbox]:checked", :count => 0
+    assert_css "tbody input[type=checkbox]:not(:checked)", :count => 50
+    check "user_all"
+    assert_css "tbody input[type=checkbox]:checked", :count => 50
+    assert_css "tbody input[type=checkbox]:not(:checked)", :count => 0
+
+    click_on "Older Users", :match => :first
+
+    assert_css "tbody input[type=checkbox]:checked", :count => 0
+    assert_css "tbody input[type=checkbox]:not(:checked)", :count => 50
+    check "user_all"
+    assert_css "tbody input[type=checkbox]:checked", :count => 50
+    assert_css "tbody input[type=checkbox]:not(:checked)", :count => 0
+  end
+end