aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/checker-before-init.ts3
-rw-r--r--server/initializers/config.ts4
-rw-r--r--server/initializers/constants.ts19
-rw-r--r--server/initializers/database.ts4
4 files changed, 27 insertions, 3 deletions
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts
index 0a315ea70..939b73344 100644
--- a/server/initializers/checker-before-init.ts
+++ b/server/initializers/checker-before-init.ts
@@ -29,7 +29,8 @@ function checkMissedConfig () {
29 'video_channels.max_per_user', 29 'video_channels.max_per_user',
30 'csp.enabled', 'csp.report_only', 'csp.report_uri', 30 'csp.enabled', 'csp.report_only', 'csp.report_uri',
31 'security.frameguard.enabled', 'security.powered_by_header.enabled', 31 'security.frameguard.enabled', 'security.powered_by_header.enabled',
32 'cache.previews.size', 'cache.captions.size', 'cache.torrents.size', 'admin.email', 'contact_form.enabled', 32 'cache.previews.size', 'cache.captions.size', 'cache.torrents.size', 'cache.storyboards.size',
33 'admin.email', 'contact_form.enabled',
33 'signup.enabled', 'signup.limit', 'signup.requires_approval', 'signup.requires_email_verification', 'signup.minimum_age', 34 'signup.enabled', 'signup.limit', 'signup.requires_approval', 'signup.requires_email_verification', 'signup.minimum_age',
34 'signup.filters.cidr.whitelist', 'signup.filters.cidr.blacklist', 35 'signup.filters.cidr.whitelist', 'signup.filters.cidr.blacklist',
35 'redundancy.videos.strategies', 'redundancy.videos.check_interval', 36 'redundancy.videos.strategies', 'redundancy.videos.check_interval',
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index 51ac5d0ce..60ab6e204 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -112,6 +112,7 @@ const CONFIG = {
112 STREAMING_PLAYLISTS_DIR: buildPath(config.get<string>('storage.streaming_playlists')), 112 STREAMING_PLAYLISTS_DIR: buildPath(config.get<string>('storage.streaming_playlists')),
113 REDUNDANCY_DIR: buildPath(config.get<string>('storage.redundancy')), 113 REDUNDANCY_DIR: buildPath(config.get<string>('storage.redundancy')),
114 THUMBNAILS_DIR: buildPath(config.get<string>('storage.thumbnails')), 114 THUMBNAILS_DIR: buildPath(config.get<string>('storage.thumbnails')),
115 STORYBOARDS_DIR: buildPath(config.get<string>('storage.storyboards')),
115 PREVIEWS_DIR: buildPath(config.get<string>('storage.previews')), 116 PREVIEWS_DIR: buildPath(config.get<string>('storage.previews')),
116 CAPTIONS_DIR: buildPath(config.get<string>('storage.captions')), 117 CAPTIONS_DIR: buildPath(config.get<string>('storage.captions')),
117 TORRENTS_DIR: buildPath(config.get<string>('storage.torrents')), 118 TORRENTS_DIR: buildPath(config.get<string>('storage.torrents')),
@@ -482,6 +483,9 @@ const CONFIG = {
482 }, 483 },
483 TORRENTS: { 484 TORRENTS: {
484 get SIZE () { return config.get<number>('cache.torrents.size') } 485 get SIZE () { return config.get<number>('cache.torrents.size') }
486 },
487 STORYBOARDS: {
488 get SIZE () { return config.get<number>('cache.storyboards.size') }
485 } 489 }
486 }, 490 },
487 INSTANCE: { 491 INSTANCE: {
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index e2f34fe16..3a643a60b 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -174,6 +174,7 @@ const JOB_ATTEMPTS: { [id in JobType]: number } = {
174 'after-video-channel-import': 1, 174 'after-video-channel-import': 1,
175 'move-to-object-storage': 3, 175 'move-to-object-storage': 3,
176 'transcoding-job-builder': 1, 176 'transcoding-job-builder': 1,
177 'generate-video-storyboard': 1,
177 'notify': 1, 178 'notify': 1,
178 'federate-video': 1 179 'federate-video': 1
179} 180}
@@ -198,6 +199,7 @@ const JOB_CONCURRENCY: { [id in Exclude<JobType, 'video-transcoding' | 'video-im
198 'video-channel-import': 1, 199 'video-channel-import': 1,
199 'after-video-channel-import': 1, 200 'after-video-channel-import': 1,
200 'transcoding-job-builder': 1, 201 'transcoding-job-builder': 1,
202 'generate-video-storyboard': 1,
201 'notify': 5, 203 'notify': 5,
202 'federate-video': 3 204 'federate-video': 3
203} 205}
@@ -218,6 +220,7 @@ const JOB_TTL: { [id in JobType]: number } = {
218 'activitypub-refresher': 60000 * 10, // 10 minutes 220 'activitypub-refresher': 60000 * 10, // 10 minutes
219 'video-redundancy': 1000 * 3600 * 3, // 3 hours 221 'video-redundancy': 1000 * 3600 * 3, // 3 hours
220 'video-live-ending': 1000 * 60 * 10, // 10 minutes 222 'video-live-ending': 1000 * 60 * 10, // 10 minutes
223 'generate-video-storyboard': 1000 * 60 * 10, // 10 minutes
221 'manage-video-torrent': 1000 * 3600 * 3, // 3 hours 224 'manage-video-torrent': 1000 * 3600 * 3, // 3 hours
222 'move-to-object-storage': 1000 * 60 * 60 * 3, // 3 hours 225 'move-to-object-storage': 1000 * 60 * 60 * 3, // 3 hours
223 'video-channel-import': 1000 * 60 * 60 * 4, // 4 hours 226 'video-channel-import': 1000 * 60 * 60 * 4, // 4 hours
@@ -766,7 +769,8 @@ const LAZY_STATIC_PATHS = {
766 AVATARS: '/lazy-static/avatars/', 769 AVATARS: '/lazy-static/avatars/',
767 PREVIEWS: '/lazy-static/previews/', 770 PREVIEWS: '/lazy-static/previews/',
768 VIDEO_CAPTIONS: '/lazy-static/video-captions/', 771 VIDEO_CAPTIONS: '/lazy-static/video-captions/',
769 TORRENTS: '/lazy-static/torrents/' 772 TORRENTS: '/lazy-static/torrents/',
773 STORYBOARDS: '/lazy-static/storyboards/'
770} 774}
771const OBJECT_STORAGE_PROXY_PATHS = { 775const OBJECT_STORAGE_PROXY_PATHS = {
772 PRIVATE_WEBSEED: '/object-storage-proxy/webseed/private/', 776 PRIVATE_WEBSEED: '/object-storage-proxy/webseed/private/',
@@ -813,6 +817,14 @@ const ACTOR_IMAGES_SIZE: { [key in ActorImageType]: { width: number, height: num
813 ] 817 ]
814} 818}
815 819
820const STORYBOARD = {
821 SPRITE_SIZE: {
822 width: 192,
823 height: 108
824 },
825 SPRITES_MAX_EDGE_COUNT: 10
826}
827
816const EMBED_SIZE = { 828const EMBED_SIZE = {
817 width: 560, 829 width: 560,
818 height: 315 830 height: 315
@@ -824,6 +836,10 @@ const FILES_CACHE = {
824 DIRECTORY: join(CONFIG.STORAGE.CACHE_DIR, 'previews'), 836 DIRECTORY: join(CONFIG.STORAGE.CACHE_DIR, 'previews'),
825 MAX_AGE: 1000 * 3600 * 3 // 3 hours 837 MAX_AGE: 1000 * 3600 * 3 // 3 hours
826 }, 838 },
839 STORYBOARDS: {
840 DIRECTORY: join(CONFIG.STORAGE.CACHE_DIR, 'storyboards'),
841 MAX_AGE: 1000 * 3600 * 24 // 24 hours
842 },
827 VIDEO_CAPTIONS: { 843 VIDEO_CAPTIONS: {
828 DIRECTORY: join(CONFIG.STORAGE.CACHE_DIR, 'video-captions'), 844 DIRECTORY: join(CONFIG.STORAGE.CACHE_DIR, 'video-captions'),
829 MAX_AGE: 1000 * 3600 * 3 // 3 hours 845 MAX_AGE: 1000 * 3600 * 3 // 3 hours
@@ -1090,6 +1106,7 @@ export {
1090 RESUMABLE_UPLOAD_SESSION_LIFETIME, 1106 RESUMABLE_UPLOAD_SESSION_LIFETIME,
1091 RUNNER_JOB_STATES, 1107 RUNNER_JOB_STATES,
1092 P2P_MEDIA_LOADER_PEER_VERSION, 1108 P2P_MEDIA_LOADER_PEER_VERSION,
1109 STORYBOARD,
1093 ACTOR_IMAGES_SIZE, 1110 ACTOR_IMAGES_SIZE,
1094 ACCEPT_HEADERS, 1111 ACCEPT_HEADERS,
1095 BCRYPT_SALT_SIZE, 1112 BCRYPT_SALT_SIZE,
diff --git a/server/initializers/database.ts b/server/initializers/database.ts
index 9e926c26c..bc120e398 100644
--- a/server/initializers/database.ts
+++ b/server/initializers/database.ts
@@ -10,6 +10,7 @@ import { UserModel } from '@server/models/user/user'
10import { UserNotificationModel } from '@server/models/user/user-notification' 10import { UserNotificationModel } from '@server/models/user/user-notification'
11import { UserRegistrationModel } from '@server/models/user/user-registration' 11import { UserRegistrationModel } from '@server/models/user/user-registration'
12import { UserVideoHistoryModel } from '@server/models/user/user-video-history' 12import { UserVideoHistoryModel } from '@server/models/user/user-video-history'
13import { StoryboardModel } from '@server/models/video/storyboard'
13import { VideoChannelSyncModel } from '@server/models/video/video-channel-sync' 14import { VideoChannelSyncModel } from '@server/models/video/video-channel-sync'
14import { VideoJobInfoModel } from '@server/models/video/video-job-info' 15import { VideoJobInfoModel } from '@server/models/video/video-job-info'
15import { VideoLiveReplaySettingModel } from '@server/models/video/video-live-replay-setting' 16import { VideoLiveReplaySettingModel } from '@server/models/video/video-live-replay-setting'
@@ -167,7 +168,8 @@ async function initDatabaseModels (silent: boolean) {
167 VideoPasswordModel, 168 VideoPasswordModel,
168 RunnerRegistrationTokenModel, 169 RunnerRegistrationTokenModel,
169 RunnerModel, 170 RunnerModel,
170 RunnerJobModel 171 RunnerJobModel,
172 StoryboardModel
171 ]) 173 ])
172 174
173 // Check extensions exist in the database 175 // Check extensions exist in the database