diff options
author | Chocobozzz <me@florianbigard.com> | 2022-10-19 10:43:53 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2022-10-24 14:48:24 +0200 |
commit | 9ab330b90decf4edf152ff8e1d2948c065766b2c (patch) | |
tree | 29d924f50f7307e8e828a57ecb9ea78623487ce0 /shared/core-utils/common/env.ts | |
parent | 3545e72c686ff1725bbdfd8d16d693e2f4aa75a3 (diff) | |
download | PeerTube-9ab330b90decf4edf152ff8e1d2948c065766b2c.tar.gz PeerTube-9ab330b90decf4edf152ff8e1d2948c065766b2c.tar.zst PeerTube-9ab330b90decf4edf152ff8e1d2948c065766b2c.zip |
Use private ACL for private videos in s3
Diffstat (limited to 'shared/core-utils/common/env.ts')
-rw-r--r-- | shared/core-utils/common/env.ts | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/shared/core-utils/common/env.ts b/shared/core-utils/common/env.ts index 38c96b152..973f895d4 100644 --- a/shared/core-utils/common/env.ts +++ b/shared/core-utils/common/env.ts | |||
@@ -14,7 +14,7 @@ function areHttpImportTestsDisabled () { | |||
14 | return disabled | 14 | return disabled |
15 | } | 15 | } |
16 | 16 | ||
17 | function areObjectStorageTestsDisabled () { | 17 | function areMockObjectStorageTestsDisabled () { |
18 | const disabled = process.env.ENABLE_OBJECT_STORAGE_TESTS !== 'true' | 18 | const disabled = process.env.ENABLE_OBJECT_STORAGE_TESTS !== 'true' |
19 | 19 | ||
20 | if (disabled) console.log('ENABLE_OBJECT_STORAGE_TESTS env is not set to "true" so object storage tests are disabled') | 20 | if (disabled) console.log('ENABLE_OBJECT_STORAGE_TESTS env is not set to "true" so object storage tests are disabled') |
@@ -22,9 +22,25 @@ function areObjectStorageTestsDisabled () { | |||
22 | return disabled | 22 | return disabled |
23 | } | 23 | } |
24 | 24 | ||
25 | function areScalewayObjectStorageTestsDisabled () { | ||
26 | if (areMockObjectStorageTestsDisabled()) return true | ||
27 | |||
28 | const enabled = process.env.OBJECT_STORAGE_SCALEWAY_KEY_ID && process.env.OBJECT_STORAGE_SCALEWAY_ACCESS_KEY | ||
29 | if (!enabled) { | ||
30 | console.log( | ||
31 | 'OBJECT_STORAGE_SCALEWAY_KEY_ID and/or OBJECT_STORAGE_SCALEWAY_ACCESS_KEY are not set, so scaleway object storage tests are disabled' | ||
32 | ) | ||
33 | |||
34 | return true | ||
35 | } | ||
36 | |||
37 | return false | ||
38 | } | ||
39 | |||
25 | export { | 40 | export { |
26 | parallelTests, | 41 | parallelTests, |
27 | isGithubCI, | 42 | isGithubCI, |
28 | areHttpImportTestsDisabled, | 43 | areHttpImportTestsDisabled, |
29 | areObjectStorageTestsDisabled | 44 | areMockObjectStorageTestsDisabled, |
45 | areScalewayObjectStorageTestsDisabled | ||
30 | } | 46 | } |