// ---------------------------------------------------------------------------
-const LAST_MIGRATION_VERSION = 160
+const LAST_MIGRATION_VERSION = 175
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
-// Number of points we add/remove from a friend after a successful/bad request
-const SERVERS_SCORE = {
+// Number of points we add/remove after a successful/bad request
+const ACTOR_FOLLOW_SCORE = {
PENALTY: -10,
BONUS: 10,
- BASE: 100,
- MAX: 1000
+ BASE: 1000,
+ MAX: 10000
}
const FOLLOW_STATES: { [ id: string ]: FollowState } = {
// 1 minutes
let JOBS_FETCHING_INTERVAL = 60000
+// 1 hour
+let SCHEDULER_INTERVAL = 60000 * 60
+
// ---------------------------------------------------------------------------
const CONFIG = {
const ACTIVITY_PUB = {
POTENTIAL_ACCEPT_HEADERS: [
'application/activity+json',
- 'application/ld+json'
+ 'application/ld+json',
+ 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
],
ACCEPT_HEADER: 'application/activity+json, application/ld+json',
PUBLIC: 'https://www.w3.org/ns/activitystreams#Public',
TORRENT: [ 'application/x-bittorrent' ],
MAGNET: [ 'application/x-bittorrent;x-scheme-handler/magnet' ]
},
- ACTOR_REFRESH_INTERVAL: 3600 * 24 // 1 day
+ MAX_RECURSION_COMMENTS: 100,
+ ACTOR_REFRESH_INTERVAL: 3600 * 24 * 1000 // 1 day
}
const ACTIVITY_PUB_ACTOR_TYPES: { [ id: string ]: ActivityPubActorType } = {
// Special constants for a test instance
if (isTestInstance() === true) {
- SERVERS_SCORE.BASE = 20
+ ACTOR_FOLLOW_SCORE.BASE = 20
JOBS_FETCHING_INTERVAL = 1000
REMOTE_SCHEME.HTTP = 'http'
REMOTE_SCHEME.WS = 'ws'
STATIC_MAX_AGE = '0'
ACTIVITY_PUB.COLLECTION_ITEMS_PER_PAGE = 2
- ACTIVITY_PUB.ACTOR_REFRESH_INTERVAL = 60 // 1 minute
+ ACTIVITY_PUB.ACTOR_REFRESH_INTERVAL = 10 * 1000 // 10 seconds
CONSTRAINTS_FIELDS.ACTORS.AVATAR.FILE_SIZE.max = 100 * 1024 // 100KB
+ SCHEDULER_INTERVAL = 10000
}
CONFIG.WEBSERVER.URL = sanitizeUrl(CONFIG.WEBSERVER.SCHEME + '://' + CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT)
OAUTH_LIFETIME,
OPENGRAPH_AND_OEMBED_COMMENT,
PAGINATION_COUNT_DEFAULT,
- SERVERS_SCORE,
+ ACTOR_FOLLOW_SCORE,
PREVIEWS_SIZE,
REMOTE_SCHEME,
FOLLOW_STATES,
VIDEO_LICENCES,
VIDEO_RATE_TYPES,
VIDEO_MIMETYPE_EXT,
- AVATAR_MIMETYPE_EXT
+ AVATAR_MIMETYPE_EXT,
+ SCHEDULER_INTERVAL
}