{
 "name": "architecture",
 "title": "Architecture",
 "path": "/en/doc/architecture/",
 "toc": [
  {
   "level": 1,
   "text": "Architecture",
   "anchor": "architecture"
  },
  {
   "level": 2,
   "text": "Architecture: CLI · Starter · Box · Page",
   "anchor": "architecture-cli-starter-box-page"
  },
  {
   "level": 2,
   "text": "The box in detail",
   "anchor": "the-box-in-detail"
  },
  {
   "level": 2,
   "text": "The containers",
   "anchor": "the-containers"
  },
  {
   "level": 2,
   "text": "Rootless and rolled",
   "anchor": "rootless-and-rolled"
  },
  {
   "level": 2,
   "text": "No bridge to the computer",
   "anchor": "no-bridge-to-the-computer"
  },
  {
   "level": 2,
   "text": "Where things live",
   "anchor": "where-things-live"
  },
  {
   "level": 2,
   "text": "Versions",
   "anchor": "versions"
  }
 ],
 "updated": "2026-10-06",
 "content": "# Architecture\n\n## Architecture: CLI · Starter · Box · Page\n\n```\n you (your user)                        │  box user “onionpod” (no login)              │  network\n────────────────────────────────────────┼──────────────────────────────────────────────┼──────────\n 🪟 Starter  (double-click)             │                                              │\n ⌨️ CLI      (onionpod …)               │  🧅 Box (box program, /opt/onionpod)         │\n        │                               │     start · stop · status · test …           │\n        └── sudo, ONLY these calls ─────┼──►  └─ pod: workspace · tor · fw · probe ────┼──► Tor only\n            (no password prompt)        │        Tor Browser · Session · ~/Transit     │\n        setup.sh / update / config ─────┼──► root (sudo once): user, /opt, /etc        │\n 🌐 Page  (website + docs, separate, knows nothing about your computer)                │\n```\n\n- **Starter** and **CLI** run as **you** — they may operate the box only through a narrow sudo rule\n  (exactly the box program's actions, as user `onionpod`).\n- The **Box** runs as its **own user** without login, rootless, with rolled user IDs — it sees neither your\n  home nor your network. The only way out: Tor.\n- root is only needed for setup, updates and security-relevant settings (`/etc/onionpod`).\n\n## The box in detail\n\n```\n your computer (Ubuntu)\n ┌───────────────────────────────────────────────────────────────────────────────┐\n │  TigerVNC viewer ◄── pixels · 127.0.0.1 · one-time password ───┐   🧅 top bar │\n │                                                                │              │\n │  ┌──────────── Pod \"onionpod\" · rootless · user IDs rolled ─────────────────┐ │\n │  │  workspace ──TCP/DNS──► fw (nftables) ──► tor ──Tor──► Internet          │ │\n │  │  Tor Browser             only Tor may exit     SOCKS · TransPort ·       │ │\n │  │  openbox · menu          rest → Tor or DROP    DNSPort · .onion          │ │\n │  │  probe: leak-test container — deliberately tries to get past Tor         │ │\n │  └──────────────────────────────────────────────────────────────────────────┘ │\n │  ✕ unreachable from the box: router · home network · host · IPv6 · UDP        │\n └───────────────────────────────────────────────────────────────────────────────┘\n```\n\n## The containers\n\n| Container | Job |\n|---|---|\n| **fw** | sets up the firewall (nftables) in the pod's shared network: only the Tor process may reach the network; everything else is redirected to Tor or dropped — and counted |\n| **tor** | Tor with SOCKS, TransPort (transparent redirection), DNSPort and `.onion` automap; the ControlPort is blocked for apps |\n| **workspace** | Tor Browser (without its own Tor), openbox, bar, start menu, Xvnc |\n| **probe** | short-lived, during the leak test: deliberately tries to get past Tor |\n\n## Rootless and rolled\n\nEverything runs under the dedicated user `onionpod` (no login, home with 700). Every start picks a different one of\n16 user ID ranges — the box's processes never run under your ID or a fixed one.\n\n## No bridge to the computer\n\n- no X11 socket, no home folder, no Docker/Podman socket in the box\n- the screen comes via **TigerVNC**: Xvnc in the box, only on `127.0.0.1:5909`, one viewer, the password burns\n  after a single use\n- the firewall accepts only this one port from outside\n\n## Where things live\n\n| Location | Content | Owner |\n|---|---|---|\n| your source | `setup.sh` and components (for updates) | you |\n| `/opt/onionpod` | programs, launcher, top bar icon, texts | root |\n| `/var/lib/onionpod` | images, Tor state, browser profile (bookmarks) | `onionpod` |\n| `/etc/onionpod/config` | version, user, language | root |\n| `/etc/onionpod/lock` | lock password (hash) | root |\n| `/etc/sudoers.d/onionpod` | you may only run `start/stop/status/build/test` as `onionpod` | root |\n| `~/.config/onionpod/starter` | desktop icon yes/no | you |\n| `~/.local/state/onionpod/` | setup.sh logs | you |\n\nWhy root for programs and rules? Because otherwise any program running under your user could silently change a\nfirewall entry — a leak past Tor.\n\n## Versions\n\nOne version for everything (`VERSION`): setup.sh, launcher and box image (label). The launcher refuses to run if the\nimage and the programs do not match, and points to `onionpod update`.\n",
 "siblings": [
  {
   "name": "index",
   "title": "Overview",
   "path": "/en/doc/"
  },
  {
   "name": "install",
   "title": "Install",
   "path": "/en/doc/install/"
  },
  {
   "name": "usage",
   "title": "Usage — Starter & Box",
   "path": "/en/doc/usage/"
  },
  {
   "name": "cli",
   "title": "Terminal command — CLI",
   "path": "/en/doc/cli/"
  },
  {
   "name": "transit",
   "title": "Vault “Transit” & downloads",
   "path": "/en/doc/transit/"
  },
  {
   "name": "session",
   "title": "Session Messenger",
   "path": "/en/doc/session/"
  },
  {
   "name": "lock",
   "title": "Lock password",
   "path": "/en/doc/lock/"
  },
  {
   "name": "leak-test",
   "title": "Leak test",
   "path": "/en/doc/leak-test/"
  },
  {
   "name": "setup",
   "title": "setup.sh reference",
   "path": "/en/doc/setup/"
  },
  {
   "name": "troubleshooting",
   "title": "Troubleshooting",
   "path": "/en/doc/troubleshooting/"
  },
  {
   "name": "limits",
   "title": "Limits & security",
   "path": "/en/doc/limits/"
  }
 ]
}