Merge branch 'rebased-fixes' into 'develop'

Fix Rebased --> Pleroma instance version

See merge request soapbox-pub/rebased!167
This commit is contained in:
Alex Gleason 2022-08-25 19:28:51 +00:00
commit 8833ea7a1b
6 changed files with 16 additions and 5 deletions

View file

@ -12,13 +12,16 @@ 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()
def name, do: @name
def compat_name, do: @compat_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

View file

@ -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()

View file

@ -24,7 +24,7 @@ def get_nodeinfo("2.0") do
%{
version: "2.0",
software: %{
name: Pleroma.Application.name() |> String.downcase(),
name: Pleroma.Application.compat_name() |> String.downcase(),
version: Pleroma.Application.version()
},
protocols: Publisher.gather_nodeinfo_protocol_names(),

View file

@ -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: [

View file

@ -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"]

View file

@ -64,6 +64,12 @@ test "returns software.repository field in nodeinfo 2.1", %{conn: conn} do
assert Pleroma.Application.repository() == result["software"]["repository"]
end
test "returns Pleroma as software name", %{conn: conn} do
conn = get(conn, "/nodeinfo/2.1.json")
assert result = json_response(conn, 200)
assert result["software"]["name"] == "pleroma"
end
test "returns fieldsLimits field", %{conn: conn} do
clear_config([:instance, :max_account_fields], 10)
clear_config([:instance, :max_remote_account_fields], 15)