Add soapbox version to /api/v1/instance

This commit is contained in:
Alex Gleason 2021-04-27 15:54:24 -05:00
parent b221d77a6d
commit 8f698d081c
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
3 changed files with 9 additions and 0 deletions

View file

@ -47,6 +47,9 @@ 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)
},
soapbox: %{
version: Soapbox.version()
} }
} }
end end

5
lib/soapbox.ex Normal file
View file

@ -0,0 +1,5 @@
defmodule Soapbox do
@version "0.1.0"
def version, do: @version
end

View file

@ -48,6 +48,7 @@ test "get instance information", %{conn: conn} do
assert result["pleroma"]["metadata"]["fields_limits"] assert result["pleroma"]["metadata"]["fields_limits"]
assert result["pleroma"]["vapid_public_key"] assert result["pleroma"]["vapid_public_key"]
assert result["pleroma"]["stats"]["mau"] == 0 assert result["pleroma"]["stats"]["mau"] == 0
assert result["soapbox"]["version"] =~ "."
assert email == from_config_email assert email == from_config_email
assert thumbnail == from_config_thumbnail assert thumbnail == from_config_thumbnail