Skip to content

Commit

Permalink
Merge commit 'fe2667bb0d3487a32b9da5250402a90482a85fe2' into glitch-s…
Browse files Browse the repository at this point in the history
…oc/merge-upstream

Conflicts:
- `app/lib/content_security_policy.rb`:
  Conflict caused by glitch-soc's support for the extra `EXTRA_DATA_HOSTS`
  environment variable.
  Ported upstream's changes while keeping support for `EXTRA_DATA_HOSTS`.
  • Loading branch information
ClearlyClaire committed Jan 10, 2024
2 parents dfbf960 + fe2667b commit 0b2c7cd
Show file tree
Hide file tree
Showing 116 changed files with 873 additions and 518 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ services:
hard: -1

libretranslate:
image: libretranslate/libretranslate:v1.5.2
image: libretranslate/libretranslate:v1.5.3
restart: unless-stopped
volumes:
- lt-data:/home/libretranslate/.local
Expand Down
9 changes: 2 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,10 @@ Rails/UnusedIgnoredColumns:
Rails/NegateInclude:
Enabled: false

# Reason: Some single letter camel case files shouldn't be split
# Reason: Deprecated cop, will be removed in 3.0, replaced by SpecFilePathFormat
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecfilepath
RSpec/FilePath:
CustomTransform:
ActivityPub: activitypub
DeepL: deepl
FetchOEmbedService: fetch_oembed_service
OEmbedController: oembed_controller
OStatus: ostatus
Enabled: false

