webserver:
https: false
- host: 'localhost'
+ hostname: 'localhost'
port: 9000
database:
- host: 'localhost'
+ hostname: 'localhost'
port: 27017
suffix: '-dev'
# Correspond to your reverse proxy "listen" configuration
webserver:
https: false
- host: 'example.com'
+ hostname: 'example.com'
port: 80
database:
port: 9001
webserver:
- host: 'localhost'
+ hostname: 'localhost'
port: 9001
database:
port: 9002
webserver:
- host: 'localhost'
+ hostname: 'localhost'
port: 9002
database:
port: 9003
webserver:
- host: 'localhost'
+ hostname: 'localhost'
port: 9003
database:
port: 9004
webserver:
- host: 'localhost'
+ hostname: 'localhost'
port: 9004
database:
port: 9005
webserver:
- host: 'localhost'
+ hostname: 'localhost'
port: 9005
database:
port: 9006
webserver:
- host: 'localhost'
+ hostname: 'localhost'
port: 9006
database:
https: false
database:
- host: 'localhost'
+ hostname: 'localhost'
port: 27017
// Get the client credentials for the PeerTube front end
function getLocalClient (req, res, next) {
- const serverHost = constants.CONFIG.WEBSERVER.HOST
+ const serverHostname = constants.CONFIG.WEBSERVER.HOSTNAME
const serverPort = constants.CONFIG.WEBSERVER.PORT
- let headerHostShouldBe = serverHost
+ let headerHostShouldBe = serverHostname
if (serverPort !== 80 && serverPort !== 443) {
headerHostShouldBe += ':' + serverPort
}
const 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 exist
mkdirp.sync(constants.CONFIG.STORAGE.LOG_DIR)
// Check the config files
function 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 = []
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: {
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
// ---------------------------------------------------------------------------
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.')
})
const hostname = parsedUrl.hostname
const port = parseInt(parsedUrl.port)
- const myHostname = constants.CONFIG.WEBSERVER.HOST
+ const myHostname = constants.CONFIG.WEBSERVER.HOSTNAME
const myPort = constants.CONFIG.WEBSERVER.PORT
return hostname === myHostname && port === myPort
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