vibetunnel/mac/VibeTunnel
Peter Steinberger add95f59d2 Fix Network access mode bind address race condition
Fixes GitHub issue #326 where VibeTunnel's "Network" access mode was
still binding to localhost instead of 0.0.0.0, preventing access over
Tailscale and other networks.

## Root Cause
Race condition in UserDefaults handling when changing access modes:
- UI updates accessModeString via @AppStorage (writes to UserDefaults)
- restartServerWithNewBindAddress() had redundant bindAddress assignment
- Two concurrent UserDefaults writes to same key could cause stale config

## Changes
**DashboardSettingsView.swift:**
- Remove redundant `serverManager.bindAddress = accessMode.bindAddress`
- @AppStorage already persists the access mode change
- Add detailed logging for access mode changes

**BunServer.swift:**
- Add debug logging for server configuration (port + bindAddress)
- Applies to both production and development servers
- Helps diagnose future binding issues

## Testing
Users can verify the fix by:
1. Change Access Mode in VibeTunnel Settings → Dashboard
2. Check with: `lsof -iTCP:4020 -sTCP:LISTEN`
   - Network mode: `TCP *:trap (LISTEN)` (0.0.0.0:4020) 
   - Localhost mode: `TCP localhost:trap (LISTEN)` (127.0.0.1:4020) 
3. View logs: `./scripts/vtlog.sh -s "bind\|configuration"`

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 03:14:42 +02:00
..
Assets.xcassets Integrate screencap functionality for remote screen sharing (#209) 2025-07-06 03:31:34 +01:00
Core Fix Network access mode bind address race condition 2025-07-15 03:14:42 +02:00
Extensions refactor: major project restructuring - move macOS app to mac/ directory 2025-06-20 13:20:01 +02:00
Presentation Fix Network access mode bind address race condition 2025-07-15 03:14:42 +02:00
Utilities Terminal theme improvements (#332) 2025-07-12 22:11:30 +02:00
Info.plist Improve Cloudflare integration implementation (#306) 2025-07-11 07:43:53 +02:00
Shared.xcconfig local needs to be local 2025-06-22 15:55:02 +02:00
sparkle-public-ed-key.txt refactor: major project restructuring - move macOS app to mac/ directory 2025-06-20 13:20:01 +02:00
version.xcconfig Add professional light mode with theme toggle (#314) 2025-07-12 01:42:42 +02:00
VibeTunnel-Mac.xctestplan Unified control protocol and deferred screen recording permissions (#239) 2025-07-08 00:42:13 +01:00
VibeTunnel.entitlements refactor: major project restructuring - move macOS app to mac/ directory 2025-06-20 13:20:01 +02:00
VibeTunnelApp.swift Add debug development server mode for hot reload (#316) 2025-07-12 10:57:03 +02:00