Merge branch 'fork' into backend-new

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-11-17 01:14:37 +01:00
commit 9f5325727e
36 changed files with 220 additions and 70 deletions

View file

@ -0,0 +1 @@
Add metadata provider for ActivityPub alternate links

View file

@ -0,0 +1 @@
Dedupe upload filter now uses a three-level sharding directory structure

View file

View file

View file

@ -0,0 +1 @@
Fix /api/v2/media returning the wrong status code (202) for media processed synchronously

View file

@ -0,0 +1 @@
Tuning for release builds to lower CPU usage.

View file

@ -0,0 +1 @@
Fix nonexisting user will not generate metadata for search engine opt-out

View file

@ -0,0 +1 @@
Include session scopes in TokenView

View file

@ -0,0 +1 @@
Make vapid_config return empty array, fixing preloading for instances without push notifications configured

View file

@ -31,7 +31,7 @@ Setup the required services to automatically start at boot, using `sysrc(8)`.
### Install media / graphics packages (optional, see [`docs/installation/optional/media_graphics_packages.md`](../installation/optional/media_graphics_packages.md)) ### Install media / graphics packages (optional, see [`docs/installation/optional/media_graphics_packages.md`](../installation/optional/media_graphics_packages.md))
```shell ```shell
# pkg install imagemagick ffmpeg p5-Image-ExifTool # pkg install imagemagick ffmpeg p5-Image-ExifTool vips
``` ```
## Configuring Pleroma ## Configuring Pleroma

View file

