diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 3c96546b496bb0..b5e72a0973baf2 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -15,6 +15,6 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ RUN gem install foreman # [Optional] Uncomment this line to install global node packages. -RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g yarn" 2>&1 +RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && corepack enable" 2>&1 COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 8d4d63847adbfe..20f3437f4efcef 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -11,6 +11,7 @@ bundle install git checkout -- Gemfile.lock # Fetch Javascript dependencies +corepack prepare yarn install --immutable # [re]create, migrate, and seed the test database diff --git a/.github/renovate.json5 b/.github/renovate.json5 index e3744ee6dcc377..77b64fdd3f9847 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -12,6 +12,7 @@ // If we do not want a package to be grouped with others, we need to set its groupName // to `null` after any other rule set it to something. dependencyDashboardHeader: 'This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. Before approving any upgrade: read the description and comments in the [`renovate.json5` file](https://github.com/mastodon/mastodon/blob/main/.github/renovate.json5).', + postUpdateOptions: ['yarnDedupeHighest'], packageRules: [ { // Require Dependency Dashboard Approval for major version bumps of these node packages diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index 00237d4deab099..6b26a60d34370c 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -35,7 +35,6 @@ linters: - 'app/views/admin/accounts/_local_account.html.haml' - 'app/views/admin/roles/_form.html.haml' - 'app/views/home/index.html.haml' - - 'app/views/layouts/application.html.haml' ViewLength: exclude: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4f62e6c4d1680e..742ac8feafa157 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -24,15 +24,6 @@ Lint/NonLocalExitFromIterator: Exclude: - 'app/helpers/jsonld_helper.rb' -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. -Lint/UnusedBlockArgument: - Exclude: - - 'config/initializers/content_security_policy.rb' - - 'config/initializers/doorkeeper.rb' - - 'config/initializers/paperclip.rb' - - 'config/initializers/simple_form.rb' - # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: Max: 144 @@ -113,12 +104,6 @@ RSpec/LetSetup: - 'spec/services/unsuspend_account_service_spec.rb' - 'spec/workers/scheduler/user_cleanup_scheduler_spec.rb' -RSpec/MessageChain: - Exclude: - - 'spec/models/concerns/remotable_spec.rb' - - 'spec/models/session_activation_spec.rb' - - 'spec/models/setting_spec.rb' - RSpec/MultipleExpectations: Max: 8 @@ -158,11 +143,6 @@ Rails/HasManyOrHasOneDependent: - 'app/models/user.rb' - 'app/models/web/push_subscription.rb' -Rails/I18nLocaleTexts: - Exclude: - - 'lib/tasks/mastodon.rake' - - 'spec/helpers/flashes_helper_spec.rb' - # Configuration parameters: Include. # Include: app/controllers/**/*.rb, app/mailers/**/*.rb Rails/LexicallyScopedActionFilter: diff --git a/Gemfile b/Gemfile index 1d5663e624e27b..9c759a24e0a7e9 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,7 @@ gem 'dotenv-rails', '~> 2.8' gem 'aws-sdk-s3', '~> 1.123', require: false gem 'fog-core', '<= 2.4.0' -gem 'fog-openstack', '~> 0.3', require: false +gem 'fog-openstack', '~> 1.0', require: false gem 'kt-paperclip', '~> 7.2' gem 'md-paperclip-azure', '~> 2.2', require: false gem 'blurhash', '~> 0.1' diff --git a/Gemfile.lock b/Gemfile.lock index 030584cc356af4..57dedfd55d485d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -263,7 +263,7 @@ GEM erubi (1.12.0) et-orbi (1.2.7) tzinfo - excon (0.100.0) + excon (0.104.0) fabrication (2.30.0) faker (3.2.2) i18n (>= 1.8.11, < 2) @@ -298,19 +298,18 @@ GEM ffi-compiler (1.0.1) ffi (>= 1.0.0) rake - fog-core (2.1.0) + fog-core (2.3.0) builder - excon (~> 0.58) - formatador (~> 0.2) + excon (~> 0.71) + formatador (>= 0.2, < 2.0) mime-types fog-json (1.2.0) fog-core multi_json (~> 1.10) - fog-openstack (0.3.10) - fog-core (>= 1.45, <= 2.1.0) + fog-openstack (1.1.0) + fog-core (~> 2.1) fog-json (>= 1.0) - ipaddress (>= 0.8) - formatador (0.3.0) + formatador (1.1.0) fugit (1.8.1) et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) @@ -370,7 +369,6 @@ GEM terminal-table (>= 1.5.1) idn-ruby (0.1.5) io-console (0.6.0) - ipaddress (0.8.3) irb (1.8.1) rdoc reline (>= 0.3.8) @@ -452,7 +450,7 @@ GEM memory_profiler (1.0.1) mime-types (3.5.1) mime-types-data (~> 3.2015) - mime-types-data (3.2023.0808) + mime-types-data (3.2023.1003) mini_mime (1.1.5) mini_portile2 (2.8.5) minitest (5.20.0) @@ -860,7 +858,7 @@ DEPENDENCIES fast_blank (~> 1.0) fastimage fog-core (<= 2.4.0) - fog-openstack (~> 0.3) + fog-openstack (~> 1.0) fuubar (~> 2.5) haml-rails (~> 2.0) haml_lint diff --git a/app/controllers/api/v1/accounts/relationships_controller.rb b/app/controllers/api/v1/accounts/relationships_controller.rb index 503f85c97d79fc..320084efb5ccdd 100644 --- a/app/controllers/api/v1/accounts/relationships_controller.rb +++ b/app/controllers/api/v1/accounts/relationships_controller.rb @@ -5,10 +5,11 @@ class Api::V1::Accounts::RelationshipsController < Api::BaseController before_action :require_user! def index - accounts = Account.without_suspended.where(id: account_ids).select('id') + scope = Account.where(id: account_ids).select('id') + scope.merge!(Account.without_suspended) unless truthy_param?(:with_suspended) # .where doesn't guarantee that our results are in the same order # we requested them, so return the "right" order to the requestor. - @accounts = accounts.index_by(&:id).values_at(*account_ids).compact + @accounts = scope.index_by(&:id).values_at(*account_ids).compact render json: @accounts, each_serializer: REST::RelationshipSerializer, relationships: relationships end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9fd3fe1601bc19..9eb24b69aa6c7e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -91,6 +91,14 @@ def locale_direction end end + def html_title + safe_join( + [content_for(:page_title).to_s.chomp, title] + .select(&:present?), + ' - ' + ) + end + def title Rails.env.production? ? site_title : "#{site_title} (Dev)" end diff --git a/app/javascript/mastodon/actions/accounts.js b/app/javascript/mastodon/actions/accounts.js index 4a985a41eff0f3..e0448f004c7c7b 100644 --- a/app/javascript/mastodon/actions/accounts.js +++ b/app/javascript/mastodon/actions/accounts.js @@ -460,7 +460,7 @@ export function fetchRelationships(accountIds) { dispatch(fetchRelationshipsRequest(newAccountIds)); - api(getState).get(`/api/v1/accounts/relationships?${newAccountIds.map(id => `id[]=${id}`).join('&')}`).then(response => { + api(getState).get(`/api/v1/accounts/relationships?with_suspended=true&${newAccountIds.map(id => `id[]=${id}`).join('&')}`).then(response => { dispatch(fetchRelationshipsSuccess({ relationships: response.data })); }).catch(error => { dispatch(fetchRelationshipsFail(error)); diff --git a/app/javascript/mastodon/api_types/accounts.ts b/app/javascript/mastodon/api_types/accounts.ts index dc2533de33686e..3285bc494ad46e 100644 --- a/app/javascript/mastodon/api_types/accounts.ts +++ b/app/javascript/mastodon/api_types/accounts.ts @@ -29,6 +29,7 @@ export interface ApiAccountOtherSettingsJSON { | 'followers_only' | 'mutuals_only' | 'block'; + subscription_policy: 'allow' | 'followers_only' | 'block'; } // See app/serializers/rest/account_serializer.rb @@ -63,4 +64,5 @@ export interface ApiAccountJSON { suspended?: boolean; limited?: boolean; memorial?: boolean; + hide_collections: boolean; } diff --git a/app/javascript/mastodon/components/account.jsx b/app/javascript/mastodon/components/account.jsx index 5077e5a28255a9..5146bf5a5b8373 100644 --- a/app/javascript/mastodon/components/account.jsx +++ b/app/javascript/mastodon/components/account.jsx @@ -121,7 +121,7 @@ class Account extends ImmutablePureComponent { buttons =