178 lines
4.9 KiB
Markdown
178 lines
4.9 KiB
Markdown
---
|
||
categories:
|
||
- '[[LLM Wiki]]'
|
||
tags:
|
||
- wiki
|
||
- tool
|
||
- network
|
||
created: 2026-04-08
|
||
source: '[[Gitea个人Git服务部署指南]]'
|
||
type: tool
|
||
aliases:
|
||
- fast-reverse-proxy
|
||
- 内网穿透工具
|
||
relations:
|
||
- type: part_of
|
||
target: '[[Gitea-部署指南]]'
|
||
description: 同源:Gitea个人Git服务部署指南
|
||
confidence: 3
|
||
---
|
||
|
||
[raw:Gitea个人Git服务部署指南:19]# FRP (Fast Reverse Proxy)
|
||
|
||
> **一句话定义**:开源的内网穿透工具,用于将本地服务暴露到公网。
|
||
|
||
## 基本信息
|
||
|
||
| 属性 | 值 |
|
||
|
|
||
------|
|
||
-----|
|
||
| 全称 | Fast Reverse Proxy |
|
||
| 官网 | <https://github.com/fatedier/frp> |
|
||
| 许可证 | Apache 2.0 |
|
||
| 编程语言 | Go |
|
||
|
||
## 工作原理
|
||
|
||
```
|
||
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
||
│ 本地服务 │ │ FRP 服务器 │ │ 公网用户 │
|
||
│ (Gitea:8418) │ ──────► │ (VPS:7000/13000)│ ──────► │ (git.haiguang.xyz)│
|
||
│ FRP 客户端 │ │ 转发规则 │ │ 浏览器/客户端 │
|
||
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
||
```
|
||
|
||
## 核心组件
|
||
|
||
| 组件 | 角色 | 配置文件 |
|
||
|------|------|----------|
|
||
| `frps` | 服务端(部署在 VPS) | `frps.toml` |
|
||
| `frpc` | 客户端(部署在 NAS) | `frpc.toml` |
|
||
|
||
## 在 Gitea 部署中的作用
|
||
|
||
在 [[Gitea-部署指南]] 中,FRP 用于:
|
||
|
||
1. **Web 服务暴露**:将群晖 NAS 上的 Gitea (8418) 映射到公网 (13000)
|
||
2. **SSH 服务暴露**:将本地 Git SSH 端口 (10022) 映射到公网 (10022)
|
||
|
||
### 配置示例 (frpc.toml)
|
||
|
||
```toml
|
||
serverAddr = "82.156.57.104"
|
||
serverPort = 7000
|
||
|
||
[[proxies]]
|
||
name = "gitea-web"
|
||
type = "tcp"
|
||
localIP = "127.0.0.1"
|
||
localPort = 8418
|
||
remotePort = 13000
|
||
|
||
[[proxies]]
|
||
name = "gitea-ssh"
|
||
type = "tcp"
|
||
localIP = "127.0.0.1"
|
||
localPort = 10022
|
||
remotePort = 10022
|
||
```
|
||
|
||
## 与其他方案的对比
|
||
|
||
| 方案 | 优点 | 缺点 |
|
||
|------|------|------|
|
||
| **FRP** | 开源、免费、可控 | 需要 VPS |
|
||
| **Tailscale** | 简单、无需 VPS | 需要两端安装 |
|
||
| **Cloudflare Tunnel** | 免费、无需 VPS | 需要 Cloudflare 账号 |
|
||
|
||
详见 [[Gitea-部署指南]]
|
||
|
||
## 相关页面
|
||
|
||
- [[Gitea-部署指南]] — 使用 FRP 部署 Gitea 的完整指南
|
||
- [[内网穿透]] — 内网穿透技术概念
|
||
- [[Gitea]] — Git 托管服务
|
||
|
||
## 来源
|
||
|
||
- [[Gitea个人Git服务部署指南]] — 完整部署指南
|
||
|
||
[raw:Gitea个人Git服务部署指南:19]# FRP (Fast Reverse Proxy)
|
||
|
||
> **一句话定义**:开源的内网穿透工具,用于将本地服务暴露到公网。
|
||
|
||
## 基本信息
|
||
|
||
| 属性 | 值 |
|
||
|------|-----|
|
||
| 全称 | Fast Reverse Proxy |
|
||
| 官网 | <https://github.com/fatedier/frp> |
|
||
| 许可证 | Apache 2.0 |
|
||
| 编程语言 | Go |
|
||
|
||
## 工作原理
|
||
|
||
```
|
||
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
||
│ 本地服务 │ │ FRP 服务器 │ │ 公网用户 │
|
||
│ (Gitea:8418) │ ──────► │ (VPS:7000/13000)│ ──────► │ (git.haiguang.xyz)│
|
||
│ FRP 客户端 │ │ 转发规则 │ │ 浏览器/客户端 │
|
||
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
||
```
|
||
|
||
## 核心组件
|
||
|
||
| 组件 | 角色 | 配置文件 |
|
||
|------|------|----------|
|
||
| `frps` | 服务端(部署在 VPS) | `frps.toml` |
|
||
| `frpc` | 客户端(部署在 NAS) | `frpc.toml` |
|
||
|
||
## 在 Gitea 部署中的作用
|
||
|
||
在 [[Gitea-部署指南]] 中,FRP 用于:
|
||
|
||
1. **Web 服务暴露**:将群晖 NAS 上的 Gitea (8418) 映射到公网 (13000)
|
||
2. **SSH 服务暴露**:将本地 Git SSH 端口 (10022) 映射到公网 (10022)
|
||
|
||
### 配置示例 (frpc.toml)
|
||
|
||
```toml
|
||
serverAddr = "82.156.57.104"
|
||
serverPort = 7000
|
||
|
||
[[proxies]]
|
||
name = "gitea-web"
|
||
type = "tcp"
|
||
localIP = "127.0.0.1"
|
||
localPort = 8418
|
||
remotePort = 13000
|
||
|
||
[[proxies]]
|
||
name = "gitea-ssh"
|
||
type = "tcp"
|
||
localIP = "127.0.0.1"
|
||
localPort = 10022
|
||
remotePort = 10022
|
||
```
|
||
|
||
## 与其他方案的对比
|
||
|
||
| 方案 | 优点 | 缺点 |
|
||
|------|------|------|
|
||
| **FRP** | 开源、免费、可控 | 需要 VPS |
|
||
| **Tailscale** | 简单、无需 VPS | 需要两端安装 |
|
||
| **Cloudflare Tunnel** | 免费、无需 VPS | 需要 Cloudflare 账号 |
|
||
|
||
详见 [[Gitea-部署指南]]
|
||
|
||
## 相关页面
|
||
|
||
- [[Gitea-部署指南]] — 使用 FRP 部署 Gitea 的完整指南
|
||
- [[内网穿透]] — 内网穿透技术概念
|
||
- [[Gitea]] — Git 托管服务
|
||
|
||
## 来源
|
||
|
||
- [[Gitea个人Git服务部署指南]] — 完整部署指南
|