commit: acb9e46074346ad28ad6444a170bdd5e00c74910
parent f0468697cd74f4ec062f9c6feda53cfbe9e4500c
Author: marcin mikołajczak <git@mkljczk.pl>
Date: Tue, 27 Feb 2024 13:25:26 +0100
Add some missing fields to instanceV2
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat:
3 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/changelog.d/instance-v2.skip b/changelog.d/instance-v2.skip
diff --git a/config/description.exs b/config/description.exs
@@ -567,6 +567,14 @@ config :pleroma, :config_description, [
]
},
%{
+ key: :status_page,
+ type: :string,
+ description: "A page where people can see the status of the server during an outage",
+ suggestions: [
+ "https://status.pleroma.example.org"
+ ]
+ },
+ %{
key: :limit,
type: :integer,
description: "Posts character limit (CW/Subject included in the counter)",
diff --git a/lib/pleroma/web/mastodon_api/views/instance_view.ex b/lib/pleroma/web/mastodon_api/views/instance_view.ex
@@ -63,7 +63,8 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
registrations: %{
enabled: Keyword.get(instance, :registrations_open),
approval_required: Keyword.get(instance, :account_approval_required),
- message: nil
+ message: nil,
+ url: nil
},
contact: %{
email: Keyword.get(instance, :email),
@@ -78,7 +79,8 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
%{
title: Keyword.get(instance, :name),
version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})",
- languages: Keyword.get(instance, :languages, ["en"])
+ languages: Keyword.get(instance, :languages, ["en"]),
+ rules: []
}
end
@@ -170,13 +172,17 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
defp configuration do
%{
+ accounts: %{
+ max_featured_tags: 0
+ },
statuses: %{
max_characters: Config.get([:instance, :limit]),
max_media_attachments: Config.get([:instance, :max_media_attachments])
},
media_attachments: %{
image_size_limit: Config.get([:instance, :upload_limit]),
- video_size_limit: Config.get([:instance, :upload_limit])
+ video_size_limit: Config.get([:instance, :upload_limit]),
+ supported_mime_types: ["application/octet-stream"]
},
polls: %{
max_options: Config.get([:instance, :poll_limits, :max_options]),
@@ -190,7 +196,13 @@ defmodule Pleroma.Web.MastodonAPI.InstanceView do
defp configuration2 do
configuration()
|> Map.merge(%{
- urls: %{streaming: Pleroma.Web.Endpoint.websocket_url()}
+ urls: %{
+ streaming: Pleroma.Web.Endpoint.websocket_url(),
+ status: Config.get([:instance, :status_page])
+ },
+ vapid: %{
+ public_key: Keyword.get(Pleroma.Web.Push.vapid_config(), :public_key)
+ }
})
end