Skip to content

Commit e16a7a0

Browse files
committed
Merge remote-tracking branch 'upstream/master' into dev
2 parents b8de049 + 974b1b7 commit e16a7a0

92 files changed

Lines changed: 1026 additions & 540 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ ruby '>= 2.5.0', '< 3.0.0'
66
gem 'pkg-config', '~> 1.4'
77

88
gem 'puma', '~> 4.3'
9-
gem 'rails', '~> 5.2.4.3'
9+
gem 'rails', '~> 5.2.4.4'
1010
gem 'sprockets', '~> 3.7.2'
11-
gem 'thor', '~> 0.20'
11+
gem 'thor', '~> 1.0'
1212
gem 'rack', '~> 2.2.3'
1313

1414
gem 'thwait', '~> 0.2.0'
@@ -20,7 +20,7 @@ gem 'makara', '~> 0.4'
2020
gem 'pghero', '~> 2.7'
2121
gem 'dotenv-rails', '~> 2.7'
2222

23-
gem 'aws-sdk-s3', '~> 1.79', require: false
23+
gem 'aws-sdk-s3', '~> 1.80', require: false
2424
gem 'fog-core', '<= 2.1.0'
2525
gem 'fog-openstack', '~> 0.3', require: false
2626
gem 'paperclip', '~> 6.0'
@@ -129,7 +129,7 @@ group :test do
129129
gem 'rails-controller-testing', '~> 1.0'
130130
gem 'rspec-sidekiq', '~> 3.1'
131131
gem 'simplecov', '~> 0.19', require: false
132-
gem 'webmock', '~> 3.8'
132+
gem 'webmock', '~> 3.9'
133133
gem 'parallel_tests', '~> 3.2'
134134
gem 'rspec_junit_formatter', '~> 0.4'
135135
end

