0.19.0 - 2025-05-23
context
previous versions constantly prompted for passwords when starting port forwarding on macos/linux because the app needed admin rights for network operations. automatic loopback address assignment worked but required sudo prompts each time, and hosts file management meant either running the app with sudo or manually changing /etc/hosts permissions. there was also no proper cleanup of network addresses when stopping port forwards.
addressing the issues
built kftray-helper, a background service that handles all network operations with proper permissions. it's a rust binary that runs as a launchd daemon on macos and systemd daemon on linux, communicating with the main app through unix sockets. the helper manages a persistent pool of loopback addresses and handles hosts file operations with batched writes and atomic updates.
added a new auto_loopback_address field in configs that automatically picks addresses from the 127.0.0.2 to 127.0.0.254 range. this lets you run multiple services on the same local port since each gets its own ip automatically. the helper includes request validation with app id checks and peer credential verification for security.
how it works in practice
install the helper once through footer menu > helper > install kftray-helper with a single password prompt. after that, creating port forwards with auto address allocation just works - check the box and forget about ip conflicts. starting multiple port forwards happens instantly without interruptions, and stopping them properly cleans up both addresses and hosts entries.
if you skip the helper installation, everything works exactly like before with osascript prompts on macos. you can also uninstall the helper anytime to go back to the previous behavior.
the helper runs as a persistent privileged daemon with network configuration and hosts file access. it validates requests through secure channels but does mean broader system permissions compared to the old approach.
newkftray.mp4
Commits
- tests: add overall tests and code coverage by @hcavarsan in #403
- fix: AddConfigModal header Flex missing grow by @honsunrise in #407
- feat: add background service for network operations by @hcavarsan in #414
- feat: add automatic loopback address allocation for port forwarding by @hcavarsan in #416
- feat: handle hostfile via kftray-helper by @hcavarsan in #417
New Contributors
- @honsunrise made their first contribution in #407