Skip to content

feat(desktop): make the PAC port a local-ports setting - #219

Merged
loss-and-quick merged 1 commit into
mainfrom
feat/pac-port-setting
Jul 14, 2026
Merged

feat(desktop): make the PAC port a local-ports setting#219
loss-and-quick merged 1 commit into
mainfrom
feat/pac-port-setting

Conversation

@loss-and-quick

Copy link
Copy Markdown
Owner

Summary

Make the desktop PAC-server port a user setting (localPacPort, default 10811), symmetric with localSocksPort/localHttpPort — closing the "fixed PAC port" note from #218/#65. The default constant is single-sourced in kasumi-core and exported to the frontend through the generated defaults; pac::start now binds the port it is given (resolved in DesktopPlatform beside the http port — the Platform trait is untouched). The settings UI shows the field in Local ports, desktop-only (the PAC mode doesn't exist on Android).

Affected layer

  • frontend/ — React Web UI
  • crates/ · src-tauri/ — Rust core / backend / Tauri desktop
  • module/ — Android installable zip (thin launcher over the Rust daemon)
  • scripts/ — build / release helpers
  • CI / .github/
  • Docs only

Verification

Web UI (frontend/):

  • bun run check — Biome lint + format clean
  • bun run test — vitest green (69 passed)
  • bun run buildtsc -b + vite build succeed
  • bun run check:i18n — locale dictionaries in sync (652 keys × 8 locales)

Rust (crates/ · src-tauri/):

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace — one failure: net::tests::tcp_ping_fails_on_unreachable_host, the known environment flake (an active VPN tun on the dev machine captures the TEST-NET-1 connect); fails identically on main
  • Codegen drift: cargo run -p kasumi-desktop --bin codegen leaves git clean

Checklist

  • Title is a scoped Conventional Commit; commits are logically split
  • No build artifacts committed (module/bin/<abi>/, geoip/geosite, built module/webroot/, src-tauri/gen/ — all gitignored on purpose)
  • Generated frontend/src/generated/ was regenerated from Rust, not hand-edited
  • If user-visible strings changed: i18n/en.ts and every locale file updated (one label key, settings.pac, ×8)
  • Renames touching the project id were grepped in all case forms (kasumi-proxy, Kasumi Proxy, camelCase)

Notes for reviewers

  • The label key is settings.pac ("PAC" in every locale), mirroring the sibling acronym labels settings.socks/settings.http rather than a longer sentence-style key.
  • The Local-ports row now holds three number fields on desktop (two elsewhere); not visually eyeballed in a running app — flag if the row wraps badly on narrow widths.
  • No port-collision validation (socks/http/pac/force): the pre-existing fields have none either; the PAC bind failure path (port taken → OS left un-proxied + logged error) already covers the misconfiguration at runtime.

@github-actions github-actions Bot added frontend React Web UI (frontend/) backend Rust core/backend/desktop (crates/, src-tauri/) labels Jul 14, 2026
@loss-and-quick
loss-and-quick merged commit 5a53260 into main Jul 14, 2026
10 checks passed
@loss-and-quick
loss-and-quick deleted the feat/pac-port-setting branch July 14, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Rust core/backend/desktop (crates/, src-tauri/) frontend React Web UI (frontend/)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant