From 00f9e41ebfaed4867e971bfb8042e3359eb67eda Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 20 Sep 2018 16:16:07 +0200 Subject: Add warning if one of the storage directory is in the peertube production directory Because admins could loose these directories on peertube upgrade --- server/helpers/core-utils.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server/helpers') 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 () { return process.env.NODE_ENV === 'test' } +function isProdInstance () { + return process.env.NODE_ENV === 'production' +} + function root () { // We are in /helpers/utils.js const paths = [ __dirname, '..', '..' ] @@ -179,6 +183,8 @@ const createTorrentPromise = promisify2(createTorrent) export { isTestInstance, + isProdInstance, + root, escapeHTML, pageToStartAndCount, -- cgit v1.2.3