From a4c9739965312556dce09ca68d3e2d709ca9fa4d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 25 Aug 2022 14:02:38 -0500 Subject: [PATCH] Fix Rebased --> Pleroma instance version --- lib/pleroma/application.ex | 2 ++ lib/pleroma/web/mastodon_api/views/instance_view.ex | 2 +- mix.exs | 7 ++++--- .../mastodon_api/controllers/instance_controller_test.exs | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index ed61d53482..70fcbc5dcf 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -12,6 +12,7 @@ defmodule Pleroma.Application do require Logger @name Mix.Project.config()[:name] + @compat_name Mix.Project.config()[:compat_name] @version Mix.Project.config()[:version] @repository Mix.Project.config()[:source_url] @mix_env Mix.env() @@ -19,6 +20,7 @@ defmodule Pleroma.Application do def name, do: @name def version, do: @version def named_version, do: @name <> " " <> @version + def compat_version, do: @compat_name <> " " <> @version def repository, do: @repository def user_agent do diff --git a/lib/pleroma/web/mastodon_api/views/instance_view.ex b/lib/pleroma/web/mastodon_api/views/instance_view.ex index f2a9681a0e..a278da8869 100644 --- a/lib/pleroma/web/mastodon_api/views/instance_view.ex +++ b/lib/pleroma/web/mastodon_api/views/instance_view.ex @@ -18,7 +18,7 @@ def render("show.json", _) do title: Keyword.get(instance, :name), description: Keyword.get(instance, :description), short_description: Keyword.get(instance, :short_description), - version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.named_version()})", + version: "#{@mastodon_api_level} (compatible; #{Pleroma.Application.compat_version()})", email: Keyword.get(instance, :email), urls: %{ streaming_api: Pleroma.Web.Endpoint.websocket_url() diff --git a/mix.exs b/mix.exs index a9e80d5192..2aefe5779e 100644 --- a/mix.exs +++ b/mix.exs @@ -6,6 +6,8 @@ defmodule Pleroma.Mixfile do def project do [ app: :pleroma, + name: "Rebased", + compat_name: "Pleroma", version: version("2.4.52"), elixir: "~> 1.9", elixirc_paths: elixirc_paths(Mix.env()), @@ -18,12 +20,11 @@ def project do test_coverage: [tool: ExCoveralls], preferred_cli_env: ["coveralls.html": :test], # Docs - name: "Rebased", homepage_url: "https://soapbox.pub/", - source_url: "https://gitlab.com/soapbox-pub/soapbox-be", + source_url: "https://gitlab.com/soapbox-pub/rebased", docs: [ source_url_pattern: - "https://gitlab.com/soapbox-pub/soapbox-be/blob/develop/%{path}#L%{line}", + "https://gitlab.com/soapbox-pub/rebased/blob/develop/%{path}#L%{line}", logo: "priv/static/images/logo.png", extras: ["README.md", "CHANGELOG.md"] ++ Path.wildcard("docs/**/*.md"), groups_for_extras: [ 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 3d20b06bd6..7dbe52c816 100644 --- a/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs +++ b/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs @@ -47,6 +47,7 @@ test "get instance information", %{conn: conn} do "rules" => _ } = result + assert result["version"] =~ "Pleroma" assert result["pleroma"]["metadata"]["account_activation_required"] != nil assert result["pleroma"]["metadata"]["features"] assert result["pleroma"]["metadata"]["federation"]