fix: Avatar-Upload auf 5 MB begrenzen
users.avatar.maxSize stand auf 0 (unbegrenzt) — Ressourcenrisiko durch beliebig große Uploads. Migration setzt das ursprüngliche Limit zurück.
This commit is contained in:
parent
c41a6cb056
commit
9948073b25
1 changed files with 17 additions and 0 deletions
17
backend/pb_migrations/1754500100_users_avatar_maxsize.js
Normal file
17
backend/pb_migrations/1754500100_users_avatar_maxsize.js
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
/// <reference path="../pb_data/types.d.ts" />
|
||||||
|
|
||||||
|
// Das Avatar-Feld stand auf maxSize 0 — also unbegrenzt. Das ist ein
|
||||||
|
// Ressourcenrisiko: Ein einzelner Upload könnte beliebig groß sein.
|
||||||
|
// Zurück auf die ursprünglichen 5 MB.
|
||||||
|
|
||||||
|
migrate((app) => {
|
||||||
|
const users = app.findCollectionByNameOrId('users')
|
||||||
|
const avatar = users.fields.getByName('avatar')
|
||||||
|
avatar.maxSize = 5242880
|
||||||
|
app.save(users)
|
||||||
|
}, (app) => {
|
||||||
|
const users = app.findCollectionByNameOrId('users')
|
||||||
|
const avatar = users.fields.getByName('avatar')
|
||||||
|
avatar.maxSize = 0
|
||||||
|
app.save(users)
|
||||||
|
})
|
||||||
Loading…
Reference in a new issue