diff options
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/constants.ts | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index f09422ffd..82373ba84 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -126,7 +126,7 @@ const CONSTRAINTS_FIELDS = { | |||
126 | DESCRIPTION: { min: 3, max: 3000 }, // Length | 126 | DESCRIPTION: { min: 3, max: 3000 }, // Length |
127 | EXTNAME: [ '.mp4', '.ogv', '.webm' ], | 127 | EXTNAME: [ '.mp4', '.ogv', '.webm' ], |
128 | INFO_HASH: { min: 40, max: 40 }, // Length, info hash is 20 bytes length but we represent it in hexadecimal so 20 * 2 | 128 | INFO_HASH: { min: 40, max: 40 }, // Length, info hash is 20 bytes length but we represent it in hexadecimal so 20 * 2 |
129 | DURATION: { min: 1, max: 7200 }, // Number | 129 | DURATION: { min: 1 }, // Number |
130 | TAGS: { min: 0, max: 5 }, // Number of total tags | 130 | TAGS: { min: 0, max: 5 }, // Number of total tags |
131 | TAG: { min: 2, max: 30 }, // Length | 131 | TAG: { min: 2, max: 30 }, // Length |
132 | THUMBNAIL: { min: 2, max: 30 }, | 132 | THUMBNAIL: { min: 2, max: 30 }, |
@@ -134,7 +134,7 @@ const CONSTRAINTS_FIELDS = { | |||
134 | VIEWS: { min: 0 }, | 134 | VIEWS: { min: 0 }, |
135 | LIKES: { min: 0 }, | 135 | LIKES: { min: 0 }, |
136 | DISLIKES: { min: 0 }, | 136 | DISLIKES: { min: 0 }, |
137 | FILE_SIZE: { min: 10, max: 1024 * 1024 * 1024 * 10 /* 10Go */ }, | 137 | FILE_SIZE: { min: 10 }, |
138 | URL: { min: 3, max: 2000 } // Length | 138 | URL: { min: 3, max: 2000 } // Length |
139 | }, | 139 | }, |
140 | ACCOUNTS: { | 140 | ACCOUNTS: { |
@@ -216,12 +216,6 @@ const VIDEO_MIMETYPE_EXT = { | |||
216 | 216 | ||
217 | // --------------------------------------------------------------------------- | 217 | // --------------------------------------------------------------------------- |
218 | 218 | ||
219 | // Score a server has when we create it as a friend | ||
220 | const FRIEND_SCORE = { | ||
221 | BASE: 100, | ||
222 | MAX: 1000 | ||
223 | } | ||
224 | |||
225 | const SERVER_ACCOUNT_NAME = 'peertube' | 219 | const SERVER_ACCOUNT_NAME = 'peertube' |
226 | 220 | ||
227 | const ACTIVITY_PUB = { | 221 | const ACTIVITY_PUB = { |
@@ -242,7 +236,9 @@ const ACTIVITY_PUB = { | |||
242 | // Number of points we add/remove from a friend after a successful/bad request | 236 | // Number of points we add/remove from a friend after a successful/bad request |
243 | const SERVERS_SCORE = { | 237 | const SERVERS_SCORE = { |
244 | PENALTY: -10, | 238 | PENALTY: -10, |
245 | BONUS: 10 | 239 | BONUS: 10, |
240 | BASE: 100, | ||
241 | MAX: 1000 | ||
246 | } | 242 | } |
247 | 243 | ||
248 | const FOLLOW_STATES: { [ id: string ]: FollowState } = { | 244 | const FOLLOW_STATES: { [ id: string ]: FollowState } = { |
@@ -323,8 +319,7 @@ const OPENGRAPH_AND_OEMBED_COMMENT = '<!-- open graph and oembed tags -->' | |||
323 | 319 | ||
324 | // Special constants for a test instance | 320 | // Special constants for a test instance |
325 | if (isTestInstance() === true) { | 321 | if (isTestInstance() === true) { |
326 | CONSTRAINTS_FIELDS.VIDEOS.DURATION.max = 14 | 322 | SERVERS_SCORE.BASE = 20 |
327 | FRIEND_SCORE.BASE = 20 | ||
328 | JOBS_FETCHING_INTERVAL = 1000 | 323 | JOBS_FETCHING_INTERVAL = 1000 |
329 | REMOTE_SCHEME.HTTP = 'http' | 324 | REMOTE_SCHEME.HTTP = 'http' |
330 | REMOTE_SCHEME.WS = 'ws' | 325 | REMOTE_SCHEME.WS = 'ws' |
@@ -341,7 +336,6 @@ export { | |||
341 | CONFIG, | 336 | CONFIG, |
342 | CONSTRAINTS_FIELDS, | 337 | CONSTRAINTS_FIELDS, |
343 | EMBED_SIZE, | 338 | EMBED_SIZE, |
344 | FRIEND_SCORE, | ||
345 | JOB_STATES, | 339 | JOB_STATES, |
346 | JOBS_FETCH_LIMIT_PER_CYCLE, | 340 | JOBS_FETCH_LIMIT_PER_CYCLE, |
347 | JOBS_FETCHING_INTERVAL, | 341 | JOBS_FETCHING_INTERVAL, |