diff options
Diffstat (limited to 'server/initializers/config.ts')
-rw-r--r-- | server/initializers/config.ts | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/server/initializers/config.ts b/server/initializers/config.ts index 51ac5d0ce..37cd852f1 100644 --- a/server/initializers/config.ts +++ b/server/initializers/config.ts | |||
@@ -106,12 +106,13 @@ const CONFIG = { | |||
106 | TMP_DIR: buildPath(config.get<string>('storage.tmp')), | 106 | TMP_DIR: buildPath(config.get<string>('storage.tmp')), |
107 | TMP_PERSISTENT_DIR: buildPath(config.get<string>('storage.tmp_persistent')), | 107 | TMP_PERSISTENT_DIR: buildPath(config.get<string>('storage.tmp_persistent')), |
108 | BIN_DIR: buildPath(config.get<string>('storage.bin')), | 108 | BIN_DIR: buildPath(config.get<string>('storage.bin')), |
109 | ACTOR_IMAGES: buildPath(config.get<string>('storage.avatars')), | 109 | ACTOR_IMAGES_DIR: buildPath(config.get<string>('storage.avatars')), |
110 | LOG_DIR: buildPath(config.get<string>('storage.logs')), | 110 | LOG_DIR: buildPath(config.get<string>('storage.logs')), |
111 | VIDEOS_DIR: buildPath(config.get<string>('storage.videos')), | 111 | WEB_VIDEOS_DIR: buildPath(config.get<string>('storage.web_videos')), |
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')), |
@@ -139,10 +140,10 @@ const CONFIG = { | |||
139 | PROXY: { | 140 | PROXY: { |
140 | PROXIFY_PRIVATE_FILES: config.get<boolean>('object_storage.proxy.proxify_private_files') | 141 | PROXIFY_PRIVATE_FILES: config.get<boolean>('object_storage.proxy.proxify_private_files') |
141 | }, | 142 | }, |
142 | VIDEOS: { | 143 | WEB_VIDEOS: { |
143 | BUCKET_NAME: config.get<string>('object_storage.videos.bucket_name'), | 144 | BUCKET_NAME: config.get<string>('object_storage.web_videos.bucket_name'), |
144 | PREFIX: config.get<string>('object_storage.videos.prefix'), | 145 | PREFIX: config.get<string>('object_storage.web_videos.prefix'), |
145 | BASE_URL: config.get<string>('object_storage.videos.base_url') | 146 | BASE_URL: config.get<string>('object_storage.web_videos.base_url') |
146 | }, | 147 | }, |
147 | STREAMING_PLAYLISTS: { | 148 | STREAMING_PLAYLISTS: { |
148 | BUCKET_NAME: config.get<string>('object_storage.streaming_playlists.bucket_name'), | 149 | BUCKET_NAME: config.get<string>('object_storage.streaming_playlists.bucket_name'), |
@@ -370,8 +371,8 @@ const CONFIG = { | |||
370 | HLS: { | 371 | HLS: { |
371 | get ENABLED () { return config.get<boolean>('transcoding.hls.enabled') } | 372 | get ENABLED () { return config.get<boolean>('transcoding.hls.enabled') } |
372 | }, | 373 | }, |
373 | WEBTORRENT: { | 374 | WEB_VIDEOS: { |
374 | get ENABLED () { return config.get<boolean>('transcoding.webtorrent.enabled') } | 375 | get ENABLED () { return config.get<boolean>('transcoding.web_videos.enabled') } |
375 | }, | 376 | }, |
376 | REMOTE_RUNNERS: { | 377 | REMOTE_RUNNERS: { |
377 | get ENABLED () { return config.get<boolean>('transcoding.remote_runners.enabled') } | 378 | get ENABLED () { return config.get<boolean>('transcoding.remote_runners.enabled') } |
@@ -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: { |
@@ -580,16 +584,6 @@ function isEmailEnabled () { | |||
580 | return false | 584 | return false |
581 | } | 585 | } |
582 | 586 | ||
583 | // --------------------------------------------------------------------------- | ||
584 | |||
585 | export { | ||
586 | CONFIG, | ||
587 | registerConfigChangedHandler, | ||
588 | isEmailEnabled | ||
589 | } | ||
590 | |||
591 | // --------------------------------------------------------------------------- | ||
592 | |||
593 | function getLocalConfigFilePath () { | 587 | function getLocalConfigFilePath () { |
594 | const localConfigDir = getLocalConfigDir() | 588 | const localConfigDir = getLocalConfigDir() |
595 | 589 | ||
@@ -600,6 +594,17 @@ function getLocalConfigFilePath () { | |||
600 | return join(localConfigDir, filename + '.json') | 594 | return join(localConfigDir, filename + '.json') |
601 | } | 595 | } |
602 | 596 | ||
597 | // --------------------------------------------------------------------------- | ||
598 | |||
599 | export { | ||
600 | CONFIG, | ||
601 | getLocalConfigFilePath, | ||
602 | registerConfigChangedHandler, | ||
603 | isEmailEnabled | ||
604 | } | ||
605 | |||
606 | // --------------------------------------------------------------------------- | ||
607 | |||
603 | function getLocalConfigDir () { | 608 | function getLocalConfigDir () { |
604 | if (process.env.PEERTUBE_LOCAL_CONFIG) return process.env.PEERTUBE_LOCAL_CONFIG | 609 | if (process.env.PEERTUBE_LOCAL_CONFIG) return process.env.PEERTUBE_LOCAL_CONFIG |
605 | 610 | ||