mirror of https://github.com/Chocobozzz/PeerTube
				
				
				
			Add ability to disable unknown infohash log
							parent
							
								
									090d100cc3
								
							
						
					
					
						commit
						a4152bed14
					
				| 
						 | 
					@ -174,6 +174,7 @@ log:
 | 
				
			||||||
    max_files: 20
 | 
					    max_files: 20
 | 
				
			||||||
  anonymize_ip: false
 | 
					  anonymize_ip: false
 | 
				
			||||||
  log_ping_requests: true
 | 
					  log_ping_requests: true
 | 
				
			||||||
 | 
					  log_tracker_unknown_infohash: true
 | 
				
			||||||
  prettify_sql: false
 | 
					  prettify_sql: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
trending:
 | 
					trending:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
listen:
 | 
					listen:
 | 
				
			||||||
  hostname: 'localhost'
 | 
					  hostname: '127.0.0.1'
 | 
				
			||||||
  port: 9000
 | 
					  port: 9000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Correspond to your reverse proxy server_name/listen configuration (i.e., your public PeerTube instance URL)
 | 
					# Correspond to your reverse proxy server_name/listen configuration (i.e., your public PeerTube instance URL)
 | 
				
			||||||
| 
						 | 
					@ -91,11 +91,13 @@ defaults:
 | 
				
			||||||
    licence: null
 | 
					    licence: null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  p2p:
 | 
					  p2p:
 | 
				
			||||||
    # Enable P2P by default
 | 
					    # Enable P2P by default in PeerTube client
 | 
				
			||||||
    # Can be enabled/disabled by anonymous users and logged in users
 | 
					    # Can be enabled/disabled by anonymous users and logged in users
 | 
				
			||||||
    webapp:
 | 
					    webapp:
 | 
				
			||||||
      enabled: true
 | 
					      enabled: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Enable P2P by default in PeerTube embed
 | 
				
			||||||
 | 
					    # Can be enabled/disabled by URL option
 | 
				
			||||||
    embed:
 | 
					    embed:
 | 
				
			||||||
      enabled: true
 | 
					      enabled: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -135,7 +137,7 @@ object_storage:
 | 
				
			||||||
  region: 'us-east-1'
 | 
					  region: 'us-east-1'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Set this ACL on each uploaded object
 | 
					  # Set this ACL on each uploaded object
 | 
				
			||||||
  upload_acl: 'public'
 | 
					  upload_acl: 'public-read'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  credentials:
 | 
					  credentials:
 | 
				
			||||||
    # You can also use AWS_ACCESS_KEY_ID env variable
 | 
					    # You can also use AWS_ACCESS_KEY_ID env variable
 | 
				
			||||||
| 
						 | 
					@ -170,6 +172,7 @@ log:
 | 
				
			||||||
    max_files: 20
 | 
					    max_files: 20
 | 
				
			||||||
  anonymize_ip: false
 | 
					  anonymize_ip: false
 | 
				
			||||||
  log_ping_requests: true
 | 
					  log_ping_requests: true
 | 
				
			||||||
 | 
					  log_tracker_unknown_infohash: true
 | 
				
			||||||
  prettify_sql: false
 | 
					  prettify_sql: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
trending:
 | 
					trending:
 | 
				
			||||||
| 
						 | 
					@ -225,7 +228,7 @@ security:
 | 
				
			||||||
    enabled: true
 | 
					    enabled: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
tracker:
 | 
					tracker:
 | 
				
			||||||
  # If you disable the tracker, you disable the P2P aspect of PeerTube
 | 
					  # If you disable the tracker, you disable the P2P on your PeerTube instance
 | 
				
			||||||
  enabled: true
 | 
					  enabled: true
 | 
				
			||||||
  # Only handle requests on your videos
 | 
					  # Only handle requests on your videos
 | 
				
			||||||
  # If you set this to false it means you have a public tracker
 | 
					  # If you set this to false it means you have a public tracker
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -69,12 +69,16 @@ const trackerServer = new TrackerServer({
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (CONFIG.TRACKER.ENABLED !== false) {
 | 
					if (CONFIG.TRACKER.ENABLED !== false) {
 | 
				
			||||||
 | 
					 | 
				
			||||||
  trackerServer.on('error', function (err) {
 | 
					  trackerServer.on('error', function (err) {
 | 
				
			||||||
    logger.error('Error in tracker.', { err })
 | 
					    logger.error('Error in tracker.', { err })
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  trackerServer.on('warning', function (err) {
 | 
					  trackerServer.on('warning', function (err) {
 | 
				
			||||||
 | 
					    if (CONFIG.LOG.LOG_TRACKER_UNKNOWN_INFOHASH) {
 | 
				
			||||||
 | 
					      const message = err.message || ''
 | 
				
			||||||
 | 
					      if (message.includes('Uknown infoHash')) return
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    logger.warn('Warning in tracker.', { err })
 | 
					    logger.warn('Warning in tracker.', { err })
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -164,6 +164,7 @@ const CONFIG = {
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    ANONYMIZE_IP: config.get<boolean>('log.anonymize_ip'),
 | 
					    ANONYMIZE_IP: config.get<boolean>('log.anonymize_ip'),
 | 
				
			||||||
    LOG_PING_REQUESTS: config.get<boolean>('log.log_ping_requests'),
 | 
					    LOG_PING_REQUESTS: config.get<boolean>('log.log_ping_requests'),
 | 
				
			||||||
 | 
					    LOG_TRACKER_UNKNOWN_INFOHASH: config.get<boolean>('log.log_tracker_unknown_infohash'),
 | 
				
			||||||
    PRETTIFY_SQL: config.get<boolean>('log.prettify_sql')
 | 
					    PRETTIFY_SQL: config.get<boolean>('log.prettify_sql')
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  TRENDING: {
 | 
					  TRENDING: {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue