diff --git a/.github/workflows/build-container-image.yml b/.github/workflows/build-container-image.yml index a899e186b8..82947dd259 100644 --- a/.github/workflows/build-container-image.yml +++ b/.github/workflows/build-container-image.yml @@ -45,7 +45,8 @@ jobs: echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV # Transform multi-line variable into comma-separated variable image_names=${PUSH_TO_IMAGES//$'\n'/,} - echo "IMAGE_NAMES=${image_names%,}" >> $GITHUB_ENV + image_names_split=${image_names%,} + echo "IMAGE_NAMES=${image_names_split,,}" >> $GITHUB_ENV - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 id: buildx @@ -160,11 +161,11 @@ jobs: - name: Create manifest list and push working-directory: ${{ runner.temp }}/digests run: | - echo "$PUSH_TO_IMAGES" | xargs -I{} \ + echo "${PUSH_TO_IMAGES,,}" | xargs -I{} \ docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '{}@sha256:%s ' *) - name: Inspect image run: | - echo "$PUSH_TO_IMAGES" | xargs -i{} \ + echo "${PUSH_TO_IMAGES,,}" | xargs -i{} \ docker buildx imagetools inspect {}:${{ steps.meta.outputs.version }} diff --git a/.simplecov b/.simplecov index 79b376c9ae..1f84c71547 100644 --- a/.simplecov +++ b/.simplecov @@ -1,6 +1,6 @@ # frozen_string_literal: true -SimpleCov.start 'rails' do +SimpleCov.configure do # During parallel runs, ensure unique names for post-run merge command_name "job-#{ENV['TEST_ENV_NUMBER']}" if ENV['TEST_ENV_NUMBER'] diff --git a/Gemfile b/Gemfile index 8576937d2d..61261e8f9b 100644 --- a/Gemfile +++ b/Gemfile @@ -45,7 +45,7 @@ gem 'omniauth-saml', '~> 2.0' gem 'color_diff', '~> 0.1' gem 'csv', '~> 3.2' -gem 'discard', '~> 1.2' +gem 'discard', '~> 2.0' gem 'doorkeeper', '~> 5.6' gem 'faraday-httpclient' gem 'fast_blank', '~> 1.0' @@ -230,4 +230,4 @@ gem 'hcaptcha', '~> 7.1' gem 'mail', '~> 2.8' -gem 'vite_rails', '~> 3.0.19' +gem 'vite_rails' diff --git a/Gemfile.lock b/Gemfile.lock index 2a659eb3c2..a8f4d4fc88 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -99,7 +99,7 @@ GEM ast (2.4.3) attr_required (1.0.2) aws-eventstream (1.4.0) - aws-partitions (1.1254.0) + aws-partitions (1.1255.0) aws-sdk-core (3.250.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) @@ -108,11 +108,11 @@ GEM bigdecimal jmespath (~> 1, >= 1.6.1) logger - aws-sdk-kms (1.125.0) - aws-sdk-core (~> 3, >= 3.247.0) + aws-sdk-kms (1.128.0) + aws-sdk-core (~> 3, >= 3.248.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.222.0) - aws-sdk-core (~> 3, >= 3.247.0) + aws-sdk-s3 (1.224.0) + aws-sdk-core (~> 3, >= 3.248.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) aws-sigv4 (1.12.1) @@ -205,8 +205,8 @@ GEM devise (>= 4.0.0) rpam2 (~> 4.0) diff-lcs (1.6.2) - discard (1.4.0) - activerecord (>= 4.2, < 9.0) + discard (2.0.0) + activerecord (>= 7.0, < 9.0) docile (1.4.1) domain_name (0.6.20240107) doorkeeper (5.9.0) @@ -354,7 +354,7 @@ GEM azure-blob (~> 0.5.2) hashie (~> 5.0) jmespath (1.6.2) - json (2.19.5) + json (2.19.7) json-canonicalization (1.0.0) json-jwt (1.17.0) activesupport (>= 4.2) @@ -647,7 +647,7 @@ GEM base64 (>= 0.1.0) logger (>= 1.6.0) rack (>= 3.0.0, < 4) - rack-proxy (0.7.7) + rack-proxy (0.8.2) rack rack-session (2.1.2) base64 (>= 0.1.0) @@ -755,7 +755,7 @@ GEM rspec-mocks (~> 3.0) sidekiq (>= 5, < 9) rspec-support (3.13.7) - rubocop (1.86.2) + rubocop (1.87.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -779,7 +779,7 @@ GEM lint_roller (~> 1.1) rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.47.1, < 2.0) - rubocop-rails (2.35.2) + rubocop-rails (2.35.3) activesupport (>= 4.2.0) lint_roller (~> 1.1) rack (>= 1.1) @@ -802,7 +802,7 @@ GEM ruby-vips (2.3.0) ffi (~> 1.12) logger - rubyzip (3.3.0) + rubyzip (3.3.1) rufus-scheduler (3.9.2) fugit (~> 1.1, >= 1.11.1) safety_net_attestation (0.5.0) @@ -901,7 +901,7 @@ GEM validate_url (1.0.15) activemodel (>= 3.0.0) public_suffix - vite_rails (3.0.20) + vite_rails (3.11.0) railties (>= 5.1, < 9) vite_ruby (~> 3.0, >= 3.2.2) vite_ruby (3.10.2) @@ -937,7 +937,7 @@ GEM xorcist (1.1.3) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.7.5) + zeitwerk (2.8.2) PLATFORMS ruby @@ -970,7 +970,7 @@ DEPENDENCIES devise devise-two-factor devise_pam_authenticatable2 (~> 9.2) - discard (~> 1.2) + discard (~> 2.0) doorkeeper (~> 5.6) dotenv fabrication @@ -1089,7 +1089,7 @@ DEPENDENCIES tty-prompt (~> 0.23) twitter-text (~> 3.1.0) tzinfo-data (~> 1.2023) - vite_rails (~> 3.0.19) + vite_rails webauthn (~> 3.0) webmock (~> 3.18) webpush! diff --git a/app/controllers/admin/custom_emojis_controller.rb b/app/controllers/admin/custom_emojis_controller.rb index 55a03b9804..9ff587632f 100644 --- a/app/controllers/admin/custom_emojis_controller.rb +++ b/app/controllers/admin/custom_emojis_controller.rb @@ -5,9 +5,6 @@ module Admin def index authorize :custom_emoji, :index? - # If filtering by local emojis, remove by_domain filter. - params.delete(:by_domain) if params[:local].present? - # If filtering by domain, ensure remote filter is set. if params[:by_domain].present? params.delete(:local) diff --git a/app/controllers/concerns/settings/export_controller_concern.rb b/app/controllers/concerns/settings/export_controller_concern.rb index 2cf28cced8..9917a5bd04 100644 --- a/app/controllers/concerns/settings/export_controller_concern.rb +++ b/app/controllers/concerns/settings/export_controller_concern.rb @@ -19,15 +19,12 @@ module Settings::ExportControllerConcern def send_export_file respond_to do |format| - format.csv { send_data export_data, filename: export_filename } + format.csv { send_data export_data, filename: "#{controller_name}.csv" } + format.json { send_data export_data, filename: "#{controller_name}.json" } end end def export_data raise 'Override in controller' end - - def export_filename - "#{controller_name}.csv" - end end diff --git a/app/controllers/concerns/signature_verification.rb b/app/controllers/concerns/signature_verification.rb index fd1e2fafb2..1a876b0cad 100644 --- a/app/controllers/concerns/signature_verification.rb +++ b/app/controllers/concerns/signature_verification.rb @@ -157,7 +157,7 @@ module SignatureVerification end def check_keypair_validity!(keypair) - raise Mastodon::SignatureVerification, "Key #{signature_key_id} is revoked" if keypair.revoked? - raise Mastodon::SignatureVerification, "Key #{signature_key_id} has expired" if keypair.expired? + raise Mastodon::SignatureVerificationError, "Key #{signature_key_id} is revoked" if keypair.revoked? + raise Mastodon::SignatureVerificationError, "Key #{signature_key_id} has expired" if keypair.expired? end end diff --git a/app/controllers/settings/exports/custom_filters_controller.rb b/app/controllers/settings/exports/custom_filters_controller.rb new file mode 100644 index 0000000000..ec7c0dfa04 --- /dev/null +++ b/app/controllers/settings/exports/custom_filters_controller.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Settings + module Exports + class CustomFiltersController < BaseController + include Settings::ExportControllerConcern + + def index + send_export_file + end + + private + + def export_data + @export.to_custom_filters_json + end + end + end +end diff --git a/app/javascript/mastodon/features/closed_registrations_modal/index.jsx b/app/javascript/mastodon/features/closed_registrations_modal/index.jsx index 89ced8029c..244be5916a 100644 --- a/app/javascript/mastodon/features/closed_registrations_modal/index.jsx +++ b/app/javascript/mastodon/features/closed_registrations_modal/index.jsx @@ -7,7 +7,7 @@ import { fetchServer } from 'mastodon/actions/server'; import { domain } from 'mastodon/initial_state'; const mapStateToProps = state => ({ - message: state.getIn(['server', 'server', 'registrations', 'message']), + message: state.getIn(['server', 'server', 'item', 'registrations', 'message']), }); class ClosedRegistrationsModal extends ImmutablePureComponent { diff --git a/app/javascript/mastodon/features/report/category.jsx b/app/javascript/mastodon/features/report/category.jsx index 7a37426a65..4c3a7d6a3b 100644 --- a/app/javascript/mastodon/features/report/category.jsx +++ b/app/javascript/mastodon/features/report/category.jsx @@ -28,14 +28,14 @@ const messages = defineMessages({ }); const mapStateToProps = state => ({ - rules: state.getIn(['server', 'server', 'rules'], ImmutableList()), + rules: state.getIn(['server', 'server', 'item', 'rules'], []), }); class Category extends PureComponent { static propTypes = { onNextStep: PropTypes.func.isRequired, - rules: ImmutablePropTypes.list, + rules: PropTypes.arrayOf(PropTypes.object), category: PropTypes.string, onChangeCategory: PropTypes.func.isRequired, startedFrom: PropTypes.oneOf(['status', 'account']), @@ -69,7 +69,7 @@ class Category extends PureComponent { render () { const { category, startedFrom, rules, intl } = this.props; - const options = rules.size > 0 ? [ + const options = rules.length > 0 ? [ 'dislike', 'spam', 'legal', diff --git a/app/javascript/mastodon/features/report/rules.jsx b/app/javascript/mastodon/features/report/rules.jsx index 33087e3d62..765bef7c6c 100644 --- a/app/javascript/mastodon/features/report/rules.jsx +++ b/app/javascript/mastodon/features/report/rules.jsx @@ -11,7 +11,7 @@ import { Button } from 'mastodon/components/button'; import Option from './components/option'; const mapStateToProps = state => ({ - rules: state.getIn(['server', 'server', 'rules']), + rules: state.getIn(['server', 'server', 'item', 'rules']), locale: state.getIn(['meta', 'locale']), }); @@ -19,7 +19,7 @@ class Rules extends PureComponent { static propTypes = { onNextStep: PropTypes.func.isRequired, - rules: ImmutablePropTypes.list, + rules: PropTypes.arrayOf(PropTypes.object), locale: PropTypes.string, selectedRuleIds: ImmutablePropTypes.set.isRequired, onToggle: PropTypes.func.isRequired, @@ -46,12 +46,12 @@ class Rules extends PureComponent {
{rules.map(item => (