How freedomofpress/dangerzone works
Dangerzone sanitizes untrusted documents by converting them in an isolation environment to RGB pixel data, then rebuilding a PDF outside the sandbox. Users initiate conversion through the CLI or GUI; document state and conversion coordination lead to a selected isolation provider. OCR is an optional conversion capability. Startup prepares platform-specific runtimes, while a separate updater checks releases and installs verified container images. The README documents the conversion stages; sampled source confirms the CLI, orchestration, provider, settings, and update responsibilities, but not every internal conversion call.
Main entry points: startup.py Startup tasks · installer.py Image installer · cli.py CLI · logic.py Conversion coordinator
Components 22
User interfaces
Document conversion
- Document model
dangerzone/document.py - Conversion coordinator
dangerzone/logic.py - Provider base
dangerzone/isolation_provider/base.py - Sandbox conversion
dangerzone/isolation_provider/base.py - RGB pixel data
dangerzone/isolation_provider/base.py - Safe PDF output
dangerzone/isolation_provider/base.py - Conversion errors
dangerzone/conversion_errors.py
Isolation and startup
- Container provider
dangerzone/isolation_provider/container.py - Qubes provider
dangerzone/isolation_provider/qubes.py - Dummy provider
dangerzone/isolation_provider/dummy.py - Startup tasks
dangerzone/startup.py - Container utilities
dangerzone/container_utils.py - Podman machine
dangerzone/podman/machine.py
Updates and settings
- Settings
dangerzone/settings.py - Release checks
dangerzone/updater/releases.py - Image signatures
dangerzone/updater/signatures.py - Image installer
dangerzone/updater/installer.py - Log index
dangerzone/updater/log_index.py
Other components
- User
Connections 25
- User → CLI: submits files
dangerzone/cli.py - User → GUI: selects documents
dangerzone/gui/main_window.py - CLI → Startup tasks: runs startup
dangerzone/cli.py - CLI → Document model: creates documents
dangerzone/cli.py - GUI → GUI logic: uses logic
dangerzone/gui/main_window.py - GUI logic → Conversion coordinator: coordinates conversion
dangerzone/gui/logic.py - Conversion coordinator → Provider base: uses provider
dangerzone/logic.py - Conversion coordinator → Document model: handles documents
dangerzone/logic.py - Provider base → Sandbox conversion: converts in sandbox
dangerzone/isolation_provider/base.py - Sandbox conversion → RGB pixel data: produces pixels
dangerzone/isolation_provider/base.py - RGB pixel data → Safe PDF output: rebuilds PDF
dangerzone/isolation_provider/base.py - Provider base → Conversion errors: raises errors
dangerzone/isolation_provider/base.py - Startup tasks → Podman machine: initializes machine
dangerzone/startup.py - Startup tasks → Qubes provider: checks Qubes
dangerzone/startup.py - Container provider → Container utilities: uses runtime
dangerzone/isolation_provider/container.py - Startup tasks → Settings: reads settings
dangerzone/startup.py - Startup tasks → Image installer: installs image
dangerzone/startup.py - Image installer → Container utilities: manages images
dangerzone/updater/installer.py - Image installer → Log index: reads index
dangerzone/updater/installer.py - Image installer → Image signatures: uses signatures
dangerzone/updater/installer.py - Image signatures → Container utilities: loads image
dangerzone/updater/signatures.py - Release checks → Settings: reads preferences
dangerzone/updater/releases.py - Image installer → Settings: reads preferences
dangerzone/updater/installer.py - CLI → Conversion coordinator: starts conversion
dangerzone/cli.py - Dummy provider → Provider base: implements provider
dangerzone/isolation_provider/dummy.py