Dawnline 0.18.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

- Add V2RayTun to a device's set-up on Android: its awg:// link as a code and to copy, in the portal and in the admin (phones, tablets and other devices), with the server's IP, which its Android app needs; not with the Maximum disguise. Its Windows app is ready but stays off until it gives the tunnel the server's DNS.
- Portal: show V2RayTun's Telegram channel beside Google Play.
- Make WireGuard part of AmneziaWG's choice when the disguise is off: the same file and code, both apps named in the steps, WireGuard's store a tap away; a router still picks its package.
- Portal: Reconnect asks again what the device is and about LAN Bypass, and LAN Bypass switches from a device's ⋯ menu, in a group of its own between the copy actions and Rename, Reconnect, Remove (the keys stay; the device takes its updated configuration).
- Turn LAN Bypass on by default for new devices, in the portal and the admin.
- Portal: an app's name too long for the picker fades at its edge and glides to its end on hover or tap; two store buttons stack where they do not fit side by side; the month chart's "Today" stays inside its axis.
- Write to the router's system log by level (Settings → Logs & history → System log: errors, warnings, normal, verbose): the service starting and stopping, every apply with its time, network, firewall, nftables and peer changes, changed settings and portal errors, in English whatever the admin's language, with keys masked.
- Activity: say what a device's change on the portal was (LAN Bypass on or off, its type).
- Demo: build again after a force-pushed main instead of failing on the commit that is gone.
This commit is contained in:
Aemeath committed 2026-11-05 13:56:20 +03:00
1 parent 18e3013047
commit f8130e39a8
65 files changed
+2066 -338

No files matched your search

