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

Head2 #4

Open
wants to merge 11 commits into
base: base2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
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
32 changes: 32 additions & 0 deletions .callstack.yaml
Original file line number Diff line number Diff line change
@@ -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.*"

3 changes: 0 additions & 3 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/reviewer.yml
Original file line number Diff line number Diff line change
@@ -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 }}"

6 changes: 3 additions & 3 deletions .rubocop/rails.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
Rails/BulkChangeTable:
Enabled: false # Conflicts with strong_migrations features

Rails/FilePath:
EnforcedStyle: arguments

Expand All @@ -18,6 +21,3 @@ Rails/RakeEnvironment:

Rails/SkipsModelValidations:
Enabled: false

Rails/UnusedIgnoredColumns:
Enabled: false # Preserve ability to migrate from arbitrary old versions
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions app/javascript/mastodon/locales/fil.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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:",
Expand Down Expand Up @@ -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?",
Expand Down
4 changes: 4 additions & 0 deletions app/javascript/mastodon/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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}",
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down
2 changes: 1 addition & 1 deletion app/models/status_edit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 11 additions & 7 deletions config/initializers/statsd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions config/locales/doorkeeper.pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions config/locales/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1699,13 +1699,17 @@ ru:
import: Импорт
import_and_export: Импорт и экспорт
migrate: Миграция учётной записи
notifications: Уведомления по электронной почте
preferences: Настройки
profile: Профиль
relationships: Подписки и подписчики
statuses_cleanup: Авто-удаление постов
strikes: Замечания модерации
two_factor_authentication: Подтверждение входа
webauthn_authentication: Ключи безопасности
severed_relationships:
event_type:
user_domain_block: Вы заблокировали %{target_name}
statuses:
attached:
audio:
Expand Down
5 changes: 5 additions & 0 deletions spec/controllers/admin/statuses_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion streaming/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
4 changes: 2 additions & 2 deletions streaming/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down
Loading