# cm5722254-beep/cambodiadnsserver architecture

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

- Interactive diagram: https://gitdiagram.com/cm5722254-beep/cambodiadnsserver
- Repository: https://github.com/cm5722254-beep/cambodiadnsserver

## Overview

CHM Cambodia DNS is a configuration-centered service suite for Cambodia-optimized DNS, encrypted DNS, and VPN/tunneling protocols, accompanied by client branding assets. The principal user workflow is selecting a DNS or tunnel configuration and using it with a compatible client; the README documents the capabilities, while the supplied source excerpts do not show runtime dispatch or service wiring. The graph therefore shows documented client-to-capability relationships, not an inferred execution pipeline. APK tooling is omitted because it is build machinery, and the theme assets are retained as a distinct product capability.

Main entry points: [`configs/dns_resolvers.json`](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/dns_resolvers.json) (Cambodia resolvers), [`configs/doh_endpoints.json`](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/doh_endpoints.json) (DoH endpoints), [`configs/dot_config.json`](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/dot_config.json) (DoT configuration), [`server/udp_custom.json`](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/udp_custom.json) (UDP Custom)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dns["DNS configuration"]
  node_resolvers["Cambodia resolvers<br/>[dns_resolvers.json]"]
  node_operators["ISP profiles"]
  node_doh["DoH endpoints<br/>[doh_endpoints.json]"]
  node_dot["DoT configuration<br/>[dot_config.json]"]
  node_dnscrypt["DNSCrypt proxy"]
  node_regions["Server regions"]
end

subgraph group_tunnel["Tunneling configuration"]
  node_udp_custom["UDP Custom<br/>[udp_custom.json]"]
  node_udpgw["BadVPN UDPGW"]
  node_slowdns["SlowDNS<br/>[slowdns.json]"]
  node_v2ray["V2Ray templates"]
  node_vless["VLESS template"]
  node_trojan["Trojan config<br/>[trojan_config.json]"]
  node_ssh["SSH configuration"]
  node_payloads["Carrier payloads"]
end

subgraph group_server["Server configuration"]
  node_stunnel["Stunnel service<br/>[stunnel.conf]"]
  node_squid["Squid proxy<br/>[squid.conf]"]
  node_nginx["Nginx service<br/>[nginx_chm.conf]"]
end

subgraph group_client["Client assets"]
  node_branding["VIP branding"]
end

node_client(("Compatible client"))

node_client -->|"uses DNS"| node_resolvers
node_client -->|"uses DoH"| node_doh
node_client -->|"uses DoT"| node_dot
node_client -->|"uses tunnel"| node_udp_custom
node_client -->|"uses tunnel"| node_udpgw
node_client -->|"uses tunnel"| node_slowdns
node_client -->|"uses tunnel"| node_v2ray
node_client -->|"uses tunnel"| node_vless
node_client -->|"uses tunnel"| node_trojan
node_client -->|"uses tunnel"| node_ssh
node_client -->|"displays assets"| node_branding

click node_resolvers "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/dns_resolvers.json"
click node_operators "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/cambodia_operators.json"
click node_doh "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/doh_endpoints.json"
click node_dot "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/dot_config.json"
click node_dnscrypt "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/dnscrypt_proxy.toml"
click node_regions "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/server_regions.json"
click node_udp_custom "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/udp_custom.json"
click node_udpgw "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/badvpn-udpgw.service"
click node_slowdns "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/slowdns.json"
click node_v2ray "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/v2ray/vmess_template.json"
click node_vless "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/v2ray/vless_template.json"
click node_trojan "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/v2ray/trojan_config.json"
click node_ssh "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/sshd_config_snippet.conf"
click node_payloads "https://github.com/cm5722254-beep/cambodiadnsserver/tree/main/payloads"
click node_stunnel "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/stunnel.conf"
click node_squid "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/squid.conf"
click node_nginx "https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/nginx_chm.conf"
click node_branding "https://github.com/cm5722254-beep/cambodiadnsserver/tree/main/theme"

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_resolvers,node_operators,node_doh,node_dot,node_dnscrypt,node_regions,node_client toneBlue
class node_udp_custom,node_udpgw,node_slowdns,node_v2ray,node_vless,node_trojan,node_ssh,node_payloads toneAmber
class node_stunnel,node_squid,node_nginx toneMint
class node_branding toneRose
```

## Components

### DNS configuration

- [Cambodia resolvers](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/dns_resolvers.json): `configs/dns_resolvers.json`
- [ISP profiles](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/cambodia_operators.json): `configs/cambodia_operators.json`
- [DoH endpoints](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/doh_endpoints.json): `configs/doh_endpoints.json`
- [DoT configuration](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/dot_config.json): `configs/dot_config.json`
- [DNSCrypt proxy](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/dnscrypt_proxy.toml): `configs/dnscrypt_proxy.toml`
- [Server regions](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/configs/server_regions.json): `configs/server_regions.json`

### Tunneling configuration

- [UDP Custom](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/udp_custom.json): `server/udp_custom.json`
- [BadVPN UDPGW](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/badvpn-udpgw.service): `server/badvpn-udpgw.service`
- [SlowDNS](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/slowdns.json): `server/slowdns.json`
- [V2Ray templates](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/v2ray/vmess_template.json): `v2ray/vmess_template.json`
- [VLESS template](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/v2ray/vless_template.json): `v2ray/vless_template.json`
- [Trojan config](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/v2ray/trojan_config.json): `v2ray/trojan_config.json`
- [SSH configuration](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/sshd_config_snippet.conf): `server/sshd_config_snippet.conf`
- [Carrier payloads](https://github.com/cm5722254-beep/cambodiadnsserver/tree/main/payloads): `payloads`

### Server configuration

- [Stunnel service](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/stunnel.conf): `server/stunnel.conf`
- [Squid proxy](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/squid.conf): `server/squid.conf`
- [Nginx service](https://github.com/cm5722254-beep/cambodiadnsserver/blob/main/server/nginx_chm.conf): `server/nginx_chm.conf`

### Client assets

- [VIP branding](https://github.com/cm5722254-beep/cambodiadnsserver/tree/main/theme): `theme`

### Other components

- **Compatible client**

## Connections

- Compatible client → Cambodia resolvers: uses DNS (evidence: `README.md`)
- Compatible client → DoH endpoints: uses DoH (evidence: `README.md`)
- Compatible client → DoT configuration: uses DoT (evidence: `README.md`)
- Compatible client → UDP Custom: uses tunnel (evidence: `README.md`)
- Compatible client → BadVPN UDPGW: uses tunnel (evidence: `README.md`)
- Compatible client → SlowDNS: uses tunnel (evidence: `README.md`)
- Compatible client → V2Ray templates: uses tunnel (evidence: `README.md`)
- Compatible client → VLESS template: uses tunnel (evidence: `README.md`)
- Compatible client → Trojan config: uses tunnel (evidence: `README.md`)
- Compatible client → SSH configuration: uses tunnel (evidence: `README.md`)
- Compatible client → VIP branding: displays assets (evidence: `README.md`)
