vibetunnel/docs
Lachlan Donald 745f5090bb
feat: add Tailscale Serve integration with automatic authentication (#472)
* feat: add secure Tailscale Serve integration support

- Add --enable-tailscale-serve flag to bind server to localhost
- Implement Tailscale identity header authentication
- Add security validations for localhost origin and proxy headers
- Create TailscaleServeService to manage tailscale serve process
- Fix dev script to properly pass arguments through pnpm
- Add comprehensive auth middleware tests for all auth methods
- Ensure secure integration with Tailscale's reverse proxy

* refactor: use isFromLocalhostAddress helper for Tailscale auth

- Extract localhost checking logic into dedicated helper function
- Makes the code clearer and addresses review feedback
- Maintains the same security checks for Tailscale authentication

* feat(web): Add Tailscale Serve integration support

- Add TailscaleServeService to manage background tailscale serve process
- Add --enable-tailscale-serve and --use-tailscale-serve flags
- Force localhost binding when Tailscale Serve is enabled
- Enhance auth middleware to support Tailscale identity headers
- Add isFromLocalhostAddress helper for secure localhost validation
- Fix dev script to properly pass CLI arguments through pnpm
- Add comprehensive auth middleware tests (17 tests)
- Use 'tailscale serve reset' for thorough cleanup

The server now automatically manages the Tailscale Serve proxy process,
providing secure HTTPS access through Tailscale networks without manual
configuration.

* feat(mac): Add Tailscale Serve toggle in Remote Access settings

- Add 'Enable Tailscale Serve Integration' toggle in RemoteAccessSettingsView
- Pass --use-tailscale-serve flag from both BunServer and DevServerManager
- Show HTTPS URL when Tailscale Serve is enabled, HTTP when disabled
- Fix URL copy bug in ServerInfoSection for Tailscale addresses
- Update authentication documentation with new integration mode
- Server automatically restarts when toggle is changed

The macOS app now provides a user-friendly toggle to enable secure
Tailscale Serve integration without manual configuration.

* fix(security): Remove dangerous --allow-tailscale-auth flag

- Remove --allow-tailscale-auth flag that allowed header spoofing
- Remove --use-tailscale-serve alias for consistency
- Keep only --enable-tailscale-serve which safely manages everything
- Update all references in server.ts to use enableTailscaleServe
- Update macOS app to use --enable-tailscale-serve flag
- Update documentation to remove manual setup mode

The --allow-tailscale-auth flag was dangerous because it allowed users to
enable Tailscale header authentication while binding to network interfaces,
which would allow anyone on the network to spoof the Tailscale headers.

Now there's only one safe way to use Tailscale integration: --enable-tailscale-serve,
which forces localhost binding and manages the proxy automatically.

* fix: address PR feedback from Peter and Cursor

- Fix Promise hang bug in TailscaleServeService when process exits with code 0
- Move tailscaleServeEnabled string to AppConstants.UserDefaultsKeys
- Create TailscaleURLHelper for URL construction logic
- Add Linux support to TailscaleServeService with common Tailscale paths
- Update all references to use centralized constants
- Fix code formatting issues

* feat: Add Tailscale Serve status monitoring and error visibility

* fix: Correct pass-through argument logic for boolean flags and duplicates

- Track processed argument indices instead of checking if arg already exists in serverArgs
- Add set of known boolean flags that don't take values
- Allow duplicate arguments to be passed through
- Only treat non-dash arguments as values for non-boolean flags

This fixes issues where:
1. Boolean flags like --verbose were incorrectly consuming the next argument
2. Duplicate flags couldn't be passed through to the server

* fix: Resolve promise hanging and orphaned processes in Tailscale serve

- Add settled flag to prevent multiple promise resolutions
- Handle exit code 0 as a failure case during startup
- Properly terminate child process in cleanup method
- Add timeout for graceful shutdown before force killing

This fixes:
1. Promise hanging when tailscale serve exits with code 0
2. Orphaned processes when startup fails or cleanup is called

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2025-07-30 02:30:10 +02:00
..
images Add Mintlify documentation configuration (#403) 2025-07-18 08:37:16 +02:00
architecture-mario.md Fix mobile terminal resize loop (#305) 2025-07-11 08:23:47 +02:00
ARCHITECTURE.md Burn everything with fire that is not node or swift. 2025-06-21 14:39:44 +02:00
authentication.md feat: add Tailscale Serve integration with automatic authentication (#472) 2025-07-30 02:30:10 +02:00
build-system.md Add comprehensive server tests and switch to Biome linter (#73) 2025-06-24 18:51:38 +02:00
changelog-management.md Improve changelog contributor attribution and management 2025-07-20 11:47:36 +02:00
claude.md Integrate screencap functionality for remote screen sharing (#209) 2025-07-06 03:31:34 +01:00
CONTRIBUTING.md Add push notifications onboarding screen (#474) 2025-07-27 12:12:30 +00:00
custom-node.md Migrate to Microsoft node-pty v1.1.0-beta34 (#87) 2025-06-26 23:10:05 +02:00
deployment.md Burn everything with fire that is not node or swift. 2025-06-21 14:39:44 +02:00
development.md Add Mintlify documentation configuration (#403) 2025-07-18 08:37:16 +02:00
files.md Add global Apple workspace 2025-06-22 14:27:38 +02:00
gemini.md feat: add gemini and review-pr slash commands (#138) 2025-06-29 21:53:33 +01:00
git-hooks.md feat: add comprehensive Git worktree management with follow mode and enhanced UI (#452) 2025-07-26 15:06:18 +02:00
git-worktree-follow-mode.md feat: add comprehensive Git worktree management with follow mode and enhanced UI (#452) 2025-07-26 15:06:18 +02:00
hq.md Re-enable HQ mode e2e tests and add comprehensive documentation (#402) 2025-07-18 16:14:38 +02:00
INDEX.md Remove Tauri project and all references (#419) 2025-07-19 02:58:50 +02:00
introduction.mdx Refactor notification preferences system (#469) 2025-07-27 13:32:11 +02:00
ios-spec.md Add Mintlify documentation configuration (#403) 2025-07-18 08:37:16 +02:00
keyboard-shortcuts.md feat: add comprehensive Git worktree management with follow mode and enhanced UI (#452) 2025-07-26 15:06:18 +02:00
logging-style-guide.md Add Mintlify documentation configuration (#403) 2025-07-18 08:37:16 +02:00
openapi.md feat: add comprehensive Git worktree management with follow mode and enhanced UI (#452) 2025-07-26 15:06:18 +02:00
org-migrate.md docs update 2025-07-19 02:51:17 +02:00
project-overview.md Clean up and improve documentation across the project 2025-07-19 03:01:48 +02:00
push-impl.md Fix duplicate Git worktree button in mobile view 2025-07-28 13:24:17 +02:00
push-notification.md Add docs for push notification feat 2025-07-28 13:26:14 +02:00
RELEASE.md Add Mintlify documentation configuration (#403) 2025-07-18 08:37:16 +02:00
repoprompt.md Add repo prompt docs 2025-07-29 15:59:32 +02:00
security.md Add Mintlify documentation configuration (#403) 2025-07-18 08:37:16 +02:00
spec.md docs: expand spec with data flows 2025-07-09 16:25:03 +02:00
testing.md Add Mintlify documentation configuration (#403) 2025-07-18 08:37:16 +02:00
TESTING_EXTERNAL_DEVICES.md docs: Create comprehensive external device testing guide 2025-07-01 12:18:12 +01:00
unified-notifications-test-plan.md Implement unified notification system via Unix socket 2025-07-28 14:35:29 +02:00
worktree-spec.md feat: add comprehensive Git worktree management with follow mode and enhanced UI (#452) 2025-07-26 15:06:18 +02:00
worktree.md feat: add comprehensive Git worktree management with follow mode and enhanced UI (#452) 2025-07-26 15:06:18 +02:00