Dawnline 0.3.0
Build packages / Version (push) Waiting to run

- Access split into Internet and Home network cards; network tiles inline,
  Auto-detect LAN beside them, other interfaces folded by kind
- Devices reach each other: Off, Everyone or Circles (per server); circles
  with names, colours and members; a person's own devices always see each
  other while it is not off
- Per-person home networks: people can be kept out of some of the server's
  networks (nft lan_part set, AllowedIPs follow)
- Home services moved from Settings to Access, added from the devices the
  router sees over DHCP (ports they announce over Bonjour when umdns runs)
- Who reaches what (rules summed up per access) and Check access (walks the
  same rules as nft and the client configuration, step by step)
- Find home devices (Bonjour): umdns services published as DNS-SD records in
  dnsmasq; installs umdns from Access
- Connections from home show the DHCP name with the address in brackets
- Repaints keep the scroll position
This commit is contained in:
Aemeath committed 2026-10-15 18:12:47 +03:00
1 parent 82ab86848e
commit aa8256bc60
26 files changed
+1661 -289

No files matched your search

+36 -4
View File
@@ -1,6 +1,6 @@
// luci.dawnline RPC bindings. The backend reports failures as { error }.
import type { AwgCaps, ClientConfig, DayUsage, HealthCheck, LogEvent, Person, Status } from '../shared/types';
import type { AwgCaps, Circle, ClientConfig, DayUsage, HealthCheck, LogEvent, MeshMode, Person, Status } from '../shared/types';
function call<T>(method: string, params: string[] = []) {
const fn = rpc.declare<any>({ object: 'luci.dawnline', method, params });
@@ -95,6 +95,7 @@ export interface Needs {
https: string[];
acme: string[];
home: string[];
bonjour: string[];
}
export interface SettingsData {
@@ -178,8 +179,18 @@ export interface InterfacesData {
ifname: string;
detected: { wan: string | null; lan: string | null };
saved: { wan: string; lan: string };
config: { auto_wan: boolean; wan_device: string; auto_lan: boolean; lan_devices: string[]; lan_like: boolean; device_mesh: boolean };
config: {
auto_wan: boolean;
wan_device: string;
auto_lan: boolean;
lan_devices: string[];
lan_like: boolean;
device_mesh: boolean;
mesh: MeshMode;
};
like_home: LikeHome;
/** Find home devices: published from umdns as DNS-SD records. */
bonjour: { on: boolean; needs: string[]; running: boolean; services: number };
effective: {
wan: { dev: string | null; zone: string; auto: boolean; missing: boolean };
home: { dev: string; auto: boolean; nets: string[]; zone: string | null; missing: boolean }[];
@@ -193,6 +204,20 @@ export interface InterfacesData {
nets_changed?: boolean;
}
/** "Check access": each rule on the way, in order; it stops at the first that fails. */
export interface AccessCheck {
ok: boolean;
steps: { ok: boolean; title: string; detail: string }[];
}
/** A device at home (DHCP lease or static host) and the services it announces over Bonjour. */
export interface HomeHost {
address: string;
name: string;
mac: string;
services: { type: string; name: string; port: number }[];
}
/** Filters for logs_clear; all empty clears the whole log. */
export interface LogFilter {
person?: string;
@@ -221,7 +246,7 @@ export type PersonPatch = Partial<
| 'dns_mode',
string
>
> & { paused?: boolean; services?: string[] };
> & { paused?: boolean; services?: string[]; circle?: string; home_nets?: string[] };
const personUpdateRaw = rpc.declare<any>({
object: 'luci.dawnline',
@@ -242,6 +267,8 @@ const personUpdateRaw = rpc.declare<any>({
'dns_mode',
'paused',
'services',
'circle',
'home_nets',
],
});
@@ -260,7 +287,7 @@ async function personUpdate(id: string, patch: PersonPatch): Promise<{ person: P
'note',
'dns_mode',
] as const;
const args: unknown[] = [id, ...keys.map((k) => patch[k]), patch.paused, patch.services];
const args: unknown[] = [id, ...keys.map((k) => patch[k]), patch.paused, patch.services, patch.circle, patch.home_nets];
const r = await personUpdateRaw(...args);
if (r && typeof r.error === 'string') throw new Error(r.error);
return r;
@@ -324,7 +351,12 @@ export const api = {
'lan_devices',
'lan_like',
'device_mesh',
'mesh',
]),
circleSet: call<{ id: string; circles: Circle[] }>('circle_set', ['id', 'server', 'name', 'color', 'members']),
circleDelete: call<{ circles: Circle[] }>('circle_delete', ['id']),
accessCheck: call<AccessCheck>('access_check', ['from', 'to']),
homeHosts: call<{ hosts: HomeHost[]; mdns: boolean }>('home_hosts', ['id']),
usageClear: call<unknown>('usage_clear', ['scope', 'id']),
uninstall: call<unknown>('uninstall', ['confirm']),
status,