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 a916251d8a8fffcaeb6be80eacf50138a53650dc #2514

Merged
merged 17 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
eae5c73
Extract class from CSP configuration/initialization (#26905)
mjankowski Oct 27, 2023
33f8c1c
Remove version check from update cache_concern.rb (#27592)
RicardoTrindade Oct 30, 2023
bf1d452
Update libretranslate/libretranslate Docker tag to v1.4.1 (#27616)
renovate[bot] Oct 30, 2023
a918208
New Crowdin Translations (automated) (#27596)
github-actions[bot] Oct 30, 2023
c2cc1df
Update dependency @types/react to v18.2.33 (#27615)
renovate[bot] Oct 30, 2023
547d3c1
Update dependency core-js to v3.33.2 (#27624)
renovate[bot] Oct 30, 2023
372494e
Update dependency punycode to v2.3.1 (#27625)
renovate[bot] Oct 30, 2023
b8adb08
Update dependency axios to v1.6.0 (#27580)
renovate[bot] Oct 30, 2023
6c52f82
Fix posts from force-sensitized accounts being able to trend (#27620)
ClearlyClaire Oct 30, 2023
beee9ea
Fix `RSpec/LetSetup` cop in spec/controllers/admin area (#27619)
mjankowski Oct 31, 2023
204c00b
Update dependency bootsnap to '~> 1.17.0' (#27617)
renovate[bot] Oct 31, 2023
147417a
Update dependency rspec-sidekiq to v4.1.0 (#27593)
renovate[bot] Oct 31, 2023
e5b7ae9
New Crowdin Translations (automated) (#27630)
github-actions[bot] Oct 31, 2023
d649bbf
Add some more tests and clean up domain block controller (#27469)
ClearlyClaire Oct 31, 2023
a916251
Update haml-lint line length configuration to match rubocop value (#2…
mjankowski Oct 31, 2023
1474318
Merge commit 'a916251d8a8fffcaeb6be80eacf50138a53650dc' into glitch-s…
ClearlyClaire Dec 17, 2023
f62bafc
Fix HAML linting issue
ClearlyClaire Dec 17, 2023
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 .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.4.0
image: libretranslate/libretranslate:v1.4.1
restart: unless-stopped
volumes:
- lt-data:/home/libretranslate/.local
Expand Down
2 changes: 2 additions & 0 deletions .haml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ linters:
enabled: true
MiddleDot:
enabled: true
LineLength:
max: 320
22 changes: 18 additions & 4 deletions .haml-lint_todo.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
# This configuration was generated by
# `haml-lint --auto-gen-config`
# on 2023-10-25 08:29:48 -0400 using Haml-Lint version 0.51.0.
# on 2023-10-26 09:32:34 -0400 using Haml-Lint version 0.51.0.
# The point is for the user to remove these configuration records
# one by one as the lints are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of Haml-Lint, may require this file to be generated again.

linters:
# Offense count: 945
# Offense count: 16
LineLength:
enabled: false
exclude:
- 'app/views/admin/account_actions/new.html.haml'
- 'app/views/admin/accounts/index.html.haml'
- 'app/views/admin/ip_blocks/new.html.haml'
- 'app/views/admin/roles/_form.html.haml'
- 'app/views/admin/settings/discovery/show.html.haml'
- 'app/views/auth/registrations/edit.html.haml'
- 'app/views/auth/registrations/new.html.haml'
- 'app/views/filters/_filter_fields.html.haml'
- 'app/views/media/player.html.haml'
- 'app/views/settings/applications/_fields.html.haml'
- 'app/views/settings/imports/index.html.haml'
- 'app/views/settings/preferences/appearance/show.html.haml'
- 'app/views/settings/preferences/notifications/show.html.haml'
- 'app/views/settings/preferences/other/show.html.haml'

# Offense count: 10
# Offense count: 9
RuboCop:
exclude:
- 'app/views/admin/accounts/_buttons.html.haml'
Expand Down
5 changes: 0 additions & 5 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ RSpec/InstanceVariable:

RSpec/LetSetup:
Exclude:
- 'spec/controllers/admin/accounts_controller_spec.rb'
- 'spec/controllers/admin/action_logs_controller_spec.rb'
- 'spec/controllers/admin/instances_controller_spec.rb'
- 'spec/controllers/admin/reports/actions_controller_spec.rb'
- 'spec/controllers/admin/statuses_controller_spec.rb'
- 'spec/controllers/api/v1/accounts/statuses_controller_spec.rb'
- 'spec/controllers/api/v1/filters_controller_spec.rb'
- 'spec/controllers/api/v2/admin/accounts_controller_spec.rb'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ gem 'blurhash', '~> 0.1'

gem 'active_model_serializers', '~> 0.10'
gem 'addressable', '~> 2.8'
gem 'bootsnap', '~> 1.16.0', require: false
gem 'bootsnap', '~> 1.17.0', require: false
gem 'browser'
gem 'charlock_holmes', '~> 0.7.7'
gem 'chewy', '~> 7.3'
Expand Down
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ GEM
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
blurhash (0.1.7)
bootsnap (1.16.0)
bootsnap (1.17.0)
msgpack (~> 1.2)
brakeman (6.0.1)
browser (5.3.1)
Expand Down Expand Up @@ -456,7 +456,7 @@ GEM
mini_mime (1.1.5)
mini_portile2 (2.8.4)
minitest (5.20.0)
msgpack (1.7.1)
msgpack (1.7.2)
multi_json (1.15.0)
multipart-post (2.3.0)
mutex_m (0.1.2)
Expand Down Expand Up @@ -633,7 +633,7 @@ GEM
rspec-support (~> 3.12.0)
rspec-github (2.4.0)
rspec-core (~> 3.0)
rspec-mocks (3.12.5)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.0.3)
Expand All @@ -644,7 +644,7 @@ GEM
rspec-expectations (~> 3.12)
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-sidekiq (4.0.1)
rspec-sidekiq (4.1.0)
rspec-core (~> 3.0)
rspec-expectations (~> 3.0)
rspec-mocks (~> 3.0)
Expand Down Expand Up @@ -835,7 +835,7 @@ DEPENDENCIES
better_errors (~> 2.9)
binding_of_caller (~> 1.0)
blurhash (~> 0.1)
bootsnap (~> 1.16.0)
bootsnap (~> 1.17.0)
brakeman (~> 6.0)
browser
bundler-audit (~> 0.9)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/domain_blocks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def create

# Disallow accidentally downgrading a domain block
if existing_domain_block.present? && !@domain_block.stricter_than?(existing_domain_block)
@domain_block.save
@domain_block.validate
flash.now[:alert] = I18n.t('admin.domain_blocks.existing_domain_block_html', name: existing_domain_block.domain, unblock_url: admin_domain_block_path(existing_domain_block)).html_safe
@domain_block.errors.delete(:domain)
return render :new
Expand Down
16 changes: 4 additions & 12 deletions app/controllers/concerns/cache_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,10 @@ def serialize_record(record)
arguments
end

if Rails.gem_version >= Gem::Version.new('7.0')
def attributes_for_database(record)
attributes = record.attributes_for_database
attributes.transform_values! { |attr| attr.is_a?(::ActiveModel::Type::Binary::Data) ? attr.to_s : attr }
attributes
end
else
def attributes_for_database(record)
attributes = record.instance_variable_get(:@attributes).send(:attributes).transform_values(&:value_for_database)
attributes.transform_values! { |attr| attr.is_a?(::ActiveModel::Type::Binary::Data) ? attr.to_s : attr }
attributes
end
def attributes_for_database(record)
attributes = record.attributes_for_database
attributes.transform_values! { |attr| attr.is_a?(::ActiveModel::Type::Binary::Data) ? attr.to_s : attr }
attributes
end

def deserialize_record(class_name, attributes_from_database, new_record = false) # rubocop:disable Style/OptionalBooleanParameter
Expand Down
12 changes: 6 additions & 6 deletions app/javascript/mastodon/locales/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
"dismissable_banner.community_timeline": "אלו הם החצרוצים הציבוריים האחרונים מהמשתמשים על שרת {domain}.",
"dismissable_banner.dismiss": "בטל",
"dismissable_banner.explore_links": "אלו הקישורים האחרונים ששותפו על ידי משתמשים ששרת זה רואה ברשת המבוזרת כרגע.",
"dismissable_banner.explore_statuses": "ההודעות האלו, משרת זה ואחרים ברשת המבוזרת, צוברים חשיפה היום. הודעות חדשות יותר עם יותר הדהודים וחיבובים מדורגים יותר לגובה.",
"dismissable_banner.explore_statuses": "ההודעות האלו, משרת זה ואחרים ברשת המבוזרת, צוברים חשיפה היום. הודעות חדשות יותר עם יותר הדהודים וחיבובים מדורגות גבוה יותר.",
"dismissable_banner.explore_tags": "התגיות האלו, משרת זה ואחרים ברשת המבוזרת, צוברות חשיפה כעת.",
"dismissable_banner.public_timeline": "אלו ההודעות האחרונות שהתקבלו מהמשתמשים שנעקבים על ידי משתמשים מ־{domain}.",
"embed.instructions": "ניתן להטמיע את ההודעה הזו באתרך ע\"י העתקת הקוד שלהלן.",
Expand Down Expand Up @@ -315,7 +315,7 @@
"home.pending_critical_update.title": "יצא עדכון אבטחה חשוב!",
"home.show_announcements": "הצג הכרזות",
"interaction_modal.description.favourite": "עם חשבון מסטודון, ניתן לחבב את ההודעה כדי לומר למחבר/ת שהערכת את תוכנו או כדי לשמור אותו לקריאה בעתיד.",
"interaction_modal.description.follow": "עם חשבון מסטודון, ניתן לעקוב אחרי {name} כדי לקבל את הםוסטים שלו/ה בפיד הבית.",
"interaction_modal.description.follow": "עם חשבון מסטודון, ניתן לעקוב אחרי {name} כדי לקבל את הפוסטים שלו/ה בפיד הבית.",
"interaction_modal.description.reblog": "עם חשבון מסטודון, ניתן להדהד את החצרוץ ולשתף עם עוקבים.",
"interaction_modal.description.reply": "עם חשבון מסטודון, ניתן לענות לחצרוץ.",
"interaction_modal.login.action": "קח אותי לדף הבית",
Expand Down Expand Up @@ -349,7 +349,7 @@
"keyboard_shortcuts.hotkey": "מקש קיצור",
"keyboard_shortcuts.legend": "הצגת מקרא",
"keyboard_shortcuts.local": "פתיחת ציר זמן קהילתי",
"keyboard_shortcuts.mention": "לאזכר את המחבר(ת)",
"keyboard_shortcuts.mention": "לאזכר את המחבר",
"keyboard_shortcuts.muted": "פתיחת רשימת משתמשים מושתקים",
"keyboard_shortcuts.my_profile": "פתיחת הפרופיל שלך",
"keyboard_shortcuts.notifications": "פתיחת טור התראות",
Expand Down Expand Up @@ -493,7 +493,7 @@
"onboarding.steps.setup_profile.title": "התאמה אישית של הפרופיל",
"onboarding.steps.share_profile.body": "ספרו לחברים איך למצוא אתכם במסטודון!",
"onboarding.steps.share_profile.title": "לשתף פרופיל",
"onboarding.tips.2fa": "<strong>הידעת?</strong> ניתן לאבטח את החשבון ע\"י הקמת אימות בשני צעדים במסך מאפייני החשבון. השיטה תעבוד עם כל יישומון תואם TOTP על המגשיר שלך, אין צורך לתת לנו את מספר הטלפון!",
"onboarding.tips.2fa": "<strong>הידעת?</strong> ניתן לאבטח את החשבון ע\"י הקמת אימות דו-שלבי במסך מאפייני החשבון. השיטה תעבוד עם כל יישומון תואם TOTP על המכשיר שלך, ללא צורך במספר טלפון!",
"onboarding.tips.accounts_from_other_servers": "<strong>הידעת?</strong> כיוון שמסטודון פועל ברשת מבוזרת, חלק מהפרופילים שתתקלו בהם פועלים משרתים אחרים משרת הבית שלכם. ניתן להיות איתם בקשר בצורה זהה לכל חשבון אחר! שם השרת שלהם הוא החלק השני של שם המשתמש שלהם!",
"onboarding.tips.migration": "<strong>הידעת?</strong> אם תחליטו כי {domain} איננו שרת שמתאים לכם בעתיד, ניתן לעבור לשרת אחר מבלי לאבד עוקבים. תוכלו אפילו להקים שרת משלכן!",
"onboarding.tips.verification": "<strong>הידעת?</strong> ניתן לאשרר את החשבון ע\"י קישור הפרופיל אל האתר שלכם ומהאתר חזרה לפרופיל. לא נדרשים תשלומים ומסמכים!",
Expand Down Expand Up @@ -575,7 +575,7 @@
"report.thanks.title": "לא מעוניין/ת לראות את זה?",
"report.thanks.title_actionable": "תודה על הדיווח, נבדוק את העניין.",
"report.unfollow": "הפסיקו לעקוב אחרי @{name}",
"report.unfollow_explanation": "אתם עוקבים אחרי החשבון הזה. כדי להפסיק לראות את הפרסומים שלו בפיד הבית שלכם, הפסיקו לעקוב אחריהם.",
"report.unfollow_explanation": "אתם עוקבים אחרי החשבון הזה. כדי להפסיק לראות את הפרסומים שלו בפיד הבית שלכם, הפסיקו לעקוב אחריו.",
"report_notification.attached_statuses": "{count, plural, one {הודעה מצורפת} two {הודעותיים מצורפות} many {{count} הודעות מצורפות} other {{count} הודעות מצורפות}}",
"report_notification.categories.legal": "חוקי",
"report_notification.categories.other": "שונות",
Expand Down Expand Up @@ -707,7 +707,7 @@
"upload_modal.apply": "החל",
"upload_modal.applying": "מחיל…",
"upload_modal.choose_image": "בחר/י תמונה",
"upload_modal.description_placeholder": "דג סקרן שט בים מאוכזב ולפתע מצא חברה",
"upload_modal.description_placeholder": "עטלף אבק נס דרך מזגן שהתפוצץ כי חם",
"upload_modal.detect_text": "זהה טקסט מתמונה",
"upload_modal.edit_media": "עריכת מדיה",
"upload_modal.hint": "הקליקי או גררי את המעגל על גבי התצוגה המקדימה על מנת לבחור בנקודת המוקד שתראה תמיד בכל התמונות הממוזערות.",
Expand Down
7 changes: 6 additions & 1 deletion app/javascript/mastodon/locales/ms.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"compose.language.search": "Cari bahasa...",
"compose.published.body": "Pos telah diterbitkan.",
"compose.published.open": "Buka",
"compose.saved.body": "Pos disimpan.",
"compose.saved.body": "Kiriman disimpan.",
"compose_form.direct_message_warning_learn_more": "Ketahui lebih lanjut",
"compose_form.encryption_warning": "Hantaran pada Mastodon tidak disulitkan hujung ke hujung. Jangan berkongsi sebarang maklumat sensitif melalui Mastodon.",
"compose_form.hashtag_warning": "Hantaran ini tidak akan disenaraikan di bawah mana-mana tanda pagar kerana ia tidak tersenarai. Hanya hantaran awam sahaja boleh dicari menggunakan tanda pagar.",
Expand Down Expand Up @@ -307,6 +307,9 @@
"home.explore_prompt.body": "Suapan rumah anda akan mempunyai gabungan pos daripada hashtag yang telah anda pilih untuk diikuti, orang yang telah anda pilih untuk diikuti dan pos yang mereka tingkatkan. Jika itu terasa terlalu senyap, anda mungkin mahu:",
"home.explore_prompt.title": "Ini adalah pusat operasi anda dalam Mastodon.",
"home.hide_announcements": "Sembunyikan pengumuman",
"home.pending_critical_update.body": "Sila kemas kini pelayan Mastodon anda secepat yang mungkin!",
"home.pending_critical_update.link": "Lihat pengemaskinian",
"home.pending_critical_update.title": "Kemas kini keselamatan kritikal tersedia!",
"home.show_announcements": "Tunjukkan pengumuman",
"interaction_modal.description.favourite": "Dengan akaun di Mastodon, anda boleh menggemari pos ini untuk memberitahu pengarang anda menghargainya dan menyimpannya untuk kemudian.",
"interaction_modal.description.follow": "Dengan akaun pada Mastodon, anda boleh mengikut {name} untuk menerima hantaran mereka di suapan rumah anda.",
Expand Down Expand Up @@ -408,6 +411,7 @@
"navigation_bar.lists": "Senarai",
"navigation_bar.logout": "Log keluar",
"navigation_bar.mutes": "Pengguna yang dibisukan",
"navigation_bar.opened_in_classic_interface": "Kiriman, akaun dan halaman tertentu yang lain dibuka secara lalai di antara muka web klasik.",
"navigation_bar.personal": "Peribadi",
"navigation_bar.pins": "Hantaran disemat",
"navigation_bar.preferences": "Keutamaan",
Expand Down Expand Up @@ -583,6 +587,7 @@
"search.quick_action.open_url": "Buka URL dalam Mastadon",
"search.quick_action.status_search": "Pos sepadan {x}",
"search.search_or_paste": "Cari atau tampal URL",
"search_popout.full_text_search_disabled_message": "Tidak tersedia di {domain}.",
"search_popout.language_code": "Kod bahasa ISO",
"search_popout.options": "Pilihan carian",
"search_popout.quick_actions": "Tindakan pantas",
Expand Down
59 changes: 59 additions & 0 deletions app/lib/content_security_policy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# frozen_string_literal: true

class ContentSecurityPolicy
def base_host
Rails.configuration.x.web_domain
end

def assets_host
url_from_configured_asset_host || url_from_base_host
end

def media_host
cdn_host_value || assets_host
end

private

def url_from_configured_asset_host
Rails.configuration.action_controller.asset_host
end

def cdn_host_value
s3_alias_host || s3_cloudfront_host || azure_alias_host || s3_hostname_host
end

def url_from_base_host
host_to_url(base_host)
end

def host_to_url(host_string)
uri_from_configuration_and_string(host_string) if host_string.present?
end

def s3_alias_host
host_to_url ENV.fetch('S3_ALIAS_HOST', nil)
end

def s3_cloudfront_host
host_to_url ENV.fetch('S3_CLOUDFRONT_HOST', nil)
end

def azure_alias_host
host_to_url ENV.fetch('AZURE_ALIAS_HOST', nil)
end

def s3_hostname_host
host_to_url ENV.fetch('S3_HOSTNAME', nil)
end

def uri_from_configuration_and_string(host_string)
Addressable::URI.parse("#{host_protocol}://#{host_string}").tap do |uri|
uri.path += '/' unless uri.path.blank? || uri.path.end_with?('/')
end.to_s
end

def host_protocol
Rails.configuration.x.use_https ? 'https' : 'http'
end
end
2 changes: 1 addition & 1 deletion app/models/trends/statuses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def klass
private

def eligible?(status)
status.public_visibility? && status.account.discoverable? && !status.account.silenced? && (status.spoiler_text.blank? || Setting.trending_status_cw) && !status.sensitive? && !status.reply? && valid_locale?(status.language)
status.public_visibility? && status.account.discoverable? && !status.account.silenced? && !status.account.sensitized? && (status.spoiler_text.blank? || Setting.trending_status_cw) && !status.sensitive? && !status.reply? && valid_locale?(status.language)
end

def calculate_scores(statuses, at_time)
Expand Down
11 changes: 10 additions & 1 deletion app/views/admin/settings/appearance/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@
%p.lead= t('admin.settings.appearance.preamble')

.fields-group
= f.input :flavour_and_skin, collection: Themes.instance.flavours_and_skins, group_label_method: ->(flavour_and_skin) { I18n.t("flavours.#{flavour_and_skin}.name", default: flavour_and_skin) }, wrapper: :with_label, label: t('admin.settings.flavour_and_skin.title'), include_blank: false, as: :grouped_select, label_method: :last, value_method: ->(value) { value.join('/') }, group_method: :last
= f.input :flavour_and_skin,
collection: Themes.instance.flavours_and_skins,
group_label_method: ->(flavour_and_skin) { I18n.t("flavours.#{flavour_and_skin}.name", default: flavour_and_skin) },
wrapper: :with_label,
label: t('admin.settings.flavour_and_skin.title'),
include_blank: false,
as: :grouped_select,
label_method: :last,
value_method: ->(value) { value.join('/') },
group_method: :last

.fields-group
= f.input :custom_css, wrapper: :with_block_label, as: :text, input_html: { rows: 8 }
Expand Down
2 changes: 1 addition & 1 deletion config/locales/activerecord.he.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ he:
agreement: הסכם שירות
email: כתובת דוא"ל
locale: הגדרות אזוריות
password: סיסמא
password: סיסמה
user/account:
username: שם משתמש/ת
user/invite_request:
Expand Down
Loading
Loading