@ -12,7 +12,7 @@ For any additional information regarding commands and configuration files mentio
To install them, run the following command (with doas or as root): To install them, run the following command (with doas or as root):
``` ```
pkg_add elixir gmake git postgresql-server postgresql-contrib cmake ffmpeg ImageMagick pkg_add elixir gmake git postgresql-server postgresql-contrib cmake ffmpeg ImageMagick libvips
``` ```
Pleroma requires a reverse proxy, OpenBSD has relayd in base (and is used in this guide) and packages/ports are available for nginx (www/nginx) and apache (www/apache-httpd). Independently of the reverse proxy, [acme-client(1)](https://man.openbsd.org/acme-client) can be used to get a certificate from Let's Encrypt. Pleroma requires a reverse proxy, OpenBSD has relayd in base (and is used in this guide) and packages/ports are available for nginx (www/nginx) and apache (www/apache-httpd). Independently of the reverse proxy, [acme-client(1)](https://man.openbsd.org/acme-client) can be used to get a certificate from Let's Encrypt.

View file

@ -18,7 +18,7 @@ Matrix-kanava #pleroma:libera.chat ovat hyviä paikkoja löytää apua
Asenna tarvittava ohjelmisto: Asenna tarvittava ohjelmisto:
`# pkg_add git elixir gmake postgresql-server-10.3 postgresql-contrib-10.3 cmake ffmpeg ImageMagick` `# pkg_add git elixir gmake postgresql-server-10.3 postgresql-contrib-10.3 cmake ffmpeg ImageMagick libvips`
#### Optional software #### Optional software

View file

@ -17,8 +17,16 @@ def filter(%Upload{name: name, tempfile: tempfile} = upload) do
|> Base.encode16(case: :lower) |> Base.encode16(case: :lower)
filename = shasum <> "." <> extension filename = shasum <> "." <> extension
{:ok, :filtered, %Upload{upload | id: shasum, path: filename}}
{:ok, :filtered, %Upload{upload | id: shasum, path: shard_path(filename)}}
end end
def filter(_), do: {:ok, :noop} def filter(_), do: {:ok, :noop}
@spec shard_path(String.t()) :: String.t()
def shard_path(
<<a::binary-size(2), b::binary-size(2), c::binary-size(2), _::binary>> = filename
) do
Path.join([a, b, c, filename])
end
end end

View file

@ -141,7 +141,7 @@ def create2_operation do
security: [%{"oAuth" => ["write:media"]}], security: [%{"oAuth" => ["write:media"]}],
requestBody: Helpers.request_body("Parameters", create_request()), requestBody: Helpers.request_body("Parameters", create_request()),
responses: %{ responses: %{
202 => Operation.response("Media", "application/json", Attachment), 200 => Operation.response("Media", "application/json", Attachment),
400 => Operation.response("Media", "application/json", ApiError), 400 => Operation.response("Media", "application/json", ApiError),
422 => Operation.response("Media", "application/json", ApiError), 422 => Operation.response("Media", "application/json", ApiError),
500 => Operation.response("Media", "application/json", ApiError) 500 => Operation.response("Media", "application/json", ApiError)

View file

@ -46,7 +46,7 @@ def redirector_with_meta(conn, %{"maybe_nickname_or_id" => maybe_nickname_or_id}
redirector_with_meta(conn, %{user: user}) redirector_with_meta(conn, %{user: user})
else else
nil -> nil ->
redirector(conn, params) redirector_with_meta(conn, Map.delete(params, "maybe_nickname_or_id"))
end end
end end

View file

@ -17,11 +17,11 @@ defmodule Pleroma.Web.Feed.UserController do
action_fallback(:errors) action_fallback(:errors)
def feed_redirect(%{assigns: %{format: "html"}} = conn, %{"nickname" => nickname}) do def feed_redirect(%{assigns: %{format: "html"}} = conn, %{"nickname" => nickname} = params) do
with {_, %User{} = user} <- {:fetch_user, User.get_cached_by_nickname_or_id(nickname)} do with {_, %User{} = user} <- {:fetch_user, User.get_cached_by_nickname_or_id(nickname)} do
Pleroma.Web.Fallback.RedirectController.redirector_with_meta(conn, %{user: user}) Pleroma.Web.Fallback.RedirectController.redirector_with_meta(conn, %{user: user})
else else
_ -> Pleroma.Web.Fallback.RedirectController.redirector(conn, nil) _ -> Pleroma.Web.Fallback.RedirectController.redirector_with_meta(conn, params)
end end
end end

View file

@ -84,9 +84,7 @@ def create2(
) do ) do
attachment_data = Map.put(object.data, "id", object.id) attachment_data = Map.put(object.data, "id", object.id)
conn render(conn, "attachment.json", %{attachment: attachment_data})
|> put_status(202)
|> render("attachment.json", %{attachment: attachment_data})
else else
{:valid_locale, _} -> {:valid_locale, _} ->
render_error(conn, 422, "valid language must be provided with description_map") render_error(conn, 422, "valid language must be provided with description_map")

View file

@ -79,9 +79,8 @@ def render("show2.json", _) do
account: contact_account(Keyword.get(instance, :contact_username)) account: contact_account(Keyword.get(instance, :contact_username))
}, },
api_versions: %{ api_versions: %{
"mastodon" => 2137, "mastodon" => 0,
"social.pleroma" => 420, "pl.mkljczk.pl" => 1
"pl.mkljczk.pl" => 69
}, },
# Extra (not present in Mastodon): # Extra (not present in Mastodon):
pleroma: pleroma_configuration2(instance) pleroma: pleroma_configuration2(instance)

View file

@ -7,6 +7,7 @@ defmodule Pleroma.Web.Metadata do
def build_tags(params) do def build_tags(params) do
providers = [ providers = [
Pleroma.Web.Metadata.Providers.ActivityPub,
Pleroma.Web.Metadata.Providers.RelMe, Pleroma.Web.Metadata.Providers.RelMe,
Pleroma.Web.Metadata.Providers.RestrictIndexing Pleroma.Web.Metadata.Providers.RestrictIndexing
| activated_providers() | activated_providers()

View file

@ -0,0 +1,22 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2024 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Metadata.Providers.ActivityPub do
alias Pleroma.Web.Metadata.Providers.Provider
@behaviour Provider
@impl Provider
def build_tags(%{object: %{data: %{"id" => object_id}}}) do
[{:link, [rel: "alternate", type: "application/activity+json", href: object_id], []}]
end
@impl Provider
def build_tags(%{user: user}) do
[{:link, [rel: "alternate", type: "application/activity+json", href: user.ap_id], []}]
end
@impl Provider
def build_tags(_), do: []
end

View file

@ -21,5 +21,6 @@ def build_tags(%{user: %{local: true} = user}) do
] ]
end end
@impl Provider
def build_tags(_), do: [] def build_tags(_), do: []
end end

View file

@ -67,6 +67,9 @@ def build_tags(%{user: user}) do
end end
end end
@impl Provider
def build_tags(_), do: []
defp build_attachments(%{data: %{"attachment" => attachments}}) do defp build_attachments(%{data: %{"attachment" => attachments}}) do
Enum.reduce(attachments, [], fn attachment, acc -> Enum.reduce(attachments, [], fn attachment, acc ->
rendered_tags = rendered_tags =

View file

@ -20,6 +20,9 @@ def build_tags(%{user: user}) do
end) end)
end end
@impl Provider
def build_tags(_), do: []
defp append_fields_tag(bio, fields) do defp append_fields_tag(bio, fields) do
fields fields
|> Enum.reduce(bio, fn %{"value" => v}, res -> res <> v end) |> Enum.reduce(bio, fn %{"value" => v}, res -> res <> v end)

View file

@ -44,6 +44,9 @@ def build_tags(%{user: user}) do
end end
end end
@impl Provider
def build_tags(_), do: []
defp title_tag(user) do defp title_tag(user) do
{:meta, [name: "twitter:title", content: Utils.user_name_string(user)], []} {:meta, [name: "twitter:title", content: Utils.user_name_string(user)], []}
end end

View file

@ -20,7 +20,7 @@ def init do
end end
def vapid_config do def vapid_config do
Application.get_env(:web_push_encryption, :vapid_details, nil) Application.get_env(:web_push_encryption, :vapid_details, [])
end end
def enabled, do: match?([subject: _, public_key: _, private_key: _], vapid_config()) def enabled, do: match?([subject: _, public_key: _, private_key: _], vapid_config())

View file

@ -15,7 +15,8 @@ def render("show.json", %{token: token_entry}) do
%{ %{
id: token_entry.id, id: token_entry.id,
valid_until: token_entry.valid_until, valid_until: token_entry.valid_until,
app_name: token_entry.app.client_name app_name: token_entry.app.client_name,
scopes: token_entry.scopes
} }
end end
end end

View file

@ -3,14 +3,16 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-22 02:09+0300\n" "POT-Creation-Date: 2022-07-22 02:09+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: 2024-10-13 21:03+0000\n"
"Last-Translator: Automatically generated\n" "Last-Translator: Codimp <contact@lithio.fr>\n"
"Language-Team: none\n" "Language-Team: French <https://translate.pleroma.social/projects/pleroma/"
"pleroma-backend-domain-config_descriptions/fr/>\n"
"Language: fr\n" "Language: fr\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Translate Toolkit 3.7.2\n" "Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.13.1\n"
## This file is a PO Template file. ## This file is a PO Template file.
## ##
@ -21,7 +23,6 @@ msgstr ""
## Run "mix gettext.extract" to bring this file up to ## Run "mix gettext.extract" to bring this file up to
## date. Leave "msgstr"s empty as changing them here has no ## date. Leave "msgstr"s empty as changing them here has no
## effect: edit them in PO (.po) files instead. ## effect: edit them in PO (.po) files instead.
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :esshd" msgctxt "config description at :esshd"
@ -32,25 +33,30 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :logger" msgctxt "config description at :logger"
msgid "Logger-related settings" msgid "Logger-related settings"
msgstr "" msgstr "Paramètres liés à la journalisation"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :mime" msgctxt "config description at :mime"
msgid "Mime Types settings" msgid "Mime Types settings"
msgstr "" msgstr "Paramètres des types Mime"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma" msgctxt "config description at :pleroma"
msgid "Allows setting a token that can be used to authenticate requests with admin privileges without a normal user account token. Append the `admin_token` parameter to requests to utilize it. (Please reconsider using HTTP Basic Auth or OAuth-based authentication if possible)" msgid "Allows setting a token that can be used to authenticate requests with admin privileges without a normal user account token. Append the `admin_token` parameter to requests to utilize it. (Please reconsider using HTTP Basic Auth or OAuth-based authentication if possible)"
msgstr "" msgstr ""
"Permet de configurer un jeton qui peut être utilisé pour authentifier les "
"requêtes avec des privilèges administrateurs sans utiliser un jeton de "
"compte utilisateur standard. Pour l'utiliser, ajoutez le paramètre "
"`admin_token`aux requêtes. (Vous devriez utiliser l'authentification HTTP "
"Basic ou OAuth à la place si vous le pouvez)"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma" msgctxt "config description at :pleroma"
msgid "Authenticator" msgid "Authenticator"
msgstr "" msgstr "Authentifieur"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
@ -62,7 +68,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config label at :cors_plug" msgctxt "config label at :cors_plug"
msgid "CORS plug config" msgid "CORS plug config"
msgstr "" msgstr "Configuration du plug CORS"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
@ -74,25 +80,25 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config label at :logger" msgctxt "config label at :logger"
msgid "Logger" msgid "Logger"
msgstr "" msgstr "Journaliseur"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config label at :mime" msgctxt "config label at :mime"
msgid "Mime Types" msgid "Mime Types"
msgstr "" msgstr "Types Mime"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config label at :pleroma" msgctxt "config label at :pleroma"
msgid "Pleroma Admin Token" msgid "Pleroma Admin Token"
msgstr "" msgstr "Jeton Administrateur Pleroma"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config label at :pleroma" msgctxt "config label at :pleroma"
msgid "Pleroma Authenticator" msgid "Pleroma Authenticator"
msgstr "" msgstr "Authentifieur Pleroma"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
@ -104,103 +110,111 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :logger-:console" msgctxt "config description at :logger-:console"
msgid "Console logger settings" msgid "Console logger settings"
msgstr "" msgstr "Paramètres de journalisation de la console"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :logger-:ex_syslogger" msgctxt "config description at :logger-:ex_syslogger"
msgid "ExSyslogger-related settings" msgid "ExSyslogger-related settings"
msgstr "" msgstr "Paramètres liés à ExSyslogger"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:activitypub" msgctxt "config description at :pleroma-:activitypub"
msgid "ActivityPub-related settings" msgid "ActivityPub-related settings"
msgstr "" msgstr "Paramètres liés à ActivityPub"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:assets" msgctxt "config description at :pleroma-:assets"
msgid "This section configures assets to be used with various frontends. Currently the only option relates to mascots on the mastodon frontend" msgid "This section configures assets to be used with various frontends. Currently the only option relates to mascots on the mastodon frontend"
msgstr "" msgstr ""
"Cette section configure les annexes (assets) à utiliser avec divers "
"frontaux. La seule option est actuellement liée au mascottes du frontal "
"mastodon"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:auth" msgctxt "config description at :pleroma-:auth"
msgid "Authentication / authorization settings" msgid "Authentication / authorization settings"
msgstr "" msgstr "Paramètres d'authentification/autorisations"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:connections_pool" msgctxt "config description at :pleroma-:connections_pool"
msgid "Advanced settings for `Gun` connections pool" msgid "Advanced settings for `Gun` connections pool"
msgstr "" msgstr "Paramètres avancés pour le bac (pool) de connexions `Gun`"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:email_notifications" msgctxt "config description at :pleroma-:email_notifications"
msgid "Email notifications settings" msgid "Email notifications settings"
msgstr "" msgstr "Paramètres de notification par email"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:features" msgctxt "config description at :pleroma-:features"
msgid "Customizable features" msgid "Customizable features"
msgstr "" msgstr "Fonctionnalités personnalisables"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:feed" msgctxt "config description at :pleroma-:feed"
msgid "Configure feed rendering" msgid "Configure feed rendering"
msgstr "" msgstr "Configurer le rendu des flux"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:frontend_configurations" msgctxt "config description at :pleroma-:frontend_configurations"
msgid "This form can be used to configure a keyword list that keeps the configuration data for any kind of frontend. By default, settings for pleroma_fe are configured. If you want to add your own configuration your settings all fields must be complete." msgid "This form can be used to configure a keyword list that keeps the configuration data for any kind of frontend. By default, settings for pleroma_fe are configured. If you want to add your own configuration your settings all fields must be complete."
msgstr "" msgstr ""
"Ce formulaire peut être utilisé pour configurer une liste de clés (keyword) "
"qui contiennent les données de configuration pour tout types de frontaux. "
"Par défaut, les paramètres pour pleroma_fe sont configurés. Si vous voulez "
"ajouter vos propres paramètres de configurations, tout les champs doivent "
"être remplis."
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:frontends" msgctxt "config description at :pleroma-:frontends"
msgid "Installed frontends management" msgid "Installed frontends management"
msgstr "" msgstr "Gestion des frontaux installés"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:gopher" msgctxt "config description at :pleroma-:gopher"
msgid "Gopher settings" msgid "Gopher settings"
msgstr "" msgstr "Paramètres Gopher"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:hackney_pools" msgctxt "config description at :pleroma-:hackney_pools"
msgid "Advanced settings for `Hackney` connections pools" msgid "Advanced settings for `Hackney` connections pools"
msgstr "" msgstr "Paramètres avancés pour les bacs (pool) de connexions `Hackney`"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:http" msgctxt "config description at :pleroma-:http"
msgid "HTTP settings" msgid "HTTP settings"
msgstr "" msgstr "Paramètres HTTP"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:http_security" msgctxt "config description at :pleroma-:http_security"
msgid "HTTP security settings" msgid "HTTP security settings"
msgstr "" msgstr "Paramètres de sécurité HTTP"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:instance" msgctxt "config description at :pleroma-:instance"
msgid "Instance-related settings" msgid "Instance-related settings"
msgstr "" msgstr "Paramètres liés à l'instance"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:instances_favicons" msgctxt "config description at :pleroma-:instances_favicons"
msgid "Control favicons for instances" msgid "Control favicons for instances"
msgstr "" msgstr "Gère les favicons des instances"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
@ -212,151 +226,177 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:majic_pool" msgctxt "config description at :pleroma-:majic_pool"
msgid "Majic/libmagic configuration" msgid "Majic/libmagic configuration"
msgstr "" msgstr "Configuration de majic/libmagic"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:manifest" msgctxt "config description at :pleroma-:manifest"
msgid "This section describe PWA manifest instance-specific values. Currently this option relate only for MastoFE." msgid "This section describe PWA manifest instance-specific values. Currently this option relate only for MastoFE."
msgstr "" msgstr ""
"Cette section décrit les valeurs spécifique à l'instance du manifeste PWA. "
"Actuellement, cette option ne concerne que MastoFE."
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:media_preview_proxy" msgctxt "config description at :pleroma-:media_preview_proxy"
msgid "Media preview proxy" msgid "Media preview proxy"
msgstr "" msgstr "Proxy de prévisualisation média"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:media_proxy" msgctxt "config description at :pleroma-:media_proxy"
msgid "Media proxy" msgid "Media proxy"
msgstr "" msgstr "Proxy média"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:modules" msgctxt "config description at :pleroma-:modules"
msgid "Custom Runtime Modules" msgid "Custom Runtime Modules"
msgstr "" msgstr "Modules Runtime Personalisés"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf" msgctxt "config description at :pleroma-:mrf"
msgid "General MRF settings" msgid "General MRF settings"
msgstr "" msgstr "Paramètres généraux MRF"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_activity_expiration" msgctxt "config description at :pleroma-:mrf_activity_expiration"
msgid "Adds automatic expiration to all local activities" msgid "Adds automatic expiration to all local activities"
msgstr "" msgstr "Ajoute une expiration automatique à toutes les activités locales"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_follow_bot" msgctxt "config description at :pleroma-:mrf_follow_bot"
msgid "Automatically follows newly discovered accounts." msgid "Automatically follows newly discovered accounts."
msgstr "" msgstr "Suivre automatiquement les comptes venant d'être découverts."
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_hashtag" msgctxt "config description at :pleroma-:mrf_hashtag"
msgid "Reject, TWKN-remove or Set-Sensitive messsages with specific hashtags (without the leading #)\n\nNote: This MRF Policy is always enabled, if you want to disable it you have to set empty lists.\n" msgid "Reject, TWKN-remove or Set-Sensitive messsages with specific hashtags (without the leading #)\n\nNote: This MRF Policy is always enabled, if you want to disable it you have to set empty lists.\n"
msgstr "" msgstr ""
"Rejeter, Enlever de TWKN ou marquer comme contenu sensible les messages avec "
"des mots-croisillons (sans mettre le # du début)\n"
"\n"
"Note: cette politique MRF est toujours activée. Si vous voulez la "
"désactiver, vous devez configurer des listes vides.\n"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_hellthread" msgctxt "config description at :pleroma-:mrf_hellthread"
msgid "Block messages with excessive user mentions" msgid "Block messages with excessive user mentions"
msgstr "" msgstr "Bloquer les messages avec un nombre excessif de mentions"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_keyword" msgctxt "config description at :pleroma-:mrf_keyword"
msgid "Reject or Word-Replace messages matching a keyword or [Regex](https://hexdocs.pm/elixir/Regex.html)." msgid "Reject or Word-Replace messages matching a keyword or [Regex](https://hexdocs.pm/elixir/Regex.html)."
msgstr "" msgstr ""
"Rejeter ou remplacer les mots des messages qui correspondent à un mot clef "
"ou à une [expression rationnelle (Regex)](https://hexdocs.pm/elixir/Regex."
"html)."
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_mention" msgctxt "config description at :pleroma-:mrf_mention"
msgid "Block messages which mention a specific user" msgid "Block messages which mention a specific user"
msgstr "" msgstr "Bloquer les messages mentionnant un utilisateur particulier"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_normalize_markup" msgctxt "config description at :pleroma-:mrf_normalize_markup"
msgid "MRF NormalizeMarkup settings. Scrub configured hypertext markup." msgid "MRF NormalizeMarkup settings. Scrub configured hypertext markup."
msgstr "" msgstr ""
"Paramètres de normalisation MRF. Balaie les balises hypertextes configurées."
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_object_age" msgctxt "config description at :pleroma-:mrf_object_age"
msgid "Rejects or delists posts based on their timestamp deviance from your server's clock." msgid "Rejects or delists posts based on their timestamp deviance from your server's clock."
msgstr "" msgstr ""
"Rejette ou retire des listes les messages selon l'écart entre leur heure et "
"l'horloge de votre serveur."
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_rejectnonpublic" msgctxt "config description at :pleroma-:mrf_rejectnonpublic"
msgid "RejectNonPublic drops posts with non-public visibility settings." msgid "RejectNonPublic drops posts with non-public visibility settings."
msgstr "" msgstr ""
"RejectNonPublic enlève les messages avec des paramètres de visibilité non-"
"publics."
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_simple" msgctxt "config description at :pleroma-:mrf_simple"
msgid "Simple ingress policies" msgid "Simple ingress policies"
msgstr "" msgstr "Politiques simples pour entrants"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_steal_emoji" msgctxt "config description at :pleroma-:mrf_steal_emoji"
msgid "Steals emojis from selected instances when it sees them." msgid "Steals emojis from selected instances when it sees them."
msgstr "" msgstr "Vole les emojis des instances sélectionnées quand il les voit."
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_subchain" msgctxt "config description at :pleroma-:mrf_subchain"
msgid "This policy processes messages through an alternate pipeline when a given message matches certain criteria. All criteria are configured as a map of regular expressions to lists of policy modules." msgid "This policy processes messages through an alternate pipeline when a given message matches certain criteria. All criteria are configured as a map of regular expressions to lists of policy modules."
msgstr "" msgstr ""
"Cette politique traite les messages à travers un tuyau séparé lorsqu'un "
"message donné correspond à certain critères. Chaque critère est configuré "
"comme une correspondance entre une expression rationnelle et une liste de "
"modules de politiques."
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:mrf_vocabulary" msgctxt "config description at :pleroma-:mrf_vocabulary"
msgid "Filter messages which belong to certain activity vocabularies" msgid "Filter messages which belong to certain activity vocabularies"
msgstr "" msgstr ""
"Filtrer les messages qui correspondent à certain vocabulaires d'activités"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:oauth2" msgctxt "config description at :pleroma-:oauth2"
msgid "Configure OAuth 2 provider capabilities" msgid "Configure OAuth 2 provider capabilities"
msgstr "" msgstr "Configurer les capacités du fournisseur OAuth 2"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:pools" msgctxt "config description at :pleroma-:pools"
msgid "Advanced settings for `Gun` workers pools" msgid "Advanced settings for `Gun` workers pools"
msgstr "" msgstr "Paramètres avancés pour les bacs (pools) de travailleurs `Gun`"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:populate_hashtags_table" msgctxt "config description at :pleroma-:populate_hashtags_table"
msgid "`populate_hashtags_table` background migration settings" msgid "`populate_hashtags_table` background migration settings"
msgstr "" msgstr "Paramètres de migration en arrière-plan `populate_hashtags_table`"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:rate_limit" msgctxt "config description at :pleroma-:rate_limit"
msgid "Rate limit settings. This is an advanced feature enabled only for :authentication by default." msgid "Rate limit settings. This is an advanced feature enabled only for :authentication by default."
msgstr "" msgstr ""
"Paramètres de limites par secondes. C'est une fonctionnalité avancée qui, "
"par défaut, n'est activée que pour :authentication."
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:restrict_unauthenticated" msgctxt "config description at :pleroma-:restrict_unauthenticated"
msgid "Disallow viewing timelines, user profiles and statuses for unauthenticated users." msgid "Disallow viewing timelines, user profiles and statuses for unauthenticated users."
msgstr "" msgstr ""
"Empêche de regarder les flux, les profils utilisateurs et les status pour "
"les utilisateurs non-authentifiés."
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:rich_media" msgctxt "config description at :pleroma-:rich_media"
msgid "If enabled the instance will parse metadata from attached links to generate link previews" msgid "If enabled the instance will parse metadata from attached links to generate link previews"
msgstr "" msgstr ""
"Si activé, l'instance interprétera les métadonnées des liens joins pour "
"générer les prévisualisations de liens"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
@ -369,6 +409,8 @@ msgstr ""
msgctxt "config description at :pleroma-:static_fe" msgctxt "config description at :pleroma-:static_fe"
msgid "Render profiles and posts using server-generated HTML that is viewable without using JavaScript" msgid "Render profiles and posts using server-generated HTML that is viewable without using JavaScript"
msgstr "" msgstr ""
"Rendre les profils et les status en utilisant du HTML généré par le serveur "
"qui ne nécessitera pas de JavaScript"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
@ -380,7 +422,7 @@ msgstr ""
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format
msgctxt "config description at :pleroma-:uri_schemes" msgctxt "config description at :pleroma-:uri_schemes"
msgid "URI schemes related settings" msgid "URI schemes related settings"
msgstr "" msgstr "Paramètres liés au schémas d'URI"
#: lib/pleroma/docs/translator.ex:5 #: lib/pleroma/docs/translator.ex:5
#, elixir-autogen, elixir-format #, elixir-autogen, elixir-format

View file

@ -9,3 +9,8 @@
## Tweak GC to run more often ## Tweak GC to run more often
##-env ERL_FULLSWEEP_AFTER 10 ##-env ERL_FULLSWEEP_AFTER 10
# Disable wasteful busywait.
+sbwt none
+sbwtdcpu none
+sbwtdio none

View file

@ -174,8 +174,9 @@ test "with dedupe enabled" do
filename = Path.basename(href) filename = Path.basename(href)
assert {:ok, files} = File.ls(uploads_dir) expected_path = Path.join([uploads_dir, Pleroma.Upload.Filter.Dedupe.shard_path(filename)])
assert filename in files
assert File.exists?(expected_path)
Object.delete(note) Object.delete(note)
@ -183,8 +184,7 @@ test "with dedupe enabled" do
assert Object.get_by_id(note.id).data["deleted"] assert Object.get_by_id(note.id).data["deleted"]
assert Object.get_by_id(attachment.id) == nil assert Object.get_by_id(attachment.id) == nil
assert {:ok, files} = File.ls(uploads_dir) refute File.exists?(expected_path)
refute filename in files
end end
test "with objects that have legacy data.url attribute" do test "with objects that have legacy data.url attribute" do

View file

@ -10,6 +10,10 @@ defmodule Pleroma.Upload.Filter.DedupeTest do
@shasum "e30397b58d226d6583ab5b8b3c5defb0c682bda5c31ef07a9f57c1c4986e3781" @shasum "e30397b58d226d6583ab5b8b3c5defb0c682bda5c31ef07a9f57c1c4986e3781"
test "generates a shard path for a shasum" do
assert "e3/03/97/" <> _path = Dedupe.shard_path(@shasum)
end
test "adds shasum" do test "adds shasum" do
File.cp!( File.cp!(
"test/fixtures/image.jpg", "test/fixtures/image.jpg",
@ -23,10 +27,12 @@ test "adds shasum" do
tempfile: Path.absname("test/fixtures/image_tmp.jpg") tempfile: Path.absname("test/fixtures/image_tmp.jpg")
} }
expected_path = Dedupe.shard_path(@shasum <> ".jpg")
assert { assert {
:ok, :ok,
:filtered, :filtered,
%Pleroma.Upload{id: @shasum, path: @shasum <> ".jpg"} %Pleroma.Upload{id: @shasum, path: ^expected_path}
} = Dedupe.filter(upload) } = Dedupe.filter(upload)
end end
end end

View file

@ -149,6 +149,9 @@ test "returns a media url" do
test "copies the file to the configured folder with deduping" do test "copies the file to the configured folder with deduping" do
File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg") File.cp!("test/fixtures/image.jpg", "test/fixtures/image_tmp.jpg")
expected_filename = "e30397b58d226d6583ab5b8b3c5defb0c682bda5c31ef07a9f57c1c4986e3781.jpg"
expected_path = Pleroma.Upload.Filter.Dedupe.shard_path(expected_filename)
file = %Plug.Upload{ file = %Plug.Upload{
content_type: "image/jpeg", content_type: "image/jpeg",
@ -159,8 +162,7 @@ test "copies the file to the configured folder with deduping" do
{:ok, data} = Upload.store(file, filters: [Pleroma.Upload.Filter.Dedupe]) {:ok, data} = Upload.store(file, filters: [Pleroma.Upload.Filter.Dedupe])
assert List.first(data["url"])["href"] == assert List.first(data["url"])["href"] ==
Pleroma.Upload.base_url() <> Path.join([Pleroma.Upload.base_url(), expected_path])
"e30397b58d226d6583ab5b8b3c5defb0c682bda5c31ef07a9f57c1c4986e3781.jpg"
end end
test "copies the file to the configured folder without deduping" do test "copies the file to the configured folder without deduping" do

View file

@ -32,7 +32,7 @@ test "GET /:maybe_nickname_or_id with missing user", %{conn: conn} do
resp = get(conn, "/foo") resp = get(conn, "/foo")
assert html_response(resp, 200) =~ "<title>a cool title</title>" assert html_response(resp, 200) =~ "<title>a cool title</title>"
refute html_response(resp, 200) =~ "initial-results" assert html_response(resp, 200) =~ "<meta content=\"noindex, noarchive\" name=\"robots\">"
end end
test "GET /*path", %{conn: conn} do test "GET /*path", %{conn: conn} do

View file

@ -147,6 +147,15 @@ test "returns 404 for a missing feed", %{conn: conn} do
assert response(conn, 404) assert response(conn, 404)
end end
test "returns noindex meta for missing user", %{conn: conn} do
conn =
conn
|> put_req_header("accept", "text/html")
|> get("/users/nonexisting")
assert html_response(conn, 200) =~ "<meta content=\"noindex, noarchive\" name=\"robots\">"
end
test "returns feed with public and unlisted activities", %{conn: conn} do test "returns feed with public and unlisted activities", %{conn: conn} do
user = insert(:user) user = insert(:user)

View file

@ -95,7 +95,7 @@ test "/api/v2/media", %{conn: conn, user: user, image: image} do
conn conn
|> put_req_header("content-type", "multipart/form-data") |> put_req_header("content-type", "multipart/form-data")
|> post("/api/v2/media", %{"file" => image, "description" => desc}) |> post("/api/v2/media", %{"file" => image, "description" => desc})
|> json_response_and_validate_schema(202) |> json_response_and_validate_schema(200)
assert media_id = response["id"] assert media_id = response["id"]
@ -191,7 +191,7 @@ test "/api/v2/media, upload_limit", %{conn: conn, user: user} do
"file" => large_binary, "file" => large_binary,
"description" => desc "description" => desc
}) })
|> json_response_and_validate_schema(202) |> json_response_and_validate_schema(200)
assert media_id = response["id"] assert media_id = response["id"]

