From c4cf92094ec3cc065df2b05c76352dcb72020777 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Mon, 6 Mar 2023 15:37:19 +0100 Subject: [PATCH 01/10] Do not strip tags from `Setting.site_short_description` (#23975) --- app/views/application/_sidebar.html.haml | 2 +- app/views/shared/_og.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/application/_sidebar.html.haml b/app/views/application/_sidebar.html.haml index 6d18668b08..9d0efa7e10 100644 --- a/app/views/application/_sidebar.html.haml +++ b/app/views/application/_sidebar.html.haml @@ -3,7 +3,7 @@ = image_tag @instance_presenter.thumbnail&.file&.url(:'@1x') || asset_pack_path('media/images/preview.png'), alt: @instance_presenter.title .hero-widget__text - %p= @instance_presenter.description.html_safe.presence || t('about.about_mastodon_html') + %p= @instance_presenter.description.presence || t('about.about_mastodon_html') - if Setting.trends && !(user_signed_in? && !current_user.setting_trends) - trends = Trends.tags.query.allowed.limit(3) diff --git a/app/views/shared/_og.html.haml b/app/views/shared/_og.html.haml index 2941b566e0..a5d99ae33a 100644 --- a/app/views/shared/_og.html.haml +++ b/app/views/shared/_og.html.haml @@ -1,5 +1,5 @@ - thumbnail = @instance_presenter.thumbnail -- description ||= strip_tags(@instance_presenter.description.presence || t('about.about_mastodon_html')) +- description ||= @instance_presenter.description.presence || strip_tags(t('about.about_mastodon_html')) %meta{ name: 'description', content: description }/ From 4595862978a7f726fbd6139a1bc415cc83cf34fe Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 6 Mar 2023 09:43:21 -0500 Subject: [PATCH 02/10] Remove pinned rexml (#23964) --- Gemfile | 1 - Gemfile.lock | 1 - 2 files changed, 2 deletions(-) diff --git a/Gemfile b/Gemfile index d3eefb224c..5804327cca 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,6 @@ source 'https://rubygems.org' ruby '>= 2.7.0', '< 3.3.0' gem 'pkg-config', '~> 1.5' -gem 'rexml', '~> 3.2' gem 'puma', '~> 6.1' gem 'rails', '~> 6.1.7' diff --git a/Gemfile.lock b/Gemfile.lock index 6f75f8f769..c6b4e74f6a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -855,7 +855,6 @@ DEPENDENCIES redcarpet (~> 3.6) redis (~> 4.5) redis-namespace (~> 1.10) - rexml (~> 3.2) rqrcode (~> 2.1) rspec-rails (~> 6.0) rspec-sidekiq (~> 3.1) From 86f8aa2db2bf4f19f482b5857c4e49b8791eb514 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 6 Mar 2023 16:00:08 +0100 Subject: [PATCH 03/10] Fix unconfirmed accounts being registered as active users (#23803) --- app/models/user.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index 5e106dee57..d56a9b9ca1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -507,11 +507,14 @@ class User < ApplicationRecord def prepare_new_user! BootstrapTimelineWorker.perform_async(account_id) ActivityTracker.increment('activity:accounts:local') + ActivityTracker.record('activity:logins', id) UserMailer.welcome(self).deliver_later TriggerWebhookWorker.perform_async('account.approved', 'Account', account_id) end def prepare_returning_user! + return unless confirmed? + ActivityTracker.record('activity:logins', id) regenerate_feed! if needs_feed_update? end From 21db91a0a8fbe5b4fd69eecd2aeb4a84823343a0 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 6 Mar 2023 16:25:35 +0100 Subject: [PATCH 04/10] Remove sidebar dead code (#23984) --- app/views/application/_sidebar.html.haml | 16 ---------------- config/locales/an.yml | 2 -- config/locales/ar.yml | 2 -- config/locales/ast.yml | 2 -- config/locales/be.yml | 2 -- config/locales/bg.yml | 2 -- config/locales/ca.yml | 2 -- config/locales/ckb.yml | 2 -- config/locales/co.yml | 2 -- config/locales/cs.yml | 2 -- config/locales/cy.yml | 2 -- config/locales/da.yml | 2 -- config/locales/de.yml | 2 -- config/locales/el.yml | 2 -- config/locales/en.yml | 2 -- config/locales/eo.yml | 2 -- config/locales/es-AR.yml | 2 -- config/locales/es-MX.yml | 2 -- config/locales/es.yml | 2 -- config/locales/et.yml | 2 -- config/locales/eu.yml | 2 -- config/locales/fa.yml | 2 -- config/locales/fi.yml | 2 -- config/locales/fo.yml | 2 -- config/locales/fr-QC.yml | 2 -- config/locales/fr.yml | 2 -- config/locales/fy.yml | 2 -- config/locales/gd.yml | 2 -- config/locales/gl.yml | 2 -- config/locales/he.yml | 2 -- config/locales/hr.yml | 2 -- config/locales/hu.yml | 2 -- config/locales/hy.yml | 2 -- config/locales/id.yml | 2 -- config/locales/io.yml | 2 -- config/locales/is.yml | 2 -- config/locales/it.yml | 2 -- config/locales/ja.yml | 2 -- config/locales/kab.yml | 2 -- config/locales/kk.yml | 2 -- config/locales/ko.yml | 2 -- config/locales/ku.yml | 2 -- config/locales/lv.yml | 2 -- config/locales/nl.yml | 2 -- config/locales/nn.yml | 2 -- config/locales/no.yml | 2 -- config/locales/oc.yml | 2 -- config/locales/pl.yml | 2 -- config/locales/pt-BR.yml | 2 -- config/locales/pt-PT.yml | 2 -- config/locales/ru.yml | 2 -- config/locales/sc.yml | 2 -- config/locales/sco.yml | 2 -- config/locales/si.yml | 2 -- config/locales/sk.yml | 2 -- config/locales/sl.yml | 2 -- config/locales/sq.yml | 2 -- config/locales/sv.yml | 2 -- config/locales/th.yml | 2 -- config/locales/tr.yml | 2 -- config/locales/uk.yml | 2 -- config/locales/vi.yml | 2 -- config/locales/zh-CN.yml | 2 -- config/locales/zh-HK.yml | 2 -- config/locales/zh-TW.yml | 2 -- 65 files changed, 144 deletions(-) delete mode 100644 app/views/application/_sidebar.html.haml diff --git a/app/views/application/_sidebar.html.haml b/app/views/application/_sidebar.html.haml deleted file mode 100644 index 9d0efa7e10..0000000000 --- a/app/views/application/_sidebar.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -.hero-widget - .hero-widget__img - = image_tag @instance_presenter.thumbnail&.file&.url(:'@1x') || asset_pack_path('media/images/preview.png'), alt: @instance_presenter.title - - .hero-widget__text - %p= @instance_presenter.description.presence || t('about.about_mastodon_html') - -- if Setting.trends && !(user_signed_in? && !current_user.setting_trends) - - trends = Trends.tags.query.allowed.limit(3) - - - unless trends.empty? - .endorsements-widget.trends-widget - %h4.emojify= t('footer.trending_now') - - - trends.each do |tag| - = react_component :hashtag, hashtag: ActiveModelSerializers::SerializableResource.new(tag, serializer: REST::TagSerializer, scope: current_user, scope_name: :current_user).as_json diff --git a/config/locales/an.yml b/config/locales/an.yml index 3a6ddda1b7..2e1a7e36ff 100644 --- a/config/locales/an.yml +++ b/config/locales/an.yml @@ -1159,8 +1159,6 @@ an: index: hint: Este filtro s'aplica a la selección de publicacions individuals independientment d'atros criterios. Puede anyadir mas publicacions a este filtro dende la interficie web. title: Publicacions filtradas - footer: - trending_now: Tendencia agora generic: all: Totz all_items_on_page_selected_html: diff --git a/config/locales/ar.yml b/config/locales/ar.yml index 32130cc7da..d72a11130b 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -1214,8 +1214,6 @@ ar: index: hint: ينطبق الفلتر هذا على اختيار المنشورات الفردية بغض النظر عن المعايير الأخرى. يمكنك إضافة المزيد من المنشورات إلى هذا الفلتر من واجهة الويب. title: الرسائل المصفّاة - footer: - trending_now: المتداولة الآن generic: all: الكل changes_saved_msg: تم حفظ التعديلات بنجاح! diff --git a/config/locales/ast.yml b/config/locales/ast.yml index afdb5176c4..b59ebba455 100644 --- a/config/locales/ast.yml +++ b/config/locales/ast.yml @@ -601,8 +601,6 @@ ast: title: Peñeres new: title: Amestar una peñera - footer: - trending_now: En tendencia generic: all: Too all_items_on_page_selected_html: diff --git a/config/locales/be.yml b/config/locales/be.yml index 17fcabe9b0..05c7b7bffe 100644 --- a/config/locales/be.yml +++ b/config/locales/be.yml @@ -1238,8 +1238,6 @@ be: index: hint: Гэты фільтр прымяняецца для выбару асобных допісаў незалежна ад іншых крытэрыяў. Вы можаце дадаць больш допісаў у гэты фільтр з вэб-інтэрфейсу. title: Адфільтраваныя допісы - footer: - trending_now: Актуальнае generic: all: Усе all_items_on_page_selected_html: diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 7483c562b0..34f0542759 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -1196,8 +1196,6 @@ bg: index: hint: Този филтър се прилага за избор на отделни публикации, независимо от други критерии. Може да добавите още публикации в този филтър от уебинтерфейса. title: Филтрирани публикации - footer: - trending_now: Налагащи се сега generic: all: Всичко all_items_on_page_selected_html: diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 68c5db23e4..2a459dbde6 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -1196,8 +1196,6 @@ ca: index: hint: Aquest filtre aplica als tuts seleccionats independentment d'altres criteris. Pots afegir més tuts a aquest filtre des de la interfície Web. title: Tuts filtrats - footer: - trending_now: En tendència generic: all: Tot all_items_on_page_selected_html: diff --git a/config/locales/ckb.yml b/config/locales/ckb.yml index 2cfa5dfee8..0f481c8ce2 100644 --- a/config/locales/ckb.yml +++ b/config/locales/ckb.yml @@ -744,8 +744,6 @@ ckb: title: فلتەرەکان new: title: زیادکردنی فلتەری نوێ - footer: - trending_now: هەوادارانی ئێستا generic: all: هەموو changes_saved_msg: گۆڕانکاریەکان بە سەرکەوتوویی هەڵگیرا! diff --git a/config/locales/co.yml b/config/locales/co.yml index 6cf1f28b33..94f2101c20 100644 --- a/config/locales/co.yml +++ b/config/locales/co.yml @@ -704,8 +704,6 @@ co: title: Filtri new: title: Aghjunghje un novu filtru - footer: - trending_now: Tindenze d'avà generic: all: Tuttu changes_saved_msg: Cambiamenti salvati! diff --git a/config/locales/cs.yml b/config/locales/cs.yml index f6796ec6b8..8c44bba8c5 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1213,8 +1213,6 @@ cs: index: hint: Tento filtr se vztahuje na výběr jednotlivých příspěvků bez ohledu na jiná kritéria. Do tohoto filtru můžete přidat více příspěvků z webového rozhraní. title: Filtrované příspěvky - footer: - trending_now: Právě populární generic: all: Všechny all_items_on_page_selected_html: diff --git a/config/locales/cy.yml b/config/locales/cy.yml index 14ecbe7034..f887329885 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -1280,8 +1280,6 @@ cy: index: hint: Mae'r hidlydd hwn yn berthnasol i ddethol postiadau unigol waeth beth fo'r meini prawf eraill. Gallwch ychwanegu mwy o bostiadau at yr hidlydd hwn o'r rhyngwyneb gwe. title: Postiadau wedi'u hidlo - footer: - trending_now: Trendiau generic: all: Popeth all_items_on_page_selected_html: diff --git a/config/locales/da.yml b/config/locales/da.yml index 38111748d8..a75364a792 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -1192,8 +1192,6 @@ da: index: hint: Dette filter gælder for udvalgte, individuelle indlæg uanset andre kriterier. Flere indlæg kan føjes til filteret via webfladen. title: Filtrerede indlæg - footer: - trending_now: Trender lige nu generic: all: Alle all_items_on_page_selected_html: diff --git a/config/locales/de.yml b/config/locales/de.yml index 69284b09f9..3f2666bdbf 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1196,8 +1196,6 @@ de: index: hint: Dieser Filter wird verwendet, um einzelne Beiträge unabhängig von anderen Kriterien auszuwählen. Du kannst mehr Beiträge zu diesem Filter über das Webinterface hinzufügen. title: Gefilterte Beiträge - footer: - trending_now: Jetzt in den Trends generic: all: Alle all_items_on_page_selected_html: diff --git a/config/locales/el.yml b/config/locales/el.yml index 7994f71740..3ed8ca4054 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -875,8 +875,6 @@ el: new: save: Αποθήκευση νέου φίλτρου title: Πρόσθεσε νέο φίλτρο - footer: - trending_now: Τάσεις generic: all: Όλα changes_saved_msg: Οι αλλαγές αποθηκεύτηκαν! diff --git a/config/locales/en.yml b/config/locales/en.yml index 97d0999e4a..87231836ae 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1196,8 +1196,6 @@ en: index: hint: This filter applies to select individual posts regardless of other criteria. You can add more posts to this filter from the web interface. title: Filtered posts - footer: - trending_now: Trending now generic: all: All all_items_on_page_selected_html: diff --git a/config/locales/eo.yml b/config/locales/eo.yml index 151ca2429f..a8279b6a6f 100644 --- a/config/locales/eo.yml +++ b/config/locales/eo.yml @@ -1197,8 +1197,6 @@ eo: index: hint: Ĉi tiu filtrilo kongruas kelkaj mesaĝoj sendepende de aliaj kriterioj. title: Filtritaj mesaĝoj - footer: - trending_now: Nunaj furoraĵoj generic: all: Ĉio all_items_on_page_selected_html: diff --git a/config/locales/es-AR.yml b/config/locales/es-AR.yml index 8d934011cd..bef481b35d 100644 --- a/config/locales/es-AR.yml +++ b/config/locales/es-AR.yml @@ -1196,8 +1196,6 @@ es-AR: index: hint: Este filtro se aplica a la selección de mensajes individuales, independientemente de otros criterios. Podés agregar más mensajes a este filtro desde la interface web. title: Mensajes filtrados - footer: - trending_now: Tendencia ahora generic: all: Todas all_items_on_page_selected_html: diff --git a/config/locales/es-MX.yml b/config/locales/es-MX.yml index 1267c49172..978cd0c3ce 100644 --- a/config/locales/es-MX.yml +++ b/config/locales/es-MX.yml @@ -1196,8 +1196,6 @@ es-MX: index: hint: Este filtro se aplica a la selección de publicaciones individuales independientemente de otros criterios. Puede añadir más publicaciones a este filtro desde la interfaz web. title: Publicaciones filtradas - footer: - trending_now: Tendencia ahora generic: all: Todos all_items_on_page_selected_html: diff --git a/config/locales/es.yml b/config/locales/es.yml index f87042792f..29c4e84e73 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1196,8 +1196,6 @@ es: index: hint: Este filtro se aplica a la selección de publicaciones individuales independientemente de otros criterios. Puede añadir más publicaciones a este filtro desde la interfaz web. title: Publicaciones filtradas - footer: - trending_now: Tendencia ahora generic: all: Todos all_items_on_page_selected_html: diff --git a/config/locales/et.yml b/config/locales/et.yml index 1b5910154e..55cb810116 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -1196,8 +1196,6 @@ et: index: hint: See filter kehtib üksikute postituste valimisel, sõltumata muudest kriteeriumidest. Sellesse filtrisse saab veebiliidese kaudu rohkem postitusi lisada. title: Filtreeritud postitused - footer: - trending_now: Praegu trendikad generic: all: Kõik all_items_on_page_selected_html: diff --git a/config/locales/eu.yml b/config/locales/eu.yml index b9a9482bf5..0b2ab33d4d 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -1198,8 +1198,6 @@ eu: index: hint: Iragazki honek banako bidalketei eragiten die, beste kriterioak badaude ere. Bidalketa gehiago gehitu ditzakezu iragazkira web interfazetik. title: Iragazitako bidalketak - footer: - trending_now: Joera orain generic: all: Denak all_items_on_page_selected_html: diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 88366c7b95..a418dc3776 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -890,8 +890,6 @@ fa: title: پالایه‌ها new: title: افزودن پالایهٔ جدید - footer: - trending_now: پرطرفدار generic: all: همه changes_saved_msg: تغییرات با موفقیت ذخیره شدند! diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 8a77fa8a57..30d5f11791 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1196,8 +1196,6 @@ fi: index: hint: Tämä suodatin koskee yksittäisten viestien valintaa muista kriteereistä riippumatta. Voit lisätä lisää viestejä tähän suodattimeen web-käyttöliittymästä. title: Suodatetut viestit - footer: - trending_now: Suosittua nyt generic: all: Kaikki all_items_on_page_selected_html: diff --git a/config/locales/fo.yml b/config/locales/fo.yml index db3aca3693..baebaae2f3 100644 --- a/config/locales/fo.yml +++ b/config/locales/fo.yml @@ -1196,8 +1196,6 @@ fo: index: hint: Hetta filtrið er galdandi fyri útvaldar stakar postar óansæð aðrar treytir. Tú kanst leggja fleiri postar afturat hesum filtrinum frá vevmarkamótinum. title: Filtreraðir postar - footer: - trending_now: Rák beint nú generic: all: Alt all_items_on_page_selected_html: diff --git a/config/locales/fr-QC.yml b/config/locales/fr-QC.yml index 76788b995d..922cea0dca 100644 --- a/config/locales/fr-QC.yml +++ b/config/locales/fr-QC.yml @@ -1196,8 +1196,6 @@ fr-QC: index: hint: Ce filtre s'applique à la sélection de messages individuels, indépendamment d'autres critères. Vous pouvez ajouter plus de messages à ce filtre à partir de l'interface Web. title: Messages filtrés - footer: - trending_now: Tendance en ce moment generic: all: Tous all_items_on_page_selected_html: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index c3ec4bdc7a..c0d48df88f 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1196,8 +1196,6 @@ fr: index: hint: Ce filtre s'applique à la sélection de messages individuels, indépendamment d'autres critères. Vous pouvez ajouter plus de messages à ce filtre à partir de l'interface Web. title: Messages filtrés - footer: - trending_now: Tendance en ce moment generic: all: Tous all_items_on_page_selected_html: diff --git a/config/locales/fy.yml b/config/locales/fy.yml index 45e15a4d2f..2c1c8657ff 100644 --- a/config/locales/fy.yml +++ b/config/locales/fy.yml @@ -1196,8 +1196,6 @@ fy: index: hint: Dit filter is fan tapassing om yndividuele berjochten te selektearjen, ûnôfhinklik fan oare kritearia. Jo kinne yn de webomjouwing mear berjochten oan dit filter tafoegje. title: Filtere berjochten - footer: - trending_now: Trends generic: all: Alle all_items_on_page_selected_html: diff --git a/config/locales/gd.yml b/config/locales/gd.yml index f47c99073d..b5347d91b4 100644 --- a/config/locales/gd.yml +++ b/config/locales/gd.yml @@ -1225,8 +1225,6 @@ gd: index: hint: Bidh a’ chriathrag seo an sàs air postaichean fa leth ge b’ e dè na roghainnean eile. ’S urrainn dhut barrachd phostaichean a chur ris a’ chriathrag seo leis an eadar-aghaidh-lìn. title: Postaichean criathraichte - footer: - trending_now: A’ treandadh an-dràsta generic: all: Na h-uile all_items_on_page_selected_html: diff --git a/config/locales/gl.yml b/config/locales/gl.yml index cdb128f927..2c3af8f889 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -1196,8 +1196,6 @@ gl: index: hint: Este filtro aplícase para seleccionar publicacións individuais independentemente doutros criterios. Podes engadir máis publicacións a este filtro desde a interface web. title: Publicacións filtradas - footer: - trending_now: Tendencia agora generic: all: Todo all_items_on_page_selected_html: diff --git a/config/locales/he.yml b/config/locales/he.yml index 064e127a0d..a4af50b533 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -1238,8 +1238,6 @@ he: index: hint: סנן זה חל באופן של בחירת הודעות בודדות ללא תלות בקריטריונים אחרים. תוכלו להוסיף עוד הודעות לסנן זה ממנשק הווב. title: הודעות שסוננו - footer: - trending_now: נושאים חמים generic: all: הכל all_items_on_page_selected_html: diff --git a/config/locales/hr.yml b/config/locales/hr.yml index 0563712266..e9d414ef59 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -99,8 +99,6 @@ hr: title: Filteri new: title: Dodaj novi filter - footer: - trending_now: Popularno generic: all: Sve changes_saved_msg: Izmjene su uspješno sačuvane! diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 620e8d6799..2887b4a69a 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -1196,8 +1196,6 @@ hu: index: hint: Ez a szűrő egyedi bejegyzések kiválasztására vonatkozik a megadott kritériumoktól függetlenül. Újabb bejegyzéseket adhatsz hozzá ehhez a szűrőhöz a webes felületen keresztül. title: Megszűrt bejegyzések - footer: - trending_now: Most felkapott generic: all: Mind all_items_on_page_selected_html: diff --git a/config/locales/hy.yml b/config/locales/hy.yml index de995c5b5e..158402ce81 100644 --- a/config/locales/hy.yml +++ b/config/locales/hy.yml @@ -575,8 +575,6 @@ hy: title: Ֆիլտրեր new: title: Ավելացնել ֆիլտր - footer: - trending_now: Այժմ արդիական generic: all: Բոլորը changes_saved_msg: Փոփոխութիւնները յաջող պահուած են diff --git a/config/locales/id.yml b/config/locales/id.yml index 2363cc66ac..0342c7bd90 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -1133,8 +1133,6 @@ id: index: hint: Saringan ini diterapkan ke beberapa kiriman individu tanpa memengaruhi oleh kriteria lain. Anda dapat menambahkan lebih banyak kiriman ke saringan ini dari antarmuka web. title: Kiriman yang disaring - footer: - trending_now: Sedang tren generic: all: Semua all_items_on_page_selected_html: diff --git a/config/locales/io.yml b/config/locales/io.yml index 9ef6c03128..b557788297 100644 --- a/config/locales/io.yml +++ b/config/locales/io.yml @@ -1112,8 +1112,6 @@ io: index: hint: Ca filtrilo aplikesas a selektita posti ne segun altra kriterio. Vu povas pozar plu multa posti a ca filtrilo de retintervizajo. title: Filtrita posti - footer: - trending_now: Nuna tendenco generic: all: Omna all_items_on_page_selected_html: diff --git a/config/locales/is.yml b/config/locales/is.yml index 5f63482522..2ba3d3108c 100644 --- a/config/locales/is.yml +++ b/config/locales/is.yml @@ -1196,8 +1196,6 @@ is: index: hint: Þessi sía virkar til að velja stakar færslur án tillits til annarra skilyrða. Þú getur bætt fleiri færslum í þessa síu í vefviðmótinu. title: Síaðar færslur - footer: - trending_now: Í umræðunni núna generic: all: Allt all_items_on_page_selected_html: diff --git a/config/locales/it.yml b/config/locales/it.yml index 9256ed49d9..ce3fd34b7e 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1198,8 +1198,6 @@ it: index: hint: Questo filtro si applica a singoli post indipendentemente da altri criteri. Puoi aggiungere più post a questo filtro dall'interfaccia Web. title: Post filtrati - footer: - trending_now: Di tendenza ora generic: all: Tutto all_items_on_page_selected_html: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 374fdaf84a..6743d83883 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1175,8 +1175,6 @@ ja: index: hint: このフィルターは、他の条件に関係なく個々の投稿を選択する場合に適用されます。Webインターフェースからこのフィルターにさらに投稿を追加できます。 title: フィルターされた投稿 - footer: - trending_now: トレンドタグ generic: all: すべて all_items_on_page_selected_html: diff --git a/config/locales/kab.yml b/config/locales/kab.yml index ead31b695f..085a8958a9 100644 --- a/config/locales/kab.yml +++ b/config/locales/kab.yml @@ -543,8 +543,6 @@ kab: back_to_filter: Tuɣalin ɣer umsizdeg batch: remove: Kkes seg umsizdeg - footer: - trending_now: Ayen mucaɛen tura generic: all: Akk changes_saved_msg: Ttwaskelsen ibelliden-ik·im akken ilaq! diff --git a/config/locales/kk.yml b/config/locales/kk.yml index 959f7b0f01..c7bdae1772 100644 --- a/config/locales/kk.yml +++ b/config/locales/kk.yml @@ -470,8 +470,6 @@ kk: title: Фильтрлер new: title: Жаңа фильтр қосу - footer: - trending_now: Бүгінгі трендтер generic: all: Барлығы changes_saved_msg: Өзгерістер сәтті сақталды! diff --git a/config/locales/ko.yml b/config/locales/ko.yml index fb778f803f..057e57068f 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -1177,8 +1177,6 @@ ko: index: hint: 이 필터는 다른 기준에 관계 없이 선택된 개별적인 게시물들에 적용됩니다. 웹 인터페이스에서 더 많은 게시물들을 이 필터에 추가할 수 있습니다. title: 필터링된 게시물 - footer: - trending_now: 지금 유행 중 generic: all: 모두 all_items_on_page_selected_html: diff --git a/config/locales/ku.yml b/config/locales/ku.yml index 899cd936a0..fa291b5c7f 100644 --- a/config/locales/ku.yml +++ b/config/locales/ku.yml @@ -1156,8 +1156,6 @@ ku: index: hint: Ev parzûn bêyî pîvanên din ji bo hilbijartina şandiyên kesane tê sepandin. Tu dikarî ji navrûya tevnê bêtir şandiyan tevlî vê parzûnê bikî. title: Şandiyên parzûnkirî - footer: - trending_now: Niha rojevê de generic: all: Hemû all_items_on_page_selected_html: diff --git a/config/locales/lv.yml b/config/locales/lv.yml index 8bcb23c602..1c5eb356d4 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -1217,8 +1217,6 @@ lv: index: hint: Šis filtrs attiecas uz atsevišķu ziņu atlasi neatkarīgi no citiem kritērijiem. Šim filtram tu vari pievienot vairāk ziņu, izmantojot tīmekļa saskarni. title: Filtrētās ziņas - footer: - trending_now: Šobrīd populārākie generic: all: Visi all_items_on_page_selected_html: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index e9a63e9d83..7732a64421 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1196,8 +1196,6 @@ nl: index: hint: Dit filter is van toepassing om individuele berichten te selecteren, ongeacht andere criteria. Je kunt in de webomgeving meer berichten aan dit filter toevoegen. title: Gefilterde berichten - footer: - trending_now: Trends generic: all: Alles all_items_on_page_selected_html: diff --git a/config/locales/nn.yml b/config/locales/nn.yml index 49f30bab09..7b860b54b2 100644 --- a/config/locales/nn.yml +++ b/config/locales/nn.yml @@ -1156,8 +1156,6 @@ nn: index: hint: Dette filteret gjelder for å velge individuelle innlegg uavhengig av andre kriterier. Du kan legge til flere innlegg til dette filteret fra webgrensesnittet. title: Filtrerte innlegg - footer: - trending_now: Populært no generic: all: Alle all_items_on_page_selected_html: diff --git a/config/locales/no.yml b/config/locales/no.yml index 3036ce050f..ebad60b73c 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -1131,8 +1131,6 @@ index: hint: Dette filteret gjelder for å velge individuelle innlegg uavhengig av andre kriterier. Du kan legge til flere innlegg til dette filteret fra webgrensesnittet. title: Filtrerte innlegg - footer: - trending_now: Trender nå generic: all: Alle all_items_on_page_selected_html: diff --git a/config/locales/oc.yml b/config/locales/oc.yml index 1d5ed61fe7..e1406ec614 100644 --- a/config/locales/oc.yml +++ b/config/locales/oc.yml @@ -627,8 +627,6 @@ oc: title: Filtres new: title: Ajustar un nòu filtre - footer: - trending_now: Tendéncia del moment generic: all: Tot changes_saved_msg: Cambiaments ben realizats ! diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 90a6aaf9ee..d086161910 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1238,8 +1238,6 @@ pl: index: hint: Ten filtr ma zastosowanie do wybierania poszczególnych wpisów niezależnie od pozostałych kryteriów. Możesz dodać więcej wpisów do tego filtra z interfejsu internetowego. title: Filtrowane posty - footer: - trending_now: Obecnie na czasie generic: all: Wszystkie all_items_on_page_selected_html: diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index d855721077..5192a83d22 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1179,8 +1179,6 @@ pt-BR: index: hint: Este filtro se aplica a publicações individuais, independentemente de outros critérios. Você pode adicionar mais postagens a este filtro a partir da interface web. title: Publicações filtradas - footer: - trending_now: Em alta no momento generic: all: Tudo all_items_on_page_selected_html: diff --git a/config/locales/pt-PT.yml b/config/locales/pt-PT.yml index d3649ba40d..2718a7fb46 100644 --- a/config/locales/pt-PT.yml +++ b/config/locales/pt-PT.yml @@ -1196,8 +1196,6 @@ pt-PT: index: hint: Este filtro aplica-se a publicações individuais selecionadas independentemente de outros critérios. Pode adicionar mais publicações a este filtro através da interface web. title: Publicações filtradas - footer: - trending_now: Em alta neste momento generic: all: Tudo all_items_on_page_selected_html: diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 9b8749b818..bfb3f5779c 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1226,8 +1226,6 @@ ru: index: hint: Этот фильтр применяется для выбора отдельных постов, независимо от других критериев. Вы можете добавить больше записей в этот фильтр из веб-интерфейса. title: Отфильтрованные посты - footer: - trending_now: Актуально сейчас generic: all: Любой all_items_on_page_selected_html: diff --git a/config/locales/sc.yml b/config/locales/sc.yml index 3a84f81702..113786f77a 100644 --- a/config/locales/sc.yml +++ b/config/locales/sc.yml @@ -658,8 +658,6 @@ sc: title: Filtros new: title: Agiunghe unu filtru nou - footer: - trending_now: Est tendèntzia immoe generic: all: Totus changes_saved_msg: Modìficas sarvadas. diff --git a/config/locales/sco.yml b/config/locales/sco.yml index 6cd4be0601..719a8918fc 100644 --- a/config/locales/sco.yml +++ b/config/locales/sco.yml @@ -1146,8 +1146,6 @@ sco: index: hint: This filter applies tae select individual posts regairdless o ither criteria. Ye kin add mair posts tae this filter fae the wab interface. title: Filtert posts - footer: - trending_now: Trendin the noo generic: all: Aw all_items_on_page_selected_html: diff --git a/config/locales/si.yml b/config/locales/si.yml index 9a639b720d..87eaee5b6b 100644 --- a/config/locales/si.yml +++ b/config/locales/si.yml @@ -959,8 +959,6 @@ si: new: save: නව පෙරහන සුරකින්න title: නව පෙරහනක් එකතු කරන්න - footer: - trending_now: දැන් ප්‍රවණතාවය generic: all: සියල්ල changes_saved_msg: වෙනස්කම් සාර්ථකව සුරකින ලදී! diff --git a/config/locales/sk.yml b/config/locales/sk.yml index da653857fb..f1b021127b 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -814,8 +814,6 @@ sk: title: Triedenia new: title: Pridaj nové triedenie - footer: - trending_now: Teraz populárne generic: all: Všetko changes_saved_msg: Zmeny boli úspešne uložené! diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 7cabc0cd86..303f9ea559 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -1238,8 +1238,6 @@ sl: index: hint: Ta filter se nanaša na posamezne objave ne glede na druge pogoje. Filtru lahko dodate več objav prek spletnega vmesnika. title: Filtrirane objave - footer: - trending_now: Zdaj v trendu generic: all: Vse all_items_on_page_selected_html: diff --git a/config/locales/sq.yml b/config/locales/sq.yml index 467aa8967e..ea94dfb6a3 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -1190,8 +1190,6 @@ sq: index: hint: Ky filtër aplikohet për të përzgjedhur postime individuale, pavarësisht kriteresh të tjera. Që nga ndërfaqja web mund të shtoni më tepër postime te ky filtër. title: Postime të filtruar - footer: - trending_now: Prirjet e tashme generic: all: Krejt all_items_on_page_selected_html: diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 9352f0c19a..aea9cea4e6 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -1196,8 +1196,6 @@ sv: index: hint: Detta filter gäller för att välja enskilda inlägg oavsett andra kriterier. Du kan lägga till fler inlägg till detta filter från webbgränssnittet. title: Filtrerade inlägg - footer: - trending_now: Trendar nu generic: all: Alla all_items_on_page_selected_html: diff --git a/config/locales/th.yml b/config/locales/th.yml index 9c4a7bfc58..815936a2d1 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -1175,8 +1175,6 @@ th: index: hint: ตัวกรองนี้นำไปใช้เพื่อเลือกโพสต์แต่ละรายการโดยไม่คำนึงถึงเกณฑ์อื่น ๆ คุณสามารถเพิ่มโพสต์เพิ่มเติมไปยังตัวกรองนี้ได้จากส่วนติดต่อเว็บ title: โพสต์ที่กรองอยู่ - footer: - trending_now: กำลังนิยม generic: all: ทั้งหมด all_items_on_page_selected_html: diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 90a4208f0a..6cbd3f5103 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -1196,8 +1196,6 @@ tr: index: hint: Bu filtre diğer ölçütlerden bağımsız olarak tekil gönderileri seçmek için uygulanıyor. Web arayüzünü kullanarak bu filtreye daha fazla gönderi ekleyebilirsiniz. title: Filtrelenmiş gönderiler - footer: - trending_now: Şu an gündemde generic: all: Tümü all_items_on_page_selected_html: diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 347f7414dc..44d54363f3 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -1238,8 +1238,6 @@ uk: index: hint: Цей фільтр застосовується для вибору окремих дописів, незалежно від інших критеріїв. Ви можете додавати більше дописів до цього фільтра з вебінтерфейсу. title: Відфільтровані дописи - footer: - trending_now: Актуальні generic: all: Усі all_items_on_page_selected_html: diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 538b9304b0..88592b7044 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -1175,8 +1175,6 @@ vi: index: hint: Bộ lọc này áp dụng để chọn các tút riêng lẻ bất kể các tiêu chí khác. Bạn có thể thêm các tút khác vào bộ lọc này từ giao diện web. title: Những tút đã lọc - footer: - trending_now: Thịnh hành generic: all: Tất cả all_items_on_page_selected_html: diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index e8ca1910a7..ed1780ce8d 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -1175,8 +1175,6 @@ zh-CN: index: hint: 无论其他条件如何,此过滤器适用于选用个别嘟文。你可以从网页界面中向此过滤器加入更多嘟文。 title: 过滤的嘟文 - footer: - trending_now: 现在流行 generic: all: 全部 all_items_on_page_selected_html: diff --git a/config/locales/zh-HK.yml b/config/locales/zh-HK.yml index 6538e34590..405f321d46 100644 --- a/config/locales/zh-HK.yml +++ b/config/locales/zh-HK.yml @@ -1175,8 +1175,6 @@ zh-HK: index: hint: 不管其他條件如何,此篩選器會套用於所選的個別帖文。你可以在網頁介面上加入更多帖文到此篩選器。 title: 篩選帖文 - footer: - trending_now: 今期流行 generic: all: 全部 all_items_on_page_selected_html: diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index a25818bca6..3174287175 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1177,8 +1177,6 @@ zh-TW: index: hint: 此過濾器會套用至所選之各別嘟文,不管它們有無符合其他條件。您可以從網頁介面中將更多嘟文加入至此過濾器。 title: 已過濾之嘟文 - footer: - trending_now: 現正熱門 generic: all: 全部 all_items_on_page_selected_html: From 8770473dbb92042f76e058469a76e5bb4beecb9f Mon Sep 17 00:00:00 2001 From: PauloVilarinho <33267902+PauloVilarinho@users.noreply.github.com> Date: Mon, 6 Mar 2023 13:33:09 -0300 Subject: [PATCH 05/10] add modal message when editing toot (#23936) Co-authored-by: PauloVilarinho --- .../mastodon/containers/status_container.jsx | 15 ++++++++++++++- app/javascript/mastodon/locales/en.json | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/containers/status_container.jsx b/app/javascript/mastodon/containers/status_container.jsx index 294105f259..580f409e94 100644 --- a/app/javascript/mastodon/containers/status_container.jsx +++ b/app/javascript/mastodon/containers/status_container.jsx @@ -56,6 +56,8 @@ const messages = defineMessages({ redraftMessage: { id: 'confirmations.redraft.message', defaultMessage: 'Are you sure you want to delete this status and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.' }, replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' }, replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' }, + editConfirm: { id: 'confirmations.edit.confirm', defaultMessage: 'Edit' }, + editMessage: { id: 'confirmations.edit.message', defaultMessage: 'Editing now will overwrite the message you are currently composing. Are you sure you want to proceed?' }, blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' }, }); @@ -149,7 +151,18 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({ }, onEdit (status, history) { - dispatch(editStatus(status.get('id'), history)); + dispatch((_, getState) => { + let state = getState(); + if (state.getIn(['compose', 'text']).trim().length !== 0) { + dispatch(openModal('CONFIRM', { + message: intl.formatMessage(messages.editMessage), + confirm: intl.formatMessage(messages.editConfirm), + onConfirm: () => dispatch(editStatus(status.get('id'), history)), + })); + } else { + dispatch(editStatus(status.get('id'), history)); + } + }); }, onTranslate (status) { diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index ae7722635d..f4d0519403 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -162,6 +162,8 @@ "confirmations.discard_edit_media.message": "You have unsaved changes to the media description or preview, discard them anyway?", "confirmations.domain_block.confirm": "Block entire domain", "confirmations.domain_block.message": "Are you really, really sure you want to block the entire {domain}? In most cases a few targeted blocks or mutes are sufficient and preferable. You will not see content from that domain in any public timelines or your notifications. Your followers from that domain will be removed.", + "confirmations.edit.confirm": "Edit", + "confirmations.edit.message": "Editing now will overwrite the message you are currently composing. Are you sure you want to proceed?", "confirmations.logout.confirm": "Log out", "confirmations.logout.message": "Are you sure you want to log out?", "confirmations.mute.confirm": "Mute", From dfa1be4ab451a4dd099ad3c140502fb0759ef832 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 6 Mar 2023 11:33:58 -0500 Subject: [PATCH 06/10] Remove unused TOCGenerator (#23986) --- app/lib/toc_generator.rb | 69 ---------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 app/lib/toc_generator.rb diff --git a/app/lib/toc_generator.rb b/app/lib/toc_generator.rb deleted file mode 100644 index 0c8f766ca4..0000000000 --- a/app/lib/toc_generator.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -class TOCGenerator - TARGET_ELEMENTS = %w(h1 h2 h3 h4 h5 h6).freeze - LISTED_ELEMENTS = %w(h2 h3).freeze - - class Section - attr_accessor :depth, :title, :children, :anchor - - def initialize(depth, title, anchor) - @depth = depth - @title = title - @children = [] - @anchor = anchor - end - - delegate :<<, to: :children - end - - def initialize(source_html) - @source_html = source_html - @processed = false - @target_html = '' - @headers = [] - @slugs = Hash.new { |h, k| h[k] = 0 } - end - - def html - parse_and_transform unless @processed - @target_html - end - - def toc - parse_and_transform unless @processed - @headers - end - - private - - def parse_and_transform - return if @source_html.blank? - - parsed_html = Nokogiri::HTML.fragment(@source_html) - - parsed_html.traverse do |node| - next unless TARGET_ELEMENTS.include?(node.name) - - anchor = node['id'] || node.text.parameterize.presence || 'sec' - @slugs[anchor] += 1 - anchor = "#{anchor}-#{@slugs[anchor]}" if @slugs[anchor] > 1 - - node['id'] = anchor - - next unless LISTED_ELEMENTS.include?(node.name) - - depth = node.name[1..-1] - latest_section = @headers.last - - if latest_section.nil? || latest_section.depth >= depth - @headers << Section.new(depth, node.text, anchor) - else - latest_section << Section.new(depth, node.text, anchor) - end - end - - @target_html = parsed_html.to_s - @processed = true - end -end From 59b24c3688628a3cb778e71fc0684636cbda557b Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 6 Mar 2023 17:44:55 +0100 Subject: [PATCH 07/10] Fix `/api/v1/streaming` sub-paths not being redirected (#23988) --- config/routes.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index e7c4c000ee..530b46a5a5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -472,7 +472,9 @@ Rails.application.routes.draw do resources :list, only: :show end - resources :streaming, only: [:index] + get '/streaming', to: 'streaming#index' + get '/streaming/(*any)', to: 'streaming#index' + resources :custom_emojis, only: [:index] resources :suggestions, only: [:index, :destroy] resources :scheduled_statuses, only: [:index, :show, :update, :destroy] From 174352716ada7c8da451f1a2db57f18b66cd3fdb Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 6 Mar 2023 21:00:10 +0100 Subject: [PATCH 08/10] Disable anonymous access to the streaming API (#23989) --- streaming/index.js | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/streaming/index.js b/streaming/index.js index 2cc4934ee9..91e86fdbc5 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -16,7 +16,6 @@ const WebSocket = require('ws'); const { JSDOM } = require('jsdom'); const env = process.env.NODE_ENV || 'development'; -const alwaysRequireAuth = process.env.LIMITED_FEDERATION_MODE === 'true' || process.env.WHITELIST_MODE === 'true' || process.env.AUTHORIZED_FETCH === 'true'; dotenv.config({ path: env === 'production' ? '.env.production' : '.env', @@ -347,22 +346,17 @@ const startWorker = async (workerId) => { * @param {boolean=} required * @return {Promise.} */ - const accountFromRequest = (req, required = true) => new Promise((resolve, reject) => { + const accountFromRequest = (req) => new Promise((resolve, reject) => { const authorization = req.headers.authorization; const location = url.parse(req.url, true); const accessToken = location.query.access_token || req.headers['sec-websocket-protocol']; if (!authorization && !accessToken) { - if (required) { - const err = new Error('Missing access token'); - err.status = 401; + const err = new Error('Missing access token'); + err.status = 401; - reject(err); - return; - } else { - resolve(); - return; - } + reject(err); + return; } const token = authorization ? authorization.replace(/^Bearer /, '') : accessToken; @@ -465,7 +459,7 @@ const startWorker = async (workerId) => { // variables. OAuth scope checks are moved to the point of subscription // to a specific stream. - accountFromRequest(info.req, alwaysRequireAuth).then(() => { + accountFromRequest(info.req).then(() => { callback(true, undefined, undefined); }).catch(err => { log.error(info.req.requestId, err.toString()); @@ -539,7 +533,7 @@ const startWorker = async (workerId) => { return; } - accountFromRequest(req, alwaysRequireAuth).then(() => checkScopes(req, channelNameFromPath(req))).then(() => { + accountFromRequest(req).then(() => checkScopes(req, channelNameFromPath(req))).then(() => { subscribeHttpToSystemChannel(req, res); }).then(() => { next(); From e594bb7d5042f4a531334fd29bf4961f2152c4fa Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 6 Mar 2023 22:49:43 -0500 Subject: [PATCH 09/10] Convert CircleCI to GitHub Actions (#23608) --- .circleci/config.yml | 128 ----------------------------- .github/workflows/test-ruby.yml | 139 ++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 2 - Gemfile | 1 + Gemfile.lock | 2 + README.md | 3 +- config/webpacker.yml | 2 +- 7 files changed, 144 insertions(+), 133 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/test-ruby.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 3913a6b0f8..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,128 +0,0 @@ -version: 2.1 - -orbs: - ruby: circleci/ruby@2.0.0 - node: circleci/node@5.0.3 - -executors: - default: - parameters: - ruby-version: - type: string - docker: - - image: cimg/ruby:<< parameters.ruby-version >> - environment: - BUNDLE_JOBS: 3 - BUNDLE_RETRY: 3 - CONTINUOUS_INTEGRATION: true - DB_HOST: localhost - DB_USER: root - DISABLE_SIMPLECOV: true - RAILS_ENV: test - - image: cimg/postgres:14.5 - environment: - POSTGRES_USER: root - POSTGRES_HOST_AUTH_METHOD: trust - - image: cimg/redis:7.0 - -commands: - install-system-dependencies: - steps: - - run: - name: Install system dependencies - command: | - sudo apt-get update - sudo apt-get install -y libicu-dev libidn11-dev - install-ruby-dependencies: - parameters: - ruby-version: - type: string - steps: - - run: - command: | - bundle config clean 'true' - bundle config frozen 'true' - bundle config without 'development production' - name: Set bundler settings - - ruby/install-deps: - bundler-version: '2.3.26' - key: ruby<< parameters.ruby-version >>-gems-v2 - wait-db: - steps: - - run: - command: dockerize -wait tcp://localhost:5432 -wait tcp://localhost:6379 -timeout 1m - name: Wait for PostgreSQL and Redis - -jobs: - build: - docker: - - image: cimg/ruby:3.2-node - environment: - RAILS_ENV: test - steps: - - checkout - - install-system-dependencies - - install-ruby-dependencies: - ruby-version: '3.2' - - node/install-packages: - cache-version: v1 - pkg-manager: yarn - - run: - command: | - export NODE_OPTIONS=--openssl-legacy-provider - ./bin/rails assets:precompile - name: Precompile assets - - persist_to_workspace: - paths: - - public/assets - - public/packs-test - root: . - - test: - parameters: - ruby-version: - type: string - executor: - name: default - ruby-version: << parameters.ruby-version >> - environment: - ALLOW_NOPAM: true - PAM_ENABLED: true - PAM_DEFAULT_SERVICE: pam_test - PAM_CONTROLLED_SERVICE: pam_test_controlled - parallelism: 4 - steps: - - checkout - - install-system-dependencies - - run: - command: sudo apt-get install -y ffmpeg imagemagick libmagickcore-dev libmagickwand-dev libjpeg-dev libpng-dev libtiff-dev libwebp-dev libpam-dev - name: Install additional system dependencies - - run: - command: bundle config with 'pam_authentication' - name: Enable PAM authentication - - install-ruby-dependencies: - ruby-version: << parameters.ruby-version >> - - attach_workspace: - at: . - - wait-db - - run: - command: ./bin/rails db:create db:schema:load db:seed - name: Load database schema - - ruby/rspec-test - -workflows: - version: 2 - build-and-test: - jobs: - - build - - test: - matrix: - parameters: - ruby-version: - - '2.7' - - '3.0' - - '3.1' - - '3.2' - name: test-ruby<< matrix.ruby-version >> - requires: - - build diff --git a/.github/workflows/test-ruby.yml b/.github/workflows/test-ruby.yml new file mode 100644 index 0000000000..60f5df8850 --- /dev/null +++ b/.github/workflows/test-ruby.yml @@ -0,0 +1,139 @@ +name: Ruby Testing + +on: + push: + pull_request: + +env: + BUNDLE_CLEAN: true + BUNDLE_FROZEN: true + BUNDLE_WITHOUT: 'development production' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + env: + RAILS_ENV: test + + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + cache: yarn + node-version-file: '.nvmrc' + + - name: Install native Ruby dependencies + run: sudo apt-get install -y libicu-dev libidn11-dev + + - name: Set up bundler cache + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - run: yarn install --frozen-lockfile + - name: Precompile assets + # Previously had set this, but it's not supported + # export NODE_OPTIONS=--openssl-legacy-provider + run: |- + ./bin/rails assets:precompile + + - uses: actions/upload-artifact@v3 + with: + path: |- + ./public/assets + ./public/packs-test + name: ${{ github.sha }} + retention-days: 0 + + test: + runs-on: ubuntu-latest + + needs: + - build + + services: + postgres: + image: postgres:14.5 + env: + POSTGRES_PASSWORD: postgres + POSTGRES_USER: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + + redis: + image: redis:7.0 + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 6379:6379 + + env: + DB_HOST: localhost + DB_USER: postgres + DB_PASS: postgres + DISABLE_SIMPLECOV: true + RAILS_ENV: test + ALLOW_NOPAM: true + PAM_ENABLED: true + PAM_DEFAULT_SERVICE: pam_test + PAM_CONTROLLED_SERVICE: pam_test_controlled + BUNDLE_WITH: 'pam_authentication' + CI_JOBS: ${{ matrix.ci_job }}/4 + + strategy: + fail-fast: false + matrix: + ruby-version: + - '2.7' + - '3.0' + - '3.1' + - '.ruby-version' + ci_job: + - 1 + - 2 + - 3 + - 4 + steps: + - uses: actions/checkout@v3 + + - uses: actions/download-artifact@v3 + with: + path: './public' + name: ${{ github.sha }} + + - name: Install native Ruby dependencies + run: sudo apt-get install -y libicu-dev libidn11-dev + + - name: Install additional system dependencies + run: sudo apt-get install -y ffmpeg imagemagick libpam-dev + + - name: Set up bundler cache + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version}} + bundler-cache: true + + - name: Update system gems + if: matrix.ruby-version == '2.7' + run: gem update --system + + - name: Load database schema + run: './bin/rails db:create db:schema:load db:seed' + + - run: bundle exec rake rspec_chunked diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d67b21ee58..c1a5fef798 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,8 +41,6 @@ It is not always possible to phrase every change in such a manner, but it is des - Code style rules (rubocop, eslint) - Normalization of locale files (i18n-tasks) -**Note**: You may need to log in and authorise the GitHub account your fork of this repository belongs to with CircleCI to enable some of the automated checks to run. - ## Documentation The [Mastodon documentation](https://docs.joinmastodon.org) is a statically generated site. You can [submit merge requests to mastodon/documentation](https://github.com/mastodon/documentation). diff --git a/Gemfile b/Gemfile index 5804327cca..dbe9ce8c0f 100644 --- a/Gemfile +++ b/Gemfile @@ -104,6 +104,7 @@ group :development, :test do gem 'fuubar', '~> 2.5' gem 'i18n-tasks', '~> 1.0', require: false gem 'rspec-rails', '~> 6.0' + gem 'rspec_chunked', '~> 0.6' gem 'rubocop-performance', require: false gem 'rubocop-rails', require: false gem 'rubocop-rspec', require: false diff --git a/Gemfile.lock b/Gemfile.lock index c6b4e74f6a..5afa9775ba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -596,6 +596,7 @@ GEM rspec-core (~> 3.0, >= 3.0.0) sidekiq (>= 2.4.0) rspec-support (3.12.0) + rspec_chunked (0.6) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) rubocop (1.45.1) @@ -858,6 +859,7 @@ DEPENDENCIES rqrcode (~> 2.1) rspec-rails (~> 6.0) rspec-sidekiq (~> 3.1) + rspec_chunked (~> 0.6) rspec_junit_formatter (~> 0.6) rubocop rubocop-performance diff --git a/README.md b/README.md index 306665e9a6..f517668a95 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,12 @@ [![GitHub release](https://img.shields.io/github/release/mastodon/mastodon.svg)][releases] -[![Build Status](https://img.shields.io/circleci/project/github/mastodon/mastodon.svg)][circleci] +[![Ruby Testing](https://github.com/mastodon/mastodon/actions/workflows/test-ruby.yml/badge.svg)](https://github.com/mastodon/mastodon/actions/workflows/test-ruby.yml) [![Code Climate](https://img.shields.io/codeclimate/maintainability/mastodon/mastodon.svg)][code_climate] [![Crowdin](https://d322cqt584bo4o.cloudfront.net/mastodon/localized.svg)][crowdin] [![Docker Pulls](https://img.shields.io/docker/pulls/tootsuite/mastodon.svg)][docker] [releases]: https://github.com/mastodon/mastodon/releases -[circleci]: https://circleci.com/gh/mastodon/mastodon [code_climate]: https://codeclimate.com/github/mastodon/mastodon [crowdin]: https://crowdin.com/project/mastodon [docker]: https://hub.docker.com/r/tootsuite/mastodon/ diff --git a/config/webpacker.yml b/config/webpacker.yml index 0baff662b0..1745a17988 100644 --- a/config/webpacker.yml +++ b/config/webpacker.yml @@ -75,7 +75,7 @@ development: test: <<: *default - # CircleCI precompiles packs prior to running the tests. + # CI precompiles packs prior to running the tests. # Also avoids race conditions in parallel_tests. compile: false From fb13f374751e9e6d9d54d6f781d71ba2b31afe97 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Wed, 8 Mar 2023 01:12:57 -0500 Subject: [PATCH 10/10] Skip double building on Dependabot branches (#24025) --- .github/workflows/rebase-needed.yml | 4 ++++ .github/workflows/test-ruby.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/rebase-needed.yml b/.github/workflows/rebase-needed.yml index 99b224ec60..944ae7b283 100644 --- a/.github/workflows/rebase-needed.yml +++ b/.github/workflows/rebase-needed.yml @@ -2,7 +2,11 @@ name: PR Needs Rebase on: push: + branches-ignore: + - 'dependabot/**' pull_request_target: + branches-ignore: + - 'dependabot/**' types: [synchronize] permissions: diff --git a/.github/workflows/test-ruby.yml b/.github/workflows/test-ruby.yml index 60f5df8850..39b4341884 100644 --- a/.github/workflows/test-ruby.yml +++ b/.github/workflows/test-ruby.yml @@ -2,6 +2,8 @@ name: Ruby Testing on: push: + branches-ignore: + - 'dependabot/**' pull_request: env: