feat: reverse shares (#86)

* add first concept

* add reverse share funcionality to frontend

* allow creator to limit share expiration

* moved reverse share in seperate module

* add table to manage reverse shares

* delete complete share if reverse share was deleted

* optimize function names

* add db migration

* enable reverse share email notifications

* fix config variable descriptions

* fix migration for new installations
This commit is contained in:
Elias Schneider
2023-01-26 13:44:04 +01:00
committed by GitHub
parent 1ceb07b89e
commit 4a5fb549c6
43 changed files with 1456 additions and 280 deletions

View File

@@ -30,7 +30,7 @@ export class FileService {
const share = await this.prisma.share.findUnique({
where: { id: shareId },
include: { files: true },
include: { files: true, reverseShare: true },
});
if (share.uploadLocked)
@@ -64,9 +64,12 @@ export class FileService {
0
);
const shareSizeSum = fileSizeSum + diskFileSize + buffer.byteLength;
if (
fileSizeSum + diskFileSize + buffer.byteLength >
this.config.get("MAX_SHARE_SIZE")
shareSizeSum > this.config.get("MAX_SHARE_SIZE") ||
(share.reverseShare?.maxShareSize &&
shareSizeSum > parseInt(share.reverseShare.maxShareSize))
) {
throw new HttpException(
"Max share size exceeded",