diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-11-11 15:20:03 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-11-16 20:29:26 +0100 |
commit | f285faa04e84b45e62bd05e7050dc500113b0356 (patch) | |
tree | bae907d0714e435e92137347e0b892b806c5302c /server/initializers | |
parent | 558d7c2385d8a152a94140eed753f511e90986d7 (diff) | |
download | PeerTube-f285faa04e84b45e62bd05e7050dc500113b0356.tar.gz PeerTube-f285faa04e84b45e62bd05e7050dc500113b0356.tar.zst PeerTube-f285faa04e84b45e62bd05e7050dc500113b0356.zip |
Server: generate magnet uri on the fly
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/constants.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/server/initializers/constants.js b/server/initializers/constants.js index a50eb2f66..55129fa3e 100644 --- a/server/initializers/constants.js +++ b/server/initializers/constants.js | |||
@@ -66,7 +66,9 @@ const CONSTRAINTS_FIELDS = { | |||
66 | VIDEOS: { | 66 | VIDEOS: { |
67 | NAME: { min: 3, max: 50 }, // Length | 67 | NAME: { min: 3, max: 50 }, // Length |
68 | DESCRIPTION: { min: 3, max: 250 }, // Length | 68 | DESCRIPTION: { min: 3, max: 250 }, // Length |
69 | MAGNET_URI: { min: 10 }, // Length | 69 | MAGNET: { |
70 | XT: { min: 10 } // Length | ||
71 | }, | ||
70 | DURATION: { min: 1, max: 7200 }, // Number | 72 | DURATION: { min: 1, max: 7200 }, // Number |
71 | TAGS: { min: 1, max: 3 }, // Number of total tags | 73 | TAGS: { min: 1, max: 3 }, // Number of total tags |
72 | TAG: { min: 2, max: 10 }, // Length | 74 | TAG: { min: 2, max: 10 }, // Length |
@@ -131,13 +133,18 @@ const REQUEST_ENDPOINTS = { | |||
131 | 133 | ||
132 | // --------------------------------------------------------------------------- | 134 | // --------------------------------------------------------------------------- |
133 | 135 | ||
136 | const REMOTE_SCHEME = { | ||
137 | HTTP: 'https', | ||
138 | WS: 'WS' | ||
139 | } | ||
140 | |||
134 | // Password encryption | 141 | // Password encryption |
135 | const BCRYPT_SALT_SIZE = 10 | 142 | const BCRYPT_SALT_SIZE = 10 |
136 | 143 | ||
137 | // Express static paths (router) | 144 | // Express static paths (router) |
138 | const STATIC_PATHS = { | 145 | const STATIC_PATHS = { |
139 | PREVIEWS: '/static/previews', | 146 | PREVIEWS: '/static/previews/', |
140 | THUMBNAILS: '/static/thumbnails', | 147 | THUMBNAILS: '/static/thumbnails/', |
141 | TORRENTS: '/static/torrents/', | 148 | TORRENTS: '/static/torrents/', |
142 | WEBSEED: '/static/webseed/' | 149 | WEBSEED: '/static/webseed/' |
143 | } | 150 | } |
@@ -161,6 +168,8 @@ if (isTestInstance() === true) { | |||
161 | CONSTRAINTS_FIELDS.VIDEOS.DURATION.max = 14 | 168 | CONSTRAINTS_FIELDS.VIDEOS.DURATION.max = 14 |
162 | FRIEND_SCORE.BASE = 20 | 169 | FRIEND_SCORE.BASE = 20 |
163 | REQUESTS_INTERVAL = 10000 | 170 | REQUESTS_INTERVAL = 10000 |
171 | REMOTE_SCHEME.HTTP = 'http' | ||
172 | REMOTE_SCHEME.WS = 'ws' | ||
164 | STATIC_MAX_AGE = 0 | 173 | STATIC_MAX_AGE = 0 |
165 | } | 174 | } |
166 | 175 | ||
@@ -177,12 +186,13 @@ module.exports = { | |||
177 | OAUTH_LIFETIME, | 186 | OAUTH_LIFETIME, |
178 | PAGINATION_COUNT_DEFAULT, | 187 | PAGINATION_COUNT_DEFAULT, |
179 | PODS_SCORE, | 188 | PODS_SCORE, |
189 | PREVIEWS_SIZE, | ||
190 | REMOTE_SCHEME, | ||
180 | REQUEST_ENDPOINTS, | 191 | REQUEST_ENDPOINTS, |
181 | REQUESTS_IN_PARALLEL, | 192 | REQUESTS_IN_PARALLEL, |
182 | REQUESTS_INTERVAL, | 193 | REQUESTS_INTERVAL, |
183 | REQUESTS_LIMIT, | 194 | REQUESTS_LIMIT, |
184 | RETRY_REQUESTS, | 195 | RETRY_REQUESTS, |
185 | PREVIEWS_SIZE, | ||
186 | SEARCHABLE_COLUMNS, | 196 | SEARCHABLE_COLUMNS, |
187 | SORTABLE_COLUMNS, | 197 | SORTABLE_COLUMNS, |
188 | STATIC_MAX_AGE, | 198 | STATIC_MAX_AGE, |