diff options
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/checker-before-init.ts | 2 | ||||
-rw-r--r-- | server/initializers/config.ts | 3 | ||||
-rw-r--r-- | server/initializers/constants.ts | 13 |
3 files changed, 12 insertions, 6 deletions
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts index a186afbdd..2578de5ed 100644 --- a/server/initializers/checker-before-init.ts +++ b/server/initializers/checker-before-init.ts | |||
@@ -17,7 +17,7 @@ function checkMissedConfig () { | |||
17 | 'log.level', | 17 | 'log.level', |
18 | 'user.video_quota', 'user.video_quota_daily', | 18 | 'user.video_quota', 'user.video_quota_daily', |
19 | 'csp.enabled', 'csp.report_only', 'csp.report_uri', | 19 | 'csp.enabled', 'csp.report_only', 'csp.report_uri', |
20 | 'cache.previews.size', 'admin.email', 'contact_form.enabled', | 20 | 'cache.previews.size', 'cache.captions.size', 'cache.torrents.size', 'admin.email', 'contact_form.enabled', |
21 | 'signup.enabled', 'signup.limit', 'signup.requires_email_verification', | 21 | 'signup.enabled', 'signup.limit', 'signup.requires_email_verification', |
22 | 'signup.filters.cidr.whitelist', 'signup.filters.cidr.blacklist', | 22 | 'signup.filters.cidr.whitelist', 'signup.filters.cidr.blacklist', |
23 | 'redundancy.videos.strategies', 'redundancy.videos.check_interval', | 23 | 'redundancy.videos.strategies', 'redundancy.videos.check_interval', |
diff --git a/server/initializers/config.ts b/server/initializers/config.ts index 930fd784e..21ca78584 100644 --- a/server/initializers/config.ts +++ b/server/initializers/config.ts | |||
@@ -266,6 +266,9 @@ const CONFIG = { | |||
266 | }, | 266 | }, |
267 | VIDEO_CAPTIONS: { | 267 | VIDEO_CAPTIONS: { |
268 | get SIZE () { return config.get<number>('cache.captions.size') } | 268 | get SIZE () { return config.get<number>('cache.captions.size') } |
269 | }, | ||
270 | TORRENTS: { | ||
271 | get SIZE () { return config.get<number>('cache.torrents.size') } | ||
269 | } | 272 | } |
270 | }, | 273 | }, |
271 | INSTANCE: { | 274 | INSTANCE: { |
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index be5db8fe8..6b0984186 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -551,16 +551,13 @@ const NSFW_POLICY_TYPES: { [ id: string ]: NSFWPolicyType } = { | |||
551 | 551 | ||
552 | // Express static paths (router) | 552 | // Express static paths (router) |
553 | const STATIC_PATHS = { | 553 | const STATIC_PATHS = { |
554 | PREVIEWS: '/static/previews/', | ||
555 | THUMBNAILS: '/static/thumbnails/', | 554 | THUMBNAILS: '/static/thumbnails/', |
556 | TORRENTS: '/static/torrents/', | 555 | TORRENTS: '/static/torrents/', |
557 | WEBSEED: '/static/webseed/', | 556 | WEBSEED: '/static/webseed/', |
558 | REDUNDANCY: '/static/redundancy/', | 557 | REDUNDANCY: '/static/redundancy/', |
559 | STREAMING_PLAYLISTS: { | 558 | STREAMING_PLAYLISTS: { |
560 | HLS: '/static/streaming-playlists/hls' | 559 | HLS: '/static/streaming-playlists/hls' |
561 | }, | 560 | } |
562 | AVATARS: '/static/avatars/', | ||
563 | VIDEO_CAPTIONS: '/static/video-captions/' | ||
564 | } | 561 | } |
565 | const STATIC_DOWNLOAD_PATHS = { | 562 | const STATIC_DOWNLOAD_PATHS = { |
566 | TORRENTS: '/download/torrents/', | 563 | TORRENTS: '/download/torrents/', |
@@ -570,12 +567,14 @@ const STATIC_DOWNLOAD_PATHS = { | |||
570 | const LAZY_STATIC_PATHS = { | 567 | const LAZY_STATIC_PATHS = { |
571 | AVATARS: '/lazy-static/avatars/', | 568 | AVATARS: '/lazy-static/avatars/', |
572 | PREVIEWS: '/lazy-static/previews/', | 569 | PREVIEWS: '/lazy-static/previews/', |
573 | VIDEO_CAPTIONS: '/lazy-static/video-captions/' | 570 | VIDEO_CAPTIONS: '/lazy-static/video-captions/', |
571 | TORRENTS: '/lazy-static/torrents/' | ||
574 | } | 572 | } |
575 | 573 | ||
576 | // Cache control | 574 | // Cache control |
577 | const STATIC_MAX_AGE = { | 575 | const STATIC_MAX_AGE = { |
578 | SERVER: '2h', | 576 | SERVER: '2h', |
577 | LAZY_SERVER: '2d', | ||
579 | CLIENT: '30d' | 578 | CLIENT: '30d' |
580 | } | 579 | } |
581 | 580 | ||
@@ -609,6 +608,10 @@ const FILES_CACHE = { | |||
609 | VIDEO_CAPTIONS: { | 608 | VIDEO_CAPTIONS: { |
610 | DIRECTORY: join(CONFIG.STORAGE.CACHE_DIR, 'video-captions'), | 609 | DIRECTORY: join(CONFIG.STORAGE.CACHE_DIR, 'video-captions'), |
611 | MAX_AGE: 1000 * 3600 * 3 // 3 hours | 610 | MAX_AGE: 1000 * 3600 * 3 // 3 hours |
611 | }, | ||
612 | TORRENTS: { | ||
613 | DIRECTORY: join(CONFIG.STORAGE.CACHE_DIR, 'torrents'), | ||
614 | MAX_AGE: 1000 * 3600 * 3 // 3 hours | ||
612 | } | 615 | } |
613 | } | 616 | } |
614 | 617 | ||