summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml1
-rw-r--r--CHANGELOG.md3
-rw-r--r--config/config.exs19
-rw-r--r--lib/pleroma/config/deprecation_warnings.ex10
-rw-r--r--lib/pleroma/web/twitter_api/controllers/util_controller.ex28
-rw-r--r--mix.exs4
-rw-r--r--mix.lock1
-rw-r--r--test/web/twitter_api/util_controller_test.exs26
8 files changed, 11 insertions, 81 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index dc99b81ee..f9745122a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -52,6 +52,7 @@ unit-testing:
- mix ecto.create
- mix ecto.migrate
- mix test --trace --preload-modules
+ - mix coveralls
lint:
stage: test
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c563c39da..b0e849285 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -97,6 +97,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Mastodon API: Exposing default scope of the user to anyone
- Mastodon API: Make `irreversible` field default to `false` [`POST /api/v1/filters`]
+## Removed
+- Configuration: `config :pleroma, :fe` in favor of the more flexible `config :pleroma, :frontend_configurations`
+
## [0.9.9999] - 2019-04-05
### Security
- Mastodon API: Fix content warnings skipping HTML sanitization
diff --git a/config/config.exs b/config/config.exs
index 3452eb1bb..0754749a3 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -253,25 +253,6 @@ config :pleroma, :markup,
Pleroma.HTML.Scrubber.Default
]
-# Deprecated, will be gone in 1.0
-config :pleroma, :fe,
- theme: "pleroma-dark",
- logo: "/static/logo.png",
- logo_mask: true,
- logo_margin: "0.1em",
- background: "/static/aurora_borealis.jpg",
- redirect_root_no_login: "/main/all",
- redirect_root_login: "/main/friends",
- show_instance_panel: true,
- scope_options_enabled: false,
- formatting_options_enabled: false,
- collapse_message_with_subject: false,
- hide_post_stats: false,
- hide_user_stats: false,
- scope_copy: true,
- subject_line_behavior: "email",
- always_show_subject_input: true
-
config :pleroma, :frontend_configurations,
pleroma_fe: %{
theme: "pleroma-dark",
diff --git a/lib/pleroma/config/deprecation_warnings.ex b/lib/pleroma/config/deprecation_warnings.ex
index 0345ac19c..240fb1c37 100644
--- a/lib/pleroma/config/deprecation_warnings.ex
+++ b/lib/pleroma/config/deprecation_warnings.ex
@@ -5,15 +5,6 @@
defmodule Pleroma.Config.DeprecationWarnings do
require Logger
- def check_frontend_config_mechanism do
- if Pleroma.Config.get(:fe) do
- Logger.warn("""
- !!!DEPRECATION WARNING!!!
- You are using the old configuration mechanism for the frontend. Please check config.md.
- """)
- end
- end
-
def check_hellthread_threshold do
if Pleroma.Config.get([:mrf_hellthread, :threshold]) do
Logger.warn("""
@@ -24,7 +15,6 @@ defmodule Pleroma.Config.DeprecationWarnings do
end
def warn do
- check_frontend_config_mechanism()
check_hellthread_threshold()
end
end
diff --git a/lib/pleroma/web/twitter_api/controllers/util_controller.ex b/lib/pleroma/web/twitter_api/controllers/util_controller.ex
index 89c55ef0e..489170d80 100644
--- a/lib/pleroma/web/twitter_api/controllers/util_controller.ex
+++ b/lib/pleroma/web/twitter_api/controllers/util_controller.ex
@@ -173,8 +173,6 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
def config(conn, _params) do
instance = Pleroma.Config.get(:instance)
- instance_fe = Pleroma.Config.get(:fe)
- instance_chat = Pleroma.Config.get(:chat)
case get_format(conn) do
"xml" ->
@@ -219,31 +217,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
if(Pleroma.Config.get([:instance, :safe_dm_mentions]), do: "1", else: "0")
}
- pleroma_fe =
- if instance_fe do
- %{
- theme: Keyword.get(instance_fe, :theme),
- background: Keyword.get(instance_fe, :background),
- logo: Keyword.get(instance_fe, :logo),
- logoMask: Keyword.get(instance_fe, :logo_mask),
- logoMargin: Keyword.get(instance_fe, :logo_margin),
- redirectRootNoLogin: Keyword.get(instance_fe, :redirect_root_no_login),
- redirectRootLogin: Keyword.get(instance_fe, :redirect_root_login),
- chatDisabled: !Keyword.get(instance_chat, :enabled),
- showInstanceSpecificPanel: Keyword.get(instance_fe, :show_instance_panel),
- scopeOptionsEnabled: Keyword.get(instance_fe, :scope_options_enabled),
- formattingOptionsEnabled: Keyword.get(instance_fe, :formatting_options_enabled),
- collapseMessageWithSubject:
- Keyword.get(instance_fe, :collapse_message_with_subject),
- hidePostStats: Keyword.get(instance_fe, :hide_post_stats),
- hideUserStats: Keyword.get(instance_fe, :hide_user_stats),
- scopeCopy: Keyword.get(instance_fe, :scope_copy),
- subjectLineBehavior: Keyword.get(instance_fe, :subject_line_behavior),
- alwaysShowSubjectInput: Keyword.get(instance_fe, :always_show_subject_input)
- }
- else
- Pleroma.Config.get([:frontend_configurations, :pleroma_fe])
- end
+ pleroma_fe = Pleroma.Config.get([:frontend_configurations, :pleroma_fe])
managed_config = Keyword.get(instance, :managed_config)
diff --git a/mix.exs b/mix.exs
index b7b9d534d..7cc20b274 100644
--- a/mix.exs
+++ b/mix.exs
@@ -13,6 +13,7 @@ defmodule Pleroma.Mixfile do
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
+ test_coverage: [tool: ExCoveralls],
# Docs
name: "Pleroma",
@@ -115,7 +116,8 @@ defmodule Pleroma.Mixfile do
{:benchee, "~> 1.0"},
{:esshd, "~> 0.1.0"},
{:ex_rated, "~> 1.2"},
- {:plug_static_index_html, "~> 1.0.0"}
+ {:plug_static_index_html, "~> 1.0.0"},
+ {:excoveralls, "~> 0.11.1", only: :test}
] ++ oauth_deps
end
diff --git a/mix.lock b/mix.lock
index 0b24818c5..7d80eb0b8 100644
--- a/mix.lock
+++ b/mix.lock
@@ -31,6 +31,7 @@
"ex_machina": {:hex, :ex_machina, "2.3.0", "92a5ad0a8b10ea6314b876a99c8c9e3f25f4dde71a2a835845b136b9adaf199a", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm"},
"ex_rated": {:hex, :ex_rated, "1.3.2", "6aeb32abb46ea6076f417a9ce8cb1cf08abf35fb2d42375beaad4dd72b550bf1", [:mix], [{:ex2ms, "~> 1.5", [hex: :ex2ms, repo: "hexpm", optional: false]}], "hexpm"},
"ex_syslogger": {:git, "https://github.com/slashmili/ex_syslogger.git", "f3963399047af17e038897c69e20d552e6899e1d", [tag: "1.4.0"]},
+ "excoveralls": {:hex, :excoveralls, "0.11.1", "dd677fbdd49114fdbdbf445540ec735808250d56b011077798316505064edb2c", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"floki": {:hex, :floki, "0.20.4", "be42ac911fece24b4c72f3b5846774b6e61b83fe685c2fc9d62093277fb3bc86", [:mix], [{:html_entities, "~> 0.4.0", [hex: :html_entities, repo: "hexpm", optional: false]}, {:mochiweb, "~> 2.15", [hex: :mochiweb, repo: "hexpm", optional: false]}], "hexpm"},
"gen_smtp": {:hex, :gen_smtp, "0.13.0", "11f08504c4bdd831dc520b8f84a1dce5ce624474a797394e7aafd3c29f5dcd25", [:rebar3], [], "hexpm"},
"gettext": {:hex, :gettext, "0.15.0", "40a2b8ce33a80ced7727e36768499fc9286881c43ebafccae6bab731e2b2b8ce", [:mix], [], "hexpm"},
diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs
index 14a8225f0..2cd82b3e7 100644
--- a/test/web/twitter_api/util_controller_test.exs
+++ b/test/web/twitter_api/util_controller_test.exs
@@ -141,7 +141,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
test "it returns the managed config", %{conn: conn} do
Pleroma.Config.put([:instance, :managed_config], false)
- Pleroma.Config.put([:fe], theme: "rei-ayanami-towel")
+ Pleroma.Config.put([:frontend_configurations, :pleroma_fe], %{theme: "asuka-hospital"})
response =
conn
@@ -157,29 +157,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
|> get("/api/statusnet/config.json")
|> json_response(:ok)
- assert response["site"]["pleromafe"]
- end
-
- test "if :pleroma, :fe is false, it returns the new style config settings", %{conn: conn} do
- Pleroma.Config.put([:instance, :managed_config], true)
- Pleroma.Config.put([:fe, :theme], "rei-ayanami-towel")
- Pleroma.Config.put([:frontend_configurations, :pleroma_fe], %{theme: "asuka-hospital"})
-
- response =
- conn
- |> get("/api/statusnet/config.json")
- |> json_response(:ok)
-
- assert response["site"]["pleromafe"]["theme"] == "rei-ayanami-towel"
-
- Pleroma.Config.put([:fe], false)
-
- response =
- conn
- |> get("/api/statusnet/config.json")
- |> json_response(:ok)
-
- assert response["site"]["pleromafe"]["theme"] == "asuka-hospital"
+ assert response["site"]["pleromafe"] == %{"theme" => "asuka-hospital"}
end
end