diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-03-21 21:11:26 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-03-21 21:11:26 +0100 |
commit | 37dc07b292ae4b24011a99146150869bb9c17c65 (patch) | |
tree | 07bd9ade440cc8dd07349a725ba7d38398628d94 /server.js | |
parent | 9457bf88079a23d28011ff7c65faa56a548b7817 (diff) | |
download | PeerTube-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.js | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -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 | ||
24 | checker.createDirectoriesIfNotExist() | ||
25 | |||
26 | // ----------- PeerTube modules ----------- | 24 | // ----------- PeerTube modules ----------- |
27 | var config = require('config') | 25 | var config = require('config') |
28 | var constants = require('./server/initializers/constants') | 26 | var constants = require('./server/initializers/constants') |
29 | var customValidators = require('./server/helpers/customValidators') | 27 | var customValidators = require('./server/helpers/customValidators') |
30 | var database = require('./server/initializers/database') | 28 | var database = require('./server/initializers/database') |
29 | var installer = require('./server/initializers/installer') | ||
31 | var logger = require('./server/helpers/logger') | 30 | var logger = require('./server/helpers/logger') |
32 | var peertubeCrypto = require('./server/helpers/peertubeCrypto') | ||
33 | var poolRequests = require('./server/lib/poolRequests') | 31 | var poolRequests = require('./server/lib/poolRequests') |
34 | var routes = require('./server/controllers') | 32 | var routes = require('./server/controllers') |
35 | var utils = require('./server/helpers/utils') | 33 | var 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 | 120 | installer.installApplication(function (err) { |
123 | require('./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 ----------- | ||
131 | peertubeCrypto.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 () { |