diff --git a/.rubocop.yml b/.rubocop.yml index 57d22e083..02fd23ffd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,5 @@ AllCops: + TargetRubyVersion: 2.3 Exclude: - "bin/**/*" - "db/schema.rb" @@ -152,7 +153,7 @@ Style/Documentation: Enabled: false # This is just silly. Calling the argument `other` in all cases makes no sense. -Style/OpMethod: +Naming/BinaryOperatorParameterName: Enabled: false # There are valid cases, for example debugging Cucumber steps, @@ -167,9 +168,3 @@ Style/NumericPredicate: # Reset some HoundCI changes back to Rubocop defaults Layout/DotPosition: EnforcedStyle: leading - -### backward compatibility - -# only with ruby >= 2.4 -Performance/RegexpMatch: - Enabled: false diff --git a/.travis.yml b/.travis.yml index e4b310171..966101451 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: ruby rvm: - - 2.4.1 - - 2.3.4 + - 2.4.2 + - 2.3.5 env: - DB=postgresql BUILD_TYPE=cucumber diff --git a/Changelog.md b/Changelog.md index 5d4c0b42c..4c49c2585 100644 --- a/Changelog.md +++ b/Changelog.md @@ -31,11 +31,13 @@ * Display likes and reshares without login [#7583](https://github.com/diaspora/diaspora/pull/7583) * Fix invalid data in the database for user data export [#7614](https://github.com/diaspora/diaspora/pull/7614) * Fix local migration run without old private key [#7558](https://github.com/diaspora/diaspora/pull/7558) +* Fix export not downloadable because the filename was resetted on access [#7622](https://github.com/diaspora/diaspora/pull/7622) ## Features * Ask for confirmation when leaving a submittable comment field [#7530](https://github.com/diaspora/diaspora/pull/7530) * Show users vote in polls [#7550](https://github.com/diaspora/diaspora/pull/7550) * Add explanation of ignore function to in-app help section [#7585](https://github.com/diaspora/diaspora/pull/7585) +* Add camo information to NodeInfo [#7617](https://github.com/diaspora/diaspora/pull/7617) # 0.7.0.1 diff --git a/Gemfile b/Gemfile index 59bfb5d91..5d55323e2 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "rails", "5.1.3" +gem "rails", "5.1.4" # Legacy Rails features, remove me! # responders (class level) @@ -55,12 +55,12 @@ gem "rack-cors", "1.0.1", require: "rack/cors" # CSS -gem "autoprefixer-rails", "7.1.2.4" +gem "autoprefixer-rails", "7.1.4.1" gem "bootstrap-sass", "3.3.7" gem "bootstrap-switch-rails", "3.3.3" gem "compass-rails", "3.0.2" gem "sass-rails", "5.0.6" -gem "sprockets-rails", "3.2.0" +gem "sprockets-rails", "3.2.1" # Database @@ -72,12 +72,12 @@ group :postgresql, optional: true do end -gem "activerecord-import", "0.19.1" +gem "activerecord-import", "0.20.1" # File uploading gem "carrierwave", "1.1.0" -gem "fog-aws", "1.4.0" +gem "fog-aws", "1.4.1" gem "mini_magick", "4.8.0" # GUID generation @@ -91,7 +91,7 @@ gem "entypo-rails", "3.0.0" gem "handlebars_assets", "0.23.2" gem "jquery-rails", "4.3.1" -gem "js-routes", "1.3.3" +gem "js-routes", "1.4.1" gem "js_image_paths", "0.1.1" source "https://rails-assets.org" do @@ -99,7 +99,7 @@ source "https://rails-assets.org" do gem "rails-assets-jquery.ui", "1.11.4" gem "rails-assets-highlightjs", "9.12.0" - gem "rails-assets-markdown-it", "8.3.2" + gem "rails-assets-markdown-it", "8.4.0" gem "rails-assets-markdown-it-hashtag", "0.4.0" gem "rails-assets-markdown-it-diaspora-mention", "1.2.0" gem "rails-assets-markdown-it-sanitizer", "0.4.3" @@ -115,7 +115,7 @@ source "https://rails-assets.org" do # jQuery plugins gem "rails-assets-autosize", "4.0.0" - gem "rails-assets-blueimp-gallery", "2.25.2" + gem "rails-assets-blueimp-gallery", "2.27.0" gem "rails-assets-jquery.are-you-sure", "1.9.0" gem "rails-assets-jquery-placeholder", "2.3.1" gem "rails-assets-jquery-textchange", "0.2.3" @@ -133,7 +133,7 @@ gem "rails-i18n", "5.0.4" gem "markerb", "1.1.0" # Map -gem "leaflet-rails", "1.1.0" +gem "leaflet-rails", "1.2.0" # Parsing @@ -149,7 +149,7 @@ gem "string-direction", "1.2.0" # Security Headers -gem "secure_headers", "3.6.7" +gem "secure_headers", "3.7.1" # Services @@ -177,11 +177,11 @@ gem "acts-as-taggable-on", "5.0.0" # URIs and HTTP -gem "addressable", "2.5.1", require: "addressable/uri" +gem "addressable", "2.5.2", require: "addressable/uri" gem "faraday", "0.11.0" # also update User-Agent in OpenID specs -gem "faraday_middleware", "0.11.0.1" +gem "faraday_middleware", "0.12.2" gem "faraday-cookie_jar", "0.0.6" -gem "typhoeus", "1.1.2" +gem "typhoeus", "1.3.0" # Views @@ -246,12 +246,12 @@ group :development do # Linters gem "haml_lint", "0.26.0", require: false - gem "pronto", "0.9.4", require: false + gem "pronto", "0.9.5", require: false gem "pronto-eslint", "0.9.1", require: false gem "pronto-haml", "0.9.0", require: false gem "pronto-rubocop", "0.9.0", require: false gem "pronto-scss", "0.9.1", require: false - gem "rubocop", "0.49.1", require: false + gem "rubocop", "0.50.0", require: false # Preloading environment @@ -306,7 +306,7 @@ group :development, :test do gem "cucumber-rails", "1.5.0", require: false # Jasmine (client side application tests (JS)) - gem "jasmine", "2.7.0" + gem "jasmine", "2.8.0" gem "jasmine-jquery-rails", "2.0.3" gem "rails-assets-jasmine-ajax", "3.3.1", source: "https://rails-assets.org" gem "sinon-rails", "1.15.0" diff --git a/Gemfile.lock b/Gemfile.lock index 54c6372cf..7e55f4293 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,25 +2,25 @@ GEM remote: https://rubygems.org/ remote: https://rails-assets.org/ specs: - actioncable (5.1.3) - actionpack (= 5.1.3) + actioncable (5.1.4) + actionpack (= 5.1.4) nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.1.3) - actionpack (= 5.1.3) - actionview (= 5.1.3) - activejob (= 5.1.3) + actionmailer (5.1.4) + actionpack (= 5.1.4) + actionview (= 5.1.4) + activejob (= 5.1.4) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.1.3) - actionview (= 5.1.3) - activesupport (= 5.1.3) + actionpack (5.1.4) + actionview (= 5.1.4) + activesupport (= 5.1.4) rack (~> 2.0) - rack-test (~> 0.6.3) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.3) - activesupport (= 5.1.3) + actionview (5.1.4) + activesupport (= 5.1.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -28,18 +28,18 @@ GEM active_model_serializers (0.9.7) activemodel (>= 3.2) concurrent-ruby (~> 1.0) - activejob (5.1.3) - activesupport (= 5.1.3) + activejob (5.1.4) + activesupport (= 5.1.4) globalid (>= 0.3.6) - activemodel (5.1.3) - activesupport (= 5.1.3) - activerecord (5.1.3) - activemodel (= 5.1.3) - activesupport (= 5.1.3) + activemodel (5.1.4) + activesupport (= 5.1.4) + activerecord (5.1.4) + activemodel (= 5.1.4) + activesupport (= 5.1.4) arel (~> 8.0) - activerecord-import (0.19.1) + activerecord-import (0.20.1) activerecord (>= 3.2) - activesupport (5.1.3) + activesupport (5.1.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) @@ -50,8 +50,8 @@ GEM activemodel (>= 3.0.0) activesupport (>= 3.0.0) rack (>= 1.1.0) - addressable (2.5.1) - public_suffix (~> 2.0, >= 2.0.2) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) arel (8.0.0) asset_sync (2.2.0) activemodel (>= 4.1.0) @@ -60,17 +60,17 @@ GEM unf ast (2.3.0) attr_required (1.0.1) - autoprefixer-rails (7.1.2.4) + autoprefixer-rails (7.1.4.1) execjs bcrypt (3.1.11) - bindata (2.4.0) + bindata (2.4.1) bootstrap-sass (3.3.7) autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) bootstrap-switch-rails (3.3.3) buftok (0.2.0) builder (3.2.3) - byebug (9.0.6) + byebug (9.1.0) capybara (2.15.1) addressable mini_mime (>= 0.1.3) @@ -105,7 +105,7 @@ GEM timers (>= 4.1.1) chunky_png (1.3.8) cliver (0.3.2) - coderay (1.1.1) + coderay (1.1.2) compass (1.0.3) chunky_png (~> 1.2) compass-core (~> 1.0.2) @@ -133,6 +133,7 @@ GEM tins (~> 1.6) crack (0.4.3) safe_yaml (~> 1.0.0) + crass (1.0.2) cucumber (2.4.0) builder (>= 2.1.2) cucumber-core (~> 1.5.0) @@ -195,7 +196,7 @@ GEM tzinfo ethon (0.10.1) ffi (>= 1.3.0) - excon (0.58.0) + excon (0.59.0) execjs (2.7.0) eye (0.9.2) celluloid (~> 0.17.3) @@ -203,7 +204,7 @@ GEM sigar (~> 0.7.3) state_machines thor - fabrication (2.16.2) + fabrication (2.16.3) factory_girl (4.8.0) activesupport (>= 3.0.0) factory_girl_rails (4.8.0) @@ -214,13 +215,13 @@ GEM faraday-cookie_jar (0.0.6) faraday (>= 0.7.4) http-cookie (~> 1.0.0) - faraday_middleware (0.11.0.1) + faraday_middleware (0.12.2) faraday (>= 0.7.4, < 1.0) ffi (1.9.18) fixture_builder (0.5.0) activerecord (>= 2) activesupport (>= 2) - fog-aws (1.4.0) + fog-aws (1.4.1) fog-core (~> 1.38) fog-json (~> 1.0) fog-xml (~> 0.1) @@ -272,7 +273,7 @@ GEM guard-rubocop (1.3.0) guard (~> 2.0) rubocop (~> 0.20) - haml (5.0.2) + haml (5.0.3) temple (>= 0.8.0) tilt haml_lint (0.26.0) @@ -289,7 +290,7 @@ GEM execjs (~> 2.0) sprockets (>= 2.0.0) tilt (>= 1.2) - hashdiff (0.3.5) + hashdiff (0.3.6) hashie (3.5.6) hitimes (1.2.6) http (2.2.2) @@ -302,7 +303,7 @@ GEM http-form_data (1.0.3) http_accept_language (2.1.1) http_parser.rb (0.6.0) - httparty (0.14.0) + httparty (0.15.6) multi_xml (>= 0.5.2) httpclient (2.8.3) i18n (0.8.6) @@ -313,18 +314,18 @@ GEM i18n-inflector (~> 2.6) railties (>= 3.0.0) ipaddress (0.8.3) - jasmine (2.7.0) - jasmine-core (>= 2.7.0, < 3.0.0) + jasmine (2.8.0) + jasmine-core (>= 2.8.0, < 3.0.0) phantomjs rack (>= 1.2.1) rake - jasmine-core (2.7.0) + jasmine-core (2.8.0) jasmine-jquery-rails (2.0.3) jquery-rails (4.3.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - js-routes (1.3.3) + js-routes (1.4.1) railties (>= 3.2) sprockets-rails js_image_paths (0.1.1) @@ -346,7 +347,7 @@ GEM multi_json jwt (1.5.6) kgio (2.11.0) - leaflet-rails (1.1.0) + leaflet-rails (1.2.0) rails (>= 4.2.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) @@ -358,7 +359,8 @@ GEM multi_json (~> 1.10) logging-rails (0.6.0) logging (>= 1.8) - loofah (2.0.3) + loofah (2.1.1) + crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.0.12) macaddr (1.7.1) @@ -379,7 +381,7 @@ GEM mobile-fu (1.4.0) rack-mobile-detect rails - multi_json (1.12.1) + multi_json (1.12.2) multi_test (0.1.2) multi_xml (0.6.0) multipart-post (2.0.0) @@ -445,9 +447,9 @@ GEM cliver (~> 0.3.1) websocket-driver (>= 0.2.0) powerpack (0.1.1) - pronto (0.9.4) + pronto (0.9.5) gitlab (~> 4.0, >= 4.0.0) - httparty (>= 0.13.7, < 0.15) + httparty (>= 0.13.7) octokit (~> 4.7, >= 4.7.0) rainbow (~> 2.1) rugged (~> 0.24, >= 0.23.0) @@ -464,14 +466,13 @@ GEM pronto-scss (0.9.1) pronto (~> 0.9.0) scss_lint (~> 0.43, >= 0.43.0) - pry (0.10.4) + pry (0.11.0) coderay (~> 1.1.0) method_source (~> 0.8.1) - slop (~> 3.4) - pry-byebug (3.4.2) - byebug (~> 9.0) + pry-byebug (3.5.0) + byebug (~> 9.1) pry (~> 0.10) - public_suffix (2.0.5) + public_suffix (3.0.0) rack (2.0.3) rack-cors (1.0.1) rack-google-analytics (1.2.0) @@ -491,24 +492,24 @@ GEM rack-rewrite (1.5.1) rack-ssl (1.4.1) rack - rack-test (0.6.3) - rack (>= 1.0) - rails (5.1.3) - actioncable (= 5.1.3) - actionmailer (= 5.1.3) - actionpack (= 5.1.3) - actionview (= 5.1.3) - activejob (= 5.1.3) - activemodel (= 5.1.3) - activerecord (= 5.1.3) - activesupport (= 5.1.3) + rack-test (0.7.0) + rack (>= 1.0, < 3) + rails (5.1.4) + actioncable (= 5.1.4) + actionmailer (= 5.1.4) + actionpack (= 5.1.4) + actionview (= 5.1.4) + activejob (= 5.1.4) + activemodel (= 5.1.4) + activerecord (= 5.1.4) + activesupport (= 5.1.4) bundler (>= 1.3.0) - railties (= 5.1.3) + railties (= 5.1.4) sprockets-rails (>= 2.0.0) rails-assets-autosize (4.0.0) rails-assets-backbone (1.3.3) rails-assets-underscore (>= 1.8.3) - rails-assets-blueimp-gallery (2.25.2) + rails-assets-blueimp-gallery (2.27.0) rails-assets-bootstrap (3.3.7) rails-assets-jquery (>= 1.9.1, < 4) rails-assets-bootstrap-markdown (2.10.0) @@ -526,7 +527,7 @@ GEM rails-assets-favico.js (0.3.10) rails-assets-fine-uploader (5.13.0) rails-assets-highlightjs (9.12.0) - rails-assets-jasmine (2.7.0) + rails-assets-jasmine (2.8.0) rails-assets-jasmine-ajax (3.3.1) rails-assets-jasmine (~> 2) rails-assets-jquery (3.2.1) @@ -543,7 +544,7 @@ GEM rails-assets-jquery.ui (1.11.4) rails-assets-jquery (>= 1.6) rails-assets-markdown-it--markdown-it-for-inline (0.1.1) - rails-assets-markdown-it (8.3.2) + rails-assets-markdown-it (8.4.0) rails-assets-markdown-it-diaspora-mention (1.2.0) rails-assets-markdown-it-hashtag (0.4.0) rails-assets-markdown-it-sanitizer (0.4.3) @@ -566,16 +567,16 @@ GEM rails-timeago (2.16.0) actionpack (>= 3.1) activesupport (>= 3.1) - railties (5.1.3) - actionpack (= 5.1.3) - activesupport (= 5.1.3) + railties (5.1.4) + actionpack (= 5.1.4) + activesupport (= 5.1.4) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (2.2.2) rake raindrops (0.19.0) - rake (12.0.0) + rake (12.1.0) rb-fsevent (0.10.2) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) @@ -607,15 +608,15 @@ GEM rspec-mocks (~> 3.6.0) rspec-support (~> 3.6.0) rspec-support (3.6.0) - rubocop (0.49.1) + rubocop (0.50.0) parallel (~> 1.10) parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) - rainbow (>= 1.99.1, < 3.0) + rainbow (>= 2.2.2, < 3.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) ruby-oembed (0.12.0) - ruby-progressbar (1.8.1) + ruby-progressbar (1.8.3) ruby_dep (1.5.0) rubyzip (1.2.1) rufus-scheduler (3.4.2) @@ -635,7 +636,7 @@ GEM scss_lint (0.54.0) rake (>= 0.9, < 13) sass (~> 3.4.20) - secure_headers (3.6.7) + secure_headers (3.7.1) useragent securecompare (1.0.0) shellany (0.0.1) @@ -657,10 +658,9 @@ GEM docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) - simplecov-html (0.10.1) + simplecov-html (0.10.2) sinon-rails (1.15.0) railties (>= 3.1) - slop (3.6.0) spring (2.0.2) activesupport (>= 4.2) spring-commands-cucumber (1.0.1) @@ -670,7 +670,7 @@ GEM sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.0) + sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) @@ -710,7 +710,7 @@ GEM simple_oauth (~> 0.3.1) twitter-text (1.14.7) unf (~> 0.1.0) - typhoeus (1.1.2) + typhoeus (1.3.0) ethon (>= 0.9.0) tzinfo (1.2.3) thread_safe (~> 0.1) @@ -764,12 +764,12 @@ PLATFORMS DEPENDENCIES active_model_serializers (= 0.9.7) - activerecord-import (= 0.19.1) + activerecord-import (= 0.20.1) acts-as-taggable-on (= 5.0.0) acts_as_api (= 1.0.1) - addressable (= 2.5.1) + addressable (= 2.5.2) asset_sync (= 2.2.0) - autoprefixer-rails (= 7.1.2.4) + autoprefixer-rails (= 7.1.4.1) bootstrap-sass (= 3.3.7) bootstrap-switch-rails (= 3.3.3) capybara (= 2.15.1) @@ -791,9 +791,9 @@ DEPENDENCIES factory_girl_rails (= 4.8.0) faraday (= 0.11.0) faraday-cookie_jar (= 0.0.6) - faraday_middleware (= 0.11.0.1) + faraday_middleware (= 0.12.2) fixture_builder (= 0.5.0) - fog-aws (= 1.4.0) + fog-aws (= 1.4.1) fuubar (= 2.2.0) gon (= 6.1.0) guard (= 2.14.1) @@ -805,15 +805,15 @@ DEPENDENCIES handlebars_assets (= 0.23.2) http_accept_language (= 2.1.1) i18n-inflector-rails (= 1.0.7) - jasmine (= 2.7.0) + jasmine (= 2.8.0) jasmine-jquery-rails (= 2.0.3) jquery-rails (= 4.3.1) - js-routes (= 1.3.3) + js-routes (= 1.4.1) js_image_paths (= 0.1.1) json (= 2.1.0) json-schema (= 2.8.0) json-schema-rspec (= 0.0.4) - leaflet-rails (= 1.1.0) + leaflet-rails (= 1.2.0) logging-rails (= 0.6.0) markerb (= 1.1.0) mini_magick (= 4.8.0) @@ -830,7 +830,7 @@ DEPENDENCIES openid_connect (= 1.1.3) pg (= 0.21.0) poltergeist (= 1.16.0) - pronto (= 0.9.4) + pronto (= 0.9.5) pronto-eslint (= 0.9.1) pronto-haml (= 0.9.0) pronto-rubocop (= 0.9.0) @@ -842,10 +842,10 @@ DEPENDENCIES rack-piwik (= 0.3.0) rack-rewrite (= 1.5.1) rack-ssl (= 1.4.1) - rails (= 5.1.3) + rails (= 5.1.4) rails-assets-autosize (= 4.0.0)! rails-assets-backbone (= 1.3.3)! - rails-assets-blueimp-gallery (= 2.25.2)! + rails-assets-blueimp-gallery (= 2.27.0)! rails-assets-bootstrap-markdown (= 2.10.0)! rails-assets-corejs-typeahead (= 1.1.1)! rails-assets-diaspora_jsxc (= 0.1.5.develop.7)! @@ -857,7 +857,7 @@ DEPENDENCIES rails-assets-jquery-textchange (= 0.2.3)! rails-assets-jquery.are-you-sure (= 1.9.0)! rails-assets-jquery.ui (= 1.11.4)! - rails-assets-markdown-it (= 8.3.2)! + rails-assets-markdown-it (= 8.4.0)! rails-assets-markdown-it--markdown-it-for-inline (= 0.1.1)! rails-assets-markdown-it-diaspora-mention (= 1.2.0)! rails-assets-markdown-it-hashtag (= 0.4.0)! @@ -874,11 +874,11 @@ DEPENDENCIES responders (= 2.4.0) rspec-json_expectations (~> 2.1) rspec-rails (= 3.6.1) - rubocop (= 0.49.1) + rubocop (= 0.50.0) ruby-oembed (= 0.12.0) rubyzip (= 1.2.1) sass-rails (= 5.0.6) - secure_headers (= 3.6.7) + secure_headers (= 3.7.1) shoulda-matchers (= 3.1.2) sidekiq (= 5.0.4) sidekiq-cron (= 0.6.3) @@ -888,13 +888,13 @@ DEPENDENCIES spring (= 2.0.2) spring-commands-cucumber (= 1.0.1) spring-commands-rspec (= 1.0.4) - sprockets-rails (= 3.2.0) + sprockets-rails (= 3.2.1) string-direction (= 1.2.0) timecop (= 0.9.1) turbo_dev_assets (= 0.0.2) twitter (= 6.1.0) twitter-text (= 1.14.7) - typhoeus (= 1.1.2) + typhoeus (= 1.3.0) uglifier (= 3.2.0) unicorn (= 5.3.0) unicorn-worker-killer (= 0.4.4) diff --git a/app/assets/javascripts/osmlocator.js b/app/assets/javascripts/osmlocator.js index 157230456..fdc2bf804 100644 --- a/app/assets/javascripts/osmlocator.js +++ b/app/assets/javascripts/osmlocator.js @@ -5,12 +5,12 @@ OSM = {}; OSM.Locator = function(){ var geolocalize = function(callback){ - navigator.geolocation.getCurrentPosition(function(position) { + navigator.geolocation.getCurrentPosition(function(position) { var lat=position.coords.latitude, lon=position.coords.longitude; $.getJSON("https://nominatim.openstreetmap.org/reverse?format=json&lat="+lat+"&lon="+lon+"&addressdetails=3", function(data){ return callback(data.display_name, position.coords); - }); + }); },errorGettingPosition); }; diff --git a/app/mailers/notification_mailers/mentioned_in_comment.rb b/app/mailers/notification_mailers/mentioned_in_comment.rb index cdfa74fa1..056226ffd 100644 --- a/app/mailers/notification_mailers/mentioned_in_comment.rb +++ b/app/mailers/notification_mailers/mentioned_in_comment.rb @@ -4,7 +4,7 @@ module NotificationMailers class MentionedInComment < NotificationMailers::Base attr_reader :comment - def set_headers(target_id) # rubocop:disable Style/AccessorMethodName + def set_headers(target_id) # rubocop:disable Naming/AccessorMethodName @comment = Mention.find_by_id(target_id).mentions_container @headers[:in_reply_to] = @headers[:references] = "<#{@comment.parent.guid}@#{AppConfig.pod_uri.host}>" diff --git a/app/mailers/notification_mailers/started_sharing.rb b/app/mailers/notification_mailers/started_sharing.rb index d3d9db164..c66749c9c 100644 --- a/app/mailers/notification_mailers/started_sharing.rb +++ b/app/mailers/notification_mailers/started_sharing.rb @@ -2,7 +2,7 @@ module NotificationMailers class StartedSharing < NotificationMailers::Base - def set_headers(*_args) # rubocop:disable Style/AccessorMethodName + def set_headers(*_args) # rubocop:disable Naming/AccessorMethodName @headers[:subject] = I18n.t("notifier.started_sharing.subject", name: @sender.name) end end diff --git a/app/presenters/node_info_presenter.rb b/app/presenters/node_info_presenter.rb index 7b7dcf0b0..e0c2c579b 100644 --- a/app/presenters/node_info_presenter.rb +++ b/app/presenters/node_info_presenter.rb @@ -24,6 +24,7 @@ class NodeInfoPresenter doc.open_registrations = open_registrations? doc.metadata["nodeName"] = name doc.metadata["xmppChat"] = chat_enabled? + doc.metadata["camo"] = camo_config doc.metadata["adminAccount"] = admin_account end @@ -73,6 +74,14 @@ class NodeInfoPresenter AppConfig.chat.enabled? end + def camo_config + { + markdown: AppConfig.privacy.camo.proxy_markdown_images?, + opengraph: AppConfig.privacy.camo.proxy_opengraph_thumbnails?, + remotePods: AppConfig.privacy.camo.proxy_remote_pod_images? + } + end + def admin_account AppConfig.admins.account if AppConfig.admins.account? end diff --git a/app/uploaders/exported_photos.rb b/app/uploaders/exported_photos.rb index ed46e0667..b19c4edb1 100644 --- a/app/uploaders/exported_photos.rb +++ b/app/uploaders/exported_photos.rb @@ -5,7 +5,6 @@ # the COPYRIGHT file. class ExportedPhotos < SecureUploader - def store_dir "uploads/users" end @@ -13,7 +12,4 @@ class ExportedPhotos < SecureUploader def filename "#{model.username}_photos_#{secure_token}.zip" if original_filename.present? end - - - end diff --git a/app/uploaders/exported_user.rb b/app/uploaders/exported_user.rb index 116a34110..53201d918 100644 --- a/app/uploaders/exported_user.rb +++ b/app/uploaders/exported_user.rb @@ -14,6 +14,6 @@ class ExportedUser < SecureUploader end def filename - "#{model.username}_diaspora_data_#{secure_token}.json.gz" + "#{model.username}_diaspora_data_#{secure_token}.json.gz" if original_filename.present? end end diff --git a/features/step_definitions/location_steps.rb b/features/step_definitions/location_steps.rb index d4dac90ab..268aec049 100644 --- a/features/step_definitions/location_steps.rb +++ b/features/step_definitions/location_steps.rb @@ -9,5 +9,11 @@ When /^I allow geolocation$/ do } } }; + + $.getJSON = function(url, myCallback) { + if (url === "https://nominatim.openstreetmap.org/reverse?format=json&lat=42.42424242&lon=3.14159&addressdetails=3") { + return myCallback({display_name: "locator address"}); + } + }; JS end diff --git a/lib/tasks/generate_session_secret.rake b/lib/tasks/generate_session_secret.rake index 01e6c2944..28af3ef6e 100644 --- a/lib/tasks/generate_session_secret.rake +++ b/lib/tasks/generate_session_secret.rake @@ -3,11 +3,10 @@ namespace :generate do desc 'Generates a Session Secret Token' task :secret_token do - - path = Rails.root.join('config', 'initializers', 'secret_token.rb') - secret = SecureRandom.hex(40) - File.open(path, 'w') do |f| - f.write <<"EOF" + path = Rails.root.join("config", "initializers", "secret_token.rb") + secret = SecureRandom.hex(40) + File.open(path, "w") do |f| + f.write < :model do end end + describe "#export" do + it "doesn't change the filename when the user is saved" do + user = FactoryGirl.create(:user) + + filename = user.export.filename + user.save! + + expect(User.find(user.id).export.filename).to eq(filename) + end + end + describe "queue_export" do it "queues up a job to perform the export" do user = FactoryGirl.create(:user) diff --git a/spec/presenters/node_info_presenter_spec.rb b/spec/presenters/node_info_presenter_spec.rb index 958a67df2..8dcc0894b 100644 --- a/spec/presenters/node_info_presenter_spec.rb +++ b/spec/presenters/node_info_presenter_spec.rb @@ -39,7 +39,12 @@ describe NodeInfoPresenter do }, "metadata" => { "nodeName" => AppConfig.settings.pod_name, - "xmppChat" => AppConfig.chat.enabled? + "xmppChat" => AppConfig.chat.enabled?, + "camo" => { + "markdown" => AppConfig.privacy.camo.proxy_markdown_images?, + "opengraph" => AppConfig.privacy.camo.proxy_opengraph_thumbnails?, + "remotePods" => AppConfig.privacy.camo.proxy_remote_pod_images? + } } ) end @@ -131,6 +136,22 @@ describe NodeInfoPresenter do end end + context "when camo is enabled" do + before do + AppConfig.privacy.camo.proxy_markdown_images = true + AppConfig.privacy.camo.proxy_opengraph_thumbnails = true + AppConfig.privacy.camo.proxy_remote_pod_images = true + end + + it "should list enabled camo options in the metadata as true" do + expect(hash).to include "metadata" => include("camo" => { + "markdown" => true, + "opengraph" => true, + "remotePods" => true + }) + end + end + context "when admin account is set" do before do AppConfig.admins.account = "podmin" @@ -160,7 +181,12 @@ describe NodeInfoPresenter do }, "metadata" => { "nodeName" => AppConfig.settings.pod_name, - "xmppChat" => AppConfig.chat.enabled? + "xmppChat" => AppConfig.chat.enabled?, + "camo" => { + "markdown" => AppConfig.privacy.camo.proxy_markdown_images?, + "opengraph" => AppConfig.privacy.camo.proxy_opengraph_thumbnails?, + "remotePods" => AppConfig.privacy.camo.proxy_remote_pod_images? + } } ) end