Dawnline 0.10.0
Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / ucode static checks (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 24.10) (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 25.12) (push) Blocked by required conditions

- Portal redesigned from scratch. No header bar: the page opens with the
  server's name and the person's and fades under the edges. Device cards
  show the status, the last 7 days (hover a day for its figures) and a
  Connect or Update button; "Your access" folds into rows: what they can
  reach (with the names at home), data this month day by day, and when
  access ends. The page follows the system's light or dark theme
- Adding a device: pick the kind (PC, Mobile, Router, Other) and a name, or
  add it from the device itself with the page's QR code. The set-up sheet
  then shows the app for that system and the connection, waits for the
  first connection, says "<device> connected" and closes on its own
- Switching apps in the set-up sheet changes only what differs: the old
  words blur into the new ones, and the menu path is shown for iOS and
  Android in one line. Names, numbers and statuses that change on the page
  morph in place
- Dialogs open in the middle on a computer, on the same spring as the menu;
  buttons that wait for the router show a spinner at once
- A paused account gets one card that says so; the page's messages are
  short and no longer send people to the admin. A QR code of the page sits
  beside the breadcrumb, to open it on another device
- Allowed hours are shown in the visitor's own time zone
- The portal's Title setting is gone: the page and its tab take the
  server's name. A title set before is removed on upgrade
- The admin names .conf files after the server too, as the portal does
  (Outline-Home.conf); its device menu says "Download AmneziaWG config" and
  "Copy AmneziaVPN config", and its QR codes use the portal's round look in
  the admin's light or dark colours
- README rewritten, with screenshots made from a demo cast
  (scripts/capture-screenshots.mjs --demo)
This commit is contained in:
Aemeath committed 2026-10-19 21:07:14 +03:00
1 parent edeb1506fd
commit 4f12ca19e7
94 files changed
+8076 -5009

No files matched your search

