This commit is contained in:
Phantasm 2026-07-18 16:13:39 +02:00
commit 41ab347571
No known key found for this signature in database
GPG key ID: 2669E588BCC634C8
4 changed files with 17 additions and 9 deletions

View file

@ -342,6 +342,7 @@ defmodule Mix.Tasks.Pleroma.Config do
end end
end end
end end
@spec migrate_to_db(Path.t() | nil) :: any() @spec migrate_to_db(Path.t() | nil) :: any()
def migrate_to_db(file_path \\ nil) do def migrate_to_db(file_path \\ nil) do
with :ok <- Pleroma.Config.DeprecationWarnings.warn() do with :ok <- Pleroma.Config.DeprecationWarnings.warn() do

View file

@ -212,7 +212,7 @@ defmodule Pleroma.Web.AdminAPI.ConfigController do
{blacklisted_group, blacklisted_key} -> {blacklisted_group, blacklisted_key} ->
group == inspect(blacklisted_group) and key == inspect(blacklisted_key) group == inspect(blacklisted_group) and key == inspect(blacklisted_key)
end) end)
else else
true true
end end

View file

@ -372,10 +372,7 @@ defmodule Mix.Tasks.Pleroma.ConfigTest do
test "filters blacklisted settings" do test "filters blacklisted settings" do
clear_config(:database_config_whitelist, [{:pleroma}]) clear_config(:database_config_whitelist, [{:pleroma}])
clear_config(:database_config_blacklist, [ clear_config(:database_config_blacklist, [{:pleroma, :logger}, {:blacklisted_group}])
{:pleroma, :logger},
{:blacklisted_group}
])
insert_config_record(:pleroma, :logger, backends: :console) insert_config_record(:pleroma, :logger, backends: :console)
insert_config_record(:web_push_encryption, :vapid_details, a: 1) insert_config_record(:web_push_encryption, :vapid_details, a: 1)
@ -387,7 +384,7 @@ defmodule Mix.Tasks.Pleroma.ConfigTest do
%ConfigDB{group: :pleroma, key: :instance}, %ConfigDB{group: :pleroma, key: :instance},
%ConfigDB{group: :pleroma, key: Pleroma.Captcha}, %ConfigDB{group: :pleroma, key: Pleroma.Captcha},
%ConfigDB{group: :pleroma2, key: :key2}, %ConfigDB{group: :pleroma2, key: :key2},
%ConfigDB{group: :web_push_encryption, key: :vapid_details}, %ConfigDB{group: :web_push_encryption, key: :vapid_details}
] = config_records() ] = config_records()
end end

View file

@ -1246,7 +1246,12 @@ defmodule Pleroma.Web.AdminAPI.ConfigControllerTest do
end end
test "doesn't set keys in the blacklist", %{conn: conn} do test "doesn't set keys in the blacklist", %{conn: conn} do
clear_config(:database_config_blacklist, [{:pleroma, :logger}, {:pleroma, :key2}, {:pleroma, Pleroma.Captcha.NotReal}, {:blacklisted_group}]) clear_config(:database_config_blacklist, [
{:pleroma, :logger},
{:pleroma, :key2},
{:pleroma, Pleroma.Captcha.NotReal},
{:blacklisted_group}
])
conn conn
|> put_req_header("content-type", "application/json") |> put_req_header("content-type", "application/json")
@ -1563,9 +1568,14 @@ defmodule Pleroma.Web.AdminAPI.ConfigControllerTest do
end end
test "filters by database configuration blacklist and whitelist", %{conn: conn} do test "filters by database configuration blacklist and whitelist", %{conn: conn} do
clear_config(:database_config_whitelist, [{:pleroma, :instance}, {:pleroma, :activitypub}, {:pleroma, Pleroma.Upload}]) clear_config(:database_config_whitelist, [
{:pleroma, :instance},
{:pleroma, :activitypub},
{:pleroma, Pleroma.Upload}
])
clear_config(:database_config_blacklist, [ clear_config(:database_config_blacklist, [
{:pleroma, Pleroma.Upload}, {:pleroma, Pleroma.Upload}
]) ])
children = children =