Dawnline 0.11.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
- Russian translation. The admin pages, the LuCI menu and the router's messages (errors, Health checks, update steps, the service log) come in Russian with the new luci-i18n-dawnline-ru package, released beside the app. LuCI shows it when its language is Russian, or "auto" with a Russian browser - The translation installs with install.sh when LuCI is in Russian (or with --lang ru), follows every Dawnline update and rollback, and can be added or removed in Components → Dawnline → Translation - The portal speaks the visitor's language: it opens in the system's language and switches between English and Russian in place, from the language pill beside its QR code. It carries its own translation and needs no package - Set-up steps quote the apps' own menus word for word, in Russian too: AmneziaVPN is "+ → Insert → Continue" (it has no "Add server"), and the Mac and Windows menus of WireGuard and AmneziaWG have their real names - Questions in the portal (Reconnect, Remove) read from the left edge and close with Cancel, without × - Numbers, sizes and dates follow the page's language. A server that can't start says why in one sentence; event details and service log lines read as whole sentences - README in Russian (README_ru.md). rules/i18n.md: how strings are written and translated; CI checks the catalogs (npm run i18n:check)
This commit is contained in:
1 parent
caed976e63
commit
2f2aaf6c34
173 files changed
+25645
-2823
No files matched your search
+58
-52
@@ -3,6 +3,7 @@
|
||||
import type { AwgCaps } from '../shared/types';
|
||||
import { E } from './e';
|
||||
import { icon } from '../shared/icons';
|
||||
import { fmt } from '../shared/i18n';
|
||||
|
||||
export type Method = 'balanced' | 'max' | 'off';
|
||||
/** The router features a method may need (the boolean ones of AwgCaps). */
|
||||
@@ -24,42 +25,47 @@ export interface MethodInfo {
|
||||
needs?: AwgNeed;
|
||||
}
|
||||
|
||||
export const METHODS: MethodInfo[] = [
|
||||
{
|
||||
id: 'off',
|
||||
title: 'Off',
|
||||
ic: 'zap',
|
||||
stealth: 0,
|
||||
speed: 4,
|
||||
text: 'Plain WireGuard-compatible traffic. Fastest, but easy to recognise and block.',
|
||||
apps: 'Any WireGuard app',
|
||||
short: 'Any WireGuard app',
|
||||
},
|
||||
{
|
||||
id: 'balanced',
|
||||
title: 'Balanced',
|
||||
ic: 'shield',
|
||||
stealth: 3,
|
||||
speed: 4,
|
||||
needs: 'v2',
|
||||
text: 'AmneziaWG 2.0: junk packets, padded packets and a first packet that looks like DNS. For networks that learned to spot 1.0-style junk.',
|
||||
apps: 'AmneziaVPN 4.8.12 or newer, AmneziaWG 2.0+ apps',
|
||||
short: 'AmneziaWG 2.0+ apps',
|
||||
},
|
||||
{
|
||||
id: 'max',
|
||||
title: 'Maximum',
|
||||
ic: 'lock',
|
||||
stealth: 4,
|
||||
speed: 3,
|
||||
needs: 'v3',
|
||||
text: 'AmneziaWG 3.1: encrypted packet headers, random tails and sizes, jittered timing, and a first packet that looks like DNS.',
|
||||
apps: 'Apps with AmneziaWG 3.1 (current AmneziaVPN)',
|
||||
short: 'AmneziaWG 3.1 apps',
|
||||
},
|
||||
];
|
||||
/** The methods in picker order, in the page's language. */
|
||||
export function methods(): MethodInfo[] {
|
||||
return [
|
||||
{
|
||||
id: 'off',
|
||||
title: _('Off'),
|
||||
ic: 'zap',
|
||||
stealth: 0,
|
||||
speed: 4,
|
||||
text: _('Plain WireGuard-compatible traffic. Fastest, but easy to recognise and block.'),
|
||||
apps: _('Any WireGuard app'),
|
||||
short: _('Any WireGuard app'),
|
||||
},
|
||||
{
|
||||
id: 'balanced',
|
||||
title: _('Balanced'),
|
||||
ic: 'shield',
|
||||
stealth: 3,
|
||||
speed: 4,
|
||||
needs: 'v2',
|
||||
text: _(
|
||||
'AmneziaWG 2.0: junk packets, padded packets and a first packet that looks like DNS. For networks that learned to spot 1.0-style junk.',
|
||||
),
|
||||
apps: _('AmneziaVPN 4.8.12 or newer, AmneziaWG 2.0+ apps'),
|
||||
short: _('AmneziaWG 2.0+ apps'),
|
||||
},
|
||||
{
|
||||
id: 'max',
|
||||
title: _('Maximum'),
|
||||
ic: 'lock',
|
||||
stealth: 4,
|
||||
speed: 3,
|
||||
needs: 'v3',
|
||||
text: _('AmneziaWG 3.1: encrypted packet headers, random tails and sizes, jittered timing, and a first packet that looks like DNS.'),
|
||||
apps: _('Apps with AmneziaWG 3.1 (current AmneziaVPN)'),
|
||||
short: _('AmneziaWG 3.1 apps'),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
export const methodInfo = (id: string): MethodInfo | undefined => METHODS.find((x) => x.id === id);
|
||||
export const methodInfo = (id: string): MethodInfo | undefined => methods().find((x) => x.id === id);
|
||||
|
||||
/** The disguise a new server gets: the strongest this router can run. */
|
||||
export const defaultMethod = (caps: AwgCaps): Method => (caps.v3 ? 'max' : caps.v2 ? 'balanced' : 'off');
|
||||
@@ -70,21 +76,21 @@ export const defaultMethod = (caps: AwgCaps): Method => (caps.v3 ? 'max' : caps.
|
||||
* the picker offers Balanced or Maximum instead. The title for such a server, or null.
|
||||
*/
|
||||
export const legacyTitle = (preset: string): string | null =>
|
||||
preset === 'standard' ? 'Standard (old)' : preset === 'strong' ? 'Strong (old)' : null;
|
||||
preset === 'standard' ? _('Standard (old)') : preset === 'strong' ? _('Strong (old)') : null;
|
||||
|
||||
const NEEDS: Record<AwgNeed, string> = {
|
||||
v2: 'Needs AmneziaWG 2.0 or newer on the router (kmod-amneziawg and amneziawg-tools from July 2025 on).',
|
||||
v3: 'Needs AmneziaWG 3.1 on the router (kmod-amneziawg and amneziawg-tools 3.1).',
|
||||
};
|
||||
|
||||
/** The same while no AmneziaWG is installed at all ("newer" would be misleading). */
|
||||
const NEEDS_NONE: Record<AwgNeed, string> = {
|
||||
v2: 'Needs AmneziaWG on the router.',
|
||||
v3: 'Needs AmneziaWG 3.1 on the router: install it first.',
|
||||
};
|
||||
/**
|
||||
* Why a method is not available. `installed` is false while no AmneziaWG is
|
||||
* installed at all ("newer" would be misleading then).
|
||||
*/
|
||||
function needsText(need: AwgNeed, installed: boolean): string {
|
||||
if (!installed) return need === 'v2' ? _('Needs AmneziaWG on the router.') : _('Needs AmneziaWG 3.1 on the router: install it first.');
|
||||
return need === 'v2'
|
||||
? _('Needs AmneziaWG 2.0 or newer on the router (kmod-amneziawg and amneziawg-tools from July 2025 on).')
|
||||
: _('Needs AmneziaWG 3.1 on the router (kmod-amneziawg and amneziawg-tools 3.1).');
|
||||
}
|
||||
|
||||
function dots(n: number, label: string): HTMLElement {
|
||||
return E('span', { class: 'dl-dots', title: `${label}: ${n} of 4` }, [
|
||||
return E('span', { class: 'dl-dots', title: fmt(_('%s: %s of 4'), label, n) }, [
|
||||
E('span', { class: 'dl-dots-label' }, label),
|
||||
E(
|
||||
'span',
|
||||
@@ -106,11 +112,11 @@ export function methodPicker(
|
||||
current?: string,
|
||||
installed = true,
|
||||
): HTMLElement {
|
||||
const el = E('div', { class: 'dl-methods', role: 'radiogroup', 'aria-label': 'Disguise method' });
|
||||
const el = E('div', { class: 'dl-methods', role: 'radiogroup', 'aria-label': _('Disguise method') });
|
||||
const paint = () =>
|
||||
dom.content(
|
||||
el,
|
||||
METHODS.map((m) => {
|
||||
methods().map((m) => {
|
||||
const ok = !m.needs || caps[m.needs];
|
||||
const on = m.id === selected;
|
||||
return E(
|
||||
@@ -132,16 +138,16 @@ export function methodPicker(
|
||||
E('div', { class: 'dl-method-head' }, [
|
||||
E('span', { class: 'dl-method-ic' }, icon(m.ic)),
|
||||
E('b', {}, m.title),
|
||||
m.id === current ? E('span', { class: 'dl-pill ok' }, 'Current') : '',
|
||||
m.id === current ? E('span', { class: 'dl-pill ok' }, _('Current')) : '',
|
||||
]),
|
||||
E('p', {}, m.text),
|
||||
E('div', { class: 'dl-method-meters' }, [dots(m.stealth, 'Stealth'), dots(m.speed, 'Speed')]),
|
||||
E('div', { class: 'dl-method-meters' }, [dots(m.stealth, _('Stealth')), dots(m.speed, _('Speed'))]),
|
||||
E(
|
||||
'div',
|
||||
{ class: 'dl-method-foot' },
|
||||
ok
|
||||
? [icon(m.id === 'off' ? 'wireguard' : 'amneziawg'), E('span', {}, m.apps)]
|
||||
: [icon('alert'), E('span', {}, (installed ? NEEDS : NEEDS_NONE)[m.needs!])],
|
||||
: [icon('alert'), E('span', {}, needsText(m.needs!, installed))],
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user