From fd206f0b2d7e5c8e00e2817266d90ec54f79e1da Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 17 Jan 2018 10:32:03 +0100 Subject: Add ability to update some configuration keys --- shared/models/config/custom-config.model.ts | 32 +++++++++++++++++++++++++++++ shared/models/config/server-config.model.ts | 21 +++++++++++++++++++ shared/models/index.ts | 2 +- shared/models/server-config.model.ts | 21 ------------------- shared/models/users/user-right.enum.ts | 1 + 5 files changed, 55 insertions(+), 22 deletions(-) create mode 100644 shared/models/config/custom-config.model.ts create mode 100644 shared/models/config/server-config.model.ts delete mode 100644 shared/models/server-config.model.ts (limited to 'shared/models') diff --git a/shared/models/config/custom-config.model.ts b/shared/models/config/custom-config.model.ts new file mode 100644 index 000000000..73b5b6a72 --- /dev/null +++ b/shared/models/config/custom-config.model.ts @@ -0,0 +1,32 @@ +export interface CustomConfig { + cache: { + previews: { + size: number + } + } + + signup: { + enabled: boolean + limit: number + } + + admin: { + email: string + } + + user: { + videoQuota: number + } + + transcoding: { + enabled: boolean + threads: number + resolutions: { + '240p': boolean + '360p': boolean + '480p': boolean + '720p': boolean + '1080p': boolean + } + } +} diff --git a/shared/models/config/server-config.model.ts b/shared/models/config/server-config.model.ts new file mode 100644 index 000000000..d0b2e40de --- /dev/null +++ b/shared/models/config/server-config.model.ts @@ -0,0 +1,21 @@ +export interface ServerConfig { + signup: { + allowed: boolean + } + transcoding: { + enabledResolutions: number[] + } + avatar: { + file: { + size: { + max: number + }, + extensions: string[] + } + } + video: { + file: { + extensions: string[] + } + } +} diff --git a/shared/models/index.ts b/shared/models/index.ts index a88c01608..1b877774c 100644 --- a/shared/models/index.ts +++ b/shared/models/index.ts @@ -5,4 +5,4 @@ export * from './videos' export * from './job.model' export * from './oauth-client-local.model' export * from './result-list.model' -export * from './server-config.model' +export * from './config/server-config.model' diff --git a/shared/models/server-config.model.ts b/shared/models/server-config.model.ts deleted file mode 100644 index d0b2e40de..000000000 --- a/shared/models/server-config.model.ts +++ /dev/null @@ -1,21 +0,0 @@ -export interface ServerConfig { - signup: { - allowed: boolean - } - transcoding: { - enabledResolutions: number[] - } - avatar: { - file: { - size: { - max: number - }, - extensions: string[] - } - } - video: { - file: { - extensions: string[] - } - } -} diff --git a/shared/models/users/user-right.enum.ts b/shared/models/users/user-right.enum.ts index 2e7fa1bcf..1fa149999 100644 --- a/shared/models/users/user-right.enum.ts +++ b/shared/models/users/user-right.enum.ts @@ -5,6 +5,7 @@ export enum UserRight { MANAGE_VIDEO_ABUSES, MANAGE_VIDEO_BLACKLIST, MANAGE_JOBS, + MANAGE_CONFIGURATION, REMOVE_ANY_VIDEO, REMOVE_ANY_VIDEO_CHANNEL, REMOVE_ANY_VIDEO_COMMENT -- cgit v1.2.3