summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/pleroma/user/backup.ex8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/pleroma/user/backup.ex b/lib/pleroma/user/backup.ex
index 2568089a4..7feaa22bf 100644
--- a/lib/pleroma/user/backup.ex
+++ b/lib/pleroma/user/backup.ex
@@ -216,13 +216,15 @@ defmodule Pleroma.User.Backup do
end
defp tempdir do
+ rand = :crypto.strong_rand_bytes(8) |> Base.url_encode64(padding: false)
+ subdir = "backup-#{rand}"
+
case Config.get([__MODULE__, :tempdir]) do
nil ->
- System.tmp_dir!()
+ Path.join([System.tmp_dir!(), subdir])
path ->
- rand = :crypto.strong_rand_bytes(8) |> Base.url_encode64(padding: false)
- Path.join([path, rand])
+ Path.join([path, subdir])
end
end