Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Say when ufw likely blocks a phone on the Wi-Fi pairing panel (#7523)
Milind Soni46826e1b7346
diff --git a/companion/src/control.ts b/companion/src/control.tsindex c796325cd5..8d14b0e5cb 100644--- a/companion/src/control.ts+++ b/companion/src/control.ts@@ -12,6 +12,7 @@ import { companionEndpointCandidates, hostedCompanionUrl } from "./endpoints.ts"import { directRoutes, routedAddresses } from "./direct-routes.ts";import { lanInterfaces, tailnetName, tailscaleAddress } from "./listener.ts";import { defaultHostName } from "./mdns.ts";+import { hostFirewall, type HostFirewall } from "./host-firewall.ts";import { publicNetworks } from "./windows-network.ts";export const CONTROL_TOKEN_HEADER = "x-openmausbot-control-token";@@ -37,6 +38,8 @@ export interface ControlOptions {/** `PUT /routes` from the desktop app: which direct ways in are on, and the tailnet name it learned. */setDirectRoutes?: (body: unknown) => boolean;publicNetworks?: () => ReadonlySet<string>;+ /** Linux: a host firewall that likely drops a phone on the device port. */+ hostFirewall?: (port: number) => HostFirewall | null;/** End-to-end status; absent or `enabled: false` while it is off. */e2e?: () => E2EStatus;/** The best live encrypted route of each connected device. */@@ -202,6 +205,8 @@ export function companionState(options: Omit<ControlOptions, "controlToken">) {const publicNetwork = pairing && lead && (options.publicNetworks ?? publicNetworks)().has(lead.name)? lead.name: null;+ // Read from /etc only while pairing is open, and only when a Wi-Fi address is offered.+ const firewall = pairing && lead ? (options.hostFirewall ?? hostFirewall)(options.companionPort) : null;const secretPublicKey = options.secretPublicKey?.() ?? null;const routes = directRoutes();return {@@ -215,6 +220,8 @@ export function companionState(options: Omit<ControlOptions, "controlToken">) {lan: lead?.address ?? null,// Windows has this network as Public, so its firewall likely drops a phone....(publicNetwork ? { publicNetwork } : {}),+ // ufw is on, its rules are readable, and none lets the device port in.+ ...(firewall ? { hostFirewall: firewall } : {}),hosts: hostCandidates(addresses, name),endpoints: companionEndpointCandidates(options.companionPort,diff --git a/companion/src/host-firewall.ts b/companion/src/host-firewall.tsnew file mode 100644index 0000000000..4df3ede686--- /dev/null+++ b/companion/src/host-firewall.ts@@ -0,0 +1,95 @@+// Linux: ufw turned on with its default "deny incoming" drops a phone's connection to the device port, and nothing+// on the phone can tell that from a computer that is off. This only reads the files ufw keeps under /etc, so the+// pairing panel can say what to allow. It never runs `ufw status` (that needs root) and never changes anything.+import { readFileSync } from "node:fs";++export type HostFirewall = "ufw";++const UFW_CONF = "/etc/ufw/ufw.conf";+const UFW_DEFAULTS = "/etc/default/ufw";+/** World-readable on some distributions (Arch), 0640 root on others (ufw's own installer): unreadable means "can't+ * tell", and then nothing is shown, since the person may well have allowed the port already. */+const UFW_USER_RULES = "/etc/ufw/user.rules";++/** `ENABLED=yes`: ufw starts at boot (`ufw enable` writes it). */+export function ufwEnabled(conf: string | null): boolean {+ return /^[ \t]*ENABLED[ \t]*=[ \t]*["']?yes["']?[ \t]*$/im.test(conf ?? "");+}++/** `DEFAULT_INPUT_POLICY` is DROP or REJECT. Unset or unreadable counts as dropping: that is ufw's own default. */+export function ufwDropsIncoming(defaults: string | null): boolean {+ const policy = /^[ \t]*DEFAULT_INPUT_POLICY[ \t]*=[ \t]*["']?([A-Za-z]+)/m.exec(defaults ?? "")?.[1];+ return policy?.toUpperCase() !== "ACCEPT";+}++const portListed = (ports: string, port: number): boolean =>+ ports === "any" ||+ ports.split(",").some((part) => {+ const [low, high] = part.split(":").map(Number);+ return high === undefined ? low === port : low <= port && port <= high;+ });++/**+ * Whether a rule in user.rules lets TCP in on `port`, from its `### tuple ###` lines: action, protocol, destination+ * port, destination, source port, source, [two application names,] and the direction last (`in`, `in_wlan0`). The+ * older 6- and 8-field lines have no direction, and ufw reads them as incoming. A rule limited to some sources still+ * counts: this only decides whether to show a hint. Null when the rules can't be read.+ */+export function ufwAllowsPort(rules: string | null, port: number): boolean | null {+ if (rules === null) return null;+ return rules.split(/\r?\n/).some((line) => {+ const tuple = /^### tuple ###\s*(.*)$/.exec(line)?.[1]?.split(" comment=")[0]?.trim();+ if (!tuple) return false;+ const fields = tuple.split(/\s+/);+ if (fields.length < 6 || fields.length > 9) return false;+ const [action, protocol, ports] = fields;+ const direction = fields.length % 2 === 0 ? "in" : fields[fields.length - 1];+ return /^(allow|limit)(_log(-all)?)?$/.test(action) &&+ (protocol === "tcp" || protocol === "any") &&+ (direction === "in" || direction.startsWith("in_")) &&+ portListed(ports, port);+ });+}++type ReadText = (path: string) => string | null;++const readText: ReadText = (path) => {+ try {+ return readFileSync(path, "utf8");+ } catch {+ return null;+ }+};++/** "ufw" when ufw is on, drops what it wasn't told to let in, and its rules are readable and none allows `port`. */+export function ufwBlocksPort(port: number, read: ReadText = readText): boolean {+ if (!ufwEnabled(read(UFW_CONF)) || !ufwDropsIncoming(read(UFW_DEFAULTS))) return false;+ return ufwAllowsPort(read(UFW_USER_RULES), port) === false;+}++/** How old an answer may be: someone who runs the allow command sees the hint go within this long. */+const MAX_AGE_MS = 10_000;++/** Three small file reads at most every ten seconds, only on Linux; null elsewhere and whenever it can't tell. */+export function createHostFirewallCheck({+ platform = process.platform,+ read = readText,+ now = Date.now,+ maxAgeMs = MAX_AGE_MS,+}: {+ platform?: NodeJS.Platform;+ read?: ReadText;+ now?: () => number;+ maxAgeMs?: number;+} = {}): (port: number) => HostFirewall | null {+ let known: { port: number; at: number; answer: HostFirewall | null } | null = null;+ return (port) => {+ if (platform !== "linux") return null;+ if (known && known.port === port && now() - known.at < maxAgeMs) return known.answer;+ const answer = ufwBlocksPort(port, read) ? "ufw" : null;+ known = { port, at: now(), answer };+ return answer;+ };+}++export const hostFirewall = createHostFirewallCheck();diff --git a/companion/test/host-firewall.test.ts b/companion/test/host-firewall.test.tsnew file mode 100644index 0000000000..336af858f9--- /dev/null+++ b/companion/test/host-firewall.test.ts@@ -0,0 +1,141 @@+import { describe, expect, it, vi } from "vitest";++// A laptop on Wi-Fi with Docker installed: the QR leads with the Wi-Fi address.+vi.mock("node:os", async (original) => ({+ ...await original<typeof import("node:os")>(),+ networkInterfaces: () => ({+ docker0: [{ family: "IPv4", internal: false, address: "172.17.0.1" }],+ wlan0: [{ family: "IPv4", internal: false, address: "192.168.1.40" }],+ }),+}));++import { companionState } from "../src/control.ts";+import { DeviceRegistry } from "../src/devices.ts";+import { createHostFirewallCheck, ufwAllowsPort, ufwBlocksPort, ufwDropsIncoming, ufwEnabled } from "../src/host-firewall.ts";++const ENABLED = "# /etc/ufw/ufw.conf\n#\n\n# Set to yes to start on boot.\nENABLED=yes\n\nLOGLEVEL=low\n";+const DEFAULTS = 'IPV6=yes\nDEFAULT_INPUT_POLICY="DROP"\nDEFAULT_OUTPUT_POLICY="ACCEPT"\n';+// What `ufw default deny incoming` plus two LocalSend-style allows leave in user.rules.+const RULES = [+ "*filter",+ ":ufw-user-input - [0:0]",+ "### RULES ###",+ "",+ "### tuple ### allow udp 53317 0.0.0.0/0 any 0.0.0.0/0 in",+ "-A ufw-user-input -p udp --dport 53317 -j ACCEPT",+ "",+ "### tuple ### allow tcp 53317 0.0.0.0/0 any 0.0.0.0/0 in",+ "-A ufw-user-input -p tcp --dport 53317 -j ACCEPT",+ "",+ "### tuple ### allow udp 53 172.17.0.1 any 172.16.0.0/12 in comment=616c6c6f772d646f636b65722d646e73",+ "",+ "### END RULES ###",+].join("\n");++const files = (over: Record<string, string | null> = {}) => {+ const all: Record<string, string | null> = {+ "/etc/ufw/ufw.conf": ENABLED,+ "/etc/default/ufw": DEFAULTS,+ "/etc/ufw/user.rules": RULES,+ ...over,+ };+ return vi.fn((path: string) => all[path] ?? null);+};++describe("ufw's files", () => {+ it("reads ENABLED and the default input policy", () => {+ expect(ufwEnabled(ENABLED)).toBe(true);+ expect(ufwEnabled("ENABLED=no\n")).toBe(false);+ expect(ufwEnabled(' ENABLED="yes" ')).toBe(true);+ expect(ufwEnabled("#ENABLED=yes\n")).toBe(false);+ expect(ufwEnabled(null)).toBe(false);+ expect(ufwDropsIncoming(DEFAULTS)).toBe(true);+ expect(ufwDropsIncoming('DEFAULT_INPUT_POLICY="REJECT"')).toBe(true);+ expect(ufwDropsIncoming('DEFAULT_INPUT_POLICY="ACCEPT"')).toBe(false);+ expect(ufwDropsIncoming(null)).toBe(true);+ });++ it("finds a rule that lets TCP in on the port, and only that", () => {+ expect(ufwAllowsPort(RULES, 8810)).toBe(false);+ expect(ufwAllowsPort(RULES, 53317)).toBe(true);+ expect(ufwAllowsPort(null, 8810)).toBeNull();+ const rule = (tuple: string) => `${RULES}\n### tuple ### ${tuple}\n`;+ expect(ufwAllowsPort(rule("allow tcp 8810 0.0.0.0/0 any 0.0.0.0/0 in"), 8810)).toBe(true);+ expect(ufwAllowsPort(rule("allow any 8810 0.0.0.0/0 any 192.168.0.0/16 in"), 8810)).toBe(true);+ expect(ufwAllowsPort(rule("limit tcp 8000:9000 0.0.0.0/0 any 0.0.0.0/0 in_wlan0"), 8810)).toBe(true);+ expect(ufwAllowsPort(rule("allow_log tcp 80,8810 0.0.0.0/0 any 0.0.0.0/0 in"), 8810)).toBe(true);+ expect(ufwAllowsPort(rule("allow tcp 8810 0.0.0.0/0 any 0.0.0.0/0 MausBot - in"), 8810)).toBe(true);+ expect(ufwAllowsPort(rule("allow tcp any 0.0.0.0/0 any 192.168.1.0/24 in"), 8810)).toBe(true);+ expect(ufwAllowsPort(rule("allow udp 8810 0.0.0.0/0 any 0.0.0.0/0 in"), 8810)).toBe(false);+ expect(ufwAllowsPort(rule("deny tcp 8810 0.0.0.0/0 any 0.0.0.0/0 in"), 8810)).toBe(false);+ expect(ufwAllowsPort(rule("allow tcp 8810 0.0.0.0/0 any 0.0.0.0/0 out"), 8810)).toBe(false);+ expect(ufwAllowsPort(rule("allow tcp 8811 0.0.0.0/0 any 0.0.0.0/0 in"), 8810)).toBe(false);+ // Older lines with no direction (6 fields, or 8 with application names): ufw reads them as incoming.+ expect(ufwAllowsPort(rule("allow tcp 8810 0.0.0.0/0 any 0.0.0.0/0"), 8810)).toBe(true);+ expect(ufwAllowsPort(rule("allow tcp 8810 0.0.0.0/0 any 0.0.0.0/0 MausBot -"), 8810)).toBe(true);+ expect(ufwAllowsPort(rule("allow udp 8810 0.0.0.0/0 any 0.0.0.0/0"), 8810)).toBe(false);+ expect(ufwAllowsPort(rule("allow tcp 8810 0.0.0.0/0 any"), 8810)).toBe(false);+ });++ it("blocks only when ufw is on, drops by default, and no readable rule allows the port", () => {+ expect(ufwBlocksPort(8810, files())).toBe(true);+ // user.rules is root-only (0640) where ufw's own installer set it up: can't tell, so nothing is said.+ expect(ufwBlocksPort(8810, files({ "/etc/ufw/user.rules": null }))).toBe(false);+ expect(ufwBlocksPort(8810, files({ "/etc/ufw/ufw.conf": "ENABLED=no\n" }))).toBe(false);+ expect(ufwBlocksPort(8810, files({ "/etc/ufw/ufw.conf": null }))).toBe(false);+ expect(ufwBlocksPort(8810, files({ "/etc/default/ufw": 'DEFAULT_INPUT_POLICY="ACCEPT"\n' }))).toBe(false);+ expect(ufwBlocksPort(8810, files({ "/etc/ufw/user.rules": `${RULES}\n### tuple ### allow tcp 8810 0.0.0.0/0 any 0.0.0.0/0 in\n` }))).toBe(false);+ });+});++describe("createHostFirewallCheck", () => {+ it("never reads anything off Linux", () => {+ const read = files();+ for (const platform of ["darwin", "win32"] as const) expect(createHostFirewallCheck({ platform, read })(8810)).toBeNull();+ expect(read).not.toHaveBeenCalled();+ });++ it("reads at most once per interval and sees an allow rule after it", () => {+ let clock = 0;+ let rules = RULES;+ const read = vi.fn((path: string) => (path === "/etc/ufw/user.rules" ? rules : path === "/etc/ufw/ufw.conf" ? ENABLED : DEFAULTS));+ const check = createHostFirewallCheck({ platform: "linux", read, now: () => clock, maxAgeMs: 10_000 });+ expect(check(8810)).toBe("ufw");+ const reads = read.mock.calls.length;+ expect(check(8810)).toBe("ufw");+ expect(read.mock.calls.length).toBe(reads);+ rules = `${RULES}\n### tuple ### allow tcp 8810 0.0.0.0/0 any 0.0.0.0/0 in\n`;+ clock = 10_000;+ expect(check(8810)).toBeNull();+ });+});++describe("companionState hostFirewall", () => {+ const state = (pairing: boolean, answer: "ufw" | null = "ufw") => {+ const devices = new DeviceRegistry();+ if (pairing) devices.openPairing();+ const hostFirewall = vi.fn(() => answer);+ const result = companionState({+ devices,+ companionPort: 8810,+ discovery: () => ({ advertising: false, name: "Test computer" }),+ publicNetworks: () => new Set(),+ hostFirewall,+ });+ return { result, hostFirewall };+ };++ it("says so while pairing, for the device port, with the Wi-Fi address ahead of docker0", () => {+ const { result, hostFirewall } = state(true);+ expect(result.lan).toBe("192.168.1.40");+ expect(result.hostFirewall).toBe("ufw");+ expect(hostFirewall).toHaveBeenCalledWith(8810);+ });++ it("says nothing when nothing blocks, and reads nothing while no pairing is open", () => {+ expect(state(true, null).result).not.toHaveProperty("hostFirewall");+ const { result, hostFirewall } = state(false);+ expect(result).not.toHaveProperty("hostFirewall");+ expect(hostFirewall).not.toHaveBeenCalled();+ });+});diff --git a/docs/linux-desktop.md b/docs/linux-desktop.mdindex feac9512a9..cd0bd41017 100644--- a/docs/linux-desktop.md+++ b/docs/linux-desktop.md@@ -407,3 +407,18 @@ If it prints `No suitable fusermount binary found on the $PATH` or `Cannot mountsetup`, install the distribution's FUSE 3 package (`fuse3` on Ubuntu, Debian and Arch). If it then names a missing`lib*.so` file, install the desktop libraries listed under[Arch Linux and EndeavourOS](#arch-linux-and-endeavouros-appimage), or your distribution's packages for them.++### A phone on the same Wi-Fi cannot pair++On Same Wi-Fi the phone connects to this computer on TCP port 8810. A host firewall that drops incoming connections+stops it, and the phone can only say it couldn't reach the computer. Omarchy turns on ufw with "deny incoming" by+default; stock Ubuntu ships ufw turned off. While a pairing code is open, the pairing panel says when ufw is on and+its rules, where they are readable without root, allow nothing on that port. Either turn on **Anywhere, through MausBot** (it needs no open port), or allow+the port:++```sh+sudo ufw allow 8810/tcp+```++The app never changes the firewall itself. If pairing still fails, check that the phone is not on a guest network+or one with client isolation, which stops devices on the same Wi-Fi from reaching each other.diff --git a/src/components/HostFirewallNote.test.ts b/src/components/HostFirewallNote.test.tsnew file mode 100644index 0000000000..e08d5f7d58--- /dev/null+++ b/src/components/HostFirewallNote.test.ts@@ -0,0 +1,92 @@+import { createElement } from "react";+import { renderToStaticMarkup } from "react-dom/server";+import { describe, expect, it } from "vitest";++import { PhonePairingQr } from "./PhonePairingQr";+import { PhoneSetupFlowView, type CompanionState, type PhoneSetupController } from "./PhoneSetupFlow";++// Linux with ufw on and its default "deny incoming": the phone's connection to the device port is dropped, and the+// phone can only say it couldn't reach the computer.+const state: CompanionState = {+ enabled: true,+ keepAwake: false,+ port: 8810,+ devices: [],+ pairing: { code: "123456", token: `omb_pair_${"a".repeat(43)}`, expiresAt: Date.now() + 120_000 },+ lan: "192.168.1.40",+ hostFirewall: "ufw",+};++const noop = () => {};+const controller = (over: Partial<PhoneSetupController>): PhoneSetupController => ({+ state,+ account: null,+ phase: "qr",+ email: "",+ code: "",+ codeSent: false,+ busy: false,+ accountBusy: false,+ error: null,+ accountError: null,+ pairingLink: "openmausbot://pair?address=192.168.1.40%3A8810",+ address: "192.168.1.40",+ pairingPort: 8810,+ addressText: "192.168.1.40:8810",+ hostedReady: false,+ localFallback: true,+ tailscaleFallback: false,+ tailscaleAvailable: false,+ pairingExpired: false,+ setupTimedOut: false,+ setEmail: noop,+ setCode: noop,+ changeEmail: noop,+ start: noop,+ useLocal: noop,+ useTailscale: noop,+ refreshTailscale: noop,+ requestCode: noop,+ verifyCode: noop,+ retryAccount: noop,+ cancel: noop,+ refreshCode: noop,+ finish: noop,+ act: async () => null,+ accountAct: async () => {},+ ...over,+});++const render = (over: Partial<PhoneSetupController>) =>+ renderToStaticMarkup(createElement(PhoneSetupFlowView, { controller: controller(over) }));+const renderE2E = (over: Partial<PhoneSetupController>) =>+ renderToStaticMarkup(createElement(PhonePairingQr, { c: controller(over), signedIn: false }));++const e2e = (relay: boolean): CompanionState => ({+ ...state,+ e2e: {+ enabled: true,+ relay: relay ? "connected" : "off",+ node: relay ? "relay1.openmausbot.com" : null,+ descriptor: relay ? { v: 1, k: "k", h: "h", r: ["relay1.openmausbot.com"] } : { v: 1, k: "k" },+ },+});++describe("the pairing panel when ufw likely drops the phone", () => {+ it("says so and gives the exact command for the device port", () => {+ for (const html of [render({}), renderE2E({ state: e2e(false) })]) {+ expect(html).toContain("data-host-firewall");+ expect(html).toContain("This computer's firewall (ufw) may block your phone on Wi-Fi.");+ expect(html).toContain("turn on Anywhere, through MausBot");+ expect(html).toContain("sudo ufw allow 8810/tcp");+ }+ });++ it("says nothing when the relay carries the pairing, ufw lets it in, the QR is hosted or the code expired", () => {+ expect(renderE2E({ state: e2e(true) })).not.toContain("data-host-firewall");+ expect(renderE2E({ state: { ...e2e(false), endpoints: [{ url: "https://c-ada.example.com", kind: "hosted", priority: 0 }] } })).not.toContain("data-host-firewall");+ for (const over of [{ state: { ...state, hostFirewall: undefined } }, { localFallback: false }, { pairingExpired: true }]) {+ expect(render(over)).not.toContain("data-host-firewall");+ }+ });+});diff --git a/src/components/HostFirewallNote.tsx b/src/components/HostFirewallNote.tsxnew file mode 100644index 0000000000..5b9b559d58--- /dev/null+++ b/src/components/HostFirewallNote.tsx@@ -0,0 +1,31 @@+import { t } from "@/lib/i18n";+import { productName } from "@/lib/brand";+import type { CompanionState } from "@/lib/companion-types";++const NOTE = "w-full rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-left text-[12px] leading-relaxed text-warning";++/** The command that lets a phone in on the device port; ufw is the only firewall the sidecar reports. */+export const hostFirewallCommand = (port: number) => `sudo ufw allow ${port}/tcp`;++/** The code reaches this computer only on its own network: no relay and no HTTPS address to pair through instead. */+export const wifiOnlyCode = (state: Pick<CompanionState, "e2e" | "endpoints">): boolean =>+ !state.e2e?.descriptor?.r?.length && !state.endpoints?.some((endpoint) => endpoint.kind === "hosted");++/** Linux: ufw is on, its rules are readable and none lets the device port in, so a phone on the Wi-Fi may never connect. */+export function HostFirewallNote({ state, className = "mt-3" }: { state: Pick<CompanionState, "hostFirewall" | "port">; className?: string }) {+ if (state.hostFirewall !== "ufw" || !Number.isSafeInteger(state.port)) return null;+ return (+ <div role="note" data-host-firewall="" className={`${NOTE} ${className}`}>+ <p>{t("phone.code.hostFirewall", { app: productName() })}</p>+ <code className="mt-1 block select-all font-mono text-[12px] text-ink">{hostFirewallCommand(state.port)}</code>+ </div>+ );+}++/** The Wi-Fi code panel's firewall notes: Windows calls the network Public, or ufw is on. */+export function FirewallNotes({ state, className = "mt-3 max-w-[390px]" }: { state: Pick<CompanionState, "hostFirewall" | "port" | "publicNetwork">; className?: string }) {+ return <>+ {state.publicNetwork && <p role="note" className={`${NOTE} ${className}`}>{t("phone.code.publicNetwork", { network: state.publicNetwork })}</p>}+ <HostFirewallNote state={state} className={className} />+ </>;+}diff --git a/src/components/PhonePairingQr.tsx b/src/components/PhonePairingQr.tsxindex 082743f399..0c1acf9d5c 100644--- a/src/components/PhonePairingQr.tsx+++ b/src/components/PhonePairingQr.tsx@@ -5,6 +5,7 @@ import { QRCodeSVG } from "qrcode.react";import { t } from "@/lib/i18n";import { copyText } from "@/lib/copy-text";import { productName } from "@/lib/brand";+import { HostFirewallNote, wifiOnlyCode } from "./HostFirewallNote";import type { PhoneSetupController } from "./PhoneSetupFlow";/** A fresh code while this screen is open; the previous one stays valid to its two-minute end, so a phone mid-scan@@ -64,6 +65,8 @@ export function PhonePairingQr({ c, signedIn }: { c: PhoneSetupController; signe{t("phone.code.publicNetwork", { network: state.publicNetwork })}</p>)}+ {/* With the relay or an HTTPS address in the QR the phone pairs through it whatever the firewall says. */}+ {wifiOnlyCode(state) && <HostFirewallNote state={state} />}<p className="mt-4 flex items-start gap-1.5 px-2 text-left text-[12px] text-ink-tertiary"><Lock size={12} className="mt-0.5 shrink-0" />{t("phone.code.e2e.encrypted")}diff --git a/src/components/PhoneSetupFlow.tsx b/src/components/PhoneSetupFlow.tsxindex 711fe06c81..20f6967fea 100644--- a/src/components/PhoneSetupFlow.tsx+++ b/src/components/PhoneSetupFlow.tsx@@ -66,6 +66,7 @@ import {phonePairingManualCodeMode,} from "../lib/companion-state";import { ConnectionDetail } from "./ConnectionDetail";+import { FirewallNotes } from "./HostFirewallNote";import { PhonePairingQr } from "./PhonePairingQr";import { PhoneSetupSignInRoutes } from "./PhoneSetupSignInRoutes";import { productName } from "../lib/brand";@@ -1056,11 +1057,7 @@ export function PhoneSetupFlowView({ controller }: { controller: PhoneSetupContr{!c.pairingExpired && manualCodeMode === "details" && c.state?.pairing && (<p className="mt-3 text-[12px] text-ink-secondary">{codeUntil(c.state.pairing.expiresAt)}</p>)}- {!c.pairingExpired && c.localFallback && c.state?.publicNetwork && (- <p role="note" className="mt-3 w-full max-w-[390px] rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-left text-[12px] leading-relaxed text-warning">- {t("phone.code.publicNetwork", { network: c.state.publicNetwork })}- </p>- )}+ {!c.pairingExpired && c.localFallback && c.state && <FirewallNotes state={c.state} />}{c.pairingExpired && (<button onClick={c.refreshCode} className="mt-5 rounded-lg bg-accent px-5 py-2.5 text-[14px] font-medium text-white">{t("phone.code.createNew")}diff --git a/src/components/devices/CodeCard.tsx b/src/components/devices/CodeCard.tsxindex a021e73510..0b40fabc52 100644--- a/src/components/devices/CodeCard.tsx+++ b/src/components/devices/CodeCard.tsx@@ -5,6 +5,7 @@ import { productName } from "@/lib/brand";import { useCopyFeedback } from "@/lib/copy-text";import { t } from "@/lib/i18n";import { codeUntil } from "@/lib/pairing-time";+import { HostFirewallNote, wifiOnlyCode } from "../HostFirewallNote";import { reachLine } from "../PhoneDevicesSection";import type { PhoneSetupController } from "../PhoneSetupFlow";import { PhoneSetupFlowView } from "../PhoneSetupFlow";@@ -88,6 +89,8 @@ export function PhoneCodeInline({ c, started: asked = false }: { c: PhoneSetupConoCode={<span data-pair-encrypted="" className="text-[13px] leading-[18px] text-ink-secondary">{t("devicesPage.addFlow.encryptedNoType")}</span>}><CopyPhoneLink link={c.pairingLink} /><p data-pair-reach="" className="text-[12px] leading-4 text-ink-secondary">{reachLine(c.state)}</p>+ {/* With the relay or an HTTPS address in the code the phone pairs through it whatever a firewall says. */}+ {wifiOnlyCode(c.state) && <HostFirewallNote state={c.state} className="" />}</PhoneCodeCard>;}return <PhoneSetupFlowView controller={c} />;diff --git a/src/components/settings/pages/DevicesPage.dom.test.ts b/src/components/settings/pages/DevicesPage.dom.test.tsindex 67af195ea2..a5081ca045 100644--- a/src/components/settings/pages/DevicesPage.dom.test.ts+++ b/src/components/settings/pages/DevicesPage.dom.test.ts@@ -612,6 +612,43 @@ describe("Add a device, in the page", () => {const foot = $("[data-pair-reach]")!;expect(foot.className).toContain("text-ink-secondary");expect($("[data-add-panel] [data-copy-link]")?.nextElementSibling).toBe(foot);+ expect($("[data-host-firewall]")).toBeNull();+ });++ it("says when ufw likely drops the phone on Wi-Fi and gives the command, only for a Wi-Fi-only code", async () => {+ const relayed = { v: 1 as const, k: "k", h: "h", r: ["relay1.openmausbot.com"] };+ const hosted = [{ url: "https://c-ada.example.com", kind: "hosted" as const, priority: 0 }];+ const cases = [+ { name: "Wi-Fi only", shows: true, over: { e2e: { enabled: true, relay: "off" as const, node: null, descriptor: { v: 1 as const, k: "k" } } } },+ { name: "relay in the QR", shows: false, over: { e2e: { enabled: true, relay: "connected" as const, node: null, descriptor: relayed } } },+ { name: "HTTPS address in the code", shows: false, over: { e2e: { enabled: false, relay: "off" as const, node: null, descriptor: null }, endpoints: hosted } },+ ];+ const base = companion;+ for (const { name, shows, over } of cases) {+ // Windows' Public-network note stays out of this card, as before.+ companion = { ...base, port: 8810, lan: "192.168.1.5", hosts: ["192.168.1.5"], hostFirewall: "ufw", publicNetwork: "Wi-Fi", ...over };+ bridge.pairing.mockImplementation(async (open: boolean) => {+ companion = { ...companion, pairing: open ? { code: "482913", token: `omb_pair_${"a".repeat(43)}`, expiresAt: NOW + 600_000 } : null };+ return companion;+ });+ // oxlint-disable-next-line eslint/no-await-in-loop -- one page per case.+ await render();+ // oxlint-disable-next-line eslint/no-await-in-loop -- one page per case.+ await click("[data-add-group=phones]");+ expect($("[data-pair-qr]"), name).not.toBeNull();+ const note = $("[data-add-panel] [data-host-firewall]");+ if (shows) {+ expect(note?.textContent, name).toContain("This computer's firewall (ufw) may block your phone on Wi-Fi.");+ expect(note?.querySelector("code")?.textContent, name).toBe("sudo ufw allow 8810/tcp");+ expect($("[data-pair-reach]")?.nextElementSibling, name).toBe(note);+ } else {+ expect(note, name).toBeNull();+ }+ expect(document.body.textContent, name).not.toContain("set to Public");+ // oxlint-disable-next-line eslint/no-await-in-loop -- one page per case.+ await act(async () => root.unmount());+ root = createRoot(host);+ }});it("asks for the private network first when Add a computer comes before it, with the later steps shown but quiet", async () => {diff --git a/src/lib/companion-types.ts b/src/lib/companion-types.tsindex 30a88f523d..bcd32aeb40 100644--- a/src/lib/companion-types.ts+++ b/src/lib/companion-types.ts@@ -55,6 +55,8 @@ export interface CompanionState {discovery?: { advertising: boolean; name: string };/** Windows has that network down as Public, where its firewall drops a phone's connection. */publicNetwork?: string;+ /** Linux, while pairing: ufw is on, its rules are readable, and none lets the device port in. */+ hostFirewall?: "ufw";/** The end-to-end connection; absent or `enabled: false` until this computer serves it. */e2e?: {enabled: boolean;diff --git a/src/locales/de.json b/src/locales/de.jsonindex 5bfaf48bd1..b093e0d185 100644--- a/src/locales/de.json+++ b/src/locales/de.json@@ -1702,6 +1702,7 @@"phone.code.trouble": "Probleme?","phone.code.address": "Kopplungsadresse","phone.code.publicNetwork": "Windows hat das Netzwerk {network} dieses Computers auf „Öffentlich“ gestellt, daher blockiert die Firewall dein Telefon möglicherweise. Wenn dein Telefon keine Verbindung herstellen kann, öffne in Windows Einstellungen → Netzwerk und Internet → {network} und setze den Netzwerkprofiltyp auf „Privat“.",+ "phone.code.hostFirewall": "Die Firewall dieses Computers (ufw) blockiert dein Telefon im WLAN möglicherweise. Wenn dein Telefon keine Verbindung bekommt, schalte „Überall, über {app}“ ein oder lass dein Telefon zu, indem du dies in einem Terminal ausführst:","phone.error.directUnavailable": "Direkte WLAN-Kopplung ist auf diesem Rechner gerade nicht verfügbar. Verbinde ihn mit dem WLAN und versuch es erneut.","phone.error.protectedUnavailable": "Die HTTPS-Kopplungsroute ist nicht mehr verfügbar. Prüf den sicheren Zugang und erstell einen neuen Code.","phone.error.remoteUpdate": "Der Fernzugriff konnte nicht aktualisiert werden. Öffne „Erweitert & Fehlersuche“ und versuch es erneut.",diff --git a/src/locales/en.json b/src/locales/en.jsonindex 212c75c8f7..914f8d3ce2 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -5059,6 +5059,7 @@"phone.code.trouble": "Having trouble?","phone.code.address": "Pairing address","phone.code.publicNetwork": "Windows has this computer's {network} network set to Public, so its firewall may block your phone. If your phone can't connect, open Windows Settings → Network & internet → {network} and set the network profile type to Private.",+ "phone.code.hostFirewall": "This computer's firewall (ufw) may block your phone on Wi-Fi. If your phone can't connect, turn on Anywhere, through {app}, or let your phone in by running this in a terminal:","phone.error.directUnavailable": "Direct Wi-Fi pairing isn’t available on this computer right now. Connect this computer to Wi-Fi, then try again.","phone.error.protectedUnavailable": "The HTTPS pairing route became unavailable. Check secure access, then create a new code.","phone.error.remoteUpdate": "Remote access could not be updated. Open Advanced & troubleshooting and try again.",diff --git a/src/locales/es.json b/src/locales/es.jsonindex c81fe78545..4925f18d2f 100644--- a/src/locales/es.json+++ b/src/locales/es.json@@ -3446,6 +3446,7 @@"phone.code.trouble": "¿Problemas?","phone.code.address": "Dirección de emparejamiento","phone.code.publicNetwork": "Windows tiene la red {network} de este equipo configurada como Pública, así que su firewall puede bloquear tu teléfono. Si tu teléfono no puede conectarse, abre Configuración de Windows → Red e Internet → {network} y cambia el tipo de perfil de red a Privada.",+ "phone.code.hostFirewall": "El firewall de este equipo (ufw) puede bloquear tu teléfono en la red Wi-Fi. Si tu teléfono no puede conectarse, activa «En cualquier lugar, a través de {app}» o deja entrar a tu teléfono ejecutando esto en una terminal:","phone.error.directUnavailable": "El emparejamiento directo por Wi-Fi no está disponible ahora en este equipo. Conéctalo a una Wi-Fi e inténtalo de nuevo.","phone.error.protectedUnavailable": "La ruta de emparejamiento HTTPS dejó de estar disponible. Revisa el acceso seguro y crea un código nuevo.","phone.error.remoteUpdate": "No se pudo actualizar el acceso remoto. Abre Avanzado y solución de problemas e inténtalo otra vez.",diff --git a/src/locales/fr.json b/src/locales/fr.jsonindex 38196bef8e..5d83d4e260 100644--- a/src/locales/fr.json+++ b/src/locales/fr.json@@ -1558,6 +1558,7 @@"phone.code.trouble": "Un souci ?","phone.code.address": "Adresse d’appairage","phone.code.publicNetwork": "Windows a défini le réseau {network} de cet ordinateur sur Public : son pare-feu peut donc bloquer votre téléphone. Si votre téléphone ne parvient pas à se connecter, ouvrez Paramètres Windows → Réseau et Internet → {network} et choisissez le type de profil réseau Privé.",+ "phone.code.hostFirewall": "Le pare-feu de cet ordinateur (ufw) peut bloquer votre téléphone sur le Wi-Fi. Si votre téléphone ne parvient pas à se connecter, activez « Partout, via {app} » ou autorisez votre téléphone en exécutant ceci dans un terminal :","phone.error.directUnavailable": "L’appairage Wi-Fi direct n’est pas disponible sur cet ordinateur pour l’instant. Connectez-le au Wi-Fi, puis réessayez.","phone.error.protectedUnavailable": "La route d’appairage HTTPS est devenue indisponible. Vérifiez l’accès sécurisé, puis créez un nouveau code.","phone.error.remoteUpdate": "L’accès à distance n’a pas pu être mis à jour. Ouvrez Avancé et dépannage, puis réessayez.",diff --git a/src/locales/hi.json b/src/locales/hi.jsonindex 8d2e84c784..b819f3331c 100644--- a/src/locales/hi.json+++ b/src/locales/hi.json@@ -1556,6 +1556,7 @@"phone.code.trouble": "दिक्कत हो रही है?","phone.code.address": "पेयरिंग पता","phone.code.publicNetwork": "Windows ने इस कंप्यूटर के {network} नेटवर्क को सार्वजनिक (Public) पर सेट किया है, इसलिए इसका फ़ायरवॉल आपके फ़ोन को रोक सकता है। अगर आपका फ़ोन कनेक्ट नहीं हो पा रहा है, तो Windows सेटिंग्स → नेटवर्क और इंटरनेट → {network} खोलें और नेटवर्क प्रोफ़ाइल प्रकार को निजी (Private) पर सेट करें।",+ "phone.code.hostFirewall": "इस कंप्यूटर का फ़ायरवॉल (ufw) Wi-Fi पर आपके फ़ोन को रोक सकता है। अगर आपका फ़ोन कनेक्ट नहीं हो पाता, तो \"कहीं से भी, {app} के ज़रिए\" चालू करें, या टर्मिनल में यह चलाकर अपने फ़ोन को अनुमति दें:","phone.error.directUnavailable": "इस कंप्यूटर पर अभी सीधा Wi-Fi पेयरिंग उपलब्ध नहीं है। इसे Wi-Fi से जोड़ें, फिर कोशिश करें।","phone.error.protectedUnavailable": "HTTPS पेयरिंग रूट अनुपलब्ध हो गया। सुरक्षित एक्सेस जाँचें, फिर नया कोड बनाएँ।","phone.error.remoteUpdate": "रिमोट एक्सेस अपडेट नहीं हो सका। उन्नत और समस्या-समाधान खोलें और फिर कोशिश करें।",diff --git a/src/locales/it.json b/src/locales/it.jsonindex 7e9ab4d8c7..8dfe385881 100644--- a/src/locales/it.json+++ b/src/locales/it.json@@ -5047,6 +5047,7 @@"phone.code.trouble": "Hai difficoltà?","phone.code.address": "Indirizzo di abbinamento","phone.code.publicNetwork": "Windows ha la rete {network} di questo computer impostata su Pubblico, quindi il firewall può bloccare il telefono. Se il telefono non riesce a connettersi, apri Impostazioni di Windows → Rete e internet → {network} e imposta il tipo di profilo di rete su Privato.",+ "phone.code.hostFirewall": "Il firewall di questo computer (ufw) potrebbe bloccare il telefono sulla Wi-Fi. Se il telefono non riesce a connettersi, attiva «Ovunque, tramite {app}» oppure fai entrare il telefono eseguendo questo comando in un terminale:","phone.error.directUnavailable": "L'abbinamento Wi-Fi diretto non è disponibile su questo computer in questo momento. Connetti questo computer al Wi-Fi, poi riprova.","phone.error.protectedUnavailable": "Il percorso di abbinamento HTTPS non è più disponibile. Controlla l'accesso sicuro, poi crea un nuovo codice.","phone.error.remoteUpdate": "Non è stato possibile aggiornare l'accesso remoto. Apri Avanzate e risoluzione dei problemi e riprova.",diff --git a/src/locales/ja.json b/src/locales/ja.jsonindex dc769f58d5..d8cc4a87de 100644--- a/src/locales/ja.json+++ b/src/locales/ja.json@@ -4287,6 +4287,7 @@"phone.code.trouble": "うまくいきませんか?","phone.code.address": "ペアリング用アドレス","phone.code.publicNetwork": "Windows はこのコンピューターの {network} ネットワークをパブリックに設定しているため、ファイアウォールがスマートフォンをブロックする可能性があります。スマートフォンが接続できない場合は、Windows の設定 → ネットワークとインターネット → {network} を開き、ネットワーク プロファイルの種類をプライベートに設定してください。",+ "phone.code.hostFirewall": "このコンピューターのファイアウォール (ufw) が Wi-Fi 上のスマートフォンをブロックしている可能性があります。スマートフォンが接続できない場合は、「{app} 経由でどこからでも」をオンにするか、ターミナルで次のコマンドを実行してスマートフォンを許可してください:","phone.error.directUnavailable": "このコンピューターでは今、Wi-Fi の直接ペアリングを利用できません。Wi-Fi に接続してからもう一度お試しください。","phone.error.protectedUnavailable": "HTTPS のペアリング経路が使えなくなりました。セキュアアクセスを確認し、新しいコードを作ってください。","phone.error.remoteUpdate": "リモートアクセスを更新できませんでした。「詳細設定とトラブルシューティング」を開いて、もう一度お試しください。",diff --git a/src/locales/ko.json b/src/locales/ko.jsonindex b3f1489f31..2fba1fcb40 100644--- a/src/locales/ko.json+++ b/src/locales/ko.json@@ -4089,6 +4089,7 @@"phone.code.trouble": "문제가 있나요?","phone.code.address": "페어링 주소","phone.code.publicNetwork": "Windows에서 이 컴퓨터의 {network} 네트워크가 공용으로 설정되어 있어서 방화벽이 휴대폰을 막을 수 있어요. 휴대폰이 연결되지 않으면 Windows 설정 → 네트워크 및 인터넷 → {network}을(를) 열고 네트워크 프로필 유형을 개인으로 바꾸세요.",+ "phone.code.hostFirewall": "이 컴퓨터의 방화벽(ufw)이 Wi-Fi에서 휴대폰을 막을 수 있어요. 휴대폰이 연결되지 않으면 '{app}을 통해 어디서나'를 켜거나, 터미널에서 다음을 실행해 휴대폰을 허용하세요:","phone.error.directUnavailable": "지금 이 컴퓨터에서는 Wi-Fi 직접 페어링을 쓸 수 없어요. 이 컴퓨터를 Wi-Fi에 연결한 뒤 다시 시도하세요.","phone.error.protectedUnavailable": "HTTPS 페어링 경로를 쓸 수 없게 됐어요. 안전한 접근을 확인한 뒤 새 코드를 만드세요.","phone.error.remoteUpdate": "원격 접근을 업데이트하지 못했어요. 고급 및 문제 해결을 열고 다시 시도하세요.",diff --git a/src/locales/pl.json b/src/locales/pl.jsonindex e006f50de6..89ee7a8c46 100644--- a/src/locales/pl.json+++ b/src/locales/pl.json@@ -3787,6 +3787,7 @@"phone.code.trouble": "Masz problem?","phone.code.address": "Adres parowania","phone.code.publicNetwork": "Windows ma sieć {network} tego komputera ustawioną jako publiczną, więc zapora może blokować twój telefon. Jeśli telefon nie może się połączyć, otwórz Ustawienia Windows → Sieć i internet → {network} i ustaw typ profilu sieci na prywatny.",+ "phone.code.hostFirewall": "Zapora tego komputera (ufw) może blokować twój telefon w sieci Wi-Fi. Jeśli telefon nie może się połączyć, włącz „Wszędzie, przez {app}” albo wpuść telefon, uruchamiając to w terminalu:","phone.error.directUnavailable": "Bezpośrednie parowanie przez Wi-Fi nie jest teraz dostępne na tym komputerze. Połącz ten komputer z Wi-Fi, a następnie spróbuj ponownie.","phone.error.protectedUnavailable": "Trasa parowania HTTPS stała się niedostępna. Sprawdź bezpieczny dostęp, a następnie utwórz nowy kod.","phone.error.remoteUpdate": "Nie udało się zaktualizować dostępu zdalnego. Otwórz Zaawansowane i rozwiązywanie problemów, a następnie spróbuj ponownie.",diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex 53bed26217..59fefc28b9 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -4720,6 +4720,7 @@"phone.code.trouble": "Com dificuldade?","phone.code.address": "Endereço de pareamento","phone.code.publicNetwork": "A rede {network} deste computador está definida como pública no Windows, então o firewall pode bloquear seu celular. Se o celular não conseguir se conectar, abra Configurações do Windows → Rede e Internet → {network} e selecione Rede privada em Tipo de perfil de rede.",+ "phone.code.hostFirewall": "O firewall deste computador (ufw) pode bloquear seu celular no Wi-Fi. Se o celular não conseguir se conectar, ative \"De qualquer lugar, pelo {app}\" ou libere o celular executando isto em um terminal:","phone.error.directUnavailable": "O pareamento direto por Wi-Fi não está disponível neste computador agora. Conecte-o a uma rede Wi-Fi e tente novamente.","phone.error.protectedUnavailable": "A rota de pareamento HTTPS ficou indisponível. Verifique o acesso seguro e crie um código novo.","phone.error.remoteUpdate": "Não foi possível atualizar o acesso remoto. Abra “Avançado e solução de problemas” e tente novamente.",diff --git a/src/locales/ru.json b/src/locales/ru.jsonindex 7e52922fe3..6588e9948a 100644--- a/src/locales/ru.json+++ b/src/locales/ru.json@@ -3835,6 +3835,7 @@"phone.code.trouble": "Возникли трудности?","phone.code.address": "Адрес сопряжения","phone.code.publicNetwork": "Windows считает сеть {network} этого компьютера общедоступной, поэтому брандмауэр может блокировать ваш телефон. Если телефон не подключается, откройте «Параметры Windows → Сеть и Интернет → {network}» и задайте для типа профиля сети значение «Частная».",+ "phone.code.hostFirewall": "Брандмауэр этого компьютера (ufw) может блокировать ваш телефон в сети Wi-Fi. Если телефон не подключается, включите «Откуда угодно, через {app}» или разрешите подключение телефона, выполнив это в терминале:","phone.error.directUnavailable": "Прямое сопряжение по Wi-Fi сейчас недоступно на этом компьютере. Подключите этот компьютер к Wi-Fi, затем попробуйте снова.","phone.error.protectedUnavailable": "Маршрут сопряжения по HTTPS стал недоступен. Проверьте защищённый доступ, затем создайте новый код.","phone.error.remoteUpdate": "Не удалось обновить удалённый доступ. Откройте «Дополнительно и диагностика» и попробуйте снова.",diff --git a/src/locales/tr.json b/src/locales/tr.jsonindex e82b7251ad..c59064bfc8 100644--- a/src/locales/tr.json+++ b/src/locales/tr.json@@ -3102,6 +3102,7 @@"phone.code.trouble": "Sorun mu yaşıyorsunuz?","phone.code.address": "Eşleştirme adresi","phone.code.publicNetwork": "Windows bu bilgisayarın {network} ağını Genel olarak ayarlamış, bu nedenle güvenlik duvarı telefonunuzu engelleyebilir. Telefonunuz bağlanamazsa Windows Ayarları → Ağ ve internet → {network} bölümünü açın ve ağ profili türünü Özel olarak ayarlayın.",+ "phone.code.hostFirewall": "Bu bilgisayarın güvenlik duvarı (ufw), Wi-Fi'da telefonunuzu engelleyebilir. Telefonunuz bağlanamazsa \"Her yerden, {app} üzerinden\" seçeneğini açın veya bir terminalde şunu çalıştırarak telefonunuza izin verin:","phone.error.directUnavailable": "Doğrudan Wi-Fi eşleştirmesi şu anda bu bilgisayarda kullanılamıyor. Bu bilgisayarı Wi-Fi'a bağlayıp tekrar deneyin.","phone.error.protectedUnavailable": "HTTPS eşleştirme rotası kullanılamaz hale geldi. Güvenli erişimi kontrol edin ve ardından yeni bir kod oluşturun.","phone.error.remoteUpdate": "Uzaktan erişim güncellenemedi. Gelişmiş ve sorun giderme bölümünü açıp tekrar deneyin.",diff --git a/src/locales/uk.json b/src/locales/uk.jsonindex f5ea8c96e9..9a406dd48b 100644--- a/src/locales/uk.json+++ b/src/locales/uk.json@@ -1875,6 +1875,7 @@"phone.code.trouble": "Виникли труднощі?","phone.code.address": "Адреса прив'язки","phone.code.publicNetwork": "Windows позначила мережу {network} цього комп’ютера як загальнодоступну, тому брандмауер може блокувати ваш телефон. Якщо телефон не може під’єднатися, відкрийте «Параметри» Windows → «Мережа та Інтернет» → {network} і встановіть тип мережевого профілю «Приватна».",+ "phone.code.hostFirewall": "Брандмауер цього комп’ютера (ufw) може блокувати ваш телефон у мережі Wi-Fi. Якщо телефон не може під’єднатися, увімкніть «Звідусіль, через {app}» або дозвольте телефону під’єднуватися, виконавши це в терміналі:","phone.error.directUnavailable": "Пряма прив'язка Wi-Fi зараз недоступна на цьому комп'ютері. Підключіть комп'ютер до Wi-Fi і спробуйте ще раз.","phone.error.protectedUnavailable": "Маршрут прив'язки HTTPS став недоступним. Перевірте безпечний доступ, потім створіть новий код.","phone.error.remoteUpdate": "Не вдалося оновити Віддалений доступ. Відкрийте «Розширені та усунення несправностей» і спробуйте ще раз.",diff --git a/src/locales/vi.json b/src/locales/vi.jsonindex 361989cd57..34be691bdd 100644--- a/src/locales/vi.json+++ b/src/locales/vi.json@@ -3102,6 +3102,7 @@"phone.code.trouble": "Gặp sự cố?","phone.code.address": "Địa chỉ ghép nối","phone.code.publicNetwork": "Windows đã đặt mạng {network} của máy tính này thành Công khai, vì vậy tường lửa có thể chặn điện thoại của bạn. Nếu điện thoại không thể kết nối, hãy mở Cài đặt Windows → Mạng & internet → {network} và đặt loại cấu hình mạng thành Riêng tư.",+ "phone.code.hostFirewall": "Tường lửa của máy tính này (ufw) có thể chặn điện thoại của bạn trên Wi-Fi. Nếu điện thoại không kết nối được, hãy bật \"Ở bất kỳ đâu, qua {app}\" hoặc cho phép điện thoại bằng cách chạy lệnh này trong terminal:","phone.error.directUnavailable": "Ghép nối Wi-Fi trực tiếp hiện không khả dụng trên máy tính này. Kết nối máy tính này với Wi-Fi rồi thử lại.","phone.error.protectedUnavailable": "Kênh ghép nối HTTPS không còn khả dụng. Hãy kiểm tra kết nối truy cập an toàn, sau đó tạo mã mới.","phone.error.remoteUpdate": "Không thể cập nhật truy cập từ xa. Mở Nâng cao & khắc phục sự cố rồi thử lại.",diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.jsonindex 9059630353..57ab2b79f2 100644--- a/src/locales/zh-tw.json+++ b/src/locales/zh-tw.json@@ -4451,6 +4451,7 @@"phone.code.trouble": "遇到問題嗎?","phone.code.address": "配對位址","phone.code.publicNetwork": "Windows 將這台電腦的 {network} 網路設為公用網路,防火牆可能會封鎖你的手機。如果手機無法連線,請開啟 Windows 設定 → 網路和網際網路 → {network},將網路設定檔類型設為私人網路。",+ "phone.code.hostFirewall": "這台電腦的防火牆 (ufw) 可能會在 Wi-Fi 上封鎖你的手機。如果手機無法連線,請開啟「透過 {app} 隨處連線」,或在終端機中執行以下指令讓手機連線:","phone.error.directUnavailable": "這台電腦目前無法使用 Wi-Fi 直接配對。請將這台電腦連上 Wi-Fi 後再試一次。","phone.error.protectedUnavailable": "HTTPS 配對路由已無法使用。請檢查安全存取,然後建立新的驗證碼。","phone.error.remoteUpdate": "無法更新遠端存取。請開啟「進階與疑難排解」後再試一次。",diff --git a/src/locales/zh.json b/src/locales/zh.jsonindex bface5e2cd..69beecbcd9 100644--- a/src/locales/zh.json+++ b/src/locales/zh.json@@ -4487,6 +4487,7 @@"phone.code.trouble": "遇到问题?","phone.code.address": "配对地址","phone.code.publicNetwork": "Windows 将这台电脑的 {network} 网络设为公用网络,防火墙可能会阻止你的手机连接。如果手机无法连接,请打开 Windows 设置 → 网络和 Internet → {network},将网络配置文件类型设为专用网络。",+ "phone.code.hostFirewall": "这台电脑的防火墙 (ufw) 可能会在 Wi-Fi 上阻止你的手机连接。如果手机无法连接,请打开“通过 {app} 随处连接”,或在终端中运行以下命令允许手机连接:","phone.error.directUnavailable": "这台电脑现在无法进行直接 Wi-Fi 配对。请先连上 Wi-Fi 再试。","phone.error.protectedUnavailable": "HTTPS 配对通道已不可用。请检查安全访问后重新生成验证码。","phone.error.remoteUpdate": "无法更新远程访问。请打开「高级与故障排查」后重试。",