it
This commit is contained in:
		
							parent
							
								
									2ae33bc5ba
								
							
						
					
					
						commit
						72f7056bc7
					
				
							
								
								
									
										6
									
								
								app.py
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								app.py
									
									
									
									
									
								
							@ -401,7 +401,7 @@ def set_api_keys():
 | 
			
		||||
            'error': f'Internal server error: {str(e)}'
 | 
			
		||||
        }), 500
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# TODO buggy, remove
 | 
			
		||||
@app.route('/api/session/info', methods=['GET'])
 | 
			
		||||
def get_session_info():
 | 
			
		||||
    """Get information about the current user session."""
 | 
			
		||||
@ -452,7 +452,7 @@ def terminate_session():
 | 
			
		||||
            'error': f'Internal server error: {str(e)}'
 | 
			
		||||
        }), 500
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# TODO remove
 | 
			
		||||
@app.route('/api/admin/sessions', methods=['GET'])
 | 
			
		||||
def list_sessions():
 | 
			
		||||
    """Admin endpoint to list all active sessions."""
 | 
			
		||||
@ -474,7 +474,7 @@ def list_sessions():
 | 
			
		||||
            'error': f'Internal server error: {str(e)}'
 | 
			
		||||
        }), 500
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# TODO remove
 | 
			
		||||
@app.route('/api/health', methods=['GET'])
 | 
			
		||||
def health_check():
 | 
			
		||||
    """Health check endpoint."""
 | 
			
		||||
 | 
			
		||||
@ -57,6 +57,8 @@ class Scanner:
 | 
			
		||||
            # Scanning progress tracking
 | 
			
		||||
            self.total_indicators_found = 0
 | 
			
		||||
            self.indicators_processed = 0
 | 
			
		||||
            self.indicators_completed = 0
 | 
			
		||||
            self.tasks_re_enqueued = 0
 | 
			
		||||
            self.current_indicator = ""
 | 
			
		||||
 | 
			
		||||
            # Concurrent processing configuration
 | 
			
		||||
@ -238,6 +240,8 @@ class Scanner:
 | 
			
		||||
            
 | 
			
		||||
            self.total_indicators_found = 0
 | 
			
		||||
            self.indicators_processed = 0
 | 
			
		||||
            self.indicators_completed = 0
 | 
			
		||||
            self.tasks_re_enqueued = 0
 | 
			
		||||
            self.current_indicator = self.current_target
 | 
			
		||||
            self.target_retries = defaultdict(int)
 | 
			
		||||
            self.scan_failed_due_to_retries = False
 | 
			
		||||
@ -309,12 +313,14 @@ class Scanner:
 | 
			
		||||
                    if self.target_retries[target] <= self.config.max_retries_per_target:
 | 
			
		||||
                        print(f"Re-queueing target {target} (attempt {self.target_retries[target]})")
 | 
			
		||||
                        self.task_queue.append((target, depth, is_large_entity_member))
 | 
			
		||||
                        self.tasks_re_enqueued += 1
 | 
			
		||||
                    else:
 | 
			
		||||
                        print(f"ERROR: Max retries exceeded for target {target}")
 | 
			
		||||
                        self.scan_failed_due_to_retries = True
 | 
			
		||||
                        self._log_target_processing_error(target, "Max retries exceeded")
 | 
			
		||||
                else:
 | 
			
		||||
                    processed_targets.add(target)
 | 
			
		||||
                    self.indicators_completed += 1
 | 
			
		||||
                
 | 
			
		||||
                for new_target in new_targets:
 | 
			
		||||
                    if new_target not in processed_targets:
 | 
			
		||||
@ -699,6 +705,8 @@ class Scanner:
 | 
			
		||||
                'current_indicator': self.current_indicator,
 | 
			
		||||
                'total_indicators_found': self.total_indicators_found,
 | 
			
		||||
                'indicators_processed': self.indicators_processed,
 | 
			
		||||
                'indicators_completed': self.indicators_completed,
 | 
			
		||||
                'tasks_re_enqueued': self.tasks_re_enqueued,
 | 
			
		||||
                'progress_percentage': self._calculate_progress(),
 | 
			
		||||
                'enabled_providers': [provider.get_name() for provider in self.providers],
 | 
			
		||||
                'graph_statistics': self.graph.get_statistics(),
 | 
			
		||||
@ -715,6 +723,8 @@ class Scanner:
 | 
			
		||||
                'current_indicator': '',
 | 
			
		||||
                'total_indicators_found': 0,
 | 
			
		||||
                'indicators_processed': 0,
 | 
			
		||||
                'indicators_completed': 0,
 | 
			
		||||
                'tasks_re_enqueued': 0,
 | 
			
		||||
                'progress_percentage': 0.0,
 | 
			
		||||
                'enabled_providers': [],
 | 
			
		||||
                'graph_statistics': {},
 | 
			
		||||