+6 -6
View File
@@ -10,9 +10,9 @@ import { confirmDialog } from '../ui/modal';
import { copyText, downloadFile } from '../ui/files';
import { attempt, notify } from '../ui/toast';
import { input } from '../ui/controls';
import { callout, card, firstBad, group, liveRow, row, svg } from '../ui/layout';
import { callout, card, firstBad, group, liveRow, row } from '../ui/layout';
import { qrCode } from '../ui/qr';
import { keepaliveHelp, mtuHelp, portHelp, type PortHold } from '../netcheck';
import { qrSvg } from '../../shared/qr';
import { vpnKey } from '../../shared/vpnkey';
import { icon } from '../../shared/icons';
import { methodInfo, methodPicker, type Method, defaultMethod, legacyTitle } from '../disguise';
@@ -171,7 +171,7 @@ function fileCard(cfg: AwgConfig): HTMLElement {
E('span', { class: 'dl-filecard-ic' }, '.conf'),
E('span', { class: 'dl-stack' }, [
E('span', { class: 'dl-mono dl-ellipsis' }, cfg.filename),
E('span', { class: 'dl-sub' }, `AmneziaWG · ${size} bytes · import it in the app`),
E('span', { class: 'dl-sub' }, `AmneziaWG · ${size} bytes`),
]),
button([icon('download'), ' Download'], () => downloadFile(cfg.filename, cfg.conf, 'application/octet-stream'), 'positive'),
]),
@@ -218,7 +218,7 @@ export async function connectBlock(cfg: AwgConfig, initial: 'file' | 'key' | 'qr
const panes: Record<string, () => Node> = {
qr: () =>
E('div', { class: 'dl-qr-pane' }, [
svg(qrSvg(cfg.conf), 'dl-qr'),
qrCode(cfg.conf),
E(
'span',
{ class: 'dl-sub' },
@@ -437,6 +437,6 @@ export const awg: Core = {
overviewTile,
connectBlock,
qrText: (cfg) => cfg.conf,
appKey: { label: 'Copy AmneziaVPN key', make: (cfg) => vpnKey(cfg, cfg.server) },
file: { label: 'Download .conf', make: (cfg) => ({ name: cfg.filename, text: cfg.conf }) },
appKey: { label: 'Copy AmneziaVPN config', make: (cfg) => vpnKey(cfg, cfg.server) },
file: { label: 'Download AmneziaWG config', make: (cfg) => ({ name: cfg.filename, text: cfg.conf }) },
};
+3 -3
View File
@@ -11,10 +11,10 @@ import { copyText, downloadFile } from './ui/files';
import { dropdown, type MenuItem } from './ui/menu';
import { drawer } from './ui/drawer';
import { attempt, notify } from './ui/toast';
import { liveField, svg } from './ui/layout';
import { liveField } from './ui/layout';
import { qrCode } from './ui/qr';
import { nameHelp } from './netcheck';
import { deviceStatus } from './ui/badges';
import { qrSvg } from '../shared/qr';
import { ago, bytes, isoDay, KIND_LABEL, KINDS, todayOf } from '../shared/format';
import { icon } from '../shared/icons';
import { eventBy } from './events/model';
@@ -420,7 +420,7 @@ export function quickMenu(anchor: HTMLElement, p: Person, d: Device, o: DeviceOp
modal(
`${d.name} · QR code`,
E('div', { class: 'dl-qr-pane' }, [
svg(qrSvg(core.qrText(c)), 'dl-qr'),
qrCode(core.qrText(c)),
E(
'span',
{ class: 'dl-sub' },
+1 -6
View File
@@ -10,6 +10,7 @@ import { E } from './e';
import { ago, initials } from '../shared/format';
import { icon, iconSvg } from '../shared/icons';
import { onNavigate } from './ui/nav';
import { isDark } from './ui/theme';
import { placeKey, shimmerOpacity } from './places/model';
// mapcn requires maplibre-gl ^6 (the globe projection came with 5): an ES module, its worker beside it.
@@ -71,12 +72,6 @@ function loadMapLibre(host: HTMLElement): Promise<any> {
return loading;
}
function isDark(): boolean {
const attr = document.documentElement.getAttribute('data-darkmode');
if (attr != null) return attr === 'true';
return window.matchMedia?.('(prefers-color-scheme: dark)').matches ?? false;
}
/** A click on a marker brings the map at least this close (a city). */
const CLICK_ZOOM = 10;
/** Places closer than this are one city: a click shows them together at city level. */
-7
View File
@@ -244,13 +244,6 @@ export function urlHelp(s: string): Help {
return { text: 'Wrong links are sent there instead of a “Not found”.', bad: false };
}
/** The portal's title: up to 64 characters on one line. */
export function titleHelp(s: string): Help {
if (chars(s) > 64) return { text: `Up to 64 characters (${chars(s)} now).`, bad: true };
if (/[\u0000-\u001f\u007f]/.test(s)) return { text: 'One line, please.', bad: true };
return { text: 'Shown in the browser tab and at the top of the portal.', bad: false };
}
/** The home domain for device hostnames (schema domain): lowercase letters, digits, dashes, dots. */
export function domainHelp(s: string, example = 'phone.myata'): Help {
const t = s.trim();
+3 -6
View File
@@ -7,7 +7,7 @@ import { button } from '../../ui/button';
import { cancelButton, closeModal, modal } from '../../ui/modal';
import { input, isOn, sw } from '../../ui/controls';
import { firstBad, group, liveRow, needRow, row } from '../../ui/layout';
import { hostHelp, portalPortHelp, titleHelp, urlHelp } from '../../netcheck';
import { hostHelp, portalPortHelp, urlHelp } from '../../netcheck';
import { icon } from '../../../shared/icons';
import { fmtDay } from '../../../shared/format';
import { installMissing } from '../../pkgs';
@@ -29,7 +29,6 @@ export function portalCard(host: SettingsHost): HTMLElement {
const c = host.d.cert;
const pOn = sw(eff.portal_enabled, 'Enable portal');
const port = input(s.portal_port, { placeholder: '8443', inputmode: 'numeric', class: 'cbi-input-text dl-w-port' });
const title = input(s.portal_title, { placeholder: 'Dawnline' });
const redirect = input(s.portal_redirect, { placeholder: 'Show “Not found”', class: 'cbi-input-text dl-mono' });
const other = input('', { placeholder: 'vpn.example.com or an IP', 'aria-label': 'Other address' });
const isIp = (h: string) => /^\d{1,3}(\.\d{1,3}){3}$/.test(h);
@@ -279,7 +278,6 @@ export function portalCard(host: SettingsHost): HTMLElement {
portalPortHelp(port.value.trim() === '' ? eff.portal_port : Number(port.value), host.d.tcp_taken ?? [], picked.some(isIp)),
);
refreshPort = listenRow.refresh;
const titleRow = liveRow('Title', title, () => titleHelp(title.value));
const redirectRow = liveRow('Unknown links', redirect, () => urlHelp(redirect.value));
const custom = !!(s.portal_cert && s.portal_key);
const kind = !c ? 'Portal is off' : custom ? 'Your files' : c.self_signed ? 'Self-signed' : 'Let’s Encrypt';
@@ -371,7 +369,7 @@ export function portalCard(host: SettingsHost): HTMLElement {
E('span', { class: 'dl-muted' }, 'A page where each person adds and manages their devices with their personal link.'),
httpsRow ? E('div', { class: 'dl-list' }, [httpsRow]) : '',
group('network', 'Port', 'How the portal listens (80 and 443 stay free)', [listenRow]),
group('edit', 'Appearance', 'What people see', [titleRow, redirectRow]),
group('edit', 'Appearance', 'What people see', [redirectRow]),
group('link', 'Addresses', 'Pick one or more; the first is the main link', [
opts,
E('div', { class: 'dl-stack gap8' }, [
@@ -388,7 +386,7 @@ export function portalCard(host: SettingsHost): HTMLElement {
'Save',
() => {
// The help lines already say what is wrong: do not send it anyway.
const bad = firstBad([listenRow, titleRow, redirectRow]);
const bad = firstBad([listenRow, redirectRow]);
if (bad) {
notify(bad, 'warning');
return;
@@ -399,7 +397,6 @@ export function portalCard(host: SettingsHost): HTMLElement {
portal_host: picked[0] ?? '',
portal_alt: picked.slice(1),
portal_port: port.value,
portal_title: title.value,
portal_redirect: redirect.value.trim(),
},
'Saved',
+3 -1
View File
@@ -47,7 +47,9 @@
.dl-pgrid.flush { padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .dl-pgrid.flush { grid-template-columns: minmax(0, 1fr); } }
.dl-qr-pane { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.dl-qr { width: min(280px, 72vw); aspect-ratio: 1; background: #fff; padding: 8px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--dl-line); }
.dl-qr { width: min(280px, 72vw); aspect-ratio: 1; background: #0a0a0a; border-radius: 18px; overflow: hidden; }
/* The portal's round look: its own card colour (black at night, white by day), the light one ringed. */
.dl-qr.light { background: #fff; box-shadow: inset 0 0 0 1px var(--dl-line); }
.dl-qr svg { display: block; width: 100%; height: 100%; }
.dl-filecard { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--dl-soft); min-width: 0; }
.dl-filecard > .dl-stack { flex: 1; min-width: 0; }
+11
View File
@@ -0,0 +1,11 @@
// A device's QR code, in the portal's round look: light dots on black on the
// dark theme, the same dots dark on white on a light one (shared/qr.ts).
import { qrSvg } from '../../shared/qr';
import { svg } from './layout';
import { isDark } from './theme';
export function qrCode(text: string): HTMLElement {
const dark = isDark();
return svg(qrSvg(text, 3, true, dark ? 'night' : 'day'), `dl-qr${dark ? '' : ' light'}`);
}
+9
View File
@@ -0,0 +1,9 @@
// Which theme the admin shows: Outline switches light and dark in place with
// html[data-darkmode]; without it, the system's choice. Read where something
// is drawn in the theme's own colours (the map, QR codes).
export function isDark(): boolean {
const attr = document.documentElement.getAttribute('data-darkmode');
if (attr != null) return attr === 'true';
return window.matchMedia?.('(prefers-color-scheme: dark)').matches ?? false;
}