Skip to content
Nat Lee

Keyboard shortcuts

Turn these off if they get in the way of a screen reader or voice control. The setting is saved in this browser.

1
Home
2
Work
3
Projects
4
About
5
Experience
/
Search projects
?
Show this panel

DevOps

Dev Dock Manager (Rust)

Development Environment Manager (Rust)

One Docker dev box per user, with a web terminal, a noVNC desktop and optional GPU. The Django version, rewritten in Rust, partly to find out whether I could.

Role
Creator & Maintainer
Period
2023.11 – Present
Status
Active
Categories
Infrastructure & backend
Stack
  • Rust
  • React
  • Next.js
  • Docker
  • Traefik
  • Redis
  • JWT
  • WebSocket
  • SQLite
  • Argon2
  • Bollard
  • Container Orchestration
  • User Management
  • Environment Isolation
Dev Dock Manager (Rust), screenshot 1

Overview

A high-performance development environment management system built with Rust and Docker. This platform provides isolated, containerized development environments for multiple users on the same machine, featuring a Rust-based backend API with JWT authentication, WebSocket support for real-time console access, and a React/Next.js frontend. All services run behind Traefik reverse proxy with optional Nvidia Docker support.

What it's good for

The pick for new setups: the same dashboard, routes and permissions as the Django version, so users can't tell which one they got, while the backend image shrinks from 687 MB to 144 MB and there's one binary to babysit instead of Daphne plus an RQ worker.

Diagrams

Main paths only. The edge cases stayed in the code.

The Django version idled at 175 MiB. This one idles at 5.5. I measured twice.

Point at a box to see what it connects to.

  1. Log in, keep a JWT pair(access token lasts an hour) → Fill in the create dialog
  2. Fill in the create dialog(name, SSH port, passwords) → Name valid and port free?
  3. Name valid and port free?(privileged: admins only) → no, fix it: Fill in the create dialog → yes: Push a job onto Redis
  4. Push a job onto Redis → answer now: Return a task_id at once → in background: Worker pops the job
  5. Return a task_id at once → wait for news: The list refreshes
  6. Worker pops the job(a task inside the API process) → Create and start gui-vnc
  7. Create and start gui-vnc(owner label, Traefik route) → Did Docker say yes?
  8. Did Docker say yes? → yes: CREATED reaches owner and admins → no: Error goes to the log
  9. Error goes to the log(no notification is sent)
  10. CREATED reaches owner and admins(over the notifications WebSocket) → The list refreshes
  11. The list refreshes → How do you get in?
  12. How do you get in? → web terminal: Shell over a WebSocket → desktop: NoVNC through Traefik → SSH: ssh -p your port
  13. Shell over a WebSocket(docker exec bash, or attach) → Your own Linux desktop
  14. NoVNC through Traefik(asks for the VNC password) → Your own Linux desktop
  15. ssh -p your port(skips Traefik entirely) → Your own Linux desktop
  16. Your own Linux desktop(others' desktops answer 404)

Features

  • High-performance Rust backend API
  • JWT-based authentication system
  • WebSocket console access
  • Multi-user environment isolation
  • Traefik reverse proxy integration
  • React/Next.js dashboard
  • Optional Nvidia Docker support
  • Redis task queue
  • Automated environment provisioning

The problem

  • Building high-performance Rust API
  • WebSocket implementation for console access
  • Docker API integration with Bollard
  • JWT authentication and authorization
  • Traefik configuration for multi-instance NoVNC

What I did

  • Implemented Rust backend with async/await
  • Built WebSocket handlers for real-time console
  • Used Bollard for Docker API integration
  • Created JWT-based auth system with SQLite + Argon2
  • Configured Traefik for service routing

Results

  • Improved performance over Python version
  • Lower memory footprint with Rust
  • Enhanced security with type-safe code
  • Better concurrency handling
  • Simplified deployment with Docker Compose
Signing in, then straight to your containers and the gui-vnc image.
Signing in, then straight to your containers and the gui-vnc image.

What I learned

  • The rewrite answers most calls 4 to 6 times faster, but the two list calls mostly wait for Docker, so there the gap is only 1.2 to 1.6 times.
  • Log-in time is mostly password hashing (Argon2 here, PBKDF2 in Django), so not all of that speed-up belongs to the language.
  • /health lives on the API inside the Docker network. Traefik doesn't route it, so localhost:8000/health from the host gets the frontend's 404.
  • Creating a desktop as an admin, privileged mode ticked; it shows up in the list live.
    Creating a desktop as an admin, privileged mode ticked; it shows up in the list live.
  • Console opens a root shell in the desktop over a WebSocket; exit closes it.
    Console opens a root shell in the desktop over a WebSocket; exit closes it.
  • The NoVNC desktop: VNC password, then VS Code, Firefox and htop in the browser.
    The NoVNC desktop: VNC password, then VS Code, Firefox and htop in the browser.
  • Same routes as the Django version, but the API is one Rust binary, queue worker included.
    Same routes as the Django version, but the API is one Rust binary, queue worker included.
  • What each click does, from login to desktop. Access tokens last one hour here.
    What each click does, from login to desktop. Access tokens last one hour here.
  • Infrastructure & backend1313 stars on GitHub

    Telepy

    One outbound reverse SSH tunnel per device gives you a browser terminal, files, remote desktop, a remote browser and the LAN behind it. No port forwarding, no VPN, no public IP.

    2024Active
  • Spin-off · Contract work
    Infrastructure & backend11 stars on GitHub

    Blockchain from Scratch

    Nine hands-on chapters, from hashing to a peer-to-peer network. The same Rust code powers interactive WebAssembly demonstrations in your browser.

    2018Completed
  • Infrastructure & backend1010 stars on GitHub

    Dev Dock Manager

    The original Django dev-box manager: isolated Docker environments for several users on one machine. The Rust version replaced it, but this one carried the load first.

    2022Completed