aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/friends.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-08-19 21:34:51 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-08-19 21:34:51 +0200
commite861452fb26553177ad4e32bfb18b4fd8a5b1816 (patch)
tree7c0cfd464709243a452b431665f5107a973df682 /server/lib/friends.js
parent5c39adb7313e0696aabb4b71196ab7b0b378c359 (diff)
downloadPeerTube-e861452fb26553177ad4e32bfb18b4fd8a5b1816.tar.gz
PeerTube-e861452fb26553177ad4e32bfb18b4fd8a5b1816.tar.zst
PeerTube-e861452fb26553177ad4e32bfb18b4fd8a5b1816.zip
Server: put config in constants
Diffstat (limited to 'server/lib/friends.js')
-rw-r--r--server/lib/friends.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/server/lib/friends.js b/server/lib/friends.js
index 6e1516b94..6a2c37fd7 100644
--- a/server/lib/friends.js
+++ b/server/lib/friends.js
@@ -11,12 +11,8 @@ const waterfall = require('async/waterfall')
11 11
12const constants = require('../initializers/constants') 12const constants = require('../initializers/constants')
13const logger = require('../helpers/logger') 13const logger = require('../helpers/logger')
14const peertubeCrypto = require('../helpers/peertube-crypto')
15const requests = require('../helpers/requests') 14const requests = require('../helpers/requests')
16 15
17const http = config.get('webserver.https') ? 'https' : 'http'
18const host = config.get('webserver.host')
19const port = config.get('webserver.port')
20const Pod = mongoose.model('Pod') 16const Pod = mongoose.model('Pod')
21const Request = mongoose.model('Request') 17const Request = mongoose.model('Request')
22const Video = mongoose.model('Video') 18const Video = mongoose.model('Video')
@@ -45,7 +41,7 @@ function hasFriends (callback) {
45} 41}
46 42
47function getMyCertificate (callback) { 43function getMyCertificate (callback) {
48 fs.readFile(peertubeCrypto.getCertDir() + 'peertube.pub', 'utf8', callback) 44 fs.readFile(constants.CONFIG.STORAGE.CERT_DIR + 'peertube.pub', 'utf8', callback)
49} 45}
50 46
51function makeFriends (callback) { 47function makeFriends (callback) {
@@ -220,7 +216,7 @@ function makeRequestsToWinningPods (cert, podsList, callback) {
220 url: pod.url + '/api/' + constants.API_VERSION + '/pods/', 216 url: pod.url + '/api/' + constants.API_VERSION + '/pods/',
221 method: 'POST', 217 method: 'POST',
222 json: { 218 json: {
223 url: http + '://' + host + ':' + port, 219 url: constants.CONFIG.WEBSERVER.URL,
224 publicKey: cert 220 publicKey: cert
225 } 221 }
226 } 222 }