From 6d14cfbf298eec6e2ffcd4ad69a118cdd168b3a1 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 24 Jun 2024 06:18:36 -0400 Subject: [PATCH 01/11] Unset Rails/UnusedIgnoredColumns (#30800) --- .rubocop/rails.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.rubocop/rails.yml b/.rubocop/rails.yml index 4e08f1ab91e55d..68c90143a692be 100644 --- a/.rubocop/rails.yml +++ b/.rubocop/rails.yml @@ -18,6 +18,3 @@ Rails/RakeEnvironment: Rails/SkipsModelValidations: Enabled: false - -Rails/UnusedIgnoredColumns: - Enabled: false # Preserve ability to migrate from arbitrary old versions From b3710098a8edcb5cc317a280758b2a772ea722ef Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:18:51 +0200 Subject: [PATCH 02/11] chore(deps): update dependency opentelemetry-instrumentation-faraday to v0.24.5 (#30797) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0fe1c03b25ac88..abd31f49aab9ec 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -532,7 +532,7 @@ GEM opentelemetry-instrumentation-excon (0.22.3) opentelemetry-api (~> 1.0) opentelemetry-instrumentation-base (~> 0.22.1) - opentelemetry-instrumentation-faraday (0.24.4) + opentelemetry-instrumentation-faraday (0.24.5) opentelemetry-api (~> 1.0) opentelemetry-instrumentation-base (~> 0.22.1) opentelemetry-instrumentation-http (0.23.3) From 54cc204473302eda7e6e7e75b343a14859524ab1 Mon Sep 17 00:00:00 2001 From: Essem Date: Mon, 24 Jun 2024 05:29:00 -0500 Subject: [PATCH 03/11] Use WebSocketServer instead of WebSocket.Server in streaming (#30788) --- streaming/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/streaming/index.js b/streaming/index.js index 154ecbc02c5f5a..65a63bb114326a 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -12,7 +12,7 @@ import { Redis } from 'ioredis'; import { JSDOM } from 'jsdom'; import pg from 'pg'; import pgConnectionString from 'pg-connection-string'; -import WebSocket from 'ws'; +import { WebSocketServer } from 'ws'; import { AuthenticationError, RequestError, extractStatusAndMessage as extractErrorStatusAndMessage } from './errors.js'; import { logger, httpLogger, initializeLogLevel, attachWebsocketHttpLogger, createWebsocketLogger } from './logging.js'; @@ -289,7 +289,7 @@ const CHANNEL_NAMES = [ const startServer = async () => { const pgPool = new pg.Pool(pgConfigFromEnv(process.env)); const server = http.createServer(); - const wss = new WebSocket.Server({ noServer: true }); + const wss = new WebSocketServer({ noServer: true }); // Set the X-Request-Id header on WebSockets: wss.on("headers", function onHeaders(headers, req) { From 1af6313ced5b39041cb8c480b1f0c65155429238 Mon Sep 17 00:00:00 2001 From: Essem Date: Mon, 24 Jun 2024 05:36:26 -0500 Subject: [PATCH 04/11] Fix CMD syntax in streaming Dockerfile (#30795) --- streaming/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/streaming/Dockerfile b/streaming/Dockerfile index 319d5b7fd86dec..d9f7615fa80c39 100644 --- a/streaming/Dockerfile +++ b/streaming/Dockerfile @@ -110,4 +110,4 @@ USER mastodon # Expose default Streaming ports EXPOSE 4000 # Run streaming when started -CMD [ node ./streaming/index.js ] +CMD [ "node", "./streaming/index.js" ] From 61722b1b1fb36ff5c3d6c470981f5fc6648e2d14 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:46:53 +0200 Subject: [PATCH 05/11] New Crowdin Translations (automated) (#30808) Co-authored-by: GitHub Actions --- app/javascript/mastodon/locales/fil.json | 7 +++++++ app/javascript/mastodon/locales/pt-BR.json | 4 ++++ app/javascript/mastodon/locales/zh-TW.json | 2 +- config/locales/doorkeeper.pt-BR.yml | 2 ++ config/locales/pt-BR.yml | 1 + config/locales/ru.yml | 4 ++++ 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/locales/fil.json b/app/javascript/mastodon/locales/fil.json index 9e459f76719abc..b8a2987ef052f3 100644 --- a/app/javascript/mastodon/locales/fil.json +++ b/app/javascript/mastodon/locales/fil.json @@ -118,6 +118,7 @@ "confirmations.delete_list.confirm": "Tanggalin", "confirmations.delete_list.message": "Sigurado ka bang gusto mong burahin ang listahang ito?", "confirmations.discard_edit_media.confirm": "Ipagpaliban", + "confirmations.domain_block.confirm": "Harangan ang serbiro", "confirmations.edit.confirm": "Baguhin", "confirmations.reply.confirm": "Tumugon", "conversation.mark_as_read": "Markahan bilang nabasa na", @@ -186,6 +187,7 @@ "follow_request.authorize": "Tanggapin", "follow_request.reject": "Tanggihan", "follow_suggestions.dismiss": "Huwag nang ipakita muli", + "follow_suggestions.popular_suggestion_longer": "Sikat sa {domain}", "follow_suggestions.view_all": "Tingnan lahat", "follow_suggestions.who_to_follow": "Sinong maaaring sundan", "footer.about": "Tungkol dito", @@ -220,6 +222,7 @@ "link_preview.author": "Ni/ng {name}", "lists.account.add": "Idagdag sa talaan", "lists.account.remove": "Tanggalin mula sa talaan", + "lists.delete": "Burahin ang talaan", "lists.new.create": "Idagdag sa talaan", "lists.new.title_placeholder": "Bagong pangalan ng talaan", "lists.replies_policy.title": "Ipakita ang mga tugon sa:", @@ -287,9 +290,13 @@ "reply_indicator.cancel": "Ipagpaliban", "report.block": "Harangan", "report.categories.other": "Iba pa", + "report.categories.violation": "Lumalabag ang nilalaman sa isa o higit pang mga patakaran ng serbiro", + "report.category.subtitle": "Piliin ang pinakamahusay na tugma", "report.category.title": "Sabihin mo sa amin kung anong nangyari sa {type} na ito", "report.close": "Tapos na", "report.next": "Sunod", + "report.placeholder": "Mga Karagdagang Puna", + "report.reasons.dislike": "Hindi ko gusto ito", "report.reasons.violation": "Lumalabag ito sa mga panuntunan ng serbiro", "report.reasons.violation_description": "Alam mo na lumalabag ito sa mga partikular na panuntunan", "report.rules.title": "Aling mga patakaran ang nilabag?", diff --git a/app/javascript/mastodon/locales/pt-BR.json b/app/javascript/mastodon/locales/pt-BR.json index afe54905476d3b..4d3bd2d280d6fe 100644 --- a/app/javascript/mastodon/locales/pt-BR.json +++ b/app/javascript/mastodon/locales/pt-BR.json @@ -415,6 +415,7 @@ "limited_account_hint.title": "Este perfil foi ocultado pelos moderadores do {domain}.", "link_preview.author": "Por {name}", "link_preview.more_from_author": "Mais de {name}", + "link_preview.shares": "{count, plural, one {{counter} publicação} other {{counter} publicações}}", "lists.account.add": "Adicionar à lista", "lists.account.remove": "Remover da lista", "lists.delete": "Excluir lista", @@ -695,8 +696,11 @@ "server_banner.about_active_users": "Pessoas usando este servidor durante os últimos 30 dias (Usuários ativos mensalmente)", "server_banner.active_users": "usuários ativos", "server_banner.administered_by": "Administrado por:", + "server_banner.is_one_of_many": "{domain} é um dos muitos servidores Mastodon independentes que você pode usar para participar do fediverso.", "server_banner.server_stats": "Estatísticas do servidor:", "sign_in_banner.create_account": "Criar conta", + "sign_in_banner.follow_anyone": "Siga alguém pelo fediverso e veja tudo em ordem cronológica. Sem algoritmos, anúncios ou clickbait à vista.", + "sign_in_banner.mastodon_is": "O Mastodon é a melhor maneira de acompanhar o que está acontecendo.", "sign_in_banner.sign_in": "Entrar", "sign_in_banner.sso_redirect": "Entrar ou Registrar-se", "status.admin_account": "Abrir interface de moderação para @{name}", diff --git a/app/javascript/mastodon/locales/zh-TW.json b/app/javascript/mastodon/locales/zh-TW.json index e6cd62162bc4f7..4ab22daba5af8f 100644 --- a/app/javascript/mastodon/locales/zh-TW.json +++ b/app/javascript/mastodon/locales/zh-TW.json @@ -62,7 +62,7 @@ "account.requested": "正在等候審核。按一下以取消跟隨請求", "account.requested_follow": "{name} 要求跟隨您", "account.share": "分享 @{name} 的個人檔案", - "account.show_reblogs": "顯示來自 @{name} 的嘟文", + "account.show_reblogs": "顯示來自 @{name} 的轉嘟", "account.statuses_counter": "{count, plural,one {{counter} 則}other {{counter} 則}}嘟文", "account.unblock": "解除封鎖 @{name}", "account.unblock_domain": "解除封鎖網域 {domain}", diff --git a/config/locales/doorkeeper.pt-BR.yml b/config/locales/doorkeeper.pt-BR.yml index d7e9353b59be3e..6b076e9081c7a6 100644 --- a/config/locales/doorkeeper.pt-BR.yml +++ b/config/locales/doorkeeper.pt-BR.yml @@ -135,6 +135,7 @@ pt-BR: media: Mídias anexadas mutes: Silenciados notifications: Notificações + profile: Seu perfil do Mastodon push: Notificações push reports: Denúncias search: Buscar @@ -165,6 +166,7 @@ pt-BR: admin:write:reports: executar ações de moderação em denúncias crypto: usar criptografia de ponta-a-ponta follow: alterar o relacionamento das contas + profile: ler somente as informações do perfil da sua conta push: receber notificações push read: ler todos os dados da sua conta read:accounts: ver informações das contas diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 8d3b53f777d630..584a9253b81a46 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -293,6 +293,7 @@ pt-BR: filter_by_action: Filtrar por ação filter_by_user: Filtrar por usuário title: Auditar histórico + unavailable_instance: "(nome de domínio indisponível)" announcements: destroyed_msg: Anúncio excluído! edit: diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 6dff92bb6d5386..5f5b3676fb6623 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1699,6 +1699,7 @@ ru: import: Импорт import_and_export: Импорт и экспорт migrate: Миграция учётной записи + notifications: Уведомления по электронной почте preferences: Настройки profile: Профиль relationships: Подписки и подписчики @@ -1706,6 +1707,9 @@ ru: strikes: Замечания модерации two_factor_authentication: Подтверждение входа webauthn_authentication: Ключи безопасности + severed_relationships: + event_type: + user_domain_block: Вы заблокировали %{target_name} statuses: attached: audio: From 8827cd597e695c0368dfdce582755eda7f667272 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 24 Jun 2024 15:11:10 +0200 Subject: [PATCH 06/11] Fix `/admin/accounts/:account_id/statuses/:id` for edited posts with media attachments (#30819) --- app/models/status_edit.rb | 2 +- spec/controllers/admin/statuses_controller_spec.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/status_edit.rb b/app/models/status_edit.rb index 50dabb91f5bc46..089c42fb99493d 100644 --- a/app/models/status_edit.rb +++ b/app/models/status_edit.rb @@ -42,7 +42,7 @@ class PreservedMediaAttachment < ActiveModelSerializers::Model scope :ordered, -> { order(id: :asc) } delegate :local?, :application, :edited?, :edited_at, - :discarded?, :visibility, to: :status + :discarded?, :visibility, :language, to: :status def emojis return @emojis if defined?(@emojis) diff --git a/spec/controllers/admin/statuses_controller_spec.rb b/spec/controllers/admin/statuses_controller_spec.rb index 4e8bf9ead68d51..4144d97d64d666 100644 --- a/spec/controllers/admin/statuses_controller_spec.rb +++ b/spec/controllers/admin/statuses_controller_spec.rb @@ -44,6 +44,11 @@ describe 'GET #show' do before do + status.media_attachments << Fabricate(:media_attachment, type: :image, account: status.account) + status.save! + status.snapshot!(at_time: status.created_at, rate_limit: false) + status.update!(text: 'Hello, this is an edited post') + status.snapshot!(rate_limit: false) get :show, params: { account_id: account.id, id: status.id } end From f6e466058a5a70eba5001c7ad3a80d86c07eb25d Mon Sep 17 00:00:00 2001 From: Tim Rogers Date: Mon, 24 Jun 2024 09:41:04 -0500 Subject: [PATCH 07/11] Added check for STATSD_ADDR setting to emit a warning and proceed rather than crashing if the address is unreachable (#30691) --- config/initializers/statsd.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/config/initializers/statsd.rb b/config/initializers/statsd.rb index a655c107165bad..f1628a9d12ca32 100644 --- a/config/initializers/statsd.rb +++ b/config/initializers/statsd.rb @@ -3,13 +3,17 @@ if ENV['STATSD_ADDR'].present? host, port = ENV['STATSD_ADDR'].split(':') - statsd = Statsd.new(host, port) - statsd.namespace = ENV.fetch('STATSD_NAMESPACE') { ['Mastodon', Rails.env].join('.') } + begin + statsd = Statsd.new(host, port) + statsd.namespace = ENV.fetch('STATSD_NAMESPACE') { ['Mastodon', Rails.env].join('.') } - NSA.inform_statsd(statsd) do |informant| - informant.collect(:action_controller, :web) - informant.collect(:active_record, :db) - informant.collect(:active_support_cache, :cache) - informant.collect(:sidekiq, :sidekiq) if ENV['STATSD_SIDEKIQ'] == 'true' + NSA.inform_statsd(statsd) do |informant| + informant.collect(:action_controller, :web) + informant.collect(:active_record, :db) + informant.collect(:active_support_cache, :cache) + informant.collect(:sidekiq, :sidekiq) if ENV['STATSD_SIDEKIQ'] == 'true' + end + rescue + Rails.logger.warn("statsd address #{ENV['STATSD_ADDR']} not reachable, proceeding without statsd") end end From 39d80e84be660e6d3eb121ee8f1067bd87cc3783 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 24 Jun 2024 10:47:14 -0400 Subject: [PATCH 08/11] Remove `lockfileMaintenance` setting (#30799) --- .github/renovate.json5 | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 03787dfac6c21b..2cf7bec8eebd21 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -14,9 +14,6 @@ // to `null` after any other rule set it to something. dependencyDashboardHeader: 'This issue lists Renovate updates and detected dependencies. Read the [Dependency Dashboard](https://docs.renovatebot.com/key-concepts/dashboard/) docs to learn more. Before approving any upgrade: read the description and comments in the [`renovate.json5` file](https://github.com/mastodon/mastodon/blob/main/.github/renovate.json5).', postUpdateOptions: ['yarnDedupeHighest'], - lockFileMaintenance: { - enabled: true, - }, packageRules: [ { // Require Dependency Dashboard Approval for major version bumps of these node packages From 6527d5039141fe4a80645147b581d76952a64f39 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 24 Jun 2024 10:50:37 -0400 Subject: [PATCH 09/11] Disable `Rails/BulkChangeTable` cop (#30820) --- .rubocop/rails.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.rubocop/rails.yml b/.rubocop/rails.yml index 68c90143a692be..ae31c1f266142e 100644 --- a/.rubocop/rails.yml +++ b/.rubocop/rails.yml @@ -1,4 +1,7 @@ --- +Rails/BulkChangeTable: + Enabled: false # Conflicts with strong_migrations features + Rails/FilePath: EnforcedStyle: arguments From 6551f7e9459ae9f3e3dd814dd40e7a07d9fd95ed Mon Sep 17 00:00:00 2001 From: hackal Date: Wed, 31 Jul 2024 13:56:15 +0200 Subject: [PATCH 10/11] add workflow files --- .callstack.yaml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/reviewer.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .callstack.yaml create mode 100644 .github/workflows/reviewer.yml diff --git a/.callstack.yaml b/.callstack.yaml new file mode 100644 index 00000000000000..86c51ee6766b1d --- /dev/null +++ b/.callstack.yaml @@ -0,0 +1,32 @@ +# yaml-language-server: $schema=https://storage.googleapis.com/config-schema/schema.v2.json + +pr_review: + modules: + bug_hunter: + enabled: true + suggestions: true + + code_suggestions: + enabled: false + + code_conventions: + enabled: false + conventions: | + Exported code should be defined before internal code. + + description: + enabled: true + diagram: true + + grammar: + enabled: true + + performance: + enabled: true + + security: + enabled: true + + exclude: + - "**/go.*" + diff --git a/.github/workflows/reviewer.yml b/.github/workflows/reviewer.yml new file mode 100644 index 00000000000000..07d4ea5f2f605a --- /dev/null +++ b/.github/workflows/reviewer.yml @@ -0,0 +1,34 @@ +name: Cal PR Review + +on: + workflow_dispatch: + inputs: + config: + type: string + description: "config for reviewer" + required: true + head: + type: string + description: "head commit sha" + required: true + base: + type: string + description: "base commit sha" + required: false +jobs: + review: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ inputs.head }} + + - name: Run reviewer + uses: addnab/docker-run-action@v3 + with: + image: callstackai/cal:latest + options: -v ${{ github.workspace }}:/code + run: | + /reviewer --dir /code --id ${{ github.run_id }} --token ${{ github.token }} --config "${{ inputs.config }}" + From b83239b7f9f19bbc35bdddcf4559677468cac496 Mon Sep 17 00:00:00 2001 From: Adam Pavlisin Date: Wed, 31 Jul 2024 14:24:40 +0200 Subject: [PATCH 11/11] Update statsd.rb --- config/initializers/statsd.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/statsd.rb b/config/initializers/statsd.rb index f1628a9d12ca32..ab1243ff2d3754 100644 --- a/config/initializers/statsd.rb +++ b/config/initializers/statsd.rb @@ -7,7 +7,7 @@ statsd = Statsd.new(host, port) statsd.namespace = ENV.fetch('STATSD_NAMESPACE') { ['Mastodon', Rails.env].join('.') } - NSA.inform_statsd(statsd) do |informant| + NSA.informant_collect(statsd) do |informant| informant.collect(:action_controller, :web) informant.collect(:active_record, :db) informant.collect(:active_support_cache, :cache)