Skip to content

v0.0.1a2

Latest
Compare
Choose a tag to compare
@vikashkrdeveloper vikashkrdeveloper released this 18 Jul 01:34
· 2 commits to master since this release

SafeExec v0.0.1a2 - Initial Alpha Release 🚀

Overview

SafeExec is a secure remote code execution (RCE) backend system designed for online coding platforms, educational tools, and competitive programming environments. This alpha release provides core functionality for executing code in multiple programming languages within secure Docker containers.

Core Features

Supported Languages

  • JavaScript/Node.js – ES6+ features supported
  • Java – JVM-based execution with proper compilation
  • Python – Full support with timeout and memory limits (may hit timeout or memory issues in heavy tasks)
  • C++ – GCC compilation with optimizations (latest C++ standards may not be fully supported; limited error output)

Security Features

  • Docker Isolation - Each execution runs in isolated containers
  • Network Restrictions - No network access during code execution
  • Memory Limits - Configurable memory constraints (128MB-512MB)
  • Timeout Controls - Execution time limits (10-30 seconds)
  • Process Limits - Maximum 50 processes per container
  • File System Limits - 1MB file size restrictions

Performance & Scalability

  • High Concurrency - Support for 20+ concurrent executions
  • Performance Monitoring - Real-time execution metrics
  • Circuit Breaker Pattern - Resilient error handling
  • Load Management - Automatic scaling based on demand
  • Queue System - Redis-based job processing with Bull

Architecture

Tech Stack

  • Backend: Node.js + TypeScript + Express
  • Database: MongoDB with Mongoose ODM
  • Queue: Redis + BullMQ for job processing
  • Containerization: Docker + Docker Compose
  • Security: Secure Docker execution environment

Key Components

  • SecureDockerExecutor: Core execution engine with security controls
  • Queue Workers: Multi-threaded job processing system
  • Performance Monitor: Real-time metrics and health checks
  • API Controllers: RESTful endpoints for code submission
  • Authentication: JWT-based user authentication

What's Included

API Endpoints

  • POST /api/execute - Execute code directly
  • POST /api/submissions - Submit code for queue processing
  • GET /api/submissions/:id - Get submission status and results
  • GET /api/health - System health and metrics
  • POST /api/auth/login - User authentication

Docker Setup

  • Pre-built executor images for all supported languages
  • Production-ready Docker Compose configuration
  • SSL/TLS support with Nginx reverse proxy
  • Automated container cleanup and resource management

Development Tools

  • TypeScript configuration with strict type checking
  • ESLint + Prettier for code quality
  • Jest testing framework with coverage reports
  • Husky pre-commit hooks for code quality
  • Commitlint for conventional commit messages

Installation & Setup

# Clone the repository
git clone https://github.com/vikashkrdeveloper/SafeExec.git
cd SafeExec

# Set up environment
cp .env.example .env

Quick Setup with Hot-Reload

# Complete development setup in one command
yarn setup:dev

Full Changelog: https://github.com/vikashkrdeveloper/SafeExec/commits/v0.0.1a2