From 19b891163d1a18c6947fb3353fcfb04bfc0f9319 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Fri, 17 Jan 2025 17:08:45 +0200 Subject: [PATCH] docs: split docs to crate READMEs and more planning --- README.md | 43 +++-------------------------------- felu-common/README.md | 4 ++++ felu-mgmt/README.md | 13 +++++++++++ felu-ns/README.md | 53 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 40 deletions(-) create mode 100644 felu-common/README.md create mode 100644 felu-mgmt/README.md create mode 100644 felu-ns/README.md diff --git a/README.md b/README.md index 781521d..c12b9f5 100644 --- a/README.md +++ b/README.md @@ -4,48 +4,11 @@ WIP, ignore for now. ## Crates ### bin -#### felu-mgmt -UI for management. - -Leptos, not sure about SSR or CSR yet, CSR might be easier. -Local accounts to begin with, SSO via OIDC *maybe*. - -Connects to configured felu-ns servers. Health checked connections and retry -connections if dropped. - -* [Leptos](https://github.com/leptos-rs/leptos) for UI -* [axum](https://github.com/tokio-rs/axum) as web framework -* [tower-sessions](https://github.com/maxcountryman/tower-sessions) as session store for axum -* [sqlx](https://github.com/launchbadge/sqlx) for PostgreSQL - -#### felu-ns -Nameserver. - -Many, hosted as ns1, ns2, nsN, ns9. - -Requires a static public IPv4, which is used as the DNS (At least Do53 (Port 53 -over UDP and TCP). Possibly DoT, DoH and DoQ in the future) interface. - -Don't start DNS servers until configuration from felu-mgmt is received. - -Optionally the same interface used for DNS can be used as the interface that -felu-mgmt connects to for management. -Though ideally management is done via a VPN connection (e.g. Tailscale) and not -via a public interface. - -Completely stateless, receives configuration from felu-mgmt and stores it in -memory. Stores nothing to disk. - -Built-in HTTP server for things like Prometheus metrics at /metrics. - -* [hickory-dns](https://github.com/hickory-dns/hickory-dns) as the DNS library, should support everything needed -* [hyper](https://github.com/hyperium/hyper) for HTTP server +* [felu-mgmt](./felu-mgmt/README.md) +* [felu-ns](./felu-ns/README.md) ### lib -#### felu-common -Protobuf definitions and other shared structures. - -* [prost](https://github.com/tokio-rs/prost) for protobufs +* [felu-common](./felu-common/README.md) ## Initial notes: ### Communication diff --git a/felu-common/README.md b/felu-common/README.md new file mode 100644 index 0000000..865ad23 --- /dev/null +++ b/felu-common/README.md @@ -0,0 +1,4 @@ +# felu-common +Protobuf definitions and other shared structures. + +* [prost](https://github.com/tokio-rs/prost) for protobufs diff --git a/felu-mgmt/README.md b/felu-mgmt/README.md new file mode 100644 index 0000000..e3e7539 --- /dev/null +++ b/felu-mgmt/README.md @@ -0,0 +1,13 @@ +# felu-mgmt +UI for management. + +Leptos, not sure about SSR or CSR yet, CSR might be easier. +Local accounts to begin with, SSO via OIDC *maybe*. + +Connects to configured felu-ns servers. Health checked connections and retry +connections if dropped. + +* [Leptos](https://github.com/leptos-rs/leptos) for UI +* [axum](https://github.com/tokio-rs/axum) as web framework +* [tower-sessions](https://github.com/maxcountryman/tower-sessions) as session store for axum +* [sqlx](https://github.com/launchbadge/sqlx) for PostgreSQL diff --git a/felu-ns/README.md b/felu-ns/README.md new file mode 100644 index 0000000..280edfd --- /dev/null +++ b/felu-ns/README.md @@ -0,0 +1,53 @@ +# felu-ns +Nameserver. + +Many, hosted as ns1, ns2, nsN, ns9. + +Requires a static public IPv4, which is used as the DNS (At least Do53 (Port 53 +over UDP and TCP). Possibly DoT, DoH and DoQ in the future) interface. + +Optionally the same interface used for DNS can be used as the interface that +felu-mgmt connects to for management. +Though ideally management is done via a VPN connection (e.g. Tailscale) and not +via a public interface. + +Completely stateless, receives configuration from felu-mgmt and stores it in +memory. Stores nothing to disk. + +Built-in HTTP server for things like Prometheus metrics at /metrics. + +## Todo development notes +* Don't start DNS servers until configuration from felu-mgmt is received. +* Stress testing, I have no clue how performant the initial actor implementation +will be. + +## Architecture +### State Actor +Stores nameserver state/configuration. + +### MgmtServer Actor +Tokio TcpListener on management port. + +Sends configuration updates to state actor. + +### DoUT Actor +DNS over UDP and TCP. + +Reads records from state actor when responding to queries. + +## CLI + +[//]: # (The output of `just ns --help`) +``` +Usage: felu-ns [OPTIONS] + +Options: + --mgmt-port Port for management [default: 54321] + --udp-port Override DNS over UDP port [default: 53] + --tcp-port Override DNS over TCP port [default: 53] + -h, --help +``` +## Dependencies +* [hickory-dns](https://github.com/hickory-dns/hickory-dns) as the DNS library, should support everything needed +* [hyper](https://github.com/hyperium/hyper) for HTTP server + -- 2.44.1