From 89a9eeb67550360b3114a13dad528086b04769d3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2020 09:24:16 +0900 Subject: [PATCH 01/13] Bump rack from 2.1.2 to 2.2.2 (#13108) Bumps [rack](https://github.com/rack/rack) from 2.1.2 to 2.2.2. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/2.1.2...v2.2.2) Signed-off-by: dependabot-preview[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 7c5485e07..07959fd3d 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ gem 'puma', '~> 4.3' gem 'rails', '~> 5.2.4' gem 'sprockets', '~> 3.7.2' gem 'thor', '~> 0.20' -gem 'rack', '~> 2.1.2' +gem 'rack', '~> 2.2.2' gem 'thwait', '~> 0.1.0' gem 'e2mmap', '~> 0.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index c3e462c0f..788785ef1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -440,7 +440,7 @@ GEM pundit (2.1.0) activesupport (>= 3.0.0) raabro (1.1.6) - rack (2.1.2) + rack (2.2.2) rack-attack (6.2.2) rack (>= 1.0, < 3) rack-cors (1.1.1) @@ -747,7 +747,7 @@ DEPENDENCIES pry-rails (~> 0.3) puma (~> 4.3) pundit (~> 2.1) - rack (~> 2.1.2) + rack (~> 2.2.2) rack-attack (~> 6.2) rack-cors (~> 1.1) rails (~> 5.2.4) From 983ab40086da909f2c693b74ed36735aab40dbcb Mon Sep 17 00:00:00 2001 From: ThibG Date: Sat, 22 Feb 2020 01:26:41 +0100 Subject: [PATCH 02/13] Fix previously OStatus-based accounts not being detected as ActivityPub (#13129) --- app/services/resolve_account_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/resolve_account_service.rb b/app/services/resolve_account_service.rb index 12e6544a0..1ad9ed407 100644 --- a/app/services/resolve_account_service.rb +++ b/app/services/resolve_account_service.rb @@ -99,7 +99,7 @@ class ResolveAccountService < BaseService if lock.acquired? @account = Account.find_remote(@username, @domain) - next if (@account.present? && !@account.activitypub?) || actor_json.nil? + next if actor_json.nil? @account = ActivityPub::ProcessAccountService.new.call(@username, @domain, actor_json) else From 0f07218e53bf581127cdcf5fbf12d9c207ace8d7 Mon Sep 17 00:00:00 2001 From: ThibG Date: Sat, 22 Feb 2020 01:27:34 +0100 Subject: [PATCH 03/13] Fix `/web` redirecting to `/web/web` in web UI (#13128) Fixes #13127 --- app/javascript/mastodon/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/mastodon/main.js b/app/javascript/mastodon/main.js index 5d73caa10..da4884fd3 100644 --- a/app/javascript/mastodon/main.js +++ b/app/javascript/mastodon/main.js @@ -12,7 +12,7 @@ function main() { if (window.history && history.replaceState) { const { pathname, search, hash } = window.location; const path = pathname + search + hash; - if (!(/^\/web[$/]/).test(path)) { + if (!(/^\/web($|\/)/).test(path)) { history.replaceState(null, document.title, `/web${path}`); } } From ca7ee9f1cfc6dad138b1589a95d9c7febe213a3c Mon Sep 17 00:00:00 2001 From: ThibG Date: Sat, 22 Feb 2020 01:29:14 +0100 Subject: [PATCH 04/13] Add `--reset-password` option to `tootctl accounts modify` (#13126) --- lib/mastodon/accounts_cli.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/mastodon/accounts_cli.rb b/lib/mastodon/accounts_cli.rb index 6dbb75689..8c91c3013 100644 --- a/lib/mastodon/accounts_cli.rb +++ b/lib/mastodon/accounts_cli.rb @@ -120,6 +120,7 @@ module Mastodon option :disable, type: :boolean option :disable_2fa, type: :boolean option :approve, type: :boolean + option :reset_password, type: :boolean desc 'modify USERNAME', 'Modify a user' long_desc <<-LONG_DESC Modify a user account. @@ -138,6 +139,9 @@ module Mastodon With the --disable-2fa option, the two-factor authentication requirement for the user can be removed. + + With the --reset-password option, the user's password is replaced by + a randomly-generated one, printed in the output. LONG_DESC def modify(username) user = Account.find_local(username)&.user @@ -152,6 +156,8 @@ module Mastodon user.moderator = options[:role] == 'moderator' end + password = SecureRandom.hex if options[:reset_password] + user.password = password if options[:reset_password] user.email = options[:email] if options[:email] user.disabled = false if options[:enable] user.disabled = true if options[:disable] @@ -161,6 +167,7 @@ module Mastodon if user.save say('OK', :green) + say("New password: #{password}") if options[:reset_password] else user.errors.to_h.each do |key, error| say('Failure/Error: ', :red) From 3d9e9ca375c185069c6660c3ecf18aa5e46f5346 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 17:36:32 +0900 Subject: [PATCH 05/13] Bump @babel/core from 7.8.3 to 7.8.4 (#13137) Bumps [@babel/core](https://github.com/babel/babel) from 7.8.3 to 7.8.4. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) - [Commits](https://github.com/babel/babel/compare/v7.8.3...v7.8.4) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 64 ++++++++++++++++++++++++++-------------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index 04c05961f..0651d25ec 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ }, "private": true, "dependencies": { - "@babel/core": "^7.8.3", + "@babel/core": "^7.8.4", "@babel/plugin-proposal-class-properties": "^7.8.3", "@babel/plugin-proposal-decorators": "^7.8.3", "@babel/plugin-transform-react-inline-elements": "^7.8.3", diff --git a/yarn.lock b/yarn.lock index 92495c5ed..1250b147f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,17 +18,17 @@ invariant "^2.2.4" semver "^5.5.0" -"@babel/core@^7.1.0", "@babel/core@^7.4.5", "@babel/core@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.8.3.tgz#30b0ebb4dd1585de6923a0b4d179e0b9f5d82941" - integrity sha512-4XFkf8AwyrEG7Ziu3L2L0Cv+WyY47Tcsp70JFmpftbAA1K7YL/sgE9jh9HyNj08Y/U50ItUchpN0w6HxAoX1rA== +"@babel/core@^7.1.0", "@babel/core@^7.4.5", "@babel/core@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.8.4.tgz#d496799e5c12195b3602d0fddd77294e3e38e80e" + integrity sha512-0LiLrB2PwrVI+a2/IEskBopDYSd8BCb3rOvH7D5tzoWd696TBEduBvuLVm4Nx6rltrLZqvI3MCalB2K2aVzQjA== dependencies: "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.8.3" - "@babel/helpers" "^7.8.3" - "@babel/parser" "^7.8.3" + "@babel/generator" "^7.8.4" + "@babel/helpers" "^7.8.4" + "@babel/parser" "^7.8.4" "@babel/template" "^7.8.3" - "@babel/traverse" "^7.8.3" + "@babel/traverse" "^7.8.4" "@babel/types" "^7.8.3" convert-source-map "^1.7.0" debug "^4.1.0" @@ -39,10 +39,10 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.0.0", "@babel/generator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.3.tgz#0e22c005b0a94c1c74eafe19ef78ce53a4d45c03" - integrity sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug== +"@babel/generator@^7.0.0", "@babel/generator@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.4.tgz#35bbc74486956fe4251829f9f6c48330e8d0985e" + integrity sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA== dependencies: "@babel/types" "^7.8.3" jsesc "^2.5.1" @@ -243,13 +243,13 @@ "@babel/traverse" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/helpers@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.8.3.tgz#382fbb0382ce7c4ce905945ab9641d688336ce85" - integrity sha512-LmU3q9Pah/XyZU89QvBgGt+BCsTPoQa+73RxAQh8fb8qkDyIfeQnmgs+hvzhTCKTzqOyk7JTkS3MS1S8Mq5yrQ== +"@babel/helpers@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.8.4.tgz#754eb3ee727c165e0a240d6c207de7c455f36f73" + integrity sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w== dependencies: "@babel/template" "^7.8.3" - "@babel/traverse" "^7.8.3" + "@babel/traverse" "^7.8.4" "@babel/types" "^7.8.3" "@babel/highlight@^7.8.3": @@ -261,10 +261,10 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.3.tgz#790874091d2001c9be6ec426c2eed47bc7679081" - integrity sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ== +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.8.3", "@babel/parser@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.4.tgz#d1dbe64691d60358a974295fa53da074dd2ce8e8" + integrity sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw== "@babel/plugin-proposal-async-generator-functions@^7.8.3": version "7.8.3" @@ -817,16 +817,16 @@ "@babel/parser" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.3.tgz#a826215b011c9b4f73f3a893afbc05151358bf9a" - integrity sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg== +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.8.3", "@babel/traverse@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.4.tgz#f0845822365f9d5b0e312ed3959d3f827f869e3c" + integrity sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg== dependencies: "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.8.3" + "@babel/generator" "^7.8.4" "@babel/helper-function-name" "^7.8.3" "@babel/helper-split-export-declaration" "^7.8.3" - "@babel/parser" "^7.8.3" + "@babel/parser" "^7.8.4" "@babel/types" "^7.8.3" debug "^4.1.0" globals "^11.1.0" @@ -9730,11 +9730,6 @@ source-list-map@^2.0.0: resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== -source-map@0.5.6: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" - integrity sha1-dc449SvwczxafwwRjYEzSiu19BI= - source-map-resolve@^0.5.0: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" @@ -9767,6 +9762,11 @@ source-map-url@^0.4.0: resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= +source-map@0.5.6: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + integrity sha1-dc449SvwczxafwwRjYEzSiu19BI= + source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" From 6518ee6c43cd63913278d2eb1891ccb8b3b3d54a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 17:50:18 +0900 Subject: [PATCH 06/13] Bump rellax from 1.10.0 to 1.12.1 (#13140) Bumps [rellax](https://github.com/dixonandmoe/rellax) from 1.10.0 to 1.12.1. - [Release notes](https://github.com/dixonandmoe/rellax/releases) - [Commits](https://github.com/dixonandmoe/rellax/commits) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0651d25ec..8f3d74229 100644 --- a/package.json +++ b/package.json @@ -147,7 +147,7 @@ "redux": "^4.0.5", "redux-immutable": "^4.0.0", "redux-thunk": "^2.2.0", - "rellax": "^1.10.0", + "rellax": "^1.12.1", "requestidlecallback": "^0.3.0", "reselect": "^4.0.0", "rimraf": "^3.0.2", diff --git a/yarn.lock b/yarn.lock index 1250b147f..f4b3e7303 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9073,10 +9073,10 @@ regjsparser@^0.6.0: dependencies: jsesc "~0.5.0" -rellax@^1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/rellax/-/rellax-1.10.0.tgz#0308b813b458f9175d37ffb4272e1f616eab1341" - integrity sha512-BtxD9b8cAQcTs6iat1fqKvHMjIZ8CaxjsC5U/cIIVHC4LjkIsr0ZmeqxUm5ZvBvyjLwfPbU8Wcryp77sR5C8QA== +rellax@^1.12.1: + version "1.12.1" + resolved "https://registry.yarnpkg.com/rellax/-/rellax-1.12.1.tgz#1b433ef7ac4aa3573449a33efab391c112f6b34d" + integrity sha512-XBIi0CDpW5FLTujYjYBn1CIbK2CJL6TsAg/w409KghP2LucjjzBjsujXDAjyBLWgsfupfUcL5WzdnIPcGfK7XA== remove-trailing-separator@^1.0.1: version "1.1.0" From 1452d85dd2de772af0dc4bc413d7bf03dbcbc965 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 17:50:25 +0900 Subject: [PATCH 07/13] Bump webpack-cli from 3.3.10 to 3.3.11 (#13139) Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 3.3.10 to 3.3.11. - [Release notes](https://github.com/webpack/webpack-cli/releases) - [Changelog](https://github.com/webpack/webpack-cli/blob/next/CHANGELOG_v3.md) - [Commits](https://github.com/webpack/webpack-cli/compare/v3.3.10...v3.3.11) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8f3d74229..16f44b34c 100644 --- a/package.json +++ b/package.json @@ -165,7 +165,7 @@ "webpack": "^4.41.5", "webpack-assets-manifest": "^3.1.1", "webpack-bundle-analyzer": "^3.6.0", - "webpack-cli": "^3.3.10", + "webpack-cli": "^3.3.11", "webpack-merge": "^4.2.1", "wicg-inert": "^3.0.0" }, diff --git a/yarn.lock b/yarn.lock index f4b3e7303..f2bc2999a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10833,10 +10833,10 @@ webpack-bundle-analyzer@^3.6.0: opener "^1.5.1" ws "^6.0.0" -webpack-cli@^3.3.10: - version "3.3.10" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.10.tgz#17b279267e9b4fb549023fae170da8e6e766da13" - integrity sha512-u1dgND9+MXaEt74sJR4PR7qkPxXUSQ0RXYq8x1L6Jg1MYVEmGPrH6Ah6C4arD4r0J1P5HKjRqpab36k0eIzPqg== +webpack-cli@^3.3.11: + version "3.3.11" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.11.tgz#3bf21889bf597b5d82c38f215135a411edfdc631" + integrity sha512-dXlfuml7xvAFwYUPsrtQAA9e4DOe58gnzSxhgrO/ZM/gyXTBowrsYeubyN4mqGhYdpXMFNyQ6emjJS9M7OBd4g== dependencies: chalk "2.4.2" cross-spawn "6.0.5" From 5158dbeb25f64fd6fad44deb454ce354c95bd1ce Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2020 21:54:19 +0900 Subject: [PATCH 08/13] Bump react-redux from 7.1.3 to 7.2.0 (#13141) Bumps [react-redux](https://github.com/reduxjs/react-redux) from 7.1.3 to 7.2.0. - [Release notes](https://github.com/reduxjs/react-redux/releases) - [Changelog](https://github.com/reduxjs/react-redux/blob/master/CHANGELOG.md) - [Commits](https://github.com/reduxjs/react-redux/compare/v7.1.3...v7.2.0) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 16f44b34c..1a873615d 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "react-motion": "^0.5.2", "react-notification": "^6.8.5", "react-overlays": "^0.9.1", - "react-redux": "^7.1.3", + "react-redux": "^7.2.0", "react-redux-loading-bar": "^4.0.8", "react-router-dom": "^4.1.1", "react-router-scroll-4": "^1.0.0-beta.1", diff --git a/yarn.lock b/yarn.lock index f2bc2999a..8814eb961 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8724,14 +8724,13 @@ react-redux-loading-bar@^4.0.8: prop-types "^15.6.2" react-lifecycles-compat "^3.0.2" -react-redux@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.1.3.tgz#717a3d7bbe3a1b2d535c94885ce04cdc5a33fc79" - integrity sha512-uI1wca+ECG9RoVkWQFF4jDMqmaw0/qnvaSvOoL/GA4dNxf6LoV8sUAcNDvE5NWKs4hFpn0t6wswNQnY3f7HT3w== +react-redux@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.0.tgz#f970f62192b3981642fec46fd0db18a074fe879d" + integrity sha512-EvCAZYGfOLqwV7gh849xy9/pt55rJXPwmYvI4lilPM5rUT/1NxuuN59ipdBksRVSvz0KInbPnp4IfoXJXCqiDA== dependencies: "@babel/runtime" "^7.5.5" hoist-non-react-statics "^3.3.0" - invariant "^2.2.4" loose-envify "^1.4.0" prop-types "^15.7.2" react-is "^16.9.0" From 3704402dcce6775c32350d09cd3dc7d2ba95105a Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 24 Feb 2020 21:15:53 +0100 Subject: [PATCH 09/13] Fix duplicate accounts being created when fetching an account for its key only (#13147) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #13136 When a user's canonical acct domain is different from its id's domain (WEB_DOMAIN ≠ LOCAL_DOMAIN), two webfinger queries are required to find the canonical domain from the URI. However, we skip webfinger queries when updating only the key of a remote user, which led to the creation of a duplicate account, using the URI's domain instead of the canonical acct: one. --- app/services/activitypub/process_account_service.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index cef658e19..d5ede0388 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -18,9 +18,10 @@ class ActivityPub::ProcessAccountService < BaseService RedisLock.acquire(lock_options) do |lock| if lock.acquired? - @account = Account.find_remote(@username, @domain) - @old_public_key = @account&.public_key - @old_protocol = @account&.protocol + @account = Account.remote.find_by(uri: @uri) if @options[:only_key] + @account ||= Account.find_remote(@username, @domain) + @old_public_key = @account&.public_key + @old_protocol = @account&.protocol create_account if @account.nil? update_account From d91946ae134f84889f26a08987cb75abeab62742 Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 24 Feb 2020 21:18:26 +0100 Subject: [PATCH 10/13] Fix backups failing when files are missing from media attachments (#13146) Fixes #13123 --- app/services/backup_service.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/backup_service.rb b/app/services/backup_service.rb index d1090dff1..896699324 100644 --- a/app/services/backup_service.rb +++ b/app/services/backup_service.rb @@ -66,6 +66,8 @@ class BackupService < BaseService def dump_media_attachments!(tar) MediaAttachment.attached.where(account: account).reorder(nil).find_in_batches do |media_attachments| media_attachments.each do |m| + next unless m.file&.path + download_to_tar(tar, m.file, m.file.path) end From cf4fe6caefc45e18c82d619933a9b5f662503aa4 Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 24 Feb 2020 21:19:19 +0100 Subject: [PATCH 11/13] Fix misleading error when attempting to re-send a pending follow request (#13133) Fixes #13131 --- app/services/follow_service.rb | 5 ++--- app/views/authorize_interactions/show.html.haml | 6 ++++++ config/locales/en.yml | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/services/follow_service.rb b/app/services/follow_service.rb index dc47804c0..4d19002c4 100644 --- a/app/services/follow_service.rb +++ b/app/services/follow_service.rb @@ -18,14 +18,13 @@ class FollowService < BaseService if source_account.following?(target_account) # We're already following this account, but we'll call follow! again to # make sure the reblogs status is set correctly. - source_account.follow!(target_account, reblogs: reblogs) - return + return source_account.follow!(target_account, reblogs: reblogs) elsif source_account.requested?(target_account) # This isn't managed by a method in AccountInteractions, so we modify it # ourselves if necessary. req = source_account.follow_requests.find_by(target_account: target_account) req.update!(show_reblogs: reblogs) - return + return req end ActivityTracker.increment('activity:interactions') diff --git a/app/views/authorize_interactions/show.html.haml b/app/views/authorize_interactions/show.html.haml index 7ca9b98c1..42c874134 100644 --- a/app/views/authorize_interactions/show.html.haml +++ b/app/views/authorize_interactions/show.html.haml @@ -10,6 +10,12 @@ %strong = t('authorize_follow.already_following') + = render 'post_follow_actions' + - elsif current_account.requested?(@resource) + .flash-message + %strong + = t('authorize_follow.already_requested') + = render 'post_follow_actions' - else = form_tag authorize_interaction_path, method: :post, class: 'simple_form' do diff --git a/config/locales/en.yml b/config/locales/en.yml index 027b73d9d..1d2580101 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -661,6 +661,7 @@ en: trouble_logging_in: Trouble logging in? authorize_follow: already_following: You are already following this account + already_requested: You have already sent a follow request to that account error: Unfortunately, there was an error looking up the remote account follow: Follow follow_request: 'You have sent a follow request to:' From 7face973fa1c7d6c18b06d427ea0b7a741d11466 Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 24 Feb 2020 22:21:40 +0100 Subject: [PATCH 12/13] Fix dismissing an announcement twice raising an obscure error (#13124) --- app/controllers/api/v1/announcements_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/announcements_controller.rb b/app/controllers/api/v1/announcements_controller.rb index 1e692ff75..ee79fc19f 100644 --- a/app/controllers/api/v1/announcements_controller.rb +++ b/app/controllers/api/v1/announcements_controller.rb @@ -11,7 +11,7 @@ class Api::V1::AnnouncementsController < Api::BaseController end def dismiss - AnnouncementMute.create!(account: current_account, announcement: @announcement) + AnnouncementMute.find_or_create_by!(account: current_account, announcement: @announcement) render_empty end From 2f2b48b227304d0f0a28dd4867e84af10b8097ad Mon Sep 17 00:00:00 2001 From: ThibG Date: Sat, 22 Feb 2020 01:27:34 +0100 Subject: [PATCH 13/13] [Glitch] Fix `/web` redirecting to `/web/web` in web UI Port 0f07218e53bf581127cdcf5fbf12d9c207ace8d7 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/util/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/util/main.js b/app/javascript/flavours/glitch/util/main.js index b76826481..1fdb9ff2b 100644 --- a/app/javascript/flavours/glitch/util/main.js +++ b/app/javascript/flavours/glitch/util/main.js @@ -12,7 +12,7 @@ function main() { if (window.history && history.replaceState) { const { pathname, search, hash } = window.location; const path = pathname + search + hash; - if (!(/^\/web[$/]/).test(path)) { + if (!(/^\/web($|\/)/).test(path)) { history.replaceState(null, document.title, `/web${path}`); } }