Skip to content
ursus161Public

About

Learn Linux by using it: a real shell in your browser, one sandbox per learner, steps checked automatically. Custom Go container runtime + gRPC.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

Shellcamp

Interactive Linux labs in the browser. Pick a lab, get a real shell in an isolated sandbox, follow the steps, and have each one verified automatically.

Motivation

Learning Linux and operating systems needs a real terminal, not screenshots. Shellcamp gives every user a disposable Linux environment started in under a second, with guided labs (processes, signals, pipes, namespaces, cgroups, permissions, networking and whatever else we can think of in development). The platform checks the system state after each step, so the user knows whether the step was done correctly.

The sandbox is not Docker: it is a custom container runtime written in Go (Linux namespaces, overlayfs, cgroups v2, seccomp, PTY over WebSocket). A Docker driver exists as a fallback behind the same interface.

Features

  • Register, login and logout with JWT; roles: guest, member, admin
  • Lab catalog with categories, search, filters, sorting and pagination
  • Real Linux terminal in the browser, one isolated sandbox per user
  • Guided lab steps with automatic verification
  • Progress tracking per user
  • Reviews and ratings for labs
  • User profiles, public or private
  • Follow and join requests (approve / reject)
  • Classrooms and assignments (teacher and students)
  • Admin panel: manage users and labs, audit log
  • Landing page

Architecture

Browser ──REST/WebSocket──> api (Gin, unprivileged) ──gRPC (unix socket)──> shellcampd (root, sandbox runtime)
                                   │
                              PostgreSQL
  • api: REST, auth, RBAC, WebSocket proxy, session policy (idle timeout, deadlines, reconciliation)
  • shellcampd: creates and destroys sandboxes, attaches terminals, runs step checks
  • shellcamp-init: PID 1 inside each sandbox, opens the PTY and hands it to the daemon
  • PostgreSQL: users, labs, sessions, progress; desired state and history

Stack

Go, Gin, GORM, PostgreSQL, golang-migrate, golang-jwt, gRPC, creack/pty, xterm.js.

Requirements

Linux kernel >= 5.14 with cgroup v2 for the native runtime. Other platforms can use the Docker driver.

Development

make tools   # buf, protoc-gen-go, protoc-gen-go-grpc
make         # lint + generate Go code from proto/
make test    # vet + tests (Docker tests need a running Docker and the alpine image)

Layout

  • proto/: the api <-> shellcampd contract and its generated Go code
  • internal/sandbox/: the Driver interface every runtime implements
  • internal/sandbox/docker/: the Docker driver, the fallback runtime

About

Learn Linux by using it: a real shell in your browser, one sandbox per learner, steps checked automatically. Custom Go container runtime + gRPC.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages