aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-04-16 14:25:37 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-04-16 14:25:37 +0200
commit0dd079da272df8d532f0086d7c91597b43e7a143 (patch)
tree93fb2a1a063f7e70ad233117efbc52812858ad05
parent3758da9489b636997a3a4fad7fc1a6081737bbe0 (diff)
downloadPeerTube-0dd079da272df8d532f0086d7c91597b43e7a143.tar.gz
PeerTube-0dd079da272df8d532f0086d7c91597b43e7a143.tar.zst
PeerTube-0dd079da272df8d532f0086d7c91597b43e7a143.zip
Update standard -> 10
-rw-r--r--client/config/webpack.common.js1
-rw-r--r--client/package.json2
-rw-r--r--package.json4
-rw-r--r--server/helpers/peertube-crypto.js14
-rw-r--r--server/lib/base-request-scheduler.js8
-rw-r--r--server/tests/real-world/real-world.js6
6 files changed, 21 insertions, 14 deletions
diff --git a/client/config/webpack.common.js b/client/config/webpack.common.js
index 86cbf84d7..35ea8ed28 100644
--- a/client/config/webpack.common.js
+++ b/client/config/webpack.common.js
@@ -6,7 +6,6 @@ const helpers = require('./helpers')
6 6
7const AssetsPlugin = require('assets-webpack-plugin') 7const AssetsPlugin = require('assets-webpack-plugin')
8const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 8const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
9const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin')
10const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin') 9const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin')
11const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin') 10const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin')
12const CopyWebpackPlugin = require('copy-webpack-plugin') 11const CopyWebpackPlugin = require('copy-webpack-plugin')
diff --git a/client/package.json b/client/package.json
index 00eb0e272..3e68007de 100644
--- a/client/package.json
+++ b/client/package.json
@@ -90,7 +90,7 @@
90 "devDependencies": { 90 "devDependencies": {
91 "add-asset-html-webpack-plugin": "^1.0.2", 91 "add-asset-html-webpack-plugin": "^1.0.2",
92 "codelyzer": "^2.0.0", 92 "codelyzer": "^2.0.0",
93 "standard": "^9.0.0", 93 "standard": "^10.0.0",
94 "webpack-bundle-analyzer": "^2.2.1", 94 "webpack-bundle-analyzer": "^2.2.1",
95 "webpack-dll-bundles-plugin": "^1.0.0-beta.5" 95 "webpack-dll-bundles-plugin": "^1.0.0-beta.5"
96 } 96 }
diff --git a/package.json b/package.json
index c4c56ebdd..281d169c6 100644
--- a/package.json
+++ b/package.json
@@ -64,7 +64,7 @@
64 "password-generator": "^2.0.2", 64 "password-generator": "^2.0.2",
65 "pg": "^6.1.0", 65 "pg": "^6.1.0",
66 "pg-hstore": "^2.3.2", 66 "pg-hstore": "^2.3.2",
67 "request": "^2.57.0", 67 "request": "^2.81.0",
68 "request-replay": "^1.0.2", 68 "request-replay": "^1.0.2",
69 "rimraf": "^2.5.4", 69 "rimraf": "^2.5.4",
70 "safe-buffer": "^5.0.1", 70 "safe-buffer": "^5.0.1",
@@ -77,7 +77,7 @@
77 "chai": "^3.3.0", 77 "chai": "^3.3.0",
78 "commander": "^2.9.0", 78 "commander": "^2.9.0",
79 "mocha": "^3.0.1", 79 "mocha": "^3.0.1",
80 "standard": "^9.0.0", 80 "standard": "^10.0.0",
81 "supertest": "^3.0.0", 81 "supertest": "^3.0.0",
82 "webtorrent": "^0.98.0" 82 "webtorrent": "^0.98.0"
83 }, 83 },
diff --git a/server/helpers/peertube-crypto.js b/server/helpers/peertube-crypto.js
index ef6808d5c..55ae6fab3 100644
--- a/server/helpers/peertube-crypto.js
+++ b/server/helpers/peertube-crypto.js
@@ -74,7 +74,9 @@ function comparePassword (plainPassword, hashPassword, callback) {
74} 74}
75 75
76function createCertsIfNotExist (callback) { 76function createCertsIfNotExist (callback) {
77 certsExist(function (exist) { 77 certsExist(function (err, exist) {
78 if (err) return callback(err)
79
78 if (exist === true) { 80 if (exist === true) {
79 return callback(null) 81 return callback(null)
80 } 82 }
@@ -113,13 +115,17 @@ module.exports = peertubeCrypto
113 115
114function certsExist (callback) { 116function certsExist (callback) {
115 const certPath = pathUtils.join(constants.CONFIG.STORAGE.CERT_DIR, constants.PRIVATE_CERT_NAME) 117 const certPath = pathUtils.join(constants.CONFIG.STORAGE.CERT_DIR, constants.PRIVATE_CERT_NAME)
116 fs.exists(certPath, function (exists) { 118 fs.access(certPath, function (err) {
117 return callback(exists) 119 // If there is an error the certificates do not exist
120 const exists = !err
121 return callback(null, exists)
118 }) 122 })
119} 123}
120 124
121function createCerts (callback) { 125function createCerts (callback) {
122 certsExist(function (exist) { 126 certsExist(function (err, exist) {
127 if (err) return callback(err)
128
123 if (exist === true) { 129 if (exist === true) {
124 const string = 'Certs already exist.' 130 const string = 'Certs already exist.'
125 logger.warning(string) 131 logger.warning(string)
diff --git a/server/lib/base-request-scheduler.js b/server/lib/base-request-scheduler.js
index 4709c7960..7378971c8 100644
--- a/server/lib/base-request-scheduler.js
+++ b/server/lib/base-request-scheduler.js
@@ -66,10 +66,10 @@ module.exports = class BaseRequestScheduler {
66 err = err ? err.message : 'Status code not 20x : ' + res.statusCode 66 err = err ? err.message : 'Status code not 20x : ' + res.statusCode
67 logger.error('Error sending secure request to %s pod.', toPod.host, { error: err }) 67 logger.error('Error sending secure request to %s pod.', toPod.host, { error: err })
68 68
69 return callback(false) 69 return callback(err)
70 } 70 }
71 71
72 return callback(true) 72 return callback(null)
73 }) 73 })
74 } 74 }
75 75
@@ -99,8 +99,8 @@ module.exports = class BaseRequestScheduler {
99 const requestToMake = requestsToMakeGrouped[hashKey] 99 const requestToMake = requestsToMakeGrouped[hashKey]
100 const toPod = requestToMake.toPod 100 const toPod = requestToMake.toPod
101 101
102 this.makeRequest(toPod, requestToMake.endpoint, requestToMake.datas, (success) => { 102 this.makeRequest(toPod, requestToMake.endpoint, requestToMake.datas, (err) => {
103 if (success === false) { 103 if (err) {
104 badPods.push(requestToMake.toPod.id) 104 badPods.push(requestToMake.toPod.id)
105 return callbackEach() 105 return callbackEach()
106 } 106 }
diff --git a/server/tests/real-world/real-world.js b/server/tests/real-world/real-world.js
index 21f0732d0..3ac13f053 100644
--- a/server/tests/real-world/real-world.js
+++ b/server/tests/real-world/real-world.js
@@ -102,7 +102,9 @@ runServers(numberOfPods, function (err, servers) {
102 checking = true 102 checking = true
103 103
104 const waitingInterval = setInterval(function () { 104 const waitingInterval = setInterval(function () {
105 isThereAwaitingRequests(servers, function (res) { 105 isThereAwaitingRequests(servers, function (err, res) {
106 if (err) throw err
107
106 if (res === true) { 108 if (res === true) {
107 console.log('A server has awaiting requests, waiting...') 109 console.log('A server has awaiting requests, waiting...')
108 return 110 return
@@ -360,6 +362,6 @@ function isThereAwaitingRequests (servers, callback) {
360 }, function (err) { 362 }, function (err) {
361 if (err) throw err 363 if (err) throw err
362 364
363 return callback(noRequests === false) 365 return callback(null, noRequests === false)
364 }) 366 })
365} 367}