From: Claire Date: Tue, 20 Apr 2021 10:17:14 +0000 (+0200) Subject: Merge branch 'main' into glitch-soc/merge-upstream X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=e2a2bc90213a653b772b457499cedbfe2e830d74;p=mastodon.git Merge branch 'main' into glitch-soc/merge-upstream Conflicts: - `README.md`: Upstream updated copyright year, we don't mention it so kept our version. - `app/controllers/admin/dashboard_controller.rb`: Not really a conflict, upstream change (removing the spam checker) too close to glitch-soc changes. Ported upstream changes. - `app/models/form/admin_settings.rb`: Same. - `app/services/remove_status_service.rb`: Same. - `app/views/admin/settings/edit.html.haml`: Same. - `config/settings.yml`: Same. - `config/environments/production.rb`: Not a real conflict, upstream added a default HTTP header, but we have extra headers in glitch-soc. Added the header. --- e2a2bc90213a653b772b457499cedbfe2e830d74 diff --cc app/controllers/admin/dashboard_controller.rb index 9e921fb95,c829ed98f..a00d7ed96 --- a/app/controllers/admin/dashboard_controller.rb +++ b/app/controllers/admin/dashboard_controller.rb @@@ -35,8 -35,6 +35,7 @@@ module Admi @whitelist_enabled = whitelist_mode? @profile_directory = Setting.profile_directory @timeline_preview = Setting.timeline_preview + @keybase_integration = Setting.enable_keybase - @spam_check_enabled = Setting.spam_check_enabled @trends_enabled = Setting.trends end diff --cc app/lib/tag_manager.rb index 29dde128c,39a98c3eb..a1d12a654 --- a/app/lib/tag_manager.rb +++ b/app/lib/tag_manager.rb @@@ -22,17 -22,8 +22,9 @@@ class TagManage uri.normalized_host end - def same_acct?(canonical, needle) - return true if canonical.casecmp(needle).zero? - - username, domain = needle.split('@') - - local_domain?(domain) && canonical.casecmp(username).zero? - end - def local_url?(url) uri = Addressable::URI.parse(url).normalize + return false unless uri.host domain = uri.host + (uri.port ? ":#{uri.port}" : '') TagManager.instance.web_domain?(domain) diff --cc app/models/form/admin_settings.rb index 999d835e6,b5c3dcdbe..558a906d2 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@@ -33,9 -29,6 +33,8 @@@ class Form::AdminSetting thumbnail hero mascot + show_reblogs_in_public_timelines + show_replies_in_public_timelines - spam_check_enabled trends trendable_by_default show_domain_blocks @@@ -55,11 -47,6 +54,10 @@@ show_known_fediverse_at_about_page preview_sensitive_media profile_directory + hide_followers_count + enable_keybase + show_reblogs_in_public_timelines + show_replies_in_public_timelines - spam_check_enabled trends trendable_by_default noindex diff --cc app/services/remove_status_service.rb index 764ed288d,2c2a26641..17868d4fd --- a/app/services/remove_status_service.rb +++ b/app/services/remove_status_service.rb @@@ -41,8 -38,6 +38,7 @@@ class RemoveStatusService < BaseServic remove_from_hashtags remove_from_public remove_from_media if @status.media_attachments.any? + remove_from_direct if status.direct_visibility? - remove_from_spam_check remove_media end diff --cc app/views/admin/settings/edit.html.haml index fa8d8441e,0e705f205..1fab9dd06 --- a/app/views/admin/settings/edit.html.haml +++ b/app/views/admin/settings/edit.html.haml @@@ -89,21 -92,6 +89,18 @@@ .fields-group = f.input :noindex, as: :boolean, wrapper: :with_label, label: t('admin.settings.default_noindex.title'), hint: t('admin.settings.default_noindex.desc_html') + .fields-group + = f.input :hide_followers_count, as: :boolean, wrapper: :with_label, label: t('admin.settings.hide_followers_count.title'), hint: t('admin.settings.hide_followers_count.desc_html') + + .fields-group + = f.input :enable_keybase, as: :boolean, wrapper: :with_label, label: t('admin.settings.enable_keybase.title'), hint: t('admin.settings.enable_keybase.desc_html') + + .fields-group + = f.input :show_reblogs_in_public_timelines, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_reblogs_in_public_timelines.title'), hint: t('admin.settings.show_reblogs_in_public_timelines.desc_html') + + .fields-group + = f.input :show_replies_in_public_timelines, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_replies_in_public_timelines.title'), hint: t('admin.settings.show_replies_in_public_timelines.desc_html') + - .fields-group - = f.input :spam_check_enabled, as: :boolean, wrapper: :with_label, label: t('admin.settings.spam_check_enabled.title'), hint: t('admin.settings.spam_check_enabled.desc_html') - %hr.spacer/ .fields-group diff --cc config/environments/production.rb index 8d811451c,df6b07d77..bf6b5d88e --- a/config/environments/production.rb +++ b/config/environments/production.rb @@@ -112,14 -115,11 +115,14 @@@ Rails.application.configure d config.action_mailer.delivery_method = ENV.fetch('SMTP_DELIVERY_METHOD', 'smtp').to_sym config.action_dispatch.default_headers = { - 'Server' => 'Mastodon', - 'X-Frame-Options' => 'DENY', - 'X-Content-Type-Options' => 'nosniff', - 'X-XSS-Protection' => '1; mode=block', - 'Permissions-Policy' => 'interest-cohort=()', + 'Server' => 'Mastodon', + 'X-Frame-Options' => 'DENY', + 'X-Content-Type-Options' => 'nosniff', + 'X-XSS-Protection' => '1; mode=block', ++ 'Permissions-Policy' => 'interest-cohort=()', + 'Referrer-Policy' => 'same-origin', + 'Strict-Transport-Security' => 'max-age=63072000; includeSubDomains; preload', + 'X-Clacks-Overhead' => 'GNU Natalie Nguyen' - } config.x.otp_secret = ENV.fetch('OTP_SECRET') diff --cc config/settings.yml index 1d9488052,b79ea620c..0af1a61a2 --- a/config/settings.yml +++ b/config/settings.yml @@@ -72,13 -67,8 +72,12 @@@ defaults: &default activity_api_enabled: true peers_api_enabled: true show_known_fediverse_at_about_page: true + show_reblogs_in_public_timelines: false + show_replies_in_public_timelines: false + default_content_type: 'text/plain' - spam_check_enabled: true show_domain_blocks: 'disabled' show_domain_blocks_rationale: 'disabled' + outgoing_spoilers: '' require_invite_text: false development: