docs(tailscale-derp): 完善登录指南并更新docker-compose配置

1. 在README中细化tailscale容器登录步骤,增加状态验证说明
2. 更新docker-compose.yml,添加TS_USERSPACE环境变量和userspace-networking命令
3. 为DERP_VERIFY_CLIENTS设置默认值true
This commit is contained in:
arch3rPro
2026-04-01 21:15:30 +08:00
parent a81c787a0b
commit bee2a5a0fc
3 changed files with 27 additions and 9 deletions

View File

@@ -18,20 +18,28 @@ Tailscale DERP 中继服务器使用完整配置方式包含tailscale和de
### 登录指南 ### 登录指南
部署完成后,需要获取tailscale登录链接 部署完成后tailscale容器需要登录认证才能正常工作
1. **查看tailscale容器日志获取登录链接**
```bash ```bash
# 查看tailscale容器日志获取登录链接 # 查看tailscale容器日志
docker logs -f <容器名称>-tailscale docker logs -f <容器名称>-tailscale
``` ```
在日志中找到类似以下内容的登录链接 2. **在日志中找到登录链接**
``` ```
Switching ipn state NoState -> NeedsLogin (WantRunning=false, nm=false)
To authenticate, visit: To authenticate, visit:
https://login.tailscale.com/a/xxxxxxx https://login.tailscale.com/a/xxxxxxx
``` ```
复制链接到浏览器打开并登录Tailscale账户 3. **复制链接到浏览器打开并登录Tailscale账户**
4. **验证登录状态**
登录成功后,再次查看日志应该显示类似以下内容:
```
Switching ipn state NeedsLogin -> Running (WantRunning=true, nm=false)
```
### 防火墙配置 ### 防火墙配置

View File

@@ -18,20 +18,28 @@ Tailscale DERP relay server with complete configuration, including coexistence o
### Login Guide ### Login Guide
After deployment, you need to get the tailscale login link: After deployment, the tailscale container needs login authentication to work properly:
1. **Check tailscale container logs for login link**:
```bash ```bash
# Check tailscale container logs for login link # Check tailscale container logs
docker logs -f <container-name>-tailscale docker logs -f <container-name>-tailscale
``` ```
Find the login link in the logs similar to: 2. **Find the login link in the logs**:
``` ```
Switching ipn state NoState -> NeedsLogin (WantRunning=false, nm=false)
To authenticate, visit: To authenticate, visit:
https://login.tailscale.com/a/xxxxxxx https://login.tailscale.com/a/xxxxxxx
``` ```
Copy the link to browser and login to your Tailscale account. 3. **Copy the link to browser and login to your Tailscale account**
4. **Verify login status**:
After successful login, check the logs again should show:
```
Switching ipn state NeedsLogin -> Running (WantRunning=true, nm=false)
```
### Firewall Configuration ### Firewall Configuration

View File

@@ -5,11 +5,13 @@ services:
- TS_HOSTNAME=tailscale-docker - TS_HOSTNAME=tailscale-docker
- TS_AUTH_ONCE=true - TS_AUTH_ONCE=true
- TS_STATE_DIR=/data - TS_STATE_DIR=/data
- TS_USERSPACE=true
volumes: volumes:
- tailscale:/var/run/tailscale - tailscale:/var/run/tailscale
- tailscale_data:/data - tailscale_data:/data
networks: networks:
- 1panel-network - 1panel-network
command: tailscaled --tun=userspace-networking --socks5-server=localhost:1055
derper: derper:
image: ghcr.io/yangchuansheng/ip_derper:latest image: ghcr.io/yangchuansheng/ip_derper:latest
@@ -23,7 +25,7 @@ services:
volumes: volumes:
- tailscale:/var/run/tailscale - tailscale:/var/run/tailscale
environment: environment:
- DERP_VERIFY_CLIENTS=${DERP_VERIFY_CLIENTS} - DERP_VERIFY_CLIENTS=${DERP_VERIFY_CLIENTS:-true}
depends_on: depends_on:
- tailscale - tailscale
labels: labels: