# a-zuro/secret-sing-box architecture

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

- Interactive diagram: https://gitdiagram.com/a-zuro/secret-sing-box
- Repository: https://github.com/a-zuro/secret-sing-box

## Overview

Secret Sing-Box automates deployment and management of a Sing-Box proxy server fronted by NGINX or HAProxy. The primary workflow starts with a root administrator running the installer, which sets up the server and produces client configuration links; users then import configurations into Sing-Box-compatible clients. Separate documented capabilities include server management, client-template synchronization, Cloudflare IP selection, routing rules, and subscription delivery. The README describes these capabilities, but no source excerpts were provided, so internal calls and undocumented integrations are not asserted.

Main entry points: [`Scripts/install-server.sh`](https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/install-server.sh) (Server installer), [`Scripts/sb-manager.sh`](https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/sb-manager.sh) (Server settings menu), [`Config-Templates/config.json`](https://github.com/a-zuro/secret-sing-box/blob/main/Config-Templates/config.json) (Server config template), [`Config-Templates/client.json`](https://github.com/a-zuro/secret-sing-box/blob/main/Config-Templates/client.json) (Client config template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deployment["Server deployment"]
  node_installer["Server installer<br/>[install-server.sh]"]
  node_singbox["Sing-Box server"]
  node_frontend["NGINX / HAProxy"]
  node_tls["TLS certificates"]
  node_security["Host security"]
  node_warp["WARP setup"]
  node_authlua["HAProxy Lua auth<br/>[auth.lua]"]
end

subgraph group_management["Configuration management"]
  node_manager["Server settings menu<br/>[sb-manager.sh]"]
  node_serverupdate["Server updates<br/>[update-server.sh]"]
  node_rulesupdate["Ruleset updates<br/>[ruleset-update.sh]"]
  node_configtemplate["Server config template<br/>[config.json]"]
end

subgraph group_client["Client access"]
  node_clienttemplate["Client config template<br/>[client.json]"]
  node_cloudflare["Cloudflare IP selection<br/>[cf-scan-ip-ru.md]"]
  node_clientguides["Client setup guidance<br/>[GUI-clients-ru.md]"]
  node_nogui["No-GUI client guidance"]
  node_pcclient["Linux client setup<br/>[sb-pc-linux.sh]"]
  node_singboxclient["Sing-Box client"]
end

subgraph group_delivery["Subscription delivery"]
  node_subscription["Subscription page<br/>[sub.html]"]
end

node_admin(("Root administrator"))

node_admin -->|"runs"| node_installer
node_installer -->|"sets up"| node_singbox
node_installer -->|"configures"| node_frontend
node_installer -->|"obtains"| node_tls
node_installer -->|"optionally configures"| node_security
node_installer -->|"configures"| node_warp
node_manager -->|"syncs settings"| node_clienttemplate
node_manager -->|"syncs settings"| node_configtemplate
node_manager -->|"updates configs"| node_singboxclient
node_admin -->|"opens menu"| node_manager
node_singboxclient -->|"gets subscriptions"| node_subscription

click node_installer "https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/install-server.sh"
click node_authlua "https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/auth.lua"
click node_manager "https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/sb-manager.sh"
click node_serverupdate "https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/update-server.sh"
click node_rulesupdate "https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/ruleset-update.sh"
click node_configtemplate "https://github.com/a-zuro/secret-sing-box/blob/main/Config-Templates/config.json"
click node_clienttemplate "https://github.com/a-zuro/secret-sing-box/blob/main/Config-Templates/client.json"
click node_cloudflare "https://github.com/a-zuro/secret-sing-box/blob/main/.github/cf-scan-ip-ru.md"
click node_clientguides "https://github.com/a-zuro/secret-sing-box/blob/main/.github/GUI-clients-ru.md"
click node_nogui "https://github.com/a-zuro/secret-sing-box/blob/main/.github/NoGUI-clients-ru.md"
click node_pcclient "https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/sb-pc-linux.sh"
click node_subscription "https://github.com/a-zuro/secret-sing-box/blob/main/Subscription-Page/sub.html"

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_installer,node_singbox,node_frontend,node_tls,node_security,node_warp,node_authlua toneBlue
class node_manager,node_serverupdate,node_rulesupdate,node_configtemplate toneAmber
class node_clienttemplate,node_cloudflare,node_clientguides,node_nogui,node_pcclient,node_singboxclient toneMint
class node_subscription toneRose
class node_admin toneIndigo
```

## Components

### Server deployment

- [Server installer](https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/install-server.sh): `Scripts/install-server.sh`
- **Sing-Box server**
- **NGINX / HAProxy**
- **TLS certificates**
- **Host security**
- **WARP setup**
- [HAProxy Lua auth](https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/auth.lua): `Scripts/auth.lua`

### Configuration management

- [Server settings menu](https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/sb-manager.sh): `Scripts/sb-manager.sh`
- [Server updates](https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/update-server.sh): `Scripts/update-server.sh`
- [Ruleset updates](https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/ruleset-update.sh): `Scripts/ruleset-update.sh`
- [Server config template](https://github.com/a-zuro/secret-sing-box/blob/main/Config-Templates/config.json): `Config-Templates/config.json`

### Client access

- [Client config template](https://github.com/a-zuro/secret-sing-box/blob/main/Config-Templates/client.json): `Config-Templates/client.json`
- [Cloudflare IP selection](https://github.com/a-zuro/secret-sing-box/blob/main/.github/cf-scan-ip-ru.md): `.github/cf-scan-ip-ru.md`
- [Client setup guidance](https://github.com/a-zuro/secret-sing-box/blob/main/.github/GUI-clients-ru.md): `.github/GUI-clients-ru.md`
- [No-GUI client guidance](https://github.com/a-zuro/secret-sing-box/blob/main/.github/NoGUI-clients-ru.md): `.github/NoGUI-clients-ru.md`
- [Linux client setup](https://github.com/a-zuro/secret-sing-box/blob/main/Scripts/sb-pc-linux.sh): `Scripts/sb-pc-linux.sh`
- **Sing-Box client**

### Subscription delivery

- [Subscription page](https://github.com/a-zuro/secret-sing-box/blob/main/Subscription-Page/sub.html): `Subscription-Page/sub.html`

### Other components

- **Root administrator**

## Connections

- Root administrator → Server installer: runs
- Server installer → Sing-Box server: sets up
- Server installer → NGINX / HAProxy: configures
- Server installer → TLS certificates: obtains
- Server installer → Host security: optionally configures
- Server installer → WARP setup: configures
- Server settings menu → Client config template: syncs settings
- Server settings menu → Server config template: syncs settings
- Server settings menu → Sing-Box client: updates configs
- Root administrator → Server settings menu: opens menu
- Sing-Box client → Subscription page: gets subscriptions