+8
View File
@@ -135,6 +135,14 @@ describe('a device’s link', () => {
'You changed device Phone of Myata · MTU',
);
});
it('says what each option became, and names the portal where a person changed it', () => {
expect(deviceChangedText('lan_bypass=on, kind=tablet')).toBe('LAN Bypass on, type: Tablet');
expect(deviceChangedText('lan_bypass=off, mtu=1400, keepalive=25')).toBe('LAN Bypass off, MTU 1400, keep-alive 25 s');
expect(deviceChangedText('mtu=auto, keepalive=auto')).toBe('MTU: automatic, keep-alive: automatic');
const change = ev({ type: 'device_changed', by: 'portal', person: 'p1', device: 'd1', detail: 'kind=phone, lan_bypass=on' });
expect(text(eventText({ people }, change))).toBe('Person Myata changed device Phone on their portal · type: Phone, LAN Bypass on');
expect(text(eventText({ people }, change, 'p1'))).toBe('Device Phone changed on the portal · type: Phone, LAN Bypass on');
});
});
describe('the router’s words', () => {
+112 -3
View File
@@ -1,7 +1,10 @@
import { describe, expect, it } from 'vitest';
import { awgLink, v2rFits } from '../src/shared/awglink';
import {
addLink,
appsFor,
appName,
appsOn,
importPath,
importSteps,
inWebview,
@@ -80,9 +83,99 @@ describe('setup', () => {
expect(sameDevice('router', 'linux', true)).toBe(false);
});
it('lists the apps a disguise allows, AmneziaVPN first', () => {
expect(appsFor('max').map((a) => a.id)).toEqual(['vpn', 'awg']);
expect(appsFor('off').map((a) => a.id)).toEqual(['vpn', 'awg', 'wg']);
it('lists the apps a disguise allows, the tunnel apps first, V2RayTun short of 3.1', () => {
expect(appsFor('max').map((a) => a.id)).toEqual(['awg', 'vpn']);
expect(appsFor('balanced').map((a) => a.id)).toEqual(['awg', 'vpn', 'v2r']);
expect(appsFor('legacy').map((a) => a.id)).toEqual(['awg', 'vpn', 'v2r']);
expect(appsFor('off').map((a) => a.id)).toEqual(['awg', 'wg', 'vpn', 'v2r']);
});
it('offers V2RayTun on Android and Windows only, and a router its packages', () => {
// V2RayTun on Windows as when its flag is on (shared/flags.ts); off, below.
const ids = (kind: Parameters<typeof appsOn>[0], os: Parameters<typeof appsOn>[2] = null) =>
appsOn(kind, appsFor('off'), os, true).map((a) => a.id);
expect(ids('router')).toEqual(['awg', 'wg']);
expect(ids('computer', 'windows')).toEqual(['awg', 'vpn', 'v2r']);
expect(ids('computer', 'mac')).not.toContain('v2r');
expect(ids('computer', 'linux')).not.toContain('v2r');
expect(ids('computer')).not.toContain('v2r');
expect(ids('phone')).toContain('v2r');
expect(ids('phone', 'android')).toContain('v2r');
expect(ids('phone', 'ios')).not.toContain('v2r');
expect(ids('other', 'android')).toContain('v2r');
expect(ids('other', 'windows')).toContain('v2r');
expect(ids('other', 'mac')).not.toContain('v2r');
const off = (kind: Parameters<typeof appsOn>[0], os: Parameters<typeof appsOn>[2]) =>
appsOn(kind, appsFor('off'), os, false).map((a) => a.id);
expect(off('computer', 'windows')).not.toContain('v2r');
expect(off('other', 'windows')).not.toContain('v2r');
expect(off('phone', 'android')).toContain('v2r');
expect(off('phone', null)).toContain('v2r');
expect(storeFor('v2r', 'android')?.href).toContain('com.v2raytun.android');
expect(storeFor('v2r', 'android')?.alt?.href).toBe('https://t.me/v2raytun');
expect(storeFor('v2r', 'ios')).toBeNull();
expect(storeFor('v2r', 'windows')?.href).toBe('https://storage.v2raytun.com/v2RayTun_Setup.exe');
expect(storeFor('v2r', 'mac')).toBeNull();
expect(importPath('v2r', 'windows')).toBe('+ → Import from clipboard');
expect(scanPath('v2r', 'android')).toBe('+ → Import config from QRcode');
expect(importPath('v2r')).toBe('+ → Import config from Clipboard');
});
it('writes the .conf as V2RayTun’s awg:// link, word for word as its own', () => {
const conf = [
'[Interface]',
'PrivateKey = To5H+v75ph8CwYDGaWIV+rpmLfig46SzvpJYucuyRp8=',
'Address = 10.8.48.141/32',
'DNS = 1.1.1.1, 1.0.0.1',
'MTU = 1380',
'Jc = 6',
'Jmin = 40',
'Jmax = 1000',
'S1 = 67',
'S2 = 41',
'H1 = 1225345823',
'H2 = 1000314123',
'H3 = 827179548',
'H4 = 962210412',
'',
'[Peer]',
'PublicKey = Aif5mPmmTkPNf3uUOH1TSWnerLIV6hRgxC8oXyqTFDM=',
'AllowedIPs = 0.0.0.0/0, ::/0',
'Endpoint = hel-01.v2tun.net:51820',
'PersistentKeepalive = 25',
'',
].join('\n');
expect(awgLink(conf, '1793854167195')).toBe(
'awg://To5H%2Bv75ph8CwYDGaWIV%2BrpmLfig46SzvpJYucuyRp8%3D@hel-01.v2tun.net:51820' +
'?publickey=Aif5mPmmTkPNf3uUOH1TSWnerLIV6hRgxC8oXyqTFDM%3D&address=10.8.48.141%2F32&dns=1.1.1.1%2C1.0.0.1' +
'&mtu=1380&allowedips=0.0.0.0%2F0%2C%3A%3A%2F0&persistentkeepalive=25&jc=6&jmin=40&jmax=1000&s1=67&s2=41' +
'&h1=1225345823&h2=1000314123&h3=827179548&h4=962210412#1793854167195',
);
});
it('keeps the preshared key, AmneziaWG 2.0 lines and an IPv6 endpoint in the link', () => {
const conf =
'[Interface]\nPrivateKey = a/b=\nAddress = 10.0.0.2/32\nS3 = 20\nH1 = 100-200\nI1 = <r 2><b 0x8580>\n\n' +
'[Peer]\nPublicKey = c+d=\nPresharedKey = e=\nAllowedIPs = 0.0.0.0/0\nEndpoint = [2001:db8::1]:51820\n';
const url = awgLink(conf, 'Home Server');
expect(url.startsWith('awg://a%2Fb%3D@[2001:db8::1]:51820?publickey=c%2Bd%3D&address=10.0.0.2%2F32&presharedkey=e%3D&')).toBe(true);
expect(url).toContain('&s3=20&h1=100-200&i1=%3Cr%202%3E%3Cb%200x8580%3E');
expect(url.endsWith('#Home%20Server')).toBe(true);
});
it('names the server by its IP in the link where one is given (V2RayTun’s core takes no name)', () => {
const conf = '[Interface]\nPrivateKey = k=\n\n[Peer]\nPublicKey = p=\nEndpoint = engage.example.eu:4500\n';
expect(awgLink(conf, 'Home', '203.0.113.7')).toBe('awg://k%3D@203.0.113.7:4500?publickey=p%3D#Home');
expect(awgLink(conf, 'Home', '2001:db8::7')).toContain('@[2001:db8::7]:4500?');
expect(awgLink(conf, 'Home', null)).toContain('@engage.example.eu:4500?');
});
it('offers V2RayTun for AmneziaWG 2.0 and plain WireGuard, never for 3.1 (Maximum)', () => {
const v2 = '[Interface]\nPrivateKey = k=\nJc = 4\nS3 = 20\nI1 = <r 2>\n\n[Peer]\nPublicKey = p=\n';
expect(v2rFits(v2)).toBe(true);
expect(v2rFits('[Interface]\nPrivateKey = k=\n')).toBe(true);
expect(v2rFits(v2.replace('S3 = 20', 'HeaderProtectionKey = h=\nRandomTrailers = on'))).toBe(false);
expect(v2rFits(v2.replace('S3 = 20', 'ContentPaddingAddition = 10-100'))).toBe(false);
});
it('sends people to the store first and to GitHub where no store has the app', () => {
@@ -121,6 +214,22 @@ describe('setup', () => {
expect(importSteps('wg', 'linux', 'Outline-Home.conf', false)[1][1]).toContain('wg-quick up');
});
it('gives WireGuard AmneziaWG’s choice where the disguise is off, and a router both packages', () => {
const ids = (kind: Parameters<typeof appsOn>[0]) => appsOn(kind, appsFor('off'), 'android').map((a) => a.id);
expect(ids('phone')).not.toContain('wg');
expect(ids('computer')).not.toContain('wg');
expect(ids('router')).toEqual(['awg', 'wg']);
expect(appName('awg', true)).toBe('AmneziaWG or WireGuard');
expect(appName('awg')).toBe('AmneziaWG');
expect(appName('vpn', true)).toBe('AmneziaVPN');
expect(importSteps('awg', 'mac', 'Home.conf', false, true)[0]).toEqual(['Open AmneziaWG or WireGuard', '']);
expect(importSteps('awg', 'linux', 'Home.conf', false, true)[2]).toEqual([
'Or, with wireguard-tools, ',
'sudo wg-quick up ./Home.conf',
]);
expect(importSteps('awg', 'linux', 'Home.conf', false)).toHaveLength(2);
});
it('spots in-app browsers', () => {
expect(inWebview(`${ANDROID} Telegram-Android/10.0`)).toBe(true);
expect(inWebview(IPHONE)).toBe(false);