# Reason:
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecnamedsubject
Expand Down
28 changes: 7 additions & 21 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp`
# using RuboCop version 1.57.2.
# using RuboCop version 1.59.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -26,7 +26,7 @@ Lint/NonLocalExitFromIterator:

# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 100
Max: 82

# Configuration parameters: CountBlocks, Max.
Metrics/BlockNesting:
Expand All @@ -50,7 +50,7 @@ RSpec/MultipleExpectations:

# Configuration parameters: AllowSubject.
RSpec/MultipleMemoizedHelpers:
Max: 21
Max: 17

# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Expand All @@ -66,7 +66,6 @@ Rails/ApplicationController:
Rails/HasAndBelongsToMany:
Exclude:
- 'app/models/concerns/account/associations.rb'
- 'app/models/preview_card.rb'
- 'app/models/status.rb'
- 'app/models/tag.rb'

Expand Down Expand Up @@ -144,7 +143,6 @@ Rails/WhereExists:
Exclude:
- 'app/controllers/activitypub/inboxes_controller.rb'
- 'app/controllers/admin/email_domain_blocks_controller.rb'
- 'app/controllers/auth/registrations_controller.rb'
- 'app/lib/activitypub/activity/create.rb'
- 'app/lib/delivery_failure_tracker.rb'
- 'app/lib/feed_manager.rb'
Expand All @@ -160,24 +158,16 @@ Rails/WhereExists:
- 'app/serializers/rest/announcement_serializer.rb'
- 'app/serializers/rest/tag_serializer.rb'
- 'app/services/activitypub/fetch_remote_status_service.rb'
- 'app/services/app_sign_up_service.rb'
- 'app/services/vote_service.rb'
- 'app/validators/reaction_validator.rb'
- 'app/validators/vote_validator.rb'
- 'app/workers/move_worker.rb'
- 'db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb'
- 'lib/tasks/tests.rake'
- 'spec/models/account_spec.rb'
- 'spec/services/activitypub/process_collection_service_spec.rb'
- 'spec/services/purge_domain_service_spec.rb'
- 'spec/services/unallow_domain_service_spec.rb'

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowOnConstant, AllowOnSelfClass.
Style/CaseEquality:
Exclude:
- 'config/initializers/trusted_proxies.rb'

# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods, AllowedPatterns.
# AllowedMethods: ==, equal?, eql?
Expand Down Expand Up @@ -205,8 +195,8 @@ Style/FetchEnvVar:
- 'config/initializers/devise.rb'
- 'config/initializers/paperclip.rb'
- 'config/initializers/vapid.rb'
- 'lib/premailer_webpack_strategy.rb'
- 'lib/mastodon/redis_config.rb'
- 'lib/premailer_webpack_strategy.rb'
- 'lib/tasks/repo.rake'
- 'spec/features/profile_spec.rb'

Expand All @@ -223,7 +213,6 @@ Style/FormatStringToken:
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/GlobalStdStream:
Exclude:
- 'config/boot.rb'
- 'config/environments/development.rb'
- 'config/environments/production.rb'

Expand Down Expand Up @@ -253,8 +242,6 @@ Style/GuardClause:
- 'app/workers/redownload_media_worker.rb'
- 'app/workers/remote_account_refresh_worker.rb'
- 'config/initializers/devise.rb'
- 'db/migrate/20170901141119_truncate_preview_cards.rb'
- 'db/post_migrate/20220704024901_migrate_settings_to_user_roles.rb'
- 'lib/devise/strategies/two_factor_ldap_authenticatable.rb'
- 'lib/devise/strategies/two_factor_pam_authenticatable.rb'
- 'lib/mastodon/cli/accounts.rb'
Expand All @@ -275,7 +262,6 @@ Style/HashAsLastArrayItem:
- 'app/models/status.rb'
- 'app/services/batched_remove_status_service.rb'
- 'app/services/notify_service.rb'
- 'db/migrate/20181024224956_migrate_account_conversations.rb'

# This cop supports unsafe autocorrection (--autocorrect-all).
Style/HashTransformValues:
Expand Down Expand Up @@ -415,8 +401,8 @@ Style/TrailingCommaInHashLiteral:
- 'config/environments/test.rb'

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, MinSize, WordRegex.
# Configuration parameters: WordRegex.
# SupportedStyles: percent, brackets
Style/WordArray:
Exclude:
- 'app/helpers/languages_helper.rb'
EnforcedStyle: percent
MinSize: 3
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ gem 'sidekiq-bulk', '~> 0.2.0'
gem 'simple-navigation', '~> 4.4'
gem 'simple_form', '~> 5.2'
gem 'stoplight', '~> 3.0.1'
gem 'strong_migrations', '1.6.4'
gem 'strong_migrations', '1.7.0'
gem 'tty-prompt', '~> 0.23', require: false
gem 'twitter-text', '~> 3.1.0'
gem 'tzinfo-data', '~> 1.2023'
Expand Down
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,14 @@ GEM
multi_json (1.15.0)
multipart-post (2.3.0)
mutex_m (0.2.0)
net-http (0.4.0)
net-http (0.4.1)
uri
net-http-persistent (4.0.2)
connection_pool (~> 2.2)
net-imap (0.4.4)
date
net-protocol
net-ldap (0.18.0)
net-ldap (0.19.0)
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
Expand Down Expand Up @@ -544,7 +544,7 @@ GEM
psych (5.1.2)
stringio
public_suffix (5.0.4)
puma (6.4.1)
puma (6.4.2)
nio4r (~> 2.0)
pundit (2.3.1)
activesupport (>= 3.0.0)
Expand Down Expand Up @@ -676,19 +676,19 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.19.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop-factory_bot (2.25.0)
rubocop (~> 1.33)
rubocop-performance (1.20.1)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails (2.23.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rspec (2.25.0)
rubocop-rspec (2.26.1)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
Expand Down Expand Up @@ -748,7 +748,7 @@ GEM
stoplight (3.0.2)
redlock (~> 1.0)
stringio (3.1.0)
strong_migrations (1.6.4)
strong_migrations (1.7.0)
activerecord (>= 5.2)
swd (1.3.0)
activesupport (>= 3)
Expand Down Expand Up @@ -952,7 +952,7 @@ DEPENDENCIES
simplecov-lcov (~> 0.8)
stackprof
stoplight (~> 3.0.1)
strong_migrations (= 1.6.4)
strong_migrations (= 1.7.0)
test-prof
thor (~> 1.2)
tty-prompt (~> 0.23)
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/admin/email_domain_blocks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create
(@email_domain_block.other_domains || []).uniq.each do |domain|
next if EmailDomainBlock.where(domain: domain).exists?

other_email_domain_block = EmailDomainBlock.create!(domain: domain, parent: @email_domain_block)
other_email_domain_block = EmailDomainBlock.create!(domain: domain, allow_with_approval: @email_domain_block.allow_with_approval, parent: @email_domain_block)
log_action :create, other_email_domain_block
end
end
Expand All @@ -65,7 +65,7 @@ def set_resolved_records
end

def resource_params
params.require(:email_domain_block).permit(:domain, other_domains: [])
params.require(:email_domain_block).permit(:domain, :allow_with_approval, other_domains: [])
end

def form_email_domain_block_batch_params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def set_email_domain_block
end

def resource_params
params.permit(:domain)
params.permit(:domain, :allow_with_approval)
end

def insert_pagination_headers
Expand Down
Loading

0 comments on commit 0b2c7cd

Please sign in to comment.