fix(restore): allow backups of any size
- default BACKUP_UPLOAD_LIMIT_MB to 0 (no hard cap, disk is the limit); a positive value still enables multer fileSize - scale request timeout by the configured limit and keep up to 24h when unlimited, cap headersTimeout at 120s - check Content-Length and free space before upload (413/507) and map multer ENOSPC to 507 - drop the hardcoded 500 MB fallback in the settings restore pre-check - cover new limit/timeout helpers in backup.selftest.js - update env template, compose, README, AGENTS and API docs
This commit is contained in:
@@ -1096,8 +1096,9 @@ document.getElementById('restoreFile').addEventListener('change', async (e) => {
|
||||
if (!file) return;
|
||||
try {
|
||||
const ps = await (await fetch(`${API}/api/public-settings`)).json();
|
||||
const maxMb = parseInt(ps.backup_upload_limit_mb, 10) || 500;
|
||||
if (file.size > maxMb * 1024 * 1024) {
|
||||
const limitMb = Number.parseInt(ps.backup_upload_limit_mb, 10);
|
||||
const maxMb = Number.isFinite(limitMb) && limitMb > 0 ? limitMb : 0;
|
||||
if (maxMb && file.size > maxMb * 1024 * 1024) {
|
||||
showError(`Архив ${(file.size / 1024 / 1024).toFixed(1)} МБ больше лимита ${maxMb} МБ`);
|
||||
e.target.value = '';
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user