Commit Graph

3 Commits

Author SHA1 Message Date
a2nr c103b55dc4 feat(compiler-worker): sesi interaktif PTY untuk playground — Python input() dan C scanf() tanpa EOFError
- session_manager.py: InteractiveSession + SessionManager (PTY Python/C, bounded
  output buffer, delta cursor, sweeper, semaphore compile max 2, limit 50 sesi)
- app.py: hybrid — endpoint batch /execute lama dipertahankan + endpoint sesi baru
  (POST /sessions, GET delta output, POST input, DELETE stop) + health
- Dockerfile: gunicorn gthread 1 worker/32 thread (registry in-memory aman)
- routes/compile.py: proxy Flask /compile/sessions + anon slot lifecycle + rate limit
- podman-compose.yml: env COMPILER_WORKER_BASE_URL
- tests: test_session_manager.py (baru) + test_app.py + services/tests/test_compile_sessions.py
2026-08-02 14:14:45 +00:00
a2nr dbed014474 feat(playground): multi-tab playground + FileTree + Console + stdin wiring to compile worker
- playground route: velxio/flowchart/circuit/code tabs with auto-save
- FileTree + ConsolePanel for C/Python code tab
- compileCode() forwards stdin through routes/compile.py to compiler_worker
- compiler_worker run_c_code/run_python_code accept stdin, pass via subprocess.run(input=)
- known issue: Console UI does not queue stdin properly → fix in next cycle
2026-08-01 22:32:54 +00:00
a2nr a41711fb54 security: implement gVisor sandboxing and harden API endpoints
- Menambahkan service 'compiler-worker' terpisah untuk isolasi eksekusi kode C/Python.
   - Mengintegrasikan gVisor (runsc) pada worker untuk mencegah RCE pada level kernel.
   - Menggunakan Gunicorn (4 workers) pada compiler-worker untuk mendukung concurrency.
   - Menambahkan otentikasi token wajib pada endpoint /compile dan laporan progres.
   - Memperketat CORS policy menggunakan environment variable ORIGIN.
   - Menerapkan secure_filename pada rute pelajaran untuk mencegah Path Traversal.
   - Mengubah volume mounting backend utama menjadi Read-Only (:ro) untuk perlindungan data.
   - Memperbarui proposal.md dan .env.example dengan standar keamanan terbaru.
2026-04-21 15:13:16 +07:00