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

Merge upstream changes up to 77cd16f4ee7ab807df6fffb1538a6659a8182a9e #2889

Merged
merged 69 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
fb6d7ed
Replace `execCommand` for copying text with the modern `clipboard` AP…
renchap Oct 21, 2024
52af99c
Update dependency libvips to v8.15.5 (#32596)
renovate[bot] Oct 21, 2024
a19a120
Update DefinitelyTyped types (non-major) (#32278)
renovate[bot] Oct 21, 2024
8e39cc9
Update Yarn to v4.5.1 (#32586)
renovate[bot] Oct 21, 2024
35da47c
Update devDependencies (non-major) (#32603)
renovate[bot] Oct 21, 2024
2e0bb35
Update dependency brakeman to v6.2.2 (#32587)
renovate[bot] Oct 21, 2024
650f224
Update dependency faker to v3.5.1 (#32588)
renovate[bot] Oct 21, 2024
4a65fa7
Update dependency aws-sdk-s3 to v1.169.0 (#32552)
renovate[bot] Oct 21, 2024
11a63b2
Update eslint (non-major) (#32279)
renovate[bot] Oct 21, 2024
29f98b3
Update dependency ruby-prof to v1.7.1 (#32599)
renovate[bot] Oct 21, 2024
e05f9fe
Update dependency pino to v9.5.0 (#32511)
renovate[bot] Oct 21, 2024
40b4f73
Pre-import Rails 7.2 generated config minor changes (#30579)
mjankowski Oct 21, 2024
bd850d1
Update dependency @reduxjs/toolkit to v2.3.0 (#32497)
renovate[bot] Oct 21, 2024
699f75b
Update dependency eslint-plugin-react-hooks to v5 (#32425)
renovate[bot] Oct 21, 2024
4d5b2de
Update dependency mime-types to '~> 3.6.0' (#32215)
renovate[bot] Oct 21, 2024
36f1ec1
Update dependency ubuntu to v24 (#32280)
renovate[bot] Oct 21, 2024
bb05325
Update dependency eslint-plugin-formatjs to v5 (#32087)
renovate[bot] Oct 21, 2024
346cdb9
Fix 'unknown' media attachment type rendering (#32613)
ThisIsMissEm Oct 22, 2024
f8a66e9
Update formatjs monorepo (#32612)
renovate[bot] Oct 22, 2024
16597fa
Fix tl language native name (#32606)
seav Oct 22, 2024
18659f8
Fix that blocking was not working on link timeline (#32625)
tribela Oct 22, 2024
029c99b
Do not change follow counters when already following (#32622)
oneiros Oct 22, 2024
6d2f865
Add coverage for `AccountAlias` validations (#31936)
mjankowski Oct 23, 2024
0a4a73f
Add coverage for `api/v1/domain_blocks/preview` endpoint (#32303)
mjankowski Oct 23, 2024
67403e7
Add coverage for ActivityPub likes/shares endpoints (#32305)
mjankowski Oct 23, 2024
1f37229
Top off coverage for `Appeal` model (#32464)
mjankowski Oct 23, 2024
c0f46e9
Fortify coverage for `Follow` model (#32472)
mjankowski Oct 23, 2024
bd0c826
Simplify model validation specs for `Announcement` (#32481)
mjankowski Oct 23, 2024
d1b20ea
Worker specs coverage increase (#32541)
mjankowski Oct 23, 2024
05f23df
Add endpoint to remove web push subscription (#32626)
oneiros Oct 23, 2024
393f0a0
Redesign Content Warning and filters (#32543)
ClearlyClaire Oct 23, 2024
c3e684b
Remove unused svg logos (#32581)
mjankowski Oct 23, 2024
fae1de6
Remove duplicate indexes from database (#32454)
mjankowski Oct 23, 2024
2f906ed
Constants for account refresh (#32420)
mjankowski Oct 23, 2024
a850be4
Match ruby version in lockfile to version in `.ruby-version` (#31995)
mjankowski Oct 23, 2024
5a4f4f3
Remove single-use `ProfileStories` method (#31164)
mjankowski Oct 23, 2024
35f008a
Move translation service config to `config_for` yml (#30663)
mjankowski Oct 23, 2024
97b18d1
Move hcaptcha service config to `config_for` yml (#30662)
mjankowski Oct 23, 2024
d11231a
Change design of rich text elements in web UI (#32633)
Gargron Oct 24, 2024
745c4f9
Remove unused `ApplicationHelper#visibility_icon` helper method (#32644)
mjankowski Oct 24, 2024
5c910dc
Add coverage for `DatabaseHelper` primary/replica methods (#32642)
mjankowski Oct 24, 2024
67504db
Simplify uniqueness validation spec for `IpBlock` (#32066)
mjankowski Oct 24, 2024
b16435e
Explore more resplendent model validation specs for `Form::AdminSetti…
mjankowski Oct 24, 2024
dea6c45
Contribute more coverage for `Account` model (#32474)
mjankowski Oct 24, 2024
37bcbea
Simplify model validation spec in AccountModerationNote/ReportNote (#…
mjankowski Oct 24, 2024
e5be4bf
Simplify model validation specs for `PreviewCard` (#32469)
mjankowski Oct 25, 2024
4134ccd
Simplify model validation specs for `WebauthnCredential` (#32466)
mjankowski Oct 25, 2024
2e3bbb6
Move account suspension related coverage to concern spec (#32432)
mjankowski Oct 25, 2024
2a13d68
Use `subject` for `FeedManager` lib spec (#32486)
mjankowski Oct 25, 2024
86132f7
Provide `establish_policy` helper method in `AccountStatusesCleanupPo…
mjankowski Oct 25, 2024
15f6336
Simplify model validation specs for `AccountMigration` (#32494)
mjankowski Oct 25, 2024
66c0471
Enrich coverage for `IpBlock` model (#32471)
mjankowski Oct 25, 2024
9464281
Simplify model validation specs for `AccountStatusCleanupPolicy` (#32…
mjankowski Oct 25, 2024
1775e15
Simplify model validation specs for `DomainAllow` (#32496)
mjankowski Oct 25, 2024
0970cf8
Update dependency pg to v1.5.9 (#32655)
renovate[bot] Oct 25, 2024
097942a
Update dependency pg to v8.13.1 (#32650)
renovate[bot] Oct 25, 2024
5f58357
Update opentelemetry-ruby (non-major) (#32631)
renovate[bot] Oct 25, 2024
60b0ad0
Update dependency postcss-preset-env to v10.0.8 (#32647)
renovate[bot] Oct 25, 2024
aa29e42
Update babel monorepo to v7.25.9 (#32628)
renovate[bot] Oct 25, 2024
3aa3884
Update formatjs monorepo (#32651)
renovate[bot] Oct 25, 2024
77cd16f
Update dependency opentelemetry-instrumentation-active_job to v0.7.8 …
renovate[bot] Oct 25, 2024
8103e69
Merge commit '77cd16f4ee7ab807df6fffb1538a6659a8182a9e' into glitch-s…
ClearlyClaire Oct 26, 2024
d304540
[Glitch] Replace `execCommand` for copying text with the modern `clip…
renchap Oct 21, 2024
28287eb
[Glitch] Fix 'unknown' media attachment type rendering
ThisIsMissEm Oct 22, 2024
50a40d1
[Glitch] Do not change follow counters when already following
oneiros Oct 22, 2024
227bf77
[Glitch] Change design of rich text elements in web UI
Gargron Oct 24, 2024
8a222b3
Fix assets build failure on glitch-soc
ClearlyClaire Oct 26, 2024
e8d23f6
[Glitch] Update eslint (non-major)
renovate[bot] Oct 21, 2024
1d3d549
[Glitch] Redesign Content Warning and filters
ClearlyClaire Oct 23, 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
2 changes: 1 addition & 1 deletion .github/workflows/check-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:

jobs:
check-i18n:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ FROM build AS libvips

# libvips version to compile, change with [--build-arg VIPS_VERSION="8.15.2"]
# renovate: datasource=github-releases depName=libvips packageName=libvips/libvips
ARG VIPS_VERSION=8.15.3
ARG VIPS_VERSION=8.15.5
# libvips download URL, change with [--build-arg VIPS_URL="https://github.com/libvips/libvips/releases/download"]
ARG VIPS_URL=https://github.com/libvips/libvips/releases/download

Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ gem 'irb', '~> 1.8'
gem 'kaminari', '~> 1.2'
gem 'link_header', '~> 0.0'
gem 'mario-redis-lock', '~> 1.2', require: 'redis_lock'
gem 'mime-types', '~> 3.5.0', require: 'mime/types/columnar'
gem 'mime-types', '~> 3.6.0', require: 'mime/types/columnar'
gem 'nokogiri', '~> 1.15'
gem 'oj', '~> 3.14'
gem 'ox', '~> 2.14'
Expand Down Expand Up @@ -111,8 +111,8 @@ group :opentelemetry do
gem 'opentelemetry-instrumentation-http_client', '~> 0.22.3', require: false
gem 'opentelemetry-instrumentation-net_http', '~> 0.22.4', require: false
gem 'opentelemetry-instrumentation-pg', '~> 0.29.0', require: false
gem 'opentelemetry-instrumentation-rack', '~> 0.24.1', require: false
gem 'opentelemetry-instrumentation-rails', '~> 0.31.0', require: false
gem 'opentelemetry-instrumentation-rack', '~> 0.25.0', require: false
gem 'opentelemetry-instrumentation-rails', '~> 0.32.0', require: false
gem 'opentelemetry-instrumentation-redis', '~> 0.25.3', require: false
gem 'opentelemetry-instrumentation-sidekiq', '~> 0.25.2', require: false
gem 'opentelemetry-sdk', '~> 1.4', require: false
Expand Down
51 changes: 26 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,17 @@ GEM
attr_required (1.0.2)
awrence (1.2.1)
aws-eventstream (1.3.0)
aws-partitions (1.983.0)
aws-sdk-core (3.209.1)
aws-partitions (1.992.0)
aws-sdk-core (3.210.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.94.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-kms (1.95.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.167.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-s3 (1.169.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.10.0)
Expand All @@ -137,7 +137,7 @@ GEM
blurhash (0.1.8)
bootsnap (1.18.4)
msgpack (~> 1.2)
brakeman (6.2.1)
brakeman (6.2.2)
racc
browser (5.3.1)
brpoplpush-redis_script (0.1.3)
Expand Down Expand Up @@ -233,7 +233,7 @@ GEM
tzinfo
excon (0.111.0)
fabrication (2.31.0)
faker (3.4.2)
faker (3.5.1)
i18n (>= 1.8.11, < 2)
faraday (1.10.3)
faraday-em_http (~> 1.0)
Expand Down Expand Up @@ -429,9 +429,10 @@ GEM
azure-storage-blob (~> 2.0.1)
hashie (~> 5.0)
memory_profiler (1.1.0)
mime-types (3.5.2)
mime-types (3.6.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0820)
mime-types-data (3.2024.1001)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.25.1)
Expand Down Expand Up @@ -503,7 +504,7 @@ GEM
opentelemetry-semantic_conventions
opentelemetry-helpers-sql-obfuscation (0.2.0)
opentelemetry-common (~> 0.21)
opentelemetry-instrumentation-action_mailer (0.1.0)
opentelemetry-instrumentation-action_mailer (0.2.0)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-active_support (~> 0.1)
opentelemetry-instrumentation-base (~> 0.22.1)
Expand All @@ -515,13 +516,13 @@ GEM
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-active_support (~> 0.1)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-active_job (0.7.7)
opentelemetry-instrumentation-active_job (0.7.8)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-active_model_serializers (0.20.2)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-active_record (0.7.3)
opentelemetry-instrumentation-active_record (0.8.0)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-active_support (0.6.0)
Expand Down Expand Up @@ -553,16 +554,16 @@ GEM
opentelemetry-api (~> 1.0)
opentelemetry-helpers-sql-obfuscation
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-rack (0.24.6)
opentelemetry-instrumentation-rack (0.25.0)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-rails (0.31.2)
opentelemetry-instrumentation-rails (0.32.0)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-action_mailer (~> 0.1.0)
opentelemetry-instrumentation-action_mailer (~> 0.2.0)
opentelemetry-instrumentation-action_pack (~> 0.9.0)
opentelemetry-instrumentation-action_view (~> 0.7.0)
opentelemetry-instrumentation-active_job (~> 0.7.0)
opentelemetry-instrumentation-active_record (~> 0.7.0)
opentelemetry-instrumentation-active_record (~> 0.8.0)
opentelemetry-instrumentation-active_support (~> 0.6.0)
opentelemetry-instrumentation-base (~> 0.22.1)
opentelemetry-instrumentation-redis (0.25.7)
Expand Down Expand Up @@ -590,7 +591,7 @@ GEM
parslet (2.0.0)
pastel (0.8.0)
tty-color (~> 0.5)
pg (1.5.8)
pg (1.5.9)
pghero (3.6.1)
activerecord (>= 6.1)
premailer (1.27.0)
Expand Down Expand Up @@ -761,7 +762,7 @@ GEM
rubocop-rspec_rails (2.30.0)
rubocop (~> 1.61)
rubocop-rspec (~> 3, >= 3.0.1)
ruby-prof (1.7.0)
ruby-prof (1.7.1)
ruby-progressbar (1.13.0)
ruby-saml (1.17.0)
nokogiri (>= 1.13.10)
Expand Down Expand Up @@ -970,7 +971,7 @@ DEPENDENCIES
mario-redis-lock (~> 1.2)
md-paperclip-azure (~> 2.2)
memory_profiler
mime-types (~> 3.5.0)
mime-types (~> 3.6.0)
net-http (~> 0.4.0)
net-ldap (~> 0.18)
nokogiri (~> 1.15)
Expand All @@ -991,8 +992,8 @@ DEPENDENCIES
opentelemetry-instrumentation-http_client (~> 0.22.3)
opentelemetry-instrumentation-net_http (~> 0.22.4)
opentelemetry-instrumentation-pg (~> 0.29.0)
opentelemetry-instrumentation-rack (~> 0.24.1)
opentelemetry-instrumentation-rails (~> 0.31.0)
opentelemetry-instrumentation-rack (~> 0.25.0)
opentelemetry-instrumentation-rails (~> 0.32.0)
opentelemetry-instrumentation-redis (~> 0.25.3)
opentelemetry-instrumentation-sidekiq (~> 0.25.2)
opentelemetry-sdk (~> 1.4)
Expand Down Expand Up @@ -1057,7 +1058,7 @@ DEPENDENCIES
xorcist (~> 1.1)

RUBY VERSION
ruby 3.3.4p94
ruby 3.3.5p100

BUNDLED WITH
2.5.18
2.5.22
9 changes: 8 additions & 1 deletion app/controllers/api/web/push_subscriptions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class Api::Web::PushSubscriptionsController < Api::Web::BaseController
before_action :require_user!
before_action :require_user!, except: :destroy
before_action :set_push_subscription, only: :update
before_action :destroy_previous_subscriptions, only: :create, if: :prior_subscriptions?
after_action :update_session_with_subscription, only: :create
Expand All @@ -17,6 +17,13 @@ def update
render json: @push_subscription, serializer: REST::WebPushSubscriptionSerializer
end

def destroy
push_subscription = ::Web::PushSubscription.find_by_token_for(:unsubscribe, params[:id])
push_subscription&.destroy

head 200
end

private

def active_session
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/auth/captcha_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Auth::CaptchaConcern
end

def captcha_available?
ENV['HCAPTCHA_SECRET_KEY'].present? && ENV['HCAPTCHA_SITE_KEY'].present?
Rails.configuration.x.captcha.secret_key.present? && Rails.configuration.x.captcha.site_key.present?
end

def captcha_enabled?
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/admin/settings_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Admin::SettingsHelper
def captcha_available?
ENV['HCAPTCHA_SECRET_KEY'].present? && ENV['HCAPTCHA_SITE_KEY'].present?
Rails.configuration.x.captcha.secret_key.present? && Rails.configuration.x.captcha.site_key.present?
end

def login_activity_title(activity)
Expand Down
12 changes: 0 additions & 12 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,6 @@ def check_icon
inline_svg_tag 'check.svg'
end

def visibility_icon(status)
if status.public_visibility?
material_symbol('globe', title: I18n.t('statuses.visibilities.public'))
elsif status.unlisted_visibility?
material_symbol('lock_open', title: I18n.t('statuses.visibilities.unlisted'))
elsif status.private_visibility? || status.limited_visibility?
material_symbol('lock', title: I18n.t('statuses.visibilities.private'))
elsif status.direct_visibility?
material_symbol('alternate_email', title: I18n.t('statuses.visibilities.direct'))
end
end

def interrelationships_icon(relationships, account_id)
if relationships.following[account_id] && relationships.followed_by[account_id]
material_symbol('sync_alt', title: I18n.t('relationships.mutual'), class: 'active passive')
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/languages_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ module LanguagesHelper
th: ['Thai', 'ไทย'].freeze,
ti: ['Tigrinya', 'ትግርኛ'].freeze,
tk: ['Turkmen', 'Türkmen'].freeze,
tl: ['Tagalog', 'Wikang Tagalog'].freeze,
tl: ['Tagalog', 'Tagalog'].freeze,
tn: ['Tswana', 'Setswana'].freeze,
to: ['Tonga', 'faka Tonga'].freeze,
tr: ['Turkish', 'Türkçe'].freeze,
Expand Down
35 changes: 14 additions & 21 deletions app/javascript/entrypoints/public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,31 +327,24 @@ Rails.delegate(document, '.input-copy button', 'click', ({ target }) => {

if (!input) return;

const oldReadOnly = input.readOnly;

input.readOnly = false;
input.focus();
input.select();
input.setSelectionRange(0, input.value.length);

try {
if (document.execCommand('copy')) {
input.blur();

navigator.clipboard
.writeText(input.value)
.then(() => {
const parent = target.parentElement;

if (!parent) return;
parent.classList.add('copied');
if (parent) {
parent.classList.add('copied');

setTimeout(() => {
parent.classList.remove('copied');
}, 700);
}
} catch (err) {
console.error(err);
}
setTimeout(() => {
parent.classList.remove('copied');
}, 700);
}

input.readOnly = oldReadOnly;
return true;
})
.catch((error: unknown) => {
console.error(error);
});
});

const toggleSidebar = () => {
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/flavours/glitch/components/button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PropsWithChildren } from 'react';
import type { PropsWithChildren, JSX } from 'react';
import { useCallback } from 'react';

import classNames from 'classnames';
Expand Down
10 changes: 8 additions & 2 deletions app/javascript/flavours/glitch/components/content_warning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ export const ContentWarning: React.FC<{
aria-expanded={expanded}
>
{expanded ? (
<FormattedMessage id='status.show_less' defaultMessage='Show less' />
<FormattedMessage
id='content_warning.hide'
defaultMessage='Hide post'
/>
) : (
<FormattedMessage id='status.show_more' defaultMessage='Show more' />
<FormattedMessage
id='content_warning.show_more'
defaultMessage='Show more'
/>
)}
{icons}
</button>
Expand Down
9 changes: 6 additions & 3 deletions app/javascript/flavours/glitch/components/filter_warning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ export const FilterWarning: React.FC<{
<StatusBanner
expanded={expanded}
onClick={onClick}
variant={BannerVariant.Blue}
variant={BannerVariant.Filter}
>
<p>
<FormattedMessage
id='filter_warning.matches_filter'
defaultMessage='Matches filter “{title}”'
values={{ title }}
defaultMessage='Matches filter “<span>{title}</span>”'
values={{
title,
span: (chunks) => <span className='filter-name'>{chunks}</span>,
}}
/>
</p>
</StatusBanner>
Expand Down
1 change: 1 addition & 0 deletions app/javascript/flavours/glitch/components/short_number.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { memo } from 'react';
import type { JSX } from 'react';

import { FormattedMessage, FormattedNumber } from 'react-intl';

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/flavours/glitch/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ class Status extends ImmutablePureComponent {
media={status.get('media_attachments')}
/>,
);
} else if (['image', 'gifv'].includes(status.getIn(['media_attachments', 0, 'type'])) || status.get('media_attachments').size > 1) {
} else if (['image', 'gifv', 'unknown'].includes(status.getIn(['media_attachments', 0, 'type'])) || status.get('media_attachments').size > 1) {
media.push(
<Bundle fetchComponent={MediaGallery} loading={this.renderLoadingMediaGallery}>
{Component => (
Expand Down
Loading
Loading