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

- Where people connect from is a globe map now: live arcs from each
  person to the server, grey ones for the last 24 h, 7 or 30 days, avatars
  instead of dots, the server's own marker, and a light map in light mode;
  it zooms to fit the people shown and follows them as they come and go
- Markers that overlap move apart with a pointer to their spot; people
  next to the server fold into a count on it; a click zooms in and opens a
  floating card (never clipped by the map), closing flies back
- The person page maps where they connected from, older places fading;
  the device panel lists its places in order, and connections from the LAN
  or through the router's own address stay off the maps ("LAN" in grey)
- Setup and new servers check the UDP port (taken by another program, a
  forward or another server) and the subnet (three numbers + .x, a private
  range not in use) as you type; the default port is 4500
- The personal portal can share the server's port number (TCP beside UDP);
  its port is checked against forwards and other services
- A new server comes up at once: the kernel module is loaded and the
  network restarted when OpenWrt doesn't know AmneziaWG yet
- A turned-off server is a state of its own: no "tunnel down" or DNS
  warnings, "Turned off" in yellow, a white Turn on, and people on it are
  not shown as paused
- Pause everyone is removed: turning a server off does the same (a router
  left paused keeps its servers off after the update)
- People: a stopped person's card fades and says why across its bottom,
  with the one action that lifts it (Resume, +10 GB, Extend 1 month);
  people held by a limit or end date sort below the others, paused last
- The person page shows the state as text ("Paused") with a Resume
  button, also while their server is off
- The portal tells a paused or ended person just that, even with the
  server off, and lets them change nothing until the admin lifts it (the
  router refuses too); its notices look like Overview's
