Dawnline 0.8.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
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
- Every field says what is wrong as you type, in the router's own words,
and Save refuses what the router would: UDP port when editing a server,
MTU, keep-alive, public address, DNS for devices, person name, device
limit, end date and data limit, device names (the next free "Phone 2"
is offered), home services, circles, portal title, redirect and other
addresses, defaults, update time
- Cyrillic names give Latin ids, hostnames and file names; names are
counted in characters, the rule names the characters it refuses; end
dates must exist on the calendar; a mistyped extra portal address is
refused instead of dropped
- The public address is checked on the router as it is typed: points at
this router, at another address, behind Cloudflare, or the WAN is
private or CGNAT; the wizard says so before the first step, never
pre-fills a private WAN address and says where its suggestion came
from; the Connection card says when the server was last reached from
the internet; IPv6 names and literals work throughout
- A person can be moved to another server from their page; a server's
tunnel network can be changed in the Danger zone (devices are
renumbered and marked "Update config"); WAN and LAN zones come from the
router's actual devices; when the public IPv4 changed, one click puts
the new one in
- Over the data limit or outside the allowed hours the tunnel stays
connected and the portal explains why nothing gets through, instead of
a silent handshake failure; Health's "devices loaded" compares the
peers themselves, not their count
- Portal: install links for this platform, two first steps on a first
visit, the phone's back button closes a sheet, the file goes through
the share sheet into the app, two QR codes (AmneziaVPN camera, AmneziaWG
and WireGuard apps), the sheet notices the first connection
- Admin: Enter submits a dialog, arrow keys walk the menus, Find in People
("/" focuses it), a device of a paused, ended or over-limit person says
so, "Keep access" past its end date is said on the Overview, Allowed
hours enforce nothing until saved, the invite card shares the link
- Health warns when another package's policy routing (mwan3, pbr) sends
tunnel traffic past the home-device path
- CLI: person ls, device ls, log with -n, --since, --level, --src and
--json; exit code 2 for an unknown command and 1 when health finds an
error; person rm asks for --yes when devices would go; devices added
from the command line get their event and "issued" marker like the
UI's
- Three disguises: Off, Balanced and Maximum. Standard and Strong (1.0-style
junk only, which networks learned to spot) are no longer offered; a server
still on one keeps running and its card says to switch. A new server gets
the strongest disguise its router can run
- Portal: setting up a device is one sheet with two steps. Get the app
(AmneziaVPN first; AmneziaWG, and WireGuard with the disguise off, behind
"Another app") from the store of the device in hand, with the GitHub release
where no store has it and the version the server needs said once; then add
the connection (open in AmneziaVPN, copy the key, share or download the
file). A device set up from another device gets its link to take there, as a
QR code for a phone; a phone set up from a computer also gets the connection
as a code, one code revealed at a time so the camera cannot read the wrong one
- Portal motion: the first visit comes in once (blocks in reading order,
meters fill, the sun rises in the logo); a repaint glides cards to their
new places and brings changed values into focus; sheets slide up on
phones and can be pulled down, come into focus on a computer, follow
their content's height and turn into the next sheet in place; tabs and
segments slide, menus, tooltips and toasts grow out of what opened them,
copy buttons turn into a check, buttons waiting for the router spin;
with reduced motion only the fades remain
- Portal: while a device is set up, a card at the top shows the way from
it to the router with a light running along it; on the first connection
the way fills green, the steps fold away and the sheet closes by itself.
The first connection is the first fresh handshake, so it is no longer
missed while the watcher catches up (or after new keys), and the device's
card goes on to Connected
- Portal: QR codes are light dots on a black card, fuller on dense keys,
with "Show a light code" for scanners that read only dark on light (every
code switches, the choice is kept); the link and code a set-up sheet
hands to another device open that device's set-up there at once
- Portal: Remove and New keys ask in a small alert with the action's icon;
the open one of two cards is not a button; device names are no longer
repeated in every line of the set-up sheet; the code card lines up with
the rest of its card (a class clash gave it the page's padding); text
keeps the arrow cursor, store badges and link buttons are not underlined
This commit is contained in:
1 parent
fd9543ce68
commit
466ca6c7b0
69 files changed
+5182
-686
No files matched your search
+67
-16
@@ -10,11 +10,12 @@ 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, group, row, svg } from '../ui/layout';
|
||||
import { callout, card, firstBad, group, liveRow, row, svg } from '../ui/layout';
|
||||
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 } from '../disguise';
|
||||
import { methodInfo, methodPicker, type Method, defaultMethod, legacyTitle } from '../disguise';
|
||||
import { coreHead, type Core, type CoreCtx } from './common';
|
||||
|
||||
/** `.conf` names of the disguise parameters, in file order. */
|
||||
@@ -198,6 +199,13 @@ function fileCard(cfg: AwgConfig): HTMLElement {
|
||||
]);
|
||||
}
|
||||
|
||||
/** The configuration carries no disguise values: plain WireGuard, any WireGuard app takes it. */
|
||||
export function plainWg(cfg: AwgConfig): boolean {
|
||||
const o = (cfg.amnezia.obfuscation ?? {}) as Record<string, string | undefined>;
|
||||
const neutral: Record<string, string> = { h1: '1', h2: '2', h3: '3', h4: '4' };
|
||||
return Object.entries(o).every(([k, v]) => v == null || v === '' || v === (neutral[k] ?? '0'));
|
||||
}
|
||||
|
||||
/** File / key / QR switcher for a client configuration; opens on the file unless asked otherwise. */
|
||||
export async function connectBlock(cfg: AwgConfig, initial: 'file' | 'key' | 'qr' = 'file'): Promise<HTMLElement> {
|
||||
if (!cfg.has_private_key)
|
||||
@@ -211,7 +219,11 @@ export async function connectBlock(cfg: AwgConfig, initial: 'file' | 'key' | 'qr
|
||||
qr: () =>
|
||||
E('div', { class: 'dl-qr-pane' }, [
|
||||
svg(qrSvg(cfg.conf), 'dl-qr'),
|
||||
E('span', { class: 'dl-sub' }, 'Scan with AmneziaVPN or AmneziaWG on the device.'),
|
||||
E(
|
||||
'span',
|
||||
{ class: 'dl-sub' },
|
||||
plainWg(cfg) ? 'Scan with AmneziaVPN or any WireGuard app on the device.' : 'Scan with AmneziaVPN or AmneziaWG on the device.',
|
||||
),
|
||||
]),
|
||||
key: () =>
|
||||
E('div', { class: 'dl-stack gap8' }, [
|
||||
@@ -243,7 +255,7 @@ async function applyDisguise(ctx: CoreCtx, srv: Server, m: Method, same: boolean
|
||||
const devices = people.reduce((n, p) => n + p.devices.length, 0);
|
||||
const ok = await confirmDialog(
|
||||
same ? 'Generate new disguise values?' : `Switch to ${info.title}?`,
|
||||
`${devices} AmneziaWG device${devices === 1 ? '' : 's'} stop connecting until they import their configuration again (from their personal link or from you).${m === 'max' ? ' They need an app with AmneziaWG 3.1.' : m === 'balanced' ? ' They need an app with AmneziaWG 2.0 or newer.' : ''}`,
|
||||
`${devices} AmneziaWG device${devices === 1 ? ' stops' : 's stop'} connecting until ${devices === 1 ? 'it imports its' : 'they import their'} configuration again (from their personal link or from you).${m === 'max' ? ' They need an app with AmneziaWG 3.1.' : m === 'balanced' ? ' They need an app with AmneziaWG 2.0 or newer.' : ''}${ctx.st.servers.length === 1 && devices ? ' To keep the old disguise for some people, add a second server and move them there.' : ''}`,
|
||||
same ? 'Generate and apply' : 'Switch and apply',
|
||||
true,
|
||||
);
|
||||
@@ -263,30 +275,54 @@ export function settingsCard(ctx: CoreCtx, srv: Server): HTMLElement {
|
||||
inputmode: 'numeric',
|
||||
class: 'cbi-input-text dl-w-port dl-mono',
|
||||
});
|
||||
const now = `${srv.mtus.computer} for computers and routers, ${srv.mtus.phone} for phones and tablets`;
|
||||
const mtuHint = srv.mtu
|
||||
? `Now ${now}. Empty = automatic.`
|
||||
: `Automatic by device type and disguise: now ${now}. Lower it if some sites hang.`;
|
||||
const ka = input(String(srv.keepalive ?? ''), { placeholder: '25', inputmode: 'numeric', class: 'cbi-input-text dl-w-port dl-mono' });
|
||||
const current = methodInfo(srv.preset) ? (srv.preset as Method) : undefined;
|
||||
let selected: Method = current ?? 'standard';
|
||||
let selected: Method = current ?? defaultMethod(st.awg);
|
||||
const apply = button('', () => applyDisguise(ctx, srv, selected, selected === current), 'neutral');
|
||||
const label = () =>
|
||||
dom.content(apply, selected === current ? [icon('reset'), ' Generate new values'] : [`Switch to ${methodInfo(selected)!.title}`]);
|
||||
label();
|
||||
const tools = st.awg_state?.tools !== false;
|
||||
// Who holds which port arrives once the card is built (netstat on the
|
||||
// router); until then the port is only checked for its range.
|
||||
let holds: PortHold[] = [];
|
||||
const portRow = liveRow('UDP port', port, () =>
|
||||
portHelp(
|
||||
Number(port.value),
|
||||
holds,
|
||||
`Opened on the WAN firewall automatically.${Number(port.value) === 4500 ? ' 4500 is IPsec’s port: most networks let it through.' : ''}`,
|
||||
),
|
||||
);
|
||||
api
|
||||
.serverPorts(srv.id)
|
||||
.then((r) => {
|
||||
holds = r.udp_taken ?? [];
|
||||
portRow.refresh();
|
||||
})
|
||||
.catch(() => {});
|
||||
const mtuRow = liveRow('MTU', mtu, () => mtuHelp(mtu.value, srv.mtus));
|
||||
const kaRow = liveRow('Keep-alive', ka, () => keepaliveHelp(ka.value));
|
||||
return card(
|
||||
'',
|
||||
[
|
||||
coreHead('AmneziaWG', srv.ifname),
|
||||
group('globe', 'Listening', 'Where devices reach this core from the internet', [
|
||||
row('UDP port', port, 'Opened on the WAN firewall automatically.'),
|
||||
]),
|
||||
group('globe', 'Listening', 'Where devices reach this core from the internet', [portRow]),
|
||||
group('file', 'In every device configuration', 'Changing these marks devices “Update config” until they import again', [
|
||||
row('MTU', mtu, mtuHint),
|
||||
row('Keep-alive', ka, 'Seconds between packets devices send to keep NAT open. 0 = off.'),
|
||||
mtuRow,
|
||||
kaRow,
|
||||
]),
|
||||
group('shield', 'Disguise', 'So networks that block VPNs do not recognise the tunnel. Off = plain WireGuard', [
|
||||
// A server from before 0.8 on the old junk-only disguise: it runs, but is no longer offered.
|
||||
legacyTitle(srv.preset)
|
||||
? callout('warn', [
|
||||
E('b', {}, legacyTitle(srv.preset)!),
|
||||
' is AmneziaWG 1.0 junk only, which networks learned to spot; it is not offered any more. Switch to ',
|
||||
E('b', {}, 'Balanced'),
|
||||
' or ',
|
||||
E('b', {}, 'Maximum'),
|
||||
': devices import their configuration again.',
|
||||
])
|
||||
: '',
|
||||
methodPicker(
|
||||
st.awg,
|
||||
selected,
|
||||
@@ -331,7 +367,19 @@ export function settingsCard(ctx: CoreCtx, srv: Server): HTMLElement {
|
||||
],
|
||||
[
|
||||
E('span', { class: 'dl-sub' }, 'Port, MTU and keep-alive apply at once.'),
|
||||
button('Save', () => ctx.save({ port: port.value, mtu: mtu.value, keepalive: ka.value }, 'AmneziaWG saved'), 'positive'),
|
||||
button(
|
||||
'Save',
|
||||
() => {
|
||||
// The help lines already say what is wrong: do not send it anyway.
|
||||
const bad = firstBad([portRow, mtuRow, kaRow]);
|
||||
if (bad) {
|
||||
notify(bad, 'warning');
|
||||
return;
|
||||
}
|
||||
return ctx.save({ port: port.value, mtu: mtu.value, keepalive: ka.value }, 'AmneziaWG saved');
|
||||
},
|
||||
'positive',
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -361,7 +409,10 @@ function overviewTile(srv: Server): HTMLElement {
|
||||
]),
|
||||
E('div', { class: 'dl-disg-id' }, [
|
||||
E('span', { class: 'dl-disg-ic' }, icon(m?.ic ?? 'shield')),
|
||||
E('span', { class: 'dl-stack' }, [E('b', {}, m ? m.title : 'Custom'), E('span', { class: 'dl-sub' }, m ? m.short : 'Set by hand')]),
|
||||
E('span', { class: 'dl-stack' }, [
|
||||
E('b', {}, m ? m.title : (legacyTitle(srv.preset) ?? 'Custom')),
|
||||
E('span', { class: 'dl-sub' }, m ? m.short : legacyTitle(srv.preset) ? 'Switch to Balanced or Maximum' : 'Set by hand'),
|
||||
]),
|
||||
]),
|
||||
m
|
||||
? E('div', { class: 'dl-disg-meters' }, [
|
||||
|
||||
Reference in new issue
Block a user