ActivityPub-federated video streaming platform using P2P directly in your web browser
Server: host -> hostname (host = hostname + port)
Chocobozzz3737bbafb109
diff --git a/config/default.yaml b/config/default.yamlindex 909bec1776..ad27b4eb89 100644--- a/config/default.yaml+++ b/config/default.yaml@@ -3,11 +3,11 @@ listen:webserver:https: false- host: 'localhost'+ hostname: 'localhost'port: 9000database:- host: 'localhost'+ hostname: 'localhost'port: 27017suffix: '-dev'diff --git a/config/production.yaml.example b/config/production.yaml.exampleindex 8bc63ee924..056ace4341 100644--- a/config/production.yaml.example+++ b/config/production.yaml.example@@ -1,7 +1,7 @@# Correspond to your reverse proxy "listen" configurationwebserver:https: false- host: 'example.com'+ hostname: 'example.com'port: 80database:diff --git a/config/test-1.yaml b/config/test-1.yamlindex 4be44abc79..6dcc7f294a 100644--- a/config/test-1.yaml+++ b/config/test-1.yaml@@ -2,7 +2,7 @@ listen:port: 9001webserver:- host: 'localhost'+ hostname: 'localhost'port: 9001database:diff --git a/config/test-2.yaml b/config/test-2.yamlindex c723e6863e..209525963a 100644--- a/config/test-2.yaml+++ b/config/test-2.yaml@@ -2,7 +2,7 @@ listen:port: 9002webserver:- host: 'localhost'+ hostname: 'localhost'port: 9002database:diff --git a/config/test-3.yaml b/config/test-3.yamlindex 58417c34b5..15719d107f 100644--- a/config/test-3.yaml+++ b/config/test-3.yaml@@ -2,7 +2,7 @@ listen:port: 9003webserver:- host: 'localhost'+ hostname: 'localhost'port: 9003database:diff --git a/config/test-4.yaml b/config/test-4.yamlindex 68253cae90..e6f34d0130 100644--- a/config/test-4.yaml+++ b/config/test-4.yaml@@ -2,7 +2,7 @@ listen:port: 9004webserver:- host: 'localhost'+ hostname: 'localhost'port: 9004database:diff --git a/config/test-5.yaml b/config/test-5.yamlindex aafd458896..fdeec76d40 100644--- a/config/test-5.yaml+++ b/config/test-5.yaml@@ -2,7 +2,7 @@ listen:port: 9005webserver:- host: 'localhost'+ hostname: 'localhost'port: 9005database:diff --git a/config/test-6.yaml b/config/test-6.yamlindex ba83b0bc1d..0c9630c897 100644--- a/config/test-6.yaml+++ b/config/test-6.yaml@@ -2,7 +2,7 @@ listen:port: 9006webserver:- host: 'localhost'+ hostname: 'localhost'port: 9006database:diff --git a/config/test.yaml b/config/test.yamlindex 8a667a001d..06705a987b 100644--- a/config/test.yaml+++ b/config/test.yaml@@ -5,5 +5,5 @@ webserver:https: falsedatabase:- host: 'localhost'+ hostname: 'localhost'port: 27017diff --git a/server/controllers/api/clients.js b/server/controllers/api/clients.jsindex ce1149227b..b013541958 100644--- a/server/controllers/api/clients.js+++ b/server/controllers/api/clients.js@@ -13,9 +13,9 @@ router.get('/local', getLocalClient)// Get the client credentials for the PeerTube front endfunction getLocalClient (req, res, next) {- const serverHost = constants.CONFIG.WEBSERVER.HOST+ const serverHostname = constants.CONFIG.WEBSERVER.HOSTNAMEconst serverPort = constants.CONFIG.WEBSERVER.PORT- let headerHostShouldBe = serverHost+ let headerHostShouldBe = serverHostnameif (serverPort !== 80 && serverPort !== 443) {headerHostShouldBe += ':' + serverPort}diff --git a/server/helpers/logger.js b/server/helpers/logger.jsindex 590ceaeb6c..fcc1789fd5 100644--- a/server/helpers/logger.js+++ b/server/helpers/logger.js@@ -8,7 +8,7 @@ winston.emitErrs = trueconst constants = require('../initializers/constants')-const label = constants.CONFIG.WEBSERVER.HOST + ':' + constants.CONFIG.WEBSERVER.PORT+const label = constants.CONFIG.WEBSERVER.HOSTNAME + ':' + constants.CONFIG.WEBSERVER.PORT// Create the directory if it does not existmkdirp.sync(constants.CONFIG.STORAGE.LOG_DIR)diff --git a/server/initializers/checker.js b/server/initializers/checker.jsindex 0bc5df92ff..4ecabac77f 100644--- a/server/initializers/checker.js+++ b/server/initializers/checker.js@@ -15,8 +15,8 @@ const checker = {// Check the config filesfunction checkConfig () {const required = [ 'listen.port',- 'webserver.https', 'webserver.host', 'webserver.port',- 'database.host', 'database.port', 'database.suffix',+ 'webserver.https', 'webserver.hostname', 'webserver.port',+ 'database.hostname', 'database.port', 'database.suffix','storage.certs', 'storage.videos', 'storage.logs', 'storage.thumbnails']const miss = []diff --git a/server/initializers/constants.js b/server/initializers/constants.jsindex 8a8d5c1ce5..5ccd427739 100644--- a/server/initializers/constants.js+++ b/server/initializers/constants.js@@ -32,7 +32,7 @@ const OAUTH_LIFETIME = {const CONFIG = {DATABASE: {DBNAME: 'peertube' + config.get('database.suffix'),- HOST: config.get('database.host'),+ HOSTNAME: config.get('database.hostname'),PORT: config.get('database.port')},STORAGE: {@@ -45,11 +45,11 @@ const CONFIG = {WEBSERVER: {SCHEME: config.get('webserver.https') === true ? 'https' : 'http',WS: config.get('webserver.https') === true ? 'wss' : 'ws',- HOST: config.get('webserver.host'),+ HOSTNAME: config.get('webserver.hostname'),PORT: config.get('webserver.port')}}-CONFIG.WEBSERVER.URL = CONFIG.WEBSERVER.SCHEME + '://' + CONFIG.WEBSERVER.HOST + ':' + CONFIG.WEBSERVER.PORT+CONFIG.WEBSERVER.URL = CONFIG.WEBSERVER.SCHEME + '://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT// ---------------------------------------------------------------------------diff --git a/server/initializers/database.js b/server/initializers/database.jsindex 632040b81f..0564e4e77f 100644--- a/server/initializers/database.js+++ b/server/initializers/database.js@@ -22,7 +22,7 @@ const database = {function connect () {mongoose.Promise = global.Promise- mongoose.connect('mongodb://' + constants.CONFIG.DATABASE.HOST + ':' + constants.CONFIG.DATABASE.PORT + '/' + constants.CONFIG.DATABASE.DBNAME)+ mongoose.connect('mongodb://' + constants.CONFIG.DATABASE.HOSTNAME + ':' + constants.CONFIG.DATABASE.PORT + '/' + constants.CONFIG.DATABASE.DBNAME)mongoose.connection.on('error', function () {throw new Error('Mongodb connection error.')})diff --git a/server/lib/friends.js b/server/lib/friends.jsindex b2ad0bbb30..3f100545c2 100644--- a/server/lib/friends.js+++ b/server/lib/friends.js@@ -273,7 +273,7 @@ function isMe (url) {const hostname = parsedUrl.hostnameconst port = parseInt(parsedUrl.port)- const myHostname = constants.CONFIG.WEBSERVER.HOST+ const myHostname = constants.CONFIG.WEBSERVER.HOSTNAMEconst myPort = constants.CONFIG.WEBSERVER.PORTreturn hostname === myHostname && port === myPortdiff --git a/server/models/video.js b/server/models/video.jsindex 05c4f51cb2..be3e80598e 100644--- a/server/models/video.js+++ b/server/models/video.js@@ -102,7 +102,7 @@ VideoSchema.pre('save', function (next) {function (callback) {const options = {announceList: [- [ constants.CONFIG.WEBSERVER.WS + '://' + constants.CONFIG.WEBSERVER.HOST + ':' + constants.CONFIG.WEBSERVER.PORT + '/tracker/socket' ]+ [ constants.CONFIG.WEBSERVER.WS + '://' + constants.CONFIG.WEBSERVER.HOSTNAME + ':' + constants.CONFIG.WEBSERVER.PORT + '/tracker/socket' ]],urlList: [constants.CONFIG.WEBSERVER.URL + constants.STATIC_PATHS.WEBSEED + video.filename