All Projects → remoteinterview → Compilebox

remoteinterview / Compilebox

Licence: mit
Compile and run user-submitted code in a docker based sandbox.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Compilebox

Wasmtime
Standalone JIT-style runtime for WebAssembly, using Cranelift
Stars: ✭ 6,413 (+574.34%)
Mutual labels:  sandbox
Ksm
A fast, hackable and simple x64 VT-x hypervisor for Windows and Linux. Builtin userspace sandbox and introspection engine.
Stars: ✭ 673 (-29.23%)
Mutual labels:  sandbox
Emofishes
Emofishes is a collection of proof of concepts that help improve, bypass or detect virtualized execution environments (focusing on the ones setup for malware analysis).
Stars: ✭ 11 (-98.84%)
Mutual labels:  sandbox
Nanos
A kernel designed to run one and only one application in a virtualized environment
Stars: ✭ 557 (-41.43%)
Mutual labels:  sandbox
Hvpp
hvpp is a lightweight Intel x64/VT-x hypervisor written in C++ focused primarily on virtualization of already running operating system
Stars: ✭ 637 (-33.02%)
Mutual labels:  sandbox
See
Sandboxed Execution Environment
Stars: ✭ 770 (-19.03%)
Mutual labels:  sandbox
Gameserver
League Sandbox's Game Server
Stars: ✭ 497 (-47.74%)
Mutual labels:  sandbox
Thrive
The main repository for the development of the evolution game Thrive.
Stars: ✭ 874 (-8.1%)
Mutual labels:  sandbox
Judge Server
Judging backend server for the DMOJ online judge.
Stars: ✭ 648 (-31.86%)
Mutual labels:  sandbox
Deer Executor
An executor for online judge —— 基于Go语言实现的代码评测工具
Stars: ✭ 23 (-97.58%)
Mutual labels:  sandbox
Graphql Editor
📺 Visual Editor & GraphQL IDE. Draw GraphQL schemas using visual 🔷 nodes and explore GraphQL API with beautiful UI. Even 🐒 can do that!
Stars: ✭ 5,485 (+476.76%)
Mutual labels:  sandbox
Seccomp Tools
Provide powerful tools for seccomp analysis
Stars: ✭ 599 (-37.01%)
Mutual labels:  sandbox
Tridentsandbox
An In-Browser Scripting IDE for HTML5/Javascript
Stars: ✭ 5 (-99.47%)
Mutual labels:  sandbox
Ops
ops - build and run nanos unikernels
Stars: ✭ 552 (-41.96%)
Mutual labels:  sandbox
Fiber
Distributed Computing for AI Made Simple
Stars: ✭ 866 (-8.94%)
Mutual labels:  sandbox
Antivmdetection
Script to create templates to use with VirtualBox to make vm detection harder
Stars: ✭ 527 (-44.58%)
Mutual labels:  sandbox
Buildxl
Microsoft Build Accelerator
Stars: ✭ 676 (-28.92%)
Mutual labels:  sandbox
Screeen
Observe user screen shot event in macOS.
Stars: ✭ 29 (-96.95%)
Mutual labels:  sandbox
Wakxy
Wakxy is a Wakfu packet sniffer (MITM). Written in C++/Qt with Javascript scripting support.
Stars: ✭ 12 (-98.74%)
Mutual labels:  sandbox
Stagy
Stagy is a tool for quick deployment of staging environments.
Stars: ✭ 19 (-98%)
Mutual labels:  sandbox

What is it?

CompileBox is a Docker based sandbox to run untrusted code and return the output to your app. Users can submit their code in any of the supported languages. The system will test the code in an isolated environment. This way you do not have to worry about untrusted code possibly damaging your server intentionally or unintentionally. You can use this system to allow your users to compile their code right in the browser.

Check the example work at:

How does it work?

The client-side app submits the code and the languageID to the server through the API. The API then creates a new Docker container and runs the code using the compiler/interpreter of that language. The program runs inside a virtual machine with limited resources and has a time-limit for execution (20s by default). Once the output is ready it is sent back to the client-side app. The Docker container is destroyed and all the files are deleted from the server.

No two coders have access to each other’s Docker or files.

Installation Instructions

  • Go to the 'Setup' directory.

    • Open the Terminal as root user

    • Execute the script Install_*.sh, select the file which best suites your Operating System description. This will install the Docker and NodeJs pre-requisites to your system and create an image called 'virtual_machine' inside the Docker. DockerVM may take around 20 to 30 minutes depending on your internet connection.

    • Once the Install script executes successfully, copy the folder named 'API' to your desired path.

    • Open app.js in the API folder and set the variable values as follows.

      1. timeout_value: The time in seconds till which the API should wait for the output of the code before generating an "Execution Timed Out" message.
      2. port: The port on which the server will listen, the default port is 80.
    • To test the installation, open a new terminal windows, cd to the API folder and type the following command

     $ npm install .
    

    to install all needed nodejs modules, followed by

    $ sudo nodejs app.js
    
    • If everything has been setup correctly in app.js file, you will see the following message on your terminal
    Listening at <port_number>
    

    Supported Operating Systems

    The CompileBox API has been installed and run succesfully on the following platforms

    • Ubuntu 12.04 LTS
    • Ubuntu 13.10
    • Ubuntu 14.04 LTS
    • Ubuntu 16.04 LTS
    • Linux Mint 15
    • CentOS 6 (root required not sudo)

Selecting The languages for Installation Inside Docker

The default Dockerfile installs the most used languages. To remove/change any, follow these steps

In order to select languages of your own choice you need to make 2 changes.
1. Dockerfile: This file contains commands that you would normally give in your terminal to install that language. Add the required commands preceeded by the RUN keyword inside the Dockerfile. Run the "UpdateDocker.sh" script, present in the same folder if you are adding new language to already installed API, execute the Install_*.sh script otherwise, from your terminal after making the changes to your Dockerfile.
2. Compilers.js: This file is inside the API folder. The compiler name, the source file name and the execution commands to Docker Container are taken from this file. This file only contains an array, which is described in detail inside the file. Add the credentials of the language you are adding to this array.

The next time you wish to compile using this language, simply issue the language_id , which is same as the index of the language in the array present in Compilers.js, along with your code to the NodeJs server.

Note: Additionally while setting up the API for the first time, you can comment out those languages from the Dockerfile that you do not wish to install, since they can be added later.

Adding Your Own Languages

In order to add your own languages you need to following steps.

  1. Modify the Dockerfile: The Dockerfile is present in the Setup folder and contains the commands that you would normally write in your terminal to install a particular language. Append the commands for the language of your choice to the end of the Dockerfile.
  2. Execute UpdateDocker.sh and wait for your language to be installed inside the virtual machine.
  3. Modify Compilers.js: Compilers.js file is available in the API folder and contains the information needed by app.js to compile a given source code inside Docker container. The file only consists of an array which is described in detail inside the file. Add the credentials for your language to the Array.

Note: You should be connected to the Internet when you run UpdateDocker.sh

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].