aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-10-23 19:41:17 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-10-26 20:28:34 +0200
commit3737bbafb109a79f77c3047eb9b2791e6b57344e (patch)
tree60a12fceac8345fc124b3d9c045732d72395bfc3 /server
parent2c49ca42d14087ce8e1695759435f796a290470b (diff)
downloadPeerTube-3737bbafb109a79f77c3047eb9b2791e6b57344e.tar.gz
PeerTube-3737bbafb109a79f77c3047eb9b2791e6b57344e.tar.zst
PeerTube-3737bbafb109a79f77c3047eb9b2791e6b57344e.zip
Server: host -> hostname (host = hostname + port)
Diffstat (limited to 'server')
-rw-r--r--server/controllers/api/clients.js4
-rw-r--r--server/helpers/logger.js2
-rw-r--r--server/initializers/checker.js4
-rw-r--r--server/initializers/constants.js6
-rw-r--r--server/initializers/database.js2
-rw-r--r--server/lib/friends.js2
-rw-r--r--server/models/video.js2
7 files changed, 11 insertions, 11 deletions
diff --git a/server/controllers/api/clients.js b/server/controllers/api/clients.js
index ce1149227..b01354195 100644
--- a/server/controllers/api/clients.js
+++ b/server/controllers/api/clients.js
@@ -13,9 +13,9 @@ router.get('/local', getLocalClient)
13 13
14// Get the client credentials for the PeerTube front end 14// Get the client credentials for the PeerTube front end
15function getLocalClient (req, res, next) { 15function getLocalClient (req, res, next) {
16 const serverHost = constants.CONFIG.WEBSERVER.HOST 16 const serverHostname = constants.CONFIG.WEBSERVER.HOSTNAME
17 const serverPort = constants.CONFIG.WEBSERVER.PORT 17 const serverPort = constants.CONFIG.WEBSERVER.PORT
18 let headerHostShouldBe = serverHost 18 let headerHostShouldBe = serverHostname
19 if (serverPort !== 80 && serverPort !== 443) { 19 if (serverPort !== 80 && serverPort !== 443) {
20 headerHostShouldBe += ':' + serverPort 20 headerHostShouldBe += ':' + serverPort
21 } 21 }
diff --git a/server/helpers/logger.js b/server/helpers/logger.js
index 590ceaeb6..fcc1789fd 100644
--- a/server/helpers/logger.js
+++ b/server/helpers/logger.js
@@ -8,7 +8,7 @@ winston.emitErrs = true
8 8
9const constants = require('../initializers/constants') 9const constants = require('../initializers/constants')
10 10
11const label = constants.CONFIG.WEBSERVER.HOST + ':' + constants.CONFIG.WEBSERVER.PORT 11const label = constants.CONFIG.WEBSERVER.HOSTNAME + ':' + constants.CONFIG.WEBSERVER.PORT
12 12
13// Create the directory if it does not exist 13// Create the directory if it does not exist
14mkdirp.sync(constants.CONFIG.STORAGE.LOG_DIR) 14mkdirp.sync(constants.CONFIG.STORAGE.LOG_DIR)
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
16function checkConfig () { 16function 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 = {
32const CONFIG = { 32const 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}
52CONFIG.WEBSERVER.URL = CONFIG.WEBSERVER.SCHEME + '://' + CONFIG.WEBSERVER.HOST + ':' + CONFIG.WEBSERVER.PORT 52CONFIG.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
23function connect () { 23function 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 })
diff --git a/server/lib/friends.js b/server/lib/friends.js
index b2ad0bbb3..3f100545c 100644
--- a/server/lib/friends.js
+++ b/server/lib/friends.js
@@ -273,7 +273,7 @@ function isMe (url) {
273 const hostname = parsedUrl.hostname 273 const hostname = parsedUrl.hostname
274 const port = parseInt(parsedUrl.port) 274 const port = parseInt(parsedUrl.port)
275 275
276 const myHostname = constants.CONFIG.WEBSERVER.HOST 276 const myHostname = constants.CONFIG.WEBSERVER.HOSTNAME
277 const myPort = constants.CONFIG.WEBSERVER.PORT 277 const myPort = constants.CONFIG.WEBSERVER.PORT
278 278
279 return hostname === myHostname && port === myPort 279 return hostname === myHostname && port === myPort
diff --git a/server/models/video.js b/server/models/video.js
index 05c4f51cb..be3e80598 100644
--- a/server/models/video.js
+++ b/server/models/video.js
@@ -102,7 +102,7 @@ VideoSchema.pre('save', function (next) {
102 function (callback) { 102 function (callback) {
103 const options = { 103 const options = {
104 announceList: [ 104 announceList: [
105 [ constants.CONFIG.WEBSERVER.WS + '://' + constants.CONFIG.WEBSERVER.HOST + ':' + constants.CONFIG.WEBSERVER.PORT + '/tracker/socket' ] 105 [ constants.CONFIG.WEBSERVER.WS + '://' + constants.CONFIG.WEBSERVER.HOSTNAME + ':' + constants.CONFIG.WEBSERVER.PORT + '/tracker/socket' ]
106 ], 106 ],
107 urlList: [ 107 urlList: [
108 constants.CONFIG.WEBSERVER.URL + constants.STATIC_PATHS.WEBSEED + video.filename 108 constants.CONFIG.WEBSERVER.URL + constants.STATIC_PATHS.WEBSEED + video.filename