]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server.ts
Fix CSP for embeds
[github/Chocobozzz/PeerTube.git] / server.ts
index b49d10344bb5a38b83739afe30fe7b350a85322d..8df3add2cdd3abfa6291c9cbae2ca82c271092c2 100644 (file)
--- a/server.ts
+++ b/server.ts
@@ -1,13 +1,6 @@
-import { resolve } from 'path'
+import { registerTSPaths } from './server/helpers/register-ts-paths'
 
-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
-})
+registerTSPaths()
 
 // FIXME: https://github.com/nodejs/node/pull/16853
 require('tls').DEFAULT_ECDH_CURVE = 'auto'
@@ -149,7 +142,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)
   }