diff --git a/AGENTS.md b/AGENTS.md index dd12bf2..505903d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -71,6 +71,23 @@ If a required command fails or emits a warning from project code, fix it in the ## Lessons +- The advisory database can make an unchanged lockfile fail the gate. Update + vulnerable transitive crates through Cargo and replace unmaintained direct + dependencies. The `chrono` migration must preserve RFC 3339 strings in + existing rule files, cloud metadata, IPC, and diagnostic logs. Use fixed + timestamps from the previous format in round-trip tests. Reuse the diagnostic + UTC formatter because an inline formatter expanded the environment collector + past Clippy's function-length limit (ADR 0138). + +- `cfg(unix)` or a non-Windows fallback does not imply Linux desktop tools + are available. macOS client download buttons must hand approved URLs to + `/usr/bin/open`; use the Homebrew OpenVPN formula page for the CLI and + verify command construction without opening a browser (ADR 0075). +- A working opener does not prove the download URL still works. Happ's + old download page returned HTTP 403 on macOS. Verify the publisher's + universal DMG through the final redirect and update both preset catalogs + so the frontend destination and native allowlist agree (ADR 0074). + - A fixed sleep does not prove a child has installed its signal handler on a busy native runner. The graceful-stop fixture must read an explicit flushed readiness message after handler installation, keep the child alive through diff --git a/Cargo.lock b/Cargo.lock index c332b48..e557e79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -565,10 +565,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ "iana-time-zone", - "js-sys", "num-traits", "serde", - "wasm-bindgen", "windows-link 0.2.1", ] @@ -648,9 +646,9 @@ dependencies = [ [[package]] name = "cookie" -version = "0.18.2" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a373e3602691c3cdea496d2f0ee5935151e6168fe87739483c463db1b2f2f87" +checksum = "d55f2d6c30eeec7d5c6f98bd4395d4abb1895629eab97ee6522d340623615f8a" dependencies = [ "time", "version_check", @@ -1285,9 +1283,9 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" dependencies = [ "percent-encoding", ] @@ -2046,15 +2044,15 @@ dependencies = [ [[package]] name = "iran-split-cli" -version = "6.2.91" +version = "6.2.94" dependencies = [ "async-trait", - "chrono", "clap", "iran-split-config", "iran-split-core", "iran-split-ipc", "iran-split-rules", + "jiff", "serde_json", "tokio", "tokio-util", @@ -2064,7 +2062,7 @@ dependencies = [ [[package]] name = "iran-split-clients" -version = "6.2.91" +version = "6.2.94" dependencies = [ "async-trait", "ipnet", @@ -2080,7 +2078,7 @@ dependencies = [ [[package]] name = "iran-split-config" -version = "6.2.91" +version = "6.2.94" dependencies = [ "hex", "rand 0.9.5", @@ -2093,11 +2091,11 @@ dependencies = [ [[package]] name = "iran-split-core" -version = "6.2.91" +version = "6.2.94" dependencies = [ "async-trait", - "chrono", "iran-split-config", + "jiff", "serde", "serde_json", "tempfile", @@ -2110,9 +2108,8 @@ dependencies = [ [[package]] name = "iran-split-desktop" -version = "6.2.91" +version = "6.2.94" dependencies = [ - "chrono", "dirs 6.0.0", "flate2", "hex", @@ -2127,6 +2124,7 @@ dependencies = [ "iran-split-platform-win", "iran-split-rules", "iran-split-taskbar", + "jiff", "regex", "reqwest 0.12.28", "semver", @@ -2152,7 +2150,7 @@ dependencies = [ [[package]] name = "iran-split-helper" -version = "6.2.91" +version = "6.2.94" dependencies = [ "clap", "hex", @@ -2177,7 +2175,7 @@ dependencies = [ [[package]] name = "iran-split-helper-winacl" -version = "6.2.91" +version = "6.2.94" dependencies = [ "tokio", "windows", @@ -2185,10 +2183,9 @@ dependencies = [ [[package]] name = "iran-split-ipc" -version = "6.2.91" +version = "6.2.94" dependencies = [ "bytes", - "chrono", "serde", "serde_json", "thiserror 2.0.20", @@ -2198,15 +2195,15 @@ dependencies = [ [[package]] name = "iran-split-mihomo" -version = "6.2.91" +version = "6.2.94" dependencies = [ - "chrono", "futures-util", "hex", "http", "iran-split-clients", "iran-split-config", "iran-split-rules", + "jiff", "reqwest 0.12.28", "serde", "serde_json", @@ -2221,7 +2218,7 @@ dependencies = [ [[package]] name = "iran-split-netstats" -version = "6.2.91" +version = "6.2.94" dependencies = [ "libc", "tempfile", @@ -2230,10 +2227,9 @@ dependencies = [ [[package]] name = "iran-split-platform-linux" -version = "6.2.91" +version = "6.2.94" dependencies = [ "async-trait", - "chrono", "hex", "iran-split-clients", "iran-split-config", @@ -2241,6 +2237,7 @@ dependencies = [ "iran-split-ipc", "iran-split-mihomo", "iran-split-rules", + "jiff", "serde", "serde_json", "sha2", @@ -2254,10 +2251,9 @@ dependencies = [ [[package]] name = "iran-split-platform-macos" -version = "6.2.91" +version = "6.2.94" dependencies = [ "async-trait", - "chrono", "hex", "iran-split-clients", "iran-split-config", @@ -2265,6 +2261,7 @@ dependencies = [ "iran-split-ipc", "iran-split-mihomo", "iran-split-rules", + "jiff", "serde", "serde_json", "sha2", @@ -2278,16 +2275,16 @@ dependencies = [ [[package]] name = "iran-split-platform-win" -version = "6.2.91" +version = "6.2.94" dependencies = [ "async-trait", - "chrono", "iran-split-clients", "iran-split-config", "iran-split-core", "iran-split-ipc", "iran-split-mihomo", "iran-split-rules", + "jiff", "serde", "serde_json", "tempfile", @@ -2301,14 +2298,14 @@ dependencies = [ [[package]] name = "iran-split-rules" -version = "6.2.91" +version = "6.2.94" dependencies = [ "async-trait", - "chrono", "hex", "idna", "ipnet", "iran-split-config", + "jiff", "psl", "reqwest 0.12.28", "serde", @@ -2323,7 +2320,7 @@ dependencies = [ [[package]] name = "iran-split-taskbar" -version = "6.2.91" +version = "6.2.94" dependencies = [ "iran-split-config", "objc2", @@ -5520,9 +5517,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.8" +version = "2.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" dependencies = [ "form_urlencoded", "idna", diff --git a/Cargo.toml b/Cargo.toml index d019f7e..05f995e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ members = [ ] [workspace.package] -version = "6.2.91" +version = "6.2.94" edition = "2021" license = "MIT OR Apache-2.0" rust-version = "1.88" @@ -28,7 +28,6 @@ publish = false [workspace.dependencies] async-trait = "0.1.88" bytes = "1.10.1" -chrono = { version = "0.4.41", features = ["serde"] } clap = { version = "4.5.38", features = ["derive"] } dirs = "6.0.0" flate2 = "1.1.1" @@ -37,6 +36,7 @@ hex = "0.4.3" http = "1.3.1" idna = "1.0.3" ipnet = { version = "2.11.0", features = ["serde"] } +jiff = { version = "0.2.35", features = ["serde"] } psl = "2.1.148" nix = { version = "0.30.1", features = ["socket", "user", "signal", "process", "fs"] } libc = "0.2.174" diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 409c4f3..294a39a 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@iran-split/desktop", - "version": "6.2.91", + "version": "6.2.94", "private": true, "type": "module", "scripts": { diff --git a/apps/desktop/src/components/ClientRegistry.test.tsx b/apps/desktop/src/components/ClientRegistry.test.tsx index 6c8095e..0d85e28 100644 --- a/apps/desktop/src/components/ClientRegistry.test.tsx +++ b/apps/desktop/src/components/ClientRegistry.test.tsx @@ -31,7 +31,7 @@ beforeEach(() => { pickProfileFile.mockResolvedValue("/tmp/office.ovpn"); vi.mocked(desktop.clientBinaryInstalled).mockReset(); vi.mocked(desktop.clientBinaryInstalled).mockResolvedValue(true); - vi.mocked(desktop.openUrl).mockClear(); + vi.mocked(desktop.openUrl).mockReset().mockResolvedValue(undefined); const openvpn = createClientInstance( "openvpn", "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", @@ -49,6 +49,7 @@ beforeEach(() => { snapshot: baseSnapshot(), actionPending: false, boot: { platform: "linux" } as BootstrapResult, + toast: null, updateClient: vi.fn(), addClient: vi.fn(), deleteClient: vi.fn(), @@ -365,6 +366,26 @@ describe("ClientRegistry profile picker", () => { ); }); + it("reports a failed macOS OpenVPN download page handoff", async () => { + useAppStore.setState({ boot: { platform: "macos" } as BootstrapResult }); + vi.mocked(desktop.openUrl).mockRejectedValueOnce("browser handoff failed"); + render(); + + await userEvent.click(screen.getByRole("button", { name: "Add client" })); + const row = screen.getByTestId("client-catalog-openvpn"); + await userEvent.click( + within(row).getByRole("button", { name: "Download OpenVPN" }), + ); + + expect(desktop.openUrl).toHaveBeenCalledWith( + "https://formulae.brew.sh/formula/openvpn", + ); + expect(useAppStore.getState().toast).toMatchObject({ + text: "Could not open the download page.", + tone: "danger", + }); + }); + it("leaves the path unchanged when the picker is cancelled", async () => { const updateClient = vi.fn(); pickProfileFile.mockResolvedValueOnce(null); diff --git a/apps/desktop/src/components/ClientRegistry.tsx b/apps/desktop/src/components/ClientRegistry.tsx index 69cdb2b..8e27f1e 100644 --- a/apps/desktop/src/components/ClientRegistry.tsx +++ b/apps/desktop/src/components/ClientRegistry.tsx @@ -858,10 +858,15 @@ function DownloadLinkButton({ labelKey: PresetDownloadLink["labelKey"]; }) { const { t } = useTranslation(); + const showToast = useAppStore((state) => state.showToast); return (