A comprehensive Docker-based repository server providing offline development resources for SecureAI-OS with full Git functionality, data management, and USB drive support.
cd docker/local-repo
docker build -t secureai-local-repo .
docker run -d --name secureai-local-repo \
-p 8080:80 -p 9418:9418 \
-v $(pwd)/data:/var/repo \
-v /run/media:/run/media \
-v /media:/media \
-v /mnt:/mnt \
-v /home:/host/home:ro \
-v /Users:/host/Users:ro \
-v /opt:/host/opt:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
--privileged \
secureai-local-repoFor IDE Project Import Support:
# Add your specific development directories
-v /path/to/your/projects:/host/projects:ro
-v $HOME/IdeaProjects:/host/idea:ro
-v $HOME/workspace:/host/workspace:roAccess at: http://localhost:8080
The web interface features an organized dropdown navigation system with categorized submenus:
- Dashboard - Main overview and repository population
- Git - Git-related functionality
- Browse Repositories - View and clone repositories
- Repository Management - Create, delete, and manage repositories
- Branch Protection - Configure branch protection rules and policies
- Merge Requests - Code review and collaboration
- AI - Advanced AI build intelligence
- OS Builder - AI-powered autonomous OS builds with 5 advanced capabilities
- AI System Status - Monitor AI capabilities and learning progress
- Tools - Development tools organized by category
- Development - Core development tools
- Project Templates - Create new projects from pre-built templates
- Build Manager - Dependency management and build configurations
- Code Editor - Built-in code editor with syntax highlighting
- Sandbox Environments - Isolated execution environments with integrated security
- Code Quality - Code analysis and documentation
- Code Analysis - Automated linting and code quality analysis
- Code Review - Manual code review tools
- Comprehensive Review - Advanced code review features
- Code Coverage - Test coverage analysis and metrics
- Documentation Generator - AI-powered automated documentation creation
- Infrastructure - System and service management
- Terraform State Analyzer - Infrastructure state analysis
- Container Environments - Multi-container development environments
- Service Orchestration - Multi-service application management
- Dependency Management - Cross-platform dependency analysis
- Security - Security analysis tools
- Vulnerability Assessment - Security scanning and remediation
- AI Model Security - AI model validation and governance
- Threat Intelligence - Real-time security threat monitoring
- Data & Workspace - Data and workspace management
- Workspace - Manage workspace and archive data
- Data Manager - Import/export data to/from USB drives
- Resource Monitor - System resource monitoring
- OS Builder - Complete operating system build environment with advanced AI intelligence (5 capabilities)
- Development - Core development tools
- System - System monitoring and logs
- Status - System status and health information
- Logs - View system and application logs
- Error Diagnosis - Intelligent error analysis and resolution suggestions
- Source Packages - Development dependencies and libraries
- Git Repositories - Full Git HTTP backend with web interface
- AI Models - Local model cache for offline development
- Build Cache - Optimized build artifacts storage
- Archive/Workspace Separation - Pristine data vs working environment
- USB Drive Support - Auto-detection and read/write access to external storage
- Import/Export - Transfer data between USB drives and workspace
- Disk Selection - Choose storage locations with free space information
- Web Interface - Browse repositories, commits, branches, and files
- HTTP Backend - Full Git clone/fetch/pull support
- Repository Management - Create, delete, and manage Git repositories via web interface
- Branch Management - Create branches from any source branch through web UI
- File Viewer - Syntax-highlighted code viewing
- Git Administration - Complete web-based Git management system
- π Secure Repository Mirroring - Mirror external repositories with comprehensive trust and legal analysis
- π‘οΈ Branch Protection Rules - Enforce branch protection policies and merge requirements
- π€ AI Code Completion - CodeLlama-powered intelligent code suggestions and completion
- Trust Analysis - Comprehensive evaluation of external repositories before mirroring
- Country of Origin Detection - Geographic analysis of repository hosting and contributors
- Legal Compliance Verification - License detection, export control compliance, redistribution rights
- Contributor Trust Assessment - Analysis of contributor patterns and suspicious activity
- Security Scanning - Malware detection, binary analysis, Git hook inspection
- Read-Only Protection - External mirrors are strictly read-only to prevent tampering
- Quarantine System - Failed repositories isolated with admin override capabilities
- Configuration Management - Adjustable trust thresholds and blocked country lists
- Branch Pattern Matching - Protect branches using wildcard patterns (main, develop, release/*)
- Direct Push Blocking - Require pull requests for protected branches
- Review Requirements - Enforce minimum number of code reviews before merge
- Admin Enforcement - Apply protection rules to administrator users
- Stale Review Dismissal - Automatically dismiss reviews when new commits are pushed
- Git Hook Integration - Server-side enforcement via pre-receive hooks
- Policy Management - Web-based interface for creating and managing protection rules
- Push Permission Checking - Real-time validation of push operations against protection policies
- CodeLlama Integration - Local AI model for intelligent code completion
- Multi-Language Support - Python, JavaScript, Java, C++, Terraform, and 15+ languages
- Context-Aware Completion - Understands code context and provides relevant suggestions
- Real-Time Suggestions - Instant AI-powered code completion in the editor
- Code Explanation - AI-generated explanations of code snippets
- Code Improvement - Suggestions for code optimization and best practices
- Offline Operation - Fully local AI model, no external API calls required
- 7B Model Optimized - Designed to work efficiently with CodeLlama-7B models
- Predictive Intervention - Predicts and prevents build failures before they occur
- Adaptive Build Strategies - Dynamically adjusts build approach based on environment and failures
- Root Cause Analysis - Traces failures to actual causes instead of symptoms
- Success Learning Engine - Learns from successful builds to optimize future builds
- Context-Aware Fixes - Applies fixes based on build environment and history
- Autonomous Build Management - Fully autonomous AI-driven OS builds with real-time issue resolution
- Proactive Intelligence - Shifts from reactive error handling to predictive build optimization
- Web-based Code Review - GitHub/GitLab-style merge request interface
- Advanced Diff Visualization - Side-by-side diff with syntax highlighting and inline comments
- Interactive Comments - Click-to-comment on any diff line with threading
- Conversation Threading - General comments and discussions
- Merge Conflict Detection - Automatic conflict checking
- Multi-format Diff Support - Git HEAD comparison, file-to-file, custom content
- Multi-language Support - Python, JavaScript, TypeScript, C++, Java code analysis
- Automated Quality Checks - Style, security, and best practice violations
- Project-wide Analysis - Scan entire repositories or individual files
- Security Scanning - Built-in security vulnerability detection
- Linter Integration - Support for flake8, pylint, bandit, ESLint, cppcheck
- Isolated Workspaces - Separate containerized environments for different projects
- Pre-configured Stacks - Python, Node.js, Java, C++ development environments
- Container Terminal - Web-based terminal access to development containers
- Volume Mounting - Automatic workspace mounting for persistent development
- Port Management - Automatic port mapping for web applications
- Resource Isolation - CPU, memory, and network isolation per environment
- Security Hardening - Read-only containers with restricted privileges
- Resource Monitoring - Real-time resource usage tracking and limits
- Pre-built Templates - Python, Node.js, C++, Flask, Express projects
- One-click Creation - Instant project setup with proper structure
- Dependency Management - Integrated build configs and package files
- Git Integration - Projects created as ready-to-clone repositories
- Template System - Extensible framework for custom templates
- Project Type Detection - Automatic detection of Python, Node.js, C++, Java projects
- Dependency Installation - One-click dependency management (pip, npm, cmake)
- Build Automation - Automated build processes with real-time output
- Test Integration - Run project tests with visual feedback
- Build Status Tracking - Monitor dependency and build artifact status
- Multi-Service Applications - Docker Compose support with dependency resolution
- Service Discovery - Automatic service registration and health monitoring
- Dependency Analysis - Cross-platform dependency resolution (npm, pip, maven, gradle)
- Conflict Detection - Automatic detection of version conflicts and circular dependencies
- Installation Ordering - Optimal dependency installation sequence
- Lockfile Generation - Reproducible dependency resolution with lockfiles
- Service Scaling - Dynamic service scaling and resource management
- Health Monitoring - Continuous service health checks and status reporting
- Comprehensive Scanning - Multi-language vulnerability detection (Python, JavaScript, Docker)
- Advanced Dependency Vulnerabilities - CVE detection in npm, pip, maven, gradle with version-specific matching
- Code Security Analysis - Detection of dangerous functions and patterns
- Secret Detection - Identification of exposed credentials and API keys
- Container Security - Dockerfile security best practices analysis
- File-Level Integration - Real-time dependency scanning in editor and Git file viewer
- Repository Awareness - Automatic dependency analysis during repository browsing
- Remediation Planning - Automated fix recommendations with version-specific guidance
- Multi-Source Detection - Scans requirements.txt, package.json, setup.py, and import statements
- Multi-Language Support - Python, JavaScript, Java coverage analysis
- Test Coverage Analysis - Line, branch, and function coverage metrics
- Visual Dashboard - Interactive coverage reports with detailed breakdowns
- File-Level Analysis - Individual file coverage with missing line identification
- Repository Integration - Direct Git repository coverage analysis
- Coverage Grading - Automated quality grading (A-F) based on coverage percentages
- Historical Tracking - Coverage trend analysis and comparison
- Integration - Seamless integration with existing build and test workflows
- Dual-Mode Operation - Simplified mode (instant) or Docker mode (full isolation)
- Multi-Language Support - Python, Node.js, Java, C++, Terraform development environments
- Integrated Code Editor - Built-in editor with syntax highlighting and file management
- Automatic Linting - Real-time code quality analysis during execution
- Vulnerability Scanning - Automatic security scanning of code and dependencies
- Resource Isolation - CPU, memory, and network isolation per sandbox (Docker mode)
- Security Hardening - Read-only containers with restricted privileges (Docker mode)
- Terminal Access - Web-based terminal access to sandbox environments
- Bulk Management - Remove individual sandboxes or all sandboxes at once
- Real-time CVE Feeds - Continuous monitoring of NVD, MITRE, and CISA vulnerability databases
- Malware Signature Detection - Pattern-based malware detection with obfuscation and network activity analysis
- IOC Monitoring - Indicators of Compromise tracking with threat actor attribution
- Supply Chain Attack Detection - Typosquatting detection and suspicious package analysis
- Dark Web Monitoring - Credential leak detection and data breach alerts (simulated)
- Code Threat Scanning - Real-time scanning of code for malware signatures and IOC matches
- Automated Threat Updates - Hourly updates of threat intelligence feeds and signatures
- Threat Dashboard - Comprehensive dashboard with metrics, recent threats, and search capabilities
- Interactive Diff Viewer - GitHub/GitLab-style diff visualization with syntax highlighting
- Inline Comments System - Click any line to add comments with author attribution
- Multi-format Comparison - Git HEAD, saved files, custom content comparison
- Real-time Statistics - Addition/deletion counts and change metrics
- Comment Threading - Multiple comments per line with timestamps
- Editor Integration - Direct access from all code editors
- Model Provenance Tracking - Complete audit trail of model origins, sources, and download history
- Integrity Verification - SHA256 checksums and signature validation for model authenticity
- AI Safety Guardrails - Real-time detection of harmful code generation patterns
- Performance Monitoring - Drift detection and baseline performance tracking
- Trust Scoring - Automated trust assessment based on source reputation and characteristics
- Violation Detection - Pattern-based safety violation detection with severity classification
- Secure Model Registry - Centralized database for all AI model security metadata
- Trusted Model Catalog - Curated collection of AI models from UK-allied countries only
- Fallback Download Sources - Multiple verified sources with automatic failover
- Country-Based Filtering - Blocks models from untrusted jurisdictions (CN, RU, IR, KP, BY)
- Federated Learning - Secure collaborative model training without sharing raw data
- Complete OS Build System - Build SecureAI-OS from scratch with Linux kernel, GCC toolchain, and AI integration
- Git-First Build Sources - All build files stored in dedicated Git repository with automatic fallback to external sources
- Resilient Download System - Continues downloading even if some files fail, with comprehensive error tracking
- Git Integration - Automatic Git repository creation for each build with complete source and binary tracking
- Resume Downloads - Intelligent resume capability from exact interruption point (8.5%, 25%, 50%, etc.)
- Multiple Mirror Sources - 3+ backup sources per package with automatic failover (kernel.org, gnu.org, mirrors.kernel.org)
- Build Source Manager - Centralized management of all source files with checksum verification and version control
- Advanced AI Intelligence - 5 AI capabilities: Predictive Intervention, Adaptive Strategies, Root Cause Analysis, Success Learning, Context-Aware Fixes
- Autonomous Build Management - Fully autonomous AI-driven builds with real-time monitoring and automatic issue resolution
- Smart Retry System - One-click retry with enhanced error handling and 30-50% faster rebuilds
- Build Templates - Pre-configured templates (minimal-ai, desktop-ai, server-ai, embedded-ai)
- Storage Flexibility - Build to internal storage or external USB drives with automatic detection
- Real-time Monitoring - Live build progress with 6-step process tracking and failure detection
- Success Learning Database - AI learns from successful builds to optimize future build strategies and sequences
- Comprehensive Documentation - Auto-generated build reports, security scans, and failure diagnostics
- Intelligent Error Analysis - Pattern-based error recognition with 90%+ confidence for common issues
- Automated Solutions - Actionable fix recommendations for connection errors, permission problems, and storage issues
- System Health Monitoring - Real-time monitoring of disk usage, memory consumption, and service status
- Pattern Matching Engine - Recognition of 10+ error types including network failures, authentication issues, and resource constraints
- Severity Classification - Automatic categorization of errors by impact level (Info, Low, Medium, High, Critical)
- Prevention Guidance - Proactive recommendations to prevent recurring issues
- Admin-Only Access - Secure diagnostic tools requiring authentication to protect system information
- Code Editor - Built-in editor with diff and search functionality
- Workspace Manager - Separate archive and working environments
- System Monitoring - Resource usage and health monitoring
- Firefox ESR Compatible - Works with enterprise browser restrictions
- Dropdown Navigation - Organized navigation with grouped functionality
- API Endpoints - RESTful APIs for all Git operations
Access: http://localhost:8080/data-manager/
Import from USB:
- Insert USB drive (auto-detected)
- Select USB drive from dropdown
- Choose target (workspace/archive)
- Browse and select files
- Click Import
Export to USB:
- Select source data type
- Choose USB drive destination
- Browse target directory
- Click Export
Access: http://localhost:8080/git-repos/
Clone Repository:
git clone http://localhost:8080/git/repo-name.gitWeb Interface:
- Browse files and directories
- View commit history and diffs
- Navigate branches and tags
- Download individual files
Access: http://localhost:8080/branch-protection/
Create Protection Rule:
- Select repository from dropdown
- Click "Add Protection Rule"
- Configure rule settings:
- Branch Pattern:
main,develop,release/*(supports wildcards) - Block Direct Push: Require pull requests for changes
- Required Reviews: Minimum number of code reviews (0-10)
- Enforce Admins: Apply rules to administrator users
- Dismiss Stale Reviews: Auto-dismiss when new commits pushed
- Admin Users: Comma-separated list of users who can bypass rules
- Branch Pattern:
- Click "Create Rule"
Protection Features:
- Pattern Matching: Use wildcards to protect multiple branches (
feature/*,hotfix/*) - Git Hook Enforcement: Server-side pre-receive hooks block unauthorized pushes
- Admin Bypass: Designated admin users can override protection rules
- Review Requirements: Enforce code review workflows before merging
- Real-time Validation: Push operations validated against protection policies
Common Protection Patterns:
# Protect main branch - require reviews, block direct push
Pattern: main
Settings: Block Direct Push β, Required Reviews: 2
# Protect all release branches
Pattern: release/*
Settings: Block Direct Push β, Required Reviews: 1, Enforce Admins β
# Protect development branch with admin bypass
Pattern: develop
Settings: Block Direct Push β, Admin Users: admin,maintainerGit Hook Integration: Protection rules are enforced via Git pre-receive hooks that:
- Check branch patterns against protection rules
- Block direct pushes to protected branches
- Validate user permissions and admin bypass
- Provide clear error messages for blocked operations
Access: Code Editor with π€ AI Complete button
Setup CodeLlama Model:
- Download CodeLlama-7B model (GGUF format)
- Place in
/var/repo/models/directory - Restart container to detect model
Using AI Completion:
- Open any file in the Code Editor
- Position cursor where you want completion
- Click π€ AI Complete button
- Review suggestions and click "Insert" to use
New File Templates:
- Empty Files: Automatically provides starter templates
- Terraform: Complete AWS provider setup with example resources
- Python: Module template with main function
- JavaScript: Node.js compatible module template
- Java: Basic class with main method
Terraform Resource Completion:
- aws_s3_bucket: Bucket configuration with tags
- aws_vpc: VPC with DNS settings and CIDR block
- aws_instance: EC2 instance with AMI and instance type
- aws_security_group: Security group with ingress/egress rules
- Variables/Outputs: Proper Terraform variable and output blocks
AI Features:
- Code Completion: Context-aware code suggestions with starter templates for new files
- Code Explanation: AI explains selected code snippets
- Code Improvement: Suggestions for optimization
- Multi-Language: Python, JavaScript, Java, C++, Terraform, Go, Rust, PHP, Ruby, etc.
- Smart Templates: Automatic starter templates for empty files
- Resource-Aware: Terraform resource-specific completions (AWS S3, VPC, EC2, etc.)
- AI-Powered Analysis - Intelligent code analysis and documentation creation
- Multi-Language Support - Python, JavaScript, Java, Terraform, and more
- Project Documentation - Complete README, API docs, and architecture documentation
- File Documentation - Individual file analysis with functions, classes, and structure
- Repository Documentation - Git repository analysis and documentation generation
- Multiple Export Formats - Markdown, HTML, and JSON export options
- Code Structure Analysis - Automatic detection of functions, classes, imports, and dependencies
- Template-Based Generation - Professional documentation templates with consistent formatting
Model Requirements:
- Minimum: 8GB RAM for CodeLlama-7B
- Storage: 4GB for model file (3.8GB download)
- Format: GGUF quantized models (automatically downloaded)
- Network: Internet connection required for initial download only
Access: http://localhost:8080/documentation/
Generate Project Documentation:
- Navigate to Documentation Generator interface
- Select "Project Documentation" tab
- Enter project path (e.g.,
/var/repo/workspace/my-project) - Click "Generate Documentation"
- Review generated README, API docs, and analysis
- Export in desired format (Markdown, HTML, JSON)
Generate File Documentation:
- Select "File Documentation" tab
- Enter file path (e.g.,
/var/repo/workspace/main.py) - Click "Generate Documentation"
- View detailed function/class analysis
Generate Repository Documentation:
- Select "Repository Documentation" tab
- Choose repository from dropdown
- Click "Generate Documentation"
- Get comprehensive project analysis
Documentation Features:
- Automatic Analysis: Detects functions, classes, imports, and dependencies
- Multi-Language: Python, JavaScript, Java, Terraform, Go, Rust, PHP, Ruby
- Project Structure: Analyzes entry points, config files, and project type
- Professional Templates: README with installation, usage, and API sections
- Export Options: Download as Markdown (.md), HTML (.html), or JSON (.json)
- Code Insights: Line counts, complexity analysis, and architectural overview
Access: http://localhost:8080/mirror-manager/
Mirror External Repository:
- Navigate to Mirror Manager interface
- Enter external repository URL (GitHub, GitLab, etc.)
- System performs comprehensive analysis:
- Trust Analysis - Geographic origin, contributor patterns
- Legal Compliance - License verification, export control
- Security Scanning - Malware detection, suspicious content
- Review analysis results with trust/legal scores
- Approve, reject, or override with warnings
- Successfully mirrored repositories available as read-only
Trust Analysis Features:
- Geographic Analysis - Server location, hosting provider identification
- Contributor Assessment - Email domain verification, account age analysis
- License Detection - Automatic recognition of MIT, Apache, GPL, BSD licenses
- Security Scanning - Binary file detection, Git hook analysis
- Export Control - Cryptography and dual-use technology detection
Repository Types:
- Local Repositories - Full read/write access, created via Git Admin
- External Mirrors - Read-only clones from external sources with trust verification
- Quarantined Repositories - Failed trust analysis, admin override available
Repository Management: Access: http://localhost:8080/git-admin/
Create Local Repository:
- Click "Create Repository" button
- Enter repository name (will auto-add .git extension)
- Add optional description
- Click "Create Repository"
- Repository is immediately available for cloning with full read/write access
Create Branch (Local Repositories Only):
- Click "Branch" button on any local repository
- Enter new branch name (e.g., feature/new-feature)
- Select source branch from dropdown
- Click "Create" to create branch
- Note: Branch creation blocked for external mirrors (read-only)
Delete Repository:
- Click "Delete" button on repository
- Confirm deletion (this action cannot be undone)
- Repository and all data will be permanently removed
- Note: External mirrors cannot be deleted (use quarantine management)
Repository Protection:
- Local Repositories - Full modification rights (push, branch creation, deletion)
- External Mirrors - Read-only protection prevents all modifications
- Visual Indicators - Clear marking of repository types in interface
- Error Messages - Informative feedback when attempting blocked operations
Features:
- Visual repository overview with statistics
- Real-time repository information (commits, branches, size)
- Copy-paste clone URLs for each repository
- Repository type identification (Local vs External Mirror)
- Trust score display for external mirrors
Access: http://localhost:8080/workspace/
Archive β Workspace Sync:
- Copies pristine data to working environment
- Preserves original archive data
- Creates isolated development space
Workspace Operations:
- Edit files without affecting archive
- Test configurations safely
- Export results when ready
Access: http://localhost:8080/project-templates/
Available Templates:
- Python Basic - Virtual environment, requirements.txt, setup.py
- Python Flask - Web application with templates and static files
- Node.js Basic - Package.json with npm scripts and dependencies
- Node.js Express - REST API with Express framework
- C++ Basic - CMake configuration and build structure
- Terraform Basic - Basic Terraform configuration with AWS provider
- Terraform AWS VPC - Complete VPC setup with subnets and security groups
- Terraform AWS Lambda - Serverless API with Lambda and API Gateway
- Terraform AWS S3 + CloudFront - Static website with CDN and SSL
Create New Project:
- Browse available templates
- Click "Create Project" on desired template
- Enter project name and optional description
- Click "Create Project" - instant Git repository creation
- Clone and start developing:
git clone http://localhost:8080/git/project-name.git
Template Features:
- Proper project structure and best practices
- Integrated dependency management (requirements.txt, package.json, CMakeLists.txt)
- Build and setup instructions in README.md
- Appropriate .gitignore files
- Ready-to-run example code
Access: http://localhost:8080/build-manager/
Supported Project Types:
- Python - Virtual environments, requirements.txt, setup.py
- Python Flask - Web applications with Flask dependencies
- Node.js - npm package management and scripts
- C++ - CMake build system configuration
- Java Maven - Maven dependency and build management
- Java Gradle - Gradle build system support
Build Operations:
- Project Detection - Automatically detects project type and dependencies
- Install Dependencies - One-click dependency installation
- Build Project - Execute build commands with real-time output
- Run Tests - Execute test suites with results display
- Status Monitoring - Track build artifacts and dependency status
Features:
- Real-time build output in terminal-style interface
- Visual dependency status indicators
- Build artifact detection and tracking
- Error handling with detailed feedback
- Integration with Git repositories
Access: http://localhost:8080/merge-requests/
Create Merge Request:
- Click "New Merge Request" button
- Select repository and source/target branches
- Add title and description
- Click "Create Merge Request"
- Share MR link for code review
Code Review Process:
- View Changes - Browse commits and file diffs
- Add Comments - General discussion comments
- Inline Comments - Click any line to add specific feedback
- Review Status - Track open/merged/closed states
- Merge Decision - Visual conflict detection
Features:
- GitHub/GitLab-style interface
- Side-by-side diff visualization
- Syntax-highlighted code changes
- Line-by-line commenting system
- Conversation threading
- Merge conflict detection
- Multi-repository support
Access: http://localhost:8080/services/
Multi-Service Application Management:
- Load Docker Compose - Import services from docker-compose.yml files
- Dependency Resolution - Automatic service startup ordering based on dependencies
- Service Control - Start, stop, restart, and scale individual services
- Health Monitoring - Continuous health checks with status reporting
- Resource Management - Monitor and control service resource usage
Features:
- Docker Compose file support
- Automatic dependency resolution
- Service discovery and registration
- Real-time health monitoring
- Web-based service management
- Container logs and debugging
- Service scaling and load balancing
Access: http://localhost:8080/dependencies/
Cross-Platform Dependency Analysis:
- Project Analysis - Scan projects for dependency files (package.json, requirements.txt, pom.xml, etc.)
- Conflict Detection - Identify version conflicts and circular dependencies
- Resolution Ordering - Generate optimal installation sequence
- Lockfile Generation - Create reproducible dependency snapshots
- Export Options - Export dependency graphs in JSON, YAML, or DOT format
Supported Package Managers:
- NPM - package.json, package-lock.json
- Python - requirements.txt, setup.py, Pipfile
- Maven - pom.xml dependency management
- Gradle - build.gradle dependency resolution
- Composer - composer.json for PHP projects
Features:
- Multi-language dependency analysis
- Version conflict detection
- Circular dependency identification
- Installation order optimization
- Dependency tree visualization
- Lockfile generation for reproducible builds
Access: http://localhost:8080/security/
Comprehensive Security Scanning:
- Project Analysis - Full project vulnerability assessment with multi-language support
- Repository Scanning - Direct Git repository security analysis
- Dependency Vulnerabilities - CVE detection in npm, pip, and other package managers
- Code Security - Detection of dangerous functions, patterns, and security anti-patterns
- Secret Detection - Identification of exposed API keys, passwords, and credentials
- Container Security - Dockerfile and container configuration analysis
Vulnerability Types:
- Dependency - Known vulnerabilities in third-party packages
- Code - Insecure coding patterns and dangerous function usage
- Configuration - Misconfigurations in Docker, CI/CD, and deployment files
- Secrets - Exposed credentials, API keys, and sensitive information
- Container - Docker security issues and best practice violations
Remediation Features:
- Automated fix recommendations with specific guidance
- Priority-based remediation planning (Critical β High β Medium β Low)
- Integration with existing editor security analysis
- Real-time vulnerability detection during file editing
- Comprehensive reporting with severity classification
Dependency Scanning Features:
- Multi-File Detection - Scans requirements.txt, package.json, setup.py, and source imports
- Version Analysis - Precise version matching against vulnerability databases
- Real-time Editor Integration - Immediate feedback when editing dependency files
- Git Repository Scanning - Automatic dependency analysis during repository browsing
- Cross-Language Support - Python (pip), JavaScript (npm), Java (Maven/Gradle)
- Offline Database - Built-in vulnerability patterns for offline scanning
Access: http://localhost:8080/coverage/
Test Coverage Analysis:
- Project Analysis - Generate comprehensive coverage reports for local projects
- Repository Scanning - Direct Git repository coverage analysis
- Multi-Language Support - Python (coverage.py), JavaScript (nyc/Istanbul), Java (JaCoCo)
- Visual Metrics - Interactive dashboard with coverage percentages and grades
- File-Level Details - Individual file analysis with missing line identification
- Coverage Comparison - Compare coverage reports across different versions
Coverage Metrics:
- Line Coverage - Percentage of executable lines covered by tests
- Branch Coverage - Percentage of code branches executed during testing
- Function Coverage - Percentage of functions called by test suites
- Coverage Grading - Automated quality assessment (A-F grades)
Dashboard Features:
- Real-time coverage percentage display with color-coded indicators
- Detailed file-by-file coverage breakdown
- Missing lines identification for targeted test improvement
- Coverage grade calculation with improvement recommendations
- Export capabilities for coverage reports and metrics
- Integration with existing project build and test workflows
Access: http://localhost:8080/threat-intelligence/
Start Threat Monitoring:
- Navigate to Threat Intelligence Dashboard
- Click "Start" to begin real-time monitoring
- Monitor CVE feeds, IOC indicators, and supply chain threats
- Use search functionality to find specific threats
- Scan code for malware signatures and IOC matches
Threat Intelligence Features:
- CVE Database Search: Search by severity, exploited status, and keywords
- IOC Indicator Search: Filter by type (IP, domain, hash, URL) and threat actor
- Supply Chain Monitoring: Detect typosquatting and suspicious packages
- Dark Web Alerts: Monitor for credential leaks and data breaches
- Code Scanner: Real-time threat scanning of code snippets
- Automated Updates: Hourly refresh of threat intelligence feeds
Dashboard Metrics:
- Total CVEs tracked with severity breakdown
- High severity and exploited CVE counts
- IOC indicators with confidence ratings
- Supply chain threats and dark web alerts
- Real-time threat feed status and last update times
Access: http://localhost:8080/sandbox/
Create Sandbox Environment:
- Choose Mode - Simplified (instant) or Docker (full isolation)
- Select Environment - Python, Node.js, Java, C++, or Terraform
- Optional Project Import - Copy existing project files into sandbox
- Code Editor - Built-in editor with syntax highlighting and file management
- Execute Code - Run code with automatic linting and vulnerability scanning
Simplified Mode Features:
- Instant Creation - No Docker container startup delay
- File System Workspace - Direct file system access for faster operations
- Full Development Tools - Same linting and security scanning as Docker mode
- Project Import - Copy files from existing projects
- Recommended - Faster and more responsive for most development tasks
Docker Mode Features:
- Complete Isolation - Each sandbox runs in isolated Docker container
- Resource Limits - 512MB memory limit and CPU quota restrictions
- Security Hardening - Read-only containers with restricted privileges
- Network Isolation - Sandboxes cannot access external networks
- Terminal Access - Web-based terminal for advanced operations
Development Tools (Both Modes):
- Multi-Language Linting - flake8/pylint (Python), ESLint (JavaScript), cppcheck (C++), terraform fmt/tflint (Terraform)
- Vulnerability Detection - bandit (Python), npm audit (Node.js), tfsec (Terraform)
- File Management - Create, edit, and save files within sandbox
- Code Execution - Run code with real-time output and error reporting
- Project Import - Copy existing projects into sandbox environments
Sandbox Management:
- Individual Removal - Stop and remove specific sandboxes
- Bulk Removal - "Remove All" button to clean up all sandboxes at once
- Status Monitoring - View sandbox status (running, stopped, ready)
- Resource Tracking - Monitor sandbox resource usage
Access: http://localhost:8080/editor/
Enhanced Editor Features:
- Syntax highlighting - Multi-language support with color coding
- Context-sensitive help - Intelligent autocomplete and documentation
- Copy/Insert snippets - One-click code insertion from help suggestions
- Undo system - Track and revert edits with Ctrl+Z or undo button
- Real-time diff - Show changes against saved file instantly
- Advanced diff viewer - Full-featured diff with inline comments
- Search & replace - Find/replace with regex support
- Security analysis - Real-time vulnerability detection
- File browser - Navigate workspace files with tree view
- Git integration - Edit files directly from Git repositories
Context Help System:
- Position cursor on any code element or select text
- Click "Get Help" to see relevant documentation and examples
- Hover over code snippets to reveal copy/insert buttons
- Click π to copy snippet to clipboard
- Click β to insert snippet at cursor position
- Press Ctrl+Space for autocomplete suggestions
Undo Functionality:
- Automatic tracking - Saves undo states after typing pauses
- Manual operations - Tracks snippet insertions and replacements
- Keyboard shortcut - Ctrl+Z (Cmd+Z on Mac) to undo
- Visual button - βΆ Undo button shows available operations
- Cursor restoration - Restores both content and cursor position
Diff System:
- Show Diff - Quick inline diff modal showing changes
- Advanced Diff - Full-featured diff viewer in new tab
- Real-time comparison - Compare current editor vs saved file
- Git comparison - Compare against Git HEAD when available
- Visual indicators - Color-coded additions, deletions, and context
- Change statistics - Live counts of modifications
Editor Workflow:
# 1. Access editor
http://localhost:8080/editor/
# 2. Select file from recent files or browse workspace
# 3. Edit with full IDE-like features:
# - Context help for any code element
# - Copy/insert code snippets
# - Real-time security scanning
# - Undo/redo operations
# - Live diff visualization
# 4. Save changes and view diffs
# 5. Use Advanced Diff for detailed code reviewAccess: http://localhost:8080/diff-viewer/
Interactive Diff Features:
- Generate Diff - Compare files against Git HEAD, saved versions, or custom content
- Visual Comparison - Side-by-side view with color-coded additions/deletions
- Inline Comments - Click any line to add comments with author attribution
- Change Statistics - Real-time counts of additions, deletions, and modifications
- Comment Threading - Multiple comments per line with timestamps
Usage:
- From Editor - Click "Advanced Diff" button in any code editor
- Direct Access - Navigate to
/diff-viewer/and enter file path - Sandbox Integration - "Diff" button in sandbox editors
- API Access - RESTful endpoints for programmatic diff generation
Comment System:
- Line-specific - Add comments to any diff line (additions, deletions, context)
- Author Tracking - Comments include author name and timestamp
- Visual Indicators - Comment icons appear on lines with discussions
- Toggle View - Show/hide comment threads as needed
Access: http://localhost:8080/ai-model-security/
Trusted Model Catalog:
- Navigate to "Register Model" tab to view AI Model Catalog
- Browse curated models from trusted sources (US, GB, CA, AU, NZ, DE, FR, etc.)
- View model details: size, license, vendor, country of origin
- Click "Download" to get model with automatic fallback sources
- Click "Sources" to check availability of download mirrors
Available Trusted Models:
- CodeLlama 7B Instruct (Meta, US) - 3.8GB - Code generation and completion
- Phi-3 Mini 4K (Microsoft, US) - 2.3GB - Small but capable language model
- Mistral 7B Instruct (Mistral AI, FR) - 4.1GB - Efficient 7B parameter model
- Gemma 2B Instruct (Google, US) - 1.4GB - Lightweight instruction-tuned model
- StarCoder2 3B (Hugging Face, US) - 1.7GB - Code generation specialist
Model Security Features:
- Country Verification - Only models from UK-allied countries allowed
- Vendor Trust - Verified sources (Meta, Microsoft, Google, Hugging Face, Mistral AI)
- Multiple Sources - Automatic fallback if primary download fails
- Integrity Verification - SHA256 checksums and file validation
- Provenance Tracking - Complete audit trail of model origins
- Safety Monitoring - Real-time detection of harmful code patterns
- Performance Tracking - Drift detection and baseline monitoring
Federated Learning:
- Navigate to "Federated Learning" tab
- Register Participants - Add trusted organizations with public keys
- Start FL Round - Initiate collaborative training for specific model
- Monitor Progress - Track active rounds and participant contributions
- Aggregate Updates - Combine model improvements securely
FL Security Features:
- Trusted Participants Only - Country verification (UK-allied nations)
- Cryptographic Authentication - Public key verification
- Privacy Preserving - Only model deltas shared, never raw data
- Weighted Aggregation - Updates weighted by data samples and trust scores
- Audit Trail - Complete logging of all federated learning activities
Federated Learning Workflow:
# 1. Register Organization (Admin)
POST /api/federated-learning/participants/register
{
"participant_id": "university.example.edu",
"public_key": "-----BEGIN PUBLIC KEY-----...",
"country_code": "US",
"organization": "Example University"
}
# 2. Start FL Round (Admin)
POST /api/federated-learning/rounds/start
{
"model_id": "codellama-7b-001",
"target_participants": 3,
"duration_hours": 24
}
# 3. Submit Model Update (Participant)
POST /api/federated-learning/updates/submit
{
"round_id": "fl_round_abc123",
"participant_id": "university.example.edu",
"model_delta": "base64_encoded_model_weights",
"data_samples": 10000,
"loss_improvement": 0.05
}
# 4. Aggregate Updates (Admin)
POST /api/federated-learning/rounds/{round_id}/aggregate
# Returns: aggregated_model_hash for distributionFL Participant Requirements:
- Trusted Country - Must be from UK-allied nation (US, GB, CA, AU, NZ, DE, FR, NL, SE, NO, DK, FI)
- Public Key Authentication - RSA/ECDSA public key for cryptographic verification
- Trust Score β₯30 - Minimum trust threshold for participation
- Organization Verification - Valid organization name and contact information
FL Round Management:
- Target Participants - Configurable (2-10 participants)
- Duration Control - Flexible round duration (1-168 hours)
- Automatic Aggregation - Triggers when target participants reached
- Manual Override - Admin can force aggregation with minimum participants
- Progress Monitoring - Real-time tracking of submissions and status
Safety Violation Detection:
- Harmful Code - Destructive commands (rm -rf, format, DROP DATABASE)
- Malicious Patterns - Backdoors, keyloggers, credential exposure
- Privacy Violations - Personal data exposure, PII leakage
- Security Risks - Code injection, system exploitation attempts
Trust Assessment Levels:
- High Trust (80-100) - Verified sources, established repositories
- Medium Trust (50-79) - Known sources with verification
- Low Trust (0-49) - Unknown sources, failed verification
Access: http://localhost:8080/error-diagnosis/
Diagnose Application Errors:
- Navigate to Error Diagnosis interface (requires admin login)
- Enter error message or paste error output
- Click "Diagnose Error" for intelligent analysis
- Review diagnosis with confidence score and solutions
System Health Check:
- Click "Check System Health" for comprehensive status
- Review disk usage, memory consumption, and service status
- Get recommendations for system optimization
Error Analysis Features:
- Pattern Recognition - Identifies 10+ common error types with 90%+ confidence
- Intelligent Solutions - Provides actionable fix recommendations
- Severity Assessment - Classifies errors by impact level (Info to Critical)
- Root Cause Analysis - Explains underlying causes of issues
- Prevention Guidance - Suggests measures to prevent recurring problems
/var/repo/
βββ archive/ # Pristine data storage
β βββ sources/ # Source packages
β βββ packages/ # Binary packages
β βββ cache/ # Build cache
β βββ git-repos/ # Git repositories
βββ workspace/ # Working environment
β βββ [same structure as archive]
βββ flask-app/ # Web application
/var/repo- Persistent data storage/run/media- USB auto-mount detection (RW)/media- Manual mount points (RW)/mnt- Additional storage (RW)/host/home- Host user directories (RO) - for IDE project access/host/Users- macOS user directories (RO) - for IDE project access/host/opt- Host optional software (RO)/host/projects- Custom project directories (RO)
- 8080 - Web interface (HTTP)
- 9418 - Git daemon (optional)
- Auto-detection of plugged USB drives
- Real-time disk space monitoring
- Multiple filesystem support (exFAT, NTFS, FAT32, ext4)
- Hot-plug support (no restart required)
- Free space information for each drive
- Device type identification (USB, SD Card, NVMe, etc.)
- Mount point display with available space
- Read/write access to external storage
# View logs
docker logs secureai-local-repo
# Restart services
docker exec secureai-local-repo supervisorctl restart flask
# Shell access
docker exec -it secureai-local-repo bash
# Update application
docker cp flask-app/ secureai-local-repo:/var/repo/
docker exec secureai-local-repo supervisorctl restart flaskGET /api/system/disks- Available storage devicesPOST /api/data/import- Import data from external sourcePOST /api/data/export- Export data to external destinationPOST /api/data/browse- Browse filesystemGET /api/git/{repo}/info- Git repository informationPOST /api/git/create- Create new Git repositoryPOST /api/git/{repo}/branch- Create new branch in repositoryDELETE /api/git/{repo}/delete- Delete Git repositoryGET /api/templates- List available project templatesPOST /api/templates/create- Create project from templateGET /api/build/{repo}/info- Get project build information and statusPOST /api/build/{repo}/install- Install project dependenciesPOST /api/build/{repo}/build- Build project with dependenciesPOST /api/build/{repo}/test- Run project testsGET /api/merge-requests- List merge requests with filteringPOST /api/merge-requests- Create new merge requestGET /api/merge-requests/{repo}/{id}- Get specific merge requestGET /api/merge-requests/{repo}/{id}/diff- Get diff and commitsPOST /api/merge-requests/{repo}/{id}/comments- Add general commentPOST /api/merge-requests/{repo}/{id}/inline-comments- Add inline commentGET /api/security/scan/project- Comprehensive vulnerability scanningPOST /api/security/scan/dependencies- Dependency vulnerability analysisPOST /api/security/scan/file-dependencies- Single file dependency scanningGET /api/security/scan/repository/{repo}- Repository security analysisPOST /api/security/remediation- Generate remediation plansPOST /api/coverage/generate- Generate code coverage reportsGET /api/coverage/repository/{repo}- Repository coverage analysisGET /api/services- Service orchestration statusPOST /api/services/compose- Load Docker Compose servicesPOST /api/services/start- Start multi-service applicationsGET /api/dependencies/analyze- Cross-platform dependency analysisPOST /api/dependencies/resolve- Dependency conflict resolutionPOST /api/sandbox/create- Create new sandbox environment (simplified or Docker mode)POST /api/sandbox/{name}/execute- Execute code in sandbox with linting and vulnerability scanningGET /api/sandbox/{name}/files- List files in sandboxGET /api/sandbox/{name}/file/{path}- Read file from sandboxPOST /api/sandbox/{name}/file/{path}- Write file to sandboxGET /api/sandbox/{name}/terminal- Get terminal access to sandboxGET /api/sandbox- List all sandbox environmentsPOST /api/sandbox/{name}/stop- Stop and remove individual sandboxPOST /api/sandbox/stop-all- Stop and remove all sandboxesPOST /api/editor/diff- Generate diff for file with inline comments supportPOST /api/diff/comment- Add inline comment to specific diff lineGET /api/diff/comments/{file_path}- Get all comments for a filePOST /api/diff/compare- Compare two different files with diff visualizationPOST /api/error/diagnose- Intelligent error diagnosis and solution recommendationsGET /api/system/health- System health check with resource monitoringGET /api/ai-models/list- List all registered AI models with security statusPOST /api/ai-models/register- Register new AI model with provenance trackingPOST /api/ai-models/{id}/verify- Verify AI model integrity and authenticityPOST /api/ai-models/safety-check- Check generated code for safety violationsPOST /api/ai-models/performance-test- Test model performance and detect driftGET /api/ai-models/{id}/status- Get comprehensive model security statusPOST /api/os-builder/start- Start OS build with failure recoveryPOST /api/os-builder/start-ai- Start AI-controlled build with Git-first downloadsPOST /api/os-builder/retry- Retry failed build with resume capabilityGET /api/os-builder/analyze-failure- AI-powered failure analysisGET /api/os-builder/status- Build status with failure detectionGET /api/os-builder/build-log- Build logs with failure analysisGET /api/os-builder/build-sources- List available build source files in Git repositoryPOST /api/os-builder/download-sources- Download build sources with Git-first strategy and resilient downloads
Repository Security Examples:
# High Trust Repository (Auto-Approved):
# URL: https://github.com/microsoft/vscode.git
# Trust Score: 95/100 (US hosting, 1000+ contributors, established)
# Legal Score: 95/100 (MIT license, clear redistribution rights)
# Result: β
Automatically mirrored as read-only
# Medium Trust Repository (Requires Confirmation):
# URL: https://github.com/newuser/experimental-tool.git
# Trust Score: 65/100 (New contributors, limited history)
# Legal Score: 85/100 (Apache-2.0 license, compliant)
# Result: β οΈ User confirmation required
# Low Trust Repository (Rejected):
# URL: https://suspicious-domain.com/user/tool.git
# Trust Score: 35/100 (Blocked country, suspicious contributors)
# Legal Score: 40/100 (No license detected, export control concerns)
# Result: β Automatically quarantined
# Quarantine Management:
# - View quarantined repos: /mirror-manager/ β Quarantined section
# - Admin override: "Restore (Admin Override)" button
# - Restored repos remain READ-ONLY for securityConnection Reset (localhost:8080):
- Check if Flask application is running:
docker exec secureai-local-repo supervisorctl status - Install missing Python dependencies:
docker exec secureai-local-repo pip3 install PyYAML networkx - Restart Flask service:
docker exec secureai-local-repo supervisorctl restart flask - Use Error Diagnosis System: Navigate to
/error-diagnosis/for intelligent troubleshooting
Sandbox Creation Issues:
- Simplified Mode Fails: Check filesystem permissions and available disk space
- Docker Mode Fails: Ensure Docker-in-Docker is properly configured with
--privilegedflag - Container Access: Check container has access to Docker socket:
-v /var/run/docker.sock:/var/run/docker.sock - Terraform Issues: Verify Terraform containers use proper entrypoint override for shell access
- Performance: Use Simplified mode for faster sandbox creation (recommended)
Sandbox Management Issues:
- "Remove All" Not Working: Check Docker daemon status and container permissions
- Sandbox Not Stopping: Use "Remove All" button to force cleanup of problematic containers
- Status Not Updating: Refresh the page or check container discovery in Docker daemon
USB Drive Not Detected:
- Ensure container has
--privilegedflag - Check volume mounts include
/run/media:/run/media - Verify USB drive is mounted on host system
Git Clone Fails:
- Check repository exists in
/var/repo/git-repos/ - Verify Git HTTP backend is running
- Test with:
curl http://localhost:8080/git/repo.git/info/refs
Push to Repository Fails:
- External Mirrors: Push operations are blocked by design (read-only)
- Local Repositories: Check repository was created via /git-admin/ (not mirrored)
- Error Message: "Push to external mirror not allowed" indicates read-only mirror
- Solution: Create local repository copy or use original external source
Mirror Request Fails:
- Trust Analysis: Repository may fail trust/legal thresholds
- Network Issues: Check external repository URL accessibility
- Blocked Country: Repository hosted in configured blocked countries
- License Issues: No approved license detected or export control concerns
- Solution: Review analysis details, adjust thresholds, or use admin override
Repository Modification Blocked:
- Branch Creation: "Cannot create branches in external mirror" - use local repo
- Repository Deletion: "Cannot delete external mirror" - use quarantine management
- File Editing: External mirror files are read-only - clone to workspace first
Firefox ESR Issues:
- JavaScript functionality may be limited
- Use server-side alternatives when available
- Check browser security settings
Disk Space Full:
- Clean Docker system:
docker system prune -a -f --volumes - Check available space:
df -h - Move data to USB drives using data manager
# Container status
docker ps
# Service status
docker exec secureai-local-repo supervisorctl status
# Flask application logs
docker logs secureai-local-repo
# Test web interface
curl -I http://localhost:8080
# Disk usage
curl http://localhost:8080/api/system/disks
# Git repositories
curl http://localhost:8080/api/git/
# Mirror management
curl http://localhost:8080/api/mirror/list
curl http://localhost:8080/api/mirror/quarantine
curl http://localhost:8080/api/mirror/config
# Test repository trust analysis
curl -X POST http://localhost:8080/api/mirror/analyze \
-H "Content-Type: application/json" \
-d '{"repo_url": "https://github.com/user/repo.git"}'
# Error diagnosis and system health
curl -X POST http://localhost:8080/api/error/diagnose \
-H "Content-Type: application/json" \
-d '{"error_message": "Connection refused"}'
curl http://localhost:8080/api/system/health
# Sandbox environments
curl http://localhost:8080/api/sandbox
# Remove all sandboxes
curl -X POST http://localhost:8080/api/sandbox/stop-allCreating and Using a Local Repository:
# 1. Create LOCAL repository via web interface at /git-admin/
# 2. Clone the empty repository (FULL READ/WRITE ACCESS)
git clone http://localhost:8080/git/my-project.git
cd my-project
# 3. Add initial content
echo "# My Project" > README.md
echo "print('Hello World')" > main.py
git add .
git commit -m "Initial commit"
git push origin master # β
PUSH ALLOWED (local repository)
# 4. Create and work on feature branch
git checkout -b feature/new-feature
echo "def new_feature(): pass" >> main.py
git add main.py
git commit -m "Add new feature"
git push origin feature/new-feature # β
PUSH ALLOWED
# 5. Switch back to main branch
git checkout master
echo "## Installation" >> README.md
git add README.md
git commit -m "Update README"
git push origin master # β
PUSH ALLOWEDUsing External Mirror (Read-Only):
# 1. Mirror external repository via /mirror-manager/
# 2. Clone the mirrored repository (READ-ONLY ACCESS)
git clone http://localhost:8080/git/external-project.git
cd external-project
# 3. You can read and build, but NOT push
echo "local changes" >> README.md
git add README.md
git commit -m "Local changes"
git push origin master # β PUSH BLOCKED - "Push to external mirror not allowed"
# 4. To modify external code, create local copy:
git clone http://localhost:8080/git/external-project.git my-fork
cd my-fork
# Create new local repository via /git-admin/ and push thereSecure Mirroring Workflow:
# 1. Request mirror via web interface at /mirror-manager/
# Enter URL: https://github.com/user/repository.git
# 2. System performs comprehensive analysis:
# - Trust Score: 85/100 (Geographic: US, Contributors: 15, Clean)
# - Legal Score: 90/100 (License: MIT, Redistribution: Allowed)
# - Security: No malware detected, 2 binary files flagged
# 3. Repository approved and mirrored as READ-ONLY
# 4. Clone and use safely:
git clone http://localhost:8080/git/user_repository.git
cd user_repository
# 5. All modification attempts blocked:
git push origin master # β "Push to external mirror not allowed"
# Branch creation via web UI # β "Cannot create branches in external mirror"
# Repository deletion # β "Cannot delete external mirror"Web-Based Repository Management:
# Local Repository Operations (Full Access):
# - Create repositories: /git-admin/ β "Create Repository" (read/write)
# - Create branches: /git-admin/ β "Branch" button (local repos only)
# - Delete repositories: /git-admin/ β "Delete" button (local repos only)
# - Browse repositories: /git-repos/
# - View commits: /git/{repo}/commits
# - Browse files: /git/{repo}/tree
# External Mirror Operations (Read-Only):
# - Mirror repositories: /mirror-manager/ β "Analyze & Mirror"
# - View trust analysis: /mirror-manager/ β Analysis details
# - Manage quarantine: /mirror-manager/ β Quarantined repositories
# - Configure thresholds: /mirror-manager/ β Configuration panel
# - Browse mirrors: /git-repos/ (marked as read-only)Trust Analysis Configuration:
# Default Configuration:
# - Trust Threshold: 70/100 (minimum to auto-approve)
# - Legal Threshold: 80/100 (minimum for legal compliance)
# - Blocked Countries: CN, RU, KP, IR
# - Approved Licenses: MIT, Apache-2.0, BSD-3-Clause, GPL-3.0, etc.
# Customizable via /mirror-manager/ interface:
# - Adjust trust/legal thresholds
# - Modify blocked country list
# - Update approved license list
# - Force mirror with admin overrideProject Template Workflow:
# 1. Create project from template via web interface at /project-templates/
# 2. Clone the generated project
git clone http://localhost:8080/git/my-flask-app.git
cd my-flask-app
# 3. Set up development environment (example for Flask)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# 4. Start developing
python app.py
# 5. Make changes and commit
git add .
git commit -m "Add new features"Build Management Workflow:
# 1. Create or clone a project
git clone http://localhost:8080/git/my-project.git
# 2. Use Build Manager web interface at /build-manager/
# - Project type automatically detected
# - Dependencies listed and status shown
# - One-click operations available
# 3. Install dependencies via web interface
# For Python: python -m venv venv && pip install -r requirements.txt
# For Node.js: npm install
# For C++: mkdir build && cmake .. && make
# 4. Build project via web interface
# Executes appropriate build commands based on project type
# 5. Run tests via web interface
# Executes test commands with real-time output
# All operations provide real-time terminal output and status updatesEnhanced Security Workflow:
# 1. Comprehensive vulnerability scanning at /security/
git clone http://localhost:8080/git/my-project.git
cd my-project
# 2. Multi-layer security analysis via web interface
# - Code vulnerabilities: dangerous functions, security anti-patterns
# - Dependency vulnerabilities: CVE detection in requirements.txt, package.json
# - Secret detection: exposed API keys, passwords, credentials
# - Container security: Dockerfile best practices analysis
# 3. Real-time security integration
# - Edit requirements.txt β immediate vulnerability feedback
# - Browse Git repository β automatic dependency analysis
# - View files in editor β real-time security indicators
# 4. Automated remediation
# - Priority-based fix recommendations (Critical β High β Medium β Low)
# - Version-specific upgrade guidance
# - Integration with existing development workflowService Orchestration & Dependency Management:
# 1. Multi-service application management at /services/
# Load docker-compose.yml β automatic service discovery
# Start services with dependency resolution
# Monitor health and scale services dynamically
# 2. Cross-platform dependency analysis at /dependencies/
# Analyze package.json, requirements.txt, pom.xml
# Detect conflicts and generate installation order
# Export lockfiles and dependency graphsCode Coverage & Quality Analysis:
# 1. Test coverage analysis at /coverage/
# Generate reports for Python, JavaScript, Java projects
# Visual dashboard with A-F grading system
# File-level analysis with missing line identification
# 2. Integration with development workflow
# Repository coverage analysis from Git
# Export coverage metrics and reports
# Compare coverage across versionsMerge Request Workflow:
# 1. Create feature branch and make changes
git clone http://localhost:8080/git/my-project.git
cd my-project
git checkout -b feature/new-feature
echo "new feature code" > feature.py
git add feature.py
git commit -m "Add new feature"
# 2. Create merge request via web interface at /merge-requests/
# - Select repository and branches
# - Add title and description
# - Submit for review
# 3. Code review process
# - Reviewers view diff at /merge-requests/{repo}/{id}
# - Add general comments for discussion
# - Click on specific lines to add inline comments
# - Review commits and file changes
# 4. Collaboration and iteration
# - Address reviewer feedback
# - Make additional commits to feature branch
# - Continue discussion in MR comments
# 5. Merge decision
# - Check for merge conflicts (automatic detection)
# - Approve and merge when ready
# - Close MR and clean up branchesSandbox Workflow:
# 1. Create sandbox environment at /sandbox/
# Choose mode: Simplified (recommended) or Docker (full isolation)
# Select environment: Python, Node.js, Java, C++, or Terraform
# Optional: Import existing project files
# 2. Access integrated code editor
# Navigate to sandbox β Click "Editor" button
# Built-in editor with syntax highlighting
# File management within sandbox
# 3. Write and execute code
# Create/edit files in sandbox environment
# Click "Run" for automatic execution with analysis
# View real-time linting and security results
# 4. Simplified mode benefits
# Instant creation (no Docker startup delay)
# Faster file operations and code execution
# Same development tools as Docker mode
# Recommended for most development tasks
# 5. Docker mode security (when needed)
# 512MB memory limit per sandbox
# CPU quota restrictions
# Network isolation (no external access)
# Complete container isolation
# 6. Development tools (both modes)
# Multi-language linting (flake8, pylint, ESLint, cppcheck, tflint)
# Security scanning (bandit, npm audit, tfsec)
# Terminal access for advanced operations (Docker mode)
# Project import from existing repositories
# 7. Sandbox management
# Individual removal: Click "Stop" button on sandbox card
# Bulk removal: Click "Remove All" button to clean up all sandboxes
# Status monitoring: View running/stopped/ready statusDiff Visualization Workflow:
# 1. Access diff viewer at /diff-viewer/
# Enter file path and select comparison mode
# Generate visual diff with syntax highlighting
# 2. Interactive code review
# Click any diff line to add inline comments
# View additions (green), deletions (red), context (white)
# See real-time statistics (additions, deletions, changes)
# 3. Comment system
# Add line-specific comments with author attribution
# Multiple comments per line with timestamps
# Toggle comment visibility as needed
# 4. Integration with editors
# "Advanced Diff" button in code editors
# "Diff" button in sandbox environments
# Direct links from file editors
# 5. API usage for automation
# POST /api/editor/diff - Generate structured diff
# POST /api/diff/comment - Add programmatic comments
# GET /api/diff/comments/{file} - Retrieve all commentsTerraform Infrastructure Workflow:
# 1. Create Terraform project from template at /project-templates/
# Choose from: Basic, AWS VPC, AWS Lambda, S3+CloudFront
git clone http://localhost:8080/git/my-terraform-project.git
cd my-terraform-project
# 2. Configure variables
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your specific values
# 3. Use Terraform sandbox for safe execution at /sandbox/
# Create Terraform sandbox environment
# Upload project files to sandbox
# Execute Terraform commands in isolated environment
# 4. Terraform operations in sandbox:
# terraform init - Initialize providers and modules
# terraform validate - Validate configuration syntax
# terraform plan - Preview infrastructure changes
# terraform apply - Deploy infrastructure (with approval)
# 5. Code editor integration:
# - Terraform syntax highlighting (.tf, .tfvars, .hcl files)
# - Context-sensitive help for resources and functions
# - Real-time linting with terraform fmt and tflint
# - Security scanning with tfsec
# - Autocomplete for Terraform blocks and AWS resources
# 6. Security and best practices:
# - Automatic tfsec scanning for security issues
# - Terraform fmt for consistent formatting
# - Variable validation and type checking
# - Resource tagging compliance
# - Cost optimization recommendationsTerraform Template Examples:
Basic Infrastructure:
# Creates S3 bucket with random suffix
resource "aws_s3_bucket" "example" {
bucket = "${var.project_name}-${random_id.bucket_suffix.hex}"
}
resource "random_id" "bucket_suffix" {
byte_length = 4
}VPC with Subnets:
# Complete VPC setup with public/private subnets
resource "aws_vpc" "main" {
cidr_block = var.vpc_cidr
enable_dns_hostnames = true
enable_dns_support = true
}
resource "aws_subnet" "public" {
count = length(var.public_subnet_cidrs)
vpc_id = aws_vpc.main.id
cidr_block = var.public_subnet_cidrs[count.index]
map_public_ip_on_launch = true
}Lambda Function:
# Serverless API with Lambda and API Gateway
resource "aws_lambda_function" "main" {
filename = data.archive_file.lambda_zip.output_path
function_name = "${var.project_name}-function"
role = aws_iam_role.lambda_role.arn
handler = "index.handler"
runtime = "python3.9"
}
resource "aws_api_gateway_rest_api" "main" {
name = "${var.project_name}-api"
description = "API Gateway for ${var.project_name}"
}Static Website:
# S3 + CloudFront for static website hosting
resource "aws_s3_bucket" "website" {
bucket = var.domain_name
}
resource "aws_cloudfront_distribution" "website" {
origin {
domain_name = aws_s3_bucket.website.bucket_regional_domain_name
origin_id = "S3-${aws_s3_bucket.website.bucket}"
}
enabled = true
default_root_object = "index.html"
aliases = [var.domain_name]
}Access: http://localhost:8080/os-builder/
Build SecureAI-OS from Scratch: Complete autonomous intelligence operating system with AI integration, security hardening, and minimal footprint.
Git-First Build System:
- Build Sources Repository: Dedicated
build-sources.gitrepository for all source files - Git-First Downloads: Checks local Git repository before downloading from external sources
- Automatic Fallback: Downloads from external mirrors only when files not available locally
- Resilient Downloads: Continues with available files even if some downloads fail
- Version Control: All source files tracked in Git with checksums and metadata
- Offline Capability: Once downloaded, builds work without internet connection
Enhanced Build Features:
- Resume Downloads: Automatically resume from interruption point (8.5%, 25%, 50%, etc.)
- Multiple Sources: 3+ mirror sources per package (kernel.org, gnu.org, mirrors.kernel.org)
- Checksum Verification: SHA256 integrity checking for all downloads with manifest tracking
- Smart Retry: AI-powered failure analysis with specific recommendations
- Alternative Sources: Automatic failover to backup download mirrors
- Build Source Manager: Centralized management with comprehensive error tracking
Start Build:
- Select build template (minimal-ai, desktop-ai, server-ai, embedded-ai)
- Configure kernel version, GCC version, target architecture
- Choose output storage location (internal or external USB)
- Click "Start Build" or "Start AI Build" for Git-first downloads
- System checks
build-sources.gitrepository first, then downloads missing files - Monitor progress with real-time failure detection and resilient download system
- Build creates Git repository with complete source and binary tracking
Git-First Download Process:
- Check Local Git: System first checks
build-sources.gitfor required files - Download Missing: Only downloads files not available in local repository
- Multiple Sources: Uses 3+ mirror sources with automatic failover
- Continue on Failure: Continues with available files even if some downloads fail
- Git Commit: All successful downloads automatically committed to Git
- Manifest Update: Checksums and metadata tracked in
manifest.json
Build Process (6 Steps with Recovery):
- Download Sources - Linux kernel, GCC, binutils, glibc, BusyBox (5-15 min) [Resume Capable]
- Build Toolchain - Cross-compilation tools (10-30 min)
- Build Kernel - AI-integrated Linux kernel (15-45 min)
- Build Root Filesystem - BusyBox utilities with AI services (5-15 min)
- Create Initramfs - Initial RAM filesystem (1-3 min)
- Create Bootable ISO - Final SecureAI-OS image (2-5 min)
Failure Recovery:
- Auto-Analysis: Automatic failure diagnosis with specific recommendations
- One-Click Retry: "Retry Build" button with enhanced error handling
- Resume Capability: Continue from exact failure point (no re-downloading)
- Alternative Sources: Automatic mirror switching for failed downloads
- Faster Retries: 30-50% faster due to resumed downloads and cached data
Output:
- Bootable ISO:
secureai-os.iso(50MB - 800MB depending on template) - Git Repository: Complete build history with AIOS-YYYYMMDD-HHMMSS-r1 naming and failure analysis
- Documentation: Build reports, security scans, failure diagnostics, and retry recommendations
- Clone URL:
http://localhost:8080/git/AIOS-YYYYMMDD-HHMMSS-r1.git
Common Issues & Auto-Solutions:
- Network Timeouts: Automatic retry with alternative mirror sources
- Partial Downloads: Resume from exact interruption point (8.5%, 25%, etc.)
- Missing Files: Git-first system continues with available files, reports missing ones
- Disk Space: Automatic detection and storage recommendations
- Build Failures: AI-powered analysis with specific fix recommendations
- Source Integrity: SHA256 checksum verification with automatic re-download on mismatch
Build Sources Management: Access: http://localhost:8080/api/os-builder/build-sources
Available Build Sources:
- View all files in
build-sources.gitrepository - Check file checksums and download timestamps
- Browse Git repository at:
http://localhost:8080/git-repos/build-sources/ - Clone repository:
git clone http://localhost:8080/git/build-sources.git
Download Build Sources:
# Download default SecureAI-OS source files
curl -X POST http://localhost:8080/api/os-builder/download-sources \
-H "Content-Type: application/json" -d '{}'
# Download custom file specifications
curl -X POST http://localhost:8080/api/os-builder/download-sources \
-H "Content-Type: application/json" -d '{
"file_specs": [
{
"filename": "custom-package.tar.xz",
"urls": [
"https://primary-source.com/package.tar.xz",
"https://mirror.com/package.tar.xz"
],
"checksum": "sha256_hash_here"
}
]
}'- Git-First Build Sources - All build files stored in dedicated
build-sources.gitrepository with automatic version control - Resilient Download System - Continues downloading even if some files fail, with comprehensive error tracking and reporting
- Build Source Manager - Centralized management of all source files with SHA256 checksum verification and manifest tracking
- Offline Build Capability - Once downloaded, builds work without internet using local Git repository
- Full OS Build System - Build SecureAI-OS from scratch with Linux kernel, GCC toolchain, and AI integration
- AI-Powered Failure Recovery - Automatic failure diagnosis with 90%+ accuracy and specific fix recommendations
- Resume Downloads - Intelligent resume from exact interruption point (8.5%, 25%, 50%, etc.) with multiple mirror sources
- Git Integration - Automatic Git repository creation for each build with complete source and binary tracking
- Knowledge Database - Learning system that stores build patterns, failure analysis, and successful fixes
- Build Templates - Pre-configured templates (minimal-ai, desktop-ai, server-ai, embedded-ai) with optimized settings
- Smart Retry System - One-click retry with enhanced error handling and 30-50% faster rebuilds
- Storage Flexibility - Build to internal storage or external USB drives with automatic detection and space monitoring
- Real-time Monitoring - Live build progress with 6-step process tracking, failure detection, and performance metrics
- Comprehensive Documentation - Auto-generated build reports, security scans, failure diagnostics, and retry recommendations
- Model Provenance Tracking - Complete audit trail with source URLs, download history, and trust scoring
- Integrity Verification - SHA256 checksums, file validation, and signature verification for model authenticity
- AI Safety Guardrails - Real-time detection of harmful code patterns with severity classification (low/medium/high/critical)
- Performance Monitoring - Baseline tracking, drift detection, and automated performance degradation alerts
- Trust Assessment - Automated scoring (0-100) based on source reputation, file characteristics, and verification status
- Violation Detection - Pattern-based safety analysis for harmful code, malicious patterns, and privacy violations
- Secure Registry - Centralized SQLite database for all AI model security metadata and audit trails
- Admin-Only Access - All AI model security features require admin authentication for enhanced security
- Intelligent Error Analysis - Pattern-based error recognition engine with 90%+ confidence for common issues
- Automated Solutions - Actionable fix recommendations for connection errors, permission problems, and storage issues
- System Health Monitoring - Real-time monitoring of disk usage (81% warning level), memory consumption (24% normal), and service status
- Pattern Matching Engine - Recognition of 10+ error types including network failures, authentication issues, and resource constraints
- Severity Classification - Automatic categorization by impact level (Info, Low, Medium, High, Critical)
- Admin Security - Diagnostic tools require authentication to protect sensitive system information
- Prevention Guidance - Proactive recommendations to prevent recurring issues
- Dual-Mode Operation - Added Simplified mode for instant sandbox creation alongside existing Docker mode
- Improved Performance - Simplified mode eliminates Docker container startup delays (10-30 seconds)
- Enhanced User Experience - Mode selection with clear recommendations and timing expectations
- Bulk Management - "Remove All Sandboxes" button for efficient cleanup of multiple environments
- Robust Error Handling - Fixed KeyError issues with sandbox container management
- Status Monitoring - Improved sandbox discovery and status reporting for existing containers
- Flask Application Stability - Resolved missing Python dependencies (PyYAML, networkx)
- Docker-in-Docker Support - Full container isolation with privileged access and Docker socket mounting
- Terraform Sandbox Fix - Resolved entrypoint conflicts for proper shell access in Terraform containers
- Container Health Monitoring - Enhanced error handling and status checking for sandbox environments
- Production Ready - System fully tested and operational at http://localhost:8080
- Full read/write access to USB drives and external storage
- Auto-detection of newly inserted drives
- Device type identification (USB, SD Card, NVMe SSD)
- Real-time space monitoring with free space display
- Disk selection dropdowns with available space information
- Import/export functionality between USB drives and workspace
- Filesystem browser for navigating external storage
- Archive/workspace separation for data integrity
- Complete Git HTTP backend with clone/fetch/pull support
- Web-based repository browser with file viewing
- Commit history and branch navigation
- Working repository creation and management
- Web-based Git administration - Create/delete repositories via UI
- Branch management interface - Create branches from web interface
- Repository statistics - Visual overview of commits, branches, size
- Firefox ESR compatibility for enterprise environments
- Enhanced diff functionality with Git integration
- Search capabilities across files and directories
- Improved navigation and user interface
- Dropdown navigation system - Organized menu structure
- Responsive design - Clean, modern interface
- Interactive forms - JavaScript-powered Git operations
- Container privilege escalation for hardware access
- Volume mount optimization for external storage
- Service management with supervisord
- Health monitoring and status reporting
- Built-in templates - Python, Node.js, C++, Flask, Express project templates
- One-click project creation - Instant setup with proper structure and dependencies
- Template engine - Placeholder replacement and file generation system
- Git integration - Projects created as ready-to-clone repositories
- Extensible framework - Easy to add custom templates
- Project type detection - Automatic detection of Python, Node.js, C++, Java projects
- Dependency management - One-click installation of project dependencies
- Build automation - Automated build processes with real-time terminal output
- Test integration - Execute test suites with visual feedback and results
- Build status tracking - Monitor dependency installation and build artifacts
- Multi-language support - Python (pip), Node.js (npm), C++ (cmake), Java (maven/gradle)
- Web-based code review - GitHub/GitLab-style merge request interface
- Diff visualization - Side-by-side diff with syntax highlighting and line numbers
- Inline commenting - Click any line to add specific code review comments
- Conversation threading - General comments and discussion system
- Merge conflict detection - Automatic checking for merge conflicts
- Multi-repository support - Works across all Git repositories
- Isolated container environments - Secure Docker-based execution with resource limits and security hardening
- Multi-language sandbox support - Python, Node.js, Java, C++ development environments with pre-installed tools
- Integrated code editor - Built-in web-based editor with syntax highlighting and file management
- Automatic code analysis - Real-time linting and vulnerability scanning during code execution
- Resource isolation - 512MB memory limits, CPU quotas, and network isolation per sandbox
- Security hardening - Read-only containers with restricted privileges and no external network access
- Terminal access - Web-based terminal interface for advanced operations within sandboxes
- Project import - Copy existing projects into sandbox environments for isolated development
- Interactive diff viewer - GitHub/GitLab-style diff visualization with syntax highlighting
- Inline comment system - Click-to-comment on any diff line with author attribution and timestamps
- Multi-format comparison - Git HEAD, saved files, and custom content comparison modes
- Real-time statistics - Live addition/deletion counts and change metrics display
- Editor integration - Direct access from code editors, sandbox environments, and file viewers
- API-driven architecture - RESTful endpoints for programmatic diff generation and comment management
- Enhanced vulnerability assessment - Multi-source dependency scanning with CVE detection
- Code coverage reporting - Multi-language test coverage analysis with visual dashboards
- Service orchestration - Docker Compose support with dependency resolution
- Dependency management - Cross-platform dependency analysis and conflict detection
- Real-time security integration - File-level vulnerability detection in editor and Git viewer
- Comprehensive remediation - Automated fix recommendations with version-specific guidance
- Dropdown navigation system - Organized menu structure with grouped functionality
- Git administration panel - Complete web-based repository management
- Interactive repository creation - Forms for creating repositories and branches
- Visual repository overview - Cards showing repository statistics and actions
- RESTful API endpoints - Programmatic access to all Git operations
- Project templates interface - Visual template selection and project creation
- Merge request interface - Complete code review and collaboration system
- Security dashboards - Comprehensive vulnerability assessment and remediation interfaces
- Coverage dashboards - Interactive test coverage reporting with detailed metrics
Context Help Workflow:
// 1. Position cursor on 'fetch' and click "Get Help"
fetch('/api/data')
.then(response => response.json())
.then(data => console.log(data));
// 2. Help panel shows:
// - fetch() documentation
// - Example code snippets
// - Copy/insert buttons on hover
// 3. Click β on a snippet to insert at cursor
// 4. Use Ctrl+Z to undo if neededDiff Visualization Workflow:
# 1. Make changes to a file in the editor
# 2. Click "Show Diff" for quick inline view
# 3. Click "Advanced Diff" for full-screen analysis
# 4. See color-coded changes:
# - Green: additions
# - Red: deletions
# - White: context
# 5. View change statistics and line numbersUndo System Workflow:
# 1. Edit file normally - undo states saved automatically
# 2. Insert code snippet - creates immediate undo point
# 3. Use find/replace - creates undo point before operation
# 4. Click βΆ Undo button or press Ctrl+Z to revert
# 5. Button shows count of available undo operationsContext-Sensitive Help System:
- Intelligent code analysis - Detects programming language and context automatically
- Real-time help - Position cursor anywhere for relevant documentation
- Interactive snippets - Copy or insert code examples with one click
- Multi-language support - JavaScript, Python, HTML, CSS with extensible framework
- Autocomplete integration - Ctrl+Space for smart suggestions
- Quick reference - Language-specific reference guides
Copy/Insert Functionality:
- Hover-activated buttons - Copy (π) and insert (β) buttons on code snippets
- Clipboard integration - Modern clipboard API with fallback support
- Direct insertion - Insert snippets at current cursor position
- Toast notifications - Visual feedback for copy/insert operations
- Context preservation - Maintains editor state and cursor position
Advanced Undo System:
- Smart state tracking - Captures meaningful editing operations
- Debounced saves - Groups typing into logical undo units
- Operation-specific tracking - Tracks snippet insertions, replacements, and manual edits
- Cursor position restoration - Restores both content and cursor location
- Visual feedback - Undo button shows available operation count
- Keyboard shortcuts - Standard Ctrl+Z (Cmd+Z) support
- Memory efficient - Limits to 10 undo states to prevent memory issues
Enhanced Diff System:
- Dual diff modes - Quick inline diff and advanced full-screen diff
- Real-time comparison - Compare current editor content vs saved file
- SessionStorage integration - Passes editor content to advanced diff viewer
- Visual diff rendering - Color-coded additions, deletions, and context lines
- Change statistics - Live counts of additions, deletions, and modifications
- Git integration - Compare against Git HEAD when available
- Structured diff output - Parsed diff data with line-by-line analysis
This project is part of the SecureAI-OS development environment.