Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Local agent instructions
AGENT.md
AGENTS.md
agent.md
agents.md
CLAUDE.md
claude.md
BRANCH_STRATEGY.md
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,36 @@ bash <(curl -fsSL https://raw.githubusercontent.com/perfect-panel/ppanel-script/
bash <(wget -qO- https://raw.githubusercontent.com/perfect-panel/ppanel-script/refs/heads/main/install.sh)
```

### Local Telepresence Workflow

Use [`telepresence.sh`](./telepresence.sh) with Telepresence-style dev domains to switch traffic to a local frontend or local backend.

```bash
VITE_ALLOWED_HOSTS=.home.arpa \
VITE_DEVTOOLS_PORT=42170 \
./telepresence.sh up frontend --frontend user
```

- `up frontend`: route traffic to a local frontend while keeping the k3s backend
- `up server`: route traffic to a local backend while keeping shared MySQL / Redis
- `up both`: route traffic to both a local frontend and a local backend while still using shared MySQL / Redis

By default the script connects to shared dependencies through `host.docker.internal:13306` and `host.docker.internal:16379`.
The script uses Telepresence to connect to the `ppanel-dev` namespace and create intercepts for the frontend or backend workloads.

If you want to make the shared dependency targets explicit, pass them through CLI options instead of environment variables, for example:

```bash
./telepresence.sh up server \
--mysql-host host.docker.internal \
--mysql-port 13306 \
--mysql-database ppanel_dev \
--mysql-user root \
--mysql-password dev-root-password \
--redis-host host.docker.internal \
--redis-port 16379
```

If the cluster does not have a Telepresence `traffic-manager` yet, append `--install-traffic-manager` on the first run.

The script assumes `ppanel-script`, `ppanel-frontend`, and `ppanel-server` live as sibling directories.
33 changes: 33 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,36 @@ bash <(curl -fsSL https://raw.githubusercontent.com/perfect-panel/ppanel-script/
bash <(wget -qO- https://raw.githubusercontent.com/perfect-panel/ppanel-script/refs/heads/main/install.sh)
```

## 本地 Telepresence 联调

使用 [`telepresence.sh`](./telepresence.sh) 配合 Telepresence 风格的开发域名切换本地前端或本地后端。

```sh
VITE_ALLOWED_HOSTS=.home.arpa \
VITE_DEVTOOLS_PORT=42170 \
./telepresence.sh up frontend --frontend user
```

- `up frontend`:切到本地前端,后端继续使用 k3s 中的部署
- `up server`:切到本地后端,依赖继续使用共享的 MySQL / Redis
- `up both`:前后端都切到本地;依赖仍使用共享的 MySQL / Redis

默认会通过 `host.docker.internal:13306` 和 `host.docker.internal:16379` 连接共享依赖。
脚本会使用 Telepresence 连接 `ppanel-dev` 命名空间,并为前端或后端创建 intercept。

如果要显式指定共享依赖,请直接通过命令行参数传入,而不是依赖环境变量,例如:

```sh
./telepresence.sh up server \
--mysql-host host.docker.internal \
--mysql-port 13306 \
--mysql-database ppanel_dev \
--mysql-user root \
--mysql-password dev-root-password \
--redis-host host.docker.internal \
--redis-port 16379
```

如果集群里还没有安装 Telepresence `traffic-manager`,可以在首次执行时追加 `--install-traffic-manager`。

脚本默认假设 `ppanel-script`、`ppanel-frontend`、`ppanel-server` 是同级目录。
Loading