# EasyDNS Web A standalone, self-contained Go administration panel for the EasyDNS Rust DNS server. **This is a separate application and Debian package. It does not install, replace, or modify EasyDNS itself.** The OLED-style UI draws visual inspiration from RustProxy 0.43.1 while keeping its own identity and strict API compatibility. ![EasyDNS operator dashboard — demo fixture, not live server data](design/screenshots/overview-demo.png) ## Features - Overview, zones, primary-zone creation/import, record CRUD, zone transfers, secondary synchronization, DNS NOTIFY and DNSSEC status. - DNS lookup, upstreams, policies, read-only views/ACL/rate limits, blocklists, cache, sampled metrics, audit, server status and configuration reload. - **Optional multi-server management**: one central panel for a local EasyDNS installation plus remote installations (for example one Primary and two Secondary DNS servers). - Server topology with per-server health, actual DNS role counts, automatic active-server selection and read-only zone serial comparison. - **Metrics: Aggregate / Split / Single** in multi-server mode. Additive QPS rates and counters can be combined, cache ratios are weighted, and latency percentiles remain per-server. No synthetic history or new EasyDNS API endpoints. - **Single-server mode by default**. Enable Multi-server using `config.toml` (Debian), `.env` (Compose), or the Configuration toggle only when neither source explicitly sets the mode. - Secure administrator login, session/CSRF protection, safe confirmations and ETag/If-Match concurrency handling for DNS record changes. The panel never invents REST endpoints or server-side capabilities. In particular, the optional “topology” is a **management view**, not a distributed cluster implementation. There is no automatic leader election, quorum, primary/secondary provisioning, DNS replication setup, or secret distribution. EasyDNS itself continues to handle native AXFR/IXFR and NOTIFY, configured on the respective DNS installations. ## Technology and visual style Go 1.23+, `net/http`, `html/template`, `go:embed`, embedded Bootstrap 5.3.6 CSS, a small custom OLED stylesheet, vanilla JavaScript/Canvas charts and local SVG icons. No CDN, frontend build step or external Go modules are required. HTMX and Chart.js were optional preferences; this implementation uses native HTML forms and an embedded Canvas renderer instead. Almost-black backgrounds, fine hairline borders, dense tables, restrained cyan/amber chart lines and flat compact controls. No gradients, oversized decorative cards, invented logo monograms or misleading “API v1” indicators. Five approved appearance references are in `design/reference/`. The screenshots under `design/screenshots/` are rendered demo fixtures, **not live EasyDNS measurements**. UI elements are constrained by available API data and operations; the style references are not treated as a backend contract. ## Install with Debian packages EasyDNS itself must already be installed and running. Install the matching EasyDNS Web package: ```bash sudo apt install ./easydns-ui_0.1.1_amd64.deb # On ARM64, use easydns-ui_0.1.1_arm64.deb instead. sudo systemctl status easydns-ui sudo cat /etc/easydns-ui/panel.password ``` Open `http://127.0.0.1:8088` on the server. Log in with username **`admin`** and the automatically generated password from the file above. An external workstation can use an SSH tunnel: ```bash ssh -L 8088:127.0.0.1:8088 user@dns-server # Then browse to http://127.0.0.1:8088 locally. ``` The default listener binds to loopback. Do not expose the HTTP panel publicly; use a TLS reverse proxy or an SSH/VPN tunnel. For browser access via HTTPS, set `cookie_secure = true` under `[panel]` in `/etc/easydns-ui/config.toml` and restart the service. The panel's login password is **not** the EasyDNS API token. On the local machine, EasyDNS automatically generates `/etc/easydns/data/control.token` when its TCP REST interface is enabled. The Go backend reads that file directly and sends `Authorization: Bearer` only when talking to the EasyDNS API. No API token appears in HTML/JavaScript. Alternatively, the Go panel can communicate through the local Unix control socket (file permissions still apply). ## Configure one Primary and two Secondary servers (optional) 1. Install EasyDNS on all three machines and configure their real DNS zones, transfers/ACLs and NOTIFY **using EasyDNS's native configuration**, not the panel. 2. Install EasyDNS Web on **one** machine. Its local EasyDNS instance is the default managed server. 3. Enable the feature. **Debian:** set `[multiserver] enabled = true` in `/etc/easydns-ui/config.toml` and restart the panel. **Docker Compose:** set `EASYDNS_UI_MULTISERVER=true` in `.env` and recreate the container. When neither source explicitly defines the enabled flag, Configuration offers an optional in-panel toggle. The new **Servers** navigation item and server selector appear. Selecting a server in the toolbar changes context automatically without a separate Switch button. The **ACTIVE SERVER** bar identifies the API target for normal DNS pages and **Single** Metrics. In **Metrics → Aggregate / Split**, the scope changes to all registered servers and is labeled **FLEET METRICS**. Each server's zone list is separate; use **Servers → Zone comparison** for a multi-server zone view. See [MULTI-SERVER.md](MULTI-SERVER.md) for troubleshooting. 4. Go to **Servers → Add server**. Add `dns-secondary-01` with **Secondary** as the *panel display label*, its HTTPS EasyDNS API URL, and the **generated control token belonging to that remote installation**. Repeat for `dns-secondary-02`. 5. Open **Servers** to see availability and actual DNS role counts. Select a server to operate its normal EasyDNS UI, or choose **Compare zone serials** to check whether the same zone is present and what SOA serial each server reports. 6. Open **Metrics** and choose **Aggregate** (default), **Split**, or **Single**. Aggregate adds rates only while every server has recent readings; incomplete data is marked rather than silently treated as zero. See [MULTI-SERVER.md](MULTI-SERVER.md) for the exact mathematics and limitations. For a remote token, read the token on its own machine securely (for example through SSH). It is **not** the local token and cannot be retrieved through the existing REST API. Remote API connections must use HTTPS with a trusted certificate. Plain HTTP is accepted only for `localhost`, `127.0.0.1` or `::1` on the panel machine, e.g. via a loopback SSH tunnel. Tokens entered in the UI are stored only in private files under `/var/lib/easydns-ui/tokens/` (0600). Tokens preconfigured in TOML or Compose `.env` are held in process memory. None are returned to the browser. The panel's **Primary/Secondary labels do not modify the actual server role**. The individual EasyDNS `GET /api/v1/status` response reports the real primary and secondary zone counts. A different SOA serial is a diagnostic observation, not proof that synchronization failed. **No automatic synchronization is performed across servers**: open an existing secondary zone on the selected server to use EasyDNS's supported manual `POST /api/v1/zones/{zone}/sync` operation. **Disable Multi-server** by setting `[multiserver] enabled = false` in TOML, or `EASYDNS_UI_MULTISERVER=false` in `.env`, then restarting the panel. If neither source explicitly sets this option, disable it using the Configuration toggle. Previously registered UI-managed connections remain saved for later re-enabling, but remote polling stops. Explicit TOML and environment values are authoritative: the Multi-server toggle is hidden in Configuration and a previous `settings.json` preference cannot override them. Server names and role labels supplied in TOML or `.env` are read-only in the Servers inventory; labels for panel-added servers remain editable. An explicitly configured local role is read-only as well. The inventory uses only LOCAL/REMOTE badges, not configuration-source badges. The `nodes.json` file holds UI-managed metadata, and `settings.json` stores the optional UI toggle only when configuration does not set it. See [MULTI-SERVER.md](MULTI-SERVER.md) for an illustrated topology guide, setup, security and limitations. ## Configuration and service **Debian:** configure the panel using `/etc/easydns-ui/config.toml` (protected, `root:easydns-ui`, mode `0640`). The package creates this file as a Debian conffile; it survives upgrades. The installer separately generates `/etc/easydns-ui/panel.password` and `/etc/easydns-ui/session.key` if they do not exist. ```bash sudoedit /etc/easydns-ui/config.toml sudo systemctl restart easydns-ui sudo journalctl -u easydns-ui -f ``` **Upgrade note for Multi-server users:** 0.1.1 treats `[multiserver] enabled` in TOML as authoritative. If an older 0.1.0 installation had Multi-server enabled only via the web toggle while `config.toml` still says `enabled = false`, change the TOML value to `true` and restart after upgrading. Existing remote connections and tokens remain saved; they are not deleted. The TOML file can configure username, password, API URL, API token (or the generated token file), bind address, session settings and up to 15 additional server connections. For an existing installation upgraded from the old `/etc/default/easydns-ui`, copy any custom values to the TOML file; the old shell environment file is no longer sourced by the systemd unit. **Docker Compose:** copy `.env.example` to `.env`, set `EASYDNS_UI_PASSWORD`, `EASYDNS_API_URL`, and `EASYDNS_API_TOKEN`, and run: ```bash cp .env.example .env chmod 600 .env docker compose up -d --build ``` Each remote server can also be configured with a separate `EASYDNS_UI_SERVER_N_TOKEN`. The container uses a persistent volume for session signing and the server registry. Docker doesn't need a TOML file. The exposed port binds to `127.0.0.1:8088` by default. See **[CONFIGURATION.md](CONFIGURATION.md)** for complete Debian TOML examples, Docker Compose `.env` variables, security, configuration precedence and fingerprinted static files. A Debian package never installs or alters the Rust DNS server itself. Purging the package removes the panel-owned configuration and credentials; a normal update preserves them. ## Build from source ```bash make test make vet make build ./bin/easydns-ui -version make deb GOARCH=amd64 VERSION=0.1.1 make deb GOARCH=arm64 VERSION=0.1.1 ``` ### Reproducible Docker-based Debian packaging Only Docker is required on the build host (no local Go or `dpkg-deb`): ```bash ./scripts/build_deb.sh # amd64 + arm64 ./scripts/build_deb.sh --arch amd64 ./scripts/build_deb.sh --arch arm64 --version 0.1.1 make docker-deb ARCH=all VERSION=0.1.1 ``` The default build image is `golang:1.23-bookworm`, including Debian tools. The Docker build container runs with networking disabled (`--network none`), uses the existing `scripts/build-deb.sh` package definition, and compiles both Linux architectures with `CGO_ENABLED=0`. Packages are placed in `dist/`. ## Project structure ```text EasyDNS-Web/ ├── cmd/easydns-ui/main.go # service entry point ├── internal/config/ # TOML, environment overrides + validation ├── internal/easydns/ # native EasyDNS REST client/models ├── internal/multiserver/ # optional node registry + sampling ├── internal/server/ # HTTP handlers, auth, HTML templates │ └── web/ # embedded OLED CSS/JS/icons/templates ├── internal/telemetry/ # genuine stats samples (RAM) ├── packaging/ # systemd and Debian maintainer scripts ├── scripts/build_deb.sh # Docker package builder ├── scripts/build-deb.sh # native Debian package builder ├── design/reference/ # approved visual references ├── design/screenshots/ # demo fixture screenshots ├── MULTI-SERVER.md ├── API-MAPPING.md ├── API-GAPS.md ├── UI-STRUCTURE.md ├── DESIGN-SYSTEM.md └── SECURITY.md ``` ## API and operational limits The API contract is based on the supplied **EasyDNS Rust 0.1.4** source (`docs/api.md`, `crates/dns-api/src/{handlers,lib}.rs`). The remote public `master` revision was not revalidated for this package; check compatibility when upgrading the Rust server. All native operations go through the real `/api/v1/...` endpoints. URLs such as `/servers`, `/configuration/multi-server`, and `/ui/telemetry` are **Go panel routes, not EasyDNS API endpoints**. `GET /api/v1/stats` supplies counters and latency snapshots, not a 24-hour server history. The panel polls every 15 seconds and stores up to 1,440 genuine samples per selected server (up to six hours), in memory. History disappears after restarting the panel. There is no query-log API, transfer queue progress, native cluster membership, or CRUD for Views/ACL/rate-limiting. See [API-GAPS.md](API-GAPS.md). ## Documentation - [MULTI-SERVER.md](MULTI-SERVER.md) — optional server management, topology and setup. - [API-MAPPING.md](API-MAPPING.md) — REST routes, JSON fields and UI actions. - [UI-STRUCTURE.md](UI-STRUCTURE.md) — navigation and form interactions. - [API-GAPS.md](API-GAPS.md) — unsupported or read-only operations. - [DESIGN-SYSTEM.md](DESIGN-SYSTEM.md) — OLED tokens, density and controls. - [SECURITY.md](SECURITY.md) — login, secrets, HTTPS and trust boundaries. Panel source: MIT. Embedded Bootstrap CSS: MIT, see [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md). RustProxy is a visual reference only and is not included as a dependency.