# dotvrtx/tempmac architecture

> Architecture diagram of the GitHub repository dotvrtx/tempmac, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dotvrtx/tempmac
- Repository: https://github.com/dotvrtx/tempmac

## Overview

This is a single-file Tor privacy toolkit. Its principal workflow accepts bridge and killswitch options, backs up and updates Tor configuration, restarts Tor, verifies the Tor connection, and monitors for leaks that can trigger a network shutdown. It also includes MAC-address backup, change, and restoration capabilities. The excerpts show some internal calls; README statements support the broader documented workflows. Other implementation details are unsampled, so uncertain connections are omitted.

Main entry points: [`index.py`](https://github.com/dotvrtx/tempmac/blob/main/index.py) (Bridge injection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command entry"]
  node_cli["CLI options<br/>[index.py]"]
end

subgraph group_tor["Tor bridges"]
  node_bridge_file["Bridge file"]
  node_bridge_injection["Bridge injection<br/>[index.py]"]
  node_bridge_validation["Bridge validation<br/>[index.py]"]
  node_tor_backup["Tor config backup<br/>[index.py]"]
  node_tor_config["Tor configuration"]
  node_tor_restart["Tor restart<br/>[index.py]"]
  node_tor_verification["Tor verification<br/>[index.py]"]
end

subgraph group_protection["Leak protection"]
  node_leak_monitor["Leak monitoring<br/>[index.py]"]
  node_shutdown_decision["Shutdown decision<br/>[index.py]"]
  node_network_shutdown["Emergency shutdown<br/>[index.py]"]
  node_logging["Logging<br/>[index.py]"]
end

subgraph group_network["Network identity"]
  node_mac_manager["MAC management<br/>[index.py]"]
  node_interface_discovery["Interface discovery<br/>[index.py]"]
end

node_user(("Operator"))
node_tor_service["Tor service"]
node_tor_check["Tor check API"]
node_network_interface["Network interface"]

node_user -->|"runs"| node_cli
node_cli -->|"starts"| node_bridge_injection
node_bridge_file -->|"supplies bridges"| node_bridge_injection
node_bridge_injection -->|"validates lines"| node_bridge_validation
node_bridge_injection -->|"backs up"| node_tor_backup
node_tor_backup -->|"saves copy"| node_tor_config
node_bridge_injection -->|"adds settings"| node_tor_config
node_bridge_injection -->|"restarts"| node_tor_restart
node_tor_restart -->|"controls"| node_tor_service
node_bridge_injection -->|"verifies"| node_tor_verification
node_tor_verification -->|"checks through"| node_tor_check
node_cli -->|"starts"| node_leak_monitor
node_leak_monitor -->|"checks status"| node_tor_verification
node_leak_monitor -->|"assesses leaks"| node_shutdown_decision
node_leak_monitor -->|"triggers"| node_network_shutdown
node_shutdown_decision -->|"authorizes"| node_network_shutdown
node_cli -->|"selects MAC actions"| node_mac_manager
node_mac_manager -->|"changes address"| node_network_interface
node_interface_discovery -->|"enumerates"| node_network_interface

click node_cli "https://github.com/dotvrtx/tempmac/blob/main/index.py"
click node_bridge_injection "https://github.com/dotvrtx/tempmac/blob/main/index.py"
click node_bridge_validation "https://github.com/dotvrtx/tempmac/blob/main/index.py"
click node_tor_backup "https://github.com/dotvrtx/tempmac/blob/main/index.py"
click node_tor_restart "https://github.com/dotvrtx/tempmac/blob/main/index.py"
click node_tor_verification "https://github.com/dotvrtx/tempmac/blob/main/index.py"
click node_leak_monitor "https://github.com/dotvrtx/tempmac/blob/main/index.py"
click node_shutdown_decision "https://github.com/dotvrtx/tempmac/blob/main/index.py"
click node_network_shutdown "https://github.com/dotvrtx/tempmac/blob/main/index.py"
click node_logging "https://github.com/dotvrtx/tempmac/blob/main/index.py"
click node_mac_manager "https://github.com/dotvrtx/tempmac/blob/main/index.py"
click node_interface_discovery "https://github.com/dotvrtx/tempmac/blob/main/index.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli toneBlue
class node_bridge_file,node_bridge_injection,node_bridge_validation,node_tor_backup,node_tor_config,node_tor_restart,node_tor_verification toneAmber
class node_leak_monitor,node_shutdown_decision,node_network_shutdown,node_logging,node_tor_check toneMint
class node_mac_manager,node_interface_discovery toneRose
class node_user,node_tor_service,node_network_interface toneIndigo
```

## Components

### Command entry

- [CLI options](https://github.com/dotvrtx/tempmac/blob/main/index.py): `index.py`

### Tor bridges

- **Bridge file**
- [Bridge injection](https://github.com/dotvrtx/tempmac/blob/main/index.py): `index.py`
- [Bridge validation](https://github.com/dotvrtx/tempmac/blob/main/index.py): `index.py`
- [Tor config backup](https://github.com/dotvrtx/tempmac/blob/main/index.py): `index.py`
- **Tor configuration**
- [Tor restart](https://github.com/dotvrtx/tempmac/blob/main/index.py): `index.py`
- [Tor verification](https://github.com/dotvrtx/tempmac/blob/main/index.py): `index.py`

### Leak protection

- [Leak monitoring](https://github.com/dotvrtx/tempmac/blob/main/index.py): `index.py`
- [Shutdown decision](https://github.com/dotvrtx/tempmac/blob/main/index.py): `index.py`
- [Emergency shutdown](https://github.com/dotvrtx/tempmac/blob/main/index.py): `index.py`
- [Logging](https://github.com/dotvrtx/tempmac/blob/main/index.py): `index.py`

### Network identity

- [MAC management](https://github.com/dotvrtx/tempmac/blob/main/index.py): `index.py`
- [Interface discovery](https://github.com/dotvrtx/tempmac/blob/main/index.py): `index.py`

### Other components

- **Operator**
- **Tor service**
- **Tor check API**
- **Network interface**

## Connections

- Operator → CLI options: runs (evidence: `README.md`)
- CLI options → Bridge injection: starts (evidence: `README.md`)
- Bridge file → Bridge injection: supplies bridges (evidence: `README.md`)
- Bridge injection → Bridge validation: validates lines (evidence: `index.py`)
- Bridge injection → Tor config backup: backs up (evidence: `README.md`)
- Tor config backup → Tor configuration: saves copy (evidence: `README.md`)
- Bridge injection → Tor configuration: adds settings (evidence: `README.md`)
- Bridge injection → Tor restart: restarts (evidence: `README.md`)
- Tor restart → Tor service: controls (evidence: `README.md`)
- Bridge injection → Tor verification: verifies (evidence: `README.md`)
- Tor verification → Tor check API: checks through (evidence: `index.py`)
- CLI options → Leak monitoring: starts (evidence: `README.md`)
- Leak monitoring → Tor verification: checks status (evidence: `index.py`)
- Leak monitoring → Shutdown decision: assesses leaks (evidence: `index.py`)
- Leak monitoring → Emergency shutdown: triggers (evidence: `index.py`)
- Shutdown decision → Emergency shutdown: authorizes (evidence: `index.py`)
- CLI options → MAC management: selects MAC actions (evidence: `index.py`)
- MAC management → Network interface: changes address (evidence: `index.py`)
- Interface discovery → Network interface: enumerates (evidence: `index.py`)
