From 8f698d081ca56cdb3ec4b4eb6a84cc817ca95f65 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 27 Apr 2021 15:54:24 -0500 Subject: [PATCH 1/2] Add soapbox version to /api/v1/instance --- lib/pleroma/web/mastodon_api/views/instance_view.ex | 3 +++ lib/soapbox.ex | 5 +++++ .../mastodon_api/controllers/instance_controller_test.exs | 1 + 3 files changed, 9 insertions(+) create mode 100644 lib/soapbox.ex diff --git a/lib/pleroma/web/mastodon_api/views/instance_view.ex b/lib/pleroma/web/mastodon_api/views/instance_view.ex index 73205fb6db..b7ea221908 100644 --- a/lib/pleroma/web/mastodon_api/views/instance_view.ex +++ b/lib/pleroma/web/mastodon_api/views/instance_view.ex @@ -47,6 +47,9 @@ def render("show.json", _) do }, stats: %{mau: Pleroma.User.active_user_count()}, vapid_public_key: Keyword.get(Pleroma.Web.Push.vapid_config(), :public_key) + }, + soapbox: %{ + version: Soapbox.version() } } end diff --git a/lib/soapbox.ex b/lib/soapbox.ex new file mode 100644 index 0000000000..3a64f27d96 --- /dev/null +++ b/lib/soapbox.ex @@ -0,0 +1,5 @@ +defmodule Soapbox do + @version "0.1.0" + + def version, do: @version +end diff --git a/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs index b998566591..6803113b6b 100644 --- a/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs @@ -48,6 +48,7 @@ test "get instance information", %{conn: conn} do assert result["pleroma"]["metadata"]["fields_limits"] assert result["pleroma"]["vapid_public_key"] assert result["pleroma"]["stats"]["mau"] == 0 + assert result["soapbox"]["version"] =~ "." assert email == from_config_email assert thumbnail == from_config_thumbnail From 99b9106a508539dde4bde04d89b5aadc1c7ad219 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 27 Apr 2021 16:15:34 -0500 Subject: [PATCH 2/2] soapbox version --> 0.0.99 --- lib/soapbox.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/soapbox.ex b/lib/soapbox.ex index 3a64f27d96..ab7ef4a16c 100644 --- a/lib/soapbox.ex +++ b/lib/soapbox.ex @@ -1,5 +1,5 @@ defmodule Soapbox do - @version "0.1.0" + @version "0.0.99" def version, do: @version end