Gemfile.lock

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@ GIT
1616
GEM
1717
remote: https://rubygems.org/
1818
specs:
19-
actioncable (5.2.4.3)
20-
actionpack (= 5.2.4.3)
19+
actioncable (5.2.4.4)
20+
actionpack (= 5.2.4.4)
2121
nio4r (~> 2.0)
2222
websocket-driver (>= 0.6.1)
23-
actionmailer (5.2.4.3)
24-
actionpack (= 5.2.4.3)
25-
actionview (= 5.2.4.3)
26-
activejob (= 5.2.4.3)
23+
actionmailer (5.2.4.4)
24+
actionpack (= 5.2.4.4)
25+
actionview (= 5.2.4.4)
26+
activejob (= 5.2.4.4)
2727
mail (~> 2.5, >= 2.5.4)
2828
rails-dom-testing (~> 2.0)
29-
actionpack (5.2.4.3)
30-
actionview (= 5.2.4.3)
31-
activesupport (= 5.2.4.3)
29+
actionpack (5.2.4.4)
30+
actionview (= 5.2.4.4)
31+
activesupport (= 5.2.4.4)
3232
rack (~> 2.0, >= 2.0.8)
3333
rack-test (>= 0.6.3)
3434
rails-dom-testing (~> 2.0)
3535
rails-html-sanitizer (~> 1.0, >= 1.0.2)
36-
actionview (5.2.4.3)
37-
activesupport (= 5.2.4.3)
36+
actionview (5.2.4.4)
37+
activesupport (= 5.2.4.4)
3838
builder (~> 3.1)
3939
erubi (~> 1.4)
4040
rails-dom-testing (~> 2.0)
@@ -45,20 +45,20 @@ GEM
4545
case_transform (>= 0.2)
4646
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
4747
active_record_query_trace (1.7)
48-
activejob (5.2.4.3)
49-
activesupport (= 5.2.4.3)
48+
activejob (5.2.4.4)
49+
activesupport (= 5.2.4.4)
5050
globalid (>= 0.3.6)
51-
activemodel (5.2.4.3)
52-
activesupport (= 5.2.4.3)
53-
activerecord (5.2.4.3)
54-
activemodel (= 5.2.4.3)
55-
activesupport (= 5.2.4.3)
51+
activemodel (5.2.4.4)
52+
activesupport (= 5.2.4.4)
53+
activerecord (5.2.4.4)
54+
activemodel (= 5.2.4.4)
55+
activesupport (= 5.2.4.4)
5656
arel (>= 9.0)
57-
activestorage (5.2.4.3)
58-
actionpack (= 5.2.4.3)
59-
activerecord (= 5.2.4.3)
57+
activestorage (5.2.4.4)
58+
actionpack (= 5.2.4.4)
59+
activerecord (= 5.2.4.4)
6060
marcel (~> 0.3.1)
61-
activesupport (5.2.4.3)
61+
activesupport (5.2.4.4)
6262
concurrent-ruby (~> 1.0, >= 1.0.2)
6363
i18n (>= 0.7, < 2)
6464
minitest (~> 5.1)
@@ -79,7 +79,7 @@ GEM
7979
cocaine (~> 0.5.3)
8080
awrence (1.1.1)
8181
aws-eventstream (1.1.0)
82-
aws-partitions (1.365.0)
82+
aws-partitions (1.368.0)
8383
aws-sdk-core (3.105.0)
8484
aws-eventstream (~> 1, >= 1.0.2)
8585
aws-partitions (~> 1, >= 1.239.0)
@@ -88,7 +88,7 @@ GEM
8888
aws-sdk-kms (1.37.0)
8989
aws-sdk-core (~> 3, >= 3.99.0)
9090
aws-sigv4 (~> 1.1)
91-
aws-sdk-s3 (1.79.1)
91+
aws-sdk-s3 (1.80.0)
9292
aws-sdk-core (~> 3, >= 3.104.3)
9393
aws-sdk-kms (~> 1)
9494
aws-sigv4 (~> 1.1)
@@ -391,7 +391,7 @@ GEM
391391
openssl (2.2.0)
392392
openssl-signature_algorithm (0.4.0)
393393
orm_adapter (0.5.0)
394-
ox (2.13.3)
394+
ox (2.13.4)
395395
paperclip (6.0.0)
396396
activemodel (>= 4.2.0)
397397
activesupport (>= 4.2.0)
@@ -410,7 +410,7 @@ GEM
410410
pastel (0.8.0)
411411
tty-color (~> 0.5)
412412
pg (1.2.3)
413-
pghero (2.7.0)
413+
pghero (2.7.2)
414414
activerecord (>= 5)
415415
pkg-config (1.4.2)
416416
posix-spawn (0.3.15)
@@ -445,18 +445,18 @@ GEM
445445
rack
446446
rack-test (1.1.0)
447447
rack (>= 1.0, < 3)
448-
rails (5.2.4.3)
449-
actioncable (= 5.2.4.3)
450-
actionmailer (= 5.2.4.3)
451-
actionpack (= 5.2.4.3)
452-
actionview (= 5.2.4.3)
453-
activejob (= 5.2.4.3)
454-
activemodel (= 5.2.4.3)
455-
activerecord (= 5.2.4.3)
456-
activestorage (= 5.2.4.3)
457-
activesupport (= 5.2.4.3)
448+
rails (5.2.4.4)
449+
actioncable (= 5.2.4.4)
450+
actionmailer (= 5.2.4.4)
451+
actionpack (= 5.2.4.4)
452+
actionview (= 5.2.4.4)
453+
activejob (= 5.2.4.4)
454+
activemodel (= 5.2.4.4)
455+
activerecord (= 5.2.4.4)
456+
activestorage (= 5.2.4.4)
457+
activesupport (= 5.2.4.4)
458458
bundler (>= 1.3.0)
459-
railties (= 5.2.4.3)
459+
railties (= 5.2.4.4)
460460
sprockets-rails (>= 2.0.0)
461461
rails-controller-testing (1.0.5)
462462
actionpack (>= 5.0.1.rc1)
@@ -472,9 +472,9 @@ GEM
472472
railties (>= 5.0, < 6)
473473
rails-settings-cached (0.6.6)
474474
rails (>= 4.2.0)
475-
railties (5.2.4.3)
476-
actionpack (= 5.2.4.3)
477-
activesupport (= 5.2.4.3)
475+
railties (5.2.4.4)
476+
actionpack (= 5.2.4.4)
477+
activesupport (= 5.2.4.4)
478478
method_source
479479
rake (>= 0.8.7)
480480
thor (>= 0.19.0, < 2.0)
@@ -485,7 +485,7 @@ GEM
485485
link_header (~> 0.0, >= 0.0.8)
486486
rdf-normalize (0.4.0)
487487
rdf (~> 3.1)
488-
redis (4.2.1)
488+
redis (4.2.2)
489489
redis-actionpack (5.2.0)
490490
actionpack (>= 5, < 7)
491491
redis-rack (>= 2.1.0, < 3)
@@ -549,7 +549,7 @@ GEM
549549
rubocop-ast (>= 0.3.0, < 1.0)
550550
ruby-progressbar (~> 1.7)
551551
unicode-display_width (>= 1.4.0, < 2.0)
552-
rubocop-ast (0.3.0)
552+
rubocop-ast (0.4.0)
553553
parser (>= 2.7.1.4)
554554
rubocop-rails (2.8.0)
555555
activesupport (>= 4.2.0)
@@ -569,7 +569,7 @@ GEM
569569
nokogumbo (~> 2.0)
570570
securecompare (1.0.0)
571571
semantic_range (2.3.0)
572-
sidekiq (6.1.1)
572+
sidekiq (6.1.2)
573573
connection_pool (>= 2.2.2)
574574
rack (~> 2.0)
575575
redis (>= 4.2.0)
@@ -601,7 +601,7 @@ GEM
601601
sprockets (3.7.2)
602602
concurrent-ruby (~> 1.0)
603603
rack (> 1, < 3)
604-
sprockets-rails (3.2.1)
604+
sprockets-rails (3.2.2)
605605
actionpack (>= 4.0)
606606
activesupport (>= 4.0)
607607
sprockets (>= 3.0.0)
@@ -620,7 +620,7 @@ GEM
620620
unicode-display_width (~> 1.1, >= 1.1.1)
621621
terrapin (0.6.0)
622622
climate_control (>= 0.0.3, < 1.0)
623-
thor (0.20.3)
623+
thor (1.0.1)
624624
thread_safe (0.3.6)
625625
thwait (0.2.0)
626626
e2mmap
@@ -661,7 +661,7 @@ GEM
661661
safety_net_attestation (~> 0.4.0)
662662
securecompare (~> 1.0)
663663
tpm-key_attestation (~> 0.9.0)
664-
webmock (3.8.3)
664+
webmock (3.9.1)
665665
addressable (>= 2.3.6)
666666
crack (>= 0.3.2)
667667
hashdiff (>= 0.4.0, < 2.0.0)
@@ -688,7 +688,7 @@ DEPENDENCIES
688688
active_record_query_trace (~> 1.7)
689689
addressable (~> 2.7)
690690
annotate (~> 3.1)
691-
aws-sdk-s3 (~> 1.79)
691+
aws-sdk-s3 (~> 1.80)
692692
better_errors (~> 2.7)
693693
binding_of_caller (~> 0.7)
694694
blurhash (~> 0.1)
@@ -776,7 +776,7 @@ DEPENDENCIES
776776
rack (~> 2.2.3)
777777
rack-attack (~> 6.3)
778778
rack-cors (~> 1.1)
779-
rails (~> 5.2.4.3)
779+
rails (~> 5.2.4.4)
780780
rails-controller-testing (~> 1.0)
781781
rails-i18n (~> 5.1)
782782
rails-settings-cached (~> 0.6)
@@ -807,13 +807,13 @@ DEPENDENCIES
807807
stoplight (~> 2.2.1)
808808
streamio-ffmpeg (~> 3.0)
809809
strong_migrations (~> 0.7)
810-
thor (~> 0.20)
810+
thor (~> 1.0)
811811
thwait (~> 0.2.0)
812812
tty-prompt (~> 0.22)
813813
twitter-text (~> 1.14)
814814
tzinfo-data (~> 1.2020)
815815
webauthn (~> 3.0.0.alpha1)
816-
webmock (~> 3.8)
816+
webmock (~> 3.9)
817817
webpacker (~> 5.2)
818818
webpush
819819

