Merge commit 'a7264a2b42631bd876d114b96f689492e2908a8d' into glitch-soc/merge-upstream

Conflicts:
- `app/views/layouts/application.html.haml`:
  Conflict because of glitch-soc's different theming system.
  Ported upstream's change.
pull/2744/head
Claire 2024-06-17 18:14:14 +02:00
commit 8089fa6935
31 changed files with 132 additions and 31 deletions

View File

@ -47,4 +47,4 @@ jobs:
- name: Run brakeman
if: always() # Run both checks, even if the first failed
run: bundle exec brakeman
run: bin/brakeman

View File

@ -17,7 +17,7 @@ jobs:
steps:
- name: Check for merge conflicts
uses: eps1lon/actions-label-merge-conflict@releases/2.x
uses: eps1lon/actions-label-merge-conflict@v3
with:
dirtyLabel: 'rebase needed :construction:'
repoToken: '${{ secrets.GITHUB_TOKEN }}'

View File

@ -48,8 +48,6 @@ ENV \
# Apply Mastodon version information
MASTODON_VERSION_PRERELEASE="${MASTODON_VERSION_PRERELEASE}" \
MASTODON_VERSION_METADATA="${MASTODON_VERSION_METADATA}" \
# Enable libvips
MASTODON_USE_LIBVIPS=true \
# Apply Mastodon static files and YJIT options
RAILS_SERVE_STATIC_FILES=${RAILS_SERVE_STATIC_FILES} \
RUBY_YJIT_ENABLE=${RUBY_YJIT_ENABLE} \
@ -67,7 +65,9 @@ ENV \
DEBIAN_FRONTEND="noninteractive" \
PATH="${PATH}:/opt/ruby/bin:/opt/mastodon/bin" \
# Optimize jemalloc 5.x performance
MALLOC_CONF="narenas:2,background_thread:true,thp:never,dirty_decay_ms:1000,muzzy_decay_ms:0"
MALLOC_CONF="narenas:2,background_thread:true,thp:never,dirty_decay_ms:1000,muzzy_decay_ms:0" \
# Enable libvips, should not be changed
MASTODON_USE_LIBVIPS=true
# Set default shell used for running commands
SHELL ["/bin/bash", "-o", "pipefail", "-o", "errexit", "-c"]
@ -104,7 +104,6 @@ RUN \
curl \
ffmpeg \
file \
libvips42 \
libjemalloc2 \
patchelf \
procps \
@ -138,18 +137,31 @@ RUN \
--mount=type=cache,id=apt-lib-${TARGETPLATFORM},target=/var/lib/apt,sharing=locked \
# Install build tools and bundler dependencies from APT
apt-get install -y --no-install-recommends \
g++ \
gcc \
build-essential \
git \
libgdbm-dev \
libglib2.0-dev \
libgmp-dev \
libicu-dev \
libidn-dev \
libpq-dev \
libssl-dev \
make \
meson \
pkg-config \
shared-mime-info \
zlib1g-dev \
# libvips components
libcgif-dev \
libexif-dev \
libexpat1-dev \
libgirepository1.0-dev \
libheif-dev \
libimagequant-dev \
libjpeg62-turbo-dev \
liblcms2-dev \
liborc-dev \
libspng-dev \
libtiff-dev \
libwebp-dev \
;
RUN \
@ -158,6 +170,26 @@ RUN \
corepack enable; \
corepack prepare --activate;
# Create temporary libvips specific build layer from build layer
FROM build as libvips
# libvips version to compile, change with [--build-arg VIPS_VERSION="8.15.2"]
# renovate: datasource=github-releases depName=libvips packageName=libvips/libvips
ARG VIPS_VERSION=8.15.2
# libvips download URL, change with [--build-arg VIPS_URL="https://github.com/libvips/libvips/releases/download"]
ARG VIPS_URL=https://github.com/libvips/libvips/releases/download
WORKDIR /usr/local/libvips/src
RUN \
curl -sSL -o vips-${VIPS_VERSION}.tar.xz ${VIPS_URL}/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.xz; \
tar xf vips-${VIPS_VERSION}.tar.xz; \
cd vips-${VIPS_VERSION}; \
meson setup build --prefix /usr/local/libvips --libdir=lib -Ddeprecated=false -Dintrospection=disabled -Dmodules=disabled -Dexamples=false; \
cd build; \
ninja; \
ninja install;
# Create temporary bundler specific build layer from build layer
FROM build as bundler
@ -207,10 +239,14 @@ COPY . /opt/mastodon/
COPY --from=yarn /opt/mastodon /opt/mastodon/
COPY --from=bundler /opt/mastodon /opt/mastodon/
COPY --from=bundler /usr/local/bundle/ /usr/local/bundle/
# Copy libvips components to layer for precompiler
COPY --from=libvips /usr/local/libvips/bin /usr/local/bin
COPY --from=libvips /usr/local/libvips/lib /usr/local/lib
ARG TARGETPLATFORM
RUN \
ldconfig; \
# Use Ruby on Rails to create Mastodon assets
SECRET_KEY_BASE_DUMMY=1 \
bundle exec rails assets:precompile; \
@ -232,12 +268,27 @@ RUN \
--mount=type=cache,id=yarn-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/yarn,sharing=locked \
# Apt update install non-dev versions of necessary components
apt-get install -y --no-install-recommends \
libssl3 \
libpq5 \
libexpat1 \
libglib2.0-0 \
libicu72 \
libidn12 \
libpq5 \
libreadline8 \
libssl3 \
libyaml-0-2 \
# libvips components
libcgif0 \
libexif12 \
libheif1 \
libimagequant0 \
libjpeg62-turbo \
liblcms2-2 \
liborc-0.4-0 \
libspng0 \
libtiff6 \
libwebp7 \
libwebpdemux2 \
libwebpmux3 \
;
# Copy Mastodon sources into final layer
@ -248,9 +299,17 @@ COPY --from=precompiler /opt/mastodon/public/packs /opt/mastodon/public/packs
COPY --from=precompiler /opt/mastodon/public/assets /opt/mastodon/public/assets
# Copy bundler components to layer
COPY --from=bundler /usr/local/bundle/ /usr/local/bundle/
# Copy libvips components to layer
COPY --from=libvips /usr/local/libvips/bin /usr/local/bin
COPY --from=libvips /usr/local/libvips/lib /usr/local/lib
RUN \
# Precompile bootsnap code for faster Rails startup
ldconfig; \
# Smoketest media processors
vips -v;
RUN \
# Precompile bootsnap code for faster Rails startup
bundle exec bootsnap precompile --gemfile app/ lib/;
RUN \