@ -788,6 +798,9 @@ class Scanner:
 | 
			
		||||
                                'statistics': live_provider.get_statistics() if live_provider else temp_provider.get_statistics(),
 | 
			
		||||
                                'enabled': self.config.is_provider_enabled(provider_name),
 | 
			
		||||
                                'rate_limit': self.config.get_rate_limit(provider_name),
 | 
			
		||||
                                'task_queue_size': len(self.task_queue),
 | 
			
		||||
                                'tasks_completed': self.indicators_completed,
 | 
			
		||||
                                'tasks_re_enqueued': self.tasks_re_enqueued,
 | 
			
		||||
                            }
 | 
			
		||||
                except Exception as e:
 | 
			
		||||
                    print(f"✗ Failed to get info for provider from {filename}: {e}")
 | 
			
		||||
 | 
			
		||||
@ -517,7 +517,7 @@ input[type="text"]:focus, select:focus {
 | 
			
		||||
    color: #e0e0e0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.provider-stats {
 | 
			
		||||
.provider-stats, .provider-task-stats {
 | 
			
		||||
    font-size: 0.8rem;
 | 
			
		||||
    color: #999;
 | 
			
		||||
    display: grid;
 | 
			
		||||
@ -526,6 +526,13 @@ input[type="text"]:focus, select:focus {
 | 
			
		||||
    margin-top: 0.5rem;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.provider-task-stats {
 | 
			
		||||
    border-top: 1px solid #333;
 | 
			
		||||
    padding-top: 0.5rem;
 | 
			
		||||
    margin-top: 0.5rem;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.provider-stat {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    justify-content: space-between;
 | 
			
		||||
 | 
			
		||||
@ -64,6 +64,9 @@ class DNSReconApp {
 | 
			
		||||
            progressDisplay: document.getElementById('progress-display'),
 | 
			
		||||
            indicatorsDisplay: document.getElementById('indicators-display'),
 | 
			
		||||
            relationshipsDisplay: document.getElementById('relationships-display'),
 | 
			
		||||
            taskQueueDisplay: document.getElementById('task-queue-display'),
 | 
			
		||||
            tasksCompletedDisplay: document.getElementById('tasks-completed-display'),
 | 
			
		||||
            tasksReEnqueuedDisplay: document.getElementById('tasks-re-enqueued-display'),
 | 
			
		||||
            progressFill: document.getElementById('progress-fill'),
 | 
			
		||||
            
 | 
			
		||||
            // Provider elements
 | 
			
		||||
@ -548,6 +551,15 @@ class DNSReconApp {
 | 
			
		||||
            if (this.elements.indicatorsDisplay) {
 | 
			
		||||
                this.elements.indicatorsDisplay.textContent = status.indicators_processed || 0;
 | 
			
		||||
            }
 | 
			
		||||
            if (this.elements.taskQueueDisplay) {
 | 
			
		||||
                this.elements.taskQueueDisplay.textContent = status.task_queue_size || 0;
 | 
			
		||||
            }
 | 
			
		||||
            if (this.elements.tasksCompletedDisplay) {
 | 
			
		||||
                this.elements.tasksCompletedDisplay.textContent = status.indicators_completed || 0;
 | 
			
		||||
            }
 | 
			
		||||
            if (this.elements.tasksReEnqueuedDisplay) {
 | 
			
		||||
                this.elements.tasksReEnqueuedDisplay.textContent = status.tasks_re_enqueued || 0;
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            // Update progress bar with smooth animation
 | 
			
		||||
            if (this.elements.progressFill) {
 | 
			
		||||
@ -790,6 +802,20 @@ class DNSReconApp {
 | 
			
		||||
                        <span class="provider-stat-value">${info.rate_limit}/min</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="provider-task-stats">
 | 
			
		||||
                    <div class="provider-stat">
 | 
			
		||||
                        <span class="provider-stat-label">Task Queue:</span>
 | 
			
		||||
                        <span class="provider-stat-value">${info.task_queue_size || 0}</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="provider-stat">
 | 
			
		||||
                        <span class="provider-stat-label">Tasks Completed:</span>
 | 
			
		||||
                        <span class="provider-stat-value">${info.tasks_completed || 0}</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                     <div class="provider-stat">
 | 
			
		||||
                        <span class="provider-stat-label">Tasks Re-enqueued:</span>
 | 
			
		||||
                        <span class="provider-stat-value">${info.tasks_re_enqueued || 0}</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            `;
 | 
			
		||||
            
 | 
			
		||||
            this.elements.providerList.appendChild(providerItem);
 | 
			
		||||
 | 
			
		||||
@ -102,6 +102,18 @@
 | 
			
		||||
                        <span class="status-label">Relationships:</span>
 | 
			
		||||
                        <span id="relationships-display" class="status-value">0</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="status-row">
 | 
			
		||||
                        <span class="status-label">Task Queue:</span>
 | 
			
		||||
                        <span id="task-queue-display" class="status-value">0</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="status-row">
 | 
			
		||||
                        <span class="status-label">Tasks Completed:</span>
 | 
			
		||||
                        <span id="tasks-completed-display" class="status-value">0</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="status-row">
 | 
			
		||||
                        <span class="status-label">Tasks Re-enqueued:</span>
 | 
			
		||||
                        <span id="tasks-re-enqueued-display" class="status-value">0</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
                
 | 
			
		||||
                <div class="progress-bar">
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user