Tailscale Integration Guide for VibeTunnel iOS
Overview
Tailscale integration allows you to securely connect to your VibeTunnel servers from anywhere without complex network configuration. This guide explains how to set up and use Tailscale with the VibeTunnel iOS app.What is Tailscale?
Tailscale creates a secure, private network (called a tailnet) between your devices using WireGuard encryption. With VibeTunnel’s Tailscale integration, you can:- Access your Mac’s terminal sessions from anywhere
- No port forwarding or firewall configuration needed
- Automatic secure connections between devices
- Seamless switching between local and remote access
Prerequisites
Before setting up Tailscale in VibeTunnel iOS:- Tailscale Account: Create a free account at tailscale.com
- Tailscale on Mac: Install Tailscale on your Mac running VibeTunnel server
- OAuth Credentials: You’ll need to create OAuth client credentials (instructions below)
Setting Up OAuth Client Credentials
VibeTunnel iOS uses OAuth to securely access your Tailscale network. Here’s how to create the required credentials:Step 1: Access Tailscale Admin Console
- Sign in to Tailscale Admin Console
- Navigate to Settings → OAuth clients
Step 2: Generate OAuth Client
- Click “Generate OAuth client”
- Configure the client:
- Description: Enter “VibeTunnel iOS” (or any name you prefer)
- Scopes: Add
devicesscope with Read access - This allows the app to discover VibeTunnel servers on your network
Step 3: Save Your Credentials
After creating the client, you’ll receive:- Client ID: Starts with
k(e.g.,k4cdcxxxxxxxx) - Client Secret: Starts with
tskey-client-(e.g.,tskey-client-xxxxxx)
Configuring Tailscale in VibeTunnel iOS
Initial Setup
- Open VibeTunnel iOS app
- Go to Settings → Tailscale
- Tap “Configure Tailscale”
- Enter your credentials:
- Paste your Client ID
- Paste your Client Secret
- Tap Save
Connection Status Indicators
The Tailscale settings page shows:- 🟢 Connected: Successfully connected to Tailscale
- 🟠 Not Connected: Credentials configured but connection failed
- 🔴 Not Configured: No credentials set up yet
Understanding Server Connection Modes
VibeTunnel servers can operate in two modes when accessed via Tailscale:Public Mode (HTTPS with Tailscale Funnel)
When your Mac has Tailscale Funnel enabled:- Server is accessible from the internet
- Uses HTTPS with valid SSL certificates
- Shows 🔒 lock icon next to server URL
- Ideal for accessing from anywhere
Private Mode (HTTP with Tailscale Serve)
When using standard Tailscale networking:- Server only accessible within your tailnet
- Uses HTTP (HTTPS certificates don’t work on mobile)
- Shows 🔓 unlock icon next to server URL
- Perfect for private, secure access
Automatic Mode Switching
The iOS app intelligently handles mode transitions:- On App Launch: Checks all saved Tailscale servers for current status
- Connection Attempts: Automatically falls back from HTTPS to HTTP if needed
- Visual Updates: Lock/unlock icons update to reflect current connection type
- Seamless Experience: You don’t need to manually reconfigure when server modes change
Using Tailscale Servers
Discovering Servers
With Tailscale configured:- The app automatically discovers VibeTunnel servers on your tailnet
- Found servers appear in the Discovered Servers section
- Tap Add to save a server for quick access
Connecting to Servers
- Saved Tailscale servers appear in your server list
- Tap any server card to connect
- The app will:
- Check server availability
- Determine best connection method (HTTPS/HTTP)
- Establish secure connection
- Show authentication prompt if needed
Connection Features
- Entire Card Tappable: Tap anywhere on the server card to connect
- Status Indicators: Visual feedback for connection state
- Error Alerts: Clear messages if connection fails
- Automatic Retry: Falls back to HTTP if HTTPS fails
Settings and Preferences
Understanding the Three Key Switches
1. Auto-Discover Servers (Default: ON)
- What it does: Enables automatic discovery of VibeTunnel servers on your Tailscale network
- When ON: The app uses Tailscale API to find servers running VibeTunnel
- When OFF: Tailscale discovery is disabled, but you can still manually add Tailscale servers
- Important: This does NOT affect Bonjour discovery - local network discovery continues working
2. Prefer Tailscale Connections (Default: OFF)
- What it does: Chooses Tailscale connection when both local and Tailscale are available
- When ON: Always uses Tailscale connection if available (useful for consistent remote access)
- When OFF: Uses the best available connection (typically local when on same network)
- Example: If you’re at home with your Mac, OFF uses local network (faster), ON uses Tailscale (consistent)
- Note: Does NOT disable Bonjour or local connections - just changes preference
3. Auto-Refresh Discovery (Default: ON)
- What it does: Automatically checks for new/changed servers every 30 seconds
- When ON: Continuously monitors for new VibeTunnel servers joining your tailnet
- When OFF: Only discovers servers when you manually refresh or open the app
- Requirement: Auto-Discover Servers must be ON for this to work
- Battery Impact: Minimal - uses efficient API polling
Recommended Settings
For Most Users:- ✅ Auto-Discover Servers: ON
- ❌ Prefer Tailscale Connections: OFF (use local when available, Tailscale when remote)
- ✅ Auto-Refresh Discovery: ON
- ✅ Auto-Discover Servers: ON
- ✅ Prefer Tailscale Connections: ON (consistent experience everywhere)
- ✅ Auto-Refresh Discovery: ON
- ✅ Auto-Discover Servers: ON
- ❌ Prefer Tailscale Connections: OFF
- ❌ Auto-Refresh Discovery: OFF (manually refresh when needed)
How Discovery Works
The app uses two independent discovery methods:-
Bonjour/mDNS (Always Active)
- Discovers servers on your local network
- Works without any configuration
- Cannot be disabled (and shouldn’t be!)
- Shows servers with network icon
-
Tailscale Discovery (Configurable)
- Discovers servers through Tailscale API
- Requires OAuth credentials
- Controlled by the three switches above
- Shows servers with Tailscale badge
Managing Discovered Servers
- Discovered servers can be added to your saved servers list
- The app remembers which servers you’ve already added
- Servers show their Tailscale hostname and IP address
Troubleshooting
Connection Issues
Problem: Can’t connect to server- Verify server is running on your Mac
- Check Tailscale is connected on both devices
- Ensure OAuth token hasn’t expired (auto-refreshes after 1 hour)
- Try Retry Connection button
- The app will prompt for credentials when needed
- Credentials are securely stored in iOS Keychain
- Re-enter credentials if authentication fails persistently
Mode Switching Issues
Problem: Server shows wrong lock icon- The app updates on launch and connection
- Pull down to refresh the server list
- Icons reflect actual connection capability, not preference
- This is normal for private mode
- App automatically falls back to HTTP
- No action needed - this is handled automatically
Discovery Problems
Problem: No servers found- Ensure VibeTunnel server is running on your Mac
- Verify Mac has Tailscale installed and connected
- Check OAuth client has
devices:readpermission - Tap Refresh Servers to manually scan
Credential Issues
Problem: “Invalid credentials” error- Client ID must start with
k - Client Secret must start with
tskey-client- - Regenerate OAuth client if credentials are lost
- Use Reset Configuration to start fresh
Security Considerations
OAuth Token Management
- Access tokens expire after 1 hour
- App automatically refreshes tokens using stored credentials
- Credentials stored securely in iOS Keychain
- Tokens never leave your device
Connection Security
- Tailscale Funnel (Public): End-to-end HTTPS encryption
- Tailscale Network (Private): WireGuard VPN encryption
- All connections authenticated before establishing
- No passwords transmitted over network
Best Practices
- Protect OAuth Credentials: Never share Client Secret
- Regular Updates: Keep VibeTunnel and Tailscale updated
- Monitor Access: Review connected devices in Tailscale admin
- Use Strong Authentication: Enable 2FA on Tailscale account
Advanced Features
Health Checks
The app performs automatic health checks:- On app startup for all Tailscale servers
- Before each connection attempt
- Updates server profiles with current capabilities
- Only applies to Tailscale-discovered servers
Fallback Logic
Smart connection fallback:- Try HTTPS if server reports it’s available
- Fall back to HTTP if HTTPS fails
- Show appropriate visual indicators
- Remember successful connection method
Server Profile Management
- Tailscale servers marked with special flag
- Health checks only run for Tailscale servers
- Bonjour and manually added servers unaffected
- Profiles automatically update when server capabilities change
Resetting Tailscale Configuration
If you need to start over:- Go to Settings → Tailscale
- Scroll to Danger Zone
- Tap Reset Tailscale Configuration
- Confirm the reset
- Remove stored OAuth credentials
- Clear all discovered servers
- Reset preferences to defaults
- Require re-entering credentials
Frequently Asked Questions
Q: Why does my server sometimes show a lock and sometimes not? A: The lock icon indicates HTTPS availability. It changes based on whether Tailscale Funnel is enabled on your Mac. Q: Do I need the Tailscale app on my iPhone? A: No, VibeTunnel iOS handles everything through the OAuth API. The Tailscale iOS app is not required. Q: Can I use Tailscale and local network discovery together? A: Yes! The app supports both Tailscale and Bonjour discovery simultaneously. Q: Is my terminal data encrypted? A: Yes, all connections use either HTTPS (Funnel) or WireGuard VPN encryption (Tailscale network). Q: What happens if my OAuth token expires? A: The app automatically refreshes tokens using your stored credentials. You’ll only need to re-enter credentials if they become invalid.Getting Help
If you encounter issues not covered in this guide:- Check the VibeTunnel Mac app is running
- Verify Tailscale status on both devices
- Review error messages in the app
- Check server logs using
vtlog.shon your Mac
- VibeTunnel Issues: GitHub Issues
- Tailscale Documentation: tailscale.com/kb
Summary
Tailscale integration makes VibeTunnel incredibly powerful for remote access:- Simple Setup: Just OAuth credentials, no network configuration
- Automatic Discovery: Finds your servers instantly
- Smart Connections: Handles HTTPS/HTTP automatically
- Secure Access: Enterprise-grade encryption
- Seamless Experience: Works like magic