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, '..', '..' ]
export {
isTestInstance,
+ isProdInstance,
+
root,
escapeHTML,
pageToStartAndCount,
import * as config from 'config'
-import { promisify0 } from '../helpers/core-utils'
+import { promisify0, isProdInstance } from '../helpers/core-utils'
import { UserModel } from '../models/account/user'
import { ApplicationModel } from '../models/application/application'
import { OAuthClientModel } from '../models/oauth/oauth-client'
}
}
+ if (isProdInstance()) {
+ const configStorage = config.get('storage')
+ for (const key of Object.keys(configStorage)) {
+ if (configStorage[key].startsWith('storage/')) {
+ logger.warn(
+ 'Directory of %s should not be in the production directory of PeerTube. Please check your production configuration file.',
+ key
+ )
+ }
+ }
+ }
+
return null
}