Make admin quotas editable and simplify uploader storage

This commit is contained in:
2026-10-15 12:51:42 +09:00
parent 4d527f74e6
commit 328fad2e36
26 changed files with 1101 additions and 205 deletions

View File

@@ -159,7 +159,7 @@ export class Accounts {
input.count > cfg.maxItems ||
(input.kind === 'url' && input.byteSize > cfg.maxUrlBytes) ||
(input.kind === 'text' && input.byteSize > cfg.maxTextBytes) ||
input.files?.some((f) => f.size > cfg.maxFileBytes)
input.files?.some((f) => f.size > this.service.admin.state.perFileBytes)
)
fail(413, 'TRANSFER_LIMIT', '전송 크기 또는 개수 제한을 초과했습니다.');
if (policy === 'request') {
@@ -555,11 +555,11 @@ export class Accounts {
.reduce((sum, row) => sum + row.bytes, 0);
return (
[...files.values()].reduce((sum, bytes) => sum + bytes, 0) + reserved + file.size <=
this.service.cfg.userQuota
this.service.admin.state.accountBytes
);
}
ensureQuota(userId: string, bytes: number) {
if (this.used(userId) + bytes > this.service.cfg.userQuota)
if (this.used(userId) + bytes > this.service.admin.state.accountBytes)
fail(413, 'ACCOUNT_QUOTA', '계정 저장 용량을 초과했습니다.');
}
favorite(userId: string, id: string, value: boolean) {