View file

@ -0,0 +1,40 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2024 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Metadata.Providers.ActivityPubTest do
use Pleroma.DataCase
import Pleroma.Factory
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.Metadata.Providers.ActivityPub
setup do: clear_config([Pleroma.Web.Metadata, :unfurl_nsfw])
test "it renders a link for user info" do
user = insert(:user)
res = ActivityPub.build_tags(%{user: user})
assert res == [
{:link, [rel: "alternate", type: "application/activity+json", href: user.ap_id], []}
]
end
test "it renders a link for a post" do
user = insert(:user)
{:ok, %{id: activity_id, object: object}} = CommonAPI.post(user, %{status: "hi"})
result = ActivityPub.build_tags(%{object: object, user: user, activity_id: activity_id})
assert [
{:link,
[rel: "alternate", type: "application/activity+json", href: object.data["id"]], []}
] == result
end
test "it returns an empty array for anything else" do
result = ActivityPub.build_tags(%{})
assert result == []
end
end

View file

@ -69,7 +69,7 @@ test "renders list", %{token: token} do
|> hd() |> hd()
|> Map.keys() |> Map.keys()
assert keys -- ["id", "app_name", "valid_until"] == [] assert Enum.sort(keys) == Enum.sort(["id", "app_name", "valid_until", "scopes"])
end end
test "revoke token", %{token: token} do test "revoke token", %{token: token} do