import { join } from 'path'
+import { randomBytes } from 'crypto'
import { JobType, VideoRateType, VideoResolution, VideoState } from '../../shared/models'
import { ActivityPubActorType } from '../../shared/models/activitypub'
import { FollowState } from '../../shared/models/actors'
// ---------------------------------------------------------------------------
-const LAST_MIGRATION_VERSION = 510
+const LAST_MIGRATION_VERSION = 515
// ---------------------------------------------------------------------------
const TRACKER_RATE_LIMITS = {
INTERVAL: 60000 * 5, // 5 minutes
ANNOUNCES_PER_IP_PER_INFOHASH: 15, // maximum announces per torrent in the interval
- ANNOUNCES_PER_IP: 30 // maximum announces for all our torrents in the interval
+ ANNOUNCES_PER_IP: 30, // maximum announces for all our torrents in the interval
+ BLOCK_IP_LIFETIME: 60000 * 10 // 10 minutes
}
const P2P_MEDIA_LOADER_PEER_VERSION = 2
// ---------------------------------------------------------------------------
+const FILES_CONTENT_HASH = {
+ MANIFEST: generateContentHash(),
+ FAVICON: generateContentHash(),
+ LOGO: generateContentHash()
+}
+
+// ---------------------------------------------------------------------------
+
export {
WEBSERVER,
API_VERSION,
VIDEO_PLAYLIST_PRIVACIES,
PLUGIN_EXTERNAL_AUTH_TOKEN_LIFETIME,
ASSETS_PATH,
+ FILES_CONTENT_HASH,
loadLanguages,
- buildLanguages
+ buildLanguages,
+ generateContentHash
}
// ---------------------------------------------------------------------------
return languages
}
+
+function generateContentHash () {
+ return randomBytes(20).toString('hex')
+}