app/controllers/accounts_controller.rb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class AccountsController < ApplicationController
77
include AccountControllerConcern
88
include SignatureAuthentication
99

10+
before_action :require_signature!, if: -> { request.format == :json && authorized_fetch_mode? }
1011
before_action :set_cache_headers
1112
before_action :set_body_classes
1213

@@ -48,7 +49,7 @@ def show
4849

4950
format.json do
5051
expires_in 3.minutes, public: !(authorized_fetch_mode? && signed_request_account.present?)
51-
render_with_cache json: @account, content_type: 'application/activity+json', serializer: ActivityPub::ActorSerializer, adapter: ActivityPub::Adapter, fields: restrict_fields_to
52+
render_with_cache json: @account, content_type: 'application/activity+json', serializer: ActivityPub::ActorSerializer, adapter: ActivityPub::Adapter
5253
end
5354
end
5455
end
@@ -153,12 +154,4 @@ def cached_filtered_status_page
153154
def params_slice(*keys)
154155
params.slice(*keys).permit(*keys)
155156
end
156-
157-
def restrict_fields_to
158-
if signed_request_account.present? || public_fetch_mode?
159-
# Return all fields
160-
else
161-
%i(id type preferred_username inbox public_key endpoints)
162-
end
163-
end
164157
end

