aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-14 17:17:01 +0100
committerChocobozzz <me@florianbigard.com>2021-12-14 17:17:01 +0100
commit3cf68b869decf07ff7435fe1436d4f3134df1bf4 (patch)
tree836efe5ddc626fef3ba4c96269efbca305f46256 /server/initializers
parenta6f919e455f2c6ae8f2194da4aa66824a6bfd09e (diff)
downloadPeerTube-3cf68b869decf07ff7435fe1436d4f3134df1bf4.tar.gz
PeerTube-3cf68b869decf07ff7435fe1436d4f3134df1bf4.tar.zst
PeerTube-3cf68b869decf07ff7435fe1436d4f3134df1bf4.zip
Ability for admins to set default upload values
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/checker-before-init.ts1
-rw-r--r--server/initializers/config.ts11
2 files changed, 11 insertions, 1 deletions
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts
index c85c389cd..2c24e20c8 100644
--- a/server/initializers/checker-before-init.ts
+++ b/server/initializers/checker-before-init.ts
@@ -34,6 +34,7 @@ function checkMissedConfig () {
34 'import.videos.http.enabled', 'import.videos.torrent.enabled', 'import.videos.concurrency', 'auto_blacklist.videos.of_users.enabled', 34 'import.videos.http.enabled', 'import.videos.torrent.enabled', 'import.videos.concurrency', 'auto_blacklist.videos.of_users.enabled',
35 'trending.videos.interval_days', 35 'trending.videos.interval_days',
36 'client.videos.miniature.prefer_author_display_name', 'client.menu.login.redirect_on_single_external_auth', 36 'client.videos.miniature.prefer_author_display_name', 'client.menu.login.redirect_on_single_external_auth',
37 'defaults.publish.download_enabled', 'defaults.publish.comments_enabled', 'defaults.publish.privacy', 'defaults.publish.licence',
37 'instance.name', 'instance.short_description', 'instance.description', 'instance.terms', 'instance.default_client_route', 38 'instance.name', 'instance.short_description', 'instance.description', 'instance.terms', 'instance.default_client_route',
38 'instance.is_nsfw', 'instance.default_nsfw_policy', 'instance.robots', 'instance.securitytxt', 39 'instance.is_nsfw', 'instance.default_nsfw_policy', 'instance.robots', 'instance.securitytxt',
39 'services.twitter.username', 'services.twitter.whitelisted', 40 'services.twitter.username', 'services.twitter.whitelisted',
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index eb848be6b..70179d25c 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -4,7 +4,7 @@ import { dirname, join } from 'path'
4import { decacheModule } from '@server/helpers/decache' 4import { decacheModule } from '@server/helpers/decache'
5import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type' 5import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type'
6import { BroadcastMessageLevel } from '@shared/models/server' 6import { BroadcastMessageLevel } from '@shared/models/server'
7import { VideosRedundancyStrategy } from '../../shared/models' 7import { VideoPrivacy, VideosRedundancyStrategy } from '../../shared/models'
8import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' 8import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
9import { buildPath, parseBytes, parseDurationToMs, root } from '../helpers/core-utils' 9import { buildPath, parseBytes, parseDurationToMs, root } from '../helpers/core-utils'
10 10
@@ -71,6 +71,15 @@ const CONFIG = {
71 } 71 }
72 }, 72 },
73 73
74 DEFAULTS: {
75 PUBLISH: {
76 DOWNLOAD_ENABLED: config.get<boolean>('defaults.publish.download_enabled'),
77 COMMENTS_ENABLED: config.get<boolean>('defaults.publish.comments_enabled'),
78 PRIVACY: config.get<VideoPrivacy>('defaults.publish.privacy'),
79 LICENCE: config.get<number>('defaults.publish.licence')
80 }
81 },
82
74 STORAGE: { 83 STORAGE: {
75 TMP_DIR: buildPath(config.get<string>('storage.tmp')), 84 TMP_DIR: buildPath(config.get<string>('storage.tmp')),
76 BIN_DIR: buildPath(config.get<string>('storage.bin')), 85 BIN_DIR: buildPath(config.get<string>('storage.bin')),