diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-20 16:16:07 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-20 16:25:00 +0200 |
commit | 00f9e41ebfaed4867e971bfb8042e3359eb67eda (patch) | |
tree | 6c67c4c3295297ff89208ab7da265df53985d570 /server/helpers | |
parent | a89368105879d2468a2d474367a68d5c1be99089 (diff) | |
download | PeerTube-00f9e41ebfaed4867e971bfb8042e3359eb67eda.tar.gz PeerTube-00f9e41ebfaed4867e971bfb8042e3359eb67eda.tar.zst PeerTube-00f9e41ebfaed4867e971bfb8042e3359eb67eda.zip |
Add warning if one of the storage directory is in the peertube
production directory
Because admins could loose these directories on peertube upgrade
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/core-utils.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts index f5ef187fe..b1a27e089 100644 --- a/server/helpers/core-utils.ts +++ b/server/helpers/core-utils.ts | |||
@@ -64,6 +64,10 @@ function isTestInstance () { | |||
64 | return process.env.NODE_ENV === 'test' | 64 | return process.env.NODE_ENV === 'test' |
65 | } | 65 | } |
66 | 66 | ||
67 | function isProdInstance () { | ||
68 | return process.env.NODE_ENV === 'production' | ||
69 | } | ||
70 | |||
67 | function root () { | 71 | function root () { |
68 | // We are in /helpers/utils.js | 72 | // We are in /helpers/utils.js |
69 | const paths = [ __dirname, '..', '..' ] | 73 | const paths = [ __dirname, '..', '..' ] |
@@ -179,6 +183,8 @@ const createTorrentPromise = promisify2<string, any, any>(createTorrent) | |||
179 | 183 | ||
180 | export { | 184 | export { |
181 | isTestInstance, | 185 | isTestInstance, |
186 | isProdInstance, | ||
187 | |||
182 | root, | 188 | root, |
183 | escapeHTML, | 189 | escapeHTML, |
184 | pageToStartAndCount, | 190 | pageToStartAndCount, |