Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54e1b343cc | ||
|
|
b2b6f129e6 | ||
|
|
1136797a36 | ||
|
|
8a44a6ed87 | ||
|
|
0736130769 | ||
|
|
1bdd35a234 | ||
|
|
e37661c6e9 | ||
|
|
1578832510 | ||
|
|
cfbbf31543 | ||
|
|
3a1ad7ce65 | ||
|
|
01c3a70d2b | ||
|
|
3cc8d9406d | ||
|
|
edc2a0416d | ||
|
|
69afa49d1c | ||
|
|
bb18a9e3d1 | ||
|
|
841fef390b | ||
|
|
96f3db329e | ||
|
|
dcc2854b7d | ||
|
|
fd9d8b3ee7 | ||
|
|
d29e37101c | ||
|
|
c119ae3d2f | ||
|
|
99f3247bbc | ||
|
|
1ddaf89492 | ||
|
|
71c1f7633d | ||
|
|
893e5bc670 | ||
|
|
560e8e71e3 | ||
|
|
9f8aa570af | ||
|
|
6dc2c9d7b5 | ||
|
|
c684788e72 | ||
|
|
d8b8a20552 | ||
|
|
a0f47c72aa | ||
|
|
5f8ec287be | ||
|
|
c4315676ef | ||
|
|
9037c7fe05 | ||
|
|
50e82a58a1 | ||
|
|
ac6f2e88ce | ||
|
|
2d78f1f533 | ||
|
|
bbda5b05ca | ||
|
|
59e795f453 | ||
|
|
447cb7930c | ||
|
|
fbdfb273c8 | ||
|
|
422ebd5f16 | ||
|
|
c0b4c7bb94 | ||
|
|
d10538f1c3 | ||
|
|
5cfc402a5e | ||
|
|
d6e76e0fe9 | ||
|
|
443127a3bf | ||
|
|
3d74061ab6 | ||
|
|
fa2211e5ab | ||
|
|
d07531c8d0 | ||
|
|
1569ff2bd1 | ||
|
|
247cf6a2b2 | ||
|
|
46b28788a0 | ||
|
|
00cdea5af4 | ||
|
|
be760a327e | ||
|
|
80525f1e4e | ||
|
|
fce9272cf0 | ||
|
|
32e26c322d | ||
|
|
794346e45a | ||
|
|
b2922b54d9 | ||
|
|
e14fca351e | ||
|
|
72a19ef017 |
No files matched your search
@@ -19,8 +19,8 @@ build/dist/
|
||||
dist/
|
||||
*.tar.gz
|
||||
*.zip
|
||||
frpc-hub
|
||||
frpc-hub.exe
|
||||
podux
|
||||
podux.exe
|
||||
|
||||
# Frontend (built inside Docker)
|
||||
site/node_modules/
|
||||
|
||||
@@ -4,6 +4,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
@@ -81,5 +82,45 @@ jobs:
|
||||
go build \
|
||||
-trimpath \
|
||||
-ldflags "-s -w -X main.Version=ci -X main.BuildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
||||
-o /tmp/frpc-hub \
|
||||
-o /tmp/podux \
|
||||
main.go
|
||||
|
||||
# ──────────────────────────────────────────────
|
||||
# Docker: build & push :dev image (dev branch only)
|
||||
# ──────────────────────────────────────────────
|
||||
docker-dev:
|
||||
name: Docker (dev tag)
|
||||
if: github.ref == 'refs/heads/dev' && github.event_name == 'push'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
push: true
|
||||
tags: ghcr.io/${{ github.repository }}:dev
|
||||
build-args: |
|
||||
VERSION=dev
|
||||
BUILD_TIME=${{ github.event.head_commit.timestamp }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
@@ -9,7 +9,7 @@ env:
|
||||
GO_VERSION_FILE: go.mod
|
||||
NODE_VERSION: '20'
|
||||
PNPM_VERSION: '10'
|
||||
APP_NAME: frpc-hub
|
||||
APP_NAME: podux
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
@@ -197,7 +197,7 @@ jobs:
|
||||
type=semver,pattern={{major}}
|
||||
type=raw,value=latest,enable=${{ !contains(github.ref_name, '-') }}
|
||||
labels: |
|
||||
org.opencontainers.image.title=frpc-hub
|
||||
org.opencontainers.image.title=podux
|
||||
org.opencontainers.image.description=FRP client hub with web UI
|
||||
|
||||
- name: Build and push
|
||||
|
||||
@@ -31,6 +31,8 @@ Thumbs.db
|
||||
/bin/
|
||||
/dist/
|
||||
/pb_public/
|
||||
podux
|
||||
podux.exe
|
||||
|
||||
# PocketBase
|
||||
/pb_data/
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
# Podux Agent Development Guide
|
||||
|
||||
## Project Scope and Technology Stack
|
||||
|
||||
Podux is a web management platform for centrally managing frpc server configurations, proxies, connection status, network latency, and runtime logs. The current codebase uses Go 1.25.5, PocketBase 0.35.0, and embedded frp 0.68.0. The application frontend is under `site/` and uses React 19, TypeScript 5.9, Vite 7, Radix Themes 3, and Tailwind CSS 4. `docs/` is a VitePress 1 documentation site; its Vue dependency does not mean that the application frontend uses Vue.
|
||||
|
||||
Treat `go.mod`, `site/package.json`, and `docs/package.json` as the sources of truth for versions and dependencies. Do not infer versions from documentation examples.
|
||||
|
||||
## Directory Map
|
||||
|
||||
| Path | Responsibility |
|
||||
| --- | --- |
|
||||
| `main.go` | PocketBase startup and dependency wiring, hooks/custom routes, monitoring scheduler, and static asset serving entry point |
|
||||
| `internal/domain/` | Server/proxy domain models and repository interfaces |
|
||||
| `internal/application/` | Use-case services for dashboard, frpc, importer, monitoring, proxy, server, system, version, and related features |
|
||||
| `internal/infrastructure/persistence/` | Repository implementations based on PocketBase/dbx |
|
||||
| `internal/interfaces/http/` | Custom HTTP handlers and authentication middleware |
|
||||
| `migrations/` | The sole version-controlled source of truth for PocketBase collection schemas |
|
||||
| `pkg/` | Build information, responses, shared types, and utilities |
|
||||
| `site/` | React application frontend; calls both the PocketBase collection API and custom `/api/*` endpoints |
|
||||
| `docs/` | Independent VitePress documentation site |
|
||||
| `development/` | Development design documents for agents and maintainers; not part of the web documentation site |
|
||||
| `pb_public/` | Copy destination for `site/dist`; embedded into the Go binary by `main.go` via `go:embed`; not committed |
|
||||
| `pb_data/` | PocketBase SQLite data, uploads, and `frpc/<server-id>` runtime logs/certificates; not committed |
|
||||
| `build/`, `deploy/` | Multi-platform build scripts and Docker deployment files |
|
||||
|
||||
See the [development design documentation](development/README.md) for the full design index.
|
||||
|
||||
## Local Development and Verification
|
||||
|
||||
Prerequisites: Go 1.25.5 as required by `go.mod`, Node.js 20 (CI baseline), and pnpm 10 (CI baseline).
|
||||
|
||||
```bash
|
||||
# Backend (ensure pb_public/index.html exists first; see the full frontend build below)
|
||||
go run . serve
|
||||
|
||||
# Application frontend; Vite proxies /api to 127.0.0.1:8090
|
||||
pnpm --dir site install --frozen-lockfile
|
||||
pnpm --dir site run dev
|
||||
|
||||
# Documentation site
|
||||
pnpm --dir docs install --frozen-lockfile
|
||||
pnpm --dir docs run docs:dev
|
||||
```
|
||||
|
||||
Run before submitting:
|
||||
|
||||
```bash
|
||||
pnpm --dir site install --frozen-lockfile
|
||||
pnpm --dir site run lint
|
||||
pnpm --dir site run build
|
||||
pnpm --dir docs install --frozen-lockfile
|
||||
pnpm --dir docs run docs:build
|
||||
|
||||
# go:embed must be satisfied before Go tooling loads the main package
|
||||
rm -rf pb_public
|
||||
mkdir -p pb_public
|
||||
cp -R site/dist/. pb_public/
|
||||
go vet ./...
|
||||
go test ./...
|
||||
go build ./...
|
||||
```
|
||||
|
||||
`build/build.sh` builds the frontend, copies `site/dist` to `pb_public`, runs `go mod tidy`, and builds platform packages. It rewrites generated directories and may modify module files, so it is not the preferred verification command for documentation-only or narrowly scoped changes.
|
||||
|
||||
## Change Conventions
|
||||
|
||||
- Backend: preserve the `interfaces -> application -> domain` dependency direction. Infrastructure implements domain repositories, and `main.go` performs central wiring. Handlers own transport-level validation and responses; business orchestration belongs in application services.
|
||||
- Frontend: keep React + TypeScript and follow the existing split between `index.tsx` (state/orchestration) and `*.view.tsx` (presentation). Prefer components from `site/src/components/` and Radix Themes. Reuse `site/src/lib/api.ts` or `pocketbase.ts` for API requests.
|
||||
- Migrations: schema changes must add a reviewable, reversible `migrations/*.go` migration. Migrations are the source of truth; never replace one by modifying a live SQLite database or production schema through the admin UI.
|
||||
- API: place custom routes in `internal/interfaces/http/` and use `requireAuth` by default. Review PocketBase collection rules as well. When paths, request/response contracts, authentication, or collection fields change, update the relevant design documents.
|
||||
- Styling: follow the [UI specification](development/ui-spec.md). Prefer Radix tokens, component props, and Tailwind utilities; do not introduce another unsupported set of brand tokens.
|
||||
- Internationalization: update both `site/src/locales/zh.json` and `en.json` for user-visible text, and access it through `react-i18next`'s `t()`. Avoid new hard-coded strings.
|
||||
- Documentation: implementation changes must update the [architecture](development/architecture.md), [database design](development/database-design.md), or [UI specification](development/ui-spec.md) when applicable. Documentation claims must link to repository paths or be marked "To be confirmed."
|
||||
|
||||
## Security Boundaries
|
||||
|
||||
- Do not commit secrets, tokens, certificates, user data, `pb_data/`, `pb_public/`, `site/dist/`, `docs/.vitepress/dist/`, or build packages.
|
||||
- `fh_servers.auth`, TLS private keys, user passwords, and token keys are sensitive. Never log their original values. Avoid logging, copying, or exposing tokens used in SSE query parameters.
|
||||
- Do not substitute manual database operations for migrations. Relations currently have no cascading deletes; assess orphaned-data risks before deleting parent records.
|
||||
- Do not perform unrelated repository-wide formatting or overwrite existing worktree changes.
|
||||
- Changes to endpoints, authentication rules, or data structures must update tests, callers, and the design documents in this directory.
|
||||
|
||||
## Pre-Submission Checklist
|
||||
|
||||
- [ ] `git diff` contains only the intended scope, with no runtime data, build artifacts, or unrelated formatting.
|
||||
- [ ] Go vet/test/build, frontend lint/build, and documentation build were run and their results reported accurately.
|
||||
- [ ] New or changed APIs, collections, relations, and rules are reflected in the database/architecture documentation.
|
||||
- [ ] The UI reuses shared components; both themes, the 760px mobile layout, Chinese/English text, and basic keyboard operation were checked.
|
||||
- [ ] Relative Markdown links work, and Mermaid names match the code and render correctly.
|
||||
- [ ] No sensitive values appear in code, logs, screenshots, or commit history.
|
||||
@@ -1,4 +1,4 @@
|
||||
# Multi-stage Dockerfile for frpc-hub
|
||||
# Multi-stage Dockerfile for podux
|
||||
# Stage 1: Build frontend
|
||||
FROM --platform=linux/amd64 node:22-alpine AS frontend-builder
|
||||
|
||||
@@ -32,7 +32,7 @@ RUN GOARM=$(echo "${TARGETVARIANT}" | tr -d 'v') \
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build \
|
||||
-trimpath \
|
||||
-ldflags "-s -w -X main.Version=${VERSION} -X main.BuildTime=${BUILD_TIME}" \
|
||||
-o frpc-hub \
|
||||
-o podux \
|
||||
main.go
|
||||
|
||||
# Stage 3: Final runtime image
|
||||
@@ -43,22 +43,22 @@ RUN apk add --no-cache \
|
||||
tzdata \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
RUN addgroup -g 1000 frpchub && \
|
||||
adduser -D -u 1000 -G frpchub frpchub
|
||||
RUN addgroup -g 1000 podux && \
|
||||
adduser -D -u 1000 -G podux podux
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=backend-builder /app/frpc-hub .
|
||||
COPY --from=backend-builder /app/podux .
|
||||
|
||||
RUN mkdir -p /app/pb_data && \
|
||||
chown -R frpchub:frpchub /app
|
||||
chown -R podux:podux /app
|
||||
|
||||
USER frpchub
|
||||
USER podux
|
||||
|
||||
EXPOSE 8090
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:8090/api/health || exit 1
|
||||
|
||||
ENTRYPOINT ["/app/frpc-hub"]
|
||||
ENTRYPOINT ["/app/podux"]
|
||||
CMD ["serve", "--http", "0.0.0.0:8090"]
|
||||
@@ -1,29 +1,42 @@
|
||||
<a name="readme-top"></a>
|
||||
|
||||
<!-- PROJECT SHIELDS -->
|
||||
|
||||
[![Forks][forks-shield]][forks-url]
|
||||
[![Stargazers][stars-shield]][stars-url]
|
||||
[![Issues][issues-shield]][issues-url]
|
||||
[![MIT License][license-shield]][license-url]
|
||||
[![Apache License][license-shield]][license-url]
|
||||
|
||||
<div align="right">
|
||||
<b>English</b> | <a href="README_zh.md">简体中文</a>
|
||||
</div>
|
||||
|
||||
> **Project Renamed:** This project was previously known as **frpc-hub** and has been officially renamed to **Podux**.
|
||||
> The repository URL and all references have been updated accordingly.
|
||||
|
||||
<!-- PROJECT LOGO -->
|
||||
<br />
|
||||
<div align="center">
|
||||
<a href="https://github.com/luckjiawei/frpc-hub">
|
||||
<a href="https://github.com/luckjiawei/podux">
|
||||
<img src="site/src/assets/logo.png" alt="Logo" width="140">
|
||||
</a>
|
||||
|
||||
<h3 align="center">Frpc-Hub</h3>
|
||||
<h3 align="center">Podux</h3>
|
||||
|
||||
<p align="center">
|
||||
<strong>Frpc-Hub</strong> is the web UI frpc always needed.
|
||||
<strong>Podux</strong> is the web UI frpc always needed.
|
||||
<br />
|
||||
Manage all your clients, proxies, and connections from one place. No terminal. No config editing.
|
||||
<br /><br />
|
||||
<a href="https://frpchub.jwinks.com/"><strong>📖 Documentation</strong></a>
|
||||
<a href="https://podux.io/en/guide/getting-started.html"><strong>🚀 Quick Start</strong></a>
|
||||
·
|
||||
<a href="https://github.com/luckjiawei/frpc-hub/issues">🐛 Report Bug</a>
|
||||
<a href="https://podux.io/"><strong>📖 Documentation</strong></a>
|
||||
·
|
||||
<a href="https://github.com/luckjiawei/frpc-hub/issues">✨ Request Feature</a>
|
||||
<a href="https://github.com/luckjiawei/podux/issues">🐛 Report Bug</a>
|
||||
·
|
||||
<a href="https://github.com/luckjiawei/podux/issues">✨ Request Feature</a>
|
||||
·
|
||||
<a href="#community"><strong>💬 Community</strong></a>
|
||||
</p>
|
||||
|
||||
<br />
|
||||
@@ -40,28 +53,53 @@
|
||||
|
||||
</div>
|
||||
|
||||
## Screenshot
|
||||
|
||||

|
||||
|
||||
## Milestones
|
||||
|
||||
- 2026-03-03: Released v0.1.0
|
||||
- 2026-03-12: Released v0.1.1
|
||||
- 2026-03-12: Released v0.1.2
|
||||
- 2026-03-16: Released v0.1.3
|
||||
- 2026-03-25: Released v0.1.4
|
||||
- 2026-03-26: Released v0.1.5
|
||||
- 2026-03-31: Released v0.1.6
|
||||
|
||||
## Community
|
||||
|
||||
No advertisements allowed!
|
||||
|
||||
### Telegram
|
||||
|
||||
Join the Telegram group for announcements, tips and general discussion:
|
||||
|
||||
👉 [https://t.me/+Tv7AcgbLn21hMDA1](https://t.me/+Tv7AcgbLn21hMDA1)
|
||||
|
||||
### WeChat Group
|
||||
|
||||
Scan the QR code to join the open source project discussion group.
|
||||
|
||||
If the group is full, scan the official account QR code on the right and follow it to get an invitation.
|
||||
|
||||
<img src="screenshot/wechat-qr.png" alt="WeChat Group QR Code" width="200"> <img src="screenshot/mp-qr.jpg" alt="Official Account QR Code" width="200">
|
||||
|
||||
## License
|
||||
|
||||
[Apache 2.0](LICENSE)
|
||||
|
||||
## Star History
|
||||
|
||||
[](https://www.star-history.com/#luckjiawei/frpc-desktop&Date)
|
||||
[](https://www.star-history.com/#luckjiawei/podux&Date)
|
||||
|
||||
<!-- MARKDOWN LINKS & IMAGES -->
|
||||
|
||||
[forks-shield]: https://img.shields.io/github/forks/luckjiawei/frpc-hub.svg?style=for-the-badge
|
||||
|
||||
[forks-url]: https://github.com/luckjiawei/frpc-hub/network/members
|
||||
|
||||
[stars-shield]: https://img.shields.io/github/stars/luckjiawei/frpc-hub.svg?style=for-the-badge
|
||||
|
||||
[stars-url]: https://github.com/luckjiawei/frpc-hub/stargazers
|
||||
|
||||
[issues-shield]: https://img.shields.io/github/issues/luckjiawei/frpc-hub.svg?style=for-the-badge
|
||||
|
||||
[issues-url]: https://github.com/luckjiawei/frpc-hub/issues
|
||||
|
||||
[license-shield]: https://img.shields.io/github/license/luckjiawei/frpc-hub.svg?style=for-the-badge
|
||||
|
||||
[license-url]: https://github.com/luckjiawei/frpc-hub/blob/main/LICENSE
|
||||
[forks-shield]: https://img.shields.io/github/forks/luckjiawei/podux.svg?style=for-the-badge
|
||||
[forks-url]: https://github.com/luckjiawei/podux/network/members
|
||||
[stars-shield]: https://img.shields.io/github/stars/luckjiawei/podux.svg?style=for-the-badge
|
||||
[stars-url]: https://github.com/luckjiawei/podux/stargazers
|
||||
[issues-shield]: https://img.shields.io/github/issues/luckjiawei/podux.svg?style=for-the-badge
|
||||
[issues-url]: https://github.com/luckjiawei/podux/issues
|
||||
[license-shield]: https://img.shields.io/github/license/luckjiawei/podux.svg?style=for-the-badge
|
||||
[license-url]: https://github.com/luckjiawei/podux/blob/main/LICENSE
|
||||
@@ -0,0 +1,105 @@
|
||||
<a name="readme-top"></a>
|
||||
|
||||
<!-- PROJECT SHIELDS -->
|
||||
|
||||
[![Forks][forks-shield]][forks-url]
|
||||
[![Stargazers][stars-shield]][stars-url]
|
||||
[![Issues][issues-shield]][issues-url]
|
||||
[![Apache License][license-shield]][license-url]
|
||||
|
||||
<div align="right">
|
||||
<a href="README.md">English</a> | <b>简体中文</b>
|
||||
</div>
|
||||
|
||||
> **项目更名通知:** 本项目原名为 **frpc-hub**,现已正式更名为 **Podux**。
|
||||
> 仓库地址及所有相关引用均已同步更新。
|
||||
|
||||
<!-- PROJECT LOGO -->
|
||||
<br />
|
||||
<div align="center">
|
||||
<a href="https://github.com/luckjiawei/podux">
|
||||
<img src="site/src/assets/logo.png" alt="Logo" width="140">
|
||||
</a>
|
||||
|
||||
<h3 align="center">Podux</h3>
|
||||
|
||||
<p align="center">
|
||||
<strong>Podux</strong> —— frpc 梦寐以求的 Web 前端管理面板。
|
||||
<br />
|
||||
在一个地方集中管理您所有的客户端、代理和连接。告别终端。无需再手动编辑配置文件。
|
||||
<br /><br />
|
||||
<a href="https://podux.io/guide/getting-started.html"><strong>🚀 快速开始</strong></a>
|
||||
·
|
||||
<a href="https://podux.io/"><strong>📖 官方文档</strong></a>
|
||||
·
|
||||
<a href="https://github.com/luckjiawei/podux/issues">🐛 提交 Bug</a>
|
||||
·
|
||||
<a href="https://github.com/luckjiawei/podux/issues">✨ 需求建议</a>
|
||||
·
|
||||
<a href="#社区"><strong>💬 交流群</strong></a>
|
||||
</p>
|
||||
|
||||
<br />
|
||||
|
||||
<p align="center">
|
||||
<strong>✅ 多节点管理</strong> ·
|
||||
<strong>📊 实时数据大盘</strong> ·
|
||||
<strong>🌐 网络监控</strong> ·
|
||||
<strong>🚀 一键开机自启</strong> ·
|
||||
<strong>⚡ 高性能稳定</strong> ·
|
||||
<strong>🐳 完美适配 Docker</strong> ·
|
||||
<strong>🎨 现代化 UI 设计</strong> ·
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
## 界面截图
|
||||
|
||||

|
||||
|
||||
## 版本里程碑
|
||||
|
||||
- 2026-03-03: 发布 v0.1.0
|
||||
- 2026-03-12: 发布 v0.1.1
|
||||
- 2026-03-14: 发布 v0.1.2
|
||||
- 2026-03-16: 发布 v0.1.3
|
||||
- 2026-03-25: 发布 v0.1.4
|
||||
- 2026-03-26: 发布 v0.1.5
|
||||
- 2026-03-31: 发布 v0.1.6
|
||||
|
||||
## 社区
|
||||
|
||||
禁止广告!
|
||||
|
||||
### Telegram
|
||||
|
||||
欢迎加入 Telegram 群,获取项目动态、使用技巧并参与交流:
|
||||
|
||||
👉 [https://t.me/+Tv7AcgbLn21hMDA1](https://t.me/+Tv7AcgbLn21hMDA1)
|
||||
|
||||
### 微信群
|
||||
|
||||
扫描微信二维码加入开源项目交流群。
|
||||
|
||||
若群已满,请扫描右侧公众号二维码,关注后获取入群方式。
|
||||
|
||||
<img src="screenshot/wechat-qr.png" alt="微信群二维码" width="200"> <img src="screenshot/mp-qr.jpg" alt="公众号二维码" width="200">
|
||||
|
||||
## License
|
||||
|
||||
[Apache 2.0](LICENSE)
|
||||
|
||||
## Star 历史
|
||||
|
||||
[](https://www.star-history.com/#luckjiawei/podux&Date)
|
||||
|
||||
<!-- MARKDOWN LINKS & IMAGES -->
|
||||
|
||||
[forks-shield]: https://img.shields.io/github/forks/luckjiawei/podux.svg?style=for-the-badge
|
||||
[forks-url]: https://github.com/luckjiawei/podux/network/members
|
||||
[stars-shield]: https://img.shields.io/github/stars/luckjiawei/podux.svg?style=for-the-badge
|
||||
[stars-url]: https://github.com/luckjiawei/podux/stargazers
|
||||
[issues-shield]: https://img.shields.io/github/issues/luckjiawei/podux.svg?style=for-the-badge
|
||||
[issues-url]: https://github.com/luckjiawei/podux/issues
|
||||
[license-shield]: https://img.shields.io/github/license/luckjiawei/podux.svg?style=for-the-badge
|
||||
[license-url]: https://github.com/luckjiawei/podux/blob/main/LICENSE
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Build script for frpc-hub - Multi-architecture support
|
||||
# Build script for podux - Multi-architecture support
|
||||
# Usage: ./build.sh [options]
|
||||
# Options:
|
||||
# --arch <arch> Build for specific architecture (linux-amd64, linux-arm64, darwin-amd64, darwin-arm64, windows-amd64, all)
|
||||
@@ -10,7 +10,7 @@ set -e
|
||||
# --help Show this help message
|
||||
|
||||
# Configuration
|
||||
APP_NAME="frpc-hub"
|
||||
APP_NAME="podux"
|
||||
VERSION=${VERSION:-$(git describe --tags --always --dirty 2>/dev/null || echo "dev")}
|
||||
BUILD_TIME=$(date -u '+%Y-%m-%d_%H:%M:%S')
|
||||
SITE_DIR="../site"
|
||||
|
||||
@@ -4,36 +4,25 @@ version: '3.8'
|
||||
# Usage: docker compose -f docker-compose.build.yml up -d
|
||||
|
||||
services:
|
||||
frpc-hub:
|
||||
podux:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
VERSION: ${VERSION:-latest}
|
||||
BUILD_TIME: ${BUILD_TIME:-$(date -u '+%Y-%m-%d_%H:%M:%S')}
|
||||
image: frpc-hub:${VERSION:-latest}
|
||||
container_name: frpc-hub
|
||||
image: podux:${VERSION:-latest}
|
||||
container_name: podux
|
||||
restart: unless-stopped
|
||||
|
||||
ports:
|
||||
# Web UI and API
|
||||
- "8090:8090"
|
||||
# Add your frpc proxy ports here
|
||||
# Example:
|
||||
# - "7000:7000" # frps server port
|
||||
# - "7500:7500" # frps dashboard port
|
||||
|
||||
volumes:
|
||||
# Persistent data storage
|
||||
- frpc-hub-data:/app/pb_data
|
||||
# Optional: Mount custom frpc configurations
|
||||
# - ./frpc-configs:/app/frpc-configs
|
||||
- podux-data:/app/pb_data
|
||||
|
||||
environment:
|
||||
# Timezone
|
||||
- TZ=Asia/Shanghai
|
||||
# Optional: Custom PocketBase settings
|
||||
# - PB_ENCRYPTION_KEY=your-encryption-key
|
||||
|
||||
# Resource limits (optional)
|
||||
deploy:
|
||||
@@ -64,9 +53,9 @@ services:
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
frpc-hub-data:
|
||||
podux-data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
default:
|
||||
name: frpc-hub-network
|
||||
name: podux-network
|
||||
@@ -1,33 +1,19 @@
|
||||
version: '3.8'
|
||||
|
||||
# Public image version: use the pre-built Docker image from a registry
|
||||
# Usage: docker compose up -d
|
||||
|
||||
services:
|
||||
frpc-hub:
|
||||
image: ${REGISTRY:-ghcr.io/your-username}/frpc-hub:${VERSION:-latest}
|
||||
container_name: frpc-hub
|
||||
podux:
|
||||
image: ghcr.io/luckjiawei/podux:${VERSION:-latest}
|
||||
container_name: podux
|
||||
restart: unless-stopped
|
||||
|
||||
ports:
|
||||
# Web UI and API
|
||||
- "8090:8090"
|
||||
# Add your frpc proxy ports here
|
||||
# Example:
|
||||
# - "7000:7000" # frps server port
|
||||
# - "7500:7500" # frps dashboard port
|
||||
|
||||
volumes:
|
||||
# Persistent data storage
|
||||
- frpc-hub-data:/app/pb_data
|
||||
# Optional: Mount custom frpc configurations
|
||||
# - ./frpc-configs:/app/frpc-configs
|
||||
- podux-data:/app/pb_data
|
||||
|
||||
environment:
|
||||
# Timezone
|
||||
- TZ=Asia/Shanghai
|
||||
# Optional: Custom PocketBase settings
|
||||
# - PB_ENCRYPTION_KEY=your-encryption-key
|
||||
|
||||
# Resource limits (optional)
|
||||
deploy:
|
||||
@@ -58,9 +44,9 @@ services:
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
frpc-hub-data:
|
||||
podux-data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
default:
|
||||
name: frpc-hub-network
|
||||
name: podux-network
|
||||
@@ -0,0 +1,20 @@
|
||||
# Podux Development Design Documentation
|
||||
|
||||
This directory documents the verifiable design of the current `main` baseline and serves as the entry point for future development and agent changes:
|
||||
|
||||
- [System architecture](architecture.md): in-process components, layering, request/startup flows, build and deployment, and CI boundaries.
|
||||
- [Database design](database-design.md): all application collections, relations, rules, indexes, lifecycles, and implementation discrepancies.
|
||||
- [UI specification](ui-spec.md): themes, actual tokens, layouts, and component reuse rules for the React application frontend.
|
||||
|
||||
## Sources of Truth and Scope
|
||||
|
||||
These documents are based on repository code and configuration, not speculation about a target architecture. For the database, `migrations/*.go` is the primary source of truth and is cross-checked against domain models, repositories, application services, HTTP handlers, and callers under `site/src/`. For the UI, the sources are `site/src/index.css`, theme contexts, layouts, shared components, and pages. Build and deployment facts come from `go.mod`, package manifests, `main.go`, CI, `build/build.sh`, and Docker files.
|
||||
|
||||
"Verified current state" describes the present implementation. "Current discrepancy / To be confirmed" and "Technical debt" identify gaps that the code cannot resolve or constraints that are not yet unified; they do not authorize schema or behavior changes.
|
||||
|
||||
## Update Triggers
|
||||
|
||||
- Update the architecture document when component boundaries, startup flow, custom routes, background tasks, persistence, or deployment change.
|
||||
- Update the database document when migrations, collection rules/indexes/relations, field mappings, or retention/deletion policies change.
|
||||
- Update the UI document when theme configuration, design tokens, layout breakpoints, shared components, interaction states, internationalization, or accessibility constraints change.
|
||||
- Update the repository-root `AGENT.md` when any of the changes above also affect agent working conventions.
|
||||
@@ -0,0 +1,97 @@
|
||||
# System Architecture
|
||||
|
||||
## Verified Current State
|
||||
|
||||
Podux is a single Go/PocketBase service that hosts the API, SQLite persistence, background monitoring, frpc client services, and the React static site. The code calls running instances `processes`, but `internal/application/frpc/service.go` actually creates in-process `frp/client.Service` instances and runs them in goroutines; it does not launch separate `frpc` OS processes.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
B[Browser / React Web<br/>site/src] -->|PocketBase collection API| PB[PocketBase / Go<br/>main.go]
|
||||
B -->|custom /api routes| H[HTTP handlers<br/>internal/interfaces/http]
|
||||
H --> A[Application services<br/>internal/application]
|
||||
PB --> H
|
||||
A --> D[Domain contracts/models<br/>internal/domain]
|
||||
A --> R[Repository implementations<br/>internal/infrastructure/persistence]
|
||||
R --> DB[(SQLite / PocketBase collections<br/>pb_data)]
|
||||
PB --> DB
|
||||
A --> F[frp client.Service instances<br/>in-process goroutines]
|
||||
F --> FRPS[Remote frps servers]
|
||||
A --> M[MonitorService + MetricsScheduler]
|
||||
M --> DB
|
||||
PB --> E[Embedded React assets<br/>pb_public]
|
||||
```
|
||||
|
||||
### Layers and Entry Points
|
||||
|
||||
- `main.go` creates the PocketBase app, registers migration commands, constructs repositories/services/handlers, binds the `fh_proxies` update hook, and initializes state, starts background tasks, registers routes, and configures the static-file fallback in `OnServe`.
|
||||
- `internal/domain` currently defines lightweight models, status values, and repository interfaces only for servers and proxies.
|
||||
- `internal/application` handles statistics, imports, frpc configuration/lifecycle, networking and metrics, system settings, and version queries.
|
||||
- `internal/infrastructure/persistence` implements server and proxy repositories with dbx/PocketBase.
|
||||
- `internal/interfaces/http` exposes `/api/dashboard/*`, `/api/frpc/*`, `/api/import/*`, `/api/servers*`, `/api/system/*`, and `/api/frp/version`. Except for initialization-status and initialization endpoints, registered custom routes use `requireAuth`.
|
||||
- React also uses the PocketBase SDK directly for `fh_users`, `fh_servers`, and `fh_proxies`; collection API rules control that access boundary.
|
||||
|
||||
### Typical Request Flow
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant UI as React Servers page
|
||||
participant H as FrpcHandler
|
||||
participant S as frpc.Service
|
||||
participant R as server/proxy repositories
|
||||
participant DB as PocketBase/SQLite
|
||||
participant C as frp client.Service
|
||||
UI->>H: POST /api/frpc/launch {id}
|
||||
H->>H: requireAuth + 15-char id validation
|
||||
H->>S: LaunchFrpc(id)
|
||||
S->>DB: load fh_servers
|
||||
S->>R: FindEnabledByServerID(id)
|
||||
R->>DB: query fh_proxies
|
||||
S->>C: NewService + Run(ctx)
|
||||
S->>R: bootStatus = running
|
||||
H-->>UI: 200 / error
|
||||
loop every 5 seconds
|
||||
S->>C: StatusExporter
|
||||
S->>R: proxy bootStatus online/offline
|
||||
end
|
||||
```
|
||||
|
||||
Standard server/proxy CRUD primarily uses the PocketBase SDK. Server lists, dashboard data, imports, settings, and runtime controls use custom APIs. After a successful `fh_proxies` update, a hook calls `ReloadFrpc` if the owning server is running.
|
||||
|
||||
### Startup Flow and Background Tasks
|
||||
|
||||
1. Go `init` loads `migrations`; `main` registers the migrate command and wires dependencies.
|
||||
2. PocketBase `serve` triggers `OnServe`, which sets every server to `stopped` and every proxy to `offline`.
|
||||
3. After a 10-second delay, servers with `autoConnection=true` start automatically.
|
||||
4. `MonitorService` immediately runs TCP latency and missing-geolocation checks, then repeats them at intervals from `fh_settings.general`; server-side defaults are 5 seconds and 24 hours.
|
||||
5. PocketBase cron aggregates raw metrics into hourly metrics at minute 5 of every hour. At 01:05 each day it aggregates daily metrics and deletes raw data older than 7 days and hourly data older than 30 days.
|
||||
6. After handlers are registered, `pb_public` is served through `embed.FS` with an SPA fallback; `/_/` remains the PocketBase Admin UI.
|
||||
|
||||
### Frontend Build and Embedding
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
SRC[site/src React + TypeScript] -->|pnpm run build| DIST[site/dist]
|
||||
DIST -->|build/build.sh copy| PUBLIC[pb_public]
|
||||
PUBLIC -->|go:embed all:pb_public| BIN[Podux Go binary]
|
||||
BIN -->|apis.Static fallback| WEB[Browser]
|
||||
```
|
||||
|
||||
The Vite development server listens on `0.0.0.0` and proxies `/api` to `127.0.0.1:8090`. Production builds do not automatically copy files to `pb_public`; CI performs that step through artifact downloads, while `build/build.sh` copies them explicitly. Go compilation still requires the directory to exist when `pb_public/index.html` is missing, and runtime logs a warning.
|
||||
|
||||
## Configuration, Persistence, and Deployment Boundaries
|
||||
|
||||
- PocketBase uses `pb_data/` as its default data root; the Docker volume mounts `/app/pb_data`. The database, uploads, and `pb_data/frpc/<id>/logs|certs` are runtime data.
|
||||
- Server connection/authentication/transport/logging/metadata settings are stored in collection JSON fields. TLS certificate contents are written to a server-specific certificates directory at startup, with private-key permissions set to `0600`. Never commit this content.
|
||||
- The fixed system-settings record ID is `wcstsqmz8hur331`; the initialization transaction creates both the first `fh_users` record and the settings record.
|
||||
- Geolocation and version queries access external services and depend on network availability. frpc instance status exists only in memory; database statuses are reset together on restart.
|
||||
- The Dockerfile builds React and then compiles a static Go binary; deployment files define ports and volumes. This document makes no claims about production reverse proxies, backups, or high availability that are not verified in repository configuration.
|
||||
|
||||
## CI and Quality Boundaries
|
||||
|
||||
`.github/workflows/ci.yml` runs on pushes to main/dev and pull requests to main. It performs a frozen frontend install, permissive type checking (`continue-on-error`), and a production build; it then downloads the frontend artifact and runs `go vet` and a Linux amd64 build. CI currently does not run `go test`, frontend lint, or the documentation build, but this project's pre-submission baseline requires those checks locally. Pushes to dev also build and publish a multi-architecture container.
|
||||
|
||||
## To Be Confirmed
|
||||
|
||||
- `github_handler.go` and its service exist, but their wiring and registration are commented out in `main.go`; they must not be treated as a published API.
|
||||
- No graceful-shutdown hook for `MonitorService` was found; it currently relies on process termination.
|
||||
- No formal repository-level backup/restore, horizontal-scaling, or multi-instance mutual-exclusion design was found.
|
||||
@@ -0,0 +1,121 @@
|
||||
# Database Design
|
||||
|
||||
## Sources of Truth and Migration Constraints
|
||||
|
||||
PocketBase uses SQLite and registers Go migrations through the blank import of `migrations` in `main.go`; `migratecmd` enables `Automigrate: true`. The only current migration is `migrations/1774402980_collections_snapshot.go`, which imports a collection snapshot with `ImportCollectionsByMarshaledJSON(..., false)`; its rollback function is currently empty. The migration, not any running `pb_data/data.db`, is therefore the primary schema source of truth.
|
||||
|
||||
Every structure/rule/index change must add a reviewable migration with an appropriate rollback. Never modify production SQLite directly or make changes only through the PocketBase Admin UI. "Default" below records only snapshot autogeneration behavior; fields without an explicit statement have no verified schema default.
|
||||
|
||||
The snapshot also contains PocketBase system collections such as `_mfas`, `_otps`, `_externalAuths`, `_authOrigins`, and `_superusers`, which are not individually modeled here. There are nine application collections: `fh_users`, `fh_servers`, `fh_proxies`, `fh_version`, `fh_settings`, `fh_metrics_targets`, `fh_metrics_raw`, `fh_metrics_hourly`, and `fh_metrics_daily`.
|
||||
|
||||
Every base collection has a required system text primary key named `id`, automatically generated as 15 lowercase alphanumeric characters. Collections with `created`/`updated` use autodate fields. In the descriptions below, `—` means an empty rule, so only a superuser may perform that operation through the PocketBase Record API; this does not restrict internal server-side database/service access.
|
||||
|
||||
## Relationship Diagram
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
fh_servers ||--o{ fh_proxies : "serverId (no cascade)"
|
||||
fh_servers ||--o{ fh_metrics_targets : "serverId (optional, no cascade)"
|
||||
fh_proxies ||--o{ fh_metrics_targets : "proxyId (optional, no cascade)"
|
||||
fh_metrics_targets ||--o{ fh_metrics_raw : "targetId (no cascade)"
|
||||
fh_metrics_targets ||--o{ fh_metrics_hourly : "targetId (no cascade)"
|
||||
fh_metrics_targets ||--o{ fh_metrics_daily : "targetId (no cascade)"
|
||||
```
|
||||
|
||||
All relation fields use `maxSelect: 1`. The schema neither guarantees that each metrics target is bound exclusively to a server or a proxy nor defines a unique `(serverId, proxyId)` index.
|
||||
|
||||
## Collection Design
|
||||
|
||||
### `fh_users` (auth)
|
||||
|
||||
Purpose: Podux login users. System fields: `password` (required, hidden, minimum 8 characters), `tokenKey` (required, hidden, 30–60 characters, automatically generated with 50 characters), `email` (required), `emailVisibility`, `verified`, `created`, and `updated`. Application fields: optional `nickname` text with max length 255; optional `avatar` file with at most one JPEG/PNG/SVG/GIF/WebP file; optional `passwordChangedAt` date.
|
||||
|
||||
Unique indexes: `tokenKey` and non-empty `email`. Password authentication is enabled with email as the identity; OAuth2, MFA, and OTP are disabled. The create rule is `@collection.fh_settings.initialized = false`; list/view/update/delete are restricted to `id = @request.auth.id`; the auth rule is empty, allowing authentication.
|
||||
|
||||
Mapping: `system.Service.InitializeSystem` creates the user; Login uses PocketBase `authWithPassword`; Settings/Profile reads and updates the user and avatar; ChangePasswordDialog updates the password.
|
||||
|
||||
### `fh_servers`
|
||||
|
||||
Purpose: remote frps connections and shared frpc configuration.
|
||||
|
||||
| Field | Type | Required/default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `serverName` | text | Required | Display name |
|
||||
| `serverAddr` | text | Required | frps address |
|
||||
| `serverPort` | text | Required | Read/edited as an integer by the service/frontend |
|
||||
| `description` | text | Optional | Description |
|
||||
| `auth` | json | Optional | frp authentication; may contain tokens/secrets |
|
||||
| `transport` | json | Optional | frp transport/TLS; may contain certificate private keys |
|
||||
| `metadatas` | json | Optional | frp metadata |
|
||||
| `log` | json | Optional | frp logging configuration |
|
||||
| `serverVersion` | text | Required, auto `built-in` | Current frp source marker |
|
||||
| `bootStatus` | text | Required, auto `stopped` | Runtime status; code uses running/stopped |
|
||||
| `autoConnection` | bool | Optional | Connect automatically after startup |
|
||||
| `geoLocation` | json | Optional | Populated by MonitorService |
|
||||
| `user` | text | Optional | frp user |
|
||||
| `created`,`updated` | autodate | Automatic | Creation/update timestamps |
|
||||
|
||||
Index: non-unique `bootStatus`. All list/view/create/update/delete rules require authentication. Mapping: there is no complete Go domain model; `ServerRecord` covers only ID/name. The server repository, frpc service, monitor service, and custom `/api/servers` handler read it; React Servers, ServerDetail, and ServerForm use it.
|
||||
|
||||
### `fh_proxies`
|
||||
|
||||
Purpose: frpc proxy configuration under a server.
|
||||
|
||||
| Field | Type | Required/default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `name` | text | Required | Proxy name; the record ID is appended to the runtime name |
|
||||
| `proxyType` | select | Required | One of tcp, udp, http, or https |
|
||||
| `serverId` | relation -> `fh_servers` | Required, N:1 | No cascading delete |
|
||||
| `localIP`,`localPort`,`remotePort`,`subdomain` | text | Optional | Endpoint configuration; Go maps ports with NullableInt |
|
||||
| `customDomains` | json | Optional | Domain array |
|
||||
| `transport`,`plugin` | json | Optional | Extended proxy configuration |
|
||||
| `status` | select | Required | enabled/disabled |
|
||||
| `bootStatus` | select | Required | online/offline |
|
||||
| `created`,`updated` | autodate | Automatic | Creation/update timestamps |
|
||||
|
||||
Indexes: non-unique `serverId`, `proxyType`, and `status`. All CRUD/list/view rules require authentication. Mapping: `domain/proxy.Proxy`, the proxy repository/service, frpc configuration generation, and dashboard; used by React Proxies, ProxyForm, and ServerDetail. A successful update hook reloads a running server.
|
||||
|
||||
### `fh_settings`
|
||||
|
||||
Purpose: system initialization state and general settings. Fields are optional `initialized` bool, optional `general` JSON, and autodate `created`/`updated`; there are no application indexes. All list/view/create/update/delete rules require authentication, but the unauthenticated custom initialization API writes the fixed ID `wcstsqmz8hur331` inside a server-side transaction. Used `general` keys include `defaultLanguage`, `latencyCheckInterval`, and `locationCheckInterval`.
|
||||
|
||||
Mapping: `application/system.Service`, the system handler, React GeneralSettings, and the initialization flow.
|
||||
|
||||
### `fh_version`
|
||||
|
||||
Purpose: version name/path records. Optional text fields `version_name` and `version_path`, plus `created`/`updated`. It has no application indexes, and all Record API rules are `null`. The current version service returns the frp version from compile-time dependencies, while the system version uses buildinfo/an external release API. No application read/write path for this collection was found; its actual purpose remains to be confirmed.
|
||||
|
||||
### `fh_metrics_targets`
|
||||
|
||||
Purpose: bind a metric series to a server or proxy. `serverId` is an optional relation to `fh_servers`; `proxyId` is an optional relation to `fh_proxies`; neither cascades on deletion. There are no `created`/`updated` fields or indexes, and all Record API rules are `null`. `MetricsService` currently creates only targets with a populated `serverId` and empty `proxyId`, and caches server-to-target mappings in memory.
|
||||
|
||||
### `fh_metrics_raw`
|
||||
|
||||
Purpose: raw metric points. Required non-cascading `targetId` relation to `fh_metrics_targets`; optional `metricKey` select (currently only `frps_delay`); required `t` date; optional `val` number. The composite non-unique index is ordered `(targetId, t, metricKey)`. There are no autodate fields, and all Record API rules are `null`. MonitorService writes non-negative latency for reachable servers; the 01:05 daily job deletes data older than 7 days.
|
||||
|
||||
### `fh_metrics_hourly`
|
||||
|
||||
Purpose: hourly aggregates. Optional relation `targetId`, optional select `metricKey`, optional date `t`, and optional numbers `valAvg`/`valMax`/`valMin`. It has a composite non-unique `(metricKey, targetId, t)` index, no autodate fields, and `null` for all Record API rules. At minute 5 of every hour, the previous complete hour is aggregated and then updated or inserted after lookup by target/key/time. Data older than 30 days is deleted daily.
|
||||
|
||||
### `fh_metrics_daily`
|
||||
|
||||
Purpose: daily aggregates. Fields match hourly, and all three value fields are optional numbers. It has a composite non-unique `(targetId, metricKey, t)` index, no autodate fields, and `null` for all Record API rules. At 01:05 daily, the previous day's hourly values are aggregated and upserted; the code currently writes only `valAvg`. No retention policy for daily data was found.
|
||||
|
||||
## Lifecycle, Deletion, and Sensitivity
|
||||
|
||||
- Server/proxy runtime statuses are reset at startup. Status is a transient runtime projection; configuration itself is persistent.
|
||||
- Aggregation follows raw -> hourly -> daily. Raw data is retained for 7 days and hourly data for 30 days; no verified limit exists for daily data.
|
||||
- Every relation uses `cascadeDelete: false`. The schema does not automatically delete proxies/metrics targets with a server, and deleting proxies/targets may also leave related records. Although the UI shows a confirmation dialog, no server-side transactional cleanup was found; treat this as an orphaning risk.
|
||||
- PocketBase protects `fh_users.password/tokenKey`; `fh_servers.auth/transport` may contain tokens, OIDC secrets, and TLS private keys. Logs mask common JSON key names, but original values must still never be exported, committed, or echoed.
|
||||
- Migration workflow: identify callers -> add forward/down migrations -> update models/repositories/services/UI -> update this document -> verify upgrade and rollback against a temporary database -> run the full checks. Never rewrite the snapshot to falsify existing deployment history.
|
||||
|
||||
## Current Discrepancies / To Be Confirmed
|
||||
|
||||
- `domain/proxy.Proxy` declares and serializes `description`, but the `fh_proxies` migration has no such field; form payloads also include description. Do not assume here that the field exists.
|
||||
- The `/api/servers` handler reads and returns `sendRate` and `recvRate`, but the migration defines neither field.
|
||||
- ProfileSettings submits both `name` and `nickname`, while the migration defines only `nickname`.
|
||||
- The migration defines `serverPort/localPort/remotePort` as text; some Go/frontend paths treat them as numbers. Preserve conversion compatibility and confirm the long-term type strategy.
|
||||
- `fh_metrics_targets` has no uniqueness constraint. An in-process application lock only prevents concurrent duplicates within one process; multi-instance and pre-existing duplicate risks remain to be confirmed.
|
||||
- Metric aggregation performs application-level "lookup then write" operations. Composite indexes are non-unique, so the database does not guarantee idempotent uniqueness.
|
||||
- No caller for `fh_version` was found; its purpose remains to be confirmed.
|
||||
- The snapshot migration has an empty down function and cannot automatically restore the pre-import schema; rollback strategy remains technical debt.
|
||||
@@ -0,0 +1,67 @@
|
||||
# UI Specification
|
||||
|
||||
## Technology Stack, Entry Point, and Theme
|
||||
|
||||
The application UI under `site/` uses React 19, TypeScript, and Vite 7 together with Radix Themes, Tailwind CSS 4, Iconify, Framer Motion, Recharts, Sonner, and react-i18next; it does not use Vue. Vue is used only by the VitePress site under `docs/`.
|
||||
|
||||
`site/src/main.tsx` loads Radix CSS, `index.css`, and i18n in that order, then wraps the application in `ThemeProvider`, `LanguageProvider`, and Radix `<Theme>`. Theme settings are `accentColor="indigo"`, `grayColor="slate"`, and `radius="large"`. Appearance is light/dark, initially taken from the system `prefers-color-scheme` and then stored in `localStorage.theme`. `index.css` is the entry point for Tailwind and global status-dot styles. `App.css` is an unused Vite template remnant not imported by `App.tsx`; do not treat it as the current UI baseline.
|
||||
|
||||
## Design Tokens in Use
|
||||
|
||||
The project has no custom token file. It primarily consumes Radix CSS variables and component size/gap scales directly.
|
||||
|
||||
| Category | Verified values/usage |
|
||||
| --- | --- |
|
||||
| Brand/accent | Radix indigo mappings `--accent-2/3/4/6/9/10/11` and `--accent-a3`; do not hard-code a new "Podux blue" |
|
||||
| Neutrals/surfaces | Slate mappings `--gray-1..12`, alpha gray, `--color-background`, and `--color-panel-solid`; main page background is `--gray-2` |
|
||||
| Status colors | Radix green/red/amber/orange/blue/purple scales; online dot `--green-9`, offline dot `--red-9`, unknown dot `--gray-9` |
|
||||
| Typography | No project font family; inherits Radix/browser. Body text commonly uses `<Text size="1|2|3|4">`, page titles use `<Heading size="6">`, and section titles commonly use size 3/4 |
|
||||
| Spacing | Prefer Radix `gap/mb/px/py` scales and Tailwind (for example px-4, sm:px-6, lg:px-8); local values commonly include 8/12/16/20/24/32px |
|
||||
| Radius | Radix global `large`; variables `--radius-2/3`; local 8/12/16/24px and full circles |
|
||||
| Borders | Usually `1px solid var(--gray-5|6)`; highlighted areas use `--accent-6` |
|
||||
| Shadows | A few local `0 4px 12px rgba(0,0,0,.05/.2)` and `0 4px 16px rgba(0,0,0,.1)` values; prefer Card/Dialog defaults |
|
||||
| Stacking | Sticky top bar uses `z-50`; full-screen Loading uses `z-index: 9999`; otherwise prefer component overlay defaults |
|
||||
|
||||
Hard-coded values such as `#22c55e`, `#E5484D`, `#30A46C`, and `#6b7280` remain scattered through charts/status implementations. Prefer existing Radix tokens. Cleanup requires a separate task that verifies SVG chart compatibility; do not replace these values in bulk during ordinary feature work.
|
||||
|
||||
## Layout and Component Patterns
|
||||
|
||||
- Application shell: reuse `layouts/MainLayout.tsx`. Desktop uses a sticky top bar with logo, Dashboard/Servers/Proxies navigation, and controls on the right. Below `760px`, mobile uses bottom navigation. Content uses `max-w-7xl`, supports a minimum viewport width of 320px, and reserves space for the mobile bottom bar.
|
||||
- Page titles: reuse `components/PageHeader.tsx`, keeping title, description, and right-side actions at a consistent hierarchy. Reuse `SectionHeading` for section titles.
|
||||
- Forms: prefer Radix `TextField/Select/Switch/Button`; reuse `FormItem` for labels and required markers. Keep page state and submission logic in hooks/index files and layout in views.
|
||||
- Cards and statistics: use Radix `Card` for general content. Reuse `StatCard` and `AnimateNumber` for dashboard value cards rather than duplicating animation/color decisions.
|
||||
- Lists: Servers/Proxies establish the desktop-table + mobile-card, search, pagination, Badge, and DropdownMenu pattern. Prefer it for new resources of the same kind.
|
||||
- Dialogs: use Radix `AlertDialog` for delete confirmation and Radix `Dialog` for editing, passwords, and similar tasks. Mark dangerous actions red, separate cancel and confirm, and prevent duplicate submissions during async work.
|
||||
- Charts: reuse `LatencyChart/ProbeHistory` for latency trends and Dashboard `TopologyChart` for topology. Containers must be responsive, with sufficient contrast in both themes.
|
||||
- Notifications: prefer `sonner` toast for operation success/failure (global top-center with richColors). Do not add alerts; the existing `alert` in ProfileSettings is technical debt.
|
||||
- Empty/loading/error: reuse `EmptyState` for empty lists and `Loading` for route/page loading. Errors should explain the problem and offer a recovery action. There is no unified ErrorState/ErrorBoundary yet; before adding one, assess whether it should become a shared component.
|
||||
|
||||
## Reference Pages
|
||||
|
||||
- Dashboard: `site/src/pages/Dashboard/DashboardPage.view.tsx` combines `PageHeader`, `StatCard`, Radix Grid/Card, and `TopologyChart`; data orchestration is in `useDashboard.ts`.
|
||||
- Servers/Proxies: `site/src/pages/Servers/ServersPage.view.tsx` and `site/src/pages/Proxies/ProxiesPage.view.tsx` are the primary references for responsive lists, status badges, action menus, and AlertDialog. Their forms are under the corresponding `*FormPage` directories.
|
||||
- Settings: `site/src/pages/Settings/SettingsPage.view.tsx` and `SettingsPage.css` use a 240px sidebar, active accent state, and content area. `GeneralSettings.tsx` demonstrates `FormItem`, loading, and save toast; `ProfileSettings.tsx` demonstrates profile cards and security sections.
|
||||
|
||||
## Responsiveness, Themes, Internationalization, and Accessibility
|
||||
|
||||
- Responsiveness: the actual application-shell breakpoint is `max-width: 760px` (the 640px comment is stale). Test at least 320px mobile and desktop widths. On mobile, table content must use cards or controlled scrolling and must not require hover for actions.
|
||||
- Themes: new colors should use `var(--accent-*)`, `var(--gray-*)`, and semantic colors. Avoid fixed white backgrounds/black text. Check charts, overlays, borders, and focus states in light and dark themes.
|
||||
- Internationalization: route all user-facing text through `t()` and update both `locales/zh.json` and `en.json`. LanguageContext/localStorage owns language selection; do not use hard-coded Chinese or English as fallback UI.
|
||||
- Accessibility: use semantic Radix components. Icon-only buttons need accessible names/tooltips; images need alt text; form labels must associate with controls; keyboard focus must remain visible. `index.css` currently forces the Recharts surface outline off and must be limited to non-interactive charts; reassess it if keyboard chart interaction is added.
|
||||
- Motion: the standard page transition is `PageTransition` at 0.3s cubic-bezier; titles use 0.5s easeOut; status dots loop every 1.6–2.5s. Lightweight hover/tap effects are acceptable but must not block interaction. Only the unused Vite-template `App.css` currently observes `prefers-reduced-motion`; actual Framer/status-dot animations do not support it consistently and remain technical debt.
|
||||
|
||||
## Reuse and Addition Rules
|
||||
|
||||
1. Check Radix Themes first, then `site/src/components/`, then neighboring page view/hook patterns.
|
||||
2. Extract a shared component only when a semantically stable pattern spans at least two pages; keep page-specific compositions in the page directory.
|
||||
3. New shared components must use tokens, support `className` and necessary props, cover loading/disabled/error states, and be verified in both themes and mobile layouts.
|
||||
4. Local styles are acceptable for third-party charts, complex layouts, or states difficult to express with Radix props/Tailwind. Scope names to the page/component and avoid global selectors and `!important`. Existing `!important` usage in Settings CSS is a compatibility condition, not a pattern for new styles.
|
||||
5. Do not restore or extend unused `App.css` template styles. Put necessary global rules in `index.css` and document their impact.
|
||||
|
||||
## Technical Debt
|
||||
|
||||
- There is no centralized project-owned set of spacing, shadow, z-index, or motion tokens; the UI relies on Radix scales mixed with local pixel values.
|
||||
- Settings has only a desktop 240px sidebar, with no dedicated mobile adaptation rules found; verify on a real device.
|
||||
- Error state, ErrorBoundary, and form-error presentation do not yet follow a unified shared pattern.
|
||||
- ProfileSettings uses native `alert`, Loading defaults to English `Loading...`, and internationalization remains inconsistent.
|
||||
- Actual interaction animations do not yet systematically honor `prefers-reduced-motion`.
|
||||
@@ -0,0 +1,25 @@
|
||||
# Dependencies
|
||||
node_modules/
|
||||
|
||||
# Build output
|
||||
dist/
|
||||
.vitepress/dist/
|
||||
.vitepress/cache/
|
||||
|
||||
# Local env files
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/
|
||||
.idea/
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
# OS files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
@@ -0,0 +1,139 @@
|
||||
import { defineConfig } from 'vitepress'
|
||||
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default defineConfig({
|
||||
// base: '/podux-doc/',
|
||||
title: "Podux",
|
||||
description: "现代化的 Frpc 管理平台 - 基于 PocketBase 和 React 构建的强大内网穿透管理系统",
|
||||
head: [
|
||||
['link', { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
|
||||
['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
|
||||
['script', { defer: '', src: 'https://umami.jwinks.com:9443/script.js', 'data-website-id': '7a64c0ad-6d82-484c-88d3-5d9a6c2a1fff' }]
|
||||
],
|
||||
metaChunk: true,
|
||||
|
||||
locales: {
|
||||
root: {
|
||||
label: '简体中文',
|
||||
lang: 'zh-CN',
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{ text: '首页', link: '/' },
|
||||
{ text: '指南', link: '/guide/what-is-podux' },
|
||||
],
|
||||
sidebar: [
|
||||
{
|
||||
text: '指南',
|
||||
items: [
|
||||
{ text: '什么是 Podux?', link: '/guide/what-is-podux' },
|
||||
{ text: '界面预览', link: '/guide/screenshots' },
|
||||
|
||||
{ text: '快速开始', link: '/guide/getting-started' },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '安装部署',
|
||||
items: [
|
||||
{
|
||||
text: '安装',
|
||||
items: [
|
||||
{ text: '二进制', link: '/deploy/install/binary' },
|
||||
{ text: 'Docker', link: '/deploy/install/docker' },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '升级',
|
||||
items: [
|
||||
{ text: '二进制', link: '/deploy/upgrade/binary' },
|
||||
{ text: 'Docker', link: '/deploy/upgrade/docker' },
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '故障排除',
|
||||
items: [
|
||||
{ text: '常见问题', link: '/troubleshoot/faq' },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '开发设计',
|
||||
items: [
|
||||
{ text: '文档索引', link: '/development/' },
|
||||
{ text: '系统架构', link: '/development/architecture' },
|
||||
{ text: '数据库设计', link: '/development/database-design' },
|
||||
{ text: 'UI 规范', link: '/development/ui-spec' },
|
||||
]
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
message: '基于 MIT 协议开源',
|
||||
copyright: 'Copyright © 2026-present Podux'
|
||||
},
|
||||
}
|
||||
},
|
||||
en: {
|
||||
label: 'English',
|
||||
lang: 'en-US',
|
||||
description: "Modern Frpc Management Platform",
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{ text: 'Home', link: '/en/' },
|
||||
{ text: 'Guide', link: '/en/guide/what-is-podux' }
|
||||
],
|
||||
sidebar: [
|
||||
{
|
||||
text: 'Guide',
|
||||
items: [
|
||||
{ text: 'What is Podux?', link: '/en/guide/what-is-podux' },
|
||||
{ text: 'Screenshots', link: '/en/guide/screenshots' },
|
||||
{ text: 'Getting Started', link: '/en/guide/getting-started' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Deployment',
|
||||
items: [
|
||||
{
|
||||
text: 'Install',
|
||||
items: [
|
||||
{ text: 'Binary', link: '/en/deploy/install/binary' },
|
||||
{ text: 'Docker', link: '/en/deploy/install/docker' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Upgrade',
|
||||
items: [
|
||||
{ text: 'Binary', link: '/en/deploy/upgrade/binary' },
|
||||
{ text: 'Docker', link: '/en/deploy/upgrade/docker' }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Troubleshooting',
|
||||
items: [
|
||||
{ text: 'FAQ', link: '/en/troubleshoot/faq' }
|
||||
]
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
message: 'Released under the MIT License.',
|
||||
copyright: 'Copyright © 2026-present Podux'
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
themeConfig: {
|
||||
// https://vitepress.dev/reference/default-theme-config
|
||||
logo: { src: '/logo.svg', width: 24, height: 24 },
|
||||
|
||||
socialLinks: [
|
||||
{ icon: 'github', link: 'https://github.com/luckjiawei/podux' }
|
||||
],
|
||||
|
||||
search: {
|
||||
provider: 'local'
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<div class="aside-ad">
|
||||
<a href="https://www.rainyun.com/s=ljw_?podux" target="_blank" rel="noopener noreferrer">
|
||||
<div class="aside-ad-inner">
|
||||
<div class="aside-ad-badge">赞助商</div>
|
||||
<div class="aside-ad-content">
|
||||
<div class="aside-ad-title">☁️ 雨云</div>
|
||||
<div class="aside-ad-desc">价格实惠的国内云服务器,轻松部署 frps 服务</div>
|
||||
<div class="aside-ad-cta">立即查看 →</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.aside-ad {
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.aside-ad a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.aside-ad-inner {
|
||||
position: relative;
|
||||
border: 1px solid var(--vp-c-brand-1);
|
||||
border-radius: 8px;
|
||||
padding: 12px 14px;
|
||||
background: var(--vp-c-bg-soft);
|
||||
transition: background 0.2s, border-color 0.2s;
|
||||
}
|
||||
|
||||
.aside-ad-inner:hover {
|
||||
background: var(--vp-c-brand-soft);
|
||||
border-color: var(--vp-c-brand-2);
|
||||
}
|
||||
|
||||
.aside-ad-badge {
|
||||
font-size: 10px;
|
||||
color: var(--vp-c-text-3);
|
||||
margin-bottom: 6px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.aside-ad-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--vp-c-text-1);
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.aside-ad-desc {
|
||||
font-size: 12px;
|
||||
color: var(--vp-c-text-2);
|
||||
line-height: 1.5;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.aside-ad-cta {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--vp-c-brand-1);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,88 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||
|
||||
interface Image {
|
||||
src: string
|
||||
caption: string
|
||||
}
|
||||
|
||||
const images: Image[] = [
|
||||
{ src: '/22.png', caption: '服务器管理 — 实时延迟与地理位置' },
|
||||
{ src: '/33.png', caption: '代理管理 — 可视化配置所有隧道' },
|
||||
{ src: '/44.png', caption: '代理详情 — 实时连接日志' },
|
||||
{ src: '/55.png', caption: '一键导入 — 支持 TOML 配置文件' },
|
||||
{ src: '/66.png', caption: '添加代理 — 表单填写界面' },
|
||||
]
|
||||
|
||||
const activeIndex = ref<number | null>(null)
|
||||
const active = computed(() => activeIndex.value !== null ? images[activeIndex.value] : null)
|
||||
|
||||
function open(i: number) {
|
||||
activeIndex.value = i
|
||||
document.body.style.overflow = 'hidden'
|
||||
}
|
||||
|
||||
function close() {
|
||||
activeIndex.value = null
|
||||
document.body.style.overflow = ''
|
||||
}
|
||||
|
||||
function prev() {
|
||||
if (activeIndex.value !== null && activeIndex.value > 0) activeIndex.value--
|
||||
}
|
||||
|
||||
function next() {
|
||||
if (activeIndex.value !== null && activeIndex.value < images.length - 1) activeIndex.value++
|
||||
}
|
||||
|
||||
function onKey(e: KeyboardEvent) {
|
||||
if (activeIndex.value === null) return
|
||||
if (e.key === 'Escape') close()
|
||||
if (e.key === 'ArrowLeft') prev()
|
||||
if (e.key === 'ArrowRight') next()
|
||||
}
|
||||
|
||||
onMounted(() => document.addEventListener('keydown', onKey))
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener('keydown', onKey)
|
||||
document.body.style.overflow = ''
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="sg-gallery">
|
||||
<div
|
||||
v-for="(img, i) in images"
|
||||
:key="img.src"
|
||||
class="sg-item"
|
||||
@click="open(i)"
|
||||
>
|
||||
<img :src="img.src" :alt="img.caption" loading="lazy" />
|
||||
<div class="sg-caption">{{ img.caption }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Teleport to="body">
|
||||
<Transition name="sg-fade">
|
||||
<div v-if="active" class="sg-lightbox" @click="close">
|
||||
<button class="sg-close" aria-label="关闭" @click.stop="close">✕</button>
|
||||
<div class="sg-lightbox-inner" @click.stop>
|
||||
<img :src="active.src" :alt="active.caption" />
|
||||
<p class="sg-lightbox-caption">{{ active.caption }}</p>
|
||||
</div>
|
||||
<button
|
||||
v-if="activeIndex! > 0"
|
||||
class="sg-nav sg-nav-prev"
|
||||
aria-label="上一张"
|
||||
@click.stop="prev"
|
||||
>‹</button>
|
||||
<button
|
||||
v-if="activeIndex! < images.length - 1"
|
||||
class="sg-nav sg-nav-next"
|
||||
aria-label="下一张"
|
||||
@click.stop="next"
|
||||
>›</button>
|
||||
</div>
|
||||
</Transition>
|
||||
</Teleport>
|
||||
</template>
|
||||
@@ -0,0 +1,259 @@
|
||||
/**
|
||||
* Customize default theme styling by overriding CSS variables:
|
||||
* https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
|
||||
*/
|
||||
|
||||
/**
|
||||
* Colors
|
||||
*
|
||||
* Each colors have exact same color scale system with 3 levels of solid
|
||||
* colors with different brightness, and 1 soft color.
|
||||
*
|
||||
* - `XXX-1`: The most solid color used mainly for colored text. It must
|
||||
* satisfy the contrast ratio against when used on top of `XXX-soft`.
|
||||
*
|
||||
* - `XXX-2`: The color used mainly for hover state of the button.
|
||||
*
|
||||
* - `XXX-3`: The color for solid background, such as bg color of the button.
|
||||
* It must satisfy the contrast ratio with pure white (#ffffff) text on
|
||||
* top of it.
|
||||
*
|
||||
* - `XXX-soft`: The color used for subtle background such as custom container
|
||||
* or badges. It must satisfy the contrast ratio when putting `XXX-1` colors
|
||||
* on top of it.
|
||||
*
|
||||
* The soft color must be semi transparent alpha channel. This is crucial
|
||||
* because it allows adding multiple "soft" colors on top of each other
|
||||
* to create a accent, such as when having inline code block inside
|
||||
* custom containers.
|
||||
*
|
||||
* - `default`: The color used purely for subtle indication without any
|
||||
* special meanings attched to it such as bg color for menu hover state.
|
||||
*
|
||||
* - `brand`: Used for primary brand colors, such as link text, button with
|
||||
* brand theme, etc.
|
||||
*
|
||||
* - `tip`: Used to indicate useful information. The default theme uses the
|
||||
* brand color for this by default.
|
||||
*
|
||||
* - `warning`: Used to indicate warning to the users. Used in custom
|
||||
* container, badges, etc.
|
||||
*
|
||||
* - `danger`: Used to show error, or dangerous message to the users. Used
|
||||
* in custom container, badges, etc.
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
:root {
|
||||
--vp-c-default-1: var(--vp-c-gray-1);
|
||||
--vp-c-default-2: var(--vp-c-gray-2);
|
||||
--vp-c-default-3: var(--vp-c-gray-3);
|
||||
--vp-c-default-soft: var(--vp-c-gray-soft);
|
||||
|
||||
--vp-c-brand-1: #6366f1;
|
||||
--vp-c-brand-2: #818cf8;
|
||||
--vp-c-brand-3: #6366f1;
|
||||
--vp-c-brand-soft: rgba(99, 102, 241, 0.14);
|
||||
|
||||
--vp-c-tip-1: var(--vp-c-brand-1);
|
||||
--vp-c-tip-2: var(--vp-c-brand-2);
|
||||
--vp-c-tip-3: var(--vp-c-brand-3);
|
||||
--vp-c-tip-soft: var(--vp-c-brand-soft);
|
||||
|
||||
--vp-c-warning-1: var(--vp-c-yellow-1);
|
||||
--vp-c-warning-2: var(--vp-c-yellow-2);
|
||||
--vp-c-warning-3: var(--vp-c-yellow-3);
|
||||
--vp-c-warning-soft: var(--vp-c-yellow-soft);
|
||||
|
||||
--vp-c-danger-1: var(--vp-c-red-1);
|
||||
--vp-c-danger-2: var(--vp-c-red-2);
|
||||
--vp-c-danger-3: var(--vp-c-red-3);
|
||||
--vp-c-danger-soft: var(--vp-c-red-soft);
|
||||
}
|
||||
|
||||
.dark {
|
||||
--vp-c-brand-1: #818cf8;
|
||||
--vp-c-brand-2: #6366f1;
|
||||
--vp-c-brand-3: #818cf8;
|
||||
--vp-c-brand-soft: rgba(129, 140, 248, 0.16);
|
||||
}
|
||||
|
||||
/**
|
||||
* Component: Home
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
:root {
|
||||
--vp-home-hero-name-color: transparent;
|
||||
--vp-home-hero-name-background: -webkit-linear-gradient(
|
||||
120deg,
|
||||
#6366f1 30%,
|
||||
#fcd34d
|
||||
);
|
||||
|
||||
--vp-home-hero-image-background-image: linear-gradient(
|
||||
-45deg,
|
||||
#6366f170 50%,
|
||||
#fcd34d50 50%
|
||||
);
|
||||
--vp-home-hero-image-filter: blur(44px);
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
:root {
|
||||
--vp-home-hero-image-filter: blur(56px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 960px) {
|
||||
:root {
|
||||
--vp-home-hero-image-filter: blur(68px);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Component: Screenshot Gallery
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
.sg-gallery {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 1.25rem;
|
||||
margin: 2rem 0;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.sg-gallery {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.sg-gallery {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.sg-item {
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
cursor: zoom-in;
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
|
||||
transition: transform 0.25s ease, box-shadow 0.25s ease;
|
||||
background: var(--vp-c-bg-soft);
|
||||
}
|
||||
|
||||
.sg-item:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
|
||||
}
|
||||
|
||||
.sg-item img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.sg-caption {
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-size: 0.78rem;
|
||||
color: var(--vp-c-text-2);
|
||||
text-align: center;
|
||||
border-top: 1px solid var(--vp-c-divider);
|
||||
}
|
||||
|
||||
/* Lightbox */
|
||||
|
||||
.sg-lightbox {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 9999;
|
||||
background: rgba(0, 0, 0, 0.88);
|
||||
backdrop-filter: blur(10px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.sg-lightbox-inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
max-width: min(90vw, 960px);
|
||||
}
|
||||
|
||||
.sg-lightbox-inner img {
|
||||
max-width: 100%;
|
||||
max-height: calc(85vh - 3rem);
|
||||
border-radius: 10px;
|
||||
object-fit: contain;
|
||||
margin: 0 !important;
|
||||
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.sg-lightbox-caption {
|
||||
margin-top: 0.9rem;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
font-size: 0.9rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sg-close {
|
||||
position: fixed;
|
||||
top: 1.25rem;
|
||||
right: 1.5rem;
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
border: none;
|
||||
color: white;
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
border-radius: 50%;
|
||||
font-size: 1rem;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: background 0.2s;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.sg-close:hover {
|
||||
background: rgba(255, 255, 255, 0.28);
|
||||
}
|
||||
|
||||
.sg-nav {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
border: none;
|
||||
color: white;
|
||||
width: 2.75rem;
|
||||
height: 2.75rem;
|
||||
border-radius: 50%;
|
||||
font-size: 1.6rem;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: background 0.2s;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.sg-nav:hover {
|
||||
background: rgba(255, 255, 255, 0.28);
|
||||
}
|
||||
|
||||
.sg-nav-prev { left: 1.25rem; }
|
||||
.sg-nav-next { right: 1.25rem; }
|
||||
|
||||
/* Lightbox fade transition */
|
||||
.sg-fade-enter-active,
|
||||
.sg-fade-leave-active {
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.sg-fade-enter-from,
|
||||
.sg-fade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
import type { Theme } from 'vitepress'
|
||||
import { h } from 'vue'
|
||||
import ScreenshotGallery from './components/ScreenshotGallery.vue'
|
||||
import AsideAd from './components/AsideAd.vue'
|
||||
import './custom.css'
|
||||
|
||||
export default {
|
||||
extends: DefaultTheme,
|
||||
Layout() {
|
||||
return h(DefaultTheme.Layout, null, {
|
||||
'aside-outline-after': () => h(AsideAd),
|
||||
})
|
||||
},
|
||||
enhanceApp({ app }) {
|
||||
app.component('ScreenshotGallery', ScreenshotGallery)
|
||||
},
|
||||
} satisfies Theme
|
||||
@@ -0,0 +1,3 @@
|
||||
# API 概览
|
||||
|
||||
待完善...
|
||||
@@ -0,0 +1,3 @@
|
||||
# 代理 API
|
||||
|
||||
待完善...
|
||||
@@ -0,0 +1,3 @@
|
||||
# 服务器 API
|
||||
|
||||
待完善...
|
||||
@@ -0,0 +1,112 @@
|
||||
# 二进制安装
|
||||
|
||||
::: warning 文档待完善
|
||||
本页内容正在持续完善中,部分细节可能不够准确,请以实际情况为准。
|
||||
:::
|
||||
|
||||
通过预编译的二进制文件安装 Podux,适合直接在服务器或本地机器上运行。
|
||||
|
||||
## 下载
|
||||
|
||||
前往 [GitHub Releases](https://github.com/luckjiawei/podux/releases/latest) 页面,根据你的系统选择对应的安装包:
|
||||
|
||||
| 系统 | 架构 | 文件名 |
|
||||
| --- | --- | --- |
|
||||
| Linux | x86_64 (amd64) | `podux-linux-amd64.tar.gz` |
|
||||
| Linux | ARM64 | `podux-linux-arm64.tar.gz` |
|
||||
| Linux | ARMv7 | `podux-linux-armv7.tar.gz` |
|
||||
| macOS | Intel | `podux-darwin-amd64.tar.gz` |
|
||||
| macOS | Apple Silicon | `podux-darwin-arm64.tar.gz` |
|
||||
| Windows | x86_64 | `podux-windows-amd64.zip` |
|
||||
|
||||
也可以通过命令行直接下载(以 Linux amd64 为例):
|
||||
|
||||
```bash
|
||||
curl -LO https://github.com/luckjiawei/podux/releases/latest/download/podux-linux-amd64.tar.gz
|
||||
```
|
||||
|
||||
## 安装
|
||||
|
||||
### Linux / macOS
|
||||
|
||||
```bash
|
||||
# 解压
|
||||
tar -xzf podux-linux-amd64.tar.gz
|
||||
|
||||
# 移动到系统路径(可选)
|
||||
sudo mv podux /usr/local/bin/
|
||||
|
||||
# 赋予执行权限
|
||||
sudo chmod +x /usr/local/bin/podux
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
||||
解压 `.zip` 文件到任意目录,在解压目录中打开 PowerShell 或命令提示符即可使用。
|
||||
|
||||
## 启动
|
||||
|
||||
```bash
|
||||
podux serve --http 0.0.0.0:8090
|
||||
```
|
||||
|
||||
启动后访问 `http://localhost:8090` 进入主界面,`http://localhost:8090/_/` 进入管理后台。
|
||||
|
||||
::: tip
|
||||
首次启动会自动初始化数据库,数据默认存储在当前目录下的 `pb_data/` 文件夹中。建议固定工作目录,避免数据分散。
|
||||
:::
|
||||
|
||||
## 配置开机自启(Linux)
|
||||
|
||||
推荐使用 systemd 管理 Podux 进程。
|
||||
|
||||
**1. 创建专用用户(可选但推荐)**
|
||||
|
||||
```bash
|
||||
sudo useradd -r -s /bin/false podux
|
||||
```
|
||||
|
||||
**2. 创建数据目录**
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /var/lib/podux
|
||||
sudo chown podux:podux /var/lib/podux
|
||||
```
|
||||
|
||||
**3. 创建 systemd 服务文件**
|
||||
|
||||
```bash
|
||||
sudo tee /etc/systemd/system/podux.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Podux Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=podux
|
||||
WorkingDirectory=/var/lib/podux
|
||||
ExecStart=/usr/local/bin/podux serve --http 0.0.0.0:8090
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
```
|
||||
|
||||
**4. 启用并启动服务**
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable podux
|
||||
sudo systemctl start podux
|
||||
|
||||
# 查看运行状态
|
||||
sudo systemctl status podux
|
||||
```
|
||||
|
||||
## 查看日志
|
||||
|
||||
```bash
|
||||
sudo journalctl -u podux -f
|
||||
```
|
||||
@@ -0,0 +1,150 @@
|
||||
# Docker 安装
|
||||
|
||||
使用 Docker 部署 Podux,适合容器化环境或希望快速隔离部署的场景。
|
||||
|
||||
## 前置条件
|
||||
|
||||
- Docker 20.10+
|
||||
- (可选)Docker Compose v2
|
||||
|
||||
## 镜像信息
|
||||
|
||||
官方镜像托管在 GitHub Container Registry:
|
||||
|
||||
```text
|
||||
ghcr.io/luckjiawei/podux:latest
|
||||
```
|
||||
|
||||
支持以下架构:`linux/amd64`、`linux/arm64`、`linux/arm/v7`
|
||||
|
||||
## 快速启动
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name podux \
|
||||
--restart unless-stopped \
|
||||
-p 8090:8090 \
|
||||
-v ./podux-data:/app/pb_data \
|
||||
ghcr.io/luckjiawei/podux:latest
|
||||
```
|
||||
|
||||
| 参数 | 说明 |
|
||||
| --- | --- |
|
||||
| `-p 8090:8090` | 将容器端口映射到宿主机 |
|
||||
| `-v ./podux-data:/app/pb_data` | 持久化数据目录 |
|
||||
| `--restart unless-stopped` | 宿主机重启后自动恢复 |
|
||||
|
||||
启动后访问 `http://localhost:8090` 进入主界面。
|
||||
|
||||
## Docker Compose(推荐)
|
||||
|
||||
创建 `docker-compose.yml` 文件:
|
||||
|
||||
```yaml
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
podux:
|
||||
image: ghcr.io/luckjiawei/podux:${VERSION:-latest}
|
||||
container_name: podux
|
||||
restart: unless-stopped
|
||||
|
||||
ports:
|
||||
- "8090:8090"
|
||||
|
||||
volumes:
|
||||
- podux-data:/app/pb_data
|
||||
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
|
||||
# Resource limits (optional)
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2'
|
||||
memory: 1G
|
||||
reservations:
|
||||
cpus: '0.5'
|
||||
memory: 256M
|
||||
|
||||
# Network mode (optional)
|
||||
# Uncomment if you need host network for better frpc performance
|
||||
# network_mode: host
|
||||
|
||||
# Logging
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8090/api/health"]
|
||||
interval: 30s
|
||||
timeout: 3s
|
||||
start_period: 10s
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
podux-data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
default:
|
||||
name: podux-network
|
||||
```
|
||||
|
||||
启动:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
查看日志:
|
||||
|
||||
```bash
|
||||
docker compose logs -f podux
|
||||
```
|
||||
|
||||
## 数据持久化
|
||||
|
||||
容器内数据存储在 `/app/pb_data`,包含数据库文件和配置信息。**必须挂载此目录**,否则容器重建后数据丢失。
|
||||
|
||||
Docker Compose 配置使用具名 volume `podux-data`,数据由 Docker 统一管理:
|
||||
|
||||
```bash
|
||||
# 查看 volume 位置
|
||||
docker volume inspect podux-data
|
||||
```
|
||||
|
||||
## 自定义端口
|
||||
|
||||
如需修改监听端口,同步修改宿主机映射端口和容器内端口:
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name podux \
|
||||
--restart unless-stopped \
|
||||
-p 18090:18090 \
|
||||
-v ./podux-data:/app/pb_data \
|
||||
ghcr.io/luckjiawei/podux:latest \
|
||||
serve --http 0.0.0.0:18090
|
||||
```
|
||||
|
||||
## 常用命令
|
||||
|
||||
```bash
|
||||
# 停止
|
||||
docker compose stop podux
|
||||
|
||||
# 重启
|
||||
docker compose restart podux
|
||||
|
||||
# 查看日志
|
||||
docker compose logs -f podux
|
||||
|
||||
# 进入容器
|
||||
docker compose exec podux sh
|
||||
```
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
# 二进制升级
|
||||
|
||||
::: warning 文档待完善
|
||||
本页内容正在持续完善中,部分细节可能不够准确,请以实际情况为准。
|
||||
:::
|
||||
|
||||
升级 Podux 二进制版本前,建议先备份数据,再替换可执行文件。
|
||||
|
||||
## 升级步骤
|
||||
|
||||
### 1. 备份数据
|
||||
|
||||
数据默认存储在工作目录下的 `pb_data/`,升级前先备份:
|
||||
|
||||
```bash
|
||||
cp -r /var/lib/podux/pb_data /var/lib/podux/pb_data.bak
|
||||
```
|
||||
|
||||
### 2. 停止服务
|
||||
|
||||
```bash
|
||||
sudo systemctl stop podux
|
||||
```
|
||||
|
||||
若未使用 systemd,手动终止进程:
|
||||
|
||||
```bash
|
||||
pkill podux
|
||||
```
|
||||
|
||||
### 3. 下载新版本
|
||||
|
||||
前往 [GitHub Releases](https://github.com/luckjiawei/podux/releases/latest) 查看最新版本,或通过命令行下载(以 Linux amd64 为例):
|
||||
|
||||
```bash
|
||||
curl -LO https://github.com/luckjiawei/podux/releases/latest/download/podux-linux-amd64.tar.gz
|
||||
tar -xzf podux-linux-amd64.tar.gz
|
||||
```
|
||||
|
||||
### 4. 替换二进制文件
|
||||
|
||||
```bash
|
||||
sudo mv podux /usr/local/bin/podux
|
||||
sudo chmod +x /usr/local/bin/podux
|
||||
```
|
||||
|
||||
### 5. 重启服务
|
||||
|
||||
```bash
|
||||
sudo systemctl start podux
|
||||
|
||||
# 确认服务正常运行
|
||||
sudo systemctl status podux
|
||||
```
|
||||
|
||||
|
||||
## 回滚
|
||||
|
||||
如果升级后出现问题,恢复备份数据并重新安装旧版本:
|
||||
|
||||
```bash
|
||||
# 停止服务
|
||||
sudo systemctl stop podux
|
||||
|
||||
# 恢复数据备份
|
||||
rm -rf /var/lib/podux/pb_data
|
||||
cp -r /var/lib/podux/pb_data.bak /var/lib/podux/pb_data
|
||||
|
||||
# 从 GitHub Releases 下载对应旧版本并替换二进制文件,然后启动
|
||||
sudo systemctl start podux
|
||||
```
|
||||
@@ -0,0 +1,69 @@
|
||||
# Docker 升级
|
||||
|
||||
升级 Docker 部署的 Podux,只需拉取新镜像并重建容器,数据通过挂载 volume 自动保留。
|
||||
|
||||
## Docker Compose 升级(推荐)
|
||||
|
||||
```bash
|
||||
# 拉取最新镜像
|
||||
docker compose pull
|
||||
|
||||
# 重建并启动容器
|
||||
docker compose up -d
|
||||
|
||||
# 确认运行状态
|
||||
docker compose ps
|
||||
```
|
||||
|
||||
旧镜像不会自动删除,可手动清理:
|
||||
|
||||
```bash
|
||||
docker image prune -f
|
||||
```
|
||||
|
||||
## docker run 升级
|
||||
|
||||
```bash
|
||||
# 拉取最新镜像
|
||||
docker pull ghcr.io/luckjiawei/podux:latest
|
||||
|
||||
# 停止并删除旧容器(数据存储在 volume 中,不会丢失)
|
||||
docker stop podux
|
||||
docker rm podux
|
||||
|
||||
# 启动新容器
|
||||
docker run -d \
|
||||
--name podux \
|
||||
--restart unless-stopped \
|
||||
-p 8090:8090 \
|
||||
-v ./podux-data:/app/pb_data \
|
||||
ghcr.io/luckjiawei/podux:latest
|
||||
```
|
||||
|
||||
## 升级到指定版本
|
||||
|
||||
如需升级到特定版本而非 `latest`,修改镜像标签:
|
||||
|
||||
```bash
|
||||
# Docker Compose:设置环境变量
|
||||
VERSION=v1.2.0 docker compose up -d
|
||||
|
||||
# 或编辑 docker-compose.yml 中的 image 字段
|
||||
image: ghcr.io/luckjiawei/podux:v1.2.0
|
||||
```
|
||||
|
||||
## 回滚
|
||||
|
||||
如果升级后出现问题,切换回旧版本:
|
||||
|
||||
```bash
|
||||
# 停止当前容器
|
||||
docker compose down
|
||||
|
||||
# 修改 docker-compose.yml 中的版本号为旧版本,然后启动
|
||||
VERSION=v1.1.0 docker compose up -d
|
||||
```
|
||||
|
||||
::: tip
|
||||
数据存储在 volume `podux-data` 中,回滚容器不影响已有数据。
|
||||
:::
|
||||
@@ -0,0 +1,120 @@
|
||||
# Binary Installation
|
||||
|
||||
::: warning Work in Progress
|
||||
This page is still being improved. Some details may not be fully accurate — please refer to the actual behavior when in doubt.
|
||||
:::
|
||||
|
||||
Install Podux using pre-compiled binaries — ideal for running directly on a server or local machine.
|
||||
|
||||
## Download
|
||||
|
||||
Go to the [GitHub Releases](https://github.com/luckjiawei/podux/releases/latest) page and download the package for your platform:
|
||||
|
||||
| OS | Architecture | Filename |
|
||||
| --- | --- | --- |
|
||||
| Linux | x86_64 (amd64) | `podux-linux-amd64.tar.gz` |
|
||||
| Linux | ARM64 | `podux-linux-arm64.tar.gz` |
|
||||
| Linux | ARMv7 | `podux-linux-armv7.tar.gz` |
|
||||
| macOS | Intel | `podux-darwin-amd64.tar.gz` |
|
||||
| macOS | Apple Silicon | `podux-darwin-arm64.tar.gz` |
|
||||
| Windows | x86_64 | `podux-windows-amd64.zip` |
|
||||
|
||||
Or download directly from the command line (Linux amd64 example):
|
||||
|
||||
```bash
|
||||
curl -LO https://github.com/luckjiawei/podux/releases/latest/download/podux-linux-amd64.tar.gz
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
### Linux / macOS
|
||||
|
||||
```bash
|
||||
# Extract
|
||||
tar -xzf podux-linux-amd64.tar.gz
|
||||
|
||||
# Move to system path (optional)
|
||||
sudo mv podux /usr/local/bin/
|
||||
|
||||
# Make executable
|
||||
sudo chmod +x /usr/local/bin/podux
|
||||
|
||||
# Verify installation
|
||||
podux --version
|
||||
```
|
||||
|
||||
### Windows
|
||||
|
||||
Extract the `.zip` file to any directory, then open PowerShell or Command Prompt inside that directory to use it.
|
||||
|
||||
## Start
|
||||
|
||||
```bash
|
||||
podux serve --http 0.0.0.0:8090
|
||||
```
|
||||
|
||||
After starting, visit `http://localhost:8090` for the main interface and `http://localhost:8090/_/` for the admin panel.
|
||||
|
||||
::: tip
|
||||
On first launch, the database is initialized automatically. Data is stored in a `pb_data/` folder in the current working directory. Fix the working directory to avoid data scatter.
|
||||
:::
|
||||
|
||||
## Auto-start on Boot (Linux)
|
||||
|
||||
Use systemd to manage the Podux process.
|
||||
|
||||
**1. Create a dedicated user (optional but recommended)**
|
||||
|
||||
```bash
|
||||
sudo useradd -r -s /bin/false podux
|
||||
```
|
||||
|
||||
**2. Create the data directory**
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /var/lib/podux
|
||||
sudo chown podux:podux /var/lib/podux
|
||||
```
|
||||
|
||||
**3. Create the systemd service file**
|
||||
|
||||
```bash
|
||||
sudo tee /etc/systemd/system/podux.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=Podux Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=podux
|
||||
WorkingDirectory=/var/lib/podux
|
||||
ExecStart=/usr/local/bin/podux serve --http 0.0.0.0:8090
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
```
|
||||
|
||||
**4. Enable and start the service**
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable podux
|
||||
sudo systemctl start podux
|
||||
|
||||
# Check status
|
||||
sudo systemctl status podux
|
||||
```
|
||||
|
||||
## View Logs
|
||||
|
||||
```bash
|
||||
sudo journalctl -u podux -f
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Binary Upgrade](/en/deploy/upgrade/binary) — Upgrade to a new version
|
||||
- [Getting Started](/en/guide/getting-started) — Add servers and proxies
|
||||
@@ -0,0 +1,154 @@
|
||||
# Docker Installation
|
||||
|
||||
Deploy Podux with Docker — ideal for containerized environments or quick isolated deployments.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Docker 20.10+
|
||||
- Docker Compose v2 (optional)
|
||||
|
||||
## Image
|
||||
|
||||
The official image is hosted on GitHub Container Registry:
|
||||
|
||||
```text
|
||||
ghcr.io/luckjiawei/podux:latest
|
||||
```
|
||||
|
||||
Supported architectures: `linux/amd64`, `linux/arm64`, `linux/arm/v7`
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name podux \
|
||||
--restart unless-stopped \
|
||||
-p 8090:8090 \
|
||||
-v ./podux-data:/app/pb_data \
|
||||
ghcr.io/luckjiawei/podux:latest
|
||||
```
|
||||
|
||||
| Flag | Description |
|
||||
| --- | --- |
|
||||
| `-p 8090:8090` | Map container port to host |
|
||||
| `-v ./podux-data:/app/pb_data` | Persist data directory |
|
||||
| `--restart unless-stopped` | Auto-recover after host reboot |
|
||||
|
||||
After starting, visit `http://localhost:8090`.
|
||||
|
||||
## Docker Compose (Recommended)
|
||||
|
||||
Create a `docker-compose.yml` file:
|
||||
|
||||
```yaml
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
podux:
|
||||
image: ghcr.io/luckjiawei/podux:${VERSION:-latest}
|
||||
container_name: podux
|
||||
restart: unless-stopped
|
||||
|
||||
ports:
|
||||
- "8090:8090"
|
||||
|
||||
volumes:
|
||||
- podux-data:/app/pb_data
|
||||
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
|
||||
# Resource limits (optional)
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2'
|
||||
memory: 1G
|
||||
reservations:
|
||||
cpus: '0.5'
|
||||
memory: 256M
|
||||
|
||||
# Network mode (optional)
|
||||
# Uncomment if you need host network for better frpc performance
|
||||
# network_mode: host
|
||||
|
||||
# Logging
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8090/api/health"]
|
||||
interval: 30s
|
||||
timeout: 3s
|
||||
start_period: 10s
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
podux-data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
default:
|
||||
name: podux-network
|
||||
```
|
||||
|
||||
Start:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
View logs:
|
||||
|
||||
```bash
|
||||
docker compose logs -f podux
|
||||
```
|
||||
|
||||
## Data Persistence
|
||||
|
||||
Container data is stored in `/app/pb_data`, which includes the database and configuration. **This directory must be mounted**, otherwise data will be lost when the container is recreated.
|
||||
|
||||
Docker Compose uses a named volume `podux-data` managed by Docker:
|
||||
|
||||
```bash
|
||||
# Inspect volume location
|
||||
docker volume inspect podux-data
|
||||
```
|
||||
|
||||
## Custom Port
|
||||
|
||||
To change the listening port, update both the host mapping and the container port:
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name podux \
|
||||
--restart unless-stopped \
|
||||
-p 18090:18090 \
|
||||
-v ./podux-data:/app/pb_data \
|
||||
ghcr.io/luckjiawei/podux:latest \
|
||||
serve --http 0.0.0.0:18090
|
||||
```
|
||||
|
||||
## Common Commands
|
||||
|
||||
```bash
|
||||
# Stop
|
||||
docker compose stop podux
|
||||
|
||||
# Restart
|
||||
docker compose restart podux
|
||||
|
||||
# View logs
|
||||
docker compose logs -f podux
|
||||
|
||||
# Enter container shell
|
||||
docker compose exec podux sh
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Docker Upgrade](/en/deploy/upgrade/docker) — Upgrade to a new version
|
||||
- [Getting Started](/en/guide/getting-started) — Add servers and proxies
|
||||
@@ -0,0 +1,70 @@
|
||||
# Binary Upgrade
|
||||
|
||||
::: warning Work in Progress
|
||||
This page is still being improved. Some details may not be fully accurate — please refer to the actual behavior when in doubt.
|
||||
:::
|
||||
|
||||
Before upgrading the Podux binary, back up your data first, then replace the executable.
|
||||
|
||||
## Upgrade Steps
|
||||
|
||||
### 1. Back Up Data
|
||||
|
||||
Data is stored in `pb_data/` under the working directory. Back it up before upgrading:
|
||||
|
||||
```bash
|
||||
cp -r /var/lib/podux/pb_data /var/lib/podux/pb_data.bak
|
||||
```
|
||||
|
||||
### 2. Stop the Service
|
||||
|
||||
```bash
|
||||
sudo systemctl stop podux
|
||||
```
|
||||
|
||||
If not using systemd, kill the process manually:
|
||||
|
||||
```bash
|
||||
pkill podux
|
||||
```
|
||||
|
||||
### 3. Download the New Version
|
||||
|
||||
Visit [GitHub Releases](https://github.com/luckjiawei/podux/releases/latest) for the latest version, or download via command line (Linux amd64 example):
|
||||
|
||||
```bash
|
||||
curl -LO https://github.com/luckjiawei/podux/releases/latest/download/podux-linux-amd64.tar.gz
|
||||
tar -xzf podux-linux-amd64.tar.gz
|
||||
```
|
||||
|
||||
### 4. Replace the Binary
|
||||
|
||||
```bash
|
||||
sudo mv podux /usr/local/bin/podux
|
||||
sudo chmod +x /usr/local/bin/podux
|
||||
```
|
||||
|
||||
### 5. Restart the Service
|
||||
|
||||
```bash
|
||||
sudo systemctl start podux
|
||||
|
||||
# Confirm service is running
|
||||
sudo systemctl status podux
|
||||
```
|
||||
|
||||
## Rollback
|
||||
|
||||
If issues occur after upgrading, restore the backup and reinstall the old version:
|
||||
|
||||
```bash
|
||||
# Stop service
|
||||
sudo systemctl stop podux
|
||||
|
||||
# Restore data backup
|
||||
rm -rf /var/lib/podux/pb_data
|
||||
cp -r /var/lib/podux/pb_data.bak /var/lib/podux/pb_data
|
||||
|
||||
# Download the old version from GitHub Releases, replace the binary, then start
|
||||
sudo systemctl start podux
|
||||
```
|
||||
@@ -0,0 +1,69 @@
|
||||
# Docker Upgrade
|
||||
|
||||
To upgrade a Docker-deployed Podux, pull the new image and recreate the container. Data in the mounted volume is preserved automatically.
|
||||
|
||||
## Docker Compose Upgrade (Recommended)
|
||||
|
||||
```bash
|
||||
# Pull the latest image
|
||||
docker compose pull
|
||||
|
||||
# Recreate and start the container
|
||||
docker compose up -d
|
||||
|
||||
# Confirm running status
|
||||
docker compose ps
|
||||
```
|
||||
|
||||
Old images are not removed automatically. Clean them up manually:
|
||||
|
||||
```bash
|
||||
docker image prune -f
|
||||
```
|
||||
|
||||
## docker run Upgrade
|
||||
|
||||
```bash
|
||||
# Pull the latest image
|
||||
docker pull ghcr.io/luckjiawei/podux:latest
|
||||
|
||||
# Stop and remove the old container (data in volume is preserved)
|
||||
docker stop podux
|
||||
docker rm podux
|
||||
|
||||
# Start a new container
|
||||
docker run -d \
|
||||
--name podux \
|
||||
--restart unless-stopped \
|
||||
-p 8090:8090 \
|
||||
-v ./podux-data:/app/pb_data \
|
||||
ghcr.io/luckjiawei/podux:latest
|
||||
```
|
||||
|
||||
## Upgrade to a Specific Version
|
||||
|
||||
To target a specific version instead of `latest`, set the image tag:
|
||||
|
||||
```bash
|
||||
# Docker Compose: set via environment variable
|
||||
VERSION=v1.2.0 docker compose up -d
|
||||
|
||||
# Or edit the image field in docker-compose.yml
|
||||
image: ghcr.io/luckjiawei/podux:v1.2.0
|
||||
```
|
||||
|
||||
## Rollback
|
||||
|
||||
If issues occur after upgrading, switch back to the previous version:
|
||||
|
||||
```bash
|
||||
# Stop the current container
|
||||
docker compose down
|
||||
|
||||
# Set the old version and start
|
||||
VERSION=v1.1.0 docker compose up -d
|
||||
```
|
||||
|
||||
::: tip
|
||||
Data is stored in the `podux-data` volume. Rolling back the container does not affect existing data.
|
||||
:::
|
||||
@@ -0,0 +1,124 @@
|
||||
# Getting Started
|
||||
|
||||
This guide helps you install and configure Podux in under 5 minutes using Docker.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Docker](https://docs.docker.com/get-docker/) installed
|
||||
- A public server with frps deployed (or a third-party frp service)
|
||||
- The machine running Podux must have internet access
|
||||
|
||||
::: info Don't have a public server yet?
|
||||
Check out **[RainYun](https://www.rainyun.com/s=ljw_?podux)** — an affordable and reliable cloud server provider, great for hosting frps and other self-hosted services.
|
||||
:::
|
||||
|
||||
## Step 1: Start the Container
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name podux \
|
||||
--restart unless-stopped \
|
||||
-p 8090:8090 \
|
||||
-v podux-data:/app/pb_data \
|
||||
ghcr.io/luckjiawei/podux:latest
|
||||
```
|
||||
|
||||
On successful startup, the terminal will display:
|
||||
|
||||
```text
|
||||
App: http://0.0.0.0:8090
|
||||
Admin: http://0.0.0.0:8090/_/
|
||||
```
|
||||
|
||||
::: tip Using Docker Compose
|
||||
You can also manage it with Docker Compose:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
podux:
|
||||
image: ghcr.io/luckjiawei/podux:latest
|
||||
container_name: podux
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8090:8090"
|
||||
volumes:
|
||||
- podux-data:/app/pb_data
|
||||
|
||||
volumes:
|
||||
podux-data:
|
||||
```
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
:::
|
||||
|
||||
## Step 2: Create an Account
|
||||
|
||||
Open your browser and navigate to the main interface:
|
||||
|
||||
```text
|
||||
http://localhost:8090
|
||||
```
|
||||
|
||||
On the first visit, you will be guided to create an account. Enter your username and password and submit.
|
||||
|
||||
## Step 3: Create a Backend Account (Optional)
|
||||
|
||||
If you need access to the backend management panel, navigate to the Admin UI:
|
||||
|
||||
```text
|
||||
http://localhost:8090/_/
|
||||
```
|
||||
|
||||
On the first visit, you will be guided to create a backend account. Enter your email and password and submit.
|
||||
|
||||
::: warning Security Notice
|
||||
If Podux is accessible from the public internet, use a strong password and consider restricting access to port `8090` via your firewall.
|
||||
:::
|
||||
|
||||
## Step 4: Open the Main Interface
|
||||
|
||||
Visit the application dashboard:
|
||||
|
||||
```text
|
||||
http://localhost:8090
|
||||
```
|
||||
|
||||
You will see the Podux main console.
|
||||
|
||||
## Step 5: Add a Server
|
||||
|
||||
1. Click **Servers** in the left navigation
|
||||
2. Click **Add Server** and fill in the following:
|
||||
|
||||
| Field | Description | Example |
|
||||
| --- | --- | --- |
|
||||
| Name | Display name for this server | `My Server` |
|
||||
| Server Address | IP or domain of your frps host | `your-server.com` |
|
||||
| Server Port | frps listening port, default `7000` | `7000` |
|
||||
| Auth Token | The `auth.token` from your frps config | `your-token` |
|
||||
|
||||
3. Enable **Auto Connect** and save — Podux will connect immediately.
|
||||
|
||||
Once connected, the server card will show an **Online** status and current latency.
|
||||
|
||||
## Step 6: Add a Proxy
|
||||
|
||||
1. Click **Proxies**, then **Add Proxy**
|
||||
2. Choose a proxy type (TCP / UDP / HTTP / HTTPS, etc.) and fill in the config:
|
||||
|
||||
**Example: Expose local SSH (port 22) to the internet**
|
||||
|
||||
| Field | Value |
|
||||
| --- | --- |
|
||||
| Name | `my-ssh` |
|
||||
| Type | `TCP` |
|
||||
| Server | Select the server you added |
|
||||
| Local IP | `127.0.0.1` |
|
||||
| Local Port | `22` |
|
||||
| Remote Port | `6022` |
|
||||
|
||||
3. Save — Podux will automatically hot-reload the frpc config, no restart needed.
|
||||
|
||||
You can then connect via `ssh -p 6022 user@your-server.com`.
|
||||
@@ -0,0 +1,5 @@
|
||||
# Screenshots
|
||||
|
||||
<img src="/11.png" alt="Dashboard Overview" style="border-radius:12px;box-shadow:0 8px 40px rgba(0,0,0,0.18);width:100%;margin:1rem 0;" />
|
||||
|
||||
<ScreenshotGallery />
|
||||
@@ -0,0 +1,114 @@
|
||||
# What is Podux?
|
||||
|
||||
Podux is a **modern frpc management platform** built on PocketBase and React, providing a visual interface to manage intranet penetration services.
|
||||
|
||||
## Dashboard
|
||||
|
||||

|
||||
|
||||
## The Name
|
||||
|
||||
**Podux** = **proxy** + **port** + **dux** (Latin: leader, guide)
|
||||
|
||||
The name itself is a statement of intent: not just a frontend for one tool, but a unified platform to lead and guide your tunneling infrastructure.
|
||||
|
||||
## Why the Rename?
|
||||
|
||||
Podux started life as **frpc-hub** — a project built around frpc. As it grew, the vision became clear: support not just frp, but become a unified platform for managing multiple tunneling tools.
|
||||
|
||||
The name **frpc-hub** tied the project to a single tool and couldn't carry that larger ambition. **Podux** reflects where the project is headed — a single, forward-looking platform that can grow to support more protocols and tools beyond frp.
|
||||
|
||||
> The rename happened in March 2026. The repository and all related references have been updated accordingly.
|
||||
|
||||
## Background
|
||||
|
||||
[frp](https://github.com/fatedier/frp) is one of the most popular open-source intranet penetration tools. Its client `frpc` establishes tunnels with the server `frps` via configuration files (`.toml` / `.ini`), exposing local services to the public internet.
|
||||
|
||||
However, using native frpc comes with several pain points:
|
||||
|
||||
- **Config-file-driven only**: Every change requires manually editing files and restarting the process
|
||||
- **Difficult multi-server management**: Maintaining multiple frps servers leads to scattered, error-prone configs
|
||||
- **No visual monitoring**: No intuitive way to view connection status or latency
|
||||
- **High operational cost**: Upgrades, backups, and migrations are all manual
|
||||
|
||||
Podux was built to solve exactly these problems.
|
||||
|
||||
## Core Features
|
||||
|
||||
### Server Management
|
||||
|
||||
Centrally manage multiple frps servers with support for:
|
||||
|
||||
- Add, edit, and delete server configurations
|
||||
- Auto-connect and automatic reconnection on failure
|
||||
- Real-time latency monitoring with geolocation display
|
||||
- One-click enable/disable toggle
|
||||
|
||||
### Proxy Management
|
||||
|
||||
Create and manage proxy tunnels via visual forms. Supported proxy types:
|
||||
|
||||
| Type | Description |
|
||||
| --- | --- |
|
||||
| TCP | General-purpose TCP port forwarding |
|
||||
| UDP | UDP traffic forwarding |
|
||||
| HTTP | HTTP reverse proxy |
|
||||
| HTTPS | HTTPS reverse proxy |
|
||||
| STCP | Secure TCP, peer-to-peer encrypted |
|
||||
| SUDP | Secure UDP |
|
||||
|
||||
### Hot Reload
|
||||
|
||||
After modifying proxy configurations, Podux automatically triggers an frpc reload — **no manual restart required**, zero service interruption.
|
||||
|
||||
### Modern Interface
|
||||
|
||||
Built with Radix UI and Tailwind CSS, delivering a clean and elegant UI with Chinese/English language switching.
|
||||
|
||||
## Architecture
|
||||
|
||||
```text
|
||||
┌─────────────────────────────────┐
|
||||
│ Browser (React) │
|
||||
│ Radix UI + Tailwind CSS │
|
||||
└────────────────┬────────────────┘
|
||||
│ HTTP API
|
||||
┌────────────────▼────────────────┐
|
||||
│ Backend (PocketBase) │
|
||||
│ Embedded SQLite Database │
|
||||
└────────────────┬────────────────┘
|
||||
│ Process Management
|
||||
┌────────────────▼────────────────┐
|
||||
│ frpc │
|
||||
│ Local intranet tunnel client │
|
||||
└────────────────┬────────────────┘
|
||||
│ Encrypted Tunnel
|
||||
┌────────────────▼────────────────┐
|
||||
│ frps │
|
||||
│ Public server (user-deployed) │
|
||||
└─────────────────────────────────┘
|
||||
```
|
||||
|
||||
Podux ships as a **single executable** that embeds both the PocketBase backend and frontend assets — ready to run with zero extra dependencies.
|
||||
|
||||
## Comparison with Manual Management
|
||||
|
||||
| | Manual frpc | Podux |
|
||||
| --- | --- | --- |
|
||||
| Configuration | Edit `.toml` files | Visual forms |
|
||||
| Reload config | Restart process manually | Automatic hot reload |
|
||||
| Multi-server | Maintain multiple config files | Unified dashboard |
|
||||
| Status monitoring | Read logs | Real-time monitoring panel |
|
||||
| Cross-platform deploy | Requires environment setup | Single file, ready to run |
|
||||
|
||||
## Use Cases
|
||||
|
||||
- **Developers**: Quickly expose local dev environments (web services, databases, SSH) to the internet for testing or demos
|
||||
- **DevOps engineers**: Manage intranet penetration configs across multiple machines from one place
|
||||
- **Home users**: Set up home servers, NAS, or remote desktop without memorizing complex config syntax
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Getting Started](/en/guide/getting-started) — Up and running in 5 minutes
|
||||
- [Binary Installation](/en/deploy/install/binary) — Deploy to your server
|
||||
- [Docker Installation](/en/deploy/install/docker) — Container-based deployment
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: "Podux"
|
||||
text: "Modern Frpc Management Platform"
|
||||
tagline: One-stop intranet penetration service management platform, making frpc configuration and monitoring simple and efficient.
|
||||
image:
|
||||
src: /logo.svg
|
||||
alt: Podux Dashboard
|
||||
actions:
|
||||
- theme: brand
|
||||
text: What is Podux?
|
||||
link: /en/guide/what-is-podux
|
||||
- theme: alt
|
||||
text: Get Started
|
||||
link: /en/guide/getting-started
|
||||
- theme: alt
|
||||
text: GitHub
|
||||
link: https://github.com/luckjiawei/podux
|
||||
|
||||
features:
|
||||
- icon: 🖥️
|
||||
title: Server Management
|
||||
details: Easily create, configure, and manage multiple frpc servers with auto-connection and status monitoring.
|
||||
- icon: 🔌
|
||||
title: Proxy Configuration
|
||||
details: Supports HTTP, HTTPS, TCP, UDP, and more proxy types with simple and intuitive configuration.
|
||||
- icon: 📊
|
||||
title: Real-time Monitoring
|
||||
details: Real-time network latency monitoring and geolocation display at a glance.
|
||||
- icon: 🔄
|
||||
title: Hot Reload
|
||||
details: Automatically reloads frpc after configuration changes without manual service restart.
|
||||
- icon: 🌐
|
||||
title: Multi-language Support
|
||||
details: Built-in internationalization support for easy switching between Chinese and English interfaces.
|
||||
- icon: 🎨
|
||||
title: Modern Interface
|
||||
details: Elegant user experience based on Radix UI and Tailwind CSS.
|
||||
- icon: 🚀
|
||||
title: High Performance
|
||||
details: Fast development and runtime experience based on Go and React.
|
||||
- icon: 📦
|
||||
title: Out of the Box
|
||||
details: Cross-platform support, single executable file, quick deployment to Linux, Windows, macOS without complex configuration.
|
||||
---
|
||||
@@ -0,0 +1,31 @@
|
||||
# FAQ
|
||||
|
||||
## Basics & Installation
|
||||
|
||||
### Q: What is Podux? How is it different from plain frpc?
|
||||
|
||||
A: Podux is a graphical management tool built on top of frpc. It integrates the core frp client functionality and provides a modern web interface for managing configuration, monitoring status, and viewing logs — eliminating the need to manually edit config files and the lack of visual monitoring in vanilla frpc.
|
||||
|
||||
### Q: Which operating systems does Podux support?
|
||||
|
||||
A: Windows, macOS, and major Linux distributions are all supported.
|
||||
|
||||
## Configuration & Usage
|
||||
|
||||
### Q: Can I import my existing `frpc.toml` config file?
|
||||
|
||||
A: It is currently recommended to recreate your configuration through Podux's visual interface to ensure all fields are correctly parsed and managed.
|
||||
|
||||
### Q: How do configuration changes take effect?
|
||||
|
||||
A: Podux supports hot reload. After saving changes in the web UI, the application automatically applies the new configuration — a full service restart is usually not required.
|
||||
|
||||
### Q: Which proxy protocols are supported?
|
||||
|
||||
A: **TCP**, **UDP**, **HTTP**, and **HTTPS** are fully supported. Advanced protocols such as **STCP** and **XTCP** are under development and will be available in future releases.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Q: How do I report a bug or unknown error?
|
||||
|
||||
A: Please open an issue on the GitHub repository. Include detailed error logs, steps to reproduce, and your operating system information to help us diagnose the problem quickly.
|
||||
@@ -0,0 +1,3 @@
|
||||
# 基础配置
|
||||
|
||||
待完善...
|
||||
@@ -0,0 +1,124 @@
|
||||
# 快速开始
|
||||
|
||||
本指南帮助你在 5 分钟内通过 Docker 完成 Podux 的安装和初始配置。
|
||||
|
||||
## 前置条件
|
||||
|
||||
- 已安装 [Docker](https://docs.docker.com/get-docker/)
|
||||
- 一台已部署 frps 的公网服务器(或使用第三方 frp 服务)
|
||||
- 运行 Podux 的机器能够访问公网
|
||||
|
||||
::: info 还没有公网服务器?
|
||||
推荐使用 **[雨云](https://www.rainyun.com/s=ljw_?podux)** —— 价格实惠、稳定可靠的国内云服务器,适合部署 frps 和各类自托管服务。
|
||||
:::
|
||||
|
||||
## 第一步:启动容器
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name podux \
|
||||
--restart unless-stopped \
|
||||
-p 8090:8090 \
|
||||
-v podux-data:/app/pb_data \
|
||||
ghcr.io/luckjiawei/podux:latest
|
||||
```
|
||||
|
||||
启动成功后,终端会输出类似以下内容:
|
||||
|
||||
```text
|
||||
App: http://0.0.0.0:8090
|
||||
Admin: http://0.0.0.0:8090/_/
|
||||
```
|
||||
|
||||
::: tip 使用 Docker Compose
|
||||
也可以通过 Docker Compose 管理:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
podux:
|
||||
image: ghcr.io/luckjiawei/podux:latest
|
||||
container_name: podux
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8090:8090"
|
||||
volumes:
|
||||
- podux-data:/app/pb_data
|
||||
|
||||
volumes:
|
||||
podux-data:
|
||||
```
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
:::
|
||||
|
||||
## 第二步:创建账号
|
||||
|
||||
打开浏览器访问主界面:
|
||||
|
||||
```text
|
||||
http://localhost:8090
|
||||
```
|
||||
|
||||
首次访问时,系统会引导你创建账号,填写用户名和密码后提交即可。
|
||||
|
||||
## 第三步:创建后台账号(可选)
|
||||
|
||||
如需使用后台管理功能,可访问 Admin UI:
|
||||
|
||||
```text
|
||||
http://localhost:8090/_/
|
||||
```
|
||||
|
||||
首次访问时,系统会引导你创建后台账号,填写邮箱和密码后提交即可。
|
||||
|
||||
::: warning 安全提示
|
||||
如果 Podux 运行在公网可访问的服务器上,请务必设置强密码,并考虑通过防火墙限制 `8090` 端口的访问来源。
|
||||
:::
|
||||
|
||||
## 第四步:进入主界面
|
||||
|
||||
访问应用主界面:
|
||||
|
||||
```text
|
||||
http://localhost:8090
|
||||
```
|
||||
|
||||
你将看到 Podux 的主控制台。
|
||||
|
||||
## 第五步:添加服务器
|
||||
|
||||
1. 点击左侧导航栏的 **服务器** 菜单
|
||||
2. 点击 **添加服务器**,填写以下信息:
|
||||
|
||||
| 字段 | 说明 | 示例 |
|
||||
| --- | --- | --- |
|
||||
| 名称 | 服务器的显示名称 | `我的服务器` |
|
||||
| 服务器地址 | frps 所在主机的 IP 或域名 | `your-server.com` |
|
||||
| 服务器端口 | frps 监听端口,默认 `7000` | `7000` |
|
||||
| 认证令牌 | frps 配置的 `auth.token` | `your-token` |
|
||||
|
||||
3. 开启 **自动连接** 后保存,Podux 会立即尝试连接。
|
||||
|
||||
连接成功后,服务器卡片将显示 **在线** 状态和当前网络延迟。
|
||||
|
||||
## 第六步:添加代理
|
||||
|
||||
1. 点击 **代理** 菜单,然后点击 **添加代理**
|
||||
2. 选择代理类型(TCP / UDP / HTTP / HTTPS 等)并填写配置:
|
||||
|
||||
**示例:将本机 SSH (22 端口) 映射到公网**
|
||||
|
||||
| 字段 | 值 |
|
||||
| --- | --- |
|
||||
| 名称 | `my-ssh` |
|
||||
| 类型 | `TCP` |
|
||||
| 服务器 | 选择已添加的服务器 |
|
||||
| 本地 IP | `127.0.0.1` |
|
||||
| 本地端口 | `22` |
|
||||
| 远程端口 | `6022` |
|
||||
|
||||
3. 保存后,Podux 会自动热重载 frpc 配置,无需重启。
|
||||
|
||||
之后即可通过 `ssh -p 6022 user@your-server.com` 访问本机。
|
||||
@@ -0,0 +1,3 @@
|
||||
# 安装部署
|
||||
|
||||
待完善...
|
||||
@@ -0,0 +1,5 @@
|
||||
# 界面预览
|
||||
|
||||
<img src="/11.png" alt="Dashboard 总览" style="border-radius:12px;box-shadow:0 8px 40px rgba(0,0,0,0.18);width:100%;margin:1rem 0;" />
|
||||
|
||||
<ScreenshotGallery />
|
||||
@@ -0,0 +1,105 @@
|
||||
# 什么是 Podux?
|
||||
|
||||
Podux 是一个**现代化的 frpc 管理平台**,基于 PocketBase 和 React 构建,提供可视化界面来管理内网穿透服务。
|
||||
|
||||
|
||||
## 名称由来
|
||||
|
||||
**Podux** = **proxy** + **port** + **dux**(拉丁语:领导者、引导者)
|
||||
|
||||
这个名字本身就是一份宣言:不只是一个工具的前端,而是一个统一管理隧道工具的平台。
|
||||
|
||||
## 为什么从 frpc-hub 改名?
|
||||
|
||||
Podux 的前身是 **frpc-hub**,最初专为管理 frpc 而生。随着项目的成长,目标逐渐清晰 —— 不只是 frp,而是成为支持多种隧道工具的统一管理平台。
|
||||
|
||||
**frpc-hub** 这个名字将项目与单一工具绑定,无法承载更大的愿景。**Podux** 代表的是面向未来的设计:一个可以容纳更多隧道协议与工具的统一入口。
|
||||
|
||||
> 改名发生于 2026 年 3 月,仓库地址及所有相关引用均已同步更新。
|
||||
|
||||
## 背景
|
||||
|
||||
[frp](https://github.com/fatedier/frp) 是目前最流行的开源内网穿透工具之一,其客户端 `frpc` 通过配置文件(`.toml` / `.ini`)与服务端 `frps` 建立隧道,将内网服务暴露到公网。
|
||||
|
||||
然而,原生 frpc 的使用方式存在一些痛点:
|
||||
|
||||
- **纯配置文件驱动**:每次修改都需要手动编辑文件并重启进程
|
||||
- **多服务器管理困难**:同时维护多个 frps 服务端时,配置容易混乱
|
||||
- **缺乏可视化监控**:无法直观查看连接状态和延迟情况
|
||||
- **运维成本高**:升级、备份、迁移全靠手动操作
|
||||
|
||||
Podux 正是为解决这些问题而生。
|
||||
|
||||
## 核心能力
|
||||
|
||||
### 服务器管理
|
||||
|
||||
集中管理多个 frps 服务器,支持:
|
||||
|
||||
- 添加、编辑、删除服务器配置
|
||||
- 自动连接与断线重连
|
||||
- 实时延迟监控与地理位置显示
|
||||
- 一键切换启用/禁用状态
|
||||
|
||||
### 代理管理
|
||||
|
||||
通过可视化表单创建和管理代理隧道,支持以下代理类型:
|
||||
|
||||
| 类型 | 说明 |
|
||||
| --- | --- |
|
||||
| TCP | 通用 TCP 端口转发 |
|
||||
| UDP | UDP 流量转发 |
|
||||
| HTTP | HTTP 反向代理 |
|
||||
| HTTPS | HTTPS 反向代理 |
|
||||
| STCP | 安全 TCP,点对点加密 |
|
||||
| SUDP | 安全 UDP |
|
||||
|
||||
### 热重载
|
||||
|
||||
修改代理配置后,Podux 会自动触发 frpc 重载,**无需手动重启**,服务零中断。
|
||||
|
||||
### 现代化界面
|
||||
|
||||
基于 Radix UI 组件库和 Tailwind CSS 构建,界面简洁美观,支持中英文切换。
|
||||
|
||||
## 技术架构
|
||||
|
||||
```text
|
||||
┌─────────────────────────────────┐
|
||||
│ 浏览器 (React) │
|
||||
│ Radix UI + Tailwind CSS │
|
||||
└────────────────┬────────────────┘
|
||||
│ HTTP API
|
||||
┌────────────────▼────────────────┐
|
||||
│ 后端 (PocketBase) │
|
||||
│ 内嵌 SQLite 数据库 │
|
||||
└────────────────┬────────────────┘
|
||||
│ 进程管理
|
||||
┌────────────────▼────────────────┐
|
||||
│ frpc │
|
||||
│ 本机运行的内网穿透客户端 │
|
||||
└────────────────┬────────────────┘
|
||||
│ 加密隧道
|
||||
┌────────────────▼────────────────┐
|
||||
│ frps │
|
||||
│ 公网服务端(用户自行部署) │
|
||||
└─────────────────────────────────┘
|
||||
```
|
||||
|
||||
Podux 以**单一可执行文件**的形式分发,内嵌了 PocketBase 后端与前端资源,开箱即用,无需额外依赖。
|
||||
|
||||
## 与手动管理对比
|
||||
|
||||
| 对比项 | 手动管理 frpc | Podux |
|
||||
| --- | --- | --- |
|
||||
| 配置方式 | 编辑 `.toml` 文件 | 可视化表单 |
|
||||
| 重载配置 | 手动重启进程 | 自动热重载 |
|
||||
| 多服务器 | 维护多份配置文件 | 统一界面管理 |
|
||||
| 状态监控 | 查看日志 | 实时监控面板 |
|
||||
| 跨平台部署 | 需配置环境 | 单文件,开箱即用 |
|
||||
|
||||
## 适用场景
|
||||
|
||||
- **开发者**:快速将本地开发环境(Web 服务、数据库、SSH 等)暴露到公网进行调试或演示
|
||||
- **运维人员**:统一管理多台机器的内网穿透配置,降低运维复杂度
|
||||
- **个人用户**:无需记忆复杂的配置语法,通过界面轻松配置家庭服务器、NAS、远程桌面等
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
# https://vitepress.dev/reference/default-theme-home-page
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: "Podux"
|
||||
text: "现代化的 Frpc 管理平台"
|
||||
tagline: 一站式内网穿透服务管理平台,让 frpc 配置和监控变得简单高效
|
||||
image:
|
||||
src: /logo.svg
|
||||
alt: Podux Dashboard
|
||||
actions:
|
||||
- theme: brand
|
||||
text: 什么是 Podux?
|
||||
link: /guide/what-is-podux
|
||||
- theme: alt
|
||||
text: 快速开始
|
||||
link: /guide/getting-started
|
||||
- theme: alt
|
||||
text: GitHub
|
||||
link: https://github.com/luckjiawei/podux
|
||||
|
||||
features:
|
||||
- icon: 🖥️
|
||||
title: 服务器管理
|
||||
details: 轻松创建、配置和管理多个 frpc 服务器,支持自动连接和状态监控
|
||||
- icon: 🔌
|
||||
title: 代理配置
|
||||
details: 支持 HTTP、HTTPS、TCP、UDP 等多种代理类型,配置简单直观
|
||||
- icon: 📊
|
||||
title: 实时监控
|
||||
details: 实时网络延迟监控、地理位置展示,一目了然
|
||||
- icon: 🔄
|
||||
title: 热重载
|
||||
details: 配置更改后自动重载 frpc,无需手动重启服务
|
||||
- icon: 🌐
|
||||
title: 多语言支持
|
||||
details: 内置国际化支持,轻松切换中英文界面
|
||||
- icon: 🎨
|
||||
title: 现代化界面
|
||||
details: 基于 Radix UI 和 Tailwind CSS,提供优雅的用户体验
|
||||
- icon: 🚀
|
||||
title: 高性能
|
||||
details: 基于 Go 和 React,提供快速的开发和运行体验
|
||||
- icon: 📦
|
||||
title: 开箱即用
|
||||
details: 跨平台支持,单一可执行文件,无需复杂配置即可快速部署到 Linux、Windows、macOS
|
||||
---
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"scripts": {
|
||||
"docs:dev": "vitepress dev",
|
||||
"docs:build": "vitepress build",
|
||||
"docs:preview": "vitepress preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitepress": "^1.5.0",
|
||||
"vue": "^3.5.13"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 589 KiB |
|
After Width: | Height: | Size: 554 KiB |
|
After Width: | Height: | Size: 482 KiB |
|
After Width: | Height: | Size: 703 KiB |
|
After Width: | Height: | Size: 368 KiB |
|
After Width: | Height: | Size: 577 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated by Pixelmator Pro 3.7 -->
|
||||
<svg width="814" height="814" viewBox="0 0 814 814" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<image id="image1" x="34" y="32" width="373" height="751" xlink:href="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAXUAAALvCAYAAACa6FVwAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABdaADAAQAAAABAAAC7wAAAADb4BoWAABAAElEQVR4Aey9CZQk2VUl+G3x3WPNtTYhIaFBgPqoQWqQGFpIaCQQAhoEojnQw9YLatQ0OjRI7KIHneYwzDAzZ04f+kwP3adZxAhtJZWklljULSSVpMqqrDUr94zcY8nYI3w1d5t737fnbu7hERkZGZkVHvl/lbmZ/eX9Z88i73/2/vvve8YlJwEnASeBfSCBeOmRCePnfTNSrHje66r74JF29Ajejlq5Rk4CTgJOAi+gBOLZD5ZrrdbBqL5WWK+uviyKGq+MG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jmyJMJBn4o2fzCKMLAGb8ljbMMSQhYJ2YW/iFIAn5FtRtv6K9s7vEHiP3MoBwgMDAQTBHIb8ooP1jGaxZtYT29m+/VPc2t447JwEngRdcAvHKJw7euHby/zrz3JLine truncated
|
||||
<image id="image2" x="147" y="67" width="119" height="152" xlink:href="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAHcAAACYCAYAAADeK3bdAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAd6ADAAQAAAABAAAAmAAAAADmtKHkAAAk/ElEQVR4Ae2dB5SURbbHv+7JM+SkAgooQQQDDxBF1MWIiKLrE1F0FdCHC4gKiCCoRAN6BNE1rG8fuG8R8751DbDqcVdUVo8BFUFJkjMySJg88+6v2jtT803H6Z6Zbuw65+vKVbfuv27lqvY4SRUzDpSVlXlWrVp1dElJSWpRUVF+ampqcWlpafbhw4cdr9dbnJ2dXSjmdDJMT08vLSws9EoYLzr+Sgh+mCUNo2NOS0vzqj0rK6u0uLg4NT8//2D9+vUbSNyivLy8jAMHDuzu27dv8csvv5wyaNCgEg8Rkyo8Dgh4qe+///6QzZs3DxbGdvz555+b79y5M1sY6xGAHNGdgwcPGrOA6kh4PsPjX8wmI8weTyDWK57ecqLsuAKkIxUC4I1OPj639LKCgjwnMzOzoKSkyDNkyA09AuVQnvCv0fDdd9+lC0idBbxOa9euvWXTpk09NmzY0CA3N9ezdetWz65du5Akw1yRIKeCwanl4MFwBRCzP4U/wKHQ3eE0vjsueZOnKmkRTMWCLuIMGzZswUMPPTQ0Ce4vHBKJvPnbb78duX///lY//vhj46+//jrt0KFDjgBsGCaSagCFkShpOp2MjAwnJSXFgAJTYTp2BYxwuCvQ6o4bnz+Fu4ZTwNVOeMxILmlK828kuHHjxs7evXud1atXO+efd37uSy+/1Jiw/nPA5whXX3755an79u3rvXTp0kkCaiuRTO/27dsNONqkwkDp35x69eoZMHEH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qXiRAXTHZriho0bmfEF11YuvPDC0jvvvLNtrPO004t5iTgOM2nSpJ8XL16cyjyW9VKW1HwA+iSUQruZqWCHAiVUONK187ILizlUfHf46tq1fAyadDZAWmvW/OD07NmrbPHExemevp6KS0bVzShIvJgPqOQA+LYFCxbUZ1endetjpY/NLwfXZnooEIPQXKVi2GEVXNyUwbZ/bZhNBZLTi8VSiYuln5UL0qav5UhqU+HLH5566jet+7T+saZpiV07KJT++c9/fnXRooXNOV/LMhonJnQApQWh4NEASzrRxq9p0LWC0Q0xl6XPpZ8F5Cn33rsk2Flj5VMs9JiBKwfYps+cOfOqgwcPO8cff7z0MykCbJ6hkT7HBjUacKoLjJ2nOw23PRaM5YBbemqaOXbLac19e39yJk2cuH7osKH9YpF+OGnErFkWCX1PbtN52I9lRMigCaWMs8FVNzeBgdzd4YLZSUPTQSdf205ct3uw9CL1I23d6UFyuRS9YcMG54orryyW2+7NIk0vmvAxkVxZ7N4qS2je9u3bm5UYCqeDJgWVQusXiGBbugKFwV3T8afjr+n4A9btjz0yBct8bCN/8tBZADqj4yw5QE5zTIvFOnqfPn3KpkyZEvEZqMjoqho6anCff/7592Ta05KCcJvOrWBAvCgFXempLm0KKhW4fD4rINNaUbGZ9Line truncated
|
||||
<image id="image3" x="181" y="67" width="599" height="672" xlink:href="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAlcAAAKgCAYAAAC2rFglAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACV6ADAAQAAAABAAACoAAAAAARWqrRAABAAElEQVR4Aey9CZxVxZU/fnuj6YXuptlBWZTFDSbGjHHUiSYmxphMNNFJZtyyzPwmiSaO+ZuYaIwzjpPJNmbBJK5jEo3GfUVQUUDAhV1UEAUUAWVfmm5ouqG7//Wt19/u08W9b1/ue+/U5/NebadOnfrWdm5V3bolnhpFQBFIGYGurq7SJUuWlJ1wwgkdxu5/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q761tKmgMD3v//9p/785z+fjcOtuIQQylVkoC21NgfmFLLQpHmKQD7XvZ+ike1qgAxUfpi362d4kA0ebj1Ivohzy+r6kSdXsPDQRD/PaOF8Fn5VVZX2gHxpaeSsZefBDvvWMOj3t0c+3I5PYuENwwsvvPBfJ0+evCVIbg0vTARUuSrMetVSpRmB1atX1/3zPLine truncated
|
||||
<image id="image4" x="330" y="67" width="450" height="424" xlink:href="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAcIAAAGoCAYAAADVd+V5AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABwqADAAQAAAABAAABqAAAAAAUS/DFAABAAElEQVR4Aey9B7xfRZn/f25Jvek9oSWQ0GFFXJYVFBALlrXB4orKuu7+LKis/lUUFt3lx8/V1dV1wYawrKKgIJ3QWwihhRJqIIQSkkACpPd673/e883n3snkfOv99vvM6/X9PlOfeeYzc57nzJw5c1qSPui6urpaH3300bbDDz98u6MDt23b1r5x48YNu+++e9ubb77ZOnHixK7ly5dvHz58eGsIz5YtW7r69+/forjVq1d3yg9du3Ztl8LHHntst19x0BkzZrSEaYTDdNKcTK1ONnh3uXQvw44yPhyUj8PdrHbUs91FtNBWZBNvMmWRFZl3koe8O1x3WiizZCk0jrZJFsoMHTrU1yd5FKZOMHjhhRfawVlldmDj20WeuF7x3IFfd3qIH+UkN/7QUT5Ky9tuxs3ixYuRKUH+QYMGtbjx5PsfuceNG9c9jhg/jKM33nijk3iNp3Bstbe3t7gx2aW4MOywaBs7dmwn45T6Qr94ufrhu5W8rv4tyAeGb3vb27ZSxpwhYAjsjEA2pbdzriYKXX311Sf87Gc/u7mtrS1BWWzatKkfzXPKJtm+fXvS2dmZtLS0+F/cbMU7Q9qdThzhNBfGqwz5Y5eLR5w3W9jzd2J0Jl1Ja2tr0uWqaUkXa5f2kRen/ITFL5OSCcsfU+rEUd63JYWfz9C5A7fWT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/r2XAY/6LL2AcT3X+U6fss/emSy655EfunOHp7rWMh0uR3co0JwJNPSN897vf3elOlGlhWZQLjJmhdqaFF7W6Ni1OaUbrCwGUp/VXaX0CbrmcsCVPml+Gq7f4q7zkweAx+4OGTunKT/3kw2Xky8waOcWWsv3aM+cH9+s/0C+bbt28JVm0aFEyeEiHv/6HDO5IPvrRj1125NuP/Jk76ea5o48+em1Yn/n7HgJNawhvvvnm933mM5+5xX1Oxi+L8nAdhyEMXXihh/Hmbw4EpLSbozWFtUIGIxctjFP2XLpuQpo9d+4U5MSAQeUUJi6MVzr1qm+Z+fHTzS7vCHOCFMurxGNXOeGmX78B3iBu27KVDyh7vvtMnfra57/w+Q+7dxXnH3nkkWvE32jfQqBpDeG3vvWtG3/3u999gAfnvJCLIcxcFJmT93UR9a3uttaCQCP3fZpRqHavIoMMleqOw4rPRuER90PIl7S4rXGYOjUz5AZXYT1T5Hkiv0GDBvjNN62tmb0BfDWD3ePk37Qlc+g+xy6y0/RTn/rUPx1yyCGvZ5Pb4psTgaY0hPPnzx/2yU9+cvUrixb6zy1xjC/PFOILL+1ia85utlaFCMTjIEyrZ39sCGopq66d3mBJewrho3xqL+EQC8nQwytzgDhLpTi/kYbvLDptx7uJLJWybwD36quv+uVTZpF8RooVJHeKzVP/8I+f+/Q73/nOJ30m+2t6BJrSEF544YW//PrXv/6lCZMmZpZF33jT3/1xBLine truncated
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 340 KiB |
@@ -0,0 +1,31 @@
|
||||
# 常见问题
|
||||
|
||||
## 基础与安装
|
||||
|
||||
### Q: Podux 是什么?它和原本的 Frpc 有什么区别?
|
||||
|
||||
A: Podux 是一个基于 Frpc 的图形化管理工具。它集成了 Frp 客户端的核心功能,并提供了一个现代化的 Web 界面来管理配置文件、监控状态和日志,解决了原生 Frpc 需要手动编辑配置文件和缺乏可视化监控的痛点。
|
||||
|
||||
### Q: Podux 支持哪些操作系统?
|
||||
|
||||
A: 目前支持 Windows、macOS 和 Linux 主流发行版。
|
||||
|
||||
## 配置与使用
|
||||
|
||||
### Q: 我现有的 `frpc.toml` 配置文件可以直接导入吗?
|
||||
|
||||
A: 目前建议通过 Podux 的可视化界面重新创建配置,以确保所有字段都能被正确解析和管理。
|
||||
|
||||
### Q: 修改配置后通过什么方式生效?
|
||||
|
||||
A: Podux 支持配置热重载(Hot Reload)。在 Web 界面保存修改后,程序会自动尝试应用新的配置,通常无需重启整个服务。
|
||||
|
||||
### Q: 支持哪些类型的代理协议?
|
||||
|
||||
A: 目前完整支持 **TCP**、**UDP**、**HTTP** 和 **HTTPS** 协议。**STCP** 和 **XTCP** 等高级协议的支持正在开发中,敬请期待后续版本更新。
|
||||
|
||||
## 故障排查
|
||||
|
||||
### Q: 遇到未知错误或 Bug 该如何反馈?
|
||||
|
||||
A: 欢迎在 GitHub 仓库提交 Issue,请尽量提供详细的错误日志、复现步骤以及您的操作系统环境信息,以便我们快速定位问题。
|
||||
@@ -1,9 +1,9 @@
|
||||
module frpc-hub
|
||||
module podux
|
||||
|
||||
go 1.25.5
|
||||
|
||||
require (
|
||||
github.com/fatedier/frp v0.67.0
|
||||
github.com/fatedier/frp v0.68.0
|
||||
github.com/pelletier/go-toml/v2 v2.2.0
|
||||
github.com/pocketbase/dbx v1.11.0
|
||||
github.com/pocketbase/pocketbase v0.35.0
|
||||
|
||||
@@ -27,6 +27,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/fatedier/frp v0.67.0 h1:w6xHLkruAJcq+fZP9VOiY6w/FBy/wB1aPqA4frs98K8=
|
||||
github.com/fatedier/frp v0.67.0/go.mod h1:0Q3mAI0c9WtAsgMQpTQhinWTKa2Qp121YWsqaFu41Zg=
|
||||
github.com/fatedier/frp v0.68.0 h1:woKC31EpgCLQDirRAOAUgHP3IRxLu2mBHS6zGpcw7tw=
|
||||
github.com/fatedier/frp v0.68.0/go.mod h1:qFdez6Z+RDqoqF1xJhh48+IW91SVQ+pNWnrmcl43Wjs=
|
||||
github.com/fatedier/golib v0.5.1 h1:hcKAnaw5mdI/1KWRGejxR+i1Hn/NvbY5UsMKDr7o13M=
|
||||
github.com/fatedier/golib v0.5.1/go.mod h1:W6kIYkIFxHsTzbgqg5piCxIiDo4LzwgTY6R5W8l9NFQ=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package dashboard
|
||||
|
||||
import (
|
||||
proxyapp "frpc-hub/internal/application/proxy"
|
||||
serverapp "frpc-hub/internal/application/server"
|
||||
proxydomain "frpc-hub/internal/domain/proxy"
|
||||
serverdomain "frpc-hub/internal/domain/server"
|
||||
proxyapp "podux/internal/application/proxy"
|
||||
serverapp "podux/internal/application/server"
|
||||
proxydomain "podux/internal/domain/proxy"
|
||||
serverdomain "podux/internal/domain/server"
|
||||
"time"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
|
||||
@@ -16,17 +16,19 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
proxydomain "frpc-hub/internal/domain/proxy"
|
||||
serverdomain "frpc-hub/internal/domain/server"
|
||||
"frpc-hub/pkg/utils"
|
||||
proxydomain "podux/internal/domain/proxy"
|
||||
serverdomain "podux/internal/domain/server"
|
||||
"podux/pkg/utils"
|
||||
|
||||
"github.com/fatedier/frp/client"
|
||||
frpcsource "github.com/fatedier/frp/pkg/config/source"
|
||||
v1 "github.com/fatedier/frp/pkg/config/v1"
|
||||
"github.com/fatedier/frp/pkg/util/log"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
var validServerID = regexp.MustCompile(`^[a-z0-9]{15}$`)
|
||||
var sensitiveRegex = regexp.MustCompile(`"(?i)(token|password|sk|pwd|secretkey|httpuser|httppwd|oidctoken|oidcclientsecret)":"(?:[^"\\]|\\.)*"`)
|
||||
|
||||
type Service struct {
|
||||
mu sync.RWMutex
|
||||
@@ -60,6 +62,7 @@ func (fs *Service) genCommonCfgs(id *string) (*v1.ClientCommonConfig, error) {
|
||||
// basic config
|
||||
cfg.ServerAddr = record.GetString("serverAddr")
|
||||
cfg.ServerPort = record.GetInt("serverPort")
|
||||
cfg.User = record.GetString("user")
|
||||
|
||||
logDirPath := filepath.Join("pb_data", "frpc", *id)
|
||||
if err := os.MkdirAll(logDirPath, 0755); err != nil {
|
||||
@@ -145,7 +148,7 @@ func (fs *Service) genCommonCfgs(id *string) (*v1.ClientCommonConfig, error) {
|
||||
}
|
||||
|
||||
func (fs *Service) genProxyCfgs(serverId *string) ([]v1.ProxyConfigurer, error) {
|
||||
proxies, err := fs.proxyRepo.FindByServerID(*serverId)
|
||||
proxies, err := fs.proxyRepo.FindEnabledByServerID(*serverId)
|
||||
if err != nil {
|
||||
fs.app.Logger().Error("genProxyCfgs", "err", err)
|
||||
return nil, err
|
||||
@@ -167,8 +170,17 @@ func (fs *Service) genProxyCfgs(serverId *string) ([]v1.ProxyConfigurer, error)
|
||||
if proxyMap.ProxyType == "http" || proxyMap.ProxyType == "https" {
|
||||
delete(proxyData, "remotePort")
|
||||
}
|
||||
proxyData["type"] = proxyMap.ProxyType
|
||||
delete(proxyData, "proxyType")
|
||||
proxyData["name"] = proxyMap.Name + "-" + proxyMap.Id
|
||||
|
||||
// Remove empty plugin map so frp doesn't try to parse a typeless plugin
|
||||
if plugin, ok := proxyData["plugin"].(map[string]interface{}); ok {
|
||||
if _, hasType := plugin["type"]; !hasType {
|
||||
delete(proxyData, "plugin")
|
||||
}
|
||||
}
|
||||
|
||||
jsonData, err = json.Marshal(proxyData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -226,12 +238,25 @@ func (fs *Service) LaunchFrpc(serverId *string) error {
|
||||
|
||||
fs.app.Logger().Debug("Config", "serverAddr", cfg.ServerAddr, "serverPort", cfg.ServerPort, "proxyCount", len(proxyCfgs))
|
||||
|
||||
// Print frp configurations in logs with sensitive data masked
|
||||
commonCfgBytes, _ := json.Marshal(cfg)
|
||||
proxyCfgsBytes, _ := json.Marshal(proxyCfgs)
|
||||
|
||||
safeCommon := sensitiveRegex.ReplaceAll(commonCfgBytes, []byte(`"${1}":"***"`))
|
||||
safeProxies := sensitiveRegex.ReplaceAll(proxyCfgsBytes, []byte(`"${1}":"***"`))
|
||||
|
||||
fs.app.Logger().Info("FRP Configuration", "common", string(safeCommon), "proxies", string(safeProxies))
|
||||
|
||||
cfg.Complete()
|
||||
log.InitLogger(cfg.Log.To, cfg.Log.Level, int(cfg.Log.MaxDays), cfg.Log.DisablePrintColor)
|
||||
|
||||
configSrc := frpcsource.NewConfigSource()
|
||||
if err := configSrc.ReplaceAll(proxyCfgs, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
svr, err := client.NewService(client.ServiceOptions{
|
||||
Common: cfg,
|
||||
ProxyCfgs: proxyCfgs,
|
||||
Common: cfg,
|
||||
ConfigSourceAggregator: frpcsource.NewAggregator(configSrc),
|
||||
})
|
||||
if err != nil {
|
||||
fs.app.Logger().Error("NewService", "err", err)
|
||||
@@ -341,8 +366,14 @@ func (fs *Service) monitorProxyStatus(serverId *string, svr *client.Service, ctx
|
||||
}
|
||||
|
||||
for _, proxy := range proxies {
|
||||
proxyName := proxy.Name + "-" + proxy.Id
|
||||
status, exists := statusExporter.GetProxyStatus(proxyName)
|
||||
baseName := proxy.Name + "-" + proxy.Id
|
||||
status, exists := statusExporter.GetProxyStatus(baseName)
|
||||
fs.app.Logger().Info("proxy status check", "baseName", baseName, "exists", exists, "phase", func() string {
|
||||
if status != nil {
|
||||
return status.Phase
|
||||
}
|
||||
return "nil"
|
||||
}())
|
||||
|
||||
if exists {
|
||||
var bootStatus proxydomain.ProxyBootStatus
|
||||
@@ -356,7 +387,8 @@ func (fs *Service) monitorProxyStatus(serverId *string, svr *client.Service, ctx
|
||||
}
|
||||
fs.proxyRepo.UpdateBootStatus(proxy.Id, bootStatus)
|
||||
} else {
|
||||
fs.app.Logger().Debug("Proxy not found in frp status", "serverId", *serverId, "proxyId", proxy.Id, "proxyName", proxyName)
|
||||
// Proxy is not in frp (disabled or removed) — mark as offline
|
||||
fs.proxyRepo.UpdateBootStatus(proxy.Id, proxydomain.ProxyBootStatusOffline)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -466,6 +498,10 @@ func (fs *Service) ReloadFrpc(serverId *string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
proxyCfgsBytes, _ := json.Marshal(proxyCfgs)
|
||||
safeProxies := sensitiveRegex.ReplaceAll(proxyCfgsBytes, []byte(`"${1}":"***"`))
|
||||
fs.app.Logger().Info("FRP Reload Configurations", "proxies", string(safeProxies))
|
||||
|
||||
fs.mu.RLock()
|
||||
svr := fs.processes[*serverId]
|
||||
fs.mu.RUnlock()
|
||||
|
||||
@@ -53,7 +53,7 @@ func (s *Service) GetFrpReleases() ([]GithubRelease, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req.Header.Set("User-Agent", "frpc-hub-server")
|
||||
req.Header.Set("User-Agent", "podux-server")
|
||||
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
type tomlFrpClientConfig struct {
|
||||
ServerAddr string `toml:"serverAddr"`
|
||||
ServerPort int `toml:"serverPort"`
|
||||
User string `toml:"user"`
|
||||
Auth tomlAuthConfig `toml:"auth"`
|
||||
Log tomlLogConfig `toml:"log"`
|
||||
Transport tomlTransportConfig `toml:"transport"`
|
||||
@@ -67,6 +68,7 @@ type ImportServerInfo struct {
|
||||
Name string `json:"name"`
|
||||
ServerAddr string `json:"serverAddr"`
|
||||
ServerPort int `json:"serverPort"`
|
||||
User string `json:"user"`
|
||||
Auth map[string]interface{} `json:"auth"`
|
||||
Log map[string]interface{} `json:"log"`
|
||||
Transport map[string]interface{} `json:"transport"`
|
||||
@@ -200,6 +202,7 @@ func (s *Service) ParseToml(req *ParseTomlRequest) (*ImportPreviewResponse, erro
|
||||
Name: fmt.Sprintf("%s:%d", cfg.ServerAddr, serverPort),
|
||||
ServerAddr: cfg.ServerAddr,
|
||||
ServerPort: serverPort,
|
||||
User: cfg.User,
|
||||
Auth: authMap,
|
||||
Log: logMap,
|
||||
Transport: transportMap,
|
||||
@@ -393,6 +396,7 @@ func (s *Service) handleServerImport(
|
||||
serverRecord.Set("serverName", serverName)
|
||||
serverRecord.Set("serverAddr", cfg.ServerAddr)
|
||||
serverRecord.Set("serverPort", serverPort)
|
||||
serverRecord.Set("user", cfg.User)
|
||||
serverRecord.Set("serverVersion", "built-in")
|
||||
serverRecord.Set("auth", string(authJSON))
|
||||
serverRecord.Set("log", string(logJSON))
|
||||
|
||||
@@ -0,0 +1,359 @@
|
||||
package monitoring
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
const MetricKeyFrpsDelay = "frps_delay"
|
||||
|
||||
// MetricsService handles writing latency data to fh_metrics_targets and fh_metrics_raw.
|
||||
type MetricsService struct {
|
||||
app core.App
|
||||
|
||||
// targetCache maps serverID -> fh_metrics_targets record ID
|
||||
targetCache map[string]string
|
||||
targetCacheLock sync.RWMutex
|
||||
}
|
||||
|
||||
// NewMetricsService creates a new MetricsService.
|
||||
func NewMetricsService(app core.App) *MetricsService {
|
||||
return &MetricsService{
|
||||
app: app,
|
||||
targetCache: make(map[string]string),
|
||||
}
|
||||
}
|
||||
|
||||
// RecordServerLatency records a latency measurement for a server.
|
||||
// It automatically finds or creates the corresponding fh_metrics_targets record.
|
||||
// Negative latency (unreachable host) is skipped.
|
||||
func (s *MetricsService) RecordServerLatency(serverID string, latencyMs int64) error {
|
||||
if latencyMs < 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
targetID, err := s.getOrCreateServerTarget(serverID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("get/create metrics target: %w", err)
|
||||
}
|
||||
|
||||
return s.recordMetric(targetID, MetricKeyFrpsDelay, float64(latencyMs))
|
||||
}
|
||||
|
||||
// getOrCreateServerTarget returns the fh_metrics_targets record ID for a server,
|
||||
// creating one if it does not exist. Results are cached in memory.
|
||||
func (s *MetricsService) getOrCreateServerTarget(serverID string) (string, error) {
|
||||
s.targetCacheLock.RLock()
|
||||
if id, ok := s.targetCache[serverID]; ok {
|
||||
s.targetCacheLock.RUnlock()
|
||||
return id, nil
|
||||
}
|
||||
s.targetCacheLock.RUnlock()
|
||||
|
||||
// Acquire write lock for the entire find-or-create to prevent duplicate records
|
||||
// when multiple goroutines encounter a cache miss simultaneously.
|
||||
s.targetCacheLock.Lock()
|
||||
defer s.targetCacheLock.Unlock()
|
||||
|
||||
// Re-check under write lock (another goroutine may have just created it).
|
||||
if id, ok := s.targetCache[serverID]; ok {
|
||||
return id, nil
|
||||
}
|
||||
|
||||
records, err := s.app.FindRecordsByFilter(
|
||||
"fh_metrics_targets",
|
||||
"serverId = {:serverId} && proxyId = ''",
|
||||
"",
|
||||
1,
|
||||
0,
|
||||
map[string]any{"serverId": serverID},
|
||||
)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("query metrics target: %w", err)
|
||||
}
|
||||
|
||||
var targetID string
|
||||
if len(records) > 0 {
|
||||
targetID = records[0].Id
|
||||
} else {
|
||||
collection, err := s.app.FindCollectionByNameOrId("fh_metrics_targets")
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("find collection fh_metrics_targets: %w", err)
|
||||
}
|
||||
record := core.NewRecord(collection)
|
||||
record.Set("serverId", serverID)
|
||||
if err := s.app.Save(record); err != nil {
|
||||
return "", fmt.Errorf("save metrics target: %w", err)
|
||||
}
|
||||
targetID = record.Id
|
||||
}
|
||||
|
||||
s.targetCache[serverID] = targetID
|
||||
return targetID, nil
|
||||
}
|
||||
|
||||
// GetLatestLatencyBatch returns the most recent latency for every server in one SQL query.
|
||||
// The returned map key is the server ID.
|
||||
func (s *MetricsService) GetLatestLatencyBatch() (map[string]*NetworkStatus, error) {
|
||||
type row struct {
|
||||
ServerID string `db:"serverId"`
|
||||
Val float64 `db:"val"`
|
||||
T string `db:"t"`
|
||||
}
|
||||
|
||||
var rows []row
|
||||
err := s.app.DB().
|
||||
NewQuery(`
|
||||
SELECT t.serverId, r.val, r.t
|
||||
FROM fh_metrics_raw r
|
||||
INNER JOIN fh_metrics_targets t ON r.targetId = t.id
|
||||
WHERE r.metricKey = {:key}
|
||||
AND r.t = (
|
||||
SELECT MAX(r2.t) FROM fh_metrics_raw r2
|
||||
WHERE r2.targetId = r.targetId AND r2.metricKey = {:key}
|
||||
)
|
||||
`).
|
||||
Bind(dbx.Params{"key": MetricKeyFrpsDelay}).
|
||||
All(&rows)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result := make(map[string]*NetworkStatus, len(rows))
|
||||
for _, row := range rows {
|
||||
latency := int64(row.Val)
|
||||
t, _ := time.Parse("2006-01-02 15:04:05.000Z", row.T)
|
||||
result[row.ServerID] = &NetworkStatus{
|
||||
Latency: latency,
|
||||
Reachable: latency >= 0,
|
||||
LastCheckTime: t,
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// GetLatestServerLatency returns the most recent latency measurement for a server.
|
||||
// Returns nil if no data has been recorded yet.
|
||||
func (s *MetricsService) GetLatestServerLatency(serverID string) (*NetworkStatus, error) {
|
||||
records, err := s.app.FindRecordsByFilter(
|
||||
"fh_metrics_raw",
|
||||
"targetId.serverId = {:serverId} && metricKey = {:key}",
|
||||
"-t",
|
||||
1,
|
||||
0,
|
||||
map[string]any{"serverId": serverID, "key": MetricKeyFrpsDelay},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("query latest latency: %w", err)
|
||||
}
|
||||
if len(records) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
r := records[0]
|
||||
latency := int64(r.GetFloat("val"))
|
||||
return &NetworkStatus{
|
||||
Latency: latency,
|
||||
Reachable: latency >= 0,
|
||||
LastCheckTime: r.GetDateTime("t").Time(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// AggregateHourly aggregates the previous full hour from fh_metrics_raw into fh_metrics_hourly.
|
||||
// It is idempotent — re-running for the same hour updates existing records.
|
||||
func (s *MetricsService) AggregateHourly() error {
|
||||
now := time.Now().UTC()
|
||||
to := now.Truncate(time.Hour)
|
||||
from := to.Add(-time.Hour)
|
||||
s.app.Logger().Info("Aggregating hourly metrics", "from", from, "to", to)
|
||||
|
||||
type row struct {
|
||||
TargetID string `db:"targetId"`
|
||||
MetricKey string `db:"metricKey"`
|
||||
ValAvg float64 `db:"valAvg"`
|
||||
ValMax float64 `db:"valMax"`
|
||||
ValMin float64 `db:"valMin"`
|
||||
}
|
||||
|
||||
var rows []row
|
||||
err := s.app.DB().
|
||||
NewQuery(`
|
||||
SELECT targetId, metricKey,
|
||||
AVG(val) AS valAvg, MAX(val) AS valMax, MIN(val) AS valMin
|
||||
FROM fh_metrics_raw
|
||||
WHERE t >= {:from} AND t < {:to}
|
||||
GROUP BY targetId, metricKey
|
||||
`).
|
||||
Bind(dbx.Params{
|
||||
"from": from.Format("2006-01-02 15:04:05.000Z"),
|
||||
"to": to.Format("2006-01-02 15:04:05.000Z"),
|
||||
}).
|
||||
All(&rows)
|
||||
if err != nil {
|
||||
return fmt.Errorf("query raw for hourly agg: %w", err)
|
||||
}
|
||||
|
||||
tStr := from.Format("2006-01-02 15:04:05.000Z")
|
||||
for _, r := range rows {
|
||||
if err := s.upsertHourly(r.TargetID, r.MetricKey, tStr, r.ValAvg, r.ValMax, r.ValMin); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *MetricsService) upsertHourly(targetID, metricKey, t string, avg, max, min float64) error {
|
||||
existing, err := s.app.FindRecordsByFilter(
|
||||
"fh_metrics_hourly",
|
||||
"targetId = {:targetId} && metricKey = {:metricKey} && t = {:t}",
|
||||
"", 1, 0,
|
||||
map[string]any{"targetId": targetID, "metricKey": metricKey, "t": t},
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("query hourly record: %w", err)
|
||||
}
|
||||
|
||||
var record *core.Record
|
||||
if len(existing) > 0 {
|
||||
record = existing[0]
|
||||
} else {
|
||||
col, err := s.app.FindCollectionByNameOrId("fh_metrics_hourly")
|
||||
if err != nil {
|
||||
return fmt.Errorf("find collection fh_metrics_hourly: %w", err)
|
||||
}
|
||||
record = core.NewRecord(col)
|
||||
record.Set("targetId", targetID)
|
||||
record.Set("metricKey", metricKey)
|
||||
record.Set("t", t)
|
||||
}
|
||||
record.Set("valAvg", avg)
|
||||
record.Set("valMax", max)
|
||||
record.Set("valMin", min)
|
||||
if err := s.app.Save(record); err != nil {
|
||||
return fmt.Errorf("save hourly record: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// AggregateDaily aggregates yesterday's hourly data into fh_metrics_daily.
|
||||
// Only valAvg is stored since valMax/valMin in fh_metrics_daily are date-type fields.
|
||||
func (s *MetricsService) AggregateDaily() error {
|
||||
now := time.Now().UTC()
|
||||
to := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.UTC)
|
||||
from := to.AddDate(0, 0, -1)
|
||||
s.app.Logger().Info("Aggregating daily metrics", "from", from, "to", to)
|
||||
|
||||
type row struct {
|
||||
TargetID string `db:"targetId"`
|
||||
MetricKey string `db:"metricKey"`
|
||||
ValAvg float64 `db:"valAvg"`
|
||||
}
|
||||
|
||||
var rows []row
|
||||
err := s.app.DB().
|
||||
NewQuery(`
|
||||
SELECT targetId, metricKey, AVG(valAvg) AS valAvg
|
||||
FROM fh_metrics_hourly
|
||||
WHERE t >= {:from} AND t < {:to}
|
||||
GROUP BY targetId, metricKey
|
||||
`).
|
||||
Bind(dbx.Params{
|
||||
"from": from.Format("2006-01-02 15:04:05.000Z"),
|
||||
"to": to.Format("2006-01-02 15:04:05.000Z"),
|
||||
}).
|
||||
All(&rows)
|
||||
if err != nil {
|
||||
return fmt.Errorf("query hourly for daily agg: %w", err)
|
||||
}
|
||||
|
||||
tStr := from.Format("2006-01-02 15:04:05.000Z")
|
||||
for _, r := range rows {
|
||||
if err := s.upsertDaily(r.TargetID, r.MetricKey, tStr, r.ValAvg); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *MetricsService) upsertDaily(targetID, metricKey, t string, avg float64) error {
|
||||
existing, err := s.app.FindRecordsByFilter(
|
||||
"fh_metrics_daily",
|
||||
"targetId = {:targetId} && metricKey = {:metricKey} && t = {:t}",
|
||||
"", 1, 0,
|
||||
map[string]any{"targetId": targetID, "metricKey": metricKey, "t": t},
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("query daily record: %w", err)
|
||||
}
|
||||
|
||||
var record *core.Record
|
||||
if len(existing) > 0 {
|
||||
record = existing[0]
|
||||
} else {
|
||||
col, err := s.app.FindCollectionByNameOrId("fh_metrics_daily")
|
||||
if err != nil {
|
||||
return fmt.Errorf("find collection fh_metrics_daily: %w", err)
|
||||
}
|
||||
record = core.NewRecord(col)
|
||||
record.Set("targetId", targetID)
|
||||
record.Set("metricKey", metricKey)
|
||||
record.Set("t", t)
|
||||
}
|
||||
record.Set("valAvg", avg)
|
||||
if err := s.app.Save(record); err != nil {
|
||||
return fmt.Errorf("save daily record: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// PurgeOldRaw deletes fh_metrics_raw records older than 7 days.
|
||||
func (s *MetricsService) PurgeOldRaw() error {
|
||||
cutoff := time.Now().UTC().Add(-7 * 24 * time.Hour).Format("2006-01-02 15:04:05.000Z")
|
||||
result, err := s.app.DB().
|
||||
Delete("fh_metrics_raw", dbx.NewExp("t < {:cutoff}", dbx.Params{"cutoff": cutoff})).
|
||||
Execute()
|
||||
if err != nil {
|
||||
return fmt.Errorf("purge old raw metrics: %w", err)
|
||||
}
|
||||
affected, _ := result.RowsAffected()
|
||||
s.app.Logger().Info("Purged old raw metrics", "deleted", affected)
|
||||
return nil
|
||||
}
|
||||
|
||||
// PurgeOldHourly deletes fh_metrics_hourly records older than 30 days.
|
||||
func (s *MetricsService) PurgeOldHourly() error {
|
||||
cutoff := time.Now().UTC().Add(-30 * 24 * time.Hour).Format("2006-01-02 15:04:05.000Z")
|
||||
result, err := s.app.DB().
|
||||
Delete("fh_metrics_hourly", dbx.NewExp("t < {:cutoff}", dbx.Params{"cutoff": cutoff})).
|
||||
Execute()
|
||||
if err != nil {
|
||||
return fmt.Errorf("purge old hourly metrics: %w", err)
|
||||
}
|
||||
affected, _ := result.RowsAffected()
|
||||
s.app.Logger().Info("Purged old hourly metrics", "deleted", affected)
|
||||
return nil
|
||||
}
|
||||
|
||||
// recordMetric writes a single data point to fh_metrics_raw.
|
||||
func (s *MetricsService) recordMetric(targetID, metricKey string, value float64) error {
|
||||
collection, err := s.app.FindCollectionByNameOrId("fh_metrics_raw")
|
||||
if err != nil {
|
||||
return fmt.Errorf("find collection fh_metrics_raw: %w", err)
|
||||
}
|
||||
|
||||
record := core.NewRecord(collection)
|
||||
record.Set("targetId", targetID)
|
||||
record.Set("metricKey", metricKey)
|
||||
record.Set("t", time.Now().UTC().Format("2006-01-02 15:04:05.000Z"))
|
||||
record.Set("val", value)
|
||||
|
||||
if err := s.app.Save(record); err != nil {
|
||||
return fmt.Errorf("save metric record: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package monitoring
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"frpc-hub/pkg/utils"
|
||||
"podux/pkg/utils"
|
||||
"time"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
@@ -13,18 +13,20 @@ import (
|
||||
// MonitorService is the background network monitoring service.
|
||||
type MonitorService struct {
|
||||
app core.App
|
||||
networkService *NetworkService
|
||||
stopChan chan bool
|
||||
geoService *GeoService
|
||||
metricsService *MetricsService
|
||||
stopChan chan struct{}
|
||||
latencyTicker *time.Ticker
|
||||
geoTicker *time.Ticker
|
||||
}
|
||||
|
||||
// NewMonitorService creates a new network monitoring service.
|
||||
func NewMonitorService(app core.App, networkService *NetworkService) *MonitorService {
|
||||
func NewMonitorService(app core.App, geoService *GeoService, metricsService *MetricsService) *MonitorService {
|
||||
return &MonitorService{
|
||||
app: app,
|
||||
networkService: networkService,
|
||||
stopChan: make(chan bool),
|
||||
geoService: geoService,
|
||||
metricsService: metricsService,
|
||||
stopChan: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,30 +43,26 @@ func (s *MonitorService) Start(latencyInterval, geoInterval time.Duration) {
|
||||
go s.updateAllServersGeoLocation()
|
||||
|
||||
s.latencyTicker = time.NewTicker(latencyInterval)
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-s.latencyTicker.C:
|
||||
s.updateAllServersLatency()
|
||||
case <-s.stopChan:
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
s.startTicker(s.latencyTicker, s.updateAllServersLatency)
|
||||
|
||||
s.geoTicker = time.NewTicker(geoInterval)
|
||||
s.startTicker(s.geoTicker, s.updateAllServersGeoLocation)
|
||||
|
||||
s.app.Logger().Info("Network monitor service started successfully")
|
||||
}
|
||||
|
||||
// startTicker runs fn on each tick until stopped.
|
||||
func (s *MonitorService) startTicker(ticker *time.Ticker, fn func()) {
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-s.geoTicker.C:
|
||||
s.updateAllServersGeoLocation()
|
||||
case <-ticker.C:
|
||||
fn()
|
||||
case <-s.stopChan:
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
s.app.Logger().Info("Network monitor service started successfully")
|
||||
}
|
||||
|
||||
// Stop halts the background monitoring task.
|
||||
@@ -129,32 +127,16 @@ func (s *MonitorService) updateAllServersGeoLocation() {
|
||||
}
|
||||
}
|
||||
|
||||
// updateServerLatency updates latency for a single server.
|
||||
// updateServerLatency pings a single server and records the result to metrics.
|
||||
func (s *MonitorService) updateServerLatency(serverID string, serverAddr string, serverPort int) {
|
||||
addr := fmt.Sprintf("%s:%d", serverAddr, serverPort)
|
||||
pingResult := utils.PingHost(addr, 5*time.Second)
|
||||
|
||||
networkStatus := map[string]interface{}{
|
||||
"latency": pingResult.Latency,
|
||||
"reachable": pingResult.Reachable,
|
||||
"lastCheckTime": time.Now().Format(time.RFC3339),
|
||||
"error": pingResult.Error,
|
||||
if err := s.metricsService.RecordServerLatency(serverID, pingResult.Latency); err != nil {
|
||||
s.app.Logger().Error("Failed to record server latency metric", "serverId", serverID, "error", err)
|
||||
}
|
||||
|
||||
networkStatusJSON, _ := json.Marshal(networkStatus)
|
||||
|
||||
_, err := s.app.DB().
|
||||
Update("fh_servers",
|
||||
dbx.Params{"networkStatus": string(networkStatusJSON)},
|
||||
dbx.HashExp{"id": serverID},
|
||||
).Execute()
|
||||
|
||||
if err != nil {
|
||||
s.app.Logger().Error("Failed to update server latency", "serverId", serverID, "error", err)
|
||||
return
|
||||
}
|
||||
|
||||
s.app.Logger().Debug("Updated latency",
|
||||
s.app.Logger().Debug("Checked latency",
|
||||
"serverId", serverID,
|
||||
"addr", serverAddr,
|
||||
"latency", pingResult.Latency,
|
||||
@@ -164,24 +146,18 @@ func (s *MonitorService) updateServerLatency(serverID string, serverAddr string,
|
||||
|
||||
// updateServerGeoLocation updates geolocation for a single server.
|
||||
func (s *MonitorService) updateServerGeoLocation(serverID string, serverAddr string) {
|
||||
location, err := s.networkService.getGeoLocationWithCache(serverAddr)
|
||||
location, err := s.geoService.Lookup(serverAddr)
|
||||
if err != nil {
|
||||
s.app.Logger().Warn("Failed to get geo location", "serverId", serverID, "addr", serverAddr, "error", err)
|
||||
return
|
||||
}
|
||||
|
||||
geoLocation := map[string]interface{}{
|
||||
"country": location.Country,
|
||||
"countryCode": location.CountryCode,
|
||||
"region": location.Region,
|
||||
"city": location.City,
|
||||
"isp": location.ISP,
|
||||
"lat": location.Latitude,
|
||||
"lon": location.Longitude,
|
||||
geoLocationJSON, err := json.Marshal(location)
|
||||
if err != nil {
|
||||
s.app.Logger().Error("Failed to marshal geo location", "serverId", serverID, "error", err)
|
||||
return
|
||||
}
|
||||
|
||||
geoLocationJSON, _ := json.Marshal(geoLocation)
|
||||
|
||||
_, err = s.app.DB().
|
||||
Update("fh_servers",
|
||||
dbx.Params{"geoLocation": string(geoLocationJSON)},
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package monitoring
|
||||
|
||||
import "github.com/pocketbase/pocketbase/core"
|
||||
|
||||
// MetricsScheduler registers cron jobs for metrics aggregation and data retention.
|
||||
type MetricsScheduler struct {
|
||||
app core.App
|
||||
metrics *MetricsService
|
||||
}
|
||||
|
||||
// NewMetricsScheduler creates a new MetricsScheduler.
|
||||
func NewMetricsScheduler(app core.App, metrics *MetricsService) *MetricsScheduler {
|
||||
return &MetricsScheduler{app: app, metrics: metrics}
|
||||
}
|
||||
|
||||
// Register adds all metrics-related cron jobs to the app scheduler.
|
||||
func (s *MetricsScheduler) Register() {
|
||||
// Aggregate raw -> hourly at minute 5 of every hour.
|
||||
s.app.Cron().MustAdd("metrics_hourly_agg", "5 * * * *", func() {
|
||||
if err := s.metrics.AggregateHourly(); err != nil {
|
||||
s.app.Logger().Error("Failed to aggregate hourly metrics", "error", err)
|
||||
}
|
||||
})
|
||||
|
||||
// Aggregate hourly -> daily and enforce data retention every day at 01:05.
|
||||
s.app.Cron().MustAdd("metrics_daily_agg", "5 1 * * *", func() {
|
||||
if err := s.metrics.AggregateDaily(); err != nil {
|
||||
s.app.Logger().Error("Failed to aggregate daily metrics", "error", err)
|
||||
}
|
||||
if err := s.metrics.PurgeOldRaw(); err != nil {
|
||||
s.app.Logger().Error("Failed to purge old raw metrics", "error", err)
|
||||
}
|
||||
if err := s.metrics.PurgeOldHourly(); err != nil {
|
||||
s.app.Logger().Error("Failed to purge old hourly metrics", "error", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1,131 +1,62 @@
|
||||
package monitoring
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"frpc-hub/pkg/utils"
|
||||
"podux/pkg/utils"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
// NetworkService is the network diagnostic service.
|
||||
type NetworkService struct {
|
||||
app core.App
|
||||
geoCache map[string]*geoCacheItem // IP geolocation cache
|
||||
geoCacheLock sync.RWMutex // Cache read-write lock
|
||||
// GeoService resolves IP addresses to geolocation data with a 24-hour in-memory cache.
|
||||
type GeoService struct {
|
||||
app core.App
|
||||
cache map[string]*geoCacheItem
|
||||
cacheLock sync.RWMutex
|
||||
}
|
||||
|
||||
// geoCacheItem is a geolocation cache entry.
|
||||
type geoCacheItem struct {
|
||||
Location *utils.GeoLocation
|
||||
ExpiresAt time.Time
|
||||
}
|
||||
|
||||
// ServerNetworkStatus holds network status for a server.
|
||||
type ServerNetworkStatus struct {
|
||||
ServerID string `json:"serverId"`
|
||||
ServerName string `json:"serverName"`
|
||||
ServerAddr string `json:"serverAddr"`
|
||||
ServerPort int `json:"serverPort"`
|
||||
NetworkStatus *NetworkStatus `json:"networkStatus"`
|
||||
GeoLocation *utils.GeoLocation `json:"geoLocation,omitempty"`
|
||||
}
|
||||
|
||||
// NetworkStatus holds latency and reachability information.
|
||||
type NetworkStatus struct {
|
||||
Latency int64 `json:"latency"` // Latency in milliseconds
|
||||
Reachable bool `json:"reachable"` // Whether the host is reachable
|
||||
LastCheckTime time.Time `json:"lastCheckTime"` // Last check timestamp
|
||||
Latency int64 `json:"latency"`
|
||||
Reachable bool `json:"reachable"`
|
||||
LastCheckTime time.Time `json:"lastCheckTime"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
// NewNetworkService creates a new network diagnostic service.
|
||||
func NewNetworkService(app core.App) *NetworkService {
|
||||
return &NetworkService{
|
||||
app: app,
|
||||
geoCache: make(map[string]*geoCacheItem),
|
||||
func NewGeoService(app core.App) *GeoService {
|
||||
return &GeoService{
|
||||
app: app,
|
||||
cache: make(map[string]*geoCacheItem),
|
||||
}
|
||||
}
|
||||
|
||||
// GetServerNetworkStatus retrieves server network status.
|
||||
func (s *NetworkService) GetServerNetworkStatus(serverID string) (*ServerNetworkStatus, error) {
|
||||
record, err := s.app.FindRecordById("fh_servers", serverID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("server not found: %w", err)
|
||||
}
|
||||
|
||||
serverName := record.GetString("name")
|
||||
serverAddr := record.GetString("serverAddr")
|
||||
serverPort := record.GetInt("serverPort")
|
||||
|
||||
addr := fmt.Sprintf("%s:%d", serverAddr, serverPort)
|
||||
pingResult := utils.PingHost(addr, 5*time.Second)
|
||||
|
||||
networkStatus := &NetworkStatus{
|
||||
Latency: pingResult.Latency,
|
||||
Reachable: pingResult.Reachable,
|
||||
LastCheckTime: time.Now(),
|
||||
Error: pingResult.Error,
|
||||
}
|
||||
|
||||
geoLocation, err := s.getGeoLocationWithCache(serverAddr)
|
||||
if err != nil {
|
||||
s.app.Logger().Warn("Failed to get geo location", "addr", serverAddr, "error", err)
|
||||
}
|
||||
|
||||
return &ServerNetworkStatus{
|
||||
ServerID: serverID,
|
||||
ServerName: serverName,
|
||||
ServerAddr: serverAddr,
|
||||
ServerPort: serverPort,
|
||||
NetworkStatus: networkStatus,
|
||||
GeoLocation: geoLocation,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// getGeoLocationWithCache retrieves geolocation information with a 24-hour cache.
|
||||
func (s *NetworkService) getGeoLocationWithCache(addr string) (*utils.GeoLocation, error) {
|
||||
s.geoCacheLock.RLock()
|
||||
if item, exists := s.geoCache[addr]; exists {
|
||||
// Lookup returns geolocation for the given address, using the cache when valid.
|
||||
func (s *GeoService) Lookup(addr string) (*utils.GeoLocation, error) {
|
||||
s.cacheLock.RLock()
|
||||
if item, exists := s.cache[addr]; exists {
|
||||
if time.Now().Before(item.ExpiresAt) {
|
||||
s.geoCacheLock.RUnlock()
|
||||
s.cacheLock.RUnlock()
|
||||
return item.Location, nil
|
||||
}
|
||||
}
|
||||
s.geoCacheLock.RUnlock()
|
||||
s.cacheLock.RUnlock()
|
||||
|
||||
location, err := utils.GetGeoLocation(addr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
s.geoCacheLock.Lock()
|
||||
s.geoCache[addr] = &geoCacheItem{
|
||||
s.cacheLock.Lock()
|
||||
s.cache[addr] = &geoCacheItem{
|
||||
Location: location,
|
||||
ExpiresAt: time.Now().Add(24 * time.Hour),
|
||||
}
|
||||
s.geoCacheLock.Unlock()
|
||||
s.cacheLock.Unlock()
|
||||
|
||||
return location, nil
|
||||
}
|
||||
|
||||
// ClearGeoCache clears the geolocation cache.
|
||||
func (s *NetworkService) ClearGeoCache() {
|
||||
s.geoCacheLock.Lock()
|
||||
defer s.geoCacheLock.Unlock()
|
||||
s.geoCache = make(map[string]*geoCacheItem)
|
||||
}
|
||||
|
||||
// CleanExpiredCache removes expired entries from the geolocation cache.
|
||||
func (s *NetworkService) CleanExpiredCache() {
|
||||
s.geoCacheLock.Lock()
|
||||
defer s.geoCacheLock.Unlock()
|
||||
|
||||
now := time.Now()
|
||||
for addr, item := range s.geoCache {
|
||||
if now.After(item.ExpiresAt) {
|
||||
delete(s.geoCache, addr)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
proxydomain "frpc-hub/internal/domain/proxy"
|
||||
proxydomain "podux/internal/domain/proxy"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
serverdomain "frpc-hub/internal/domain/server"
|
||||
serverdomain "podux/internal/domain/server"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"frpc-hub/pkg/buildinfo"
|
||||
"podux/pkg/buildinfo"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
@@ -166,17 +166,18 @@ func (s *Service) GetAppVersion() string {
|
||||
type LatestVersionResponse struct {
|
||||
TagName string `json:"tag_name"`
|
||||
HTMLURL string `json:"html_url"`
|
||||
Body string `json:"body"`
|
||||
}
|
||||
|
||||
// GetLatestVersion fetches the latest frpc-hub release from GitHub.
|
||||
// GetLatestVersion fetches the latest podux release from GitHub.
|
||||
func (s *Service) GetLatestVersion() (*LatestVersionResponse, error) {
|
||||
client := &http.Client{Timeout: 10 * time.Second}
|
||||
|
||||
req, err := http.NewRequest("GET", "https://api.github.com/repos/luckjiawei/frpc-hub/releases/latest", nil)
|
||||
req, err := http.NewRequest("GET", "https://ghp.podux.io/repos/luckjiawei/podux/releases/latest", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Header.Set("User-Agent", "frpc-hub-server")
|
||||
req.Header.Set("User-Agent", "podux-server/"+buildinfo.AppVersion)
|
||||
req.Header.Set("Accept", "application/vnd.github+json")
|
||||
|
||||
resp, err := client.Do(req)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package proxy
|
||||
|
||||
import "frpc-hub/pkg/types"
|
||||
import "podux/pkg/types"
|
||||
|
||||
// Proxy represents a frpc proxy configuration record.
|
||||
type Proxy struct {
|
||||
@@ -14,6 +14,7 @@ type Proxy struct {
|
||||
Subdomain string `db:"subdomain" json:"subdomain"`
|
||||
CustomDomains types.JSONStringArray `db:"customDomains" json:"customDomains"`
|
||||
Transport types.JSONMap `db:"transport" json:"transport"`
|
||||
Plugin types.JSONMap `db:"plugin" json:"plugin,omitempty"`
|
||||
Description string `db:"description" json:"description"`
|
||||
Status string `db:"status" json:"status"`
|
||||
}
|
||||
|
||||
@@ -9,4 +9,5 @@ type Repository interface {
|
||||
UpdateBootStatusByServerID(serverID string, status ProxyBootStatus) error
|
||||
ResetAllBootStatus() error
|
||||
FindByServerID(serverID string) ([]Proxy, error)
|
||||
FindEnabledByServerID(serverID string) ([]Proxy, error)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package persistence
|
||||
|
||||
import (
|
||||
"frpc-hub/internal/domain/proxy"
|
||||
"podux/internal/domain/proxy"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
@@ -151,3 +151,23 @@ func (r *ProxyRepository) FindByServerID(serverID string) ([]proxy.Proxy, error)
|
||||
|
||||
return proxies, nil
|
||||
}
|
||||
|
||||
func (r *ProxyRepository) FindEnabledByServerID(serverID string) ([]proxy.Proxy, error) {
|
||||
var proxies []proxy.Proxy
|
||||
err := r.app.DB().
|
||||
Select("fh_proxies.*").
|
||||
From("fh_proxies").
|
||||
Where(dbx.And(
|
||||
dbx.HashExp{"serverId": serverID},
|
||||
dbx.HashExp{"status": string(proxy.ProxyStatusEnabled)},
|
||||
)).
|
||||
All(&proxies)
|
||||
|
||||
if err != nil {
|
||||
r.app.Logger().Error("Failed to find enabled proxies by server id", "serverID", serverID, "error", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return proxies, nil
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package persistence
|
||||
|
||||
import (
|
||||
"frpc-hub/internal/domain/server"
|
||||
"podux/internal/domain/server"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
@@ -79,10 +79,11 @@ func (r *ServerRepository) ResetAllBootStatus() error {
|
||||
|
||||
func (r *ServerRepository) GetMaxLatency() (int64, error) {
|
||||
var maxLatency int64
|
||||
// Get the max latency among each target's most recent measurement.
|
||||
err := r.app.DB().
|
||||
Select("MAX(CAST(json_extract(networkStatus, '$.latency') AS INTEGER))").
|
||||
From("fh_servers").
|
||||
Where(dbx.NewExp("networkStatus IS NOT NULL AND networkStatus != ''")).
|
||||
Select("MAX(val)").
|
||||
From("fh_metrics_raw").
|
||||
Where(dbx.NewExp("metricKey = 'frps_delay' AND t IN (SELECT MAX(t) FROM fh_metrics_raw WHERE metricKey = 'frps_delay' GROUP BY targetId)")).
|
||||
Row(&maxLatency)
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package httphandler
|
||||
|
||||
import (
|
||||
"frpc-hub/internal/application/dashboard"
|
||||
"frpc-hub/pkg/response"
|
||||
"podux/internal/application/dashboard"
|
||||
"podux/pkg/response"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package httphandler
|
||||
|
||||
import (
|
||||
"frpc-hub/internal/application/frpc"
|
||||
"podux/internal/application/frpc"
|
||||
"net/http"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
@@ -84,4 +84,29 @@ func (h *FrpcHandler) RegisterHandlers(e *core.ServeEvent) {
|
||||
}
|
||||
return e.JSON(200, map[string]string{"message": "frpc terminated"})
|
||||
}))
|
||||
|
||||
e.Router.POST("/api/frpc/reload", requireAuth(func(e *core.RequestEvent) error {
|
||||
data := struct {
|
||||
ID string `json:"id"`
|
||||
}{}
|
||||
if err := e.BindBody(&data); err != nil {
|
||||
return e.JSON(400, map[string]string{"error": "invalid request body"})
|
||||
}
|
||||
id := data.ID
|
||||
if id == "" {
|
||||
return e.JSON(400, map[string]string{"error": "id is required"})
|
||||
}
|
||||
if !validID.MatchString(id) {
|
||||
return e.JSON(400, map[string]string{"error": "invalid id format"})
|
||||
}
|
||||
// Only reload if the server is currently running
|
||||
if !h.service.IsServerRunning(id) {
|
||||
return e.JSON(200, map[string]string{"message": "server not running, skipped"})
|
||||
}
|
||||
err := h.service.ReloadFrpc(&id)
|
||||
if err != nil {
|
||||
return e.JSON(500, map[string]string{"error": err.Error()})
|
||||
}
|
||||
return e.JSON(200, map[string]string{"message": "frpc reloaded"})
|
||||
}))
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package httphandler
|
||||
|
||||
import (
|
||||
"frpc-hub/internal/application/github"
|
||||
"podux/internal/application/github"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package httphandler
|
||||
|
||||
import (
|
||||
"frpc-hub/internal/application/importer"
|
||||
"podux/internal/application/importer"
|
||||
"net/http"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
package httphandler
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"podux/internal/application/monitoring"
|
||||
"podux/pkg/response"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
type ServerHandler struct {
|
||||
app core.App
|
||||
metricsService *monitoring.MetricsService
|
||||
}
|
||||
|
||||
func NewServerHandler(app core.App, metricsService *monitoring.MetricsService) *ServerHandler {
|
||||
return &ServerHandler{app: app, metricsService: metricsService}
|
||||
}
|
||||
|
||||
type serverVO struct {
|
||||
ID string `json:"id"`
|
||||
ServerName string `json:"serverName"`
|
||||
User string `json:"user"`
|
||||
ServerAddr string `json:"serverAddr"`
|
||||
ServerPort int `json:"serverPort"`
|
||||
Description string `json:"description"`
|
||||
BootStatus string `json:"bootStatus"`
|
||||
AutoConnection bool `json:"autoConnection"`
|
||||
SendRate float64 `json:"sendRate"`
|
||||
RecvRate float64 `json:"recvRate"`
|
||||
GeoLocation any `json:"geoLocation,omitempty"`
|
||||
Log any `json:"log,omitempty"`
|
||||
Auth any `json:"auth,omitempty"`
|
||||
Transport any `json:"transport,omitempty"`
|
||||
Metadatas any `json:"metadatas,omitempty"`
|
||||
Created string `json:"created"`
|
||||
Updated string `json:"updated"`
|
||||
NetworkStatus *monitoring.NetworkStatus `json:"networkStatus,omitempty"`
|
||||
}
|
||||
|
||||
type serverListResponse struct {
|
||||
Page int `json:"page"`
|
||||
PerPage int `json:"perPage"`
|
||||
TotalItems int64 `json:"totalItems"`
|
||||
TotalPages int `json:"totalPages"`
|
||||
Items []serverVO `json:"items"`
|
||||
}
|
||||
|
||||
type serverOptionVO struct {
|
||||
ID string `json:"id"`
|
||||
ServerName string `json:"serverName"`
|
||||
BootStatus string `json:"bootStatus"`
|
||||
NetworkStatus *monitoring.NetworkStatus `json:"networkStatus,omitempty"`
|
||||
}
|
||||
|
||||
type probePoint struct {
|
||||
T string `json:"t"`
|
||||
Val float64 `json:"val"`
|
||||
}
|
||||
|
||||
func (h *ServerHandler) RegisterHandlers(e *core.ServeEvent) {
|
||||
// Paginated server list with assembled latency metrics.
|
||||
e.Router.GET("/api/servers", requireAuth(func(e *core.RequestEvent) error {
|
||||
page, _ := strconv.Atoi(e.Request.URL.Query().Get("page"))
|
||||
if page < 1 {
|
||||
page = 1
|
||||
}
|
||||
perPage, _ := strconv.Atoi(e.Request.URL.Query().Get("perPage"))
|
||||
if perPage < 1 {
|
||||
perPage = 10
|
||||
}
|
||||
search := e.Request.URL.Query().Get("search")
|
||||
|
||||
// Count total matching records
|
||||
var total int64
|
||||
countQ := h.app.DB().Select("COUNT(*)").From("fh_servers")
|
||||
if search != "" {
|
||||
countQ = countQ.Where(dbx.NewExp(
|
||||
"(serverName LIKE {:s} OR serverAddr LIKE {:s} OR description LIKE {:s})",
|
||||
dbx.Params{"s": "%" + search + "%"},
|
||||
))
|
||||
}
|
||||
if err := countQ.Row(&total); err != nil {
|
||||
return e.JSON(500, response.Error(err))
|
||||
}
|
||||
|
||||
// Fetch the page of records
|
||||
var records []*core.Record
|
||||
var err error
|
||||
if search != "" {
|
||||
records, err = h.app.FindRecordsByFilter(
|
||||
"fh_servers",
|
||||
"serverName ~ {:s} || serverAddr ~ {:s} || description ~ {:s}",
|
||||
"-created",
|
||||
perPage,
|
||||
(page-1)*perPage,
|
||||
map[string]any{"s": search},
|
||||
)
|
||||
} else {
|
||||
records, err = h.app.FindRecordsByFilter("fh_servers", "", "-created", perPage, (page-1)*perPage)
|
||||
}
|
||||
if err != nil {
|
||||
return e.JSON(500, response.Error(err))
|
||||
}
|
||||
|
||||
latencyMap, err := h.metricsService.GetLatestLatencyBatch()
|
||||
if err != nil {
|
||||
h.app.Logger().Warn("Failed to get latency batch", "error", err)
|
||||
latencyMap = map[string]*monitoring.NetworkStatus{}
|
||||
}
|
||||
|
||||
totalPages := int(math.Ceil(float64(total) / float64(perPage)))
|
||||
items := make([]serverVO, 0, len(records))
|
||||
for _, r := range records {
|
||||
items = append(items, serverVO{
|
||||
ID: r.Id,
|
||||
ServerName: r.GetString("serverName"),
|
||||
User: r.GetString("user"),
|
||||
ServerAddr: r.GetString("serverAddr"),
|
||||
ServerPort: r.GetInt("serverPort"),
|
||||
Description: r.GetString("description"),
|
||||
BootStatus: r.GetString("bootStatus"),
|
||||
AutoConnection: r.GetBool("autoConnection"),
|
||||
SendRate: r.GetFloat("sendRate"),
|
||||
RecvRate: r.GetFloat("recvRate"),
|
||||
GeoLocation: r.Get("geoLocation"),
|
||||
Log: r.Get("log"),
|
||||
Auth: r.Get("auth"),
|
||||
Transport: r.Get("transport"),
|
||||
Metadatas: r.Get("metadatas"),
|
||||
Created: r.GetString("created"),
|
||||
Updated: r.GetString("updated"),
|
||||
NetworkStatus: latencyMap[r.Id],
|
||||
})
|
||||
}
|
||||
|
||||
return e.JSON(200, serverListResponse{
|
||||
Page: page,
|
||||
PerPage: perPage,
|
||||
TotalItems: total,
|
||||
TotalPages: totalPages,
|
||||
Items: items,
|
||||
})
|
||||
}))
|
||||
|
||||
// Probe history for a single server — last 30 minutes of latency data.
|
||||
e.Router.GET("/api/servers/probe-history", requireAuth(func(e *core.RequestEvent) error {
|
||||
serverID := e.Request.URL.Query().Get("serverId")
|
||||
if serverID == "" {
|
||||
return e.JSON(400, response.Error(fmt.Errorf("serverId is required")))
|
||||
}
|
||||
|
||||
since := time.Now().UTC().Add(-30 * time.Minute).Format("2006-01-02 15:04:05.000Z")
|
||||
|
||||
type row struct {
|
||||
T string `db:"t"`
|
||||
Val float64 `db:"val"`
|
||||
}
|
||||
var rows []row
|
||||
err := h.app.DB().
|
||||
NewQuery(`
|
||||
SELECT r.t, r.val
|
||||
FROM fh_metrics_raw r
|
||||
INNER JOIN fh_metrics_targets t ON r.targetId = t.id
|
||||
WHERE t.serverId = {:serverId}
|
||||
AND r.metricKey = {:key}
|
||||
AND r.t >= {:since}
|
||||
ORDER BY r.t ASC
|
||||
LIMIT 500
|
||||
`).
|
||||
Bind(dbx.Params{
|
||||
"serverId": serverID,
|
||||
"key": monitoring.MetricKeyFrpsDelay,
|
||||
"since": since,
|
||||
}).
|
||||
All(&rows)
|
||||
if err != nil {
|
||||
return e.JSON(500, response.Error(err))
|
||||
}
|
||||
|
||||
points := make([]probePoint, 0, len(rows))
|
||||
for _, r := range rows {
|
||||
points = append(points, probePoint{T: r.T, Val: r.Val})
|
||||
}
|
||||
return e.JSON(200, points)
|
||||
}))
|
||||
|
||||
// Flat server list for dropdowns, with latest latency assembled.
|
||||
e.Router.GET("/api/servers/options", requireAuth(func(e *core.RequestEvent) error {
|
||||
records, err := h.app.FindRecordsByFilter("fh_servers", "", "-created", 500, 0)
|
||||
if err != nil {
|
||||
return e.JSON(500, response.Error(err))
|
||||
}
|
||||
|
||||
latencyMap, err := h.metricsService.GetLatestLatencyBatch()
|
||||
if err != nil {
|
||||
h.app.Logger().Warn("Failed to get latency batch for options", "error", err)
|
||||
latencyMap = map[string]*monitoring.NetworkStatus{}
|
||||
}
|
||||
|
||||
items := make([]serverOptionVO, 0, len(records))
|
||||
for _, r := range records {
|
||||
items = append(items, serverOptionVO{
|
||||
ID: r.Id,
|
||||
ServerName: r.GetString("serverName"),
|
||||
BootStatus: r.GetString("bootStatus"),
|
||||
NetworkStatus: latencyMap[r.Id],
|
||||
})
|
||||
}
|
||||
|
||||
return e.JSON(200, items)
|
||||
}))
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package httphandler
|
||||
|
||||
import (
|
||||
"frpc-hub/internal/application/system"
|
||||
"podux/internal/application/system"
|
||||
"net/http"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package httphandler
|
||||
|
||||
import (
|
||||
"frpc-hub/internal/application/version"
|
||||
"podux/internal/application/version"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
@@ -2,21 +2,21 @@ package main
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"github.com/spf13/cobra"
|
||||
"io/fs"
|
||||
"log"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"frpc-hub/internal/application/dashboard"
|
||||
"frpc-hub/internal/application/frpc"
|
||||
"frpc-hub/internal/application/importer"
|
||||
"frpc-hub/internal/application/monitoring"
|
||||
"frpc-hub/internal/application/proxy"
|
||||
"frpc-hub/internal/application/server"
|
||||
"frpc-hub/internal/application/system"
|
||||
"frpc-hub/internal/application/version"
|
||||
"frpc-hub/internal/infrastructure/persistence"
|
||||
httphandler "frpc-hub/internal/interfaces/http"
|
||||
_ "frpc-hub/migrations"
|
||||
"podux/internal/application/dashboard"
|
||||
"podux/internal/application/frpc"
|
||||
"podux/internal/application/importer"
|
||||
"podux/internal/application/monitoring"
|
||||
"podux/internal/application/proxy"
|
||||
"podux/internal/application/server"
|
||||
"podux/internal/application/system"
|
||||
"podux/internal/application/version"
|
||||
"podux/internal/infrastructure/persistence"
|
||||
httphandler "podux/internal/interfaces/http"
|
||||
_ "podux/migrations"
|
||||
|
||||
"github.com/pocketbase/pocketbase"
|
||||
"github.com/pocketbase/pocketbase/apis"
|
||||
@@ -45,8 +45,10 @@ func main() {
|
||||
frpcService := frpc.NewService(app, serverRepo, proxyRepo)
|
||||
dashboardService := dashboard.NewService(app, serverService, proxyService)
|
||||
settingsService := system.NewService(app)
|
||||
networkService := monitoring.NewNetworkService(app)
|
||||
networkMonitorService := monitoring.NewMonitorService(app, networkService)
|
||||
geoService := monitoring.NewGeoService(app)
|
||||
metricsService := monitoring.NewMetricsService(app)
|
||||
metricsScheduler := monitoring.NewMetricsScheduler(app, metricsService)
|
||||
networkMonitorService := monitoring.NewMonitorService(app, geoService, metricsService)
|
||||
importService := importer.NewService(app)
|
||||
versionService := version.NewService(app)
|
||||
//githubService := github.NewService(app)
|
||||
@@ -58,6 +60,7 @@ func main() {
|
||||
dashboardHandler := httphandler.NewDashboardHandler(dashboardService)
|
||||
systemHandler := httphandler.NewSystemHandler(app, settingsService)
|
||||
importHandler := httphandler.NewImportHandler(app, importService)
|
||||
serverHandler := httphandler.NewServerHandler(app, metricsService)
|
||||
|
||||
// Hook: Reload frpc when proxy is updated
|
||||
app.OnRecordAfterUpdateSuccess("fh_proxies").BindFunc(func(e *core.RecordEvent) error {
|
||||
@@ -87,6 +90,7 @@ func main() {
|
||||
// Start network monitoring service using intervals from settings
|
||||
latencyInterval, geoInterval := settingsService.GetMonitoringIntervals()
|
||||
networkMonitorService.Start(latencyInterval, geoInterval)
|
||||
metricsScheduler.Register()
|
||||
|
||||
// Register routes for each module
|
||||
//githubHandler.RegisterHandlers(e)
|
||||
@@ -95,6 +99,7 @@ func main() {
|
||||
dashboardHandler.RegisterHandlers(e)
|
||||
systemHandler.RegisterHandlers(e)
|
||||
importHandler.RegisterHandlers(e)
|
||||
serverHandler.RegisterHandlers(e)
|
||||
|
||||
// Serve static files from embedded FS
|
||||
content, err := fs.Sub(pbPublicDir, "pb_public")
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(app core.App) error {
|
||||
collection, err := app.FindCollectionByNameOrId("pbc_3738798621")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"listRule": null
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return app.Save(collection)
|
||||
}, func(app core.App) error {
|
||||
collection, err := app.FindCollectionByNameOrId("pbc_3738798621")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"listRule": "@request.auth.id != ''"
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return app.Save(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(app core.App) error {
|
||||
collection, err := app.FindCollectionByNameOrId("pbc_3738798621")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"listRule": ""
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return app.Save(collection)
|
||||
}, func(app core.App) error {
|
||||
collection, err := app.FindCollectionByNameOrId("pbc_3738798621")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"listRule": null
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return app.Save(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(app core.App) error {
|
||||
collection, err := app.FindCollectionByNameOrId("pbc_3738798621")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"listRule": "@request.auth.id != ''"
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return app.Save(collection)
|
||||
}, func(app core.App) error {
|
||||
collection, err := app.FindCollectionByNameOrId("pbc_3738798621")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"listRule": ""
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return app.Save(collection)
|
||||
})
|
||||
}
|
||||
@@ -958,6 +958,16 @@ func init() {
|
||||
"offline"
|
||||
]
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "json3916310420",
|
||||
"maxSize": 0,
|
||||
"name": "plugin",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "json"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "autodate2990389176",
|
||||
@@ -1154,14 +1164,18 @@ func init() {
|
||||
"type": "json"
|
||||
},
|
||||
{
|
||||
"autogeneratePattern": "",
|
||||
"hidden": false,
|
||||
"id": "json948844010",
|
||||
"maxSize": 0,
|
||||
"name": "networkStatus",
|
||||
"id": "text2375276105",
|
||||
"max": 0,
|
||||
"min": 0,
|
||||
"name": "user",
|
||||
"pattern": "",
|
||||
"presentable": false,
|
||||
"primaryKey": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "json"
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
@@ -1337,6 +1351,345 @@ func init() {
|
||||
"type": "base",
|
||||
"updateRule": "@request.auth.id != ''",
|
||||
"viewRule": "@request.auth.id != ''"
|
||||
},
|
||||
{
|
||||
"createRule": null,
|
||||
"deleteRule": null,
|
||||
"fields": [
|
||||
{
|
||||
"autogeneratePattern": "[a-z0-9]{15}",
|
||||
"hidden": false,
|
||||
"id": "text3208210256",
|
||||
"max": 15,
|
||||
"min": 15,
|
||||
"name": "id",
|
||||
"pattern": "^[a-z0-9]+$",
|
||||
"presentable": false,
|
||||
"primaryKey": true,
|
||||
"required": true,
|
||||
"system": true,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"cascadeDelete": false,
|
||||
"collectionId": "pbc_1442576311",
|
||||
"hidden": false,
|
||||
"id": "relation361630566",
|
||||
"maxSelect": 1,
|
||||
"minSelect": 0,
|
||||
"name": "targetId",
|
||||
"presentable": false,
|
||||
"required": true,
|
||||
"system": false,
|
||||
"type": "relation"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "select2505851765",
|
||||
"maxSelect": 1,
|
||||
"name": "metricKey",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "select",
|
||||
"values": [
|
||||
"frps_delay"
|
||||
]
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "date2238339752",
|
||||
"max": "",
|
||||
"min": "",
|
||||
"name": "t",
|
||||
"presentable": false,
|
||||
"required": true,
|
||||
"system": false,
|
||||
"type": "date"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "number2548021861",
|
||||
"max": null,
|
||||
"min": null,
|
||||
"name": "val",
|
||||
"onlyInt": false,
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "number"
|
||||
}
|
||||
],
|
||||
"id": "pbc_793044944",
|
||||
"indexes": [
|
||||
"CREATE INDEX ` + "`" + `idx_ccjpJ7y6sJ` + "`" + ` ON ` + "`" + `fh_metrics_raw` + "`" + ` (\n ` + "`" + `targetId` + "`" + `,\n ` + "`" + `t` + "`" + `,\n ` + "`" + `metricKey` + "`" + `\n)"
|
||||
],
|
||||
"listRule": null,
|
||||
"name": "fh_metrics_raw",
|
||||
"system": false,
|
||||
"type": "base",
|
||||
"updateRule": null,
|
||||
"viewRule": null
|
||||
},
|
||||
{
|
||||
"createRule": null,
|
||||
"deleteRule": null,
|
||||
"fields": [
|
||||
{
|
||||
"autogeneratePattern": "[a-z0-9]{15}",
|
||||
"hidden": false,
|
||||
"id": "text3208210256",
|
||||
"max": 15,
|
||||
"min": 15,
|
||||
"name": "id",
|
||||
"pattern": "^[a-z0-9]+$",
|
||||
"presentable": false,
|
||||
"primaryKey": true,
|
||||
"required": true,
|
||||
"system": true,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"cascadeDelete": false,
|
||||
"collectionId": "pbc_3738798621",
|
||||
"hidden": false,
|
||||
"id": "relation2665642495",
|
||||
"maxSelect": 1,
|
||||
"minSelect": 0,
|
||||
"name": "serverId",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "relation"
|
||||
},
|
||||
{
|
||||
"cascadeDelete": false,
|
||||
"collectionId": "pbc_2245327697",
|
||||
"hidden": false,
|
||||
"id": "relation2990786978",
|
||||
"maxSelect": 1,
|
||||
"minSelect": 0,
|
||||
"name": "proxyId",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "relation"
|
||||
}
|
||||
],
|
||||
"id": "pbc_1442576311",
|
||||
"indexes": [],
|
||||
"listRule": null,
|
||||
"name": "fh_metrics_targets",
|
||||
"system": false,
|
||||
"type": "base",
|
||||
"updateRule": null,
|
||||
"viewRule": null
|
||||
},
|
||||
{
|
||||
"createRule": null,
|
||||
"deleteRule": null,
|
||||
"fields": [
|
||||
{
|
||||
"autogeneratePattern": "[a-z0-9]{15}",
|
||||
"hidden": false,
|
||||
"id": "text3208210256",
|
||||
"max": 15,
|
||||
"min": 15,
|
||||
"name": "id",
|
||||
"pattern": "^[a-z0-9]+$",
|
||||
"presentable": false,
|
||||
"primaryKey": true,
|
||||
"required": true,
|
||||
"system": true,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"cascadeDelete": false,
|
||||
"collectionId": "pbc_1442576311",
|
||||
"hidden": false,
|
||||
"id": "relation361630566",
|
||||
"maxSelect": 1,
|
||||
"minSelect": 0,
|
||||
"name": "targetId",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "relation"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "select2505851765",
|
||||
"maxSelect": 1,
|
||||
"name": "metricKey",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "select",
|
||||
"values": [
|
||||
"frps_delay"
|
||||
]
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "date2238339752",
|
||||
"max": "",
|
||||
"min": "",
|
||||
"name": "t",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "date"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "number4252428468",
|
||||
"max": null,
|
||||
"min": null,
|
||||
"name": "valAvg",
|
||||
"onlyInt": false,
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "number2095552691",
|
||||
"max": null,
|
||||
"min": null,
|
||||
"name": "valMax",
|
||||
"onlyInt": false,
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "number1089120234",
|
||||
"max": null,
|
||||
"min": null,
|
||||
"name": "valMin",
|
||||
"onlyInt": false,
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "number"
|
||||
}
|
||||
],
|
||||
"id": "pbc_316017333",
|
||||
"indexes": [
|
||||
"CREATE INDEX ` + "`" + `idx_er76FRWKT4` + "`" + ` ON ` + "`" + `fh_metrics_hourly` + "`" + ` (\n ` + "`" + `metricKey` + "`" + `,\n ` + "`" + `targetId` + "`" + `,\n ` + "`" + `t` + "`" + `\n)"
|
||||
],
|
||||
"listRule": null,
|
||||
"name": "fh_metrics_hourly",
|
||||
"system": false,
|
||||
"type": "base",
|
||||
"updateRule": null,
|
||||
"viewRule": null
|
||||
},
|
||||
{
|
||||
"createRule": null,
|
||||
"deleteRule": null,
|
||||
"fields": [
|
||||
{
|
||||
"autogeneratePattern": "[a-z0-9]{15}",
|
||||
"hidden": false,
|
||||
"id": "text3208210256",
|
||||
"max": 15,
|
||||
"min": 15,
|
||||
"name": "id",
|
||||
"pattern": "^[a-z0-9]+$",
|
||||
"presentable": false,
|
||||
"primaryKey": true,
|
||||
"required": true,
|
||||
"system": true,
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"cascadeDelete": false,
|
||||
"collectionId": "pbc_1442576311",
|
||||
"hidden": false,
|
||||
"id": "relation962958965",
|
||||
"maxSelect": 1,
|
||||
"minSelect": 0,
|
||||
"name": "targetId",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "relation"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "select2505851765",
|
||||
"maxSelect": 1,
|
||||
"name": "metricKey",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "select",
|
||||
"values": [
|
||||
"frps_delay"
|
||||
]
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "date2238339752",
|
||||
"max": "",
|
||||
"min": "",
|
||||
"name": "t",
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "date"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "number4252428468",
|
||||
"max": null,
|
||||
"min": null,
|
||||
"name": "valAvg",
|
||||
"onlyInt": false,
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "number3814843458",
|
||||
"max": null,
|
||||
"min": null,
|
||||
"name": "valMax",
|
||||
"onlyInt": false,
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"hidden": false,
|
||||
"id": "number3748453147",
|
||||
"max": null,
|
||||
"min": null,
|
||||
"name": "valMin",
|
||||
"onlyInt": false,
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "number"
|
||||
}
|
||||
],
|
||||
"id": "pbc_3875966484",
|
||||
"indexes": [
|
||||
"CREATE INDEX ` + "`" + `idx_cytGPviJew` + "`" + ` ON ` + "`" + `fh_metrics_daily` + "`" + ` (\n ` + "`" + `targetId` + "`" + `,\n ` + "`" + `metricKey` + "`" + `,\n ` + "`" + `t` + "`" + `\n)"
|
||||
],
|
||||
"listRule": null,
|
||||
"name": "fh_metrics_daily",
|
||||
"system": false,
|
||||
"type": "base",
|
||||
"updateRule": null,
|
||||
"viewRule": null
|
||||
}
|
||||
]`
|
||||
|
||||
@@ -2,4 +2,4 @@ package buildinfo
|
||||
|
||||
// AppVersion is the single source of truth for the application version.
|
||||
// Update this value to release a new version.
|
||||
const AppVersion = "0.1.0"
|
||||
const AppVersion = "0.1.6"
|
||||
|
After Width: | Height: | Size: 589 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 272 KiB |
@@ -1,73 +0,0 @@
|
||||
# React + TypeScript + Vite
|
||||
|
||||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
||||
|
||||
Currently, two official plugins are available:
|
||||
|
||||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
||||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
||||
|
||||
## React Compiler
|
||||
|
||||
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
||||
|
||||
## Expanding the ESLint configuration
|
||||
|
||||
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
||||
|
||||
```js
|
||||
export default defineConfig([
|
||||
globalIgnores(['dist']),
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
extends: [
|
||||
// Other configs...
|
||||
|
||||
// Remove tseslint.configs.recommended and replace with this
|
||||
tseslint.configs.recommendedTypeChecked,
|
||||
// Alternatively, use this for stricter rules
|
||||
tseslint.configs.strictTypeChecked,
|
||||
// Optionally, add this for stylistic rules
|
||||
tseslint.configs.stylisticTypeChecked,
|
||||
|
||||
// Other configs...
|
||||
],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
// other options...
|
||||
},
|
||||
},
|
||||
])
|
||||
```
|
||||
|
||||
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
||||
|
||||
```js
|
||||
// eslint.config.js
|
||||
import reactX from 'eslint-plugin-react-x'
|
||||
import reactDom from 'eslint-plugin-react-dom'
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores(['dist']),
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
extends: [
|
||||
// Other configs...
|
||||
// Enable lint rules for React
|
||||
reactX.configs['recommended-typescript'],
|
||||
// Enable lint rules for React DOM
|
||||
reactDom.configs.recommended,
|
||||
],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
// other options...
|
||||
},
|
||||
},
|
||||
])
|
||||
```
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Frpc Hub</title>
|
||||
<title>Podux</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "frpc-hub-web",
|
||||
"name": "podux-web",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.6",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 4.2 KiB |
@@ -23,6 +23,15 @@ const ServerDetailPage = lazy(() =>
|
||||
import("./pages/ServerDetail").then((m) => ({ default: m.ServerDetailPage }))
|
||||
);
|
||||
const ImportPage = lazy(() => import("./pages/Import").then((m) => ({ default: m.ImportPage })));
|
||||
const ProxyFormPage = lazy(() =>
|
||||
import("./pages/Proxies/ProxyFormPage").then((m) => ({ default: m.ProxyFormPage }))
|
||||
);
|
||||
const ServerFormPage = lazy(() =>
|
||||
import("./pages/Servers/ServerFormPage").then((m) => ({ default: m.ServerFormPage }))
|
||||
);
|
||||
const ServerLogPage = lazy(() =>
|
||||
import("./pages/ServerLog/ServerLogPage").then((m) => ({ default: m.ServerLogPage }))
|
||||
);
|
||||
|
||||
function AuthenticatedLayout() {
|
||||
console.log("AuthenticatedLayout rendered");
|
||||
@@ -59,8 +68,13 @@ function App() {
|
||||
<Route element={<AuthenticatedLayout />}>
|
||||
<Route path="/dashboard" element={<DashboardPage />} />
|
||||
<Route path="/proxies" element={<ProxiesPage />} />
|
||||
<Route path="/proxies/new" element={<ProxyFormPage />} />
|
||||
<Route path="/proxies/:id/edit" element={<ProxyFormPage />} />
|
||||
<Route path="/servers" element={<ServersPage />} />
|
||||
<Route path="/servers/new" element={<ServerFormPage />} />
|
||||
<Route path="/servers/:id/edit" element={<ServerFormPage />} />
|
||||
<Route path="/servers/:id" element={<ServerDetailPage />} />
|
||||
<Route path="/servers/:id/logs" element={<ServerLogPage />} />
|
||||
<Route path="/settings" element={<SettingsPage />} />
|
||||
<Route path="/import" element={<ImportPage />} />
|
||||
{/* <Route path="/versions" element={<VersionPage />} /> */}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated by Pixelmator Pro 3.7 -->
|
||||
<svg width="814" height="814" viewBox="0 0 814 814" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<image id="image1" x="34" y="32" width="373" height="751" xlink:href="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAXUAAALvCAYAAACa6FVwAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABdaADAAQAAAABAAAC7wAAAADb4BoWAABAAElEQVR4Aey9CZQk2VUl+G3x3WPNtTYhIaFBgPqoQWqQGFpIaCQQAhoEojnQw9YLatQ0OjRI7KIHneYwzDAzZ04f+kwP3adZxAhtJZWklljULSSVpMqqrDUr94zcY8nYI3w1d5t737fnbu7hERkZGZkVHvl/lbmZ/eX9Z88i73/2/vvve8YlJwEnASeBfSCBeOmRCePnfTNSrHje66r74JF29Ajejlq5Rk4CTgJOAi+gBOLZD5ZrrdbBqL5WWK+uviyKGq+MGs1XxKY95gXBDeP7530vPJPPlU6F5ZGFjF+ulY9E8573jtYLyPZd6dqB+l0Rs+vEScBJ4HYlEMfHMo2Zk1+/tDLzusrK4mvXlhf+fqO2PlGtrh/2/FYubrVNo9EwYTZjTOybTCa3EntBM18oz4VhfnlsfPLRAwcf+FRp9OBj3sQPLt0uP3u1vQP1vfpmHF9OAk4CIoHl2T952frSwhtrKzPfVVm78arF2esv99o1k/V906ivmyDwTBj6xvM802pHJgwyJmq3kB+YVuSZIFswtX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OvLS/8IuAgYfuwZ95HXqNR/7Z4/lOjfWztyVsH6nvytTimnASGRwLx2l8fWZ47+9snn370gZW5C2Ycy/5LOXq3wB/dZyAuqxXLE8FMQgWcR4Afauc8NCm4EpiYr3W4otSWEcCpYXNAIAhTq4bZhpti4D6HIF2Msc5FRTGAnwHB2BdUdbnmRCi/FORgGemQB1aSikJS+oKVB6YjO5i0ouhFplQYitWlzvxi36H7dRJwEtihBCqrl3/uyvln/kG0PmsOluFTblaw7B4O53EVgA4QBTpCYRbQFM+TBKBpNmEiOMtEJmBcgFo0eBYyX8G8e61tRFunOQfmFU6G5otl0dYJ1PSood952m5OWkz2d1AZBwr06sNHHTzyOsB+pw3QCjnrGrXw/bH3k9PU9/47chw6CexZCdTn/uLHr5x/8t8szZzxS9kagnPBy8XDbkUtTIoCPmluoQZM04v1K7ePQvCmYYSToC3Uob5OMOJq0DbMHxgGBNBZj/ZtauecvuQhwM+6IK1ATbNLBlp6iFAA1NyBy5KknHZ11GViWyrkpKNtmW+v7RcDr/XgwBFhwRNODBc5wbp7PTlQ3+tvyPHnJLBHJVBf+ujbL547/n9PnX6qPAqTy+FJhLJF6Fof4XPpsqigSSDV683O+ogK2LzXdmyj+fRy4XXvAS8VbDatNnACsSaloff9/XfocoRAohYvvu5Afpp0WE5tX0h6mSWptMd/nPllj78gx56TwF6UQLz2yVctz5z51ekLz42HrVWsEoW23eQKTK7zx96hgMcutFqAhqYLkEzAHtq4j/vexBaJSt1bYDVnaO+CuiyjmyJMJBn4o2fzCKMLAGb8ljbMMSQhYJ2YW/iFIAn5FtRtv6K9s7vEHiP3MoBwgMDAQTBHIb8ooP1jGaxZtYT29m+/VPc2t447JwEngRdcAvHKJw7euHby/zrz3JLine truncated
|
||||
<image id="image2" x="147" y="67" width="119" height="152" xlink:href="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAHcAAACYCAYAAADeK3bdAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAA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NEASzrRxq9p0LWC0Q0xl6XPpZ8F5Cn33rsk2Flj5VMs9JiBKwfYps+cOfOqgwcPO8cff7z0MykCbJ6hkT7HBjUacKoLjJ2nOw23PRaM5YBbemqaOXbLac19e39yJk2cuH7osKH9YpF+OGnErFkWCX1PbtN52I9lRMigCaWMs8FVNzeBgdzd4YLZSUPTQSdf205ct3uw9CL1I23d6UFyuRS9YcMG54orryyW2+7NIk0vmvAxkVxZ7N4qS2je9u3bm5UYCqeDJgWVQusXiGBbugKFwV3T8afjr+n4A9btjz0yBct8bCN/8tBZADqj4yw5QE5zTIvFOnqfPn3KpkyZEvEZqMjoqho6anCff/7592Ta05KCcJvOrWBAvCgFXempLm0KKhW4fD4rINNaUbGZ9Line truncated
|
||||
<image id="image3" x="181" y="67" width="599" height="672" xlink:href="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAlcAAAKgCAYAAAC2rFglAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACV6ADAAQAAAABAAACoAAAAAARWqrRAABAAElEQVR4Aey9CZxVxZU/fnuj6YXuptlBWZTFDSbGjHHUiSYmxphMNNFJZtyyzPwmiSaO+ZuYaIwzjpPJNmbBJK5jEo3GfUVQUUDAhV1UEAUUAWVfmm5ouqG7//Wt19/u08W9b1/ue+/U5/NebadOnfrWdm5V3bolnhpFQBFIGYGurq7SJUuWlJ1wwgkdxu5/8ODB8tbW1n2HHXZY2bZt20pHjBjRtWPHjo76+vpSmVl7e3tXv379ShjW1NTUSTfs5ubmLvpPP/30HjfDYM+ZM6dExsEv4xFnZCo1soF3l4m3MnSnsX6R3vX3sOrOp8MElKCskI28QRQgK2TuIw9ou01PnJSZssQbhrJRFqQZMGCAzY/y0I88gcGaNWvKgTPTdGNjywUaN1/y7MavJ17ih3SUG25pkN6Ji1lutJuNGzdCJg/yV1VVlZj2ZOsfcg8dOrSnHaH9oB1t3bq1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tDgh5UsHIS3MpjnHlygOnr0aM+8cfj64EGD13/870/9xYmnnDI3XpmUrjgR0FG/OOtdS50kAuY7gkdf+M8XrMQAbV719pqa99jBGgM0BmM7IHcrU9KtE3aSgCeQjJOla4MF8UedSL/1mD/WFW2Gq51dBFz8XX+QNJIOdc3VL9jc8sO2H+jgxw90UKawegU70kbwbcTIG4jo0/v3tXrbtm3r+fYi/HiB5eNnnHbX2LFj55x00inT9Kb4oFop7nD9cHNx17+WPkEEli1b9vWWfXu9uro6r7xf5NZoDuRghQE6MkhH3HLQTzArJU8QAWAN49oyzBIIGvrVzg0Csn+w3yQjiZtW+rkyhX6K/PDrVaYiVzogT76V2NXVz/bhsrISr6Kynzd46BCv3LhxxQN4rF67BgrXJcZ9ybgjj9h/1113/cJ8V3SaueJhUTKya5rCREBXrgqzXrVUGULgk5/8ZKe5mb0EW4IYtLGCxTeS5ETB7P3CGKd2uBDAhKz1lVydALdohtiCxs9NZShV/Jme8kCJwioVbGkYT3rkDzqYiHyR1S18tRJpK8oj3wut6NffbhkeaGv3NmzY4FXX1tj+X1td45177hfuPenkk35jboxfdeqppzbL/NRdfAioclV8da4lThKBGTNmfPriiy9+uqGhwW4J4gAsDJQraeTkIcPVXRgIUBEojNLEVwoqIdHs+DgFU7HfSDuYOnoM5IRSBJuGfoTJcMYjX9YtVqjw4wMU7rDDlxiwtYhw6Gq4Kb6iotIqWQfbD3j4DA/4Hjl+/Af/9o1/+7y5S2v1SSedtIf81S4uBFS5Kq761tKmgMD3v//9p/785z+fjcOtuIQQylVkoC21NgfmFLLQpHmKQD7XvZ+ike1qgAxUfpi362d4kA0ebj1Ivohzy+r6kSdXsPDQRD/PaOF8Fn5VVZX2gHxpaeSsZefBDvvWMOj3t0c+3I5PYuENwwsvvPBfJ0+evCVIbg0vTARUuSrMetVSpRmB1atX1/3zPLine truncated
|
||||
<image id="image4" x="330" y="67" width="450" height="424" xlink:href="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAcIAAAGo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SbozWFtUIGIxctjFP2XLpuQpo9d+4U5MSAQeUUJi6MVzr1qm+Z+fHTzS7vCHOCFMurxGNXOeGmX78B3iBu27KVDyh7vvtMnfra57/w+Q+7dxXnH3nkkWvE32jfQqBpDeG3vvWtG3/3u999gAfnvJCLIcxcFJmT93UR9a3uttaCQCP3fZpRqHavIoMMleqOw4rPRuER90PIl7S4rXGYOjUz5AZXYT1T5Hkiv0GDBvjNN62tmb0BfDWD3ePk37Qlc+g+xy6y0/RTn/rUPx1yyCGvZ5Pb4psTgaY0hPPnzx/2yU9+cvUrixb6zy1xjC/PFOILL+1ia85utlaFCMTjIEyrZ39sCGopq66d3mBJewrho3xqL+EQC8nQwytzgDhLpTi/kYbvLDptx7uJLJWybwD36quv+uVTZpF8RooVJHeKzVP/8I+f+/Q73/nOJ30m+2t6BJrSEF544YW//PrXv/6lCZMmZpZF33jT3/1xBLine truncated
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 340 KiB |
@@ -0,0 +1,272 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Flex, Text } from "@radix-ui/themes";
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
AreaChart,
|
||||
Area,
|
||||
XAxis,
|
||||
YAxis,
|
||||
CartesianGrid,
|
||||
Tooltip,
|
||||
ResponsiveContainer,
|
||||
} from "recharts";
|
||||
import { apiGet } from "../lib/api";
|
||||
|
||||
interface ProbePoint {
|
||||
t: string;
|
||||
val: number;
|
||||
}
|
||||
|
||||
interface ChartPoint {
|
||||
time: string;
|
||||
ms: number;
|
||||
}
|
||||
|
||||
function toChartPoints(points: ProbePoint[]): ChartPoint[] {
|
||||
return points
|
||||
.filter((p) => p.val >= 0)
|
||||
.map((p) => ({
|
||||
time: new Date(p.t.replace(" ", "T").replace(/Z$/, "+00:00")).toLocaleTimeString([], {
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
second: "2-digit",
|
||||
}),
|
||||
ms: Math.round(p.val),
|
||||
}));
|
||||
}
|
||||
|
||||
// ── Custom tooltip ────────────────────────────────────────────────────────────
|
||||
|
||||
interface CustomTooltipProps {
|
||||
active?: boolean;
|
||||
payload?: { value: number }[];
|
||||
label?: string;
|
||||
}
|
||||
|
||||
function CustomTooltip({ active, payload, label }: CustomTooltipProps) {
|
||||
if (!active || !payload?.length) return null;
|
||||
return (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, scale: 0.92, y: -4 }}
|
||||
animate={{ opacity: 1, scale: 1, y: 0 }}
|
||||
transition={{ duration: 0.15, ease: "easeOut" }}
|
||||
style={{
|
||||
background: "var(--color-panel-solid)",
|
||||
border: "1px solid var(--gray-5)",
|
||||
borderRadius: 10,
|
||||
padding: "8px 12px",
|
||||
boxShadow: "0 8px 24px rgba(0,0,0,0.14)",
|
||||
}}
|
||||
>
|
||||
<Text size="1" color="gray">{label}</Text>
|
||||
<Flex align="center" gap="2" mt="1">
|
||||
<motion.div
|
||||
animate={{ scale: [1, 1.3, 1] }}
|
||||
transition={{ repeat: Infinity, duration: 1.5, ease: "easeInOut" }}
|
||||
style={{ width: 8, height: 8, borderRadius: "50%", background: "var(--green-9)" }}
|
||||
/>
|
||||
<Text size="2" weight="bold">{payload[0].value}ms</Text>
|
||||
</Flex>
|
||||
</motion.div>
|
||||
);
|
||||
}
|
||||
|
||||
// ── Pulsing dot on the last data point ───────────────────────────────────────
|
||||
|
||||
interface DotProps {
|
||||
cx?: number;
|
||||
cy?: number;
|
||||
index?: number;
|
||||
dataLength: number;
|
||||
}
|
||||
|
||||
function PulsingDot({ cx = 0, cy = 0, index = 0, dataLength }: DotProps) {
|
||||
if (index !== dataLength - 1) return null;
|
||||
return (
|
||||
<g>
|
||||
<circle cx={cx} cy={cy} r={4} fill="var(--green-9)" />
|
||||
<circle cx={cx} cy={cy} r={4} fill="var(--green-9)" opacity={0.5}>
|
||||
<animate attributeName="r" from="4" to="14" dur="1.6s" repeatCount="indefinite" />
|
||||
<animate attributeName="opacity" from="0.5" to="0" dur="1.6s" repeatCount="indefinite" />
|
||||
</circle>
|
||||
</g>
|
||||
);
|
||||
}
|
||||
|
||||
// ── Skeleton loader ───────────────────────────────────────────────────────────
|
||||
|
||||
function ChartSkeleton() {
|
||||
// Fake wave path to mimic a latency curve
|
||||
const path = "M0,60 C20,55 40,70 60,50 C80,30 100,65 120,45 C140,25 160,55 180,40 C200,25 220,50 240,35 C260,20 280,45 300,30 C320,15 340,40 360,25";
|
||||
return (
|
||||
<svg width="100%" height={180} style={{ overflow: "hidden" }}>
|
||||
<defs>
|
||||
<linearGradient id="shimmer" x1="0" y1="0" x2="1" y2="0">
|
||||
<stop offset="0%" stopColor="var(--gray-3)" />
|
||||
<stop offset="40%" stopColor="var(--gray-5)" />
|
||||
<stop offset="100%" stopColor="var(--gray-3)" />
|
||||
<animateTransform
|
||||
attributeName="gradientTransform"
|
||||
type="translate"
|
||||
from="-1 0"
|
||||
to="2 0"
|
||||
dur="1.4s"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
</linearGradient>
|
||||
<clipPath id="skeletonClip">
|
||||
<rect x="0" y="0" width="100%" height="100%" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
{/* Fake grid lines */}
|
||||
{[40, 80, 120, 160].map((y) => (
|
||||
<line key={y} x1="52" y1={y} x2="100%" y2={y} stroke="var(--gray-3)" strokeDasharray="4 4" />
|
||||
))}
|
||||
{/* Fake Y-axis labels */}
|
||||
{[40, 80, 120].map((y, i) => (
|
||||
<rect key={i} x="0" y={y - 6} width="36" height="10" rx="4" fill="url(#shimmer)" />
|
||||
))}
|
||||
{/* Fake curve area */}
|
||||
<path
|
||||
d={`${path} L360,180 L0,180 Z`}
|
||||
fill="url(#shimmer)"
|
||||
opacity={0.5}
|
||||
clipPath="url(#skeletonClip)"
|
||||
/>
|
||||
{/* Fake curve line */}
|
||||
<path d={path} fill="none" stroke="url(#shimmer)" strokeWidth="2" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
// ── Main component ────────────────────────────────────────────────────────────
|
||||
|
||||
interface LatencyChartProps {
|
||||
serverId: string;
|
||||
}
|
||||
|
||||
export function LatencyChart({ serverId }: LatencyChartProps) {
|
||||
const { t } = useTranslation();
|
||||
const [data, setData] = useState<ChartPoint[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [animKey, setAnimKey] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
|
||||
const load = async () => {
|
||||
try {
|
||||
const res = await apiGet(`/api/servers/probe-history?serverId=${serverId}`);
|
||||
if (!res.ok || cancelled) return;
|
||||
const points: ProbePoint[] = await res.json();
|
||||
if (cancelled) return;
|
||||
setData(toChartPoints(points));
|
||||
setAnimKey((k) => k + 1);
|
||||
} catch {
|
||||
// silent
|
||||
} finally {
|
||||
if (!cancelled) setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
load();
|
||||
const interval = setInterval(load, 30_000);
|
||||
return () => {
|
||||
cancelled = true;
|
||||
clearInterval(interval);
|
||||
};
|
||||
}, [serverId]);
|
||||
|
||||
const isEmpty = !loading && data.length === 0;
|
||||
|
||||
return (
|
||||
<div style={{ position: "relative", height: 180 }}>
|
||||
<AnimatePresence mode="wait">
|
||||
{loading ? (
|
||||
<motion.div
|
||||
key="skeleton"
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0 }}
|
||||
transition={{ duration: 0.25 }}
|
||||
style={{ position: "absolute", inset: 0 }}
|
||||
>
|
||||
<ChartSkeleton />
|
||||
</motion.div>
|
||||
) : isEmpty ? (
|
||||
<motion.div
|
||||
key="empty"
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
style={{ position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center" }}
|
||||
>
|
||||
<Text size="2" color="gray">{t("server.probeNoData")}</Text>
|
||||
</motion.div>
|
||||
) : (
|
||||
<motion.div
|
||||
key={`chart-${animKey}`}
|
||||
initial={{ opacity: 0, clipPath: "inset(0 100% 0 0)" }}
|
||||
animate={{ opacity: 1, clipPath: "inset(0 0% 0 0)" }}
|
||||
transition={{ duration: 0.9, ease: [0.25, 0.46, 0.45, 0.94] }}
|
||||
style={{ position: "absolute", inset: 0 }}
|
||||
>
|
||||
<ResponsiveContainer width="100%" height={180}>
|
||||
<AreaChart data={data} margin={{ top: 8, right: 4, left: -16, bottom: 0 }}>
|
||||
<defs>
|
||||
<linearGradient id="latencyGrad" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="5%" stopColor="var(--green-9)" stopOpacity={0.28} />
|
||||
<stop offset="95%" stopColor="var(--green-9)" stopOpacity={0} />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<CartesianGrid strokeDasharray="3 3" stroke="var(--gray-4)" vertical={false} />
|
||||
|
||||
<XAxis
|
||||
dataKey="time"
|
||||
tick={{ fontSize: 11, fill: "var(--gray-9)" }}
|
||||
tickLine={false}
|
||||
axisLine={false}
|
||||
interval="preserveStartEnd"
|
||||
/>
|
||||
|
||||
<YAxis
|
||||
tick={{ fontSize: 11, fill: "var(--gray-9)" }}
|
||||
tickLine={false}
|
||||
axisLine={false}
|
||||
tickFormatter={(v) => `${v}ms`}
|
||||
width={52}
|
||||
/>
|
||||
|
||||
<Tooltip
|
||||
content={<CustomTooltip />}
|
||||
cursor={{ stroke: "var(--green-7)", strokeWidth: 1, strokeDasharray: "4 4" }}
|
||||
/>
|
||||
|
||||
<Area
|
||||
type="monotone"
|
||||
dataKey="ms"
|
||||
stroke="var(--green-9)"
|
||||
strokeWidth={2}
|
||||
fill="url(#latencyGrad)"
|
||||
dot={(props: any) => (
|
||||
<PulsingDot key={props.index} {...props} dataLength={data.length} />
|
||||
)}
|
||||
activeDot={{
|
||||
r: 5,
|
||||
fill: "var(--green-9)",
|
||||
stroke: "var(--color-panel-solid)",
|
||||
strokeWidth: 2,
|
||||
}}
|
||||
isAnimationActive={true}
|
||||
animationDuration={900}
|
||||
animationEasing="ease-out"
|
||||
/>
|
||||
</AreaChart>
|
||||
</ResponsiveContainer>
|
||||
</motion.div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Flex, Text, Tooltip, Badge } from "@radix-ui/themes";
|
||||
import { motion } from "framer-motion";
|
||||
import { Icon } from "@iconify/react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { apiGet } from "../lib/api";
|
||||
|
||||
interface ProbePoint {
|
||||
t: string;
|
||||
val: number;
|
||||
}
|
||||
|
||||
interface Bucket {
|
||||
start: number;
|
||||
end: number;
|
||||
avg: number | null; // null = no data, -1 = unreachable
|
||||
}
|
||||
|
||||
const BUCKETS = 30;
|
||||
const WINDOW_MS = 30 * 60 * 1000;
|
||||
|
||||
function buildBuckets(points: ProbePoint[]): Bucket[] {
|
||||
const now = Date.now();
|
||||
const slotMs = WINDOW_MS / BUCKETS;
|
||||
|
||||
const buckets: Bucket[] = Array.from({ length: BUCKETS }, (_, i) => ({
|
||||
start: now - WINDOW_MS + i * slotMs,
|
||||
end: now - WINDOW_MS + (i + 1) * slotMs,
|
||||
avg: null,
|
||||
}));
|
||||
|
||||
for (const p of points) {
|
||||
const ts = new Date(p.t.replace(" ", "T").replace(/Z$/, "+00:00")).getTime();
|
||||
const idx = Math.floor((ts - (now - WINDOW_MS)) / slotMs);
|
||||
if (idx < 0 || idx >= BUCKETS) continue;
|
||||
const b = buckets[idx];
|
||||
if (p.val < 0) {
|
||||
b.avg = -1;
|
||||
} else if (b.avg === null) {
|
||||
b.avg = p.val;
|
||||
} else if (b.avg >= 0) {
|
||||
b.avg = (b.avg + p.val) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
return buckets;
|
||||
}
|
||||
|
||||
function bucketGradient(avg: number | null): string {
|
||||
if (avg === null) return "linear-gradient(to top, var(--gray-4), var(--gray-5))";
|
||||
if (avg < 0) return "linear-gradient(to top, var(--red-6), var(--red-8))";
|
||||
if (avg < 50) return "linear-gradient(to top, var(--green-7), var(--green-9))";
|
||||
if (avg < 150) return "linear-gradient(to top, var(--amber-7), var(--amber-9))";
|
||||
return "linear-gradient(to top, var(--red-7), var(--red-9))";
|
||||
}
|
||||
|
||||
function bucketGlow(avg: number | null): string {
|
||||
if (avg === null || avg < 0) return "none";
|
||||
if (avg < 50) return "0 2px 8px var(--green-a6)";
|
||||
if (avg < 150) return "0 2px 8px var(--amber-a6)";
|
||||
return "0 2px 8px var(--red-a6)";
|
||||
}
|
||||
|
||||
function bucketLabel(b: Bucket, noData: string, unreachable: string): string {
|
||||
const fmt = (ts: number) =>
|
||||
new Date(ts).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
||||
const range = `${fmt(b.start)} – ${fmt(b.end)}`;
|
||||
if (b.avg === null) return `${range}\n${noData}`;
|
||||
if (b.avg < 0) return `${range}\n${unreachable}`;
|
||||
return `${range}\n${Math.round(b.avg)}ms`;
|
||||
}
|
||||
|
||||
interface ProbeHistoryProps {
|
||||
serverId: string;
|
||||
}
|
||||
|
||||
export function ProbeHistory({ serverId }: ProbeHistoryProps) {
|
||||
const { t } = useTranslation();
|
||||
const [buckets, setBuckets] = useState<Bucket[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [animKey, setAnimKey] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
|
||||
const load = async () => {
|
||||
try {
|
||||
const res = await apiGet(`/api/servers/probe-history?serverId=${serverId}`);
|
||||
if (!res.ok || cancelled) return;
|
||||
const points: ProbePoint[] = await res.json();
|
||||
if (cancelled) return;
|
||||
setBuckets(buildBuckets(points));
|
||||
setAnimKey((k) => k + 1);
|
||||
} catch {
|
||||
// silent
|
||||
} finally {
|
||||
if (!cancelled) setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
load();
|
||||
const interval = setInterval(load, 30_000);
|
||||
return () => {
|
||||
cancelled = true;
|
||||
clearInterval(interval);
|
||||
};
|
||||
}, [serverId]);
|
||||
|
||||
// Stats
|
||||
const valid = buckets.filter((b) => b.avg !== null);
|
||||
const reachable = valid.filter((b) => b.avg! >= 0);
|
||||
const uptime = valid.length > 0 ? (reachable.length / valid.length) * 100 : null;
|
||||
const avgLatency =
|
||||
reachable.length > 0
|
||||
? Math.round(reachable.reduce((s, b) => s + b.avg!, 0) / reachable.length)
|
||||
: null;
|
||||
const maxLatency =
|
||||
reachable.length > 0 ? Math.round(Math.max(...reachable.map((b) => b.avg!))) : null;
|
||||
|
||||
const lastActiveIdx = buckets.reduce((last, b, i) => (b.avg !== null ? i : last), -1);
|
||||
|
||||
const uptimeColor =
|
||||
uptime === null ? "gray" : uptime === 100 ? "green" : uptime >= 80 ? "amber" : "red";
|
||||
|
||||
return (
|
||||
<Flex direction="column" gap="4">
|
||||
{/* Stats row */}
|
||||
<Flex gap="5" align="center" wrap="wrap">
|
||||
{/* Overall status */}
|
||||
<Flex align="center" gap="2">
|
||||
{uptime === null || loading ? (
|
||||
<Badge color="gray" variant="soft">
|
||||
<Icon icon="lucide:loader-2" width="10" height="10" className="animate-spin" />
|
||||
{t("server.probeChecking")}
|
||||
</Badge>
|
||||
) : uptime === 100 ? (
|
||||
<Badge color="green" variant="soft">
|
||||
<motion.span
|
||||
animate={{ opacity: [1, 0.4, 1] }}
|
||||
transition={{ repeat: Infinity, duration: 2, ease: "easeInOut" }}
|
||||
style={{ display: "flex", alignItems: "center" }}
|
||||
>
|
||||
<Icon icon="lucide:circle" width="8" height="8" />
|
||||
</motion.span>
|
||||
{t("server.probeNormal")}
|
||||
</Badge>
|
||||
) : uptime >= 80 ? (
|
||||
<Badge color="amber" variant="soft">
|
||||
<Icon icon="lucide:alert-circle" width="10" height="10" />
|
||||
{t("server.probePartial")}
|
||||
</Badge>
|
||||
) : (
|
||||
<Badge color="red" variant="soft">
|
||||
<Icon icon="lucide:x-circle" width="10" height="10" />
|
||||
{t("server.probeOutage")}
|
||||
</Badge>
|
||||
)}
|
||||
</Flex>
|
||||
|
||||
{/* Divider */}
|
||||
<div style={{ width: 1, height: 16, background: "var(--gray-5)" }} />
|
||||
|
||||
{/* Uptime */}
|
||||
{uptime !== null && (
|
||||
<Flex direction="column" gap="0">
|
||||
<Text size="1" color="gray">{t("server.probeUptime")}</Text>
|
||||
<Text size="2" weight="bold" color={uptimeColor}>
|
||||
{uptime.toFixed(1)}%
|
||||
</Text>
|
||||
</Flex>
|
||||
)}
|
||||
|
||||
{/* Avg latency */}
|
||||
{avgLatency !== null && (
|
||||
<Flex direction="column" gap="0">
|
||||
<Text size="1" color="gray">{t("server.probeAvgLatency")}</Text>
|
||||
<Text size="2" weight="bold">{avgLatency}ms</Text>
|
||||
</Flex>
|
||||
)}
|
||||
|
||||
{/* Peak latency */}
|
||||
{maxLatency !== null && (
|
||||
<Flex direction="column" gap="0">
|
||||
<Text size="1" color="gray">{t("server.probePeakLatency")}</Text>
|
||||
<Text size="2" weight="bold" color={maxLatency > 150 ? "red" : maxLatency > 50 ? "amber" : undefined}>
|
||||
{maxLatency}ms
|
||||
</Text>
|
||||
</Flex>
|
||||
)}
|
||||
</Flex>
|
||||
|
||||
{/* Bar grid */}
|
||||
<Flex
|
||||
gap="1"
|
||||
align="end"
|
||||
style={{ height: 44, position: "relative" }}
|
||||
>
|
||||
{loading
|
||||
? Array.from({ length: BUCKETS }).map((_, i) => (
|
||||
<motion.div
|
||||
key={i}
|
||||
animate={{ opacity: [0.3, 0.6, 0.3] }}
|
||||
transition={{
|
||||
repeat: Infinity,
|
||||
duration: 1.2,
|
||||
delay: i * 0.04,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
style={{
|
||||
flex: 1,
|
||||
height: 28 + Math.sin(i * 0.5) * 8,
|
||||
borderRadius: 4,
|
||||
background: "var(--gray-4)",
|
||||
}}
|
||||
/>
|
||||
))
|
||||
: buckets.map((b, i) => {
|
||||
const isLast = i === lastActiveIdx;
|
||||
return (
|
||||
<Tooltip key={`${animKey}-${i}`} content={bucketLabel(b, t("server.probeNoData"), t("server.probeUnreachable"))}>
|
||||
<motion.div
|
||||
key={animKey}
|
||||
initial={{ scaleY: 0, opacity: 0 }}
|
||||
animate={{ scaleY: 1, opacity: b.avg === null ? 0.35 : 1 }}
|
||||
transition={{
|
||||
delay: i * 0.018,
|
||||
duration: 0.35,
|
||||
ease: [0.34, 1.56, 0.64, 1], // spring-like
|
||||
}}
|
||||
whileHover={{
|
||||
scaleY: 1.18,
|
||||
filter: "brightness(1.25)",
|
||||
transition: { duration: 0.12 },
|
||||
}}
|
||||
style={{
|
||||
flex: 1,
|
||||
height: 36,
|
||||
borderRadius: 4,
|
||||
background: bucketGradient(b.avg),
|
||||
boxShadow: isLast ? bucketGlow(b.avg) : "none",
|
||||
transformOrigin: "bottom",
|
||||
cursor: "default",
|
||||
position: "relative",
|
||||
overflow: "hidden",
|
||||
}}
|
||||
>
|
||||
{/* Shine overlay */}
|
||||
<div
|
||||
style={{
|
||||
position: "absolute",
|
||||
inset: 0,
|
||||
background:
|
||||
"linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, transparent 60%)",
|
||||
borderRadius: 4,
|
||||
pointerEvents: "none",
|
||||
}}
|
||||
/>
|
||||
{/* Pulse on latest active bar */}
|
||||
{isLast && b.avg !== null && (
|
||||
<motion.div
|
||||
animate={{ opacity: [0, 0.4, 0] }}
|
||||
transition={{
|
||||
repeat: Infinity,
|
||||
duration: 2,
|
||||
ease: "easeInOut",
|
||||
}}
|
||||
style={{
|
||||
position: "absolute",
|
||||
inset: 0,
|
||||
background: "rgba(255,255,255,0.5)",
|
||||
borderRadius: 4,
|
||||
pointerEvents: "none",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</motion.div>
|
||||
</Tooltip>
|
||||
);
|
||||
})}
|
||||
</Flex>
|
||||
|
||||
{/* Time labels */}
|
||||
<Flex justify="between" align="center">
|
||||
<Text size="1" color="gray">{t("server.probe30mAgo")}</Text>
|
||||
<Flex align="center" gap="2">
|
||||
<motion.div
|
||||
animate={{ opacity: [1, 0.3, 1] }}
|
||||
transition={{ repeat: Infinity, duration: 2, ease: "easeInOut" }}
|
||||
style={{ width: 6, height: 6, borderRadius: "50%", background: "var(--green-9)" }}
|
||||
/>
|
||||
<Text size="1" color="gray">{t("server.probeNow")}</Text>
|
||||
</Flex>
|
||||
</Flex>
|
||||
</Flex>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
import { Flex } from "@radix-ui/themes";
|
||||
import { Icon } from "@iconify/react";
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
|
||||
export interface RadioCardOption {
|
||||
value: string;
|
||||
label: string;
|
||||
icon?: string;
|
||||
comingSoon?: boolean;
|
||||
incompatible?: boolean;
|
||||
incompatibleLabel?: string;
|
||||
}
|
||||
|
||||
interface RadioCardGroupProps {
|
||||
options: RadioCardOption[];
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
comingSoonLabel?: string;
|
||||
}
|
||||
|
||||
export function RadioCardGroup({ options, value, onChange, comingSoonLabel = "Coming soon" }: RadioCardGroupProps) {
|
||||
return (
|
||||
<Flex gap="2" wrap="wrap">
|
||||
{options.map((opt) => {
|
||||
const isActive = value === opt.value;
|
||||
const disabled = !!opt.comingSoon || !!opt.incompatible;
|
||||
return (
|
||||
<button
|
||||
key={opt.value}
|
||||
type="button"
|
||||
disabled={disabled}
|
||||
onClick={() => !disabled && onChange(opt.value)}
|
||||
className={`box-border rounded-lg border-2 px-3 py-2 transition-colors duration-200 outline-none
|
||||
${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"}
|
||||
${isActive ? "border-[var(--accent-9)] bg-[var(--accent-3)]" : "border-[var(--gray-5)] bg-[var(--gray-2)] hover:border-[var(--gray-7)]"}
|
||||
`}
|
||||
>
|
||||
<Flex align="center" gap="2">
|
||||
{/* Selection dot */}
|
||||
<div className="relative flex h-3 w-3 shrink-0 items-center justify-center">
|
||||
<div className={`h-3 w-3 rounded-full border-2 transition-colors duration-200 ${isActive ? "border-[var(--accent-9)]" : "border-[var(--gray-7)]"}`} />
|
||||
<AnimatePresence>
|
||||
{isActive && (
|
||||
<motion.div
|
||||
key="dot"
|
||||
initial={{ scale: 0 }}
|
||||
animate={{ scale: 1 }}
|
||||
exit={{ scale: 0 }}
|
||||
transition={{ duration: 0.15, ease: "easeOut" }}
|
||||
className="absolute h-1.5 w-1.5 rounded-full bg-[var(--accent-9)]"
|
||||
/>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
|
||||
{/* Icon */}
|
||||
{opt.icon && (
|
||||
<Icon
|
||||
icon={opt.icon}
|
||||
width="14"
|
||||
height="14"
|
||||
color={isActive ? "var(--accent-9)" : "var(--gray-9)"}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Label — bold ghost reserves width to prevent jitter */}
|
||||
<span className="relative">
|
||||
<span aria-hidden className="invisible block h-0 font-bold">{opt.label}</span>
|
||||
<span className={`block ${isActive ? "font-bold text-[var(--accent-11)]" : "font-normal text-[var(--gray-11)]"}`}>
|
||||
{opt.label}
|
||||
</span>
|
||||
</span>
|
||||
|
||||
{/* Badges */}
|
||||
{opt.comingSoon && (
|
||||
<span className="rounded bg-[var(--gray-4)] px-1 py-0.5 text-[10px] text-[var(--gray-9)]">
|
||||
{comingSoonLabel}
|
||||
</span>
|
||||
)}
|
||||
{opt.incompatible && opt.incompatibleLabel && (
|
||||
<span className="rounded bg-[var(--amber-3)] px-1 py-0.5 text-[10px] text-[var(--amber-11)]">
|
||||
{opt.incompatibleLabel}
|
||||
</span>
|
||||
)}
|
||||
</Flex>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</Flex>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import { Icon } from "@iconify/react";
|
||||
import { Box, Flex, Text } from "@radix-ui/themes";
|
||||
|
||||
interface SectionHeadingProps {
|
||||
id: string;
|
||||
title: string;
|
||||
icon: string;
|
||||
}
|
||||
|
||||
export function SectionHeading({ id, title, icon }: SectionHeadingProps) {
|
||||
return (
|
||||
<div id={id} style={{ scrollMarginTop: 24 }}>
|
||||
<Flex align="center" gap="2" mb="4">
|
||||
<Box
|
||||
style={{
|
||||
background: "linear-gradient(135deg, var(--accent-9), var(--accent-10))",
|
||||
borderRadius: 8,
|
||||
padding: "6px",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
flexShrink: 0,
|
||||
}}
|
||||
>
|
||||
<Icon icon={icon} width="16" height="16" color="white" />
|
||||
</Box>
|
||||
<Text size="4" weight="bold">
|
||||
{title}
|
||||
</Text>
|
||||
</Flex>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { Box, Button, Flex, Heading, Text } from "@radix-ui/themes";
|
||||
import { Icon } from "@iconify/react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import pb from "../lib/pocketbase";
|
||||
|
||||
interface ServerLogViewerProps {
|
||||
serverId: string;
|
||||
/** Height of the scrollable log area. Defaults to 300px. */
|
||||
height?: number | string;
|
||||
/** Whether to show the card heading. Defaults to true. */
|
||||
showHeading?: boolean;
|
||||
}
|
||||
|
||||
export function ServerLogViewer({ serverId, height = 300, showHeading = true }: ServerLogViewerProps) {
|
||||
const { t } = useTranslation();
|
||||
const [logs, setLogs] = useState<string[]>([]);
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// SSE log streaming
|
||||
useEffect(() => {
|
||||
const token = pb.authStore.token;
|
||||
const es = new EventSource(`/api/frpc/logs/stream?id=${serverId}&token=${token}`);
|
||||
|
||||
const MAX_LOGS = 500;
|
||||
es.onmessage = (event) => {
|
||||
setLogs((prev) => {
|
||||
const next = [...prev, event.data];
|
||||
return next.length > MAX_LOGS ? next.slice(next.length - MAX_LOGS) : next;
|
||||
});
|
||||
};
|
||||
|
||||
es.onerror = () => {
|
||||
es.close();
|
||||
};
|
||||
|
||||
return () => {
|
||||
es.close();
|
||||
};
|
||||
}, [serverId]);
|
||||
|
||||
// Auto-scroll to bottom on new logs
|
||||
useEffect(() => {
|
||||
if (containerRef.current) {
|
||||
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
||||
}
|
||||
}, [logs]);
|
||||
|
||||
return (
|
||||
<Flex direction="column" gap="3">
|
||||
{showHeading && (
|
||||
<Flex justify="between" align="center">
|
||||
<Heading size="4">{t("server.connectionLogs")}</Heading>
|
||||
<Button size="1" variant="soft" onClick={() => setLogs([])}>
|
||||
<Icon icon="lucide:trash-2" width="14" height="14" />
|
||||
{t("server.clear")}
|
||||
</Button>
|
||||
</Flex>
|
||||
)}
|
||||
|
||||
{!showHeading && (
|
||||
<Flex justify="end">
|
||||
<Button size="1" variant="soft" onClick={() => setLogs([])}>
|
||||
<Icon icon="lucide:trash-2" width="14" height="14" />
|
||||
{t("server.clear")}
|
||||
</Button>
|
||||
</Flex>
|
||||
)}
|
||||
|
||||
<Box
|
||||
ref={containerRef}
|
||||
style={{
|
||||
backgroundColor: "var(--gray-2)",
|
||||
borderRadius: "var(--radius-3)",
|
||||
padding: "1rem",
|
||||
fontFamily: "monospace",
|
||||
fontSize: "0.9rem",
|
||||
height,
|
||||
overflowY: "auto",
|
||||
}}
|
||||
>
|
||||
{logs.length > 0 ? (
|
||||
logs.map((log, index) => (
|
||||
<div key={index} style={{ marginBottom: "4px" }}>
|
||||
<Text color="gray">{log}</Text>
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<Text color="gray" style={{ fontStyle: "italic" }}>
|
||||
{t("server.noLogsAvailable")}
|
||||
</Text>
|
||||
)}
|
||||
</Box>
|
||||
</Flex>
|
||||
);
|
||||
}
|
||||
@@ -1,38 +1,78 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
/* Status Indicator Dot Animation */
|
||||
@keyframes status-blink {
|
||||
0%,
|
||||
100% {
|
||||
/* Remove focus outline on all recharts SVG surfaces */
|
||||
.recharts-surface,
|
||||
.recharts-legend-wrapper,
|
||||
.recharts-legend-wrapper * {
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
/* Status Indicator Dot — Green pulse (online) */
|
||||
@keyframes status-pulse-green {
|
||||
0% {
|
||||
box-shadow: 0 0 0 0 var(--green-a7), 0 0 6px var(--green-a8);
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
60% {
|
||||
box-shadow: 0 0 0 6px transparent, 0 0 10px var(--green-a6);
|
||||
opacity: 0.85;
|
||||
transform: scale(1.15);
|
||||
}
|
||||
100% {
|
||||
box-shadow: 0 0 0 0 transparent, 0 0 6px var(--green-a8);
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Status Indicator Dot — Red blink (offline) */
|
||||
@keyframes status-blink-red {
|
||||
0%,
|
||||
100% {
|
||||
opacity: 1;
|
||||
box-shadow: 0 0 6px var(--red-a8);
|
||||
}
|
||||
50% {
|
||||
opacity: 0.25;
|
||||
box-shadow: 0 0 2px var(--red-a5);
|
||||
}
|
||||
}
|
||||
|
||||
/* Status Indicator Dot — Gray (unknown) */
|
||||
@keyframes status-blink-gray {
|
||||
0%,
|
||||
100% {
|
||||
opacity: 0.7;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.3;
|
||||
transform: scale(0.85);
|
||||
}
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
border-radius: 50%;
|
||||
margin-right: 6px;
|
||||
animation: status-blink 2s ease-in-out infinite;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.status-dot-green {
|
||||
background-color: var(--green-9);
|
||||
box-shadow: 0 0 8px var(--green-a7);
|
||||
box-shadow: 0 0 6px var(--green-a8);
|
||||
animation: status-pulse-green 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.status-dot-red {
|
||||
background-color: var(--red-9);
|
||||
box-shadow: 0 0 8px var(--red-a7);
|
||||
box-shadow: 0 0 6px var(--red-a8);
|
||||
animation: status-blink-red 1.6s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.status-dot-gray {
|
||||
background-color: var(--gray-9);
|
||||
box-shadow: 0 0 8px var(--gray-a7);
|
||||
box-shadow: 0 0 4px var(--gray-a7);
|
||||
animation: status-blink-gray 2.5s ease-in-out infinite;
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import { motion, AnimatePresence } from "framer-motion";
|
||||
import { PageTransition } from "../components/PageTransition";
|
||||
import { ThemeToggle } from "../components/ThemeToggle";
|
||||
import { LanguageToggle } from "../components/LanguageToggle";
|
||||
import logo from "../assets/logo.png";
|
||||
import logo from "../assets/logo.svg";
|
||||
import { Icon } from "@iconify/react";
|
||||
|
||||
interface MainLayoutProps {
|
||||
@@ -83,6 +83,7 @@ export function MainLayout({ children }: MainLayoutProps) {
|
||||
const [appVersion, setAppVersion] = useState<string>("");
|
||||
const [latestVersion, setLatestVersion] = useState<string>("");
|
||||
const [releaseUrl, setReleaseUrl] = useState<string>("");
|
||||
const [releaseBody, setReleaseBody] = useState<string>("");
|
||||
const updateAvailable = appVersion && latestVersion ? isNewerVersion(latestVersion, appVersion) : false;
|
||||
|
||||
useEffect(() => {
|
||||
@@ -96,6 +97,7 @@ export function MainLayout({ children }: MainLayoutProps) {
|
||||
.then((data) => {
|
||||
if (data.tag_name) setLatestVersion(data.tag_name);
|
||||
if (data.html_url) setReleaseUrl(data.html_url);
|
||||
if (data.body) setReleaseBody(data.body);
|
||||
})
|
||||
.catch(() => {});
|
||||
}, []);
|
||||
@@ -142,11 +144,11 @@ export function MainLayout({ children }: MainLayoutProps) {
|
||||
whileHover={{ scale: 1.1, rotate: 10 }}
|
||||
whileTap={{ scale: 0.95 }}
|
||||
src={logo}
|
||||
alt="Frpc Hub Logo"
|
||||
alt="Podux Logo"
|
||||
className="h-8 w-8 cursor-pointer rounded-2xl object-contain"
|
||||
/>
|
||||
<Text size="4" weight="bold">
|
||||
Frpc Hub
|
||||
Podux
|
||||
</Text>
|
||||
</Flex>
|
||||
</Link>
|
||||
@@ -222,7 +224,7 @@ export function MainLayout({ children }: MainLayoutProps) {
|
||||
/>
|
||||
</motion.div>
|
||||
</Popover.Trigger>
|
||||
<Popover.Content style={{ maxWidth: 280 }}>
|
||||
<Popover.Content style={{ maxWidth: 320 }}>
|
||||
<Flex direction="column" gap="3">
|
||||
<Flex align="center" gap="2">
|
||||
<Icon icon="lucide:package" width="16" height="16" style={{ color: "var(--amber-11)" }} />
|
||||
@@ -240,6 +242,24 @@ export function MainLayout({ children }: MainLayoutProps) {
|
||||
<Text size="1" weight="medium" style={{ color: "var(--amber-11)" }}>{latestVersion}</Text>
|
||||
</Flex>
|
||||
</Flex>
|
||||
{releaseBody && (
|
||||
<Flex direction="column" gap="1">
|
||||
<Text size="1" color="gray" weight="medium">{t("version.releaseNotes")}</Text>
|
||||
<Box
|
||||
style={{
|
||||
maxHeight: 160,
|
||||
overflowY: "auto",
|
||||
backgroundColor: "var(--gray-a2)",
|
||||
borderRadius: "var(--radius-2)",
|
||||
padding: "8px",
|
||||
}}
|
||||
>
|
||||
<Text size="1" style={{ whiteSpace: "pre-wrap", wordBreak: "break-word" }}>
|
||||
{releaseBody}
|
||||
</Text>
|
||||
</Box>
|
||||
</Flex>
|
||||
)}
|
||||
{releaseUrl && (
|
||||
<a href={releaseUrl} target="_blank" rel="noopener noreferrer" className="no-underline">
|
||||
<Flex
|
||||
@@ -342,7 +362,7 @@ export function MainLayout({ children }: MainLayoutProps) {
|
||||
{/* Left: Copyright */}
|
||||
<Flex align="center" gap="2">
|
||||
<Text size="1" color="gray">
|
||||
© 2026 Frpc Hub. All rights reserved.
|
||||
© 2026 Podux. All rights reserved.
|
||||
</Text>
|
||||
</Flex>
|
||||
|
||||
@@ -398,7 +418,7 @@ export function MainLayout({ children }: MainLayoutProps) {
|
||||
{/* Right: Links */}
|
||||
<Flex align="center" gap="4">
|
||||
<a
|
||||
href="https://github.com/luckjiawei/frpc-hub"
|
||||
href="https://github.com/luckjiawei/podux"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="no-underline"
|
||||
@@ -409,7 +429,7 @@ export function MainLayout({ children }: MainLayoutProps) {
|
||||
className="text-gray-500 transition-colors hover:text-gray-700"
|
||||
>
|
||||
<Icon icon="lucide:github" width="16" height="16" />
|
||||
<Text size="1">Frpc Hub</Text>
|
||||
<Text size="1">Podux</Text>
|
||||
</Flex>
|
||||
</a>
|
||||
</Flex>
|
||||
|
||||