config :pleroma, Pleroma.Web.Auth.Authenticator, Pleroma.Web.Auth.PleromaAuthenticator
+config :pleroma, Pleroma.Backup,
+ purge_after_days: 30,
+ limit_days: 7
+
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"
]
}
]
+ },
+ %{
+ group: :pleroma,
+ key: Pleroma.Backup,
+ type: :group,
+ description: "Account Backup",
+ children: [
+ %{
+ key: :purge_after_days,
+ type: :integer,
+ description: "Remove backup achives after N days",
+ suggestions: [30]
+ },
+ %{
+ key: :limit_days,
+ type: :integer,
+ description: "Limit user to export not more often than once per N days",
+ suggestions: [7]
+ }
+ ]
}
]
* `enabled`: Allow/disallow displaying and getting instances favicons
+## Account Backup
+
+* `:purge_after_days` an integer, remove backup achives after N days.
+* `:limit_days` an integer, limit user to export not more often than once per N days.
+
## Frontend management
Frontends in Pleroma are swappable - you can specify which one to use here.
defp validate_limit(user) do
case get_last(user.id) do
%__MODULE__{inserted_at: inserted_at} ->
- days = 7
+ days = Pleroma.Config.get([Pleroma.Backup, :limit_days])
diff = Timex.diff(NaiveDateTime.utc_now(), inserted_at, :days)
if diff > days do
test "it return an error if the export limit is over" do
%{id: user_id} = user = insert(:user)
- limit_days = 7
+ limit_days = Pleroma.Config.get([Pleroma.Backup, :limit_days])
assert {:ok, %Oban.Job{args: args}} = Backup.create(user)
backup = Backup.get(args["backup_id"])
assert %Backup{user_id: ^user_id, processed: false, file_size: 0} = backup