fix: raise upload size cap from 500 MB to 5 GB
The 500 MB cap was arbitrary. Self-hosted admins should decide based on their own disk space. Global multipart ceiling raised to 5 GB, validation cap to 5120 MB.
This commit is contained in:
@@ -61,7 +61,7 @@ async function main(): Promise<void> {
|
|||||||
|
|
||||||
await app.register(multipart, {
|
await app.register(multipart, {
|
||||||
limits: {
|
limits: {
|
||||||
fileSize: 500 * 1024 * 1024, // 500MB hard ceiling — actual limit enforced per-request
|
fileSize: 5 * 1024 * 1024 * 1024, // 5GB hard ceiling — actual limit enforced per-request from DB
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -224,8 +224,8 @@ export async function settingsRoutes(app: FastifyInstance): Promise<void> {
|
|||||||
|
|
||||||
if (body.maxUploadSizeMb !== undefined) {
|
if (body.maxUploadSizeMb !== undefined) {
|
||||||
const mb = Number(body.maxUploadSizeMb);
|
const mb = Number(body.maxUploadSizeMb);
|
||||||
if (isNaN(mb) || mb < 1 || mb > 500) {
|
if (isNaN(mb) || mb < 1 || mb > 5120) {
|
||||||
return reply.code(400).send({ error: 'maxUploadSizeMb must be between 1 and 500', statusCode: 400 });
|
return reply.code(400).send({ error: 'maxUploadSizeMb must be between 1 and 5120', statusCode: 400 });
|
||||||
}
|
}
|
||||||
updateData.maxUploadSizeBytes = Math.round(mb * 1024 * 1024);
|
updateData.maxUploadSizeBytes = Math.round(mb * 1024 * 1024);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ export function StoragePanel() {
|
|||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
min={1}
|
min={1}
|
||||||
max={500}
|
max={5120}
|
||||||
value={uploadLimitMb}
|
value={uploadLimitMb}
|
||||||
onChange={(e) => { setUploadLimitMb(Number(e.target.value)); setUploadLimitDirty(true); }}
|
onChange={(e) => { setUploadLimitMb(Number(e.target.value)); setUploadLimitDirty(true); }}
|
||||||
className="input-standard w-20 px-2 py-1 text-sm text-center"
|
className="input-standard w-20 px-2 py-1 text-sm text-center"
|
||||||
@@ -208,7 +208,7 @@ export function StoragePanel() {
|
|||||||
<span className="text-sm text-txt-tertiary">MB</span>
|
<span className="text-sm text-txt-tertiary">MB</span>
|
||||||
<button
|
<button
|
||||||
onClick={handleUploadLimitSave}
|
onClick={handleUploadLimitSave}
|
||||||
disabled={!uploadLimitDirty || uploadLimitSaving || uploadLimitMb < 1 || uploadLimitMb > 500}
|
disabled={!uploadLimitDirty || uploadLimitSaving || uploadLimitMb < 1 || uploadLimitMb > 5120}
|
||||||
className="px-3 py-1 bg-accent-primary hover:bg-accent-primary/80 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 ml-auto"
|
className="px-3 py-1 bg-accent-primary hover:bg-accent-primary/80 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 ml-auto"
|
||||||
>
|
>
|
||||||
{uploadLimitSaving ? 'Saving...' : 'Save'}
|
{uploadLimitSaving ? 'Saving...' : 'Save'}
|
||||||
|
|||||||
Reference in New Issue
Block a user