DEVELOPMENT ENVIRONMENT

~liljamo/felu-ng

ref: a01dbe90b91672fd00ed8fffddbb4d8656d33db5 felu-ng/README.md -rw-r--r-- 2.2 KiB
a01dbe90Jonni Liljamo docs: more initial planning 2 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# felu

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

### lib
#### felu-common
Protobuf definitions and other shared structures.

* [prost](https://github.com/tokio-rs/prost) for protobufs

## Initial notes:
### Communication
Certs!

Protobufs over gRPC or just TCP?
Which is easier when we need a stream?

One-way stream? Mgmt sends data to ns, and ns can respond Results to received
messages, but not send messages to mgmt.

### Version control
Configuration version number.
Whole config hash?

### Health checks
Check if all available and on correct version of config.
Send config update if not.

5 second intervals.

### Atomic updates
Swap config after update in one operation.

## Scenarios
### New felu-ns
Receive whole config.

### Config updated
Existing felu-ns receive update.

#### felu-ns network flaky just as config was supposed to come
Health check will re-send if this happens.