]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/constants.js
Server: do not make friends with myself
[github/Chocobozzz/PeerTube.git] / server / initializers / constants.js
index be2e3e9439bcf9bc6d8354a8ded910968b21814d..8a8d5c1ce562ad7986dedd7042d37aecc3f07c44 100644 (file)
@@ -35,17 +35,16 @@ const CONFIG = {
     HOST: config.get('database.host'),
     PORT: config.get('database.port')
   },
-  ELECTRON: {
-    DEBUG: config.get('electron.debug')
-  },
   STORAGE: {
     CERT_DIR: path.join(__dirname, '..', '..', config.get('storage.certs')),
     LOG_DIR: path.join(__dirname, '..', '..', config.get('storage.logs')),
-    UPLOAD_DIR: path.join(__dirname, '..', '..', config.get('storage.uploads')),
-    THUMBNAILS_DIR: path.join(__dirname, '..', '..', config.get('storage.thumbnails'))
+    VIDEOS_DIR: path.join(__dirname, '..', '..', config.get('storage.videos')),
+    THUMBNAILS_DIR: path.join(__dirname, '..', '..', config.get('storage.thumbnails')),
+    TORRENTS_DIR: path.join(__dirname, '..', '..', config.get('storage.torrents'))
   },
   WEBSERVER: {
     SCHEME: config.get('webserver.https') === true ? 'https' : 'http',
+    WS: config.get('webserver.https') === true ? 'wss' : 'ws',
     HOST: config.get('webserver.host'),
     PORT: config.get('webserver.port')
   }
@@ -129,6 +128,9 @@ const STATIC_PATHS = {
   WEBSEED: '/static/webseed/'
 }
 
+// Cache control
+let STATIC_MAX_AGE = '30d'
+
 // Videos thumbnail size
 const THUMBNAILS_SIZE = '200x110'
 
@@ -137,10 +139,6 @@ const USER_ROLES = {
   USER: 'user'
 }
 
-// Seeds in parallel we send to electron when "seed all"
-// Once a video is in seeding state we seed another video etc
-const SEEDS_IN_PARALLEL = 3
-
 // ---------------------------------------------------------------------------
 
 // Special constants for a test instance
@@ -148,6 +146,7 @@ if (isTestInstance() === true) {
   CONSTRAINTS_FIELDS.VIDEOS.DURATION.max = 14
   FRIEND_SCORE.BASE = 20
   REQUESTS_INTERVAL = 10000
+  STATIC_MAX_AGE = 0
 }
 
 // ---------------------------------------------------------------------------
@@ -168,8 +167,8 @@ module.exports = {
   REQUESTS_LIMIT,
   RETRY_REQUESTS,
   SEARCHABLE_COLUMNS,
-  SEEDS_IN_PARALLEL,
   SORTABLE_COLUMNS,
+  STATIC_MAX_AGE,
   STATIC_PATHS,
   THUMBNAILS_SIZE,
   USER_ROLES