diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-10-23 19:41:17 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-10-26 20:28:34 +0200 |
commit | 3737bbafb109a79f77c3047eb9b2791e6b57344e (patch) | |
tree | 60a12fceac8345fc124b3d9c045732d72395bfc3 /server/initializers | |
parent | 2c49ca42d14087ce8e1695759435f796a290470b (diff) | |
download | PeerTube-3737bbafb109a79f77c3047eb9b2791e6b57344e.tar.gz PeerTube-3737bbafb109a79f77c3047eb9b2791e6b57344e.tar.zst PeerTube-3737bbafb109a79f77c3047eb9b2791e6b57344e.zip |
Server: host -> hostname (host = hostname + port)
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/checker.js | 4 | ||||
-rw-r--r-- | server/initializers/constants.js | 6 | ||||
-rw-r--r-- | server/initializers/database.js | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/server/initializers/checker.js b/server/initializers/checker.js index 0bc5df92f..4ecabac77 100644 --- a/server/initializers/checker.js +++ b/server/initializers/checker.js | |||
@@ -15,8 +15,8 @@ const checker = { | |||
15 | // Check the config files | 15 | // Check the config files |
16 | function checkConfig () { | 16 | function checkConfig () { |
17 | const required = [ 'listen.port', | 17 | const required = [ 'listen.port', |
18 | 'webserver.https', 'webserver.host', 'webserver.port', | 18 | 'webserver.https', 'webserver.hostname', 'webserver.port', |
19 | 'database.host', 'database.port', 'database.suffix', | 19 | 'database.hostname', 'database.port', 'database.suffix', |
20 | 'storage.certs', 'storage.videos', 'storage.logs', 'storage.thumbnails' | 20 | 'storage.certs', 'storage.videos', 'storage.logs', 'storage.thumbnails' |
21 | ] | 21 | ] |
22 | const miss = [] | 22 | const miss = [] |
diff --git a/server/initializers/constants.js b/server/initializers/constants.js index 8a8d5c1ce..5ccd42773 100644 --- a/server/initializers/constants.js +++ b/server/initializers/constants.js | |||
@@ -32,7 +32,7 @@ const OAUTH_LIFETIME = { | |||
32 | const CONFIG = { | 32 | const CONFIG = { |
33 | DATABASE: { | 33 | DATABASE: { |
34 | DBNAME: 'peertube' + config.get('database.suffix'), | 34 | DBNAME: 'peertube' + config.get('database.suffix'), |
35 | HOST: config.get('database.host'), | 35 | HOSTNAME: config.get('database.hostname'), |
36 | PORT: config.get('database.port') | 36 | PORT: config.get('database.port') |
37 | }, | 37 | }, |
38 | STORAGE: { | 38 | STORAGE: { |
@@ -45,11 +45,11 @@ const CONFIG = { | |||
45 | WEBSERVER: { | 45 | WEBSERVER: { |
46 | SCHEME: config.get('webserver.https') === true ? 'https' : 'http', | 46 | SCHEME: config.get('webserver.https') === true ? 'https' : 'http', |
47 | WS: config.get('webserver.https') === true ? 'wss' : 'ws', | 47 | WS: config.get('webserver.https') === true ? 'wss' : 'ws', |
48 | HOST: config.get('webserver.host'), | 48 | HOSTNAME: config.get('webserver.hostname'), |
49 | PORT: config.get('webserver.port') | 49 | PORT: config.get('webserver.port') |
50 | } | 50 | } |
51 | } | 51 | } |
52 | CONFIG.WEBSERVER.URL = CONFIG.WEBSERVER.SCHEME + '://' + CONFIG.WEBSERVER.HOST + ':' + CONFIG.WEBSERVER.PORT | 52 | CONFIG.WEBSERVER.URL = CONFIG.WEBSERVER.SCHEME + '://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT |
53 | 53 | ||
54 | // --------------------------------------------------------------------------- | 54 | // --------------------------------------------------------------------------- |
55 | 55 | ||
diff --git a/server/initializers/database.js b/server/initializers/database.js index 632040b81..0564e4e77 100644 --- a/server/initializers/database.js +++ b/server/initializers/database.js | |||
@@ -22,7 +22,7 @@ const database = { | |||
22 | 22 | ||
23 | function connect () { | 23 | function connect () { |
24 | mongoose.Promise = global.Promise | 24 | mongoose.Promise = global.Promise |
25 | mongoose.connect('mongodb://' + constants.CONFIG.DATABASE.HOST + ':' + constants.CONFIG.DATABASE.PORT + '/' + constants.CONFIG.DATABASE.DBNAME) | 25 | mongoose.connect('mongodb://' + constants.CONFIG.DATABASE.HOSTNAME + ':' + constants.CONFIG.DATABASE.PORT + '/' + constants.CONFIG.DATABASE.DBNAME) |
26 | mongoose.connection.on('error', function () { | 26 | mongoose.connection.on('error', function () { |
27 | throw new Error('Mongodb connection error.') | 27 | throw new Error('Mongodb connection error.') |
28 | }) | 28 | }) |