forked from AkkomaGang/akkoma
Create dir for EmojiStealPolicy automatically
This commit is contained in:
parent
e4f1d8f48c
commit
77e39e6aae
1 changed files with 19 additions and 0 deletions
|
@ -114,6 +114,9 @@ def start(_type, _args) do
|
||||||
|
|
||||||
set_postgres_server_version()
|
set_postgres_server_version()
|
||||||
|
|
||||||
|
# Requires Config.TransferTask so ConfigDB values are loaded
|
||||||
|
steal_emoji_policy_setup()
|
||||||
|
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -300,4 +303,20 @@ def limiters_setup do
|
||||||
[Pleroma.Web.RichMedia.Helpers, Pleroma.Web.MediaProxy]
|
[Pleroma.Web.RichMedia.Helpers, Pleroma.Web.MediaProxy]
|
||||||
|> Enum.each(&ConcurrentLimiter.new(&1, 1, 0))
|
|> Enum.each(&ConcurrentLimiter.new(&1, 1, 0))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@spec steal_emoji_policy_setup() :: :ok
|
||||||
|
def steal_emoji_policy_setup() do
|
||||||
|
with true <-
|
||||||
|
Pleroma.Web.ActivityPub.MRF.StealEmojiPolicy in Config.get!([:mrf, :policies]) do
|
||||||
|
path =
|
||||||
|
[:instance, :static_dir]
|
||||||
|
|> Config.get!()
|
||||||
|
|> Path.join("emoji/steal")
|
||||||
|
|
||||||
|
if !File.exists?(path), do: File.mkdir_p!(path)
|
||||||
|
else
|
||||||
|
_ ->
|
||||||
|
:ok
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue