Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream 20241006 #864

Merged
merged 80 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
0b6d217
Use account display name for pretend blog example in attribution area…
mjankowski Oct 1, 2024
5839ee4
New Crowdin Translations (automated) (#32195)
github-actions[bot] Oct 1, 2024
1be55ce
Fix follow notifications from streaming being grouped (#32179)
renchap Oct 1, 2024
685067e
Avoid `id` duplication conflict with main navigation from settings pr…
mjankowski Oct 1, 2024
d9973f3
Update peter-evans/create-pull-request action to v7.0.5 (#32164)
renovate[bot] Oct 1, 2024
497e8d0
Bump `main` version 4.4.0-alpha.1 (#32180)
renchap Oct 1, 2024
675d3ea
Extract dashboard partial for admin instance page (#32189)
mjankowski Oct 1, 2024
f811fcb
Improve alignment of icons on admin roles list (#32153)
mjankowski Oct 1, 2024
2829f72
Update dependency propshaft to v1.1.0 (#32192)
renovate[bot] Oct 1, 2024
3d943f0
Update dependency webmock to v3.24.0 (#32190)
renovate[bot] Oct 1, 2024
b7ddf45
Update docker/dockerfile Docker tag to v1.10 (#32166)
renovate[bot] Oct 1, 2024
7a65300
Update dependency haml_lint to v0.59.0 (#32146)
renovate[bot] Oct 1, 2024
f251edf
Add `date_range` view helper (#32187)
mjankowski Oct 1, 2024
0b89765
Update RuboCop (non-major) to v1.22.1 (#31573)
renovate[bot] Oct 1, 2024
e6cda83
Move OTP secret length to configuration (#32125)
oneiros Oct 1, 2024
e975b55
Remove `WebfingerHelper` module & move usage inline (#31203)
mjankowski Oct 1, 2024
454d21a
Remove OAuth Password Grant Type support (#30960)
ThisIsMissEm Oct 1, 2024
efd3f59
Use `module: :users` in routes/admin section (#30767)
mjankowski Oct 1, 2024
8ae381f
Update dependency postcss-preset-env to v10.0.5 (#32019)
renovate[bot] Oct 1, 2024
7e35bef
Remove explicit `put` action in settings forms (#32176)
mjankowski Oct 1, 2024
489abb8
Remove explicit `put` action in prefs forms (#32175)
mjankowski Oct 1, 2024
4b4bf82
Fix nav item active highlight for some paths (#32159)
mjankowski Oct 1, 2024
651846c
Only show email domain blocks MX table when some found (#32155)
mjankowski Oct 1, 2024
c009507
Use `button_to` for `method: :post` links on account show page (#32154)
mjankowski Oct 1, 2024
ec16ed3
Extract constants for header and avatar geometry (#32151)
mjankowski Oct 1, 2024
44071fd
Wrap datetime in `time` element with attrs (#32177)
mjankowski Oct 1, 2024
c5f0da9
Add detection and download of material_symbol icons in config/navigat…
ThisIsMissEm Oct 1, 2024
7b92cf3
Fix unneeded requests to blocked domains when receiving relayed signe…
ClearlyClaire Oct 1, 2024
f73787a
Fix broken border on applications list (#32147)
mjankowski Oct 1, 2024
f10d61b
Adjust spacing on setting sub-nav items when below mobile size (#32137)
mjankowski Oct 1, 2024
df98cf7
Avoid repeated icon stack in settings sidebar (#32201)
mjankowski Oct 1, 2024
65508bb
Show timestamp when the user deletes their account on admin dashboard…
tribela Oct 1, 2024
4cae309
Fix `Rails/CreateTableWithTimestamps` cop (#30836)
mjankowski Oct 1, 2024
a2c4ba2
Update dependency rubocop-rspec to v3.1.0 (#32202)
renovate[bot] Oct 1, 2024
f91f077
Enable ESLlint no-case-declarations (#30768)
nschonni Oct 1, 2024
66b2bc1
Ignore error if mentioned account was not processable (#29215)
tribela Oct 2, 2024
ea72d5e
New Crowdin Translations (automated) (#32214)
github-actions[bot] Oct 2, 2024
f071636
Update simplecov-html to version 0.13.1 (#32205)
mjankowski Oct 2, 2024
33d3ca7
Support /.well-known/host-meta.json (#32206)
c960657 Oct 2, 2024
ebab3b8
Expand coverage for `Export` utility class (#32212)
mjankowski Oct 2, 2024
4a737a9
Fix incorrect `'navigator'` check (#32219)
ClearlyClaire Oct 2, 2024
4aa26eb
Extract `WebPushRequest` from push notification worker and subscripti…
mjankowski Oct 2, 2024
1f65a95
Remove unneeded `reorder(nil)` conditions (#32200)
mjankowski Oct 2, 2024
cf859d1
More link/button conversion across views (#32199)
mjankowski Oct 2, 2024
2151dfb
Add `relevant_params` to ReportFilter (matches account filter) (#32136)
mjankowski Oct 2, 2024
d270d6d
Provide `use_path` to qr generator for svg data size reduction (#32127)
mjankowski Oct 2, 2024
b500653
Fix media uploads in composer appearing over search results in advanc…
ClearlyClaire Oct 2, 2024
f760899
Fix editing description of media uploads with custom thumbnails (#32221)
ClearlyClaire Oct 2, 2024
b7bb850
Enable hostname config for all system specs (#32109)
mjankowski Oct 2, 2024
36f9c96
Clean up labels on development application form (#32116)
mjankowski Oct 2, 2024
7d6b9cc
Add `copyable_input` helper method to wrap shared options (#32119)
mjankowski Oct 2, 2024
cec8961
Move admin action log type list generation to helper (#32178)
mjankowski Oct 2, 2024
f768a6e
Hide badges in media gallery when media are hidden (#32224)
ClearlyClaire Oct 2, 2024
6ef510f
Update dependency json-schema to v5.0.1 (#32234)
renovate[bot] Oct 3, 2024
0be1d33
Update dependency aws-sdk-s3 to v1.167.0 (#32231)
renovate[bot] Oct 3, 2024
d96351a
Update babel monorepo to v7.25.7 (#32225)
renovate[bot] Oct 3, 2024
fe3f537
New Crowdin Translations (automated) (#32233)
github-actions[bot] Oct 3, 2024
1db91ab
Update dependency typescript to v5.6.2 (#32165)
renovate[bot] Oct 3, 2024
52afa94
Use `print_table` to wrap storage output CLI (#32230)
mjankowski Oct 3, 2024
d95f6f4
Extract `ExportSummary` class for account object counts (#32227)
mjankowski Oct 3, 2024
cc8d723
Register an XML encoder for response tests (#32220)
mjankowski Oct 3, 2024
4c0e44e
Fix recently-broken admin interface buttons (#32240)
ClearlyClaire Oct 3, 2024
aba888c
Update dependency ffmpeg to v7.1 (#32239)
renovate[bot] Oct 4, 2024
1b247a1
New Crowdin Translations (automated) (#32249)
github-actions[bot] Oct 4, 2024
12a8ac1
Update dependency node to 20.18 (#32244)
renovate[bot] Oct 4, 2024
63a9590
Add margin-bottom to error.dialog to reduce whitespace (#25708)
forsamori Oct 4, 2024
160917e
Pluralize csv imports (#27094)
gunchleoc Oct 4, 2024
82e7d53
Rename transformer constant in sanitizer (#30532)
mjankowski Oct 4, 2024
cf28104
Rename preloaded models constant in cli media (#30531)
mjankowski Oct 4, 2024
49407e7
Fix Content-Security-Policy when using sso-redirect (#32241)
ClearlyClaire Oct 4, 2024
463f919
Add regression coverage for admin reports resolution button within fo…
mjankowski Oct 4, 2024
77f5b12
Fix unsupported grouped notifications from streaming causing duplicat…
ClearlyClaire Oct 4, 2024
4fe7f21
Use `async_count` in more view locations (#32086)
mjankowski Oct 4, 2024
e4e07b1
Reduce factory usage across `spec/services` area (#32098)
mjankowski Oct 4, 2024
ebdeac0
Add coverage for missing status scenario in NotificationMailer (#32256)
mjankowski Oct 4, 2024
1f72036
Fix notification push notifications not including the author's userna…
ClearlyClaire Oct 4, 2024
51769e0
Fix media gallery items having incorrect borders when hidden (#32257)
ClearlyClaire Oct 4, 2024
c40ab43
Remove redundant title attribute (#32258)
c960657 Oct 4, 2024
66bed31
Merge remote-tracking branch 'parent/main' into upstream-20241006
kmycode Oct 5, 2024
6c04262
Update notification.jsx
kmycode Oct 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ module.exports = defineConfig({
'indent': ['error', 2],
'jsx-quotes': ['error', 'prefer-single'],
'semi': ['error', 'always'],
'no-case-declarations': 'off',
'no-catch-shadow': 'error',
'no-console': [
'warn',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/crowdin-download-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

# Create or update the pull request
- name: Create Pull Request
uses: peter-evans/[email protected].1
uses: peter-evans/[email protected].5
with:
commit-message: 'New Crowdin translations'
title: 'New Crowdin Translations for ${{ github.base_ref || github.ref_name }} (automated)'
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.17
20.18
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# syntax=docker/dockerfile:1.9
# syntax=docker/dockerfile:1.10

# This file is designed for production server deployment, not local development work
# For a containerized local dev environment, see: https://github.com/mastodon/mastodon/blob/main/README.md#docker
Expand Down Expand Up @@ -214,7 +214,7 @@ FROM build AS ffmpeg

# ffmpeg version to compile, change with [--build-arg FFMPEG_VERSION="7.0.x"]
# renovate: datasource=repology depName=ffmpeg packageName=openpkg_current/ffmpeg
ARG FFMPEG_VERSION=7.0.2
ARG FFMPEG_VERSION=7.1
# ffmpeg download URL, change with [--build-arg FFMPEG_URL="https://ffmpeg.org/releases"]
ARG FFMPEG_URL=https://ffmpeg.org/releases

Expand Down
28 changes: 14 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ GEM
attr_required (1.0.2)
awrence (1.2.1)
aws-eventstream (1.3.0)
aws-partitions (1.978.0)
aws-sdk-core (3.209.0)
aws-partitions (1.983.0)
aws-sdk-core (3.209.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.94.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.166.0)
aws-sdk-s3 (1.167.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
Expand Down Expand Up @@ -301,7 +301,7 @@ GEM
activesupport (>= 5.1)
haml (>= 4.0.6)
railties (>= 5.1)
haml_lint (0.58.0)
haml_lint (0.59.0)
haml (>= 5.0)
parallel (~> 1.10)
rainbow
Expand Down Expand Up @@ -369,7 +369,7 @@ GEM
json-ld-preloaded (3.3.0)
json-ld (~> 3.3)
rdf (~> 3.3)
json-schema (5.0.0)
json-schema (5.0.1)
addressable (~> 2.8)
jsonapi-renderer (0.2.2)
jwt (2.7.1)
Expand Down Expand Up @@ -601,7 +601,7 @@ GEM
actionmailer (>= 3)
net-smtp
premailer (~> 1.7, >= 1.7.9)
propshaft (1.0.1)
propshaft (1.1.0)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
Expand Down Expand Up @@ -698,7 +698,7 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.7)
rexml (3.3.8)
rotp (6.3.0)
rouge (4.3.0)
rpam2 (4.0.2)
Expand Down Expand Up @@ -748,15 +748,15 @@ GEM
parser (>= 3.3.1.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
rubocop-performance (1.21.1)
rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.25.1)
rubocop-rails (2.26.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (3.0.4)
rubocop-rspec (3.1.0)
rubocop (~> 1.61)
rubocop-rspec_rails (2.30.0)
rubocop (~> 1.61)
Expand Down Expand Up @@ -815,7 +815,7 @@ GEM
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov-html (0.13.1)
simplecov-lcov (0.8.0)
simplecov_json_formatter (0.1.4)
stackprof (0.2.26)
Expand Down Expand Up @@ -862,7 +862,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.9.1)
unicode-display_width (2.5.0)
unicode-display_width (2.6.0)
uri (0.13.1)
validate_email (0.1.6)
activemodel (>= 3.0)
Expand All @@ -884,7 +884,7 @@ GEM
webfinger (1.2.0)
activesupport
httpclient (>= 2.4)
webmock (3.23.1)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/announcements_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Admin::AnnouncementsController < Admin::BaseController

def index
authorize :announcement, :index?
@published_announcements_count = Announcement.published.async_count
end

def new
Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/disputes/appeals_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Admin::Disputes::AppealsController < Admin::BaseController
def index
authorize :appeal, :index?

@pending_appeals_count = Appeal.pending.async_count
@appeals = filtered_appeals.page(params[:page])
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Admin::Trends::Links::PreviewCardProvidersController < Admin::BaseControll
def index
authorize :preview_card_provider, :review?

@pending_preview_card_providers_count = PreviewCardProvider.unreviewed.async_count
@preview_card_providers = filtered_preview_card_providers.page(params[:page])
@form = Trends::PreviewCardProviderBatch.new
end
Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/trends/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Admin::Trends::TagsController < Admin::BaseController
def index
authorize :tag, :review?

@pending_tags_count = Tag.pending_review.async_count
@tags = filtered_tags.page(params[:page])
@form = Trends::TagBatch.new
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/web_app_controller_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module WebAppControllerConcern
policy = ContentSecurityPolicy.new

if policy.sso_host.present?
p.form_action policy.sso_host
p.form_action policy.sso_host, -> { "https://#{request.host}/auth/auth/" }
else
p.form_action :none
end
Expand Down
13 changes: 12 additions & 1 deletion app/controllers/settings/exports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Settings::ExportsController < Settings::BaseController
skip_before_action :require_functional!

def show
@export = Export.new(current_account)
@export_summary = ExportSummary.new(preloaded_account)
@backups = current_user.backups
end

Expand All @@ -25,4 +25,15 @@ def create

redirect_to settings_export_path
end

private

def preloaded_account
current_account.tap do |account|
ActiveRecord::Associations::Preloader.new(
records: [account],
associations: :account_stat
).call
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def show
end

def create
session[:new_otp_secret] = User.generate_otp_secret(32)
session[:new_otp_secret] = User.generate_otp_secret

redirect_to new_settings_two_factor_authentication_confirmation_path
end
Expand Down
18 changes: 17 additions & 1 deletion app/controllers/well_known/host_meta_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@ class HostMetaController < ActionController::Base # rubocop:disable Rails/Applic
def show
@webfinger_template = "#{webfinger_url}?resource={uri}"
expires_in 3.days, public: true
render content_type: 'application/xrd+xml', formats: [:xml]

respond_to do |format|
format.any do
render content_type: 'application/xrd+xml', formats: [:xml]
end

format.json do
render json: {
links: [
{
rel: 'lrdd',
template: @webfinger_template,
},
],
}
end
end
end
end
end
7 changes: 7 additions & 0 deletions app/helpers/admin/action_logs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,11 @@ def log_target(log)
end
end
end

def sorted_action_log_types
Admin::ActionLogFilter::ACTION_TYPE_MAP
.keys
.map { |key| [I18n.t("admin.action_logs.action_types.#{key}"), key] }
.sort_by(&:first)
end
end
7 changes: 7 additions & 0 deletions app/helpers/admin/dashboard_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ def relevant_account_ip(account, ip_query)
end
end

def date_range(range)
[l(range.first), l(range.last)]
.join(' - ')
end

def relevant_account_timestamp(account)
timestamp, exact = if account.user_current_sign_in_at && account.user_current_sign_in_at < 24.hours.ago
[account.user_current_sign_in_at, true]
elsif account.user_current_sign_in_at
[account.user_current_sign_in_at, false]
elsif account.user_pending?
[account.user_created_at, true]
elsif account.suspended_at.present? && account.local? && account.user.nil?
[account.suspended_at, true]
elsif account.last_status_at.present?
[account.last_status_at, true]
else
Expand Down
17 changes: 9 additions & 8 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
module ApplicationHelper
include RegistrationLimitationHelper

DANGEROUS_SCOPES = %w(
read
write
follow
).freeze

RTL_LOCALES = %i(
ar
ckb
Expand Down Expand Up @@ -97,8 +91,11 @@ def title
Rails.env.production? ? site_title : "#{site_title} (Dev)"
end

def class_for_scope(scope)
'scope-danger' if DANGEROUS_SCOPES.include?(scope.to_s)
def label_for_scope(scope)
safe_join [
tag.samp(scope, class: { 'scope-danger' => SessionActivation::DEFAULT_SCOPES.include?(scope.to_s) }),
tag.span(t("doorkeeper.scopes.#{scope}"), class: :hint),
]
end

def can?(action, record)
Expand Down Expand Up @@ -266,6 +263,10 @@ def user_custom_css_version
current_account&.user&.custom_css&.updated_at.to_s
end

def copyable_input(options = {})
tag.input(type: :text, maxlength: 999, spellcheck: false, readonly: true, **options)
end

private

def storage_host_var
Expand Down
7 changes: 0 additions & 7 deletions app/helpers/webfinger_helper.rb

This file was deleted.

3 changes: 1 addition & 2 deletions app/javascript/mastodon/actions/markers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ export const synchronouslySubmitMarkers = createAppAsyncThunk(
});

return;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
} else if ('navigator' && 'sendBeacon' in navigator) {
} else if ('sendBeacon' in navigator) {
// Failing that, we can use sendBeacon, but we have to encode the data as
// FormData for DoorKeeper to recognize the token.
const formData = new FormData();
Expand Down
4 changes: 4 additions & 0 deletions app/javascript/mastodon/actions/notification_groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ const supportedGroupedNotificationTypes = [
'emoji_reaction',
];

export function shouldGroupNotificationType(type: string) {
return supportedGroupedNotificationTypes.includes(type);
}

export const fetchNotifications = createDataLoadingThunk(
'notificationGroups/fetch',
async (_params, { getState }) =>
Expand Down
3 changes: 2 additions & 1 deletion app/javascript/mastodon/actions/streaming.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,13 @@ export const connectTimelineStream = (timelineId, channelName, params = {}, opti
// @ts-expect-error
dispatch(updateEmojiReactions(JSON.parse(data.payload)));
break;
case 'notifications_merged':
case 'notifications_merged': {
const state = getState();
if (state.notifications.top || !state.notifications.mounted)
dispatch(expandNotifications({ forceLoad: true, maxId: undefined }));
dispatch(refreshStaleNotificationGroups());
break;
}
case 'conversation':
// @ts-expect-error
dispatch(updateConversations(JSON.parse(data.payload)));
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/mastodon/components/media_gallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class Item extends PureComponent {

{visible && thumbnail}

{badges && (
{visible && badges && (
<div className='media-gallery__item__badges'>
{badges}
</div>
Expand Down Expand Up @@ -366,14 +366,14 @@ class MediaGallery extends PureComponent {

return (
<div className={classNames(classList)} style={style} ref={this.handleRef}>
{children}

{(!visible || uncached) && (
<div className={classNames('spoiler-button', { 'spoiler-button--click-thru': uncached })}>
{spoilerButton}
</div>
)}

{children}

{(visible && !uncached) && (
<div className='media-gallery__actions'>
<button className='media-gallery__actions__pill' onClick={this.handleOpen}><FormattedMessage id='media_gallery.hide' defaultMessage='Hide' /></button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,11 @@ class Notification extends ImmutablePureComponent {
return this.renderStatusReference(notification, link);
case 'status':
return this.renderStatus(notification, link);
case 'list_status':
case 'list_status': {
const list = notification.get('list');
const listLink = <bdi><Link className='notification__display-name' href={`/lists/${list.get('id')}`} title={list.get('title')} to={`/lists/${list.get('id')}`}>{list.get('title')}</Link></bdi>;
return this.renderListStatus(notification, listLink, link);
}
case 'update':
return this.renderUpdate(notification, link);
case 'poll':
Expand Down
Loading
Loading