mirror of
https://github.com/diced/zipline.git
synced 2025-05-10 18:05:54 +02:00
370 lines
9.5 KiB
Text
Executable file
370 lines
9.5 KiB
Text
Executable file
generator client {
|
|
provider = "prisma-client-js"
|
|
output = "../generated/client"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Zipline {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
firstSetup Boolean @default(true)
|
|
|
|
coreReturnHttpsUrls Boolean @default(false)
|
|
coreDefaultDomain String?
|
|
coreTempDirectory String // default join(tmpdir(), 'zipline')
|
|
|
|
chunksEnabled Boolean @default(true)
|
|
chunksMax String @default("95mb")
|
|
chunksSize String @default("25mb")
|
|
|
|
tasksDeleteInterval String @default("30m")
|
|
tasksClearInvitesInterval String @default("30m")
|
|
tasksMaxViewsInterval String @default("30m")
|
|
tasksThumbnailsInterval String @default("30m")
|
|
tasksMetricsInterval String @default("30m")
|
|
|
|
filesRoute String @default("/u")
|
|
filesLength Int @default(6)
|
|
filesDefaultFormat String @default("random")
|
|
filesDisabledExtensions String[]
|
|
filesMaxFileSize String @default("100mb")
|
|
filesDefaultExpiration String?
|
|
filesAssumeMimetypes Boolean @default(false)
|
|
filesDefaultDateFormat String @default("YYYY-MM-DD_HH:mm:ss")
|
|
filesRemoveGpsMetadata Boolean @default(false)
|
|
filesRandomWordsNumAdjectives Int @default(2)
|
|
filesRandomWordsSeparator String @default("-")
|
|
|
|
urlsRoute String @default("/go")
|
|
urlsLength Int @default(6)
|
|
|
|
featuresImageCompression Boolean @default(true)
|
|
featuresRobotsTxt Boolean @default(true)
|
|
featuresHealthcheck Boolean @default(true)
|
|
featuresUserRegistration Boolean @default(false)
|
|
featuresOauthRegistration Boolean @default(false)
|
|
featuresDeleteOnMaxViews Boolean @default(true)
|
|
|
|
featuresThumbnailsEnabled Boolean @default(true)
|
|
featuresThumbnailsNumberThreads Int @default(4)
|
|
|
|
featuresMetricsEnabled Boolean @default(true)
|
|
featuresMetricsAdminOnly Boolean @default(false)
|
|
featuresMetricsShowUserSpecific Boolean @default(true)
|
|
|
|
invitesEnabled Boolean @default(true)
|
|
invitesLength Int @default(6)
|
|
|
|
websiteTitle String @default("Zipline")
|
|
websiteTitleLogo String?
|
|
websiteExternalLinks Json @default("[{ \"name\": \"GitHub\", \"url\": \"https://github.com/diced/zipline\"}, { \"name\": \"Documentation\", \"url\": \"https://zipline.diced.sh/\"}]")
|
|
websiteLoginBackground String?
|
|
websiteLoginBackgroundBlur Boolean @default(true)
|
|
websiteDefaultAvatar String?
|
|
websiteTos String?
|
|
|
|
websiteThemeDefault String @default("system")
|
|
websiteThemeDark String @default("builtin:dark_gray")
|
|
websiteThemeLight String @default("builtin:light_gray")
|
|
|
|
oauthBypassLocalLogin Boolean @default(false)
|
|
oauthLoginOnly Boolean @default(false)
|
|
|
|
oauthDiscordClientId String?
|
|
oauthDiscordClientSecret String?
|
|
oauthDiscordRedirectUri String?
|
|
|
|
oauthGoogleClientId String?
|
|
oauthGoogleClientSecret String?
|
|
oauthGoogleRedirectUri String?
|
|
|
|
oauthGithubClientId String?
|
|
oauthGithubClientSecret String?
|
|
oauthGithubRedirectUri String?
|
|
|
|
oauthOidcClientId String?
|
|
oauthOidcClientSecret String?
|
|
oauthOidcAuthorizeUrl String?
|
|
oauthOidcTokenUrl String?
|
|
oauthOidcUserinfoUrl String?
|
|
oauthOidcRedirectUri String?
|
|
|
|
mfaTotpEnabled Boolean @default(false)
|
|
mfaTotpIssuer String @default("Zipline")
|
|
mfaPasskeys Boolean @default(false)
|
|
|
|
ratelimitEnabled Boolean @default(true)
|
|
ratelimitMax Int @default(10)
|
|
ratelimitWindow Int?
|
|
ratelimitAdminBypass Boolean @default(true)
|
|
ratelimitAllowList String[]
|
|
|
|
httpWebhookOnUpload String?
|
|
httpWebhookOnShorten String?
|
|
|
|
discordWebhookUrl String?
|
|
discordUsername String?
|
|
discordAvatarUrl String?
|
|
|
|
discordOnUploadWebhookUrl String?
|
|
discordOnUploadUsername String?
|
|
discordOnUploadAvatarUrl String?
|
|
discordOnUploadContent String?
|
|
discordOnUploadEmbed Json?
|
|
|
|
discordOnShortenWebhookUrl String?
|
|
discordOnShortenUsername String?
|
|
discordOnShortenAvatarUrl String?
|
|
discordOnShortenContent String?
|
|
discordOnShortenEmbed Json?
|
|
|
|
pwaEnabled Boolean @default(false)
|
|
pwaTitle String @default("Zipline")
|
|
pwaShortName String @default("Zipline")
|
|
pwaDescription String @default("Zipline")
|
|
pwaThemeColor String @default("#000000")
|
|
pwaBackgroundColor String @default("#000000")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
username String @unique
|
|
password String?
|
|
avatar String?
|
|
token String @unique
|
|
role Role @default(USER)
|
|
view Json @default("{}")
|
|
|
|
totpSecret String?
|
|
passkeys UserPasskey[]
|
|
sessions String[]
|
|
|
|
quota UserQuota?
|
|
|
|
files File[]
|
|
urls Url[]
|
|
folders Folder[]
|
|
invites Invite[]
|
|
tags Tag[]
|
|
oauthProviders OAuthProvider[]
|
|
IncompleteFile IncompleteFile[]
|
|
exports Export[]
|
|
}
|
|
|
|
model Export {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
completed Boolean @default(false)
|
|
path String
|
|
files Int
|
|
size String
|
|
|
|
User User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
userId String
|
|
}
|
|
|
|
model UserQuota {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
filesQuota UserFilesQuota
|
|
maxBytes String?
|
|
maxFiles Int?
|
|
|
|
maxUrls Int?
|
|
|
|
User User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
userId String? @unique
|
|
}
|
|
|
|
enum UserFilesQuota {
|
|
BY_BYTES
|
|
BY_FILES
|
|
}
|
|
|
|
model UserPasskey {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
lastUsed DateTime?
|
|
|
|
name String
|
|
reg Json
|
|
|
|
User User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
userId String
|
|
}
|
|
|
|
enum Role {
|
|
USER
|
|
ADMIN
|
|
SUPERADMIN
|
|
}
|
|
|
|
model OAuthProvider {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
userId String
|
|
provider OAuthProviderType
|
|
|
|
username String
|
|
accessToken String
|
|
refreshToken String?
|
|
oauthId String?
|
|
|
|
user User @relation(fields: [userId], references: [id])
|
|
|
|
@@unique([provider, oauthId])
|
|
}
|
|
|
|
enum OAuthProviderType {
|
|
DISCORD
|
|
GOOGLE
|
|
GITHUB
|
|
OIDC
|
|
}
|
|
|
|
model File {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
deletesAt DateTime?
|
|
|
|
name String // name & file saved on datasource
|
|
originalName String? // original name of file when uploaded
|
|
size BigInt
|
|
type String
|
|
views Int @default(0)
|
|
maxViews Int?
|
|
favorite Boolean @default(false)
|
|
password String?
|
|
|
|
tags Tag[]
|
|
|
|
User User? @relation(fields: [userId], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
userId String?
|
|
|
|
Folder Folder? @relation(fields: [folderId], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
folderId String?
|
|
|
|
thumbnail Thumbnail?
|
|
}
|
|
|
|
model Thumbnail {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
path String
|
|
|
|
file File @relation(fields: [fileId], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
fileId String
|
|
|
|
@@unique([fileId])
|
|
}
|
|
|
|
model Folder {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
name String
|
|
public Boolean @default(false)
|
|
allowUploads Boolean @default(false)
|
|
|
|
files File[]
|
|
|
|
User User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
userId String
|
|
}
|
|
|
|
model IncompleteFile {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
status IncompleteFileStatus
|
|
chunksTotal Int
|
|
chunksComplete Int
|
|
|
|
metadata Json
|
|
|
|
User User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
userId String
|
|
}
|
|
|
|
enum IncompleteFileStatus {
|
|
PENDING
|
|
PROCESSING
|
|
COMPLETE
|
|
FAILED
|
|
}
|
|
|
|
model Tag {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
name String @unique
|
|
color String
|
|
|
|
files File[]
|
|
User User? @relation(fields: [userId], references: [id])
|
|
userId String?
|
|
}
|
|
|
|
model Url {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
code String
|
|
vanity String?
|
|
destination String
|
|
views Int @default(0)
|
|
maxViews Int?
|
|
password String?
|
|
enabled Boolean @default(true)
|
|
|
|
User User? @relation(fields: [userId], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
userId String?
|
|
|
|
@@unique([code, vanity])
|
|
}
|
|
|
|
model Metric {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
data Json
|
|
}
|
|
|
|
model Invite {
|
|
id String @id @default(cuid())
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
expiresAt DateTime?
|
|
|
|
code String @unique
|
|
uses Int @default(0)
|
|
maxUses Int?
|
|
|
|
inviter User @relation(fields: [inviterId], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
inviterId String
|
|
}
|