Runtime configuration
Related to #85 Everything should now be configured at runtime, with the exception of the `Pleroma.HTML` scrubbers (the scrubbers used can be changed at runtime, but their configuration is compile-time) because it's building a module with a macro.
This commit is contained in:
parent
25512aa29c
commit
5bb88fd174
18 changed files with 190 additions and 163 deletions
|
|
@ -1,14 +1,12 @@
|
|||
defmodule Pleroma.HTML do
|
||||
alias HtmlSanitizeEx.Scrubber
|
||||
|
||||
@markup Application.get_env(:pleroma, :markup)
|
||||
|
||||
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]
|
||||
|
||||
def get_scrubbers() do
|
||||
Keyword.get(@markup, :scrub_policy)
|
||||
Pleroma.Config.get([:markup, :scrub_policy])
|
||||
|> get_scrubbers
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue