mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 08:19:05 +00:00
Merge commit '17eb1a7e668dbba6e79612395b99407e8e8de6b9' into glitch-soc/merge-upstream
This commit is contained in:
@@ -14,9 +14,9 @@ ARG BASE_REGISTRY="docker.io"
|
|||||||
# Ruby image to use for base image, change with [--build-arg RUBY_VERSION="3.4.x"]
|
# Ruby image to use for base image, change with [--build-arg RUBY_VERSION="3.4.x"]
|
||||||
# renovate: datasource=docker depName=docker.io/ruby
|
# renovate: datasource=docker depName=docker.io/ruby
|
||||||
ARG RUBY_VERSION="3.4.7"
|
ARG RUBY_VERSION="3.4.7"
|
||||||
# # Node.js version to use in base image, change with [--build-arg NODE_MAJOR_VERSION="20"]
|
# # Node.js version to use in base image, change with [--build-arg NODE_MAJOR_VERSION="22"]
|
||||||
# renovate: datasource=node-version depName=node
|
# renovate: datasource=node-version depName=node
|
||||||
ARG NODE_MAJOR_VERSION="22"
|
ARG NODE_MAJOR_VERSION="24"
|
||||||
# Debian image to use for base image, change with [--build-arg DEBIAN_VERSION="trixie"]
|
# Debian image to use for base image, change with [--build-arg DEBIAN_VERSION="trixie"]
|
||||||
ARG DEBIAN_VERSION="trixie"
|
ARG DEBIAN_VERSION="trixie"
|
||||||
# Node.js image to use for base image based on combined variables (ex: 20-trixie-slim)
|
# Node.js image to use for base image based on combined variables (ex: 20-trixie-slim)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ Mastodon is a **free, open-source social network server** based on [ActivityPub]
|
|||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
- **Ruby** 3.2+
|
- **Ruby** 3.2+
|
||||||
- **PostgreSQL** 13+
|
- **PostgreSQL** 14+
|
||||||
- **Redis** 7.0+
|
- **Redis** 7.0+
|
||||||
- **Node.js** 20+
|
- **Node.js** 20+
|
||||||
|
|
||||||
|
|||||||
@@ -8,4 +8,11 @@ class REST::ScheduledStatusSerializer < ActiveModel::Serializer
|
|||||||
def id
|
def id
|
||||||
object.id.to_s
|
object.id.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def params
|
||||||
|
object.params.merge(
|
||||||
|
quoted_status_id: object.params['quoted_status_id']&.to_s,
|
||||||
|
quote_approval_policy: Status::QUOTE_APPROVAL_POLICY_FLAGS.keys.find { |key| object.params['quote_approval_policy']&.anybits?(Status::QUOTE_APPROVAL_POLICY_FLAGS[key] << 16) }&.to_s || 'nobody'
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class PublishScheduledStatusWorker
|
|||||||
options.tap do |options_hash|
|
options.tap do |options_hash|
|
||||||
options_hash[:application] = Doorkeeper::Application.find(options_hash.delete(:application_id)) if options[:application_id]
|
options_hash[:application] = Doorkeeper::Application.find(options_hash.delete(:application_id)) if options[:application_id]
|
||||||
options_hash[:thread] = Status.find(options_hash.delete(:in_reply_to_id)) if options_hash[:in_reply_to_id]
|
options_hash[:thread] = Status.find(options_hash.delete(:in_reply_to_id)) if options_hash[:in_reply_to_id]
|
||||||
|
options_hash[:quoted_status] = Status.find(options_hash.delete(:quoted_status_id)) if options_hash[:quoted_status_id]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
StrongMigrations.start_after = 2017_09_24_022025
|
StrongMigrations.start_after = 2017_09_24_022025
|
||||||
StrongMigrations.target_version = 13
|
StrongMigrations.target_version = 14
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace :db do
|
|||||||
|
|
||||||
task pre_migration_check: :environment do
|
task pre_migration_check: :environment do
|
||||||
pg_version = ActiveRecord::Base.connection.database_version
|
pg_version = ActiveRecord::Base.connection.database_version
|
||||||
abort 'This version of Mastodon requires PostgreSQL 13.0 or newer. Please update PostgreSQL before updating Mastodon.' if pg_version < 130_000
|
abort 'This version of Mastodon requires PostgreSQL 14.0 or newer. Please update PostgreSQL before updating Mastodon.' if pg_version < 140_000
|
||||||
|
|
||||||
schema_version = ActiveRecord::Migrator.current_version
|
schema_version = ActiveRecord::Migrator.current_version
|
||||||
abort <<~MESSAGE if ENV['SKIP_POST_DEPLOYMENT_MIGRATIONS'] && schema_version < 2023_09_07_150100
|
abort <<~MESSAGE if ENV['SKIP_POST_DEPLOYMENT_MIGRATIONS'] && schema_version < 2023_09_07_150100
|
||||||
|
|||||||
@@ -10,14 +10,18 @@ RSpec.describe REST::ScheduledStatusSerializer do
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:scheduled_status) { Fabricate.build(:scheduled_status, scheduled_at: 4.minutes.from_now, params: { application_id: 123 }) }
|
let(:scheduled_status) { Fabricate.build(:scheduled_status, scheduled_at: 4.minutes.from_now, params: { application_id: 123, quoted_status_id: 456, quote_approval_policy: Status::QUOTE_APPROVAL_POLICY_FLAGS[:public] << 16 }) }
|
||||||
|
|
||||||
describe 'serialization' do
|
describe 'serialization' do
|
||||||
it 'returns expected values and removes application_id from params' do
|
it 'returns expected values and removes application_id from params' do
|
||||||
expect(subject.deep_symbolize_keys)
|
expect(subject.deep_symbolize_keys)
|
||||||
.to include(
|
.to include(
|
||||||
scheduled_at: be_a(String).and(match_api_datetime_format),
|
scheduled_at: be_a(String).and(match_api_datetime_format),
|
||||||
params: include(:application_id)
|
params: a_hash_including(
|
||||||
|
application_id: 123,
|
||||||
|
quoted_status_id: '456',
|
||||||
|
quote_approval_policy: 'public'
|
||||||
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,8 +13,12 @@ RSpec.describe PublishScheduledStatusWorker do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context 'when the account is not disabled' do
|
context 'when the account is not disabled' do
|
||||||
|
let(:user) { Fabricate(:user) }
|
||||||
|
let(:scheduled_status) { Fabricate(:scheduled_status, account: user.account, params: { text: 'Hello world, future!', quoted_status_id: Fabricate(:status, account: user.account).id }) }
|
||||||
|
|
||||||
it 'creates a status and removes scheduled record' do
|
it 'creates a status and removes scheduled record' do
|
||||||
expect(scheduled_status.account.statuses.first.text).to eq 'Hello world, future!'
|
expect(scheduled_status.account.statuses.first.text).to eq 'Hello world, future!'
|
||||||
|
expect(scheduled_status.account.statuses.first.quote).to_not be_nil
|
||||||
|
|
||||||
expect(ScheduledStatus.find_by(id: scheduled_status.id)).to be_nil
|
expect(ScheduledStatus.find_by(id: scheduled_status.id)).to be_nil
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ ARG TARGETPLATFORM=${TARGETPLATFORM}
|
|||||||
ARG BUILDPLATFORM=${BUILDPLATFORM}
|
ARG BUILDPLATFORM=${BUILDPLATFORM}
|
||||||
ARG BASE_REGISTRY="docker.io"
|
ARG BASE_REGISTRY="docker.io"
|
||||||
|
|
||||||
# Node version to use in base image, change with [--build-arg NODE_MAJOR_VERSION="20"]
|
# Node version to use in base image, change with [--build-arg NODE_MAJOR_VERSION="22"]
|
||||||
# renovate: datasource=node-version depName=node
|
# renovate: datasource=node-version depName=node
|
||||||
ARG NODE_MAJOR_VERSION="22"
|
ARG NODE_MAJOR_VERSION="24"
|
||||||
# Debian image to use for base image, change with [--build-arg DEBIAN_VERSION="trixie"]
|
# Debian image to use for base image, change with [--build-arg DEBIAN_VERSION="trixie"]
|
||||||
ARG DEBIAN_VERSION="trixie"
|
ARG DEBIAN_VERSION="trixie"
|
||||||
# Node image to use for base image based on combined variables (ex: 20-trixie-slim)
|
# Node image to use for base image based on combined variables (ex: 20-trixie-slim)
|
||||||
|
|||||||
Reference in New Issue
Block a user