]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/checker.js
Server: do not enable images tests by default because it needs a special
[github/Chocobozzz/PeerTube.git] / server / initializers / checker.js
index cb62fabf49b7fe155adf0cfc5386ecf957da8c8d..3831efb8d5eccffe3d75a464e4270181d6bb4917 100644 (file)
@@ -1,8 +1,10 @@
 'use strict'
 
 const config = require('config')
+const mongoose = require('mongoose')
 
-const Users = require('../models/users')
+const Client = mongoose.model('OAuthClient')
+const User = mongoose.model('User')
 
 const checker = {
   checkConfig: checkConfig,
@@ -16,7 +18,7 @@ function checkConfig () {
     'webserver.https', 'webserver.host', 'webserver.port',
     'database.host', 'database.port', 'database.suffix',
     'storage.certs', 'storage.uploads', 'storage.logs',
-    'network.friends' ]
+    'network.friends', 'electron.debug' ]
   const miss = []
 
   for (const key of required) {
@@ -29,7 +31,7 @@ function checkConfig () {
 }
 
 function clientsExist (callback) {
-  Users.getClients(function (err, clients) {
+  Client.list(function (err, clients) {
     if (err) return callback(err)
 
     return callback(null, clients.length !== 0)
@@ -37,7 +39,7 @@ function clientsExist (callback) {
 }
 
 function usersExist (callback) {
-  Users.getUsers(function (err, users) {
+  User.list(function (err, users) {
     if (err) return callback(err)
 
     return callback(null, users.length !== 0)