FRP配置技能
This commit is contained in:
170
openclaw/xingyao/frp-query-skill/SKILL.md
Normal file
170
openclaw/xingyao/frp-query-skill/SKILL.md
Normal file
@@ -0,0 +1,170 @@
|
||||
---
|
||||
name: frp-query
|
||||
description: FRP (Fast Reverse Proxy) 配置查询技能。用于查询和管理内网服务器的 FRP 客户端配置信息,包括:(1) 查看指定服务器的 frpc.toml 配置文件内容,(2) 列出所有端口映射关系,(3) 查询特定服务的端口信息,(4) 检查 FRP 客户端运行状态。触发关键词:frp配置、frp端口、查看frp、frp列表、服务器 frp
|
||||
---
|
||||
|
||||
# FRP 配置查询技能
|
||||
|
||||
## 技能概述
|
||||
|
||||
本技能用于查询和管理比利哥家庭网络中各服务器的 FRP(Fast Reverse Proxy)客户端配置信息。
|
||||
|
||||
## 服务器配置
|
||||
|
||||
| 服务器 | 内网IP | SSH别名 | FRP目录 | 配置文件 |
|
||||
|--------|--------|---------|---------|----------|
|
||||
| macmini | 192.168.3.189 | `ssh macmini` | `/opt/frp/frp_0.65.0_darwin_arm64` | `frpc.toml` |
|
||||
| ubuntu1 | 192.168.3.47 | `ssh ubuntu1` | `/opt/frp/frp_0.65.0_linux_amd64` | `frpc.toml` |
|
||||
| ubuntu2 | 192.168.3.45 | `ssh ubuntu2` | `/opt/frp/frp_0.65.0_linux_amd64` | `frpc.toml` |
|
||||
| NAS | 192.168.3.17 | `ssh nas` | `/opt/frp_0.65.0_linux_amd64` | `frpc.toml` |
|
||||
|
||||
> ⚠️ **注意**: NAS 的 FRP 目录路径与其他服务器不同,没有中间的 `frp/` 子目录
|
||||
|
||||
## FRP 服务器信息
|
||||
|
||||
| 配置项 | 值 |
|
||||
|--------|-----|
|
||||
| serverAddr | 192.227.222.142 (VPS1) |
|
||||
| serverPort | 7000 |
|
||||
| auth.token | Gg8sqHJVgh42KQ0oTatMjl6AywWqAzaaT0B77a4qD46tXtoH9j9mXb2k1YitObhs |
|
||||
| 管理面板 | 127.0.0.1:7400 (admin/admin) |
|
||||
|
||||
## 查询命令
|
||||
|
||||
### 查看服务器 FRP 配置
|
||||
|
||||
```bash
|
||||
# 查看 macmini 配置
|
||||
ssh macmini "cat /opt/frp/frp_0.65.0_darwin_arm64/frpc.toml"
|
||||
|
||||
# 查看 ubuntu1 配置
|
||||
ssh ubuntu1 "cat /opt/frp/frp_0.65.0_linux_amd64/frpc.toml"
|
||||
|
||||
# 查看 ubuntu2 配置
|
||||
ssh ubuntu2 "cat /opt/frp/frp_0.65.0_linux_amd64/frpc.toml"
|
||||
|
||||
# 查看 NAS 配置 (路径不同)
|
||||
ssh nas "cat /opt/frp_0.65.0_linux_amd64/frpc.toml"
|
||||
```
|
||||
|
||||
### 查看 FRP 运行状态
|
||||
|
||||
```bash
|
||||
# Ubuntu 服务器 (systemd)
|
||||
ssh ubuntu1 "systemctl status frpc"
|
||||
|
||||
# macOS/NAS (tmux)
|
||||
ssh macmini "tmux attach -t frpc"
|
||||
```
|
||||
|
||||
### 重启 FRP 服务
|
||||
|
||||
```bash
|
||||
# Ubuntu
|
||||
ssh ubuntu1 "systemctl restart frpc"
|
||||
|
||||
# macOS
|
||||
# SSH 后进入 tmux 会话手动重启
|
||||
```
|
||||
|
||||
## 端口映射速查
|
||||
|
||||
### 按服务器分组
|
||||
|
||||
**macmini (RemotePort: 15151-18999)**
|
||||
| 服务 | RemotePort |
|
||||
|------|------------|
|
||||
| vaultwarden | 15151 |
|
||||
| n8n | 15679 |
|
||||
| drawio | 18085 |
|
||||
| it-tools | 18999 |
|
||||
| macmini-ssh | 60026 |
|
||||
|
||||
**ubuntu1 (RemotePort: 13000-19443)**
|
||||
| 服务 | RemotePort |
|
||||
|------|------------|
|
||||
| grafana | 13000 |
|
||||
| stq | 15173 |
|
||||
| stq-n8n | 15678 |
|
||||
| stq-admin | 17000 |
|
||||
| homarr | 17575 |
|
||||
| superset | 18777 |
|
||||
| tk | 18888 |
|
||||
| transmission | 19091 |
|
||||
| portainer | 19443 |
|
||||
| ubuntu1-ssh | 60022 |
|
||||
|
||||
**ubuntu2 (RemotePort: 18889, 60024)**
|
||||
| 服务 | RemotePort |
|
||||
|------|------------|
|
||||
| tk-dev | 18889 |
|
||||
| ubuntu2-ssh | 60024 |
|
||||
|
||||
**NAS (RemotePort: 10080-65005)**
|
||||
| 服务 | RemotePort |
|
||||
|------|------------|
|
||||
| nas_web | 10080 |
|
||||
| zipline | 13333 |
|
||||
| navidrome | 14533 |
|
||||
| nas | 15000 |
|
||||
| calibre | 18083 |
|
||||
| jellyfin | 18096 |
|
||||
| nas_ssh | 60023 |
|
||||
| mysql | 63307 |
|
||||
| webdav | 65005 |
|
||||
|
||||
### 按域名分组
|
||||
|
||||
| 域名 | 目标服务器 | RemotePort |
|
||||
|------|-----------|------------|
|
||||
| n8n.ishenwei.online | macmini | 15679 |
|
||||
| vaultwarden.ishenwei.online | macmini | 15151 |
|
||||
| it-tools.ishenwei.online | macmini | 18999 |
|
||||
| drawio.ishenwei.online | macmini | 18085 |
|
||||
| grafana.ishenwei.online | ubuntu1 | 13000 |
|
||||
| superset.ishenwei.online | ubuntu1 | 18777 |
|
||||
| dashboard.ishenwei.online | ubuntu1 | 17575 |
|
||||
| tk.ishenwei.online | ubuntu1 | 18888 |
|
||||
| transmission.ishenwei.online | ubuntu1 | 19091 |
|
||||
| tk-dev.ishenwei.online | ubuntu2 | 18889 |
|
||||
| nas.ishenwei.online | NAS | 15000 |
|
||||
| navidrome.ishenwei.online | NAS | 14533 |
|
||||
| calibre.ishenwei.online | NAS | 18083 |
|
||||
| jellyfin.ishenwei.online | NAS | 18096 |
|
||||
| zipline.ishenwei.online | NAS | 13333 |
|
||||
|
||||
## 输出格式示例
|
||||
|
||||
当用户询问 FRP 配置时,使用以下格式输出:
|
||||
|
||||
```
|
||||
📡 FRP 配置查询结果
|
||||
|
||||
• macmini
|
||||
• FRP目录: /opt/frp/frp_0.65.0_darwin_arm64
|
||||
• 代理数量: 5个
|
||||
• 主要端口: 60026(ssh), 15679(n8n), 15151(vaultwarden)...
|
||||
|
||||
• ubuntu1
|
||||
• FRP目录: /opt/frp/frp_0.65.0_linux_amd64
|
||||
• 代理数量: 10个
|
||||
• 主要端口: 60022(ssh), 13000(grafana), 18888(tk)...
|
||||
|
||||
• ubuntu2
|
||||
• FRP目录: /opt/frp/frp_0.65.0_linux_amd64
|
||||
• 代理数量: 2个
|
||||
• 主要端口: 60024(ssh), 18889(tk-dev)...
|
||||
|
||||
• NAS
|
||||
• FRP目录: /opt/frp_0.65.0_linux_amd64
|
||||
• 代理数量: 10个
|
||||
• 主要端口: 60023(ssh), 15000(nas), 18096(jellyfin)...
|
||||
```
|
||||
|
||||
## 触发场景
|
||||
|
||||
- 用户询问"xxx 服务器的 FRP 配置"
|
||||
- 用户询问"查看 frp 端口列表"
|
||||
- 用户询问"xxx 服务的端口是多少"
|
||||
- 用户要求"检查 frp 状态"
|
||||
- 用户询问"frp 映射了哪些端口"
|
||||
306
openclaw/xingyao/frp-query-skill/references/frpc-config.md
Normal file
306
openclaw/xingyao/frp-query-skill/references/frpc-config.md
Normal file
@@ -0,0 +1,306 @@
|
||||
# FRP 完整配置参考
|
||||
|
||||
本文档包含各服务器完整的 frpc.toml 配置内容。
|
||||
|
||||
---
|
||||
|
||||
## 1. MacMini 配置
|
||||
|
||||
### 配置文件路径
|
||||
`/opt/frp/frp_0.65.0_darwin_arm64/frpc.toml`
|
||||
|
||||
### 完整内容
|
||||
|
||||
```toml
|
||||
# frpc.toml
|
||||
# 客户端配置文件
|
||||
# 服务器地址与认证
|
||||
serverAddr = "192.227.222.142"
|
||||
serverPort = 7000
|
||||
auth.method = "token"
|
||||
auth.token = "Gg8sqHJVgh42KQ0oTatMjl6AywWqAzaaT0B77a4qD46tXtoH9j9mXb2k1YitObhs"
|
||||
|
||||
# 日志配置
|
||||
log.level = "info"
|
||||
log.maxDays = 3
|
||||
log.disablePrintColor = false
|
||||
|
||||
# 管理界面(可选)
|
||||
webServer.addr = "127.0.0.1"
|
||||
webServer.port = 7400
|
||||
webServer.user = "admin"
|
||||
webServer.password = "admin"
|
||||
|
||||
# 代理配置
|
||||
|
||||
[[proxies]]
|
||||
name = "macmini-ssh"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 22
|
||||
remotePort = 60026
|
||||
|
||||
[[proxies]]
|
||||
name = "n8n"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 5678
|
||||
remotePort = 15679
|
||||
|
||||
[[proxies]]
|
||||
name = "vaultwarden"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 5151
|
||||
remotePort = 15151
|
||||
|
||||
[[proxies]]
|
||||
name = "it-tools"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 8999
|
||||
remotePort = 18999
|
||||
|
||||
[[proxies]]
|
||||
name = "drawio"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 8085
|
||||
remotePort = 18085
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 2. Ubuntu1 配置
|
||||
|
||||
### 配置文件路径
|
||||
`/opt/frp/frp_0.65.0_linux_amd64/frpc.toml`
|
||||
|
||||
### 完整内容
|
||||
|
||||
```toml
|
||||
# frpc.toml
|
||||
# 客户端配置文件
|
||||
# 服务器地址与认证
|
||||
serverAddr = "192.227.222.142"
|
||||
serverPort = 7000
|
||||
auth.method = "token"
|
||||
auth.token = "Gg8sqHJVgh42KQ0oTatMjl6AywWqAzaaT0B77a4qD46tXtoH9j9mXb2k1YitObhs"
|
||||
|
||||
# 日志配置
|
||||
log.level = "info"
|
||||
log.maxDays = 3
|
||||
log.disablePrintColor = false
|
||||
|
||||
# 管理界面(可选)
|
||||
webServer.addr = "127.0.0.1"
|
||||
webServer.port = 7400
|
||||
webServer.user = "admin"
|
||||
webServer.password = "admin"
|
||||
|
||||
[[proxies]]
|
||||
name = "transmission"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 9091
|
||||
remotePort = 19091
|
||||
|
||||
[[proxies]]
|
||||
name = "grafana"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 3000
|
||||
remotePort = 13000
|
||||
|
||||
[[proxies]]
|
||||
name = "ubuntu1-ssh"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 22
|
||||
remotePort = 60022
|
||||
|
||||
[[proxies]]
|
||||
name = "homarr"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 7575
|
||||
remotePort = 17575
|
||||
|
||||
[[proxies]]
|
||||
name = "superset"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 8777
|
||||
remotePort = 18777
|
||||
|
||||
[[proxies]]
|
||||
name = "tk"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 8888
|
||||
remotePort = 18888
|
||||
|
||||
[[proxies]]
|
||||
name = "ubuntu1-portainer"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 9000
|
||||
remotePort = 19443
|
||||
|
||||
[[proxies]]
|
||||
name = "stq"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 5173
|
||||
remotePort = 15173
|
||||
|
||||
[[proxies]]
|
||||
name = "stq-admin"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 7000
|
||||
remotePort = 17000
|
||||
|
||||
[[proxies]]
|
||||
name = "stq-n8n"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 62000
|
||||
remotePort = 15678
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3. Ubuntu2 配置
|
||||
|
||||
### 配置文件路径
|
||||
`/opt/frp/frp_0.65.0_linux_amd64/frpc.toml`
|
||||
|
||||
### 完整内容
|
||||
|
||||
```toml
|
||||
# frpc.toml
|
||||
# 客户端配置文件
|
||||
# 服务器地址与认证
|
||||
serverAddr = "192.227.222.142"
|
||||
serverPort = 7000
|
||||
auth.method = "token"
|
||||
auth.token = "Gg8sqHJVgh42KQ0oTatMjl6AywWqAzaaT0B77a4qD46tXtoH9j9mXb2k1YitObhs"
|
||||
|
||||
# 日志配置
|
||||
log.level = "info"
|
||||
log.maxDays = 3
|
||||
log.disablePrintColor = false
|
||||
|
||||
# 管理界面(可选)
|
||||
webServer.addr = "127.0.0.1"
|
||||
webServer.port = 7400
|
||||
webServer.user = "admin"
|
||||
webServer.password = "admin"
|
||||
|
||||
[[proxies]]
|
||||
name = "ubuntu2-ssh"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 22
|
||||
remotePort = 60024
|
||||
|
||||
[[proxies]]
|
||||
name = "tk-dev"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 8888
|
||||
remotePort = 18889
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. NAS 配置
|
||||
|
||||
### 配置文件路径
|
||||
`/opt/frp_0.65.0_linux_amd64/frpc.toml`
|
||||
|
||||
> ⚠️ 注意:NAS 的路径与其他服务器不同
|
||||
|
||||
### 完整内容
|
||||
|
||||
```toml
|
||||
# FRP Client Configuration for NAS
|
||||
# Converted from frpc.ini
|
||||
|
||||
serverAddr = "192.227.222.142"
|
||||
serverPort = 7000
|
||||
|
||||
[auth]
|
||||
token = "Gg8sqHJVgh42KQ0oTatMjl6AywWqAzaaT0B77a4qD46tXtoH9j9mXb2k1YitObhs"
|
||||
|
||||
[[proxies]]
|
||||
name = "nas"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 5000
|
||||
remotePort = 15000
|
||||
|
||||
[[proxies]]
|
||||
name = "navidrome"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 4533
|
||||
remotePort = 14533
|
||||
|
||||
[[proxies]]
|
||||
name = "calibre"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 8083
|
||||
remotePort = 18083
|
||||
|
||||
[[proxies]]
|
||||
name = "webdav"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 5005
|
||||
remotePort = 65005
|
||||
|
||||
[[proxies]]
|
||||
name = "miniflux"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 8080
|
||||
remotePort = 18080
|
||||
|
||||
[[proxies]]
|
||||
name = "zipline"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 3333
|
||||
remotePort = 13333
|
||||
|
||||
[[proxies]]
|
||||
name = "nas_ssh"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 22
|
||||
remotePort = 60023
|
||||
|
||||
[[proxies]]
|
||||
name = "mysql"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 3307
|
||||
remotePort = 63307
|
||||
|
||||
[[proxies]]
|
||||
name = "nas_web"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 80
|
||||
remotePort = 10080
|
||||
|
||||
[[proxies]]
|
||||
name = "jellyfin"
|
||||
type = "tcp"
|
||||
localIP = "127.0.0.1"
|
||||
localPort = 8096
|
||||
remotePort = 18096
|
||||
```
|
||||
Reference in New Issue
Block a user