]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server.ts
Delete actor too when deleting account/video channel
[github/Chocobozzz/PeerTube.git] / server.ts
index b23ec5105e71b3f5e4edbff441426250a4797bc9..efbfd3c9747a54162e6830ae6c5730ad8178eaea 100644 (file)
--- a/server.ts
+++ b/server.ts
@@ -27,7 +27,7 @@ import { checkMissedConfig, checkFFmpeg, checkConfig, checkActivityPubUrls } fro
 
 // Do not use barrels because we don't want to load all modules here (we need to initialize database first)
 import { logger } from './server/helpers/logger'
-import { API_VERSION, CONFIG, STATIC_PATHS, CACHE } from './server/initializers/constants'
+import { API_VERSION, CONFIG, STATIC_PATHS, CACHE, REMOTE_SCHEME } from './server/initializers/constants'
 
 const missed = checkMissedConfig()
 if (missed.length !== 0) {
@@ -49,43 +49,12 @@ if (errorMessage !== null) {
 // Trust our proxy (IP forwarding...)
 app.set('trust proxy', CONFIG.TRUST_PROXY)
 
-// Security middlewares
+// Security middleware
 app.use(helmet({
   frameguard: {
     action: 'deny' // we only allow it for /videos/embed, see server/controllers/client.ts
-  },
-  dnsPrefetchControl: {
-    allow: true
-  },
-  contentSecurityPolicy: {
-    directives: {
-      defaultSrc: ['*', 'data:', 'wss:', 'https:'],
-      fontSrc: ["'self'", 'data:'],
-      frameSrc: ["'none'"],
-      mediaSrc: ['*', 'https:'],
-      objectSrc: ["'none'"],
-      scriptSrc: ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
-      styleSrc: ["'self'", "'unsafe-inline'"],
-      upgradeInsecureRequests: true
-    },
-    browserSniff: false // assumes a modern browser, but allows CDN in front
-  },
-  referrerPolicy: {
-    policy: 'strict-origin-when-cross-origin'
   }
 }))
-app.use((_, res, next) => {
-  [
-    "vibrate 'none'",
-    "geolocation 'none'",
-    "camera 'none'",
-    "microphone 'none'",
-    "magnetometer 'none'",
-    "payment 'none'",
-    "accelerometer 'none'"
-  ].forEach(e => res.append('Feature-Policy', e + ';'))
-  next()
-})
 
 // ----------- Database -----------