- Automatic MTU: with the field empty the tunnel, computers and routers
  get 1380 minus AmneziaWG S4 (1368 on Maximum), phones and tablets 1280;
  a typed MTU still caps phones and tablets at 1280, and servers on the
  old default 1380 move to automatic (phones and tablets get "Update
  config", their old files keep working)
- Only procd's agent runs: a second copy (started by hand or left over)
  refuses to start or is ended within 5 minutes, so no more stray paused
  and resumed events; a device that leaves the tunnel is offline at once
- The installer picks the newest release (it took the lowest), DNS
  lookups can't hang, and tooltips and floating cards close on scroll and
  on leaving the page
This commit is contained in:
Aemeath committed 2026-10-17 01:03:23 +03:00
1 parent 29b1d7dfd7
commit 972e522518
60 files changed
+1966 -636

No files matched your search

+17 -20
View File
@@ -41,7 +41,6 @@ function attention(st: Status): Attention[] {
tone: 'bad',
text: [`Tunnel ${s.ifname} is down. `, link(L.url('admin/network/dawnline/diagnostics'), 'Open Diagnostics')],
});
if (st.settings.paused_all) out.push({ tone: 'warn', text: ['Everyone is paused.'] });
for (const p of st.people) {
if (p.state === 'quota') out.push({ tone: 'warn', text: [link(personUrl(p.id), p.name), ' reached the data limit.'] });
else if (p.state === 'expired') out.push({ tone: 'warn', text: [link(personUrl(p.id), p.name), '’s access has ended.'] });
@@ -166,9 +165,8 @@ export class ServerOverview {
this.range,
);
const legend = E('div', { class: 'dl-map-legend' }, [
E('span', {}, [E('i', { class: 'dot ok' }), 'Online']),
E('span', {}, [E('i', { class: 'dot' }), 'Seen recently']),
E('span', {}, [E('i', { class: 'line' }), 'Live tunnel']),
E('span', {}, [E('i', { class: 'line live' }), 'Live tunnel']),
E('span', {}, [E('i', { class: 'line' }), 'Seen recently']),
]);
const wrap = E('div', { class: 'dl-map-wrap' }, [this.map.el, legend]);
requestAnimationFrame(() => this.map!.mount(this.mapData()));
@@ -178,11 +176,10 @@ export class ServerOverview {
paint(quiet = false) {
const st = this.st;
const srv = st.servers[0];
const slots = st.people.reduce((a, p) => a + Math.max(0, p.device_limit - p.devices.length), 0);
repaint(
this.parts.bento,
E('div', { class: 'dl-bento' }, [this.onlineTile(), this.speedTile(), coreOf(srv).overviewTile(srv), this.monthTile(slots)]),
E('div', { class: 'dl-bento' }, [this.onlineTile(), this.speedTile(), coreOf(srv).overviewTile(srv), this.monthTile()]),
quiet,
);
@@ -235,11 +232,14 @@ export class ServerOverview {
*/
onlineTile(): HTMLElement {
const st = this.st;
const off = st.servers[0] ? !st.servers[0].enabled : false;
const CAP = 12;
const today = (d: Device) => d.spark[d.spark.length - 1] ?? 0;
const cityOf = (d: Device) => st.geo.points.find((g) => g.device === d.id && g.city)?.city;
const home = (d: Device) => /^(10\.|192\.168\.|172\.(1[6-9]|2\d|3[01])\.)/.test(d.endpoint ?? '');
const where = (d: Device) => (home(d) ? 'home' : cityOf(d)) ?? '';
// Where a device is: its city, or "LAN" when it connects from the home network (the hover
// card adds its address there).
const where = (d: Device, ip = false): string => (home(d) ? (ip && d.endpoint ? `LAN · ${d.endpoint}` : 'LAN') : (cityOf(d) ?? ''));
const connectedAt = (d: Device) => [...st.events].reverse().find((e) => e.type === 'connect' && e.device === d.id)?.ts ?? 0;
const on = st.people
.map((p) => ({ p, devs: p.devices.filter((d) => d.online).sort((a, b) => today(b) - today(a)) }))
@@ -298,7 +298,7 @@ export class ServerOverview {
E(
'div',
{ class: 'dl-hc-devs' },
devs.map((d) => E('span', { class: 'dl-hc-dev' }, [icon(d.kind), [d.name, where(d)].filter(Boolean).join(' · ')])),
devs.map((d) => E('span', { class: 'dl-hc-dev' }, [icon(d.kind), d.name, where(d) ? [' · ', where(d, true)] : ''])),
),
E('div', { class: 'dl-hc-foot' }, [
E(
@@ -321,7 +321,7 @@ export class ServerOverview {
? E('span', { class: 'dl-onl-meta' }, [
...devs.slice(0, 3).map((d) => icon(d.kind)),
devs.length > 3 ? `+${devs.length - 3}` : '',
where(devs[0]) ? E('span', {}, ` · ${where(devs[0])}`) : '',
where(devs[0]) ? E('span', {}, [' · ', where(devs[0])]) : '',
])
: '',
]);
@@ -362,10 +362,11 @@ export class ServerOverview {
: '',
])
: E('div', { class: 'dl-onl-empty' }, [
E('span', {}, 'Nobody is connected'),
// A server that is off takes no connections: say so rather than "nobody".
E('span', {}, off ? 'The server is turned off' : 'Nobody is connected'),
last
? E('span', { class: 'dl-sub' }, `Last: ${last.p.name}, ${ago(last.d.handshake, st.now)}`)
: E('span', { class: 'dl-sub' }, 'No device has connected yet'),
: E('span', { class: 'dl-sub' }, off ? 'Devices connect once it is on' : 'No device has connected yet'),
]),
]);
}
@@ -375,16 +376,12 @@ export class ServerOverview {
* upload side by side, the last 15 minutes as a small chart, today's total.
*/
speedTile(): HTMLElement {
return speedTile(this.st.servers[0]?.rate ?? [], this.st.now, this.st.totals.today);
const srv = this.st.servers[0];
return speedTile(srv?.rate ?? [], this.st.now, this.st.totals.today, srv ? !srv.enabled : false);
}
/** The last 30 days, today on the right, with the peak; plus the people summary. */
monthTile(slots: number): HTMLElement {
const t = this.st.totals;
const paused = this.st.people.filter((p) => p.state !== 'active').length;
return daysTile(
this.st.series,
`${t.people} ${t.people === 1 ? 'person' : 'people'}${paused ? ` · ${paused} paused` : ''} · ${slots} device slot${slots === 1 ? '' : 's'} free`,
);
/** The last 30 days, today on the right, with the peak. */
monthTile(): HTMLElement {
return daysTile(this.st.series, '');
}
}