From: Anton Khorev Date: Mon, 12 Sep 2022 22:52:23 +0000 (+0300) Subject: Merge tooltip fixes/tests X-Git-Tag: live~1953^2~5 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/e409e83b4886ce918c64f5c4cd7fa30cbc1ba14f?hp=31a39d3479462ced8127f0f12e3f0133ce39263a Merge tooltip fixes/tests --- diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml index e556dfa72..696b2cfbd 100644 --- a/.github/ISSUE_TEMPLATE/feature.yml +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -4,18 +4,26 @@ description: You want to request a feature, share an idea or have a question. # labels: # assignees: body: + - type: textarea + id: idea + attributes: + label: Problem + description: Please describe the problem or use case that is the cause for your feature request or idea. + placeholder: + validations: + required: false - type: textarea id: idea attributes: label: Description - description: Please describe you feature request, idea or question. + description: Please describe your feature request, idea or question. placeholder: validations: required: false - type: textarea attributes: label: Screenshots - description: Please add screenshots if they can help us understand your request/idea/question. + description: Please add screenshots or mockups if they can help us understand your request/idea/question. placeholder: validations: required: false diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cc2420730..6f88614ab 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -26,8 +26,8 @@ jobs: sleep 15 # let the DB warm up a little - name: Prepare Database run: | - docker-compose run --rm web rake db:migrate - docker-compose run web bundle exec rake i18n:js:export + docker-compose run --rm web bundle exec rails db:migrate + docker-compose run --rm web bundle exec rails i18n:js:export docker-compose run --rm web osmosis --rx docker/null-island.osm.xml --wd host=db database=openstreetmap user=openstreetmap password=openstreetmap validateSchemaVersion=no - name: Test Basic Website run: | diff --git a/.gitignore b/.gitignore index 73316769e..75e9eb59e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ .vagrant app/assets/javascripts/i18n config/environments/*.local.yml -config/piwik.yml config/settings.local.yml config/settings/*.local.yml coverage diff --git a/Gemfile b/Gemfile index 9f4f745ff..020cc9166 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" # Require rails -gem "rails", "7.0.3.1" +gem "rails", "7.0.4" # Require json for multi_json gem "json" @@ -36,6 +36,9 @@ gem "image_optim_rails" # Use argon2 for password hashing gem "argon2" +# Support brotli compression for assets +gem "sprockets-exporters_pack" + # Load rails plugins gem "actionpack-page_caching", ">= 1.2.0" gem "activerecord-import" @@ -47,7 +50,7 @@ gem "composite_primary_keys", "~> 14.0.0" gem "config" gem "delayed_job_active_record" gem "http_accept_language", "~> 2.1.1" -gem "i18n-js", ">= 3.0.0" +gem "i18n-js", "~> 3.9.2" gem "oauth-plugin", ">= 0.5.1" gem "openstreetmap-deadlock_retry", ">= 1.3.1", :require => "deadlock_retry" gem "rack-cors" diff --git a/Gemfile.lock b/Gemfile.lock index 4de4c7996..925d57d06 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,79 +3,79 @@ GEM specs: aasm (5.3.0) concurrent-ruby (~> 1.0) - actioncable (7.0.3.1) - actionpack (= 7.0.3.1) - activesupport (= 7.0.3.1) + actioncable (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.3.1) - actionpack (= 7.0.3.1) - activejob (= 7.0.3.1) - activerecord (= 7.0.3.1) - activestorage (= 7.0.3.1) - activesupport (= 7.0.3.1) + actionmailbox (7.0.4) + actionpack (= 7.0.4) + activejob (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.3.1) - actionpack (= 7.0.3.1) - actionview (= 7.0.3.1) - activejob (= 7.0.3.1) - activesupport (= 7.0.3.1) + actionmailer (7.0.4) + actionpack (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activesupport (= 7.0.4) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.3.1) - actionview (= 7.0.3.1) - activesupport (= 7.0.3.1) + actionpack (7.0.4) + actionview (= 7.0.4) + activesupport (= 7.0.4) rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) actionpack-page_caching (1.2.4) actionpack (>= 4.0.0) - actiontext (7.0.3.1) - actionpack (= 7.0.3.1) - activerecord (= 7.0.3.1) - activestorage (= 7.0.3.1) - activesupport (= 7.0.3.1) + actiontext (7.0.4) + actionpack (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.3.1) - activesupport (= 7.0.3.1) + actionview (7.0.4) + activesupport (= 7.0.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) active_record_union (1.3.0) activerecord (>= 4.0) - activejob (7.0.3.1) - activesupport (= 7.0.3.1) + activejob (7.0.4) + activesupport (= 7.0.4) globalid (>= 0.3.6) - activemodel (7.0.3.1) - activesupport (= 7.0.3.1) - activerecord (7.0.3.1) - activemodel (= 7.0.3.1) - activesupport (= 7.0.3.1) + activemodel (7.0.4) + activesupport (= 7.0.4) + activerecord (7.0.4) + activemodel (= 7.0.4) + activesupport (= 7.0.4) activerecord-import (1.4.0) activerecord (>= 4.2) - activestorage (7.0.3.1) - actionpack (= 7.0.3.1) - activejob (= 7.0.3.1) - activerecord (= 7.0.3.1) - activesupport (= 7.0.3.1) + activestorage (7.0.4) + actionpack (= 7.0.4) + activejob (= 7.0.4) + activerecord (= 7.0.4) + activesupport (= 7.0.4) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.3.1) + activesupport (7.0.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) annotate (3.2.0) activerecord (>= 3.2, < 8.0) rake (>= 10.4, < 14.0) @@ -86,8 +86,8 @@ GEM autoprefixer-rails (10.4.7.0) execjs (~> 2) aws-eventstream (1.2.0) - aws-partitions (1.610.0) - aws-sdk-core (3.131.3) + aws-partitions (1.628.0) + aws-sdk-core (3.144.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) @@ -105,17 +105,16 @@ GEM coderay (>= 1.0.0) erubi (>= 1.0.0) rack (>= 0.9.0) - better_html (1.0.16) - actionview (>= 4.0) - activesupport (>= 4.0) + better_html (2.0.1) + actionview (>= 6.0) + activesupport (>= 6.0) ast (~> 2.0) erubi (~> 1.4) - html_tokenizer (~> 0.0.6) parser (>= 2.4) smart_properties binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) - bootsnap (1.12.0) + bootsnap (1.13.0) msgpack (~> 1.2) bootstrap (5.1.3) autoprefixer-rails (>= 9.1.0) @@ -124,7 +123,8 @@ GEM bootstrap_form (5.1.0) actionpack (>= 5.2) activemodel (>= 5.2) - brakeman (5.2.3) + brakeman (5.3.1) + brotli (0.4.0) browser (5.3.1) builder (3.2.4) bzip2-ffi (1.1.0) @@ -163,23 +163,23 @@ GEM delayed_job (>= 3.0, < 5) digest (3.1.0) docile (1.4.0) - doorkeeper (5.5.4) + doorkeeper (5.6.0) railties (>= 5) doorkeeper-i18n (5.2.4) doorkeeper (>= 5.2) dry-configurable (0.15.0) concurrent-ruby (~> 1.0) dry-core (~> 0.6) - dry-container (0.10.0) + dry-container (0.10.1) concurrent-ruby (~> 1.0) - dry-core (0.8.0) + dry-core (0.8.1) concurrent-ruby (~> 1.0) dry-inflector (0.3.0) dry-initializer (3.1.1) dry-logic (1.2.0) concurrent-ruby (~> 1.0) dry-core (~> 0.5, >= 0.5) - dry-schema (1.9.3) + dry-schema (1.10.2) concurrent-ruby (~> 1.0) dry-configurable (~> 0.13, >= 0.13.0) dry-core (~> 0.5, >= 0.5) @@ -198,15 +198,14 @@ GEM dry-core (~> 0.5, >= 0.5) dry-initializer (~> 3.0) dry-schema (~> 1.8, >= 1.8.0) - erb_lint (0.1.3) + erb_lint (0.2.0) activesupport - better_html (~> 1.0.7) - html_tokenizer + better_html (>= 2.0.1) parser (>= 2.7.1.4) rainbow rubocop smart_properties - erubi (1.10.0) + erubi (1.11.0) execjs (2.8.1) exifr (1.3.9) factory_bot (6.2.1) @@ -214,10 +213,10 @@ GEM factory_bot_rails (6.2.0) factory_bot (~> 6.2.0) railties (>= 5.0.0) - faraday (2.3.0) - faraday-net_http (~> 2.0) + faraday (2.5.2) + faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) - faraday-net_http (2.0.3) + faraday-net_http (3.0.0) ffi (1.15.5) ffi-compiler (1.0.1) ffi (>= 1.0.0) @@ -231,7 +230,6 @@ GEM activesupport (>= 5.0) hashdiff (1.0.1) hashie (5.0.0) - html_tokenizer (0.0.7) htmlentities (4.3.4) http_accept_language (2.1.1) i18n (1.12.0) @@ -262,7 +260,7 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (2.6.2) - jwt (2.4.1) + jwt (2.5.0) kgio (2.11.4) kramdown (2.4.0) rexml @@ -285,8 +283,8 @@ GEM mini_magick (4.11.0) mini_mime (1.1.2) mini_portile2 (2.8.0) - minitest (5.16.2) - msgpack (1.5.4) + minitest (5.16.3) + msgpack (1.5.6) multi_json (1.15.0) multi_xml (0.6.0) net-imap (0.2.3) @@ -353,13 +351,13 @@ GEM omniauth-oauth2 (~> 1.4) openstreetmap-deadlock_retry (1.3.1) parallel (1.22.1) - parser (3.1.2.0) + parser (3.1.2.1) ast (~> 2.4.1) - pg (1.4.1) + pg (1.4.3) popper_js (2.11.5) progress (3.6.0) - public_suffix (4.0.7) - puma (5.6.4) + public_suffix (5.0.0) + puma (5.6.5) nio4r (~> 2.0) quad_tile (1.0.1) r2 (0.2.7) @@ -375,20 +373,20 @@ GEM rack-test (2.0.2) rack (>= 1.3) rack-uri_sanitizer (0.0.2) - rails (7.0.3.1) - actioncable (= 7.0.3.1) - actionmailbox (= 7.0.3.1) - actionmailer (= 7.0.3.1) - actionpack (= 7.0.3.1) - actiontext (= 7.0.3.1) - actionview (= 7.0.3.1) - activejob (= 7.0.3.1) - activemodel (= 7.0.3.1) - activerecord (= 7.0.3.1) - activestorage (= 7.0.3.1) - activesupport (= 7.0.3.1) + rails (7.0.4) + actioncable (= 7.0.4) + actionmailbox (= 7.0.4) + actionmailer (= 7.0.4) + actionpack (= 7.0.4) + actiontext (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activemodel (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) bundler (>= 1.15.0) - railties (= 7.0.3.1) + railties (= 7.0.4) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -401,16 +399,16 @@ GEM rails-i18n (7.0.5) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.3.1) - actionpack (= 7.0.3.1) - activesupport (= 7.0.3.1) + railties (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) method_source rake (>= 12.2) thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) - rb-fsevent (0.11.1) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (2.5.0) @@ -419,27 +417,27 @@ GEM rexml (3.2.5) rinku (2.0.6) rotp (6.2.0) - rubocop (1.32.0) + rubocop (1.36.0) json (~> 2.3) parallel (~> 1.10) - parser (>= 3.1.0.0) + parser (>= 3.1.2.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.19.1, < 2.0) + rubocop-ast (>= 1.20.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.19.1) + rubocop-ast (1.21.0) parser (>= 3.1.1.0) - rubocop-minitest (0.20.1) + rubocop-minitest (0.22.0) rubocop (>= 0.90, < 2.0) rubocop-performance (1.14.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.15.2) + rubocop-rails (2.16.0) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.7.0, < 2.0) + rubocop (>= 1.33.0, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) ruby-openid (2.9.2) @@ -459,8 +457,8 @@ GEM sprockets (> 3.0) sprockets-rails tilt - secure_headers (6.3.4) - selenium-webdriver (4.3.0) + secure_headers (6.4.0) + selenium-webdriver (4.4.0) childprocess (>= 0.5, < 5.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) @@ -476,11 +474,14 @@ GEM sprockets (4.1.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) + sprockets-exporters_pack (0.1.2) + brotli (>= 0.2.0) + sprockets (>= 4.0.0.beta3) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - strong_migrations (1.2.0) + strong_migrations (1.3.0) activerecord (>= 5.2) strscan (3.0.4) terser (1.1.12) @@ -491,10 +492,10 @@ GEM tzinfo (2.0.5) concurrent-ruby (~> 1.0) unicode-display_width (2.2.0) - validates_email_format_of (1.6.3) + validates_email_format_of (1.7.2) i18n vendorer (0.2.0) - webmock (3.14.0) + webmock (3.18.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -544,7 +545,7 @@ DEPENDENCIES gd2-ffij (>= 0.4.0) htmlentities http_accept_language (~> 2.1.1) - i18n-js (>= 3.0.0) + i18n-js (~> 3.9.2) image_optim_rails image_processing jbuilder (~> 2.7) @@ -574,7 +575,7 @@ DEPENDENCIES r2 (~> 0.2.7) rack-cors rack-uri_sanitizer - rails (= 7.0.3.1) + rails (= 7.0.4) rails-controller-testing rails-i18n (~> 7.0.0) rinku (>= 2.0.6) @@ -590,6 +591,7 @@ DEPENDENCIES selenium-webdriver simplecov simplecov-lcov + sprockets-exporters_pack strong_migrations terser validates_email_format_of (>= 1.5.1) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..c1ad6e5ac --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,9 @@ +# Security Policy + +## Reporting a Vulnerability + +We welcome any reports of security vulnerabilities, and we will respond to you quickly to acknowledge receipt. + +To report a vulnerability please email [the maintainers using this link](mailto:tom@compton.nu;openstreetmap-website@gravitystorm.co.uk;security@openstreetmap.org). This will also notify the security team for the main deployment of this software. + +Please note that we do not offer any bug bounties and we do not participate in any bug programs. If your security report is validated by us, then we are happy to credit you publicly in our issue tracker, on request. diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 740990fb3..89f60847f 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -13,7 +13,7 @@ //= require leaflet.locationfilter //= require i18n //= require oauth -//= require piwik +//= require matomo //= require richtext //= require qs/dist/qs //= require bs-custom-file-input diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index f0b96f59f..5ba36a455 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -1,5 +1,6 @@ //= require_self //= require leaflet.sidebar +//= require leaflet.sidebar-pane //= require leaflet.locatecontrol/src/L.Control.Locate //= require leaflet.layers //= require leaflet.key @@ -195,7 +196,7 @@ $(document).ready(function () { $(".welcome").addClass("visible"); } - $(".welcome .close").on("click", function () { + $(".welcome .btn-close").on("click", function () { $(".welcome").removeClass("visible"); Cookies.set("_osm_welcome", "hide", { secure: true, expires: expiry, path: "/", samesite: "lax" }); }); @@ -203,7 +204,7 @@ $(document).ready(function () { var bannerExpiry = new Date(); bannerExpiry.setYear(bannerExpiry.getFullYear() + 1); - $("#banner .close-wrap").on("click", function (e) { + $("#banner .btn-close").on("click", function (e) { var cookieId = e.target.id; $("#banner").hide(); e.preventDefault(); @@ -212,13 +213,13 @@ $(document).ready(function () { } }); - if (OSM.PIWIK) { + if (OSM.MATOMO) { map.on("layeradd", function (e) { if (e.layer.options) { - var goal = OSM.PIWIK.goals[e.layer.options.keyid]; + var goal = OSM.MATOMO.goals[e.layer.options.keyid]; if (goal) { - $("body").trigger("piwikgoal", goal); + $("body").trigger("matomogoal", goal); } } }); diff --git a/app/assets/javascripts/index/browse.js b/app/assets/javascripts/index/browse.js index 1140515f5..61319f7b4 100644 --- a/app/assets/javascripts/index/browse.js +++ b/app/assets/javascripts/index/browse.js @@ -48,20 +48,20 @@ OSM.initializeBrowse = function (map) { function displayFeatureWarning(count, limit, add, cancel) { $("#browse_status").html( - $("
") - .append( - $("

") - .text(I18n.t("browse.start_rjs.load_data")) - .prepend($("").click(cancel))) - .append( - $("
") - .append( - $("

") - .text(I18n.t("browse.start_rjs.feature_warning", { num_features: count, max_features: limit }))) - .append( - $("") - .val(I18n.t("browse.start_rjs.load_data")) - .click(add)))); + $("
").append( + $("
").append( + $("
").append( + $("

") + .text(I18n.t("browse.start_rjs.load_data"))), + $("
").append( + $("