end
def warn do
- with :ok <- check_hellthread_threshold(),
- :ok <- check_old_mrf_config(),
- :ok <- check_media_proxy_whitelist_config(),
- :ok <- check_welcome_message_config(),
- :ok <- check_gun_pool_options(),
- :ok <- check_activity_expiration_config(),
- :ok <- check_remote_ip_plug_name(),
- :ok <- check_uploders_s3_public_endpoint(),
- :ok <- check_old_chat_shoutbox(),
- :ok <- check_quarantined_instances_tuples(),
- :ok <- check_transparency_exclusions_tuples(),
- :ok <- check_simple_policy_tuples() do
- :ok
- else
- _ ->
- :error
- end
+ [
+ check_hellthread_threshold(),
+ check_old_mrf_config(),
+ check_media_proxy_whitelist_config(),
+ check_welcome_message_config(),
+ check_gun_pool_options(),
+ check_activity_expiration_config(),
+ check_remote_ip_plug_name(),
+ check_uploders_s3_public_endpoint(),
+ check_old_chat_shoutbox(),
+ check_quarantined_instances_tuples(),
+ check_transparency_exclusions_tuples(),
+ check_simple_policy_tuples()
+ ]
+ |> Enum.reduce(:ok, fn
+ :ok, :ok -> :ok
+ _, _ -> :error
+ end)
end
def check_welcome_message_config do
{:media_removal, [{"some.removal", ""}, {"some.other.instance", "Some reason"}]}
]
- capture_log(fn -> DeprecationWarnings.check_simple_policy_tuples() end)
+ capture_log(fn -> DeprecationWarnings.warn() end)
assert Config.get([:mrf_simple]) == expected_config
end
expected_config = [{"domain.com", "some reason"}, {"some.tld", ""}]
- capture_log(fn -> DeprecationWarnings.check_quarantined_instances_tuples() end)
+ capture_log(fn -> DeprecationWarnings.warn() end)
assert Config.get([:instance, :quarantined_instances]) == expected_config
end
expected_config = [{"domain.com", "some reason"}, {"some.tld", ""}]
- capture_log(fn -> DeprecationWarnings.check_transparency_exclusions_tuples() end)
+ capture_log(fn -> DeprecationWarnings.warn() end)
assert Config.get([:mrf, :transparency_exclusions]) == expected_config
end