Phase 0-2: Schema cleanup, typed relations, event-driven automation

- Phase 0: AGENTS.md cleanup (dedup quotes, renumber sections, merge qmd)
- Phase 1: typed relations (manage-relations.py, graph-search.py, check-staleness.py, detect-conflicts.py)
- Phase 2: frontmatter validator, weekly lint, knowledge promotion, git hooks
- Fix .gitignore to track tools/ and .githooks/
- Fix git remote URL (remove plaintext token)
- New wiki pages: 504 pages, 34 raw sources
This commit is contained in:
hehaiguang1123
2026-07-01 08:05:43 +08:00
parent e544d6e04a
commit a6f05ab2d5
1067 changed files with 522992 additions and 819 deletions
+72
View File
@@ -0,0 +1,72 @@
---
categories:
- "[[LLM Wiki]]"
tags:
- wiki
- concept
- network
created: 2026-04-08
source: "[[Gitea个人Git服务部署指南]]"
type: concept
aliases:
- NAT traversal
- 端口映射
---
# 内网穿透
> **一句话定义**:将内网服务暴露到公网的技术,使得外部用户可以通过域名或 IP 访问本地部署的服务。
## 核心概念
### 问题背景
大多数家庭网络和局域网设备没有公网 IP,无法直接从互联网访问。
```
用户 ──► 公网 IP/VPS ──► 内网设备 (NAS/电脑)
需要内网穿透
```
## 主流方案对比
| 方案 | 原理 | 优点 | 缺点 |
|------|------|------|------|
| **FRP** | 中继代理 | 开源、可控、需要 VPS | 有流量限制 |
| **Tailscale** | WireGuard 隧道 | 简单、安全 | 需要两端安装 |
| **Cloudflare Tunnel** | Cloudflare 代理 | 免费、无需 VPS | 依赖第三方 |
| **ngrok** | 隧道服务 | 简单易用 | 免费版有限制 |
| **花生壳** | 传统内网穿透 | 国内品牌 | 速度慢、收费 |
## 在个人服务部署中的应用
在 [[Gitea-部署指南]] 中,内网穿透用于:
1. **Git 服务暴露**:通过 FRP 将群晖 NAS 上的 Gitea 映射到公网
2. **SSH 访问**:将本地 SSH 端口暴露供 Git 操作
### 部署架构图
```
┌─────────────────────────────────────────────────────────┐
│ 公网 │
│ 用户 ──► git.haiguang.xyz (域名) ──► FRP 服务器 │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ 群晖 NAS (内网) │
│ FRP 客户端 ──► Gitea (localhost:8418) │
└─────────────────────────────────────────────────────────┘
```
## 相关页面
- [[FRP]] — 具体的内网穿透工具
- [[Gitea-部署指南]] — 使用 FRP 部署 Gitea 的完整指南
- [[Gitea]] — Git 托管服务
## 来源
- [[Gitea个人Git服务部署指南]] — 完整部署指南