app/controllers/admin/accounts_controller.rb

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module Admin
44
class AccountsController < BaseController
5-
before_action :set_account, only: [:show, :redownload, :remove_avatar, :remove_header, :enable, :unsilence, :unsuspend, :memorialize, :approve, :reject]
5+
before_action :set_account, except: [:index]
66
before_action :require_remote_account!, only: [:redownload]
77
before_action :require_local_account!, only: [:enable, :memorialize, :approve, :reject]
88

@@ -14,49 +14,58 @@ def index
1414
def show
1515
authorize @account, :show?
1616

17+
@deletion_request = @account.deletion_request
1718
@account_moderation_note = current_account.account_moderation_notes.new(target_account: @account)
1819
@moderation_notes = @account.targeted_moderation_notes.latest
1920
@warnings = @account.targeted_account_warnings.latest.custom
21+
@domain_block = DomainBlock.rule_for(@account.domain)
2022
end
2123

2224
def memorialize
2325
authorize @account, :memorialize?
2426
@account.memorialize!
2527
log_action :memorialize, @account
26-
redirect_to admin_account_path(@account.id)
28+
redirect_to admin_account_path(@account.id), notice: I18n.t('admin.accounts.memorialized_msg', username: @account.acct)
2729
end
2830

2931
def enable
3032
authorize @account.user, :enable?
3133
@account.user.enable!
3234
log_action :enable, @account.user
33-
redirect_to admin_account_path(@account.id)
35+
redirect_to admin_account_path(@account.id), notice: I18n.t('admin.accounts.enabled_msg', username: @account.acct)
3436
end
3537

3638
def approve
3739
authorize @account.user, :approve?
3840
@account.user.approve!
39-
redirect_to admin_pending_accounts_path
41+
redirect_to admin_pending_accounts_path, notice: I18n.t('admin.accounts.approved_msg', username: @account.acct)
4042
end
4143

4244
def reject
4345
authorize @account.user, :reject?
44-
SuspendAccountService.new.call(@account, reserve_email: false, reserve_username: false)
45-
redirect_to admin_pending_accounts_path
46+
DeleteAccountService.new.call(@account, reserve_email: false, reserve_username: false)
47+
redirect_to admin_pending_accounts_path, notice: I18n.t('admin.accounts.rejected_msg', username: @account.acct)
48+
end
49+
50+
def destroy
51+
authorize @account, :destroy?
52+
Admin::AccountDeletionWorker.perform_async(@account.id)
53+
redirect_to admin_account_path(@account.id), notice: I18n.t('admin.accounts.destroyed_msg', username: @account.acct)
4654
end
4755

4856
def unsilence
4957
authorize @account, :unsilence?
5058
@account.unsilence!
5159
log_action :unsilence, @account
52-
redirect_to admin_account_path(@account.id)
60+
redirect_to admin_account_path(@account.id), notice: I18n.t('admin.accounts.unsilenced_msg', username: @account.acct)
5361
end
5462

5563
def unsuspend
5664
authorize @account, :unsuspend?
5765
@account.unsuspend!
66+
Admin::UnsuspensionWorker.perform_async(@account.id)
5867
log_action :unsuspend, @account
59-
redirect_to admin_account_path(@account.id)
68+
redirect_to admin_account_path(@account.id), notice: I18n.t('admin.accounts.unsuspended_msg', username: @account.acct)
6069
end
6170

6271
def redownload
@@ -65,7 +74,7 @@ def redownload
6574
@account.update!(last_webfingered_at: nil)
6675
ResolveAccountService.new.call(@account)
6776

68-
redirect_to admin_account_path(@account.id)
77+
redirect_to admin_account_path(@account.id), notice: I18n.t('admin.accounts.redownloaded_msg', username: @account.acct)
6978
end
7079

7180
def remove_avatar
@@ -76,7 +85,7 @@ def remove_avatar
7685

7786
log_action :remove_avatar, @account.user
7887

79-
redirect_to admin_account_path(@account.id)
88+
redirect_to admin_account_path(@account.id), notice: I18n.t('admin.accounts.removed_avatar_msg', username: @account.acct)
8089
end
8190

8291
def remove_header
@@ -87,7 +96,7 @@ def remove_header
8796

8897
log_action :remove_header, @account.user
8998

90-
redirect_to admin_account_path(@account.id)
99+
redirect_to admin_account_path(@account.id), notice: I18n.t('admin.accounts.removed_header_msg', username: @account.acct)
91100
end
92101

93102
private

0 commit comments

Comments
 (0)