Expose favicon URL in instance API
This commit is contained in:
parent
35f16d9c47
commit
bddd4375bf
2 changed files with 10 additions and 2 deletions
|
@ -56,7 +56,10 @@ def render("show.json", _) do
|
||||||
},
|
},
|
||||||
stats: %{mau: Pleroma.User.active_user_count()},
|
stats: %{mau: Pleroma.User.active_user_count()},
|
||||||
vapid_public_key: Keyword.get(Pleroma.Web.Push.vapid_config(), :public_key),
|
vapid_public_key: Keyword.get(Pleroma.Web.Push.vapid_config(), :public_key),
|
||||||
oauth_consumer_strategies: Pleroma.Config.oauth_consumer_strategies()
|
oauth_consumer_strategies: Pleroma.Config.oauth_consumer_strategies(),
|
||||||
|
favicon:
|
||||||
|
URI.merge(Pleroma.Web.Endpoint.url(), Keyword.get(instance, :favicon))
|
||||||
|
|> to_string
|
||||||
},
|
},
|
||||||
configuration: configuration(),
|
configuration: configuration(),
|
||||||
soapbox: %{
|
soapbox: %{
|
||||||
|
|
|
@ -19,6 +19,7 @@ test "get instance information", %{conn: conn} do
|
||||||
email = Pleroma.Config.get([:instance, :email])
|
email = Pleroma.Config.get([:instance, :email])
|
||||||
thumbnail = Pleroma.Web.Endpoint.url() <> Pleroma.Config.get([:instance, :instance_thumbnail])
|
thumbnail = Pleroma.Web.Endpoint.url() <> Pleroma.Config.get([:instance, :instance_thumbnail])
|
||||||
background = Pleroma.Web.Endpoint.url() <> Pleroma.Config.get([:instance, :background_image])
|
background = Pleroma.Web.Endpoint.url() <> Pleroma.Config.get([:instance, :background_image])
|
||||||
|
favicon = Pleroma.Web.Endpoint.url() <> Pleroma.Config.get([:instance, :favicon])
|
||||||
|
|
||||||
# Note: not checking for "max_toot_chars" since it's optional
|
# Note: not checking for "max_toot_chars" since it's optional
|
||||||
assert %{
|
assert %{
|
||||||
|
@ -44,7 +45,10 @@ test "get instance information", %{conn: conn} do
|
||||||
"background_image" => from_config_background,
|
"background_image" => from_config_background,
|
||||||
"shout_limit" => _,
|
"shout_limit" => _,
|
||||||
"description_limit" => _,
|
"description_limit" => _,
|
||||||
"rules" => _
|
"rules" => _,
|
||||||
|
"pleroma" => %{
|
||||||
|
"favicon" => from_config_favicon
|
||||||
|
}
|
||||||
} = result
|
} = result
|
||||||
|
|
||||||
assert result["version"] =~ "Pleroma"
|
assert result["version"] =~ "Pleroma"
|
||||||
|
@ -60,6 +64,7 @@ test "get instance information", %{conn: conn} do
|
||||||
assert email == from_config_email
|
assert email == from_config_email
|
||||||
assert thumbnail == from_config_thumbnail
|
assert thumbnail == from_config_thumbnail
|
||||||
assert background == from_config_background
|
assert background == from_config_background
|
||||||
|
assert favicon == from_config_favicon
|
||||||
end
|
end
|
||||||
|
|
||||||
test "get instance stats", %{conn: conn} do
|
test "get instance stats", %{conn: conn} do
|
||||||
|
|
Loading…
Reference in a new issue