Skip to content

Commit

Permalink
Merge pull request #755 from kmycode/upstream-20240604
Browse files Browse the repository at this point in the history
Upstream 20240604
  • Loading branch information
kmycode authored Jun 4, 2024
2 parents 51155d6 + 2a7c52a commit aac7bd3
Show file tree
Hide file tree
Showing 93 changed files with 1,137 additions and 463 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.13
20.14
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.1
3.3.2
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
ARG TARGETPLATFORM=${TARGETPLATFORM}
ARG BUILDPLATFORM=${BUILDPLATFORM}

# Ruby image to use for base image, change with [--build-arg RUBY_VERSION="3.3.1"]
ARG RUBY_VERSION="3.3.1"
# Ruby image to use for base image, change with [--build-arg RUBY_VERSION="3.3.x"]
ARG RUBY_VERSION="3.3.2"
# # Node version to use in base image, change with [--build-arg NODE_MAJOR_VERSION="20"]
ARG NODE_MAJOR_VERSION="20"
# Debian image to use for base image, change with [--build-arg DEBIAN_VERSION="bookworm"]
ARG DEBIAN_VERSION="bookworm"
# Node image to use for base image based on combined variables (ex: 20-bookworm-slim)
FROM docker.io/node:${NODE_MAJOR_VERSION}-${DEBIAN_VERSION}-slim as node
# Ruby image to use for base image based on combined variables (ex: 3.3.1-slim-bookworm)
# Ruby image to use for base image based on combined variables (ex: 3.3.x-slim-bookworm)
FROM docker.io/ruby:${RUBY_VERSION}-slim-${DEBIAN_VERSION} as ruby

# Resulting version string is vX.X.X-MASTODON_VERSION_PRERELEASE+MASTODON_VERSION_METADATA
# Example: v4.2.0-nightly.2023.11.09+something
# Overwrite existence of 'alpha.0' in version.rb [--build-arg MASTODON_VERSION_PRERELEASE="nightly.2023.11.09"]
ARG MASTODON_VERSION_PRERELEASE=""
# Append build metadata or fork information to version.rb [--build-arg MASTODON_VERSION_METADATA="something"]
# Append build metadata or fork information to version.rb [--build-arg MASTODON_VERSION_METADATA="pr-12345"]
ARG MASTODON_VERSION_METADATA=""

