aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
authorWicklow <123956049+wickloww@users.noreply.github.com>2023-04-07 08:09:54 +0000
committerGitHub <noreply@github.com>2023-04-07 10:09:54 +0200
commitb302c80dc0d9ba8eabef9ef6576efe36afc57584 (patch)
tree14d406b41291805deb94a36a5e79f8d6989355f8 /server/initializers
parent9258e9a4a37911fc64b5faada2a7e604bd1ede1f (diff)
downloadPeerTube-b302c80dc0d9ba8eabef9ef6576efe36afc57584.tar.gz
PeerTube-b302c80dc0d9ba8eabef9ef6576efe36afc57584.tar.zst
PeerTube-b302c80dc0d9ba8eabef9ef6576efe36afc57584.zip
feature/ability to disable video history by default (#5728)
* draft: ability to disable video history by default * Update configuration and add tests * Updated code based on review comments * Add tests on registration and video quota * Remove required video quotas in query * Fix tests
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/checker-before-init.ts2
-rw-r--r--server/initializers/config.ts5
2 files changed, 6 insertions, 1 deletions
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts
index 1351749a6..49010c059 100644
--- a/server/initializers/checker-before-init.ts
+++ b/server/initializers/checker-before-init.ts
@@ -24,7 +24,7 @@ function checkMissedConfig () {
24 'open_telemetry.metrics.enabled', 'open_telemetry.metrics.prometheus_exporter.hostname', 24 'open_telemetry.metrics.enabled', 'open_telemetry.metrics.prometheus_exporter.hostname',
25 'open_telemetry.metrics.prometheus_exporter.port', 'open_telemetry.tracing.enabled', 'open_telemetry.tracing.jaeger_exporter.endpoint', 25 'open_telemetry.metrics.prometheus_exporter.port', 'open_telemetry.tracing.enabled', 'open_telemetry.tracing.jaeger_exporter.endpoint',
26 'open_telemetry.metrics.http_request_duration.enabled', 26 'open_telemetry.metrics.http_request_duration.enabled',
27 'user.video_quota', 'user.video_quota_daily', 27 'user.history.videos.enabled', 'user.video_quota', 'user.video_quota_daily',
28 'video_channels.max_per_user', 28 'video_channels.max_per_user',
29 'csp.enabled', 'csp.report_only', 'csp.report_uri', 29 'csp.enabled', 'csp.report_only', 'csp.report_uri',
30 'security.frameguard.enabled', 'security.powered_by_header.enabled', 30 'security.frameguard.enabled', 'security.powered_by_header.enabled',
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index eb9d0079c..e2442213c 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -324,6 +324,11 @@ const CONFIG = {
324 } 324 }
325 }, 325 },
326 USER: { 326 USER: {
327 HISTORY: {
328 VIDEOS: {
329 get ENABLED () { return config.get<boolean>('user.history.videos.enabled') }
330 }
331 },
327 get VIDEO_QUOTA () { return parseBytes(config.get<number>('user.video_quota')) }, 332 get VIDEO_QUOTA () { return parseBytes(config.get<number>('user.video_quota')) },
328 get VIDEO_QUOTA_DAILY () { return parseBytes(config.get<number>('user.video_quota_daily')) } 333 get VIDEO_QUOTA_DAILY () { return parseBytes(config.get<number>('user.video_quota_daily')) }
329 }, 334 },