diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/core-utils.ts | 4 | ||||
-rw-r--r-- | server/helpers/database-utils.ts | 2 | ||||
-rw-r--r-- | server/helpers/peertube-crypto.ts | 6 | ||||
-rw-r--r-- | server/helpers/requests.ts | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts index 33bbdca8b..3dae78144 100644 --- a/server/helpers/core-utils.ts +++ b/server/helpers/core-utils.ts | |||
@@ -103,11 +103,11 @@ const writeFilePromise = promisify2WithVoid<string, any>(writeFile) | |||
103 | const readdirPromise = promisify1<string, string[]>(readdir) | 103 | const readdirPromise = promisify1<string, string[]>(readdir) |
104 | const mkdirpPromise = promisify1<string, string>(mkdirp) | 104 | const mkdirpPromise = promisify1<string, string>(mkdirp) |
105 | const pseudoRandomBytesPromise = promisify1<number, Buffer>(pseudoRandomBytes) | 105 | const pseudoRandomBytesPromise = promisify1<number, Buffer>(pseudoRandomBytes) |
106 | const accessPromise = promisify1WithVoid<string|Buffer>(access) | 106 | const accessPromise = promisify1WithVoid<string | Buffer>(access) |
107 | const opensslExecPromise = promisify2WithVoid<string, any>(openssl.exec) | 107 | const opensslExecPromise = promisify2WithVoid<string, any>(openssl.exec) |
108 | const bcryptComparePromise = promisify2<any, string, boolean>(bcrypt.compare) | 108 | const bcryptComparePromise = promisify2<any, string, boolean>(bcrypt.compare) |
109 | const bcryptGenSaltPromise = promisify1<number, string>(bcrypt.genSalt) | 109 | const bcryptGenSaltPromise = promisify1<number, string>(bcrypt.genSalt) |
110 | const bcryptHashPromise = promisify2<any, string|number, string>(bcrypt.hash) | 110 | const bcryptHashPromise = promisify2<any, string | number, string>(bcrypt.hash) |
111 | const createTorrentPromise = promisify2<string, any, any>(createTorrent) | 111 | const createTorrentPromise = promisify2<string, any, any>(createTorrent) |
112 | const rimrafPromise = promisify1WithVoid<string>(rimraf) | 112 | const rimrafPromise = promisify1WithVoid<string>(rimraf) |
113 | const statPromise = promisify1<string, Stats>(stat) | 113 | const statPromise = promisify1<string, Stats>(stat) |
diff --git a/server/helpers/database-utils.ts b/server/helpers/database-utils.ts index dcc9e2577..d62462d35 100644 --- a/server/helpers/database-utils.ts +++ b/server/helpers/database-utils.ts | |||
@@ -4,7 +4,7 @@ import * as retry from 'async/retry' | |||
4 | import { logger } from './logger' | 4 | import { logger } from './logger' |
5 | 5 | ||
6 | type RetryTransactionWrapperOptions = { errorMessage: string, arguments?: any[] } | 6 | type RetryTransactionWrapperOptions = { errorMessage: string, arguments?: any[] } |
7 | function retryTransactionWrapper (functionToRetry: (... args) => Promise<any>, options: RetryTransactionWrapperOptions) { | 7 | function retryTransactionWrapper (functionToRetry: (...args) => Promise<any>, options: RetryTransactionWrapperOptions) { |
8 | const args = options.arguments ? options.arguments : [] | 8 | const args = options.arguments ? options.arguments : [] |
9 | 9 | ||
10 | return transactionRetryer(callback => { | 10 | return transactionRetryer(callback => { |
diff --git a/server/helpers/peertube-crypto.ts b/server/helpers/peertube-crypto.ts index fbc3bdcc2..10a226af4 100644 --- a/server/helpers/peertube-crypto.ts +++ b/server/helpers/peertube-crypto.ts | |||
@@ -40,7 +40,7 @@ function checkSignature (publicKey: string, data: string, hexSignature: string) | |||
40 | return isValid | 40 | return isValid |
41 | } | 41 | } |
42 | 42 | ||
43 | async function sign (data: string|Object) { | 43 | async function sign (data: string | Object) { |
44 | const sign = crypto.createSign(SIGNATURE_ALGORITHM) | 44 | const sign = crypto.createSign(SIGNATURE_ALGORITHM) |
45 | 45 | ||
46 | let dataString: string | 46 | let dataString: string |
@@ -71,13 +71,13 @@ async function createCertsIfNotExist () { | |||
71 | return | 71 | return |
72 | } | 72 | } |
73 | 73 | ||
74 | return await createCerts() | 74 | return createCerts() |
75 | } | 75 | } |
76 | 76 | ||
77 | async function cryptPassword (password: string) { | 77 | async function cryptPassword (password: string) { |
78 | const salt = await bcryptGenSaltPromise(BCRYPT_SALT_SIZE) | 78 | const salt = await bcryptGenSaltPromise(BCRYPT_SALT_SIZE) |
79 | 79 | ||
80 | return await bcryptHashPromise(password, salt) | 80 | return bcryptHashPromise(password, salt) |
81 | } | 81 | } |
82 | 82 | ||
83 | function getMyPrivateCert () { | 83 | function getMyPrivateCert () { |
diff --git a/server/helpers/requests.ts b/server/helpers/requests.ts index 8c5d848f3..af1f401de 100644 --- a/server/helpers/requests.ts +++ b/server/helpers/requests.ts | |||
@@ -13,7 +13,7 @@ import { sign } from './peertube-crypto' | |||
13 | 13 | ||
14 | type MakeRetryRequestParams = { | 14 | type MakeRetryRequestParams = { |
15 | url: string, | 15 | url: string, |
16 | method: 'GET'|'POST', | 16 | method: 'GET' | 'POST', |
17 | json: Object | 17 | json: Object |
18 | } | 18 | } |
19 | function makeRetryRequest (params: MakeRetryRequestParams) { | 19 | function makeRetryRequest (params: MakeRetryRequestParams) { |
@@ -31,7 +31,7 @@ function makeRetryRequest (params: MakeRetryRequestParams) { | |||
31 | } | 31 | } |
32 | 32 | ||
33 | type MakeSecureRequestParams = { | 33 | type MakeSecureRequestParams = { |
34 | method: 'GET'|'POST' | 34 | method: 'GET' | 'POST' |
35 | toPod: PodInstance | 35 | toPod: PodInstance |
36 | path: string | 36 | path: string |
37 | data?: Object | 37 | data?: Object |