mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-08 09:24:18 +00:00
Ensure scrubbers are loaded by the compiler
This commit is contained in:
parent
6cb40bee26
commit
2fdfed50f0
|
@ -39,6 +39,8 @@ defmodule Mix.Pleroma do
|
|||
|
||||
Enum.each(@apps, &Application.ensure_all_started/1)
|
||||
|
||||
Pleroma.Application.load_all_pleroma_modules()
|
||||
|
||||
oban_config = [
|
||||
crontab: [],
|
||||
repo: Pleroma.Repo,
|
||||
|
|
|
@ -17,6 +17,13 @@ defmodule Mix.Tasks.Pleroma.Diagnostics do
|
|||
|> IO.inspect()
|
||||
end
|
||||
|
||||
def run(["get_object", url]) do
|
||||
start_pleroma()
|
||||
|
||||
Pleroma.Object.Fetcher.fetch_object_from_id(url)
|
||||
|> IO.inspect()
|
||||
end
|
||||
|
||||
def run(["home_timeline", nickname]) do
|
||||
start_pleroma()
|
||||
user = Repo.get_by!(User, nickname: nickname)
|
||||
|
|
|
@ -48,7 +48,6 @@ defmodule Pleroma.Application do
|
|||
# due to protocol consolidation warnings
|
||||
Code.compiler_options(warnings_as_errors: false)
|
||||
Config.Holder.save_default()
|
||||
Pleroma.HTML.compile_scrubbers()
|
||||
Pleroma.Config.Oban.warn()
|
||||
Config.DeprecationWarnings.warn()
|
||||
Pleroma.Web.Plugs.HTTPSecurityPlug.warn_if_disabled()
|
||||
|
|
|
@ -8,20 +8,6 @@ defmodule Pleroma.HTML do
|
|||
|
||||
@cachex Pleroma.Config.get([:cachex, :provider], Cachex)
|
||||
|
||||
def compile_scrubbers do
|
||||
dir = Path.join(:code.priv_dir(:pleroma), "scrubbers")
|
||||
|
||||
dir
|
||||
|> Pleroma.Utils.compile_dir()
|
||||
|> case do
|
||||
{:error, _errors, _warnings} ->
|
||||
raise "Compiling scrubbers failed"
|
||||
|
||||
{:ok, _modules, _warnings} ->
|
||||
:ok
|
||||
end
|
||||
end
|
||||
|
||||
defp get_scrubbers(scrubber) when is_atom(scrubber), do: [scrubber]
|
||||
defp get_scrubbers(scrubbers) when is_list(scrubbers), do: scrubbers
|
||||
defp get_scrubbers(_), do: [Pleroma.HTML.Scrubber.Default]
|
||||
|
|
Loading…
Reference in a new issue