commit: 8298b326a7a3081be262c73f734dfe3082962e83
parent 03e54aaba9d2d7cd7f4329f53a80f10ac71ab64d
Author: tusooa <tusooa@kazv.moe>
Date: Thu, 7 Mar 2024 01:31:27 +0000
Merge branch 'instance-v2' into 'develop'
Add some missing fields to instanceV2
See merge request pleroma/pleroma!4081
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