aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--config/default.yaml6
-rw-r--r--config/production.yaml.example6
-rw-r--r--config/test-1.yaml2
-rw-r--r--config/test-2.yaml2
-rw-r--r--config/test-3.yaml2
-rw-r--r--config/test-4.yaml2
-rw-r--r--config/test-5.yaml2
-rw-r--r--config/test-6.yaml2
-rw-r--r--scripts/migrations/peertube-4.2.ts6
-rwxr-xr-xscripts/prune-storage.ts2
-rw-r--r--server/initializers/checker-after-init.ts10
-rw-r--r--server/initializers/checker-before-init.ts6
-rw-r--r--server/initializers/config.ts12
-rw-r--r--server/initializers/constants.ts4
-rw-r--r--server/lib/files-cache/avatar-permanent-file-cache.ts2
-rw-r--r--server/lib/local-actor.ts2
-rw-r--r--server/lib/object-storage/pre-signed-urls.ts4
-rw-r--r--server/lib/object-storage/urls.ts2
-rw-r--r--server/lib/object-storage/videos.ts10
-rw-r--r--server/models/actor/actor-image.ts4
-rw-r--r--server/tests/api/object-storage/videos.ts8
-rw-r--r--server/tests/api/redundancy/redundancy.ts2
-rw-r--r--server/tests/api/transcoding/hls.ts4
-rw-r--r--server/tests/api/transcoding/transcoder.ts2
-rw-r--r--server/tests/cli/create-move-video-storage-job.ts4
-rw-r--r--server/tests/cli/prune-storage.ts8
-rw-r--r--shared/server-commands/server/object-storage-command.ts6
-rw-r--r--shared/server-commands/server/server.ts2
-rw-r--r--shared/server-commands/server/servers-command.ts2
-rw-r--r--support/docker/production/config/custom-environment-variables.yaml8
-rw-r--r--support/docker/production/config/production.yaml2
32 files changed, 69 insertions, 68 deletions
diff --git a/.gitignore b/.gitignore
index c6029ad65..e0004004d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,7 @@ yarn-error.log
23/ffmpeg-4/ 23/ffmpeg-4/
24/thumbnails/ 24/thumbnails/
25/torrents/ 25/torrents/
26/web-videos/
26/videos/ 27/videos/
27/previews/ 28/previews/
28/logs/ 29/logs/
diff --git a/config/default.yaml b/config/default.yaml
index a9e74095e..e590ab300 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -130,7 +130,7 @@ storage:
130 tmp_persistent: 'storage/tmp-persistent/' # As tmp but the directory is not cleaned up between PeerTube restarts 130 tmp_persistent: 'storage/tmp-persistent/' # As tmp but the directory is not cleaned up between PeerTube restarts
131 bin: 'storage/bin/' 131 bin: 'storage/bin/'
132 avatars: 'storage/avatars/' 132 avatars: 'storage/avatars/'
133 videos: 'storage/videos/' 133 web_videos: 'storage/web-videos/'
134 streaming_playlists: 'storage/streaming-playlists/' 134 streaming_playlists: 'storage/streaming-playlists/'
135 redundancy: 'storage/redundancy/' 135 redundancy: 'storage/redundancy/'
136 logs: 'storage/logs/' 136 logs: 'storage/logs/'
@@ -202,8 +202,8 @@ object_storage:
202 base_url: '' # Example: 'https://mirror.example.com' 202 base_url: '' # Example: 'https://mirror.example.com'
203 203
204 # Same settings but for web videos 204 # Same settings but for web videos
205 videos: 205 web_videos:
206 bucket_name: 'videos' 206 bucket_name: 'web-videos'
207 prefix: '' 207 prefix: ''
208 base_url: '' 208 base_url: ''
209 209
diff --git a/config/production.yaml.example b/config/production.yaml.example
index 8fccaa517..884300ddb 100644
--- a/config/production.yaml.example
+++ b/config/production.yaml.example
@@ -128,7 +128,7 @@ storage:
128 tmp_persistent: '/var/www/peertube/storage/tmp-persistent/' # As tmp but the directory is not cleaned up between PeerTube restarts 128 tmp_persistent: '/var/www/peertube/storage/tmp-persistent/' # As tmp but the directory is not cleaned up between PeerTube restarts
129 bin: '/var/www/peertube/storage/bin/' 129 bin: '/var/www/peertube/storage/bin/'
130 avatars: '/var/www/peertube/storage/avatars/' 130 avatars: '/var/www/peertube/storage/avatars/'
131 videos: '/var/www/peertube/storage/videos/' 131 web_videos: '/var/www/peertube/storage/web-videos/'
132 streaming_playlists: '/var/www/peertube/storage/streaming-playlists/' 132 streaming_playlists: '/var/www/peertube/storage/streaming-playlists/'
133 redundancy: '/var/www/peertube/storage/redundancy/' 133 redundancy: '/var/www/peertube/storage/redundancy/'
134 logs: '/var/www/peertube/storage/logs/' 134 logs: '/var/www/peertube/storage/logs/'
@@ -200,8 +200,8 @@ object_storage:
200 base_url: '' # Example: 'https://mirror.example.com' 200 base_url: '' # Example: 'https://mirror.example.com'
201 201
202 # Same settings but for web videos 202 # Same settings but for web videos
203 videos: 203 web_videos:
204 bucket_name: 'videos' 204 bucket_name: 'web-videos'
205 prefix: '' 205 prefix: ''
206 base_url: '' 206 base_url: ''
207 207
diff --git a/config/test-1.yaml b/config/test-1.yaml
index 45ec27e63..b86b48438 100644
--- a/config/test-1.yaml
+++ b/config/test-1.yaml
@@ -13,7 +13,7 @@ storage:
13 tmp_persistent: 'test1/tmp-persistent/' 13 tmp_persistent: 'test1/tmp-persistent/'
14 bin: 'test1/bin/' 14 bin: 'test1/bin/'
15 avatars: 'test1/avatars/' 15 avatars: 'test1/avatars/'
16 videos: 'test1/videos/' 16 web_videos: 'test1/web-videos/'
17 streaming_playlists: 'test1/streaming-playlists/' 17 streaming_playlists: 'test1/streaming-playlists/'
18 redundancy: 'test1/redundancy/' 18 redundancy: 'test1/redundancy/'
19 logs: 'test1/logs/' 19 logs: 'test1/logs/'
diff --git a/config/test-2.yaml b/config/test-2.yaml
index 7a06e5650..266e44c17 100644
--- a/config/test-2.yaml
+++ b/config/test-2.yaml
@@ -13,7 +13,7 @@ storage:
13 tmp_persistent: 'test2/tmp-persistent/' 13 tmp_persistent: 'test2/tmp-persistent/'
14 bin: 'test2/bin/' 14 bin: 'test2/bin/'
15 avatars: 'test2/avatars/' 15 avatars: 'test2/avatars/'
16 videos: 'test2/videos/' 16 web_videos: 'test2/web-videos/'
17 streaming_playlists: 'test2/streaming-playlists/' 17 streaming_playlists: 'test2/streaming-playlists/'
18 redundancy: 'test2/redundancy/' 18 redundancy: 'test2/redundancy/'
19 logs: 'test2/logs/' 19 logs: 'test2/logs/'
diff --git a/config/test-3.yaml b/config/test-3.yaml
index 4b1563369..b31d37765 100644
--- a/config/test-3.yaml
+++ b/config/test-3.yaml
@@ -13,7 +13,7 @@ storage:
13 tmp_persistent: 'test3/tmp-persistent/' 13 tmp_persistent: 'test3/tmp-persistent/'
14 bin: 'test3/bin/' 14 bin: 'test3/bin/'
15 avatars: 'test3/avatars/' 15 avatars: 'test3/avatars/'
16 videos: 'test3/videos/' 16 web_videos: 'test3/web-videos/'
17 streaming_playlists: 'test3/streaming-playlists/' 17 streaming_playlists: 'test3/streaming-playlists/'
18 redundancy: 'test3/redundancy/' 18 redundancy: 'test3/redundancy/'
19 logs: 'test3/logs/' 19 logs: 'test3/logs/'
diff --git a/config/test-4.yaml b/config/test-4.yaml
index 248db4db9..d73b09b56 100644
--- a/config/test-4.yaml
+++ b/config/test-4.yaml
@@ -13,7 +13,7 @@ storage:
13 tmp_persistent: 'test4/tmp-persistent/' 13 tmp_persistent: 'test4/tmp-persistent/'
14 bin: 'test4/bin/' 14 bin: 'test4/bin/'
15 avatars: 'test4/avatars/' 15 avatars: 'test4/avatars/'
16 videos: 'test4/videos/' 16 web_videos: 'test4/web-videos/'
17 streaming_playlists: 'test4/streaming-playlists/' 17 streaming_playlists: 'test4/streaming-playlists/'
18 redundancy: 'test4/redundancy/' 18 redundancy: 'test4/redundancy/'
19 logs: 'test4/logs/' 19 logs: 'test4/logs/'
diff --git a/config/test-5.yaml b/config/test-5.yaml
index 04e2cd78d..56cdc5242 100644
--- a/config/test-5.yaml
+++ b/config/test-5.yaml
@@ -13,7 +13,7 @@ storage:
13 tmp_persistent: 'test5/tmp-persistent/' 13 tmp_persistent: 'test5/tmp-persistent/'
14 bin: 'test5/bin/' 14 bin: 'test5/bin/'
15 avatars: 'test5/avatars/' 15 avatars: 'test5/avatars/'
16 videos: 'test5/videos/' 16 web_videos: 'test5/web-videos/'
17 streaming_playlists: 'test5/streaming-playlists/' 17 streaming_playlists: 'test5/streaming-playlists/'
18 redundancy: 'test5/redundancy/' 18 redundancy: 'test5/redundancy/'
19 logs: 'test5/logs/' 19 logs: 'test5/logs/'
diff --git a/config/test-6.yaml b/config/test-6.yaml
index 25efe0054..0e212c699 100644
--- a/config/test-6.yaml
+++ b/config/test-6.yaml
@@ -13,7 +13,7 @@ storage:
13 tmp_persistent: 'test6/tmp-persistent/' 13 tmp_persistent: 'test6/tmp-persistent/'
14 bin: 'test6/bin/' 14 bin: 'test6/bin/'
15 avatars: 'test6/avatars/' 15 avatars: 'test6/avatars/'
16 videos: 'test6/videos/' 16 web_videos: 'test6/web-videos/'
17 streaming_playlists: 'test6/streaming-playlists/' 17 streaming_playlists: 'test6/streaming-playlists/'
18 redundancy: 'test6/redundancy/' 18 redundancy: 'test6/redundancy/'
19 logs: 'test6/logs/' 19 logs: 'test6/logs/'
diff --git a/scripts/migrations/peertube-4.2.ts b/scripts/migrations/peertube-4.2.ts
index 513c629ef..d8929692b 100644
--- a/scripts/migrations/peertube-4.2.ts
+++ b/scripts/migrations/peertube-4.2.ts
@@ -78,7 +78,7 @@ async function fillAvatarSizeIfNeeded (accountOrChannel: MAccountDefault | MChan
78 78
79 console.log('Filling size of avatars of %s.', accountOrChannel.name) 79 console.log('Filling size of avatars of %s.', accountOrChannel.name)
80 80
81 const { width, height } = await getImageSize(join(CONFIG.STORAGE.ACTOR_IMAGES, avatar.filename)) 81 const { width, height } = await getImageSize(join(CONFIG.STORAGE.ACTOR_IMAGES_DIR, avatar.filename))
82 avatar.width = width 82 avatar.width = width
83 avatar.height = height 83 avatar.height = height
84 84
@@ -107,8 +107,8 @@ async function generateSmallerAvatar (actor: MActorDefault) {
107 const sourceFilename = bigAvatar.filename 107 const sourceFilename = bigAvatar.filename
108 108
109 const newImageName = buildUUID() + getLowercaseExtension(sourceFilename) 109 const newImageName = buildUUID() + getLowercaseExtension(sourceFilename)
110 const source = join(CONFIG.STORAGE.ACTOR_IMAGES, sourceFilename) 110 const source = join(CONFIG.STORAGE.ACTOR_IMAGES_DIR, sourceFilename)
111 const destination = join(CONFIG.STORAGE.ACTOR_IMAGES, newImageName) 111 const destination = join(CONFIG.STORAGE.ACTOR_IMAGES_DIR, newImageName)
112 112
113 await processImage({ path: source, destination, newSize: imageSize, keepOriginal: true }) 113 await processImage({ path: source, destination, newSize: imageSize, keepOriginal: true })
114 114
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts
index 8d1ded59b..9a73a8600 100755
--- a/scripts/prune-storage.ts
+++ b/scripts/prune-storage.ts
@@ -50,7 +50,7 @@ async function run () {
50 await pruneDirectory(CONFIG.STORAGE.PREVIEWS_DIR, doesThumbnailExist(true, ThumbnailType.PREVIEW)), 50 await pruneDirectory(CONFIG.STORAGE.PREVIEWS_DIR, doesThumbnailExist(true, ThumbnailType.PREVIEW)),
51 await pruneDirectory(CONFIG.STORAGE.THUMBNAILS_DIR, doesThumbnailExist(false, ThumbnailType.MINIATURE)), 51 await pruneDirectory(CONFIG.STORAGE.THUMBNAILS_DIR, doesThumbnailExist(false, ThumbnailType.MINIATURE)),
52 52
53 await pruneDirectory(CONFIG.STORAGE.ACTOR_IMAGES, doesActorImageExist) 53 await pruneDirectory(CONFIG.STORAGE.ACTOR_IMAGES_DIR, doesActorImageExist)
54 ) 54 )
55 55
56 const tmpFiles = await readdir(CONFIG.STORAGE.TMP_DIR) 56 const tmpFiles = await readdir(CONFIG.STORAGE.TMP_DIR)
diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts
index 906a918e3..5ef72058b 100644
--- a/server/initializers/checker-after-init.ts
+++ b/server/initializers/checker-after-init.ts
@@ -217,7 +217,7 @@ function checkStorageConfig () {
217 } 217 }
218 } 218 }
219 219
220 if (CONFIG.STORAGE.VIDEOS_DIR === CONFIG.STORAGE.REDUNDANCY_DIR) { 220 if (CONFIG.STORAGE.WEB_VIDEOS_DIR === CONFIG.STORAGE.REDUNDANCY_DIR) {
221 logger.warn('Redundancy directory should be different than the videos folder.') 221 logger.warn('Redundancy directory should be different than the videos folder.')
222 } 222 }
223} 223}
@@ -290,7 +290,7 @@ function checkLiveConfig () {
290function checkObjectStorageConfig () { 290function checkObjectStorageConfig () {
291 if (CONFIG.OBJECT_STORAGE.ENABLED === true) { 291 if (CONFIG.OBJECT_STORAGE.ENABLED === true) {
292 292
293 if (!CONFIG.OBJECT_STORAGE.VIDEOS.BUCKET_NAME) { 293 if (!CONFIG.OBJECT_STORAGE.WEB_VIDEOS.BUCKET_NAME) {
294 throw new Error('videos_bucket should be set when object storage support is enabled.') 294 throw new Error('videos_bucket should be set when object storage support is enabled.')
295 } 295 }
296 296
@@ -299,10 +299,10 @@ function checkObjectStorageConfig () {
299 } 299 }
300 300
301 if ( 301 if (
302 CONFIG.OBJECT_STORAGE.VIDEOS.BUCKET_NAME === CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS.BUCKET_NAME && 302 CONFIG.OBJECT_STORAGE.WEB_VIDEOS.BUCKET_NAME === CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS.BUCKET_NAME &&
303 CONFIG.OBJECT_STORAGE.VIDEOS.PREFIX === CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS.PREFIX 303 CONFIG.OBJECT_STORAGE.WEB_VIDEOS.PREFIX === CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS.PREFIX
304 ) { 304 ) {
305 if (CONFIG.OBJECT_STORAGE.VIDEOS.PREFIX === '') { 305 if (CONFIG.OBJECT_STORAGE.WEB_VIDEOS.PREFIX === '') {
306 throw new Error('Object storage bucket prefixes should be set when the same bucket is used for both types of video.') 306 throw new Error('Object storage bucket prefixes should be set when the same bucket is used for both types of video.')
307 } 307 }
308 308
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts
index 3d117d1b9..a872fcba3 100644
--- a/server/initializers/checker-before-init.ts
+++ b/server/initializers/checker-before-init.ts
@@ -18,7 +18,7 @@ function checkMissedConfig () {
18 'database.hostname', 'database.port', 'database.username', 'database.password', 'database.pool.max', 18 'database.hostname', 'database.port', 'database.username', 'database.password', 'database.pool.max',
19 'smtp.hostname', 'smtp.port', 'smtp.username', 'smtp.password', 'smtp.tls', 'smtp.from_address', 19 'smtp.hostname', 'smtp.port', 'smtp.username', 'smtp.password', 'smtp.tls', 'smtp.from_address',
20 'email.body.signature', 'email.subject.prefix', 20 'email.body.signature', 'email.subject.prefix',
21 'storage.avatars', 'storage.videos', 'storage.logs', 'storage.previews', 'storage.thumbnails', 'storage.torrents', 'storage.cache', 21 'storage.avatars', 'storage.web_videos', 'storage.logs', 'storage.previews', 'storage.thumbnails', 'storage.torrents', 'storage.cache',
22 'storage.redundancy', 'storage.tmp', 'storage.streaming_playlists', 'storage.plugins', 'storage.well_known', 22 'storage.redundancy', 'storage.tmp', 'storage.streaming_playlists', 'storage.plugins', 'storage.well_known',
23 'log.level', 'log.rotation.enabled', 'log.rotation.max_file_size', 'log.rotation.max_files', 'log.anonymize_ip', 23 'log.level', 'log.rotation.enabled', 'log.rotation.max_file_size', 'log.rotation.max_files', 'log.anonymize_ip',
24 'log.log_ping_requests', 'log.log_tracker_unknown_infohash', 'log.prettify_sql', 'log.accept_client_log', 24 'log.log_ping_requests', 'log.log_tracker_unknown_infohash', 'log.prettify_sql', 'log.accept_client_log',
@@ -60,8 +60,8 @@ function checkMissedConfig () {
60 'object_storage.enabled', 'object_storage.endpoint', 'object_storage.region', 'object_storage.upload_acl.public', 60 'object_storage.enabled', 'object_storage.endpoint', 'object_storage.region', 'object_storage.upload_acl.public',
61 'object_storage.upload_acl.private', 'object_storage.proxy.proxify_private_files', 'object_storage.credentials.access_key_id', 61 'object_storage.upload_acl.private', 'object_storage.proxy.proxify_private_files', 'object_storage.credentials.access_key_id',
62 'object_storage.credentials.secret_access_key', 'object_storage.max_upload_part', 'object_storage.streaming_playlists.bucket_name', 62 'object_storage.credentials.secret_access_key', 'object_storage.max_upload_part', 'object_storage.streaming_playlists.bucket_name',
63 'object_storage.streaming_playlists.prefix', 'object_storage.streaming_playlists.base_url', 'object_storage.videos.bucket_name', 63 'object_storage.streaming_playlists.prefix', 'object_storage.streaming_playlists.base_url', 'object_storage.web_videos.bucket_name',
64 'object_storage.videos.prefix', 'object_storage.videos.base_url', 64 'object_storage.web_videos.prefix', 'object_storage.web_videos.base_url',
65 'theme.default', 65 'theme.default',
66 'feeds.videos.count', 'feeds.comments.count', 66 'feeds.videos.count', 'feeds.comments.count',
67 'geo_ip.enabled', 'geo_ip.country.database_url', 67 'geo_ip.enabled', 'geo_ip.country.database_url',
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index 5301a1708..37cd852f1 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -106,9 +106,9 @@ 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')),
@@ -140,10 +140,10 @@ const CONFIG = {
140 PROXY: { 140 PROXY: {
141 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')
142 }, 142 },
143 VIDEOS: { 143 WEB_VIDEOS: {
144 BUCKET_NAME: config.get<string>('object_storage.videos.bucket_name'), 144 BUCKET_NAME: config.get<string>('object_storage.web_videos.bucket_name'),
145 PREFIX: config.get<string>('object_storage.videos.prefix'), 145 PREFIX: config.get<string>('object_storage.web_videos.prefix'),
146 BASE_URL: config.get<string>('object_storage.videos.base_url') 146 BASE_URL: config.get<string>('object_storage.web_videos.base_url')
147 }, 147 },
148 STREAMING_PLAYLISTS: { 148 STREAMING_PLAYLISTS: {
149 BUCKET_NAME: config.get<string>('object_storage.streaming_playlists.bucket_name'), 149 BUCKET_NAME: config.get<string>('object_storage.streaming_playlists.bucket_name'),
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index d87aa6f54..5116c6396 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -881,8 +881,8 @@ const DIRECTORIES = {
881 }, 881 },
882 882
883 VIDEOS: { 883 VIDEOS: {
884 PUBLIC: CONFIG.STORAGE.VIDEOS_DIR, 884 PUBLIC: CONFIG.STORAGE.WEB_VIDEOS_DIR,
885 PRIVATE: join(CONFIG.STORAGE.VIDEOS_DIR, 'private') 885 PRIVATE: join(CONFIG.STORAGE.WEB_VIDEOS_DIR, 'private')
886 }, 886 },
887 887
888 HLS_REDUNDANCY: join(CONFIG.STORAGE.REDUNDANCY_DIR, 'hls') 888 HLS_REDUNDANCY: join(CONFIG.STORAGE.REDUNDANCY_DIR, 'hls')
diff --git a/server/lib/files-cache/avatar-permanent-file-cache.ts b/server/lib/files-cache/avatar-permanent-file-cache.ts
index 1d77c5bc1..0c508b063 100644
--- a/server/lib/files-cache/avatar-permanent-file-cache.ts
+++ b/server/lib/files-cache/avatar-permanent-file-cache.ts
@@ -7,7 +7,7 @@ import { AbstractPermanentFileCache } from './shared'
7export class AvatarPermanentFileCache extends AbstractPermanentFileCache<MActorImage> { 7export class AvatarPermanentFileCache extends AbstractPermanentFileCache<MActorImage> {
8 8
9 constructor () { 9 constructor () {
10 super(CONFIG.STORAGE.ACTOR_IMAGES) 10 super(CONFIG.STORAGE.ACTOR_IMAGES_DIR)
11 } 11 }
12 12
13 protected loadModel (filename: string) { 13 protected loadModel (filename: string) {
diff --git a/server/lib/local-actor.ts b/server/lib/local-actor.ts
index 872addc58..611e6d0af 100644
--- a/server/lib/local-actor.ts
+++ b/server/lib/local-actor.ts
@@ -40,7 +40,7 @@ export async function updateLocalActorImageFiles (
40 const extension = getLowercaseExtension(imagePhysicalFile.filename) 40 const extension = getLowercaseExtension(imagePhysicalFile.filename)
41 41
42 const imageName = buildUUID() + extension 42 const imageName = buildUUID() + extension
43 const destination = join(CONFIG.STORAGE.ACTOR_IMAGES, imageName) 43 const destination = join(CONFIG.STORAGE.ACTOR_IMAGES_DIR, imageName)
44 await processImageFromWorker({ path: imagePhysicalFile.path, destination, newSize: imageSize, keepOriginal: true }) 44 await processImageFromWorker({ path: imagePhysicalFile.path, destination, newSize: imageSize, keepOriginal: true })
45 45
46 return { 46 return {
diff --git a/server/lib/object-storage/pre-signed-urls.ts b/server/lib/object-storage/pre-signed-urls.ts
index 313654a57..caf149bb8 100644
--- a/server/lib/object-storage/pre-signed-urls.ts
+++ b/server/lib/object-storage/pre-signed-urls.ts
@@ -15,8 +15,8 @@ export async function generateWebVideoPresignedUrl (options: {
15 const key = generateWebVideoObjectStorageKey(file.filename) 15 const key = generateWebVideoObjectStorageKey(file.filename)
16 16
17 const command = new GetObjectCommand({ 17 const command = new GetObjectCommand({
18 Bucket: CONFIG.OBJECT_STORAGE.VIDEOS.BUCKET_NAME, 18 Bucket: CONFIG.OBJECT_STORAGE.WEB_VIDEOS.BUCKET_NAME,
19 Key: buildKey(key, CONFIG.OBJECT_STORAGE.VIDEOS), 19 Key: buildKey(key, CONFIG.OBJECT_STORAGE.WEB_VIDEOS),
20 ResponseContentDisposition: `attachment; filename=${downloadFilename}` 20 ResponseContentDisposition: `attachment; filename=${downloadFilename}`
21 }) 21 })
22 22
diff --git a/server/lib/object-storage/urls.ts b/server/lib/object-storage/urls.ts
index 84bc1f6c0..d25f84026 100644
--- a/server/lib/object-storage/urls.ts
+++ b/server/lib/object-storage/urls.ts
@@ -10,7 +10,7 @@ function getInternalUrl (config: BucketInfo, keyWithoutPrefix: string) {
10// --------------------------------------------------------------------------- 10// ---------------------------------------------------------------------------
11 11
12function getWebVideoPublicFileUrl (fileUrl: string) { 12function getWebVideoPublicFileUrl (fileUrl: string) {
13 const baseUrl = CONFIG.OBJECT_STORAGE.VIDEOS.BASE_URL 13 const baseUrl = CONFIG.OBJECT_STORAGE.WEB_VIDEOS.BASE_URL
14 if (!baseUrl) return fileUrl 14 if (!baseUrl) return fileUrl
15 15
16 return replaceByBaseUrl(fileUrl, baseUrl) 16 return replaceByBaseUrl(fileUrl, baseUrl)
diff --git a/server/lib/object-storage/videos.ts b/server/lib/object-storage/videos.ts
index 300c1f7e1..891e9ff76 100644
--- a/server/lib/object-storage/videos.ts
+++ b/server/lib/object-storage/videos.ts
@@ -59,7 +59,7 @@ function storeWebVideoFile (video: MVideo, file: MVideoFile) {
59 return storeObject({ 59 return storeObject({
60 inputPath: VideoPathManager.Instance.getFSVideoFileOutputPath(video, file), 60 inputPath: VideoPathManager.Instance.getFSVideoFileOutputPath(video, file),
61 objectStorageKey: generateWebVideoObjectStorageKey(file.filename), 61 objectStorageKey: generateWebVideoObjectStorageKey(file.filename),
62 bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS, 62 bucketInfo: CONFIG.OBJECT_STORAGE.WEB_VIDEOS,
63 isPrivate: video.hasPrivateStaticPath() 63 isPrivate: video.hasPrivateStaticPath()
64 }) 64 })
65} 65}
@@ -69,7 +69,7 @@ function storeWebVideoFile (video: MVideo, file: MVideoFile) {
69async function updateWebVideoFileACL (video: MVideo, file: MVideoFile) { 69async function updateWebVideoFileACL (video: MVideo, file: MVideoFile) {
70 await updateObjectACL({ 70 await updateObjectACL({
71 objectStorageKey: generateWebVideoObjectStorageKey(file.filename), 71 objectStorageKey: generateWebVideoObjectStorageKey(file.filename),
72 bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS, 72 bucketInfo: CONFIG.OBJECT_STORAGE.WEB_VIDEOS,
73 isPrivate: video.hasPrivateStaticPath() 73 isPrivate: video.hasPrivateStaticPath()
74 }) 74 })
75} 75}
@@ -103,7 +103,7 @@ function removeHLSFileObjectStorageByFullKey (key: string) {
103// --------------------------------------------------------------------------- 103// ---------------------------------------------------------------------------
104 104
105function removeWebVideoObjectStorage (videoFile: MVideoFile) { 105function removeWebVideoObjectStorage (videoFile: MVideoFile) {
106 return removeObject(generateWebVideoObjectStorageKey(videoFile.filename), CONFIG.OBJECT_STORAGE.VIDEOS) 106 return removeObject(generateWebVideoObjectStorageKey(videoFile.filename), CONFIG.OBJECT_STORAGE.WEB_VIDEOS)
107} 107}
108 108
109// --------------------------------------------------------------------------- 109// ---------------------------------------------------------------------------
@@ -130,7 +130,7 @@ async function makeWebVideoFileAvailable (filename: string, destination: string)
130 await makeAvailable({ 130 await makeAvailable({
131 key, 131 key,
132 destination, 132 destination,
133 bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS 133 bucketInfo: CONFIG.OBJECT_STORAGE.WEB_VIDEOS
134 }) 134 })
135 135
136 return destination 136 return destination
@@ -148,7 +148,7 @@ function getWebVideoFileReadStream (options: {
148 148
149 return createObjectReadStream({ 149 return createObjectReadStream({
150 key, 150 key,
151 bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS, 151 bucketInfo: CONFIG.OBJECT_STORAGE.WEB_VIDEOS,
152 rangeHeader 152 rangeHeader
153 }) 153 })
154} 154}
diff --git a/server/models/actor/actor-image.ts b/server/models/actor/actor-image.ts
index 9c34a0101..51085a16d 100644
--- a/server/models/actor/actor-image.ts
+++ b/server/models/actor/actor-image.ts
@@ -157,11 +157,11 @@ export class ActorImageModel extends Model<Partial<AttributesOnly<ActorImageMode
157 } 157 }
158 158
159 getPath () { 159 getPath () {
160 return join(CONFIG.STORAGE.ACTOR_IMAGES, this.filename) 160 return join(CONFIG.STORAGE.ACTOR_IMAGES_DIR, this.filename)
161 } 161 }
162 162
163 removeImage () { 163 removeImage () {
164 const imagePath = join(CONFIG.STORAGE.ACTOR_IMAGES, this.filename) 164 const imagePath = join(CONFIG.STORAGE.ACTOR_IMAGES_DIR, this.filename)
165 return remove(imagePath) 165 return remove(imagePath)
166 } 166 }
167 167
diff --git a/server/tests/api/object-storage/videos.ts b/server/tests/api/object-storage/videos.ts
index c4f72bbe4..dcc52ef06 100644
--- a/server/tests/api/object-storage/videos.ts
+++ b/server/tests/api/object-storage/videos.ts
@@ -181,7 +181,7 @@ function runTestSuite (options: {
181 : undefined 181 : undefined
182 }, 182 },
183 183
184 videos: { 184 web_videos: {
185 bucket_name: options.webVideoBucket, 185 bucket_name: options.webVideoBucket,
186 prefix: options.webVideoPrefix, 186 prefix: options.webVideoPrefix,
187 base_url: baseMockUrl 187 base_url: baseMockUrl
@@ -308,7 +308,7 @@ describe('Object storage for videos', function () {
308 bucket_name: 'aaa' 308 bucket_name: 'aaa'
309 }, 309 },
310 310
311 videos: { 311 web_videos: {
312 bucket_name: 'aaa' 312 bucket_name: 'aaa'
313 } 313 }
314 } 314 }
@@ -386,7 +386,7 @@ describe('Object storage for videos', function () {
386 describe('Test simple object storage', function () { 386 describe('Test simple object storage', function () {
387 runTestSuite({ 387 runTestSuite({
388 playlistBucket: objectStorage.getMockBucketName('streaming-playlists'), 388 playlistBucket: objectStorage.getMockBucketName('streaming-playlists'),
389 webVideoBucket: objectStorage.getMockBucketName('videos') 389 webVideoBucket: objectStorage.getMockBucketName('web-videos')
390 }) 390 })
391 }) 391 })
392 392
@@ -431,7 +431,7 @@ describe('Object storage for videos', function () {
431 runTestSuite({ 431 runTestSuite({
432 maxUploadPart, 432 maxUploadPart,
433 playlistBucket: objectStorage.getMockBucketName('streaming-playlists'), 433 playlistBucket: objectStorage.getMockBucketName('streaming-playlists'),
434 webVideoBucket: objectStorage.getMockBucketName('videos'), 434 webVideoBucket: objectStorage.getMockBucketName('web-videos'),
435 fixture 435 fixture
436 }) 436 })
437 }) 437 })
diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts
index 9a8cb4f51..85da6acf5 100644
--- a/server/tests/api/redundancy/redundancy.ts
+++ b/server/tests/api/redundancy/redundancy.ts
@@ -160,7 +160,7 @@ async function check2Webseeds (videoUUID?: string) {
160 160
161 const directories = [ 161 const directories = [
162 servers[0].getDirectoryPath('redundancy'), 162 servers[0].getDirectoryPath('redundancy'),
163 servers[1].getDirectoryPath('videos') 163 servers[1].getDirectoryPath('web-videos')
164 ] 164 ]
165 165
166 for (const directory of directories) { 166 for (const directory of directories) {
diff --git a/server/tests/api/transcoding/hls.ts b/server/tests/api/transcoding/hls.ts
index 0d2fc0fba..d67043c2a 100644
--- a/server/tests/api/transcoding/hls.ts
+++ b/server/tests/api/transcoding/hls.ts
@@ -75,8 +75,8 @@ describe('Test HLS videos', function () {
75 75
76 it('Should have the playlists/segment deleted from the disk', async function () { 76 it('Should have the playlists/segment deleted from the disk', async function () {
77 for (const server of servers) { 77 for (const server of servers) {
78 await checkDirectoryIsEmpty(server, 'videos', [ 'private' ]) 78 await checkDirectoryIsEmpty(server, 'web-videos', [ 'private' ])
79 await checkDirectoryIsEmpty(server, join('videos', 'private')) 79 await checkDirectoryIsEmpty(server, join('web-videos', 'private'))
80 80
81 await checkDirectoryIsEmpty(server, join('streaming-playlists', 'hls'), [ 'private' ]) 81 await checkDirectoryIsEmpty(server, join('streaming-playlists', 'hls'), [ 'private' ])
82 await checkDirectoryIsEmpty(server, join('streaming-playlists', 'hls', 'private')) 82 await checkDirectoryIsEmpty(server, join('streaming-playlists', 'hls', 'private'))
diff --git a/server/tests/api/transcoding/transcoder.ts b/server/tests/api/transcoding/transcoder.ts
index b899b736d..5386d236f 100644
--- a/server/tests/api/transcoding/transcoder.ts
+++ b/server/tests/api/transcoding/transcoder.ts
@@ -586,7 +586,7 @@ describe('Test video transcoding', function () {
586 '1440p': true, 586 '1440p': true,
587 '2160p': true 587 '2160p': true
588 }, 588 },
589 web_videos: { enabled: true }, 589 webVideos: { enabled: true },
590 hls: { enabled: true } 590 hls: { enabled: true }
591 } 591 }
592 } 592 }
diff --git a/server/tests/cli/create-move-video-storage-job.ts b/server/tests/cli/create-move-video-storage-job.ts
index 253fc983e..fc6a8e648 100644
--- a/server/tests/cli/create-move-video-storage-job.ts
+++ b/server/tests/cli/create-move-video-storage-job.ts
@@ -109,8 +109,8 @@ describe('Test create move video storage job', function () {
109 }) 109 })
110 110
111 it('Should not have files on disk anymore', async function () { 111 it('Should not have files on disk anymore', async function () {
112 await checkDirectoryIsEmpty(servers[0], 'videos', [ 'private' ]) 112 await checkDirectoryIsEmpty(servers[0], 'web-videos', [ 'private' ])
113 await checkDirectoryIsEmpty(servers[0], join('videos', 'private')) 113 await checkDirectoryIsEmpty(servers[0], join('web-videos', 'private'))
114 114
115 await checkDirectoryIsEmpty(servers[0], join('streaming-playlists', 'hls'), [ 'private' ]) 115 await checkDirectoryIsEmpty(servers[0], join('streaming-playlists', 'hls'), [ 'private' ])
116 await checkDirectoryIsEmpty(servers[0], join('streaming-playlists', 'hls', 'private')) 116 await checkDirectoryIsEmpty(servers[0], join('streaming-playlists', 'hls', 'private'))
diff --git a/server/tests/cli/prune-storage.ts b/server/tests/cli/prune-storage.ts
index b60e522a4..561ed6a68 100644
--- a/server/tests/cli/prune-storage.ts
+++ b/server/tests/cli/prune-storage.ts
@@ -35,10 +35,10 @@ async function assertNotExists (server: PeerTubeServer, directory: string, subst
35 35
36async function assertCountAreOkay (servers: PeerTubeServer[]) { 36async function assertCountAreOkay (servers: PeerTubeServer[]) {
37 for (const server of servers) { 37 for (const server of servers) {
38 const videosCount = await countFiles(server, 'videos') 38 const videosCount = await countFiles(server, 'web-videos')
39 expect(videosCount).to.equal(9) // 2 videos with 4 resolutions + private directory 39 expect(videosCount).to.equal(9) // 2 videos with 4 resolutions + private directory
40 40
41 const privateVideosCount = await countFiles(server, 'videos/private') 41 const privateVideosCount = await countFiles(server, 'web-videos/private')
42 expect(privateVideosCount).to.equal(4) 42 expect(privateVideosCount).to.equal(4)
43 43
44 const torrentsCount = await countFiles(server, 'torrents') 44 const torrentsCount = await countFiles(server, 'torrents')
@@ -131,8 +131,8 @@ describe('Test prune storage scripts', function () {
131 it('Should create some dirty files', async function () { 131 it('Should create some dirty files', async function () {
132 for (let i = 0; i < 2; i++) { 132 for (let i = 0; i < 2; i++) {
133 { 133 {
134 const basePublic = servers[0].servers.buildDirectory('videos') 134 const basePublic = servers[0].servers.buildDirectory('web-videos')
135 const basePrivate = servers[0].servers.buildDirectory(join('videos', 'private')) 135 const basePrivate = servers[0].servers.buildDirectory(join('web-videos', 'private'))
136 136
137 const n1 = buildUUID() + '.mp4' 137 const n1 = buildUUID() + '.mp4'
138 const n2 = buildUUID() + '.webm' 138 const n2 = buildUUID() + '.webm'
diff --git a/shared/server-commands/server/object-storage-command.ts b/shared/server-commands/server/object-storage-command.ts
index 7d8ec93cd..6bb232c36 100644
--- a/shared/server-commands/server/object-storage-command.ts
+++ b/shared/server-commands/server/object-storage-command.ts
@@ -42,7 +42,7 @@ export class ObjectStorageCommand {
42 bucket_name: this.getMockStreamingPlaylistsBucketName() 42 bucket_name: this.getMockStreamingPlaylistsBucketName()
43 }, 43 },
44 44
45 videos: { 45 web_videos: {
46 bucket_name: this.getMockWebVideosBucketName() 46 bucket_name: this.getMockWebVideosBucketName()
47 } 47 }
48 } 48 }
@@ -136,9 +136,9 @@ export class ObjectStorageCommand {
136 prefix: `test:server-${serverNumber}-streaming-playlists:` 136 prefix: `test:server-${serverNumber}-streaming-playlists:`
137 }, 137 },
138 138
139 videos: { 139 web_videos: {
140 bucket_name: this.DEFAULT_SCALEWAY_BUCKET, 140 bucket_name: this.DEFAULT_SCALEWAY_BUCKET,
141 prefix: `test:server-${serverNumber}-videos:` 141 prefix: `test:server-${serverNumber}-web-videos:`
142 } 142 }
143 } 143 }
144 } 144 }
diff --git a/shared/server-commands/server/server.ts b/shared/server-commands/server/server.ts
index 2629889ee..38568a890 100644
--- a/shared/server-commands/server/server.ts
+++ b/shared/server-commands/server/server.ts
@@ -370,7 +370,7 @@ export class PeerTubeServer {
370 tmp_persistent: this.getDirectoryPath('tmp-persistent') + '/', 370 tmp_persistent: this.getDirectoryPath('tmp-persistent') + '/',
371 bin: this.getDirectoryPath('bin') + '/', 371 bin: this.getDirectoryPath('bin') + '/',
372 avatars: this.getDirectoryPath('avatars') + '/', 372 avatars: this.getDirectoryPath('avatars') + '/',
373 videos: this.getDirectoryPath('videos') + '/', 373 web_videos: this.getDirectoryPath('web-videos') + '/',
374 streaming_playlists: this.getDirectoryPath('streaming-playlists') + '/', 374 streaming_playlists: this.getDirectoryPath('streaming-playlists') + '/',
375 redundancy: this.getDirectoryPath('redundancy') + '/', 375 redundancy: this.getDirectoryPath('redundancy') + '/',
376 logs: this.getDirectoryPath('logs') + '/', 376 logs: this.getDirectoryPath('logs') + '/',
diff --git a/shared/server-commands/server/servers-command.ts b/shared/server-commands/server/servers-command.ts
index 4e66a900c..c91c2b008 100644
--- a/shared/server-commands/server/servers-command.ts
+++ b/shared/server-commands/server/servers-command.ts
@@ -78,7 +78,7 @@ export class ServersCommand extends AbstractCommand {
78 } 78 }
79 79
80 buildWebVideoFilePath (fileUrl: string) { 80 buildWebVideoFilePath (fileUrl: string) {
81 return this.buildDirectory(join('videos', basename(fileUrl))) 81 return this.buildDirectory(join('web-videos', basename(fileUrl)))
82 } 82 }
83 83
84 buildFragmentedFilePath (videoUUID: string, fileUrl: string) { 84 buildFragmentedFilePath (videoUUID: string, fileUrl: string) {
diff --git a/support/docker/production/config/custom-environment-variables.yaml b/support/docker/production/config/custom-environment-variables.yaml
index 8c1231bfc..0058cbd64 100644
--- a/support/docker/production/config/custom-environment-variables.yaml
+++ b/support/docker/production/config/custom-environment-variables.yaml
@@ -86,10 +86,10 @@ object_storage:
86 base_url: "PEERTUBE_OBJECT_STORAGE_STREAMING_PLAYLISTS_BASE_URL" 86 base_url: "PEERTUBE_OBJECT_STORAGE_STREAMING_PLAYLISTS_BASE_URL"
87 upload_acl: "PEERTUBE_OBJECT_STORAGE_UPLOAD_ACL" 87 upload_acl: "PEERTUBE_OBJECT_STORAGE_UPLOAD_ACL"
88 88
89 videos: 89 web_videos:
90 bucket_name: "PEERTUBE_OBJECT_STORAGE_VIDEOS_BUCKET_NAME" 90 bucket_name: "PEERTUBE_OBJECT_STORAGE_WEB_VIDEOS_BUCKET_NAME"
91 prefix: "PEERTUBE_OBJECT_STORAGE_VIDEOS_PREFIX" 91 prefix: "PEERTUBE_OBJECT_STORAGE_WEB_VIDEOS_PREFIX"
92 base_url: "PEERTUBE_OBJECT_STORAGE_VIDEOS_BASE_URL" 92 base_url: "PEERTUBE_OBJECT_STORAGE_WEB_VIDEOS_BASE_URL"
93 93
94webadmin: 94webadmin:
95 configuration: 95 configuration:
diff --git a/support/docker/production/config/production.yaml b/support/docker/production/config/production.yaml
index e3f6247d8..9c9581e40 100644
--- a/support/docker/production/config/production.yaml
+++ b/support/docker/production/config/production.yaml
@@ -47,7 +47,7 @@ storage:
47 tmp_persistent: '../data/tmp-persistent/' # As tmp but the directory is not cleaned up between PeerTube restarts 47 tmp_persistent: '../data/tmp-persistent/' # As tmp but the directory is not cleaned up between PeerTube restarts
48 bin: '../data/bin/' 48 bin: '../data/bin/'
49 avatars: '../data/avatars/' 49 avatars: '../data/avatars/'
50 videos: '../data/videos/' 50 web_videos: '../data/web-videos/'
51 streaming_playlists: '../data/streaming-playlists' 51 streaming_playlists: '../data/streaming-playlists'
52 redundancy: '../data/redundancy/' 52 redundancy: '../data/redundancy/'
53 logs: '../data/logs/' 53 logs: '../data/logs/'