diff --git a/package.json b/package.json index 242e1beb2..42acf1b90 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "multer": "^1.1.0", "node-ipc": "^7.0.0", "openssl-wrapper": "^0.2.3", + "password-generator": "^2.0.2", "request": "^2.57.0", "request-replay": "^1.0.2", "segfault-handler": "^1.0.0", diff --git a/server/initializers/installer.js b/server/initializers/installer.js index ec9175f34..c2f5e47bc 100644 --- a/server/initializers/installer.js +++ b/server/initializers/installer.js @@ -3,6 +3,7 @@ const async = require('async') const config = require('config') const mkdirp = require('mkdirp') +const passwordGenerator = require('password-generator') const path = require('path') const checker = require('./checker') @@ -56,8 +57,7 @@ function createOAuthClientIfNotExist (callback) { logger.info('Creating a default OAuth Client.') - // TODO: generate password - const secret = 'megustalabanana' + const secret = passwordGenerator(32, false) Users.createClient(secret, [ 'password' ], function (err, id) { if (err) return callback(err) @@ -78,9 +78,8 @@ function createOAuthUserIfNotExist (callback) { logger.info('Creating the administrator.') - // TODO: generate password - const username = 'admin' - const password = 'nomegustalabanana' + const username = 'root' + const password = passwordGenerator(8, true) Users.createUser(username, password, function (err) { if (err) return callback(err)