View File

@ -109,7 +109,7 @@ GEM
aws-sdk-kms (1.83.0)
aws-sdk-core (~> 3, >= 3.197.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.152.2)
aws-sdk-s3 (1.152.3)
aws-sdk-core (~> 3, >= 3.197.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
@ -445,7 +445,7 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.16.5)
nokogiri (1.16.6)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nsa (0.3.0)

View File

@ -15,15 +15,15 @@ module Admin::ActionLogsHelper
link_to log.human_identifier, admin_roles_path(log.target_id)
when 'Report'
link_to "##{log.human_identifier.presence || log.target_id}", admin_report_path(log.target_id)
when 'DomainBlock', 'DomainAllow', 'EmailDomainBlock', 'UnavailableDomain'
link_to log.human_identifier, "https://#{log.human_identifier.presence}"
when 'Instance', 'DomainBlock', 'DomainAllow', 'UnavailableDomain'
log.human_identifier.present? ? link_to(log.human_identifier, admin_instance_path(log.human_identifier)) : I18n.t('admin.action_logs.unavailable_instance')
when 'Status'
link_to log.human_identifier, log.permalink
when 'AccountWarning'
link_to log.human_identifier, disputes_strike_path(log.target_id)
when 'Announcement'
link_to truncate(log.human_identifier), edit_admin_announcement_path(log.target_id)
when 'IpBlock', 'Instance', 'CustomEmoji'
when 'IpBlock', 'EmailDomainBlock', 'CustomEmoji'
log.human_identifier
when 'CanonicalEmailBlock'
content_tag(:samp, (log.human_identifier.presence || '')[0...7], title: log.human_identifier)

View File

