1
0
Fork 0
peertube/shared/models/server/server-config.model.ts
Florian CUNY 754b6f5f41
Made the video channels limit (per user) server-wide configurable (#4491)
* Made the video channels limit (per user) server-wide configurable

Implements https://github.com/Chocobozzz/PeerTube/issues/3092

Also added a "quota bar" in the account's settings page

* Fixed lint errors

* Another pass at fixing lint errors

* Applied code suggestions

* Removed 'video channels quota'
2021-10-26 16:42:10 +02:00

244 lines
3.7 KiB
TypeScript

import { ClientScript } from '../plugins/plugin-package-json.model'
import { NSFWPolicyType } from '../videos/nsfw-policy.type'
import { BroadcastMessageLevel } from './broadcast-message-level.type'
export interface ServerConfigPlugin {
name: string
version: string
description: string
clientScripts: { [name: string]: ClientScript }
}
export interface ServerConfigTheme extends ServerConfigPlugin {
css: string[]
}
export interface RegisteredExternalAuthConfig {
npmName: string
name: string
version: string
authName: string
authDisplayName: string
}
export interface RegisteredIdAndPassAuthConfig {
npmName: string
name: string
version: string
authName: string
weight: number
}
export interface ServerConfig {
serverVersion: string
serverCommit?: string
client: {
videos: {
miniature: {
preferAuthorDisplayName: boolean
}
}
}
webadmin: {
configuration: {
edition: {
allowed: boolean
}
}
}
instance: {
name: string
shortDescription: string
isNSFW: boolean
defaultNSFWPolicy: NSFWPolicyType
defaultClientRoute: string
customizations: {
javascript: string
css: string
}
}
search: {
remoteUri: {
users: boolean
anonymous: boolean
}
searchIndex: {
enabled: boolean
url: string
disableLocalSearch: boolean
isDefaultSearch: boolean
}
}
plugin: {
registered: ServerConfigPlugin[]
registeredExternalAuths: RegisteredExternalAuthConfig[]
registeredIdAndPassAuths: RegisteredIdAndPassAuthConfig[]
}
theme: {
registered: ServerConfigTheme[]
default: string
}
email: {
enabled: boolean
}
contactForm: {
enabled: boolean
}
signup: {
allowed: boolean
allowedForCurrentIP: boolean
requiresEmailVerification: boolean
minimumAge: number
}
transcoding: {
hls: {
enabled: boolean
}
webtorrent: {
enabled: boolean
}
enabledResolutions: number[]
profile: string
availableProfiles: string[]
}
live: {
enabled: boolean
maxDuration: number
maxInstanceLives: number
maxUserLives: number
allowReplay: boolean
transcoding: {
enabled: boolean
enabledResolutions: number[]
profile: string
availableProfiles: string[]
}
rtmp: {
port: number
}
}
import: {
videos: {
http: {
enabled: boolean
}
torrent: {
enabled: boolean
}
}
}
autoBlacklist: {
videos: {
ofUsers: {
enabled: boolean
}
}
}
avatar: {
file: {
size: {
max: number
}
extensions: string[]
}
}
banner: {
file: {
size: {
max: number
}
extensions: string[]
}
}
video: {
image: {
size: {
max: number
}
extensions: string[]
}
file: {
extensions: string[]
}
}
videoCaption: {
file: {
size: {
max: number
}
extensions: string[]
}
}
user: {
videoQuota: number
videoQuotaDaily: number
}
videoChannels: {
maxPerUser: number
}
trending: {
videos: {
intervalDays: number
algorithms: {
enabled: string[]
default: string
}
}
}
tracker: {
enabled: boolean
}
followings: {
instance: {
autoFollowIndex: {
indexUrl: string
}
}
}
broadcastMessage: {
enabled: boolean
message: string
level: BroadcastMessageLevel
dismissable: boolean
}
homepage: {
enabled: boolean
}
}
export type HTMLServerConfig = Omit<ServerConfig, 'signup'>