]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/installer.js
Server: add webserver url log at startup
[github/Chocobozzz/PeerTube.git] / server / initializers / installer.js
index 974402094a168ce24d6f492147a5a25a42dffc8b..1df300ba8d467fb76d3a7b5647fe1efc76559294 100644 (file)
@@ -13,11 +13,12 @@ const constants = require('./constants')
 const logger = require('../helpers/logger')
 const peertubeCrypto = require('../helpers/peertube-crypto')
 
+const Application = mongoose.model('Application')
 const Client = mongoose.model('OAuthClient')
 const User = mongoose.model('User')
 
 const installer = {
-  installApplication: installApplication
+  installApplication
 }
 
 function installApplication (callback) {
@@ -106,9 +107,9 @@ function createOAuthAdminIfNotExist (callback) {
     }
 
     const user = new User({
-      username: username,
-      password: password,
-      role: role
+      username,
+      password,
+      role
     })
 
     user.save(function (err, createdUser) {
@@ -117,7 +118,9 @@ function createOAuthAdminIfNotExist (callback) {
       logger.info('Username: ' + username)
       logger.info('User password: ' + password)
 
-      return callback(null)
+      logger.info('Creating Application collection.')
+      const application = new Application({ mongoSchemaVersion: constants.LAST_MONGO_SCHEMA_VERSION })
+      application.save(callback)
     })
   })
 }