@ -110,18 +110,6 @@ class LanguageDropdownMenu extends PureComponent {
}).map(result => result.obj);
}
frequentlyUsed () {
const { languages, value } = this.props;
const current = languages.find(lang => lang[0] === value);
const results = [];
if (current) {
results.push(current);
}
return results;
}
handleClick = e => {
const value = e.currentTarget.getAttribute('data-index');

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Aquest perfil l'han amagat els moderadors de {domain}.",
"link_preview.author": "Per {name}",
"link_preview.more_from_author": "Més de {name}",
"link_preview.shares": "{count, plural, one {{counter} publicació} other {{counter} publicacions}}",
"lists.account.add": "Afegeix a la llista",
"lists.account.remove": "Elimina de la llista",
"lists.delete": "Elimina la llista",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Denne profil er blevet skjult af {domain}-moderatorerne.",
"link_preview.author": "Af {name}",
"link_preview.more_from_author": "Mere fra {name}",
"link_preview.shares": "{count, plural, one {{counter} indlæg} other {{counter} indlæg}}",
"lists.account.add": "Føj til liste",
"lists.account.remove": "Fjern fra liste",
"lists.delete": "Slet liste",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Dieses Profil wurde von den Moderator*innen von {domain} ausgeblendet.",
"link_preview.author": "Von {name}",
"link_preview.more_from_author": "Mehr von {name}",
"link_preview.shares": "{count, plural, one {{counter} Beitrag} other {{counter} Beiträge}}",
"lists.account.add": "Zur Liste hinzufügen",
"lists.account.remove": "Von der Liste entfernen",
"lists.delete": "Liste löschen",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Este perfil fue ocultado por los moderadores de {domain}.",
"link_preview.author": "Por {name}",
"link_preview.more_from_author": "Más de {name}",
"link_preview.shares": "{count, plural, one {{counter} mensaje} other {{counter} mensajes}}",
"lists.account.add": "Agregar a lista",
"lists.account.remove": "Quitar de lista",
"lists.delete": "Eliminar lista",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Este perfil ha sido ocultado por los moderadores de {domain}.",
"link_preview.author": "Por {name}",
"link_preview.more_from_author": "Más de {name}",
"link_preview.shares": "{count, plural, one {{counter} publicación} other {{counter} publicaciones}}",
"lists.account.add": "Añadir a lista",
"lists.account.remove": "Quitar de lista",
"lists.delete": "Borrar lista",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Este perfil ha sido ocultado por los moderadores de {domain}.",
"link_preview.author": "Por {name}",
"link_preview.more_from_author": "Más de {name}",
"link_preview.shares": "{count, plural, one {{counter} publicación} other {{counter} publicaciones}}",
"lists.account.add": "Añadir a lista",
"lists.account.remove": "Quitar de lista",
"lists.delete": "Borrar lista",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Palvelimen {domain} valvojat ovat piilottaneet tämän käyttäjätilin.",
"link_preview.author": "Julkaissut {name}",
"link_preview.more_from_author": "Lisää käyttäjältä {name}",
"link_preview.shares": "{count, plural, one {{counter} julkaisu} other {{counter} julkaisua}}",
"lists.account.add": "Lisää listalle",
"lists.account.remove": "Poista listalta",
"lists.delete": "Poista lista",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Hesin vangin er fjaldur av kjakleiðarunum á {domain}.",
"link_preview.author": "Av {name}",
"link_preview.more_from_author": "Meira frá {name}",
"link_preview.shares": "{count, plural, one {{counter} postur} other {{counter} postar}}",
"lists.account.add": "Legg afturat lista",
"lists.account.remove": "Tak av lista",
"lists.delete": "Strika lista",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Este perfil foi agochado pola moderación de {domain}.",
"link_preview.author": "Por {name}",
"link_preview.more_from_author": "Máis de {name}",
"link_preview.shares": "{count, plural, one {{counter} publicación} other {{counter} publicacións}}",
"lists.account.add": "Engadir á listaxe",
"lists.account.remove": "Eliminar da listaxe",
"lists.delete": "Eliminar listaxe",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Þetta notandasnið hefur verið falið af umsjónarmönnum {domain}.",
"link_preview.author": "Eftir {name}",
"link_preview.more_from_author": "Meira frá {name}",
"link_preview.shares": "{count, plural, one {{counter} færsla} other {{counter} færslur}}",
"lists.account.add": "Bæta á lista",
"lists.account.remove": "Fjarlægja af lista",
"lists.delete": "Eyða lista",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Questo profilo è stato nascosto dai moderatori di {domain}.",
"link_preview.author": "Di {name}",
"link_preview.more_from_author": "Altro da {name}",
"link_preview.shares": "{count, plural,one {{counter} post}other {{counter} post}}",
"lists.account.add": "Aggiungi all'elenco",
"lists.account.remove": "Rimuovi dall'elenco",
"lists.delete": "Elimina elenco",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Dit profiel is door de moderatoren van {domain} verborgen.",
"link_preview.author": "Door {name}",
"link_preview.more_from_author": "Meer van {name}",
"link_preview.shares": "{count, plural, one {{counter} bericht} other {{counter} berichten}}",
"lists.account.add": "Aan lijst toevoegen",
"lists.account.remove": "Uit lijst verwijderen",
"lists.delete": "Lijst verwijderen",

View File

@ -414,6 +414,8 @@
"limited_account_hint.action": "Vis profilen likevel",
"limited_account_hint.title": "Denne profilen er skjult av moderatorane på {domain}.",
"link_preview.author": "Av {name}",
"link_preview.more_from_author": "Meir frå {name}",
"link_preview.shares": "{count, plural,one {{counter} innlegg} other {{counter} innlegg}}",
"lists.account.add": "Legg til i liste",
"lists.account.remove": "Fjern frå liste",
"lists.delete": "Slett liste",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Ten profil został ukryty przez moderatorów {domain}.",
"link_preview.author": "{name}",
"link_preview.more_from_author": "Więcej od {name}",
"link_preview.shares": "{count, plural, one {{counter} wpis} few {{counter} wpisy} many {{counter} wpisów} other {{counter} wpisów}}",
"lists.account.add": "Dodaj do listy",
"lists.account.remove": "Usunąć z listy",
"lists.delete": "Usuń listę",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Este perfil foi ocultado pelos moderadores de {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": "Eliminar lista",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Profil so moderatorji strežnika {domain} skrili.",
"link_preview.author": "Avtor_ica {name}",
"link_preview.more_from_author": "Več od {name}",
"link_preview.shares": "{count, plural, one {{counter} objava} two {{counter} objavi} few {{counter} objave} other {{counter} objav}}",
"lists.account.add": "Dodaj na seznam",
"lists.account.remove": "Odstrani s seznama",
"lists.delete": "Izbriši seznam",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "Denna profil har dolts av {domain}s moderatorer.",
"link_preview.author": "Av {name}",
"link_preview.more_from_author": "Mer från {name}",
"link_preview.shares": "{count, plural, one {{counter} inlägg} other {{counter} inlägg}}",
"lists.account.add": "Lägg till i lista",
"lists.account.remove": "Ta bort från lista",
"lists.delete": "Radera lista",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "此账号资料已被 {domain} 管理员隐藏。",
"link_preview.author": "由 {name}",
"link_preview.more_from_author": "查看 {name} 的更多内容",
"link_preview.shares": "{count, plural, other {{counter} 条嘟文}}",
"lists.account.add": "添加到列表",
"lists.account.remove": "从列表中移除",
"lists.delete": "删除列表",

View File

@ -415,6 +415,7 @@
"limited_account_hint.title": "此個人檔案已被 {domain} 的管理員隱藏。",
"link_preview.author": "來自 {name}",
"link_preview.more_from_author": "來自 {name} 之更多內容",
"link_preview.shares": "{count, plural, other {{count} 則嘟文}}",
"lists.account.add": "新增至列表",
"lists.account.remove": "自列表中移除",
"lists.delete": "刪除列表",

View File

@ -30,7 +30,7 @@
= theme_style_tags current_theme
-# Needed for the wicg-inert polyfill. It needs to be on it's own <style> tag, with this `id`
= flavoured_stylesheet_pack_tag 'inert', media: 'all', id: 'inert-style'
= flavoured_stylesheet_pack_tag 'inert', media: 'all', crossorigin: 'anonymous', id: 'inert-style'
= javascript_pack_tag 'common', crossorigin: 'anonymous'
= preload_locale_pack

27
bin/brakeman Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'brakeman' is installed as part of a gem, and
# this file is here to facilitate running it.
#
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
bundle_binstub = File.expand_path("bundle", __dir__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "rubygems"
require "bundler/setup"
load Gem.bin_path("brakeman", "brakeman")

View File

@ -135,6 +135,7 @@ fr-CA:
media: Fichiers médias
mutes: Masqués
notifications: Notifications
profile: Votre profil Mastodon
push: Notifications push
reports: Signalements
search: Recherche
@ -165,6 +166,7 @@ fr-CA:
admin:write:reports: effectuer des actions de modération sur les signalements
crypto: utiliser le chiffrement de bout-en-bout
follow: modifier les relations du compte
profile: lire uniquement les informations de votre compte
push: recevoir vos notifications poussées
read: lire toutes les données de votre compte
read:accounts: voir les informations des comptes

View File

@ -135,6 +135,7 @@ fr:
media: Fichiers médias
mutes: Masqués
notifications: Notifications
profile: Votre profil Mastodon
push: Notifications push
reports: Signalements
search: Recherche
@ -165,6 +166,7 @@ fr:
admin:write:reports: effectuer des actions de modération sur les signalements
crypto: utiliser le chiffrement de bout-en-bout
follow: modifier les relations du compte
profile: lire uniquement les informations de votre compte
push: recevoir vos notifications poussées
read: lire toutes les données de votre compte
read:accounts: voir les informations des comptes

View File

@ -135,6 +135,7 @@ nn:
media: Mediavedlegg
mutes: Dempingar
notifications: Varsel
profile: Mastodon-profilen din
push: Pushvarsel
reports: Rapportar
search: Søk
@ -165,6 +166,7 @@ nn:
admin:write:reports: utføre moderatorhandlingar på rapportar
crypto: bruk ende-til-ende-kryptering
follow: fylg, blokkér, avblokkér, avfylg brukarar
profile: les berre den grunnlejggande informasjonen til brukarkontoen din
push: motta pushvarsla dine
read: lese alle dine kontodata
read:accounts: sjå informasjon om kontoar

View File

@ -293,6 +293,7 @@ en:
filter_by_action: Filter by action
filter_by_user: Filter by user
title: Audit log
unavailable_instance: "(domain name unavailable)"
announcements:
destroyed_msg: Announcement successfully deleted!
edit: