diff options
19 files changed, 87 insertions, 12 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html index 537e06d4d..318c8e2c2 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html | |||
@@ -272,6 +272,28 @@ | |||
272 | </div> | 272 | </div> |
273 | </div> | 273 | </div> |
274 | 274 | ||
275 | <div class="form-row mt-4"> <!-- video channels grid --> | ||
276 | <div class="form-group col-12 col-lg-4 col-xl-3"> | ||
277 | <div i18n class="inner-form-title">VIDEO CHANNELS</div> | ||
278 | </div> | ||
279 | |||
280 | <div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> | ||
281 | <div class="form-group" formGroupName="videoChannels"> | ||
282 | <label i18n for="videoChannelsMaxPerUser">Max video channels per user</label> | ||
283 | |||
284 | <div class="number-with-unit"> | ||
285 | <input | ||
286 | type="number" min="1" id="videoChannelsMaxPerUser" class="form-control" | ||
287 | formControlName="maxPerUser" [ngClass]="{ 'input-error': formErrors['videoChannels.maxPerUser'] }" | ||
288 | > | ||
289 | <span i18n>{form.value['videoChannels']['maxPerUser'], plural, =1 {channel} other {channels}}</span> | ||
290 | </div> | ||
291 | |||
292 | <div *ngIf="formErrors.videoChannels.maxPerUser" class="form-error">{{ formErrors.videoChannels.maxPerUser }}</div> | ||
293 | </div> | ||
294 | </div> | ||
295 | </div> | ||
296 | |||
275 | <div class="form-row mt-4"> <!-- search grid --> | 297 | <div class="form-row mt-4"> <!-- search grid --> |
276 | <div class="form-group col-12 col-lg-4 col-xl-3"> | 298 | <div class="form-group col-12 col-lg-4 col-xl-3"> |
277 | <div i18n class="inner-form-title">SEARCH</div> | 299 | <div i18n class="inner-form-title">SEARCH</div> |
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 96c67fac7..fdb0a7532 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |||
@@ -22,7 +22,8 @@ import { | |||
22 | SERVICES_TWITTER_USERNAME_VALIDATOR, | 22 | SERVICES_TWITTER_USERNAME_VALIDATOR, |
23 | SIGNUP_LIMIT_VALIDATOR, | 23 | SIGNUP_LIMIT_VALIDATOR, |
24 | SIGNUP_MINIMUM_AGE_VALIDATOR, | 24 | SIGNUP_MINIMUM_AGE_VALIDATOR, |
25 | TRANSCODING_THREADS_VALIDATOR | 25 | TRANSCODING_THREADS_VALIDATOR, |
26 | MAX_VIDEO_CHANNELS_PER_USER_VALIDATOR | ||
26 | } from '@app/shared/form-validators/custom-config-validators' | 27 | } from '@app/shared/form-validators/custom-config-validators' |
27 | import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators' | 28 | import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators' |
28 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | 29 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' |
@@ -151,6 +152,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { | |||
151 | videoQuota: USER_VIDEO_QUOTA_VALIDATOR, | 152 | videoQuota: USER_VIDEO_QUOTA_VALIDATOR, |
152 | videoQuotaDaily: USER_VIDEO_QUOTA_DAILY_VALIDATOR | 153 | videoQuotaDaily: USER_VIDEO_QUOTA_DAILY_VALIDATOR |
153 | }, | 154 | }, |
155 | videoChannels: { | ||
156 | maxPerUser: MAX_VIDEO_CHANNELS_PER_USER_VALIDATOR | ||
157 | }, | ||
154 | transcoding: { | 158 | transcoding: { |
155 | enabled: null, | 159 | enabled: null, |
156 | threads: TRANSCODING_THREADS_VALIDATOR, | 160 | threads: TRANSCODING_THREADS_VALIDATOR, |
diff --git a/client/src/app/shared/form-validators/custom-config-validators.ts b/client/src/app/shared/form-validators/custom-config-validators.ts index fbf423d08..ba8512e95 100644 --- a/client/src/app/shared/form-validators/custom-config-validators.ts +++ b/client/src/app/shared/form-validators/custom-config-validators.ts | |||
@@ -98,6 +98,15 @@ export const MAX_USER_LIVES_VALIDATOR: BuildFormValidator = { | |||
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | export const MAX_VIDEO_CHANNELS_PER_USER_VALIDATOR: BuildFormValidator = { | ||
102 | VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ], | ||
103 | MESSAGES: { | ||
104 | required: $localize`Max video channels per user is required.`, | ||
105 | min: $localize`Max video channels per user must be greater or equal to 1.`, | ||
106 | pattern: $localize`Max video channels per user must be a number.` | ||
107 | } | ||
108 | } | ||
109 | |||
101 | export const CONCURRENCY_VALIDATOR: BuildFormValidator = { | 110 | export const CONCURRENCY_VALIDATOR: BuildFormValidator = { |
102 | VALIDATORS: [ Validators.required, Validators.min(1) ], | 111 | VALIDATORS: [ Validators.required, Validators.min(1) ], |
103 | MESSAGES: { | 112 | MESSAGES: { |
diff --git a/client/src/app/shared/shared-main/shared-main.module.ts b/client/src/app/shared/shared-main/shared-main.module.ts index 80d0a84f3..93989780d 100644 --- a/client/src/app/shared/shared-main/shared-main.module.ts +++ b/client/src/app/shared/shared-main/shared-main.module.ts | |||
@@ -43,7 +43,12 @@ import { | |||
43 | } from './misc' | 43 | } from './misc' |
44 | import { PluginPlaceholderComponent } from './plugins' | 44 | import { PluginPlaceholderComponent } from './plugins' |
45 | import { ActorRedirectGuard } from './router' | 45 | import { ActorRedirectGuard } from './router' |
46 | import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users' | 46 | import { |
47 | UserHistoryService, | ||
48 | UserNotificationsComponent, | ||
49 | UserNotificationService, | ||
50 | UserQuotaComponent | ||
51 | } from './users' | ||
47 | import { RedundancyService, VideoImportService, VideoOwnershipService, VideoService } from './video' | 52 | import { RedundancyService, VideoImportService, VideoOwnershipService, VideoService } from './video' |
48 | import { VideoCaptionService } from './video-caption' | 53 | import { VideoCaptionService } from './video-caption' |
49 | import { VideoChannelService } from './video-channel' | 54 | import { VideoChannelService } from './video-channel' |
diff --git a/config/default.yaml b/config/default.yaml index f545382c8..cf9d69a62 100644 --- a/config/default.yaml +++ b/config/default.yaml | |||
@@ -296,6 +296,9 @@ user: | |||
296 | video_quota: -1 | 296 | video_quota: -1 |
297 | video_quota_daily: -1 | 297 | video_quota_daily: -1 |
298 | 298 | ||
299 | video_channels: | ||
300 | max_per_user: 20 # Allows each user to create up to 20 video channels. | ||
301 | |||
299 | # If enabled, the video will be transcoded to mp4 (x264) with `faststart` flag | 302 | # If enabled, the video will be transcoded to mp4 (x264) with `faststart` flag |
300 | # In addition, if some resolutions are enabled the mp4 video file will be transcoded to these new resolutions | 303 | # In addition, if some resolutions are enabled the mp4 video file will be transcoded to these new resolutions |
301 | # Please, do not disable transcoding since many uploaded videos will not work | 304 | # Please, do not disable transcoding since many uploaded videos will not work |
diff --git a/config/production.yaml.example b/config/production.yaml.example index 2e0d029ce..70993bf57 100644 --- a/config/production.yaml.example +++ b/config/production.yaml.example | |||
@@ -306,6 +306,9 @@ user: | |||
306 | video_quota: -1 | 306 | video_quota: -1 |
307 | video_quota_daily: -1 | 307 | video_quota_daily: -1 |
308 | 308 | ||
309 | video_channels: | ||
310 | max_per_user: 20 # Allows each user to create up to 20 video channels. | ||
311 | |||
309 | # If enabled, the video will be transcoded to mp4 (x264) with `faststart` flag | 312 | # If enabled, the video will be transcoded to mp4 (x264) with `faststart` flag |
310 | # In addition, if some resolutions are enabled the mp4 video file will be transcoded to these new resolutions | 313 | # In addition, if some resolutions are enabled the mp4 video file will be transcoded to these new resolutions |
311 | # Please, do not disable transcoding since many uploaded videos will not work | 314 | # Please, do not disable transcoding since many uploaded videos will not work |
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 5ea1f67c9..8965cacc9 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -196,6 +196,9 @@ function customConfig (): CustomConfig { | |||
196 | videoQuota: CONFIG.USER.VIDEO_QUOTA, | 196 | videoQuota: CONFIG.USER.VIDEO_QUOTA, |
197 | videoQuotaDaily: CONFIG.USER.VIDEO_QUOTA_DAILY | 197 | videoQuotaDaily: CONFIG.USER.VIDEO_QUOTA_DAILY |
198 | }, | 198 | }, |
199 | videoChannels: { | ||
200 | maxPerUser: CONFIG.VIDEO_CHANNELS.MAX_PER_USER | ||
201 | }, | ||
199 | transcoding: { | 202 | transcoding: { |
200 | enabled: CONFIG.TRANSCODING.ENABLED, | 203 | enabled: CONFIG.TRANSCODING.ENABLED, |
201 | allowAdditionalExtensions: CONFIG.TRANSCODING.ALLOW_ADDITIONAL_EXTENSIONS, | 204 | allowAdditionalExtensions: CONFIG.TRANSCODING.ALLOW_ADDITIONAL_EXTENSIONS, |
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts index 16dc137c0..72acdd422 100644 --- a/server/initializers/checker-before-init.ts +++ b/server/initializers/checker-before-init.ts | |||
@@ -19,6 +19,7 @@ function checkMissedConfig () { | |||
19 | 'storage.redundancy', 'storage.tmp', 'storage.streaming_playlists', 'storage.plugins', | 19 | 'storage.redundancy', 'storage.tmp', 'storage.streaming_playlists', 'storage.plugins', |
20 | 'log.level', | 20 | 'log.level', |
21 | 'user.video_quota', 'user.video_quota_daily', | 21 | 'user.video_quota', 'user.video_quota_daily', |
22 | 'video_channels.max_per_user', | ||
22 | 'csp.enabled', 'csp.report_only', 'csp.report_uri', | 23 | 'csp.enabled', 'csp.report_only', 'csp.report_uri', |
23 | 'security.frameguard.enabled', | 24 | 'security.frameguard.enabled', |
24 | 'cache.previews.size', 'cache.captions.size', 'cache.torrents.size', 'admin.email', 'contact_form.enabled', | 25 | 'cache.previews.size', 'cache.captions.size', 'cache.torrents.size', 'admin.email', 'contact_form.enabled', |
diff --git a/server/initializers/config.ts b/server/initializers/config.ts index cab60a61f..8375bf430 100644 --- a/server/initializers/config.ts +++ b/server/initializers/config.ts | |||
@@ -233,6 +233,9 @@ const CONFIG = { | |||
233 | get VIDEO_QUOTA () { return parseBytes(config.get<number>('user.video_quota')) }, | 233 | get VIDEO_QUOTA () { return parseBytes(config.get<number>('user.video_quota')) }, |
234 | get VIDEO_QUOTA_DAILY () { return parseBytes(config.get<number>('user.video_quota_daily')) } | 234 | get VIDEO_QUOTA_DAILY () { return parseBytes(config.get<number>('user.video_quota_daily')) } |
235 | }, | 235 | }, |
236 | VIDEO_CHANNELS: { | ||
237 | get MAX_PER_USER () { return config.get<number>('video_channels.max_per_user') } | ||
238 | }, | ||
236 | TRANSCODING: { | 239 | TRANSCODING: { |
237 | get ENABLED () { return config.get<boolean>('transcoding.enabled') }, | 240 | get ENABLED () { return config.get<boolean>('transcoding.enabled') }, |
238 | get ALLOW_ADDITIONAL_EXTENSIONS () { return config.get<boolean>('transcoding.allow_additional_extensions') }, | 241 | get ALLOW_ADDITIONAL_EXTENSIONS () { return config.get<boolean>('transcoding.allow_additional_extensions') }, |
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index f6c19dab4..3781f9508 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -512,10 +512,6 @@ const OVERVIEWS = { | |||
512 | } | 512 | } |
513 | } | 513 | } |
514 | 514 | ||
515 | const VIDEO_CHANNELS = { | ||
516 | MAX_PER_USER: 20 | ||
517 | } | ||
518 | |||
519 | // --------------------------------------------------------------------------- | 515 | // --------------------------------------------------------------------------- |
520 | 516 | ||
521 | const SERVER_ACTOR_NAME = 'peertube' | 517 | const SERVER_ACTOR_NAME = 'peertube' |
@@ -897,7 +893,6 @@ export { | |||
897 | VIDEO_TRANSCODING_FPS, | 893 | VIDEO_TRANSCODING_FPS, |
898 | FFMPEG_NICE, | 894 | FFMPEG_NICE, |
899 | ABUSE_STATES, | 895 | ABUSE_STATES, |
900 | VIDEO_CHANNELS, | ||
901 | LRU_CACHE, | 896 | LRU_CACHE, |
902 | REQUEST_TIMEOUT, | 897 | REQUEST_TIMEOUT, |
903 | USER_PASSWORD_RESET_LIFETIME, | 898 | USER_PASSWORD_RESET_LIFETIME, |
diff --git a/server/lib/server-config-manager.ts b/server/lib/server-config-manager.ts index b78251e8c..bdf6492f9 100644 --- a/server/lib/server-config-manager.ts +++ b/server/lib/server-config-manager.ts | |||
@@ -184,6 +184,9 @@ class ServerConfigManager { | |||
184 | videoQuota: CONFIG.USER.VIDEO_QUOTA, | 184 | videoQuota: CONFIG.USER.VIDEO_QUOTA, |
185 | videoQuotaDaily: CONFIG.USER.VIDEO_QUOTA_DAILY | 185 | videoQuotaDaily: CONFIG.USER.VIDEO_QUOTA_DAILY |
186 | }, | 186 | }, |
187 | videoChannels: { | ||
188 | maxPerUser: CONFIG.VIDEO_CHANNELS.MAX_PER_USER | ||
189 | }, | ||
187 | trending: { | 190 | trending: { |
188 | videos: { | 191 | videos: { |
189 | intervalDays: CONFIG.TRENDING.VIDEOS.INTERVAL_DAYS, | 192 | intervalDays: CONFIG.TRENDING.VIDEOS.INTERVAL_DAYS, |
diff --git a/server/middlewares/validators/config.ts b/server/middlewares/validators/config.ts index f0385ab44..da52b14ba 100644 --- a/server/middlewares/validators/config.ts +++ b/server/middlewares/validators/config.ts | |||
@@ -38,6 +38,8 @@ const customConfigUpdateValidator = [ | |||
38 | body('user.videoQuota').custom(isUserVideoQuotaValid).withMessage('Should have a valid video quota'), | 38 | body('user.videoQuota').custom(isUserVideoQuotaValid).withMessage('Should have a valid video quota'), |
39 | body('user.videoQuotaDaily').custom(isUserVideoQuotaDailyValid).withMessage('Should have a valid daily video quota'), | 39 | body('user.videoQuotaDaily').custom(isUserVideoQuotaDailyValid).withMessage('Should have a valid daily video quota'), |
40 | 40 | ||
41 | body('videoChannels.maxPerUser').isInt().withMessage("Should have a valid maximum amount of video channels per user"), | ||
42 | |||
41 | body('transcoding.enabled').isBoolean().withMessage('Should have a valid transcoding enabled boolean'), | 43 | body('transcoding.enabled').isBoolean().withMessage('Should have a valid transcoding enabled boolean'), |
42 | body('transcoding.allowAdditionalExtensions').isBoolean().withMessage('Should have a valid additional extensions boolean'), | 44 | body('transcoding.allowAdditionalExtensions').isBoolean().withMessage('Should have a valid additional extensions boolean'), |
43 | body('transcoding.threads').isInt().withMessage('Should have a valid transcoding threads number'), | 45 | body('transcoding.threads').isInt().withMessage('Should have a valid transcoding threads number'), |
diff --git a/server/middlewares/validators/videos/video-channels.ts b/server/middlewares/validators/videos/video-channels.ts index c4705192a..edce48c7f 100644 --- a/server/middlewares/validators/videos/video-channels.ts +++ b/server/middlewares/validators/videos/video-channels.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { body, param, query } from 'express-validator' | 2 | import { body, param, query } from 'express-validator' |
3 | import { VIDEO_CHANNELS } from '@server/initializers/constants' | ||
4 | import { MChannelAccountDefault, MUser } from '@server/types/models' | 3 | import { MChannelAccountDefault, MUser } from '@server/types/models' |
5 | import { UserRight } from '../../../../shared' | 4 | import { UserRight } from '../../../../shared' |
6 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 5 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
@@ -15,6 +14,7 @@ import { logger } from '../../../helpers/logger' | |||
15 | import { ActorModel } from '../../../models/actor/actor' | 14 | import { ActorModel } from '../../../models/actor/actor' |
16 | import { VideoChannelModel } from '../../../models/video/video-channel' | 15 | import { VideoChannelModel } from '../../../models/video/video-channel' |
17 | import { areValidationErrors, doesLocalVideoChannelNameExist, doesVideoChannelNameWithHostExist } from '../shared' | 16 | import { areValidationErrors, doesLocalVideoChannelNameExist, doesVideoChannelNameWithHostExist } from '../shared' |
17 | import { CONFIG } from '@server/initializers/config' | ||
18 | 18 | ||
19 | const videoChannelsAddValidator = [ | 19 | const videoChannelsAddValidator = [ |
20 | body('name').custom(isVideoChannelUsernameValid).withMessage('Should have a valid channel name'), | 20 | body('name').custom(isVideoChannelUsernameValid).withMessage('Should have a valid channel name'), |
@@ -37,8 +37,8 @@ const videoChannelsAddValidator = [ | |||
37 | } | 37 | } |
38 | 38 | ||
39 | const count = await VideoChannelModel.countByAccount(res.locals.oauth.token.User.Account.id) | 39 | const count = await VideoChannelModel.countByAccount(res.locals.oauth.token.User.Account.id) |
40 | if (count >= VIDEO_CHANNELS.MAX_PER_USER) { | 40 | if (count >= CONFIG.VIDEO_CHANNELS.MAX_PER_USER) { |
41 | res.fail({ message: `You cannot create more than ${VIDEO_CHANNELS.MAX_PER_USER} channels` }) | 41 | res.fail({ message: `You cannot create more than ${CONFIG.VIDEO_CHANNELS.MAX_PER_USER} channels` }) |
42 | return false | 42 | return false |
43 | } | 43 | } |
44 | 44 | ||
diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts index 4151dc5b5..b652d8531 100644 --- a/server/models/video/video-channel.ts +++ b/server/models/video/video-channel.ts | |||
@@ -26,7 +26,7 @@ import { | |||
26 | isVideoChannelDisplayNameValid, | 26 | isVideoChannelDisplayNameValid, |
27 | isVideoChannelSupportValid | 27 | isVideoChannelSupportValid |
28 | } from '../../helpers/custom-validators/video-channels' | 28 | } from '../../helpers/custom-validators/video-channels' |
29 | import { CONSTRAINTS_FIELDS, VIDEO_CHANNELS, WEBSERVER } from '../../initializers/constants' | 29 | import { CONSTRAINTS_FIELDS, WEBSERVER } from '../../initializers/constants' |
30 | import { sendDeleteActor } from '../../lib/activitypub/send' | 30 | import { sendDeleteActor } from '../../lib/activitypub/send' |
31 | import { | 31 | import { |
32 | MChannelActor, | 32 | MChannelActor, |
@@ -44,6 +44,7 @@ import { setAsUpdated } from '../shared' | |||
44 | import { buildServerIdsFollowedBy, buildTrigramSearchIndex, createSimilarityAttribute, getSort, throwIfNotValid } from '../utils' | 44 | import { buildServerIdsFollowedBy, buildTrigramSearchIndex, createSimilarityAttribute, getSort, throwIfNotValid } from '../utils' |
45 | import { VideoModel } from './video' | 45 | import { VideoModel } from './video' |
46 | import { VideoPlaylistModel } from './video-playlist' | 46 | import { VideoPlaylistModel } from './video-playlist' |
47 | import { CONFIG } from '@server/initializers/config' | ||
47 | 48 | ||
48 | export enum ScopeNames { | 49 | export enum ScopeNames { |
49 | FOR_API = 'FOR_API', | 50 | FOR_API = 'FOR_API', |
@@ -584,7 +585,7 @@ ON "Account->Actor"."serverId" = "Account->Actor->Server"."id"` | |||
584 | 585 | ||
585 | static listAllByAccount (accountId: number) { | 586 | static listAllByAccount (accountId: number) { |
586 | const query = { | 587 | const query = { |
587 | limit: VIDEO_CHANNELS.MAX_PER_USER, | 588 | limit: CONFIG.VIDEO_CHANNELS.MAX_PER_USER, |
588 | include: [ | 589 | include: [ |
589 | { | 590 | { |
590 | attributes: [], | 591 | attributes: [], |
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index 87cb2287e..273b1f718 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts | |||
@@ -81,6 +81,9 @@ describe('Test config API validators', function () { | |||
81 | videoQuota: 5242881, | 81 | videoQuota: 5242881, |
82 | videoQuotaDaily: 318742 | 82 | videoQuotaDaily: 318742 |
83 | }, | 83 | }, |
84 | videoChannels: { | ||
85 | maxPerUser: 20 | ||
86 | }, | ||
84 | transcoding: { | 87 | transcoding: { |
85 | enabled: true, | 88 | enabled: true, |
86 | allowAdditionalExtensions: true, | 89 | allowAdditionalExtensions: true, |
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index 1d996d454..8d5b3ac7f 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts | |||
@@ -58,6 +58,8 @@ function checkInitialConfig (server: PeerTubeServer, data: CustomConfig) { | |||
58 | expect(data.user.videoQuota).to.equal(5242880) | 58 | expect(data.user.videoQuota).to.equal(5242880) |
59 | expect(data.user.videoQuotaDaily).to.equal(-1) | 59 | expect(data.user.videoQuotaDaily).to.equal(-1) |
60 | 60 | ||
61 | expect(data.videoChannels.maxPerUser).to.equal(20) | ||
62 | |||
61 | expect(data.transcoding.enabled).to.be.false | 63 | expect(data.transcoding.enabled).to.be.false |
62 | expect(data.transcoding.allowAdditionalExtensions).to.be.false | 64 | expect(data.transcoding.allowAdditionalExtensions).to.be.false |
63 | expect(data.transcoding.allowAudioFiles).to.be.false | 65 | expect(data.transcoding.allowAudioFiles).to.be.false |
@@ -153,6 +155,8 @@ function checkUpdatedConfig (data: CustomConfig) { | |||
153 | expect(data.user.videoQuota).to.equal(5242881) | 155 | expect(data.user.videoQuota).to.equal(5242881) |
154 | expect(data.user.videoQuotaDaily).to.equal(318742) | 156 | expect(data.user.videoQuotaDaily).to.equal(318742) |
155 | 157 | ||
158 | expect(data.videoChannels.maxPerUser).to.equal(24) | ||
159 | |||
156 | expect(data.transcoding.enabled).to.be.true | 160 | expect(data.transcoding.enabled).to.be.true |
157 | expect(data.transcoding.threads).to.equal(1) | 161 | expect(data.transcoding.threads).to.equal(1) |
158 | expect(data.transcoding.concurrency).to.equal(3) | 162 | expect(data.transcoding.concurrency).to.equal(3) |
@@ -265,6 +269,9 @@ const newCustomConfig: CustomConfig = { | |||
265 | videoQuota: 5242881, | 269 | videoQuota: 5242881, |
266 | videoQuotaDaily: 318742 | 270 | videoQuotaDaily: 318742 |
267 | }, | 271 | }, |
272 | videoChannels: { | ||
273 | maxPerUser: 24 | ||
274 | }, | ||
268 | transcoding: { | 275 | transcoding: { |
269 | enabled: true, | 276 | enabled: true, |
270 | allowAdditionalExtensions: true, | 277 | allowAdditionalExtensions: true, |
diff --git a/shared/extra-utils/server/config-command.ts b/shared/extra-utils/server/config-command.ts index 51d04fa63..2746e9ac4 100644 --- a/shared/extra-utils/server/config-command.ts +++ b/shared/extra-utils/server/config-command.ts | |||
@@ -220,6 +220,9 @@ export class ConfigCommand extends AbstractCommand { | |||
220 | videoQuota: 5242881, | 220 | videoQuota: 5242881, |
221 | videoQuotaDaily: 318742 | 221 | videoQuotaDaily: 318742 |
222 | }, | 222 | }, |
223 | videoChannels: { | ||
224 | maxPerUser: 20 | ||
225 | }, | ||
223 | transcoding: { | 226 | transcoding: { |
224 | enabled: true, | 227 | enabled: true, |
225 | allowAdditionalExtensions: true, | 228 | allowAdditionalExtensions: true, |
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts index 75d04423a..322fbb797 100644 --- a/shared/models/server/custom-config.model.ts +++ b/shared/models/server/custom-config.model.ts | |||
@@ -85,6 +85,10 @@ export interface CustomConfig { | |||
85 | videoQuotaDaily: number | 85 | videoQuotaDaily: number |
86 | } | 86 | } |
87 | 87 | ||
88 | videoChannels: { | ||
89 | maxPerUser: number | ||
90 | } | ||
91 | |||
88 | transcoding: { | 92 | transcoding: { |
89 | enabled: boolean | 93 | enabled: boolean |
90 | 94 | ||
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts index a0313b8da..e75eefd47 100644 --- a/shared/models/server/server-config.model.ts +++ b/shared/models/server/server-config.model.ts | |||
@@ -203,6 +203,10 @@ export interface ServerConfig { | |||
203 | videoQuotaDaily: number | 203 | videoQuotaDaily: number |
204 | } | 204 | } |
205 | 205 | ||
206 | videoChannels: { | ||
207 | maxPerUser: number | ||
208 | } | ||
209 | |||
206 | trending: { | 210 | trending: { |
207 | videos: { | 211 | videos: { |
208 | intervalDays: number | 212 | intervalDays: number |