aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-03-21 21:11:26 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-03-21 21:11:26 +0100
commit37dc07b292ae4b24011a99146150869bb9c17c65 (patch)
tree07bd9ade440cc8dd07349a725ba7d38398628d94 /server.js
parent9457bf88079a23d28011ff7c65faa56a548b7817 (diff)
downloadPeerTube-37dc07b292ae4b24011a99146150869bb9c17c65.tar.gz
PeerTube-37dc07b292ae4b24011a99146150869bb9c17c65.tar.zst
PeerTube-37dc07b292ae4b24011a99146150869bb9c17c65.zip
Create an "installer" module that create defaults clients/users...
Diffstat (limited to 'server.js')
-rw-r--r--server.js14
1 files changed, 2 insertions, 12 deletions
diff --git a/server.js b/server.js
index f9925eb24..b748a0242 100644
--- a/server.js
+++ b/server.js
@@ -21,15 +21,13 @@ if (miss.length !== 0) {
21 throw new Error('Miss some configurations keys : ' + miss) 21 throw new Error('Miss some configurations keys : ' + miss)
22} 22}
23 23
24checker.createDirectoriesIfNotExist()
25
26// ----------- PeerTube modules ----------- 24// ----------- PeerTube modules -----------
27var config = require('config') 25var config = require('config')
28var constants = require('./server/initializers/constants') 26var constants = require('./server/initializers/constants')
29var customValidators = require('./server/helpers/customValidators') 27var customValidators = require('./server/helpers/customValidators')
30var database = require('./server/initializers/database') 28var database = require('./server/initializers/database')
29var installer = require('./server/initializers/installer')
31var logger = require('./server/helpers/logger') 30var logger = require('./server/helpers/logger')
32var peertubeCrypto = require('./server/helpers/peertubeCrypto')
33var poolRequests = require('./server/lib/poolRequests') 31var poolRequests = require('./server/lib/poolRequests')
34var routes = require('./server/controllers') 32var routes = require('./server/controllers')
35var utils = require('./server/helpers/utils') 33var utils = require('./server/helpers/utils')
@@ -119,17 +117,9 @@ app.use(function (err, req, res, next) {
119 res.sendStatus(err.status || 500) 117 res.sendStatus(err.status || 500)
120}) 118})
121 119
122// TODO: move into initializer 120installer.installApplication(function (err) {
123require('./server/models/users').createClient('coucou', [ 'password' ], function (err, id) {
124 if (err) throw err 121 if (err) throw err
125 logger.info('Client id: ' + id)
126
127 require('./server/models/users').createUser('floflo', 'coucou', function () {})
128})
129 122
130// ----------- Create the certificates if they don't already exist -----------
131peertubeCrypto.createCertsIfNotExist(function (err) {
132 if (err) throw err
133 // Create/activate the webtorrent module 123 // Create/activate the webtorrent module
134 webtorrent.create(function () { 124 webtorrent.create(function () {
135 function cleanForExit () { 125 function cleanForExit () {