-
Notifications
You must be signed in to change notification settings - Fork 5
Add automatic Tailscale Serve integration #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| # Tailscale Integration | ||
|
|
||
| Perry automatically detects and integrates with [Tailscale](https://tailscale.com) to provide secure HTTPS access to your workspaces over your private network. | ||
|
|
||
| ## How It Works | ||
|
|
||
| When you start the Perry agent, it checks if Tailscale is running on your machine. If Tailscale is detected with HTTPS enabled, Perry automatically starts [Tailscale Serve](https://tailscale.com/kb/1312/serve) to expose the agent over HTTPS using your Tailscale domain. | ||
|
|
||
| This gives you: | ||
| - **Trusted HTTPS certificates** - No browser warnings, valid certificates from Let's Encrypt | ||
| - **Private network access** - Access Perry from any device on your tailnet | ||
| - **User identity** - Perry can identify who's making requests via Tailscale headers | ||
|
|
||
| ## Setup | ||
|
|
||
| ### 1. Install Tailscale | ||
|
|
||
| Follow the [Tailscale installation guide](https://tailscale.com/download) for your platform. | ||
|
|
||
| ### 2. Enable HTTPS Certificates | ||
|
|
||
| Tailscale HTTPS must be enabled for your tailnet. This is typically enabled by default, but you can verify in your [Tailscale admin console](https://login.tailscale.com/admin/dns). | ||
|
|
||
| ### 3. Set Operator Permissions (Required) | ||
|
|
||
| By default, Tailscale Serve requires root permissions. To allow Perry to use it without sudo, run: | ||
|
|
||
| ```bash | ||
| sudo tailscale set --operator=$USER | ||
| ``` | ||
|
|
||
| This only needs to be done once per machine. | ||
|
|
||
| ### 4. Start Perry | ||
|
|
||
| ```bash | ||
| perry agent run | ||
| ``` | ||
|
|
||
| If Tailscale is properly configured, you'll see: | ||
|
|
||
| ``` | ||
| [agent] Tailscale detected: your-machine.tail-scale.ts.net | ||
| [agent] Tailscale Serve enabled | ||
| [agent] Agent running at http://localhost:7391 | ||
| [agent] Tailscale HTTPS: https://your-machine.tail-scale.ts.net | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### "Tailscale Serve requires operator permissions" | ||
|
|
||
| You'll see this message if Tailscale Serve can't start: | ||
|
|
||
| ``` | ||
| [agent] Tailscale Serve requires operator permissions | ||
| [agent] To enable: Run: sudo tailscale set --operator=$USER | ||
| [agent] Continuing without HTTPS... | ||
| ``` | ||
|
|
||
| **Fix:** Run `sudo tailscale set --operator=$USER` and restart the agent. | ||
|
|
||
| ### "Tailscale HTTPS not enabled in tailnet" | ||
|
|
||
| Your tailnet doesn't have HTTPS certificates enabled. Check your [Tailscale admin DNS settings](https://login.tailscale.com/admin/dns) and ensure "HTTPS Certificates" is enabled. | ||
|
|
||
| ### Tailscale Not Detected | ||
|
|
||
| If Perry doesn't detect Tailscale at all, verify Tailscale is running: | ||
|
|
||
| ```bash | ||
| tailscale status | ||
| ``` | ||
|
|
||
| ## Graceful Fallback | ||
|
|
||
| Perry always starts successfully regardless of Tailscale status: | ||
|
|
||
| | Scenario | Behavior | | ||
| |----------|----------| | ||
| | Tailscale not installed | Agent starts normally on localhost | | ||
| | Tailscale running, HTTPS enabled, operator set | HTTPS via Tailscale Serve | | ||
| | Tailscale running, HTTPS enabled, no operator | Logs fix instructions, falls back to localhost | | ||
| | Tailscale running, HTTPS not enabled | Falls back to localhost | | ||
|
|
||
| ## Security Considerations | ||
|
|
||
| When using Tailscale Serve: | ||
| - Traffic is encrypted end-to-end within your tailnet | ||
| - Perry can identify users via `Tailscale-User-*` headers | ||
| - Access is limited to devices on your tailnet | ||
|
|
||
| Without Tailscale, Perry binds to localhost only by default. For remote access without Tailscale, consider using a reverse proxy with proper authentication. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.