feat: machine mode, PEM-only certs, ECH support, multi-instance config, batch ops, xbctl
This commit is contained in:
@@ -1,65 +1,75 @@
|
||||
# xboard-node
|
||||
|
||||
Dedicated node backend for [Xboard](https://github.com/cedar2025/Xboard). Fully compatible with Xboard API.
|
||||
Node backend for [Xboard](https://github.com/cedar2025/Xboard). Supports `sing-box` / `xray-core` dual kernels.
|
||||
|
||||
> **Disclaimer**: This project is for educational and learning purposes only.
|
||||
|
||||
## Overview
|
||||
## Features
|
||||
|
||||
| Item | Description |
|
||||
| --- | --- |
|
||||
| Role | Xboard-compatible node backend |
|
||||
| Kernels | `sing-box` (default), `xray-core` |
|
||||
| Protocols | V2Ray family, Trojan, Shadowsocks, Hysteria2, TUIC, Naive |
|
||||
| Modes | Panel-managed mode, `standalone` mode |
|
||||
| Sync | WebSocket push, REST polling/report fallback |
|
||||
| User controls | Per-user speed limit, device limit, alive IP tracking |
|
||||
| Runtime ops | Hot user add/remove/update |
|
||||
| Reporting | Traffic, online/alive-IP state, CPU, memory, swap, disk, connection count |
|
||||
| Deployment | Single Go service, Docker, Docker Compose |
|
||||
- Protocols: V2Ray family, Trojan, Shadowsocks, Hysteria2, TUIC, AnyTLS
|
||||
- Sync: WebSocket push + REST polling dual channel
|
||||
- User controls: speed limit, device limit, alive-IP tracking, hot update
|
||||
- Deploy modes: node mode, machine mode, standalone mode
|
||||
- Multi-instance: single process binding multiple panels / nodes
|
||||
|
||||
## Install
|
||||
|
||||
### Docker
|
||||
|
||||
```bash
|
||||
docker run -d --restart=always --network=host \
|
||||
-e apiHost=https://panel.com \
|
||||
-e apiKey=TOKEN \
|
||||
-e nodeID=1 \
|
||||
-e apiHost=https://panel.com -e apiKey=TOKEN -e nodeID=1 \
|
||||
ghcr.io/cedar2025/xboard-node:latest
|
||||
```
|
||||
|
||||
### Docker Compose
|
||||
|
||||
**1. Get the `compose/` directory**
|
||||
|
||||
```bash
|
||||
git clone -b compose --depth 1 https://github.com/cedar2025/xboard-node.git
|
||||
cd xboard-node
|
||||
```
|
||||
|
||||
**2. Edit local config**
|
||||
|
||||
```bash
|
||||
vim config/config.yml
|
||||
# edit config/config.yml — set panel.url, panel.token, panel.node_id
|
||||
```
|
||||
|
||||
**3. Start**
|
||||
|
||||
```bash
|
||||
vim config/config.yml # set panel.url / token / node_id
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### Installer (Linux systemd)
|
||||
|
||||
```bash
|
||||
# Node mode
|
||||
curl -fsSL https://raw.githubusercontent.com/cedar2025/xboard-node/dev/install.sh | \
|
||||
sudo bash -s -- --mode node --panel https://panel.example.com --token TOKEN --node-id 1
|
||||
|
||||
# Machine mode
|
||||
curl -fsSL https://raw.githubusercontent.com/cedar2025/xboard-node/dev/install.sh | \
|
||||
sudo bash -s -- --mode machine --panel https://panel.example.com --token TOKEN --machine-id 1
|
||||
|
||||
# Run again with another --panel to append a binding. No manual instance management needed.
|
||||
# Upgrade
|
||||
curl -fsSL .../install.sh | sudo bash -s -- upgrade
|
||||
# Uninstall
|
||||
curl -fsSL .../install.sh | sudo bash -s -- uninstall --purge --yes
|
||||
```
|
||||
|
||||
## xbctl
|
||||
|
||||
Run `xbctl` after installation for help. Common commands:
|
||||
|
||||
```bash
|
||||
xbctl list # list all instances
|
||||
xbctl status # running status
|
||||
xbctl bind add-node --panel URL --token TOKEN --node-id 1
|
||||
xbctl bind add-machine --panel URL --token TOKEN --machine-id 1
|
||||
xbctl bind remove-node --panel URL --node-id 1
|
||||
xbctl service restart
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
`config.yml`:
|
||||
```yaml
|
||||
panel:
|
||||
url: "https://panel.com"
|
||||
token: "token"
|
||||
node_id: 1
|
||||
```
|
||||
Legacy single-panel config is fully compatible. Appending bindings auto-migrates to `instances` format. See `config.yml.example`.
|
||||
|
||||
## Extensions
|
||||
|
||||
- Custom routes: [docs-custom-routes.md](docs-custom-routes.md)
|
||||
- Custom outbounds: [docs-custom-outbounds.md](docs-custom-outbounds.md)
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user