Skip to content

LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.

Settings > Privacy: network rules by app

Federico Pereiraf770134bc780
diff --git a/apps/monitor/FwRules.jsx b/apps/monitor/FwRules.jsx
new file mode 100644
index 0000000..ff90abe
--- /dev/null
+++ b/apps/monitor/FwRules.jsx
@@ -0,0 +1,214 @@
+// FwRules.jsx — Settings → Privacy → "Network rules by app" (registered with
+// registerPrivacySection after "App network access", see docs/FIREWALL.md, "Rules by app").
+// For each app:
+// - its default: allow everything, or block everything except its rules (the {out, any} rule,
+// the same one the Monitor's switch writes);
+// - its rules: allow or block a domain (exact, or *.example.com with every subdomain), an IP
+// address or a CIDR network, with an optional port or range and protocol. Each row says when
+// the rule last decided a connection (lord-netperm's notices, seen by this session);
+// - add (a sheet that checks what is typed), edit and delete. There is no priority to reorder:
+// the engine picks the most specific match (rules.c, fw_decide), so the list is shown in that
+// order and the footer explains it.
+// The rules are saved by lord-server (lord.fw); this screen writes no files.
+import {
+ View, Text, Button, Segmented, ScrollView, GroupBox, useTheme, useLocale, useStore, useLauncherApps, firewall, firewallState, fwRule,
+ spacing, typeScale, formatDate, formatTime, direction,
+} from '@lordos/sdk';
+import { useEffect, useState } from 'react';
+import { RuleSheet, destKind, RED, GREEN } from './RuleSheet.jsx';
+
+const { sortByPrecedence, isDefaultRule } = fwRule;
+
+// Firewall id of a launcher app: the built-in ones run inside LordOS; isolated ones have a scope.
+const fwId = (a) => (a.kind === 'linux' ? a.id : a.kind === 'package' || a.isolated ? `lpk:${a.id}` : 'lordos');
+
+function useAppIndex() {
+ const list = useLauncherApps();
+ const byId = new Map();
+ for (const a of list) {
+ const id = fwId(a);
+ if (id !== 'lordos' && !byId.has(id)) byId.set(id, a);
+ }
+ return byId;
+}
+
+export const appLabelOf = (tr, apps, id) => (id === 'lordos' ? tr('monitor.lordos') : apps.get(id)?.name || id.replace(/^(desktop|lpk):/, ''));
+
+function AppIcon({ a, size = 24 }) {
+ const t = useTheme();
+ const Icon = a?.Icon;
+ return Icon ? <Icon size={size} /> : <View style={{ width: size, height: size, borderRadius: 6, backgroundColor: t.control }} />;
+}
+
+// "2 min ago", "today 14:05", "18/10/2026 14:05", or "not seen yet".
+export function lastMatchText(tr, secs) {
+ if (!secs) return tr('fwrules.lastMatch.never');
+ const now = Date.now() / 1000, d = Math.max(0, now - secs);
+ if (d < 60) return tr('fwrules.lastMatch.now');
+ if (d < 3600) return tr('fwrules.lastMatch.minutes', { count: Math.floor(d / 60) });
+ const when = new Date(secs * 1000), today = new Date();
+ const time = formatTime(when);
+ return when.toDateString() === today.toDateString() ? tr('fwrules.lastMatch.today', { time }) : tr('fwrules.lastMatch.date', { date: formatDate(when), time });
+}
+
+function ActionPill({ action }) {
+ const { t: tr } = useLocale();
+ const allow = action === 'allow';
+ return (
+ <View style={{ width: 52, height: 18, borderRadius: 9, alignItems: 'center', justifyContent: 'center', backgroundColor: allow ? 'rgba(48,209,88,0.18)' : 'rgba(255,69,58,0.18)' }}>
+ <Text style={{ fontSize: 10, fontWeight: 600, color: allow ? GREEN : RED }}>{tr(allow ? 'fwrules.allow' : 'fwrules.block')}</Text>
+ </View>
+ );
+}
+
+function RuleRow({ r, onEdit, onDelete, first }) {
+ const t = useTheme();
+ const { t: tr } = useLocale();
+ const detail = [destKind(tr, r.dst), r.port ? tr('fwrules.portValue', { port: r.port }) : tr('fwrules.anyPort'), r.proto ? r.proto.toUpperCase() : tr('fwrules.anyProto')];
+ if (r.dir === 'in') detail.push(tr('fwrules.incoming'));
+ return (
+ <View style={{ minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: spacing.s, paddingVertical: 6,
+ borderTopWidth: first ? 0 : 1, borderTopColor: t.separator }}>
+ <ActionPill action={r.action} />
+ <View style={{ flex: 1, minWidth: 0, gap: 2 }}>
+ <Text style={{ fontSize: typeScale.body, color: t.text, fontFamily: 'monospace', whiteSpace: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', direction: 'ltr', textAlign: 'start' }}>{r.dst}</Text>
+ <Text style={{ fontSize: typeScale.caption, color: t.textDim, whiteSpace: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', textAlign: 'start' }}>
+ {`${detail.join(' · ')} — ${lastMatchText(tr, r.lastMatch)}`}
+ </Text>
+ </View>
+ <Button small plain label={tr('fwrules.edit')} onClick={onEdit} />
+ <Button small plain destructive label={tr('fwrules.delete')} onClick={onDelete} />
+ </View>
+ );
+}
+
+// One app: header (icon, name, summary, chevron) and, open, its default, rules and the sheet.
+function AppRules({ id, apps, open, onToggle }) {
+ const t = useTheme();
+ const { t: tr } = useLocale();
+ const [sheet, setSheet] = useState(null); // null | { editId?, initial }
+ const [confirm, setConfirm] = useState(0); // the id waiting for a second click on Delete
+ const all = firewall.rules(id);
+ const def = all.find(isDefaultRule);
+ const rules = sortByPrecedence(all.filter((r) => !isDefaultRule(r)));
+ const label = appLabelOf(tr, apps, id);
+ const blocked = def?.action === 'deny';
+ const can = firewall.enforceable(id);
+ const summary = `${tr('fwrules.count', { count: rules.length })} · ${tr(blocked ? 'fwrules.default.denyShort' : 'fwrules.default.allowShort')}`;
+ return (
+ <View style={{ borderTopWidth: 0 }}>
+ <View onClick={onToggle} style={{ minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: spacing.s, paddingVertical: 6 }}>
+ <AppIcon a={apps.get(id)} />
+ <View style={{ flex: 1, minWidth: 0, gap: 1 }}>
+ <Text style={{ fontSize: typeScale.body, color: t.text, whiteSpace: 'nowrap', overflow: 'hidden', textAlign: 'start' }}>{label}</Text>
+ <Text style={{ fontSize: typeScale.caption, color: blocked ? RED : t.textDim, whiteSpace: 'nowrap', overflow: 'hidden', textAlign: 'start' }}>{summary}</Text>
+ </View>
+ <Text style={{ fontSize: 11, color: t.textDim }}>{open ? '▾' : direction() === 'rtl' ? '◂' : '▸'}</Text>
+ </View>
+ {open && (
+ <View style={{ gap: spacing.m, paddingBottom: spacing.m, paddingInlineStart: 32 }}>
+ {!can ? <Text style={{ fontSize: typeScale.caption, color: '#ff9f0a', lineHeight: 1.35, textAlign: 'start' }}>{tr('fwrules.notEnforceable')}</Text> : null}
+ <View style={{ flexDirection: 'row', alignItems: 'center', gap: spacing.m }}>
+ <View style={{ flex: 1, minWidth: 0, gap: 2 }}>
+ <Text style={{ fontSize: typeScale.body, color: t.text, textAlign: 'start' }}>{tr('fwrules.default')}</Text>
+ <Text style={{ fontSize: typeScale.caption, color: t.textDim, lineHeight: 1.35, textAlign: 'start' }}>{tr(blocked ? 'fwrules.default.denyHint' : 'fwrules.default.allowHint')}</Text>
+ </View>
+ <Segmented small value={blocked ? 'deny' : 'allow'} onChange={(v) => firewall.setAppRule(id, v === 'deny' ? 'deny' : null)}
+ options={[['allow', tr('fwrules.default.allow')], ['deny', tr('fwrules.default.deny')]]} />
+ </View>
+ <View style={{ borderRadius: 8, border: `1px solid ${t.separator}`, paddingHorizontal: spacing.m }}>
+ {rules.map((r, i) => (
+ confirm === r.id ? (
+ <View key={r.id} style={{ minHeight: 44, flexDirection: 'row', alignItems: 'center', gap: spacing.s, borderTopWidth: i ? 1 : 0, borderTopColor: t.separator }}>
+ <Text style={{ flex: 1, fontSize: typeScale.callout, color: t.text, textAlign: 'start' }}>{tr('fwrules.confirmDelete', { dst: r.dst })}</Text>
+ <Button small label={tr('fwrules.cancel')} onClick={() => setConfirm(0)} />
+ <Button small destructive label={tr('fwrules.delete')} onClick={() => { setConfirm(0); firewall.removeRule(r.id); }} />
+ </View>
+ ) : (
+ <RuleRow key={r.id} r={r} first={i === 0} onEdit={() => setSheet({ editId: r.id, initial: r })} onDelete={() => setConfirm(r.id)} />
+ )
+ ))}
+ {!rules.length && <Text style={{ fontSize: typeScale.callout, color: t.textDim, paddingVertical: 12, textAlign: 'start' }}>{tr('fwrules.empty')}</Text>}
+ </View>
+ {sheet ? (
+ <RuleSheet key={sheet.editId || 'new'} app={id} appLabel={label} editId={sheet.editId} initial={sheet.initial}
+ onDone={() => setSheet(null)} />
+ ) : (
+ <View style={{ flexDirection: 'row', justifyContent: 'flex-end' }}>
+ <Button small label={tr('fwrules.add')} onClick={() => setSheet({ initial: { action: blocked ? 'allow' : 'deny' } })} />
+ </View>
+ )}
+ </View>
+ )}
+ </View>
+ );
+}
+
+// Drop-down list to pick another app.
+function AddApp({ apps, exclude, onPick }) {
+ const t = useTheme();
+ const { t: tr } = useLocale();
+ const [open, setOpen] = useState(false);
+ const choices = ['lordos', ...apps.keys()].filter((id) => !exclude.has(id));
+ return (
+ <View style={{ gap: spacing.s, paddingVertical: spacing.s }}>
+ <View style={{ flexDirection: 'row' }}>
+ <Button small label={open ? tr('fwrules.close') : tr('fwrules.addApp')} onClick={() => setOpen(!open)} />
+ </View>
+ {open && (
+ <View style={{ height: 180, borderRadius: 8, border: `1px solid ${t.separator}`, backgroundColor: t.mode === 'dark' ? 'rgba(0,0,0,0.12)' : '#ffffff' }}>
+ <ScrollView style={{ flex: 1, padding: 4 }}>
+ {choices.map((id) => (
+ <View key={id} onClick={() => { setOpen(false); onPick(id); }} style={{ flexDirection: 'row', alignItems: 'center', gap: 8, paddingHorizontal: 8, paddingVertical: 5, borderRadius: 5 }}>
+ <AppIcon a={apps.get(id)} size={20} />
+ <Text style={{ flex: 1, fontSize: typeScale.body, color: t.text, whiteSpace: 'nowrap', overflow: 'hidden', textAlign: 'start' }}>{appLabelOf(tr, apps, id)}</Text>
+ </View>
+ ))}
+ {!choices.length && <Text style={{ fontSize: 12, color: t.textDim, padding: 8 }}>{tr('fwrules.noMoreApps')}</Text>}
+ </ScrollView>
+ </View>
+ )}
+ </View>
+ );
+}
+
+export function FirewallRulesPrivacy() {
+ const t = useTheme();
+ const { t: tr } = useLocale();
+ useStore(firewallState); // redrawn when a rule changes
+ const focus = useStore(firewall.focus);
+ const apps = useAppIndex();
+ const [extra, setExtra] = useState([]); // apps added here that have no rule yet
+ const [open, setOpen] = useState(() => new Set());
+ // "last matched" moves on its own: look again every few seconds while the page is shown
+ const [, tick] = useState(0);
+ useEffect(() => { const id = setInterval(() => tick((x) => x + 1), 5000); return () => clearInterval(id); }, []);
+ // the Monitor's "Rules for this app" opens that app
+ useEffect(() => {
+ if (!focus) return;
+ setExtra((l) => (l.includes(focus) ? l : [...l, focus]));
+ setOpen((s) => new Set([...s, focus]));
+ firewall.focus.set(() => null);
+ }, [focus]);
+ if (!firewall.available()) return null;
+ const withRules = firewall.ruleApps();
+ const ids = [...new Set([...withRules, ...extra])].sort((a, b) => appLabelOf(tr, apps, a).localeCompare(appLabelOf(tr, apps, b)));
+ const toggle = (id) => setOpen((s) => { const n = new Set(s); if (n.has(id)) n.delete(id); else n.add(id); return n; });
+ const foot = (text) => <Text style={{ fontSize: typeScale.caption, color: t.textDim, lineHeight: 1.4, marginHorizontal: spacing.xs, textAlign: 'start' }}>{text}</Text>;
+ return (
+ <View style={{ gap: 6 }}>
+ <Text style={{ fontSize: typeScale.body, fontWeight: 600, color: t.text, paddingHorizontal: spacing.xs, textAlign: 'start' }}>{tr('fwrules.title')}</Text>
+ <GroupBox>
+ {ids.map((id, i) => (
+ <View key={id} style={{ borderTopWidth: i ? 1 : 0, borderTopColor: t.separator }}>
+ <AppRules id={id} apps={apps} open={open.has(id)} onToggle={() => toggle(id)} />
+ </View>
+ ))}
+ {!ids.length && <Text style={{ fontSize: typeScale.body, color: t.textDim, paddingVertical: 9, textAlign: 'start' }}>{tr('fwrules.noApps')}</Text>}
+ <AddApp apps={apps} exclude={new Set(ids)} onPick={(id) => { setExtra((l) => [...l, id]); setOpen((s) => new Set([...s, id])); }} />
+ </GroupBox>
+ {foot(tr('fwrules.precedence'))}
+ {foot(tr('fwrules.dnsNote'))}
+ </View>
+ );
+}
diff --git a/apps/monitor/RuleSheet.jsx b/apps/monitor/RuleSheet.jsx
new file mode 100644
index 0000000..01159a0
--- /dev/null
+++ b/apps/monitor/RuleSheet.jsx
@@ -0,0 +1,123 @@
+// RuleSheet.jsx — the sheet that adds or edits one firewall rule of an app: allow or block, a
+// destination (an exact domain, a wildcard *.example.com, an IP address or a CIDR network), an
+// optional port or range and an optional protocol. Used by Settings → Privacy → "Network rules by
+// app" (inline, under the app's rules) and by the Monitor's Network tab ("Allow / Block this
+// domain", over the window). What the user types is checked as they type with sdk/fwrule.js, the
+// same rules as the C store; lord.fw.addRule / updateRule check it again in C.
+// Layout per docs/DESIGN.md "Dialogs and sheets": 20 px padding, a 15/600 title, 13 px body,
+// the buttons at the end with 12 px above them and one primary action.
+import { View, Text, Button, Segmented, TextInput, useTheme, useLocale, firewall, fwRule, spacing, typeScale, formatNumber } from '@lordos/sdk';
+import { useState } from 'react';
+
+const { checkRule, parseDest } = fwRule;
+
+export const RED = '#ff453a', GREEN = '#30d158';
+
+// What a destination covers, in words (under the field).
+export function destMeaning(tr, dst) {
+ const d = parseDest(dst);
+ if (!d.ok) return null;
+ switch (d.kind) {
+ case 'domain': return tr('fwrules.meaning.domain', { name: d.dst });
+ case 'wildcard': return tr('fwrules.meaning.wildcard', { name: d.domain });
+ case 'address': return tr('fwrules.meaning.address');
+ case 'network': {
+ const bits = (d.fam === 4 ? 32 : 128) - d.prefix;
+ return bits <= 32 ? tr('fwrules.meaning.network', { count: formatNumber(2 ** bits, 0) }) : tr('fwrules.meaning.networkLarge');
+ }
+ case 'lan': return tr('fwrules.meaning.lan');
+ case 'internet': return tr('fwrules.meaning.internet');
+ default: return tr('fwrules.meaning.any');
+ }
+}
+
+// Short label of a destination's kind (the rules list).
+export function destKind(tr, dst) {
+ const d = parseDest(dst);
+ return d.ok ? tr(`fwrules.kind.${d.kind}`) : '';
+}
+
+function Field({ label, children, hint, hintColor }) {
+ const t = useTheme();
+ return (
+ <View style={{ gap: 4 }}>
+ <Text style={{ fontSize: typeScale.callout, fontWeight: 600, color: t.textDim, textAlign: 'start' }}>{label}</Text>
+ {children}
+ {hint ? <Text style={{ fontSize: typeScale.caption, color: hintColor || t.textDim, lineHeight: 1.35, textAlign: 'start' }}>{hint}</Text> : null}
+ </View>
+ );
+}
+
+// initial: { dst, port, proto, action, dir } (dir stays as it is); editId: the rule being edited.
+// suggestions: other destinations to offer as chips (the Monitor offers the exact name and its
+// *.parent). onDone(id | null): saved (the new id) or cancelled.
+export function RuleSheet({ app, appLabel, initial = {}, editId, suggestions = [], onDone, overlay, note }) {
+ const t = useTheme();
+ const { t: tr } = useLocale();
+ const [f, setF] = useState(() => ({ dst: initial.dst || '', port: initial.port || '', proto: initial.proto || '', action: initial.action || 'deny', dir: initial.dir || 'out' }));
+ const [failed, setFailed] = useState(false);
+ const put = (p) => { setFailed(false); setF((o) => ({ ...o, ...p })); };
+ const res = checkRule(f);
+ const dstErr = !res.ok && res.field === 'dst' && f.dst.trim() ? tr(`fwrules.err.${res.error}`) : null;
+ const portErr = !res.ok && res.field === 'port' ? tr('fwrules.err.port') : null;
+ const meaning = res.ok ? destMeaning(tr, res.rule.dst) : null;
+ const save = () => {
+ if (!res.ok) return;
+ const rule = { app, ...res.rule };
+ const id = editId ? firewall.updateRule(editId, res.rule) : firewall.addRule(rule);
+ if (id) onDone(id); else setFailed(true);
+ };
+ const title = editId ? tr('fwrules.sheet.editTitle') : tr(f.action === 'allow' ? 'fwrules.sheet.allowTitle' : 'fwrules.sheet.blockTitle');
+ const box = (
+ <View style={{ gap: spacing.l, padding: spacing.xl, borderRadius: 12, width: overlay ? 440 : undefined,
+ backgroundColor: overlay ? (t.mode === 'dark' ? '#2a2a2f' : '#ffffff') : t.mode === 'dark' ? 'rgba(255,255,255,0.04)' : 'rgba(0,0,0,0.025)',
+ border: `1px solid ${t.separator}`, boxShadow: overlay ? '0 18px 50px rgba(0,0,0,0.35)' : 'none' }}>
+ <View style={{ gap: 3 }}>
+ <Text style={{ fontSize: typeScale.headline, fontWeight: 600, color: t.text, textAlign: 'start' }}>{title}</Text>
+ {appLabel ? <Text style={{ fontSize: typeScale.callout, color: t.textDim, textAlign: 'start' }}>{tr('fwrules.sheet.forApp', { app: appLabel })}</Text> : null}
+ </View>
+ <Field label={tr('fwrules.field.action')}>
+ <View style={{ flexDirection: 'row' }}>
+ <Segmented small value={f.action} onChange={(action) => put({ action })}
+ options={[['allow', tr('fwrules.allow')], ['deny', tr('fwrules.block')]]} />
+ </View>
+ </Field>
+ <Field label={tr('fwrules.field.dst')} hint={dstErr || meaning || tr('fwrules.field.dstHint')} hintColor={dstErr ? RED : null}>
+ <TextInput value={f.dst} autoFocus={!initial.dst} placeholder={tr('fwrules.field.dstPlaceholder')} onChange={(dst) => put({ dst })} onSubmit={save}
+ onCancel={() => onDone(null)} style={{ direction: 'ltr' }} />
+ {suggestions.length > 1 ? (
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 6 }}>
+ {suggestions.map((s) => (
+ <View key={s} onClick={() => put({ dst: s })} style={{ height: 22, paddingHorizontal: 9, borderRadius: 11, justifyContent: 'center',
+ backgroundColor: f.dst === s ? t.accent : t.control }}>
+ <Text style={{ fontSize: typeScale.caption, color: f.dst === s ? '#fff' : t.text, fontFamily: 'monospace', direction: 'ltr' }}>{s}</Text>
+ </View>
+ ))}
+ </View>
+ ) : null}
+ </Field>
+ <View style={{ flexDirection: 'row', gap: spacing.l, flexWrap: 'wrap' }}>
+ <Field label={tr('fwrules.field.port')} hint={portErr || tr('fwrules.field.portHint')} hintColor={portErr ? RED : null}>
+ <TextInput value={f.port} placeholder={tr('fwrules.any')} onChange={(port) => put({ port })} onSubmit={save} onCancel={() => onDone(null)} style={{ width: 130, direction: 'ltr' }} />
+ </Field>
+ <Field label={tr('fwrules.field.proto')}>
+ <View style={{ flexDirection: 'row', height: 28, alignItems: 'center' }}>
+ <Segmented small value={f.proto} onChange={(proto) => put({ proto })} options={[['', tr('fwrules.any')], ['tcp', 'TCP'], ['udp', 'UDP']]} />
+ </View>
+ </Field>
+ </View>
+ {note ? <Text style={{ fontSize: typeScale.caption, color: t.textDim, lineHeight: 1.4, textAlign: 'start' }}>{note}</Text> : null}
+ {failed ? <Text style={{ fontSize: typeScale.caption, color: RED, textAlign: 'start' }}>{tr('fwrules.err.save')}</Text> : null}
+ <View style={{ flexDirection: 'row', justifyContent: 'flex-end', gap: spacing.s, marginTop: spacing.xs }}>
+ <Button label={tr('fwrules.cancel')} onClick={() => onDone(null)} />
+ <Button primary label={editId ? tr('fwrules.save') : tr('fwrules.addRule')} disabled={!res.ok} onClick={save} />
+ </View>
+ </View>
+ );
+ if (!overlay) return box;
+ return (
+ <View style={{ position: 'absolute', left: 0, top: 0, right: 0, bottom: 0, alignItems: 'center', justifyContent: 'center', backgroundColor: 'rgba(0,0,0,0.28)' }}>
+ {box}
+ </View>
+ );
+}
diff --git a/apps/monitor/index.jsx b/apps/monitor/index.jsx
index 235718c..8c91763 100644
--- a/apps/monitor/index.jsx
+++ b/apps/monitor/index.jsx
@@ -14,6 +14,7 @@ import { Glyph, MonitorIcon } from './icons.jsx';
import { NetworkTab } from './Network.jsx';
import { MonitorPrivacy } from './Privacy.jsx';
import { FirewallPrivacy } from './Firewall.jsx';
+import { FirewallRulesPrivacy } from './FwRules.jsx';
import { CoolingTab } from './Cooling.jsx';
export function Icon({ size }) { return <MonitorIcon size={size} />; }
@@ -25,6 +26,8 @@ export const C = { mem: '#8b5cf6', cache: '#c4b5fd', rx: '#22c55e', tx: '#f97316
if (typeof sdk.registerPrivacySection === 'function') sdk.registerPrivacySection({ id: 'monitor', order: 10, Component: MonitorPrivacy });
// … and "App network": trusted and restricted apps (lord.fw, docs/FIREWALL.md)
if (typeof sdk.registerPrivacySection === 'function') sdk.registerPrivacySection({ id: 'firewall', order: 11, Component: FirewallPrivacy });
+// … and the rules of each app: domains, addresses and networks, with the app's default
+if (typeof sdk.registerPrivacySection === 'function') sdk.registerPrivacySection({ id: 'fwrules', order: 12, Component: FirewallRulesPrivacy });
// ---- formats ----
export const fmt = {
diff --git a/assets/locales/en/fwrules.json b/assets/locales/en/fwrules.json
new file mode 100644
index 0000000..b898c1f
--- /dev/null
+++ b/assets/locales/en/fwrules.json
@@ -0,0 +1,93 @@
+{
+ "title": "Network rules by app",
+ "noApps": "No app has its own rules yet.",
+ "addApp": "Add app…",
+ "close": "Close",
+ "noMoreApps": "Every app already has rules here.",
+ "precedence": "There is no order to set: when several rules match a connection, the most specific one decides. An exact domain beats *.domain, a longer wildcard beats a shorter one, an address beats its network, and any of them beats the app's default. With equally specific rules, the one with a port beats any port, a protocol beats any protocol, and Block beats Allow. The list shows each app's rules in that order.",
+ "dnsNote": "Domains are matched with the names the system resolver returned for each address. An app that uses its own encrypted DNS (for example DNS over HTTPS inside a browser) asks without the system, so its names can't be matched: a domain rule doesn't see those connections, while address and network rules, the app's default and its restrictions still apply.",
+ "count": {
+ "one": "{count} rule",
+ "other": "{count} rules"
+ },
+ "default": "Default for this app",
+ "default.allow": "Allow all",
+ "default.deny": "Block all except rules",
+ "default.allowShort": "allows everything else",
+ "default.denyShort": "blocks everything else",
+ "default.allowHint": "What no rule covers follows the firewall mode.",
+ "default.denyHint": "Only what an Allow rule covers can connect.",
+ "notEnforceable": "This app has no scope of its own (it was not opened from LordOS), so its rules are kept but not enforced.",
+ "empty": "No rules for this app.",
+ "add": "Add rule…",
+ "edit": "Edit",
+ "delete": "Delete",
+ "confirmDelete": "Delete the rule for {dst}?",
+ "cancel": "Cancel",
+ "save": "Save",
+ "addRule": "Add rule",
+ "allow": "Allow",
+ "block": "Block",
+ "any": "Any",
+ "anyPort": "any port",
+ "anyProto": "any protocol",
+ "portValue": "port {port}",
+ "incoming": "incoming",
+ "lastMatch.never": "not matched yet",
+ "lastMatch.now": "matched just now",
+ "lastMatch.minutes": {
+ "one": "matched {count} minute ago",
+ "other": "matched {count} minutes ago"
+ },
+ "lastMatch.today": "matched today at {time}",
+ "lastMatch.date": "matched on {date} at {time}",
+ "kind.domain": "exact domain",
+ "kind.wildcard": "domain and subdomains",
+ "kind.address": "address",
+ "kind.network": "network",
+ "kind.lan": "local network",
+ "kind.internet": "internet",
+ "kind.any": "everything",
+ "meaning.domain": "Only {name}, not its subdomains.",
+ "meaning.wildcard": "{name} and every name under it (www.{name}, a.b.{name}…).",
+ "meaning.address": "This address only.",
+ "meaning.network": {
+ "one": "A network of {count} address.",
+ "other": "A network of {count} addresses."
+ },
+ "meaning.networkLarge": "A large IPv6 network.",
+ "meaning.lan": "Every local address (the LAN, this computer).",
+ "meaning.internet": "Everything outside the local network.",
+ "meaning.any": "Every destination.",
+ "field.action": "Action",
+ "field.dst": "Destination",
+ "field.dstHint": "A domain (example.com), every subdomain (*.example.com), an address (192.0.2.7) or a network (10.0.0.0/8, 2001:db8::/32).",
+ "field.dstPlaceholder": "example.com, *.example.com, 192.0.2.0/24",
+ "field.port": "Port",
+ "field.portHint": "Empty for any; one (443) or a range (8000-8080).",
+ "field.proto": "Protocol",
+ "err.empty": "Type a destination.",
+ "err.domain": "Not a valid domain: letters, digits, hyphens and dots, labels up to 63 characters. International names go in punycode (xn--…).",
+ "err.wildcard": "A wildcard is written *. and a domain, such as *.example.com.",
+ "err.address": "Not a valid IPv4 or IPv6 address.",
+ "err.prefix": "The prefix after / must be 0–32 for IPv4 or 0–128 for IPv6.",
+ "err.hostBits": "The address has bits set outside the prefix: write the network's first address (for example 10.0.0.0/8).",
+ "err.isDefault": "A rule for every destination is the app's default: set it above.",
+ "err.port": "Ports go from 1 to 65535; a range is low-high.",
+ "err.save": "The rule could not be saved.",
+ "sheet.editTitle": "Edit rule",
+ "sheet.allowTitle": "Allow a destination",
+ "sheet.blockTitle": "Block a destination",
+ "sheet.forApp": "For {app}",
+ "sheet.nameNote": "The name is the one the system resolver returned for this connection's address.",
+ "sheet.noName": "The system resolver reported no name for this address (or the app found it with its own DNS), so the rule is prefilled with the address. You can type a domain instead.",
+ "allowThisDomain": "Allow this domain",
+ "blockThisDomain": "Block this domain",
+ "allowThisAddress": "Allow this address",
+ "blockThisAddress": "Block this address",
+ "appRulesLink": {
+ "one": "Rules for this app ({count}) ›",
+ "other": "Rules for this app ({count}) ›"
+ },
+ "pickAddress": "Select an address to allow or block it for this app."
+}
diff --git a/assets/locales/es/fwrules.json b/assets/locales/es/fwrules.json
new file mode 100644
index 0000000..6e22d52
--- /dev/null
+++ b/assets/locales/es/fwrules.json
@@ -0,0 +1,93 @@
+{
+ "title": "Reglas de red por app",
+ "noApps": "Ninguna app tiene reglas propias todavía.",
+ "addApp": "Agregar app…",
+ "close": "Cerrar",
+ "noMoreApps": "Todas las apps ya tienen reglas acá.",
+ "precedence": "No hay un orden que fijar: cuando varias reglas coinciden con una conexión, decide la más específica. Un dominio exacto le gana a *.dominio, un comodín más largo a uno más corto, una dirección a su red, y cualquiera de ellas al valor por defecto de la app. Entre reglas igual de específicas, la que tiene puerto le gana a cualquier puerto, un protocolo a cualquier protocolo, y Bloquear a Permitir. La lista muestra las reglas de cada app en ese orden.",
+ "dnsNote": "Los dominios se comparan con los nombres que el resolvedor del sistema devolvió para cada dirección. Una app que usa su propio DNS cifrado (por ejemplo DNS sobre HTTPS dentro de un navegador) pregunta sin pasar por el sistema, así que sus nombres no se pueden comparar: una regla de dominio no ve esas conexiones, mientras que las reglas de direcciones y redes, el valor por defecto de la app y sus restricciones siguen aplicándose.",
+ "count": {
+ "one": "{count} regla",
+ "other": "{count} reglas"
+ },
+ "default": "Por defecto para esta app",
+ "default.allow": "Permitir todo",
+ "default.deny": "Bloquear todo salvo las reglas",
+ "default.allowShort": "permite todo lo demás",
+ "default.denyShort": "bloquea todo lo demás",
+ "default.allowHint": "Lo que ninguna regla cubre sigue el modo del firewall.",
+ "default.denyHint": "Solo puede conectarse lo que cubra una regla Permitir.",
+ "notEnforceable": "Esta app no tiene un ámbito propio (no se abrió desde LordOS), así que sus reglas se guardan pero no se aplican.",
+ "empty": "Esta app no tiene reglas.",
+ "add": "Agregar regla…",
+ "edit": "Editar",
+ "delete": "Eliminar",
+ "confirmDelete": "¿Eliminar la regla de {dst}?",
+ "cancel": "Cancelar",
+ "save": "Guardar",
+ "addRule": "Agregar regla",
+ "allow": "Permitir",
+ "block": "Bloquear",
+ "any": "Cualquiera",
+ "anyPort": "cualquier puerto",
+ "anyProto": "cualquier protocolo",
+ "portValue": "puerto {port}",
+ "incoming": "entrante",
+ "lastMatch.never": "todavía sin coincidencias",
+ "lastMatch.now": "coincidió recién",
+ "lastMatch.minutes": {
+ "one": "coincidió hace {count} minuto",
+ "other": "coincidió hace {count} minutos"
+ },
+ "lastMatch.today": "coincidió hoy a las {time}",
+ "lastMatch.date": "coincidió el {date} a las {time}",
+ "kind.domain": "dominio exacto",
+ "kind.wildcard": "dominio y subdominios",
+ "kind.address": "dirección",
+ "kind.network": "red",
+ "kind.lan": "red local",
+ "kind.internet": "internet",
+ "kind.any": "todo",
+ "meaning.domain": "Solo {name}, no sus subdominios.",
+ "meaning.wildcard": "{name} y todos los nombres debajo (www.{name}, a.b.{name}…).",
+ "meaning.address": "Solo esta dirección.",
+ "meaning.network": {
+ "one": "Una red de {count} dirección.",
+ "other": "Una red de {count} direcciones."
+ },
+ "meaning.networkLarge": "Una red IPv6 grande.",
+ "meaning.lan": "Todas las direcciones locales (la LAN, este equipo).",
+ "meaning.internet": "Todo lo que está fuera de la red local.",
+ "meaning.any": "Cualquier destino.",
+ "field.action": "Acción",
+ "field.dst": "Destino",
+ "field.dstHint": "Un dominio (example.com), todos sus subdominios (*.example.com), una dirección (192.0.2.7) o una red (10.0.0.0/8, 2001:db8::/32).",
+ "field.dstPlaceholder": "example.com, *.example.com, 192.0.2.0/24",
+ "field.port": "Puerto",
+ "field.portHint": "Vacío para cualquiera; uno (443) o un rango (8000-8080).",
+ "field.proto": "Protocolo",
+ "err.empty": "Escribí un destino.",
+ "err.domain": "No es un dominio válido: letras, dígitos, guiones y puntos, etiquetas de hasta 63 caracteres. Los nombres internacionales van en punycode (xn--…).",
+ "err.wildcard": "Un comodín se escribe *. y un dominio, como *.example.com.",
+ "err.address": "No es una dirección IPv4 o IPv6 válida.",
+ "err.prefix": "El prefijo después de / va de 0 a 32 en IPv4 o de 0 a 128 en IPv6.",
+ "err.hostBits": "La dirección tiene bits fuera del prefijo: escribí la primera dirección de la red (por ejemplo 10.0.0.0/8).",
+ "err.isDefault": "Una regla para cualquier destino es el valor por defecto de la app: elegilo arriba.",
+ "err.port": "Los puertos van de 1 a 65535; un rango es menor-mayor.",
+ "err.save": "No se pudo guardar la regla.",
+ "sheet.editTitle": "Editar regla",
+ "sheet.allowTitle": "Permitir un destino",
+ "sheet.blockTitle": "Bloquear un destino",
+ "sheet.forApp": "Para {app}",
+ "sheet.nameNote": "El nombre es el que el resolvedor del sistema devolvió para la dirección de esta conexión.",
+ "sheet.noName": "El resolvedor del sistema no informó un nombre para esta dirección (o la app lo obtuvo con su propio DNS), así que la regla viene con la dirección. Podés escribir un dominio en su lugar.",
+ "allowThisDomain": "Permitir este dominio",
+ "blockThisDomain": "Bloquear este dominio",
+ "allowThisAddress": "Permitir esta dirección",
+ "blockThisAddress": "Bloquear esta dirección",
+ "appRulesLink": {
+ "one": "Reglas de esta app ({count}) ›",
+ "other": "Reglas de esta app ({count}) ›"
+ },
+ "pickAddress": "Elegí una dirección para permitirla o bloquearla para esta app."
+}
diff --git a/assets/locales/pt/fwrules.json b/assets/locales/pt/fwrules.json
new file mode 100644
index 0000000..20ea13a
--- /dev/null
+++ b/assets/locales/pt/fwrules.json
@@ -0,0 +1,93 @@
+{
+ "title": "Regras de rede por app",
+ "noApps": "Nenhum app tem regras próprias ainda.",
+ "addApp": "Adicionar app…",
+ "close": "Fechar",
+ "noMoreApps": "Todos os apps já têm regras aqui.",
+ "precedence": "Não há uma ordem para definir: quando várias regras coincidem com uma conexão, decide a mais específica. Um domínio exato vence *.domínio, um curinga mais longo vence um mais curto, um endereço vence a sua rede, e qualquer uma delas vence o padrão do app. Entre regras igualmente específicas, a que tem porta vence qualquer porta, um protocolo vence qualquer protocolo, e Bloquear vence Permitir. A lista mostra as regras de cada app nessa ordem.",
+ "dnsNote": "Os domínios são comparados com os nomes que o resolvedor do sistema devolveu para cada endereço. Um app que usa o seu próprio DNS criptografado (por exemplo DNS sobre HTTPS dentro de um navegador) pergunta sem passar pelo sistema, então os seus nomes não podem ser comparados: uma regra de domínio não vê essas conexões, enquanto as regras de endereços e redes, o padrão do app e as suas restrições continuam valendo.",
+ "count": {
+ "one": "{count} regra",
+ "other": "{count} regras"
+ },
+ "default": "Padrão para este app",
+ "default.allow": "Permitir tudo",
+ "default.deny": "Bloquear tudo exceto as regras",
+ "default.allowShort": "permite todo o resto",
+ "default.denyShort": "bloqueia todo o resto",
+ "default.allowHint": "O que nenhuma regra cobre segue o modo do firewall.",
+ "default.denyHint": "Só pode se conectar o que uma regra Permitir cobrir.",
+ "notEnforceable": "Este app não tem um escopo próprio (não foi aberto pelo LordOS), então as suas regras são guardadas mas não aplicadas.",
+ "empty": "Este app não tem regras.",
+ "add": "Adicionar regra…",
+ "edit": "Editar",
+ "delete": "Excluir",
+ "confirmDelete": "Excluir a regra de {dst}?",
+ "cancel": "Cancelar",
+ "save": "Salvar",
+ "addRule": "Adicionar regra",
+ "allow": "Permitir",
+ "block": "Bloquear",
+ "any": "Qualquer",
+ "anyPort": "qualquer porta",
+ "anyProto": "qualquer protocolo",
+ "portValue": "porta {port}",
+ "incoming": "entrada",
+ "lastMatch.never": "ainda sem coincidências",
+ "lastMatch.now": "coincidiu agora mesmo",
+ "lastMatch.minutes": {
+ "one": "coincidiu há {count} minuto",
+ "other": "coincidiu há {count} minutos"
+ },
+ "lastMatch.today": "coincidiu hoje às {time}",
+ "lastMatch.date": "coincidiu em {date} às {time}",
+ "kind.domain": "domínio exato",
+ "kind.wildcard": "domínio e subdomínios",
+ "kind.address": "endereço",
+ "kind.network": "rede",
+ "kind.lan": "rede local",
+ "kind.internet": "internet",
+ "kind.any": "tudo",
+ "meaning.domain": "Só {name}, não os seus subdomínios.",
+ "meaning.wildcard": "{name} e todos os nomes abaixo dele (www.{name}, a.b.{name}…).",
+ "meaning.address": "Só este endereço.",
+ "meaning.network": {
+ "one": "Uma rede de {count} endereço.",
+ "other": "Uma rede de {count} endereços."
+ },
+ "meaning.networkLarge": "Uma rede IPv6 grande.",
+ "meaning.lan": "Todos os endereços locais (a LAN, este computador).",
+ "meaning.internet": "Tudo o que está fora da rede local.",
+ "meaning.any": "Qualquer destino.",
+ "field.action": "Ação",
+ "field.dst": "Destino",
+ "field.dstHint": "Um domínio (example.com), todos os subdomínios (*.example.com), um endereço (192.0.2.7) ou uma rede (10.0.0.0/8, 2001:db8::/32).",
+ "field.dstPlaceholder": "example.com, *.example.com, 192.0.2.0/24",
+ "field.port": "Porta",
+ "field.portHint": "Vazio para qualquer; uma (443) ou um intervalo (8000-8080).",
+ "field.proto": "Protocolo",
+ "err.empty": "Digite um destino.",
+ "err.domain": "Não é um domínio válido: letras, dígitos, hifens e pontos, rótulos de até 63 caracteres. Nomes internacionais vão em punycode (xn--…).",
+ "err.wildcard": "Um curinga se escreve *. e um domínio, como *.example.com.",
+ "err.address": "Não é um endereço IPv4 ou IPv6 válido.",
+ "err.prefix": "O prefixo depois de / vai de 0 a 32 no IPv4 ou de 0 a 128 no IPv6.",
+ "err.hostBits": "O endereço tem bits fora do prefixo: escreva o primeiro endereço da rede (por exemplo 10.0.0.0/8).",
+ "err.isDefault": "Uma regra para qualquer destino é o padrão do app: defina-o acima.",
+ "err.port": "As portas vão de 1 a 65535; um intervalo é menor-maior.",
+ "err.save": "Não foi possível salvar a regra.",
+ "sheet.editTitle": "Editar regra",
+ "sheet.allowTitle": "Permitir um destino",
+ "sheet.blockTitle": "Bloquear um destino",
+ "sheet.forApp": "Para {app}",
+ "sheet.nameNote": "O nome é o que o resolvedor do sistema devolveu para o endereço desta conexão.",
+ "sheet.noName": "O resolvedor do sistema não informou um nome para este endereço (ou o app o obteve com o seu próprio DNS), então a regra vem com o endereço. Você pode digitar um domínio no lugar.",
+ "allowThisDomain": "Permitir este domínio",
+ "blockThisDomain": "Bloquear este domínio",
+ "allowThisAddress": "Permitir este endereço",
+ "blockThisAddress": "Bloquear este endereço",
+ "appRulesLink": {
+ "one": "Regras deste app ({count}) ›",
+ "other": "Regras deste app ({count}) ›"
+ },
+ "pickAddress": "Escolha um endereço para permiti-lo ou bloqueá-lo para este app."
+}