ActivityPub-federated video streaming platform using P2P directly in your web browser
Update standard -> 10
Chocobozzz0dd079da272d
diff --git a/client/config/webpack.common.js b/client/config/webpack.common.jsindex 86cbf84d78..35ea8ed284 100644--- a/client/config/webpack.common.js+++ b/client/config/webpack.common.js@@ -6,7 +6,6 @@ const helpers = require('./helpers')const AssetsPlugin = require('assets-webpack-plugin')const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin-const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin')const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin')const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin')const CopyWebpackPlugin = require('copy-webpack-plugin')diff --git a/client/package.json b/client/package.jsonindex 00eb0e272f..3e68007de5 100644--- a/client/package.json+++ b/client/package.json@@ -90,7 +90,7 @@"devDependencies": {"add-asset-html-webpack-plugin": "^1.0.2","codelyzer": "^2.0.0",- "standard": "^9.0.0",+ "standard": "^10.0.0","webpack-bundle-analyzer": "^2.2.1","webpack-dll-bundles-plugin": "^1.0.0-beta.5"}diff --git a/package.json b/package.jsonindex c4c56ebddc..281d169c67 100644--- a/package.json+++ b/package.json@@ -64,7 +64,7 @@"password-generator": "^2.0.2","pg": "^6.1.0","pg-hstore": "^2.3.2",- "request": "^2.57.0",+ "request": "^2.81.0","request-replay": "^1.0.2","rimraf": "^2.5.4","safe-buffer": "^5.0.1",@@ -77,7 +77,7 @@"chai": "^3.3.0","commander": "^2.9.0","mocha": "^3.0.1",- "standard": "^9.0.0",+ "standard": "^10.0.0","supertest": "^3.0.0","webtorrent": "^0.98.0"},diff --git a/server/helpers/peertube-crypto.js b/server/helpers/peertube-crypto.jsindex ef6808d5ce..55ae6fab32 100644--- a/server/helpers/peertube-crypto.js+++ b/server/helpers/peertube-crypto.js@@ -74,7 +74,9 @@ function comparePassword (plainPassword, hashPassword, callback) {}function createCertsIfNotExist (callback) {- certsExist(function (exist) {+ certsExist(function (err, exist) {+ if (err) return callback(err)+if (exist === true) {return callback(null)}@@ -113,13 +115,17 @@ module.exports = peertubeCryptofunction certsExist (callback) {const certPath = pathUtils.join(constants.CONFIG.STORAGE.CERT_DIR, constants.PRIVATE_CERT_NAME)- fs.exists(certPath, function (exists) {- return callback(exists)+ fs.access(certPath, function (err) {+ // If there is an error the certificates do not exist+ const exists = !err+ return callback(null, exists)})}function createCerts (callback) {- certsExist(function (exist) {+ certsExist(function (err, exist) {+ if (err) return callback(err)+if (exist === true) {const string = 'Certs already exist.'logger.warning(string)diff --git a/server/lib/base-request-scheduler.js b/server/lib/base-request-scheduler.jsindex 4709c7960f..7378971c81 100644--- a/server/lib/base-request-scheduler.js+++ b/server/lib/base-request-scheduler.js@@ -66,10 +66,10 @@ module.exports = class BaseRequestScheduler {err = err ? err.message : 'Status code not 20x : ' + res.statusCodelogger.error('Error sending secure request to %s pod.', toPod.host, { error: err })- return callback(false)+ return callback(err)}- return callback(true)+ return callback(null)})}@@ -99,8 +99,8 @@ module.exports = class BaseRequestScheduler {const requestToMake = requestsToMakeGrouped[hashKey]const toPod = requestToMake.toPod- this.makeRequest(toPod, requestToMake.endpoint, requestToMake.datas, (success) => {- if (success === false) {+ this.makeRequest(toPod, requestToMake.endpoint, requestToMake.datas, (err) => {+ if (err) {badPods.push(requestToMake.toPod.id)return callbackEach()}diff --git a/server/tests/real-world/real-world.js b/server/tests/real-world/real-world.jsindex 21f0732d0b..3ac13f053f 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) {checking = trueconst waitingInterval = setInterval(function () {- isThereAwaitingRequests(servers, function (res) {+ isThereAwaitingRequests(servers, function (err, res) {+ if (err) throw err+if (res === true) {console.log('A server has awaiting requests, waiting...')return@@ -360,6 +362,6 @@ function isThereAwaitingRequests (servers, callback) {}, function (err) {if (err) throw err- return callback(noRequests === false)+ return callback(null, noRequests === false)})}