]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server.ts
Translated using Weblate (Chinese (Simplified))
[github/Chocobozzz/PeerTube.git] / server.ts
index b49d10344bb5a38b83739afe30fe7b350a85322d..b14ebf623297a9f3d56154379b737839ec5b5067 100644 (file)
--- a/server.ts
+++ b/server.ts
@@ -1,16 +1,5 @@
-import { resolve } from 'path'
-
-const tsConfig = require('./tsconfig.json')
-const tsConfigPaths = require('tsconfig-paths')
-
-// Thanks: https://github.com/dividab/tsconfig-paths/issues/75#issuecomment-458936883
-tsConfigPaths.register({
-  baseUrl: resolve(tsConfig.compilerOptions.baseUrl || '', tsConfig.compilerOptions.outDir || ''),
-  paths: tsConfig.compilerOptions.paths
-})
-
-// FIXME: https://github.com/nodejs/node/pull/16853
-require('tls').DEFAULT_ECDH_CURVE = 'auto'
+import { registerTSPaths } from './server/helpers/register-ts-paths'
+registerTSPaths()
 
 import { isTestInstance } from './server/helpers/core-utils'
 if (isTestInstance()) {
@@ -149,7 +138,7 @@ if (isTestInstance()) {
 
 // For the logger
 morgan.token('remote-addr', req => {
-  if (req.get('DNT') === '1') {
+  if (CONFIG.LOG.ANONYMIZE_IP === true || req.get('DNT') === '1') {
     return anonymize(req.ip, 16, 16)
   }