# sanidhyy/unlock-airtel-router architecture

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

- Interactive diagram: https://gitdiagram.com/sanidhyy/unlock-airtel-router
- Repository: https://github.com/sanidhyy/unlock-airtel-router

## Overview

This repository is a set of scripts for enabling SSH on supported Airtel/Zyxel routers and unlocking hidden web-UI controls. The main setup flow backs up and decrypts router configuration, edits SSH access settings, encrypts and restores the configuration, then uses SSH to set the UI debug flag and install a boot-time command. The shared backup tool also supports standalone download, decrypt, encrypt, and restore operations. Relationships below follow the README and shown script calls; internals not shown are represented only at the documented capability level.

Main entry points: [`enable_ssh.py`](https://github.com/sanidhyy/unlock-airtel-router/blob/main/enable_ssh.py) (Enable SSH), [`unlock_ui.py`](https://github.com/sanidhyy/unlock-airtel-router/blob/main/unlock_ui.py) (Unlock UI script), [`download_backup.py`](https://github.com/sanidhyy/unlock-airtel-router/blob/main/download_backup.py) (Download backup CLI), [`restore_backup.py`](https://github.com/sanidhyy/unlock-airtel-router/blob/main/restore_backup.py) (Restore config CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Router setup"]
  node_enable["Enable SSH<br/>[enable_ssh.py]"]
  node_editssh["Edit SSH settings<br/>[enable_ssh.py]"]
  node_sshconfig["SSH shortcut<br/>[enable_ssh.py]"]
end

subgraph group_backup["Backup and restore"]
  node_downloadcli["Download backup CLI<br/>[download_backup.py]"]
  node_restorecli["Restore config CLI<br/>[restore_backup.py]"]
end

subgraph group_unlock["UI unlock"]
  node_unlockscript["Unlock UI script<br/>[unlock_ui.py]"]
  node_flag["Set UI debug flag<br/>[unlock_ui.py]"]
  node_startup["Boot-time unlock<br/>[unlock_ui.py]"]
end

subgraph group_shared["Shared tool"]
  node_creds["Credential prompts"]
  node_session["Router login"]
  node_backupdownload["Backup download"]
  node_decrypt["Config decryption"]
  node_encrypt["Config encryption"]
  node_restore["Config restore"]
end

node_user(("Router owner"))
node_router["Router"]
node_sshclient["SSH client"]

node_user -->|"runs"| node_enable
node_enable -->|"gets credentials"| node_creds
node_enable -->|"logs in"| node_session
node_enable -->|"downloads backup"| node_backupdownload
node_enable -->|"decrypts backup"| node_decrypt
node_enable -->|"edits settings"| node_editssh
node_enable -->|"encrypts edited config"| node_encrypt
node_enable -->|"submits config"| node_restore
node_enable -->|"offers shortcut"| node_sshconfig
node_downloadcli -->|"gets credentials"| node_creds
node_downloadcli -->|"logs in"| node_session
node_downloadcli -->|"downloads backup"| node_backupdownload
node_downloadcli -->|"decrypts backup"| node_decrypt
node_restorecli -->|"gets credentials"| node_creds
node_restorecli -->|"encrypts config"| node_encrypt
node_restorecli -->|"logs in"| node_session
node_restorecli -->|"submits config"| node_restore
node_session -->|"authenticates"| node_router
node_backupdownload -->|"requests backup"| node_router
node_restore -->|"uploads config"| node_router
node_user -->|"runs"| node_unlockscript
node_unlockscript -->|"gets credentials"| node_creds
node_unlockscript -->|"invokes"| node_sshclient
node_sshclient -->|"runs remote script"| node_router
node_unlockscript -->|"sets and verifies"| node_flag
node_unlockscript -->|"installs boot block"| node_startup
node_startup -->|"reapplies after boot"| node_flag

click node_enable "https://github.com/sanidhyy/unlock-airtel-router/blob/main/enable_ssh.py"
click node_editssh "https://github.com/sanidhyy/unlock-airtel-router/blob/main/enable_ssh.py"
click node_sshconfig "https://github.com/sanidhyy/unlock-airtel-router/blob/main/enable_ssh.py"
click node_downloadcli "https://github.com/sanidhyy/unlock-airtel-router/blob/main/download_backup.py"
click node_restorecli "https://github.com/sanidhyy/unlock-airtel-router/blob/main/restore_backup.py"
click node_creds "https://github.com/sanidhyy/unlock-airtel-router/blob/main/zyxel_backup_restore.py"
click node_session "https://github.com/sanidhyy/unlock-airtel-router/blob/main/zyxel_backup_restore.py"
click node_backupdownload "https://github.com/sanidhyy/unlock-airtel-router/blob/main/zyxel_backup_restore.py"
click node_decrypt "https://github.com/sanidhyy/unlock-airtel-router/blob/main/zyxel_backup_restore.py"
click node_encrypt "https://github.com/sanidhyy/unlock-airtel-router/blob/main/zyxel_backup_restore.py"
click node_restore "https://github.com/sanidhyy/unlock-airtel-router/blob/main/zyxel_backup_restore.py"
click node_unlockscript "https://github.com/sanidhyy/unlock-airtel-router/blob/main/unlock_ui.py"
click node_flag "https://github.com/sanidhyy/unlock-airtel-router/blob/main/unlock_ui.py"
click node_startup "https://github.com/sanidhyy/unlock-airtel-router/blob/main/unlock_ui.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_enable,node_editssh,node_sshconfig,node_sshclient toneBlue
class node_downloadcli,node_restorecli toneAmber
class node_unlockscript,node_flag,node_startup,node_user,node_router toneMint
class node_creds,node_session,node_backupdownload,node_decrypt,node_encrypt,node_restore toneRose
```

## Components

### Router setup

- [Enable SSH](https://github.com/sanidhyy/unlock-airtel-router/blob/main/enable_ssh.py): `enable_ssh.py`
- [Edit SSH settings](https://github.com/sanidhyy/unlock-airtel-router/blob/main/enable_ssh.py): `enable_ssh.py`
- [SSH shortcut](https://github.com/sanidhyy/unlock-airtel-router/blob/main/enable_ssh.py): `enable_ssh.py`

### Backup and restore

- [Download backup CLI](https://github.com/sanidhyy/unlock-airtel-router/blob/main/download_backup.py): `download_backup.py`
- [Restore config CLI](https://github.com/sanidhyy/unlock-airtel-router/blob/main/restore_backup.py): `restore_backup.py`

### UI unlock

- [Unlock UI script](https://github.com/sanidhyy/unlock-airtel-router/blob/main/unlock_ui.py): `unlock_ui.py`
- [Set UI debug flag](https://github.com/sanidhyy/unlock-airtel-router/blob/main/unlock_ui.py): `unlock_ui.py`
- [Boot-time unlock](https://github.com/sanidhyy/unlock-airtel-router/blob/main/unlock_ui.py): `unlock_ui.py`

### Shared tool

- [Credential prompts](https://github.com/sanidhyy/unlock-airtel-router/blob/main/zyxel_backup_restore.py): `zyxel_backup_restore.py`
- [Router login](https://github.com/sanidhyy/unlock-airtel-router/blob/main/zyxel_backup_restore.py): `zyxel_backup_restore.py`
- [Backup download](https://github.com/sanidhyy/unlock-airtel-router/blob/main/zyxel_backup_restore.py): `zyxel_backup_restore.py`
- [Config decryption](https://github.com/sanidhyy/unlock-airtel-router/blob/main/zyxel_backup_restore.py): `zyxel_backup_restore.py`
- [Config encryption](https://github.com/sanidhyy/unlock-airtel-router/blob/main/zyxel_backup_restore.py): `zyxel_backup_restore.py`
- [Config restore](https://github.com/sanidhyy/unlock-airtel-router/blob/main/zyxel_backup_restore.py): `zyxel_backup_restore.py`

### Other components

- **Router owner**
- **Router**
- **SSH client**

## Connections

- Router owner → Enable SSH: runs (evidence: `README.md`)
- Enable SSH → Credential prompts: gets credentials (evidence: `enable_ssh.py`)
- Enable SSH → Router login: logs in (evidence: `enable_ssh.py`)
- Enable SSH → Backup download: downloads backup (evidence: `enable_ssh.py`)
- Enable SSH → Config decryption: decrypts backup (evidence: `enable_ssh.py`)
- Enable SSH → Edit SSH settings: edits settings (evidence: `enable_ssh.py`)
- Enable SSH → Config encryption: encrypts edited config (evidence: `enable_ssh.py`)
- Enable SSH → Config restore: submits config (evidence: `enable_ssh.py`)
- Enable SSH → SSH shortcut: offers shortcut (evidence: `enable_ssh.py`)
- Download backup CLI → Credential prompts: gets credentials (evidence: `download_backup.py`)
- Download backup CLI → Router login: logs in (evidence: `download_backup.py`)
- Download backup CLI → Backup download: downloads backup (evidence: `download_backup.py`)
- Download backup CLI → Config decryption: decrypts backup (evidence: `download_backup.py`)
- Restore config CLI → Credential prompts: gets credentials (evidence: `restore_backup.py`)
- Restore config CLI → Config encryption: encrypts config (evidence: `restore_backup.py`)
- Restore config CLI → Router login: logs in (evidence: `restore_backup.py`)
- Restore config CLI → Config restore: submits config (evidence: `restore_backup.py`)
- Router login → Router: authenticates (evidence: `zyxel_backup_restore.py`)
- Backup download → Router: requests backup (evidence: `zyxel_backup_restore.py`)
- Config restore → Router: uploads config (evidence: `zyxel_backup_restore.py`)
- Router owner → Unlock UI script: runs (evidence: `README.md`)
- Unlock UI script → Credential prompts: gets credentials (evidence: `unlock_ui.py`)
- Unlock UI script → SSH client: invokes (evidence: `unlock_ui.py`)
- SSH client → Router: runs remote script (evidence: `README.md`)
- Unlock UI script → Set UI debug flag: sets and verifies (evidence: `README.md`)
- Unlock UI script → Boot-time unlock: installs boot block (evidence: `unlock_ui.py`)
- Boot-time unlock → Set UI debug flag: reapplies after boot (evidence: `unlock_ui.py`)
