aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-06-30 21:58:48 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-06-30 21:58:48 +0200
commitd14b3e37a2c0d647b59259bf2ca059b5817f144c (patch)
treeb77bf4e6f1b68531c8cd06b8b241a8df367a2897 /server
parent5189d08aac7b022a56cf765277558782d151d92f (diff)
downloadPeerTube-d14b3e37a2c0d647b59259bf2ca059b5817f144c.tar.gz
PeerTube-d14b3e37a2c0d647b59259bf2ca059b5817f144c.tar.zst
PeerTube-d14b3e37a2c0d647b59259bf2ca059b5817f144c.zip
Do not generate a random password for test env
Diffstat (limited to 'server')
-rw-r--r--server/initializers/installer.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/initializers/installer.js b/server/initializers/installer.js
index 53b07903c..059fcd8d8 100644
--- a/server/initializers/installer.js
+++ b/server/initializers/installer.js
@@ -81,7 +81,18 @@ function createOAuthUserIfNotExist (callback) {
81 logger.info('Creating the administrator.') 81 logger.info('Creating the administrator.')
82 82
83 const username = 'root' 83 const username = 'root'
84 const password = passwordGenerator(8, true) 84 let password = ''
85
86 // Do not generate a random password for tests
87 if (process.env.NODE_ENV === 'test') {
88 password = 'test'
89
90 if (process.env.NODE_APP_INSTANCE) {
91 password += process.env.NODE_APP_INSTANCE
92 }
93 } else {
94 password = passwordGenerator(8, true)
95 }
85 96
86 Users.createUser(username, password, function (err) { 97 Users.createUser(username, password, function (err) {
87 if (err) return callback(err) 98 if (err) return callback(err)