# Allow Ruby on Rails to serve static files
Expand Down
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ GEM
climate_control (1.2.0)
cocoon (1.2.15)
color_diff (0.1)
concurrent-ruby (1.2.3)
concurrent-ruby (1.3.1)
connection_pool (2.4.1)
cose (1.3.0)
cbor (~> 0.5.9)
Expand Down Expand Up @@ -579,7 +579,7 @@ GEM
orm_adapter (0.5.0)
ox (2.14.18)
parallel (1.24.0)
parser (3.3.1.0)
parser (3.3.2.0)
ast (~> 2.4.1)
racc
parslet (2.0.0)
Expand All @@ -597,7 +597,7 @@ GEM
net-smtp
premailer (~> 1.7, >= 1.7.9)
private_address_check (0.5.0)
propshaft (0.8.0)
propshaft (0.9.0)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
Expand Down Expand Up @@ -726,7 +726,7 @@ GEM
rspec-mocks (~> 3.0)
sidekiq (>= 5, < 8)
rspec-support (3.13.1)
rubocop (1.64.0)
rubocop (1.64.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down Expand Up @@ -1050,7 +1050,7 @@ DEPENDENCIES
xorcist (~> 1.1)

RUBY VERSION
ruby 3.3.1p55
ruby 3.3.2p78

BUNDLED WITH
2.5.9
2.5.11
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,4 @@ def pagination_since_id
def records_continue?
@accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,4 @@ def pagination_since_id
def records_continue?
@accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class Api::V1::Admin::CanonicalEmailBlocksController < Api::BaseController
after_action :verify_authorized
after_action :insert_pagination_headers, only: :index

PAGINATION_PARAMS = %i(limit).freeze

def index
authorize :canonical_email_block, :index?
render json: @canonical_email_blocks, each_serializer: REST::Admin::CanonicalEmailBlockSerializer
Expand Down Expand Up @@ -80,8 +78,4 @@ def pagination_collection
def records_continue?
@canonical_email_blocks.size == limit_param(LIMIT)
end

def pagination_params(core_params)
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
end
end
6 changes: 0 additions & 6 deletions app/controllers/api/v1/admin/domain_allows_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class Api::V1::Admin::DomainAllowsController < Api::BaseController
after_action :verify_authorized
after_action :insert_pagination_headers, only: :index

PAGINATION_PARAMS = %i(limit).freeze

def index
authorize :domain_allow, :index?
render json: @domain_allows, each_serializer: REST::Admin::DomainAllowSerializer
Expand Down Expand Up @@ -77,10 +75,6 @@ def records_continue?
@domain_allows.size == limit_param(LIMIT)
end

def pagination_params(core_params)
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
end

def resource_params
params.permit(:domain)
end
Expand Down
6 changes: 0 additions & 6 deletions app/controllers/api/v1/admin/domain_blocks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController
after_action :verify_authorized
after_action :insert_pagination_headers, only: :index

PAGINATION_PARAMS = %i(limit).freeze

def index
authorize :domain_block, :index?
render json: @domain_blocks, each_serializer: REST::Admin::DomainBlockSerializer
Expand Down Expand Up @@ -94,10 +92,6 @@ def records_continue?
@domain_blocks.size == limit_param(LIMIT)
end

def pagination_params(core_params)
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
end

def resource_params
params.permit(:domain, :severity, :reject_media, :reject_favourite, :reject_reply_exclude_followers, :reject_send_sensitive, :reject_hashtag, :reject_straight_follow,
:reject_new_follow, :reject_friend, :block_trends, :detect_invalid_subscription, :reject_reports, :private_comment, :public_comment, :obfuscate, :hidden)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ class Api::V1::Admin::EmailDomainBlocksController < Api::BaseController
after_action :verify_authorized
after_action :insert_pagination_headers, only: :index

PAGINATION_PARAMS = %i(
limit
).freeze

def index
authorize :email_domain_block, :index?
render json: @email_domain_blocks, each_serializer: REST::Admin::EmailDomainBlockSerializer
Expand Down Expand Up @@ -73,8 +69,4 @@ def pagination_collection
def records_continue?
@email_domain_blocks.size == limit_param(LIMIT)
end

def pagination_params(core_params)
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
end
end
8 changes: 0 additions & 8 deletions app/controllers/api/v1/admin/ip_blocks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ class Api::V1::Admin::IpBlocksController < Api::BaseController
after_action :verify_authorized
after_action :insert_pagination_headers, only: :index

PAGINATION_PARAMS = %i(
limit
).freeze

def index
authorize :ip_block, :index?
render json: @ip_blocks, each_serializer: REST::Admin::IpBlockSerializer
Expand Down Expand Up @@ -78,8 +74,4 @@ def pagination_collection
def records_continue?
@ip_blocks.size == limit_param(LIMIT)
end

def pagination_params(core_params)
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
end
end
5 changes: 0 additions & 5 deletions app/controllers/api/v1/admin/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class Api::V1::Admin::TagsController < Api::BaseController
after_action :verify_authorized

LIMIT = 100
PAGINATION_PARAMS = %i(limit).freeze

def index
authorize :tag, :index?
Expand Down Expand Up @@ -59,8 +58,4 @@ def pagination_collection
def records_continue?
@tags.size == limit_param(LIMIT)
end

def pagination_params(core_params)
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ class Api::V1::Admin::Trends::Links::PreviewCardProvidersController < Api::BaseC
after_action :verify_authorized
after_action :insert_pagination_headers, only: :index

PAGINATION_PARAMS = %i(limit).freeze

def index
authorize :preview_card_provider, :index?

Expand Down Expand Up @@ -57,8 +55,4 @@ def pagination_collection
def records_continue?
@providers.size == limit_param(LIMIT)
end

def pagination_params(core_params)
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
end
end
4 changes: 0 additions & 4 deletions app/controllers/api/v1/blocks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,4 @@ def pagination_collection
def records_continue?
paginated_blocks.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end
end
4 changes: 0 additions & 4 deletions app/controllers/api/v1/bookmarks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,4 @@ def pagination_collection
def records_continue?
results.size == limit_param(DEFAULT_STATUSES_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end
end
4 changes: 0 additions & 4 deletions app/controllers/api/v1/conversations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,4 @@ def pagination_since_id
def records_continue?
@conversations.size == limit_param(LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,4 @@ def pagination_collection
def records_continue?
@encrypted_messages.size == limit_param(LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end
end
4 changes: 0 additions & 4 deletions app/controllers/api/v1/domain_blocks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ def records_continue?
@blocks.size == limit_param(BLOCK_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end

def domain_block_params
params.permit(:domain)
end
Expand Down
4 changes: 0 additions & 4 deletions app/controllers/api/v1/endorsements_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ def records_continue?
@accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end

def unlimited?
params[:limit] == '0'
end
Expand Down
4 changes: 0 additions & 4 deletions app/controllers/api/v1/favourites_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,4 @@ def pagination_collection
def records_continue?
results.size == limit_param(DEFAULT_STATUSES_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end
end
4 changes: 0 additions & 4 deletions app/controllers/api/v1/follow_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,4 @@ def pagination_since_id
def records_continue?
@accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end
end
4 changes: 0 additions & 4 deletions app/controllers/api/v1/followed_tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,4 @@ def pagination_collection
def records_continue?
@results.size == limit_param(TAGS_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Api::V1::Instances::ExtendedDescriptionsController < Api::V1::Instances::B

before_action :set_extended_description

# Override `current_user` to avoid reading session cookies unless in whitelist mode
# Override `current_user` to avoid reading session cookies unless in limited federation mode
def current_user
super if limited_federation_mode?
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/instances/peers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Api::V1::Instances::PeersController < Api::V1::Instances::BaseController

skip_around_action :set_locale

# Override `current_user` to avoid reading session cookies unless in whitelist mode
# Override `current_user` to avoid reading session cookies unless in limited federation mode
def current_user
super if limited_federation_mode?
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/instances/rules_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Api::V1::Instances::RulesController < Api::V1::Instances::BaseController

before_action :set_rules

# Override `current_user` to avoid reading session cookies unless in whitelist mode
# Override `current_user` to avoid reading session cookies unless in limited federation mode
def current_user
super if limited_federation_mode?
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/instances_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Api::V1::InstancesController < Api::BaseController

vary_by ''

# Override `current_user` to avoid reading session cookies unless in whitelist mode
# Override `current_user` to avoid reading session cookies unless in limited federation mode
def current_user
super if limited_federation_mode?
end
Expand Down
4 changes: 0 additions & 4 deletions app/controllers/api/v1/lists/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ def records_continue?
@accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end

def unlimited?
params[:limit] == '0'
end
Expand Down
4 changes: 0 additions & 4 deletions app/controllers/api/v1/mutes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,4 @@ def pagination_collection
def records_continue?
paginated_mutes.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end
end
4 changes: 0 additions & 4 deletions app/controllers/api/v1/scheduled_statuses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ def scheduled_status_params
params.permit(:scheduled_at)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end

def next_path
api_v1_scheduled_statuses_url pagination_params(max_id: pagination_max_id) if records_continue?
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,4 @@ def pagination_since_id
def records_continue?
@accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,4 @@ def pagination_since_id
def records_continue?
@accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
end

def pagination_params(core_params)
params.slice(:limit).permit(:limit).merge(core_params)
end
end
Loading

0 comments on commit aac7bd3

Please sign in to comment.