Files
frpc-console/readme.md
T
2026-07-23 22:25:02 +08:00

200 lines
5.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 🚀 frpc-console
> 轻量级 frpc 管理面板 —— 为你的内网穿透插上翅膀
[![Go Version](https://img.shields.io/badge/Go-1.21+-00ADD8?style=flat&logo=go)](https://golang.org/)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Release](https://img.shields.io/github/v/release/lxh2875931338/frpc-console)](https://github.com/lxh2875931338/frpc-console/releases)
---
## 📖 简介
**frpc-console** 是一个专为 [frp](https://github.com/fatedier/frp) 设计的轻量级管理工具。它解决了 frpc 配置文件手动维护繁琐、缺少可视化界面的痛点,让你在浏览器中轻松管理所有隧道。
### ✨ 核心特性
- 🔐 **首次启动引导** —— Web 端完成管理员注册,无需 CLI 交互
- 📋 **隧道全生命周期管理** —— 增删改查 + 一键启用/禁用
- 📦 **导入/导出 TOML** —— 无缝迁移现有 frpc 配置
- 🔄 **配置热加载** —— 修改即生效,无需重启 frpc
- 🖥️ **多平台支持** —— Windows / Linux / ARM 全平台兼容
- 🐳 **容器化就绪** —— 提供 Docker 镜像,开箱即用
- 🎨 **深色磨砂玻璃 UI** —— 现代化视觉体验,日夜皆宜
### 🎯 与 Podux 的对比
| 特性 | frpc-console | Podux |
|---|---|---|
| 数据库 | SQLite (几 MB) | PocketBase (数百 MB) |
| 前端 | Vue CDN (无需构建) | React + Webpack |
| 内存占用 | ~50 MB | 1GB+ (实测 OOM) |
| 部署方式 | 单二进制 / Docker | Docker 专用 |
| 多平台支持 | ✅ 原生交叉编译 | ❌ 需自行构建 |
---
## 🚀 快速开始
### 方式一:直接运行二进制
从 [Releases](https://github.com/lxh2875931338/frpc-console/releases) 下载对应平台版本:
```bash
# Linux / macOS
chmod +x frpc-console
./frpc-console
# Windows
frpc-console.exe
```
首次启动会在终端提示设置管理员账户,之后访问 http://localhost:8080 即可。
### 方式二:Docker 运行
```bash
docker run -d \
--name frpc-console \
-p 8080:8080 \
-v ./data:/app/data \
lxh2875931338/frpc-console:latest
```
### 方式三:源码编译
```bash
git clone https://github.com/lxh2875931338/frpc-console.git
cd frpc-console
go mod tidy
go build -o frpc-console .
./frpc-console
```
## 🗂️ 项目结构
```txt
frpc-console/
├── main.go # 入口
├── api.go # HTTP 路由 & Handler
├── db.go # SQLite 数据库操作
├── auth.go # JWT 认证 & 密码管理
├── frp.go # frpc 管理核心逻辑
├── toml_parser.go # TOML 解析器
├── static/ # 前端静态资源
│ ├── index.html
│ ├── app.js
│ ├── style-1.css # 全局基础样式
│ ├── style-2.css # 登录页样式
│ └── style-3.css # 主界面样式
├── bin/ # 内嵌 frpc 二进制 (多平台)
│ ├── frpc_windows_amd64.exe
│ ├── frpc_linux_amd64
│ └── frpc_linux_arm64
├── frpc.tmpl # frpc 配置模板
├── Dockerfile
└── go.mod
```
## ⚙️ 配置说明
### 环境变量
| 变量 | 说明 | 默认值 |
|---|---|---|
| PORT | 监听端口 | 8080 |
### 数据存储
· 数据库文件:./frpc-console.db
· frpc 配置文件:./frpc.toml
· frpc 日志文件:./frpc.log
---
## 🛠️ 开发指南
```bash
# 克隆项目
git clone https://github.com/lxh2875931338/frpc-console.git
cd frpc-console
# 安装依赖
go mod tidy
# 开发模式运行
go run .
# 编译生产版本
go build -ldflags="-s -w" -o frpc-console .
```
## 前端开发
前端使用 Vue 3 CDN + Naive UI,无需额外构建工具。修改 static/ 目录下的文件后,刷新浏览器即可预览效果。
---
### 📦 构建 Docker 镜像
```bash
# 构建 amd64 镜像
docker build -t frpc-console:amd64 .
# 多架构构建 (需要 buildx)
docker buildx build --platform linux/amd64,linux/arm64 -t frpc-console:latest --push .
```
---
## 🔧 常见问题
#### Q: 如何修改管理员密码?
登录后,在「全局配置」页面顶部找到「账户管理」区域,输入当前密码和新密码即可。
#### Q: 如何导入现有的 frpc.toml
在「隧道列表」页面点击「导入 TOML」,选择你的 frpc.toml 文件即可。
#### Q: frpc 启动失败怎么办?
检查 frpc.toml 配置是否正确,或查看 ./frpc.log 日志文件。
#### Q: 支持哪些 frp 版本?
目前支持情况如下:
| 系统 | 架构版本 | 版本号 |
|---|---|---|
| Linux | AMD64/x86-64 | 0.70.0 |
| Linux | ARM64/Aarch64 | 0.70.0 |
| Windows | AMD64/x86-64 | 0.69.0 |
---
## 📝 更新日志
### 1.0-Release (2026-07-23)
· 🎉 首次发布</br>
· ✨ 支持隧道增删改查</br>
· ✨ 支持 TOML 导入/导出</br>
· ✨ 首次启动 Web 注册</br>
· ✨ 深色磨砂玻璃 UI</br>
· ✨ 多平台 frpc 自动适配</br>
· 🐳 Docker 镜像支持
---
## 📄 许可证
MIT License © 2026 lxh2875931338
---
## 🙏 致谢
· fatedier/frp —— 强大的内网穿透工具</br>
· gin-gonic/gin —— 高性能 Go Web 框架</br>
· vuejs/vue —— 渐进式 JavaScript 框架