On the backend, it used NGinX as web server, GUnicorn as a WSGI server, Flask a web framework, Redis for caching and Docker as a sandbox. It was MPA (Multiple-Page Application) based on Javascript and JQuery in the frontend. The first version of this project was launched in 2015. First the cache ( Redis) is checked and only if it is not there is the project executed in codebox. The execution of the projects is not immediate. There is a FastAPI application served through a reverse proxy by Caddy and through an ASGI server by Hypercorn. The backend is hosted in a DigitalOcean droplet. The frontend is built with Vue.js and SPA (Single Page Application) architecture. ArchitectureĬodebox is the most important part but does not work alone. The commands output ( stdout) and errors ( stderr) are grouped and returned through codebox stdout. The project files, input data and commands are sent via stdin. Even if there is a violation, its effects will be contained and then eliminated when the container is destroyed.Ĭommunication is done via codebox standard input ( stdin) and output ( stdout). In Code Lab, the sandbox is based on a Docker container called codebox, which contains all the languages, libraries and tools offered by Code Lab, but which runs with limitations on user permissions, time, memory and network access restriction. The way to mitigate this risk is to run the code in a sandbox, which is a type of virtualization in a restricted and controlled environment 1. Running code from unknown sources poses security risks because malicious code may attempt to take control of the system, access restricted areas and data, or misuse available resources (memory, processes, disk, etc.). This project was originally done as a proof of concept and also to help my students to use different programming languages without installing anything on their machines. It is interesting for cases where you want to do a quick experiment but there is no computer with the programming language installed and configured nearby. The Code Lab project allows programming directly in the browser, without any other external dependencies.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |