update docs

This commit is contained in:
xboard
2025-01-22 21:01:18 +08:00
parent 56890364fc
commit 25c71c60ac
28 changed files with 770 additions and 1173 deletions
+2 -2
View File
@@ -71,7 +71,7 @@ git clone -b compose --depth 1 https://github.com/cedar2025/Xboard ./
```yaml
services:
web:
image: ghcr.io/cedar2025/xboard:latest
image: ghcr.io/cedar2025/xboard:new
volumes:
- ./.docker/.data/redis/:/data/
- ./.env:/www/.env
@@ -90,7 +90,7 @@ services:
- 1panel-network
horizon:
image: ghcr.io/cedar2025/xboard:latest
image: ghcr.io/cedar2025/xboard:new
volumes:
- ./.docker/.data/redis/:/data/
- ./.env:/www/.env
+137
View File
@@ -0,0 +1,137 @@
# Xboard Deployment Guide for aaPanel + Docker Environment
## Table of Contents
1. [Requirements](#requirements)
2. [Quick Deployment](#quick-deployment)
3. [Detailed Configuration](#detailed-configuration)
4. [Maintenance Guide](#maintenance-guide)
5. [Troubleshooting](#troubleshooting)
## Requirements
### Hardware Requirements
- CPU: 1 core or above
- Memory: 2GB or above
- Storage: 10GB+ available space
### Software Requirements
- Operating System: Ubuntu 20.04+ / CentOS 7+ / Debian 10+
- Latest version of aaPanel
- Docker and Docker Compose
- Nginx (any version)
- MySQL 5.7+
## Quick Deployment
### 1. Install aaPanel
```bash
curl -sSL https://www.aapanel.com/script/install_6.0_en.sh -o install_6.0_en.sh && \
bash install_6.0_en.sh aapanel
```
### 2. Basic Environment Setup
#### 2.1 Install Docker
```bash
# Install Docker
curl -sSL https://get.docker.com | bash
# For CentOS systems, also run:
systemctl enable docker
systemctl start docker
```
#### 2.2 Install Required Components
In the aaPanel dashboard, install:
- Nginx (any version)
- MySQL 5.7
- ⚠️ PHP and Redis are not required
### 3. Site Configuration
#### 3.1 Create Website
1. Navigate to: aaPanel > Website > Add site
2. Fill in the information:
- Domain: Enter your site domain
- Database: Select MySQL
- PHP Version: Select Pure Static
#### 3.2 Deploy Xboard
```bash
# Enter site directory
cd /www/wwwroot/your-domain
# Clean directory
chattr -i .user.ini
rm -rf .htaccess 404.html 502.html index.html .user.ini
# Clone repository
git clone https://github.com/cedar2025/Xboard.git ./
# Prepare configuration file
cp compose.sample.yaml compose.yaml
# Install dependencies and initialize
docker compose run -it --rm web sh init.sh
```
> ⚠️ Please save the admin dashboard URL, username, and password shown after installation
#### 3.3 Start Services
```bash
docker compose up -d
```
#### 3.4 Configure Reverse Proxy
Add the following content to your site configuration:
```nginx
location / {
proxy_pass http://127.0.0.1:7001;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header Server-Protocol $server_protocol;
proxy_set_header Server-Name $server_name;
proxy_set_header Server-Addr $server_addr;
proxy_set_header Server-Port $server_port;
proxy_cache off;
}
```
## Maintenance Guide
### Version Updates
> 💡 Important Note: Update commands may vary depending on your installed version:
> - For recent installations (new version), use:
```bash
docker compose pull && \
docker compose run -it --rm web sh update.sh && \
docker compose up -d
```
> - For older installations, replace `web` with `xboard`:
```bash
git config --global --add safe.directory $(pwd)
git fetch --all && git reset --hard origin/master && git pull origin master
docker compose pull && \
docker compose run -it --rm xboard sh update.sh && \
docker compose up -d
```
> 🤔 Not sure which to use? Try the new version command first, if it fails, use the old version command.
### Routine Maintenance
- Regular log checking: `docker compose logs`
- Monitor system resource usage
- Regular backup of database and configuration files
## Troubleshooting
If you encounter any issues during installation or operation, please check:
1. System requirements are met
2. All required ports are available
3. Docker services are running properly
4. Nginx configuration is correct
5. Check logs for detailed error messages
+173
View File
@@ -0,0 +1,173 @@
# Xboard Deployment Guide for aaPanel Environment
## Table of Contents
1. [Requirements](#requirements)
2. [Quick Deployment](#quick-deployment)
3. [Detailed Configuration](#detailed-configuration)
4. [Maintenance Guide](#maintenance-guide)
5. [Troubleshooting](#troubleshooting)
## Requirements
### Hardware Requirements
- CPU: 1 core or above
- Memory: 2GB or above
- Storage: 10GB+ available space
### Software Requirements
- Operating System: Ubuntu 20.04+ / Debian 10+ (⚠️ CentOS 7 is not recommended)
- Latest version of aaPanel
- PHP 8.2
- MySQL 5.7+
- Redis
- Nginx (any version)
## Quick Deployment
### 1. Install aaPanel
```bash
URL=https://www.aapanel.com/script/install_6.0_en.sh && \
if [ -f /usr/bin/curl ];then curl -ksSO "$URL" ;else wget --no-check-certificate -O install_6.0_en.sh "$URL";fi && \
bash install_6.0_en.sh aapanel
```
### 2. Basic Environment Setup
#### 2.1 Install LNMP Environment
In the aaPanel dashboard, install:
- Nginx (any version)
- MySQL 5.7
- PHP 8.2
#### 2.2 Install PHP Extensions
Required PHP extensions:
- redis
- fileinfo
- swoole4
- readline
- event
#### 2.3 Enable Required PHP Functions
Functions that need to be enabled:
- putenv
- proc_open
- pcntl_alarm
- pcntl_signal
### 3. Site Configuration
#### 3.1 Create Website
1. Navigate to: aaPanel > Website > Add site
2. Fill in the information:
- Domain: Enter your site domain
- Database: Select MySQL
- PHP Version: Select 8.2
#### 3.2 Deploy Xboard
```bash
# Enter site directory
cd /www/wwwroot/your-domain
# Clean directory
chattr -i .user.ini
rm -rf .htaccess 404.html 502.html index.html .user.ini
# Clone repository
git clone https://github.com/cedar2025/Xboard.git ./
# Install dependencies
sh init.sh
```
#### 3.3 Configure Site
1. Set running directory to `/public`
2. Add rewrite rules:
```nginx
location /downloads {
}
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
location ~ .*\.(js|css)?$
{
expires 1h;
error_log off;
access_log /dev/null;
}
```
## Detailed Configuration
### 1. Configure Daemon Process
1. Install Supervisor
2. Add queue daemon process:
- Name: `Xboard`
- Run User: `www`
- Running Directory: Site directory
- Start Command: `php artisan horizon`
- Process Count: 1
### 2. Configure Scheduled Tasks
- Type: Shell Script
- Task Name: v2board
- Frequency: 1 minute
- Script Content: `php /www/wwwroot/site-directory/artisan schedule:run`
### 3. Octane Configuration (Optional)
#### 3.1 Add Octane Daemon Process
- Name: Octane
- Run User: www
- Running Directory: Site directory
- Start Command: `/www/server/php/81/bin/php artisan octane:start --port 7010`
- Process Count: 1
#### 3.2 Octane-specific Rewrite Rules
```nginx
location ~* \.(jpg|jpeg|png|gif|js|css|svg|woff2|woff|ttf|eot|wasm|json|ico)$ {
}
location ~ .* {
proxy_pass http://127.0.0.1:7010;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header Server-Protocol $server_protocol;
proxy_set_header Server-Name $server_name;
proxy_set_header Server-Addr $server_addr;
proxy_set_header Server-Port $server_port;
}
```
## Maintenance Guide
### Version Updates
```bash
# Enter site directory
cd /www/wwwroot/your-domain
# Execute update script
git fetch --all && git reset --hard origin/master && git pull origin master
sh update.sh
# If Octane is enabled, restart the daemon process
# aaPanel > App Store > Tools > Supervisor > Restart Octane
```
### Routine Maintenance
- Regular log checking
- Monitor system resource usage
- Regular backup of database and configuration files
## Troubleshooting
### Common Issues
1. Changes to admin path require service restart to take effect
2. Any code changes after enabling Octane require restart to take effect
3. When PHP extension installation fails, check if PHP version is correct
4. For database connection failures, check database configuration and permissions
+77
View File
@@ -0,0 +1,77 @@
# Quick Deployment Guide with Docker Compose
This guide explains how to quickly deploy Xboard using Docker Compose. By default, it uses SQLite database, eliminating the need for a separate MySQL installation.
### 1. Environment Preparation
Install Docker:
```bash
curl -sSL https://get.docker.com | bash
# For CentOS systems, also run:
systemctl enable docker
systemctl start docker
```
### 2. Deployment Steps
1. Get project files:
```bash
git clone -b compose --depth 1 https://github.com/cedar2025/Xboard
cd Xboard
```
2. Install database:
- Quick installation (Recommended for beginners)
```bash
docker compose run -it --rm \
-e ENABLE_SQLITE=true \
-e ENABLE_REDIS=true \
-e ADMIN_ACCOUNT=admin@demo.com \
web php artisan xboard:install
```
- Custom configuration installation (Advanced users)
```bash
docker compose run -it --rm web php artisan xboard:install
```
> Please save the admin dashboard URL, username, and password shown after installation
3. Start services:
```bash
docker compose up -d
```
4. Access the site:
- Default port: 7001
- Website URL: http://your-server-ip:7001
### 3. Version Updates
> 💡 Important Note: Update commands may vary depending on your installed version:
> - For recent installations (new version), use:
```bash
cd Xboard
docker compose pull && \
docker compose run -it --rm web php artisan xboard:update && \
docker compose up -d
```
> - For older installations, replace `web` with `xboard`:
```bash
cd Xboard
docker compose pull && \
docker compose run -it --rm xboard php artisan xboard:update && \
docker compose up -d
```
> 🤔 Not sure which to use? Try the new version command first, if it fails, use the old version command.
### 4. Version Rollback
1. Modify the version number in `docker-compose.yaml` to the version you want to roll back to
2. Execute: `docker compose up -d`
### Important Notes
- If you need to use MySQL, please install it separately and redeploy
- Code changes require service restart to take effect
- You can configure Nginx reverse proxy to use port 80
+54
View File
@@ -0,0 +1,54 @@
# Configuration Migration Guide
This guide explains how to migrate configuration files from v2board to Xboard. Xboard stores configurations in the database instead of files.
### 1. Docker Compose Environment
1. Prepare configuration file:
```bash
# Create config directory
mkdir config
# Copy old configuration file
cp old-project-path/config/v2board.php config/
```
2. Modify `docker-compose.yaml`, uncomment the following line:
```yaml
- ./config/v2board.php:/www/config/v2board.php
```
3. Execute migration:
```bash
docker compose run -it --rm web php artisan migrateFromV2b config
```
### 2. aaPanel Environment
1. Copy configuration file:
```bash
cp old-project-path/config/v2board.php config/v2board.php
```
2. Execute migration:
```bash
php artisan migrateFromV2b config
```
### 3. aaPanel + Docker Environment
1. Copy configuration file:
```bash
cp old-project-path/config/v2board.php config/v2board.php
```
2. Execute migration:
```bash
docker compose run -it --rm web php artisan migrateFromV2b config
```
### Important Notes
- After modifying the admin path, service restart is required:
- Docker environment: `docker compose restart`
- aaPanel environment: Restart the Octane daemon process
+63
View File
@@ -0,0 +1,63 @@
# V2board 1.7.3 Migration Guide
This guide explains how to migrate from V2board version 1.7.3 to Xboard.
### 1. Database Changes Overview
- `v2_stat_order` table renamed to `v2_stat`:
- `order_amount``order_total`
- `commission_amount``commission_total`
- New fields added:
- `paid_count` (integer, nullable)
- `paid_total` (integer, nullable)
- `register_count` (integer, nullable)
- `invite_count` (integer, nullable)
- `transfer_used_total` (string(32), nullable)
- New tables added:
- `v2_log`
- `v2_server_hysteria`
- `v2_server_vless`
### 2. Prerequisites
⚠️ Please complete the basic Xboard installation first (SQLite not supported):
- [Docker Compose Deployment](../installation/docker-compose.md)
- [aaPanel + Docker Deployment](../installation/aapanel-docker.md)
- [aaPanel Deployment](../installation/aapanel.md)
### 3. Migration Steps
#### Docker Environment
```bash
# 1. Stop services
docker compose down
# 2. Clear database
docker compose run -it --rm web php artisan db:wipe
# 3. Import old database (Important)
# Please manually import the V2board 1.7.3 database
# 4. Execute migration
docker compose run -it --rm web php artisan migratefromv2b 1.7.3
```
#### aaPanel Environment
```bash
# 1. Clear database
php artisan db:wipe
# 2. Import old database (Important)
# Please manually import the V2board 1.7.3 database
# 3. Execute migration
php artisan migratefromv2b 1.7.3
```
### 4. Configuration Migration
After completing the data migration, you need to migrate the configuration file:
- [Configuration Migration Guide](./config.md)
+51
View File
@@ -0,0 +1,51 @@
# V2board 1.7.4 Migration Guide
This guide explains how to migrate from V2board version 1.7.4 to Xboard.
### 1. Database Changes Overview
- New table added:
- `v2_server_vless`
### 2. Prerequisites
⚠️ Please complete the basic Xboard installation first (SQLite not supported):
- [Docker Compose Deployment](../installation/docker-compose.md)
- [aaPanel + Docker Deployment](../installation/aapanel-docker.md)
- [aaPanel Deployment](../installation/aapanel.md)
### 3. Migration Steps
#### Docker Environment
```bash
# 1. Stop services
docker compose down
# 2. Clear database
docker compose run -it --rm web php artisan db:wipe
# 3. Import old database (Important)
# Please manually import the V2board 1.7.4 database
# 4. Execute migration
docker compose run -it --rm web php artisan migratefromv2b 1.7.4
```
#### aaPanel Environment
```bash
# 1. Clear database
php artisan db:wipe
# 2. Import old database (Important)
# Please manually import the V2board 1.7.4 database
# 3. Execute migration
php artisan migratefromv2b 1.7.4
```
### 4. Configuration Migration
After completing the data migration, you need to migrate the configuration file:
- [Configuration Migration Guide](./config.md)
+61
View File
@@ -0,0 +1,61 @@
# V2board Dev Migration Guide
This guide explains how to migrate from V2board Dev version (2023/10/27) to Xboard.
⚠️ Please upgrade to version 2023/10/27 following the official guide before proceeding with migration.
### 1. Database Changes Overview
- `v2_order` table:
- Added `surplus_order_ids` (text, nullable) - Deduction orders
- `v2_plan` table:
- Removed `daily_unit_price` - Affects period value
- Removed `transfer_unit_price` - Affects traffic value
- `v2_server_hysteria` table:
- Removed `ignore_client_bandwidth` - Affects bandwidth configuration
- Removed `obfs_type` - Affects obfuscation type configuration
### 2. Prerequisites
⚠️ Please complete the basic Xboard installation first (SQLite not supported):
- [Docker Compose Deployment](../installation/docker-compose.md)
- [aaPanel + Docker Deployment](../installation/aapanel-docker.md)
- [aaPanel Deployment](../installation/aapanel.md)
### 3. Migration Steps
#### Docker Environment
```bash
# 1. Stop services
docker compose down
# 2. Clear database
docker compose run -it --rm web php artisan db:wipe
# 3. Import old database (Important)
# Please manually import the V2board Dev database
# 4. Execute migration
docker compose run -it --rm web php artisan migratefromv2b dev231027
```
#### aaPanel Environment
```bash
# 1. Clear database
php artisan db:wipe
# 2. Import old database (Important)
# Please manually import the V2board Dev database
# 3. Execute migration
php artisan migratefromv2b dev231027
```
### 4. Configuration Migration
After completing the data migration, you need to migrate the configuration file:
- [Configuration Migration Guide](./config.md)
+68
View File
@@ -0,0 +1,68 @@
# V2board wyx2685 Migration Guide
This guide explains how to migrate from V2board wyx2685 version (2023/11/17) to Xboard.
⚠️ Important migration notes:
- Device limitation feature will be lost
- Special Trojan features will be lost
- Hysteria2 routes need to be reconfigured
### 1. Database Changes Overview
- `v2_plan` table:
- Removed `device_limit` (nullable)
- `v2_server_hysteria` table:
- Removed `version`
- Removed `obfs`
- Removed `obfs_password`
- `v2_server_trojan` table:
- Removed `network`
- Removed `network_settings`
- `v2_user` table:
- Removed `device_limit`
### 2. Prerequisites
⚠️ Please complete the basic Xboard installation first (SQLite not supported):
- [Docker Compose Deployment](../installation/docker-compose.md)
- [aaPanel + Docker Deployment](../installation/aapanel-docker.md)
- [aaPanel Deployment](../installation/aapanel.md)
### 3. Migration Steps
#### Docker Environment
```bash
# 1. Stop services
docker compose down
# 2. Clear database
docker compose run -it --rm web php artisan db:wipe
# 3. Import old database (Important)
# Please manually import the V2board wyx2685 database
# 4. Execute migration
docker compose run -it --rm web php artisan migratefromv2b wyx2685
```
#### aaPanel Environment
```bash
# 1. Clear database
php artisan db:wipe
# 2. Import old database (Important)
# Please manually import the V2board wyx2685 database
# 3. Execute migration
php artisan migratefromv2b wyx2685
```
### 4. Configuration Migration
After completing the data migration, you need to migrate the configuration file:
- [Configuration Migration Guide](./config.md)
-59
View File
@@ -1,59 +0,0 @@
# 在线设备数限制
1. 在订阅上添加客户端连接数限制
2. 用户订阅的时候将客户端限制附加到用户表字段上
3. 后端获取用户信息的时候增加客户端显示字段显示
4. 获取在线用户IP,判断是否达到了限制数量,当达到了限制IP数量拒绝新的IP连接 , 当有新的IP连接的时候立刻上报到xboard后端
5. 上报用户流量时附带IP
#### xboard 需要增加接口
1. 获取节点用户列表
```
{
"id": 1,
"uuid":"cd692137-3f7b-47fb-b7a3-037a203d6489",
"speed_limit": null,
"device_limit": 10,
"online_ips": ['1.1.1.1', '2.2.2.2']
}
```
2. 后端上报新的在线用户IP (后端获取到在线数量没达到用户在线限制才会上报)
```
{
"id": 1,
"new_online_ip": "3.3.3.3"
}
```
上报成功返回 ```{ "data":true }```
当达到用户在线数量限制就返回,面板的在线用户的IPs
```
{
"data": ['1.1.1.1','2.2.2.2','3.3.3.3','4.4.4.4','5.5.5.5']
}
```
3. 后端上报用户流量(IP,ID,流量,三要素)
```
{
"id":1,
"u": 100,
"d": 100,
"ip": "1.1.1.1"
}
```
#### 安全设计
1、为了不泄漏用户的在线IP, ip使用Hash加密处理, 后端有用户连接时,对用户的连接IP使用 hash验证
#### 界面反馈
##### 后台界面
- 在订阅界面增加用户设备限制
- 编辑用户时增加用户设备限制
- 在用户列表显示在线用户量
- 在订阅列表显示当前订阅在线用户、IP数量
- 在节点页面显示在线用户数量和IP数
##### 用户前端
- 首页增加在线链接设备数(旁边增加重置订阅按钮)
#### 后续性能优化
- 后端上报用户流量使用 brotli压缩,减少体积
- 后端上报新的用户IP接口使用websocet或者grpc
-27
View File
@@ -1,27 +0,0 @@
# 性能对比总结
## 测试使用机器配置
CPU型号: Intel 8255C
CPU核心数量: 4核
内存:8G
## 不同环境并发对比
> php-fpm指的就是我们平时使用的aapanel(宝塔)的安装方式, 并发测试使用的是wrk
|场景 | php-fpm(传统) | php-fpm(传统开启opcache) | laravels | webman(docker)|
|---- | ---- |---- |----| ---|
|首页 | 6请求/秒 | 157请求/秒 | 477请求/秒 | 803请求/秒 |
|用户订阅 | 6请求/秒 | 196请求/秒 | 586请求/秒 | 1064请求/秒 |
|用户首页延迟| 308ms | 110ms | 101ms | 98ms |
## 前端加载速度对比(v2b原版/Xboard)
> FCPFirst Contentful Paint 指的是 首次内容渲染 耗费的时间
> FCP(原版耗时/xboard耗时) 结果越低越好
|场景 | php-fpm | php-fpm(开启opcache)|laravels | webman(docker)|
|---- | ---- |---- |--- |---- |
| 登录页面 | FCP(7秒/2.9秒) | FCP (7秒/2.9秒) | FCP(7.1秒/2.7秒) | FCP(7.3秒/2.9秒) |
| 注册页面 | FCP(7.1秒/3秒) | FCP (7秒/2.8秒) | FCP(7.1秒/2.7秒) | FCP(7.3秒/2.9秒) |
-222
View File
@@ -1,222 +0,0 @@
# Xboard 在 1Panel 环境下的部署指南
## 目录
1. [环境要求](#环境要求)
2. [快速部署](#快速部署)
3. [详细配置](#详细配置)
4. [维护指南](#维护指南)
5. [故障排查](#故障排查)
## 环境要求
### 硬件配置
- CPU: 1核心及以上
- 内存: 2GB及以上
- 硬盘: 10GB及以上可用空间
### 软件要求
- 操作系统: Ubuntu 20.04+ / CentOS 7+ / Debian 10+
- 1Panel 最新版
- Docker 和 Docker Compose
## 快速部署
### 1. 安装 1Panel
```bash
curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && \
sudo bash quick_start.sh
```
### 2. 基础环境配置
#### 2.1 安装必要组件
在 1Panel 应用商店中安装:
- OpenResty
- ✅ 勾选"端口外部访问"选项
- 📝 记录安装路径
- MySQL 5.7
> ARM 架构设备推荐使用 MariaDB 替代
#### 2.2 创建数据库
1. 数据库配置:
- 名称: `xboard`
- 用户: `xboard`
- 访问权限: 所有主机(%)
- 🔐 请安全保存数据库密码
### 3. 站点配置
#### 3.1 创建站点
1. 导航至:网站 > 创建网站 > 反向代理
2. 填写信息:
- 域名: 您的站点域名
- 代号: `xboard`
- 代理地址: `127.0.0.1:7001`
#### 3.2 配置反向代理
在站点配置中添加以下内容:
```nginx
location ^~ / {
proxy_pass http://127.0.0.1:7001;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header Server-Protocol $server_protocol;
proxy_set_header Server-Name $server_name;
proxy_set_header Server-Addr $server_addr;
proxy_set_header Server-Port $server_port;
proxy_cache off;
}
```
### 4. 部署 Xboard
#### 4.1 获取源码
```bash
# 进入站点目录
cd /opt/1panel/apps/openresty/openresty/www/sites/xboard/index
# 安装 Git(如需要)
## Ubuntu/Debian
apt update && apt install -y git
## CentOS/RHEL
yum update && yum install -y git
# 克隆项目
git clone -b compose --depth 1 https://github.com/cedar2025/Xboard ./
```
#### 4.2 配置 Docker Compose
创建或修改 `docker-compose.yml`:
```yaml
services:
web:
image: ghcr.io/cedar2025/xboard:new
volumes:
- ./.docker/.data/redis/:/data/
- ./.env:/www/.env
- ./.docker/.data/:/www/.docker/.data
- ./storage/logs:/www/storage/logs
- ./storage/theme:/www/storage/theme
environment:
- docker=true
depends_on:
- redis
command: php artisan octane:start --host=0.0.0.0 --port=7001
restart: on-failure
ports:
- 7001:7001
networks:
- 1panel-network
horizon:
image: ghcr.io/cedar2025/xboard:latest
volumes:
- ./.docker/.data/redis/:/data/
- ./.env:/www/.env
- ./.docker/.data/:/www/.docker/.data
- ./storage/logs:/www/storage/logs
restart: on-failure
command: php artisan horizon
networks:
- 1panel-network
depends_on:
- redis
redis:
image: redis:7-alpine
command: redis-server --unixsocket /data/redis.sock --unixsocketperm 777 --save 900 1 --save 300 10 --save 60 10000
restart: unless-stopped
networks:
- 1panel-network
volumes:
- ./.docker/.data/redis:/data
networks:
1panel-network:
external: true
```
#### 4.3 初始化安装
```bash
# 安装并初始化
docker compose run -it --rm web php artisan xboard:install
```
⚠️ 重要配置说明:
1. 数据库配置
- 数据库地址:根据部署方式选择以下配置
1. 如果数据库和 Xboard 在同一网络,一般填写 `mysql`
2. 如果连接失败,请在 1Panel 面板中依次打开:数据库 -> 选择对应数据库 -> 连接信息 -> 容器连接,使用其中的"地址"
3. 如果使用外部数据库,填写实际的数据库地址
- 数据库端口:`3306`(如无特殊配置,使用默认端口)
- 数据库名称:`xboard`(之前创建的数据库名)
- 数据库用户:`xboard`(之前创建的用户名)
- 数据库密码:填写之前保存的密码
2. Redis 配置
- 选择使用内置 Redis
- 无需额外配置
3. 管理员信息
- 请妥善保存安装完成后返回的管理员账号和密码
- 记录后台访问地址
完成配置后启动服务:
```bash
docker compose up -d
```
## 维护指南
### 版本更新
> 💡 重要提示:根据您安装的版本不同,更新命令可能略有差异:
> - 如果您是最近安装的新版本,使用下面的命令:
```bash
docker compose pull && \
docker compose run -it --rm web php artisan xboard:update && \
docker compose up -d
```
> - 如果您是较早安装的旧版本,需要将命令中的 `web` 改为 `xboard`,即:
```bash
docker compose pull && \
docker compose run -it --rm xboard php artisan xboard:update && \
docker compose up -d
```
> 🤔 不确定用哪个?可以先尝试使用新版命令,如果报错再使用旧版命令。
### 日常维护
- 定期检查日志: `docker compose logs`
- 监控系统资源使用情况
- 定期备份数据库和配置文件
## 故障排查
### 常见问题
1. 无法访问网站
- 检查防火墙配置
- 验证端口是否正确开放
- 检查 Docker 容器状态
2. 数据库连接失败
- 验证数据库凭据
- 检查数据库服务状态
- 确认网络连接
### 安全建议
- ⚠️ 确保 7001 端口不对外开放
- 定期更新系统和组件
- 配置 SSL 证书实现 HTTPS 访问
- 使用强密码策略
- 定期备份数据
### 获取帮助
- 查看官方文档
- 访问项目 GitHub 仓库
- 加入社区讨论组
-130
View File
@@ -1,130 +0,0 @@
# Xboard 在 aaPanel + Docker 环境下的部署指南
## 目录
1. [环境要求](#环境要求)
2. [快速部署](#快速部署)
3. [详细配置](#详细配置)
4. [维护指南](#维护指南)
5. [故障排查](#故障排查)
## 环境要求
### 硬件配置
- CPU: 1核心及以上
- 内存: 2GB及以上
- 硬盘: 10GB及以上可用空间
### 软件要求
- 操作系统: Ubuntu 20.04+ / CentOS 7+ / Debian 10+
- aaPanel 最新版
- Docker 和 Docker Compose
- Nginx(任意版本)
- MySQL 5.7+
## 快速部署
### 1. 安装 aaPanel
```bash
curl -sSL https://www.aapanel.com/script/install_6.0_en.sh -o install_6.0_en.sh && \
bash install_6.0_en.sh aapanel
```
### 2. 基础环境配置
#### 2.1 安装 Docker
```bash
# 安装 Docker
curl -sSL https://get.docker.com | bash
# CentOS 系统需要执行:
systemctl enable docker
systemctl start docker
```
#### 2.2 安装必要组件
在 aaPanel 面板中安装:
- Nginx(任意版本)
- MySQL 5.7
- ⚠️ 无需安装 PHP 和 Redis
### 3. 站点配置
#### 3.1 创建站点
1. 导航至:aaPanel > Website > Add site
2. 填写信息:
- 域名:填写您的站点域名
- 数据库:选择 MySQL
- PHP 版本:选择纯静态
#### 3.2 部署 Xboard
```bash
# 进入站点目录
cd /www/wwwroot/你的域名
# 清理目录
chattr -i .user.ini
rm -rf .htaccess 404.html 502.html index.html .user.ini
# 克隆代码
git clone https://github.com/cedar2025/Xboard.git ./
# 准备配置文件
cp compose.sample.yaml compose.yaml
# 安装依赖并初始化
docker compose run -it --rm web sh init.sh
```
> ⚠️ 请妥善保存安装完成后返回的后台地址和管理员账号密码
#### 3.3 启动服务
```bash
docker compose up -d
```
#### 3.4 配置反向代理
在站点配置中添加以下内容:
```nginx
location / {
proxy_pass http://127.0.0.1:7001;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header Server-Protocol $server_protocol;
proxy_set_header Server-Name $server_name;
proxy_set_header Server-Addr $server_addr;
proxy_set_header Server-Port $server_port;
proxy_cache off;
}
```
## 维护指南
### 版本更新
> 💡 重要提示:根据您安装的版本不同,更新命令可能略有差异:
> - 如果您是最近安装的新版本,使用下面的命令:
```bash
docker compose pull && \
docker compose run -it --rm web sh update.sh && \
docker compose up -d
```
> - 如果您是较早安装的旧版本,需要将命令中的 `web` 改为 `xboard`,即:
```bash
git config --global --add safe.directory $(pwd)
git fetch --all && git reset --hard origin/master && git pull origin master
docker compose pull && \
docker compose run -it --rm xboard sh update.sh && \
docker compose up -d
```
> 🤔 不确定用哪个?可以先尝试使用新版命令,如果报错再使用旧版命令。
### 日常维护
- 定期检查日志: `docker compose logs`
- 监控系统资源使用情况
- 定期备份数据库和配置文件
## 故障排查
-173
View File
@@ -1,173 +0,0 @@
## Xboard 在 aaPanel 环境下的部署指南
## 目录
1. [环境要求](#环境要求)
2. [快速部署](#快速部署)
3. [详细配置](#详细配置)
4. [维护指南](#维护指南)
5. [故障排查](#故障排查)
## 环境要求
### 硬件配置
- CPU: 1核心及以上
- 内存: 2GB及以上
- 硬盘: 10GB及以上可用空间
### 软件要求
- 操作系统: Ubuntu 20.04+ / Debian 10+ (⚠️ 不建议使用 CentOS 7)
- aaPanel 最新版
- PHP 8.2
- MySQL 5.7+
- Redis
- Nginx(任意版本)
## 快速部署
### 1. 安装 aaPanel
```bash
URL=https://www.aapanel.com/script/install_6.0_en.sh && \
if [ -f /usr/bin/curl ];then curl -ksSO "$URL" ;else wget --no-check-certificate -O install_6.0_en.sh "$URL";fi && \
bash install_6.0_en.sh aapanel
```
### 2. 基础环境配置
#### 2.1 安装 LNMP 环境
在 aaPanel 面板中安装:
- Nginx(任意版本)
- MySQL 5.7
- PHP 8.2
#### 2.2 安装 PHP 扩展
必需的 PHP 扩展:
- redis
- fileinfo
- swoole4
- readline
- event
#### 2.3 解除 PHP 禁用函数
需要启用的函数:
- putenv
- proc_open
- pcntl_alarm
- pcntl_signal
### 3. 站点配置
#### 3.1 创建站点
1. 导航至:aaPanel > Website > Add site
2. 填写信息:
- 域名:填写您的站点域名
- 数据库:选择 MySQL
- PHP 版本:选择 8.2
#### 3.2 部署 Xboard
```bash
# 进入站点目录
cd /www/wwwroot/你的域名
# 清理目录
chattr -i .user.ini
rm -rf .htaccess 404.html 502.html index.html .user.ini
# 克隆代码
git clone https://github.com/cedar2025/Xboard.git ./
# 安装依赖
sh init.sh
```
#### 3.3 配置站点
1. 设置运行目录为 `/public`
2. 添加伪静态规则:
```nginx
location /downloads {
}
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
location ~ .*\.(js|css)?$
{
expires 1h;
error_log off;
access_log /dev/null;
}
```
## 详细配置
### 1. 配置守护进程
1. 安装 Supervisor
2. 添加队列守护进程:
- 名称:`Xboard`
- 运行用户:`www`
- 运行目录:站点目录
- 启动命令:`php artisan horizon`
- 进程数:1
### 2. 配置计划任务
- 类型:Shell Script
- 任务名:v2board
- 周期:1分钟
- 脚本内容:`php /www/wwwroot/站点目录/artisan schedule:run`
### 3. Octane 配置(可选)
#### 3.1 添加 Octane 守护进程
- 名称:Octane
- 运行用户:www
- 运行目录:站点目录
- 启动命令:`/www/server/php/81/bin/php artisan octane:start --port 7010`
- 进程数:1
#### 3.2 Octane 专用伪静态规则
```nginx
location ~* \.(jpg|jpeg|png|gif|js|css|svg|woff2|woff|ttf|eot|wasm|json|ico)$ {
}
location ~ .* {
proxy_pass http://127.0.0.1:7010;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header Server-Protocol $server_protocol;
proxy_set_header Server-Name $server_name;
proxy_set_header Server-Addr $server_addr;
proxy_set_header Server-Port $server_port;
}
```
## 维护指南
### 版本更新
```bash
# 进入站点目录
cd /www/wwwroot/你的域名
# 执行更新脚本
git fetch --all && git reset --hard origin/master && git pull origin master
sh update.sh
# 如果启用了 Octane,需要重启守护进程
# aaPanel > App Store > Tools > Supervisor > 重启 Octane
```
### 日常维护
- 定期检查日志
- 监控系统资源使用情况
- 定期备份数据库和配置文件
## 故障排查
### 常见问题
1. 修改后台路径需要重启服务才能生效
2. 启用 Octane 后的任何代码修改都需要重启才能生效
3. PHP 扩展安装失败时,请检查 PHP 版本是否正确
4. 数据库连接失败时,请检查数据库配置和权限
-77
View File
@@ -1,77 +0,0 @@
## Docker Compose 快速部署指南
本指南介绍如何使用 Docker Compose 快速部署 Xboard。默认使用 SQLite 数据库,无需额外安装 MySQL。
### 1. 环境准备
安装 Docker:
```bash
curl -sSL https://get.docker.com | bash
# CentOS 系统需要执行:
systemctl enable docker
systemctl start docker
```
### 2. 部署步骤
1. 获取项目文件:
```bash
git clone -b compose --depth 1 https://github.com/cedar2025/Xboard
cd Xboard
```
2. 安装数据库:
- 快速安装(推荐新手使用)
```bash
docker compose run -it --rm \
-e ENABLE_SQLITE=true \
-e ENABLE_REDIS=true \
-e ADMIN_ACCOUNT=admin@demo.com \
web php artisan xboard:install
```
- 自定义配置安装(高级用户)
```bash
docker compose run -it --rm web php artisan xboard:install
```
> 安装完成后请保存返回的后台地址和管理员账号密码
3. 启动服务:
```bash
docker compose up -d
```
4. 访问站点:
- 默认端口:7001
- 网站地址:http://服务器IP:7001
### 3. 版本更新
> 💡 重要提示:根据您安装的版本不同,更新命令可能略有差异:
> - 如果您是最近安装的新版本,使用下面的命令:
```bash
cd Xboard
docker compose pull && \
docker compose run -it --rm web php artisan xboard:update && \
docker compose up -d
```
> - 如果您是较早安装的旧版本,需要将命令中的 `web` 改为 `xboard`,即:
```bash
cd Xboard
docker compose pull && \
docker compose run -it --rm xboard php artisan xboard:update && \
docker compose up -d
```
> 🤔 不确定用哪个?可以先尝试使用新版命令,如果报错再使用旧版命令。
### 4. 版本回滚
1. 修改 `docker-compose.yaml` 中的版本号为需要回滚的版本
2. 执行:`docker compose up -d`
### 注意事项
- 如需使用 MySQL,请自行安装并重新部署
- 代码修改后需要重启服务才能生效
- 可以配置 Nginx 反向代理使用 80 端口
-54
View File
@@ -1,54 +0,0 @@
## 配置迁移指南
本指南介绍如何将 v2board 的配置文件迁移到 Xboard。Xboard 使用数据库存储配置,不再使用文件存储。
### 1. Docker Compose 环境
1. 准备配置文件:
```bash
# 创建配置目录
mkdir config
# 复制旧配置文件
cp 旧项目路径/config/v2board.php config/
```
2. 修改 `docker-compose.yaml`,取消以下行的注释:
```yaml
- ./config/v2board.php:/www/config/v2board.php
```
3. 执行迁移:
```bash
docker compose run -it --rm web php artisan migrateFromV2b config
```
### 2. aaPanel 环境
1. 复制配置文件:
```bash
cp 旧项目路径/config/v2board.php config/v2board.php
```
2. 执行迁移:
```bash
php artisan migrateFromV2b config
```
### 3. aaPanel + Docker 环境
1. 复制配置文件:
```bash
cp 旧项目路径/config/v2board.php config/v2board.php
```
2. 执行迁移:
```bash
docker compose run -it --rm web php artisan migrateFromV2b config
```
### 注意事项
- 修改后台路径后需要重启服务:
- Docker 环境:`docker compose restart`
- aaPanel 环境:重启 Octane 守护进程
-63
View File
@@ -1,63 +0,0 @@
## V2board 1.7.3 迁移指南
本指南介绍如何将 V2board 1.7.3 版本迁移到 Xboard。
### 1. 数据库变更说明
- `v2_stat_order` 表更名为 `v2_stat`
- `order_amount``order_total`
- `commission_amount``commission_total`
- 新增字段:
- `paid_count` (integer, nullable)
- `paid_total` (integer, nullable)
- `register_count` (integer, nullable)
- `invite_count` (integer, nullable)
- `transfer_used_total` (string(32), nullable)
- 新增数据表:
- `v2_log`
- `v2_server_hysteria`
- `v2_server_vless`
### 2. 准备工作
⚠️ 请先完成 Xboard 基础安装(不支持 SQLite):
- [Docker Compose 部署](./docker-compose安装指南.md)
- [aaPanel + Docker 部署](./aapanel+docker安装指南.md)
- [aaPanel 部署](./aapanel安装指南.md)
### 3. 迁移步骤
#### Docker 环境
```bash
# 1. 停止服务
docker compose down
# 2. 清空数据库
docker compose run -it --rm web php artisan db:wipe
# 3. 导入旧数据库(重要)
# 请手动导入 V2board 1.7.3 的数据库
# 4. 执行迁移
docker compose run -it --rm web php artisan migratefromv2b 1.7.3
```
#### aaPanel 环境
```bash
# 1. 清空数据库
php artisan db:wipe
# 2. 导入旧数据库(重要)
# 请手动导入 V2board 1.7.3 的数据库
# 3. 执行迁移
php artisan migratefromv2b 1.7.3
```
### 4. 配置迁移
完成数据迁移后,还需要迁移配置文件:
- [配置迁移指南](./config迁移指南.md)
-51
View File
@@ -1,51 +0,0 @@
## V2board 1.7.4 迁移指南
本指南介绍如何将 V2board 1.7.4 版本迁移到 Xboard。
### 1. 数据库变更说明
- 新增数据表:
- `v2_server_vless`
### 2. 准备工作
⚠️ 请先完成 Xboard 基础安装(不支持 SQLite):
- [Docker Compose 部署](./docker-compose安装指南.md)
- [aaPanel + Docker 部署](./aapanel+docker安装指南.md)
- [aaPanel 部署](./aapanel安装指南.md)
### 3. 迁移步骤
#### Docker 环境
```bash
# 1. 停止服务
docker compose down
# 2. 清空数据库
docker compose run -it --rm web php artisan db:wipe
# 3. 导入旧数据库(重要)
# 请手动导入 V2board 1.7.4 的数据库
# 4. 执行迁移
docker compose run -it --rm web php artisan migratefromv2b 1.7.4
```
#### aaPanel 环境
```bash
# 1. 清空数据库
php artisan db:wipe
# 2. 导入旧数据库(重要)
# 请手动导入 V2board 1.7.4 的数据库
# 3. 执行迁移
php artisan migratefromv2b 1.7.4
```
### 4. 配置迁移
完成数据迁移后,还需要迁移配置文件:
- [配置迁移指南](./config迁移指南.md)
-61
View File
@@ -1,61 +0,0 @@
## V2board Dev 迁移指南
本指南介绍如何将 V2board Dev2023/10/27)版本迁移到 Xboard。
⚠️ 请先按照官方指南升级到 2023/10/27 版本后再执行迁移。
### 1. 数据库变更说明
- `v2_order` 表:
- 新增 `surplus_order_ids` (text, nullable) - 折抵订单
- `v2_plan` 表:
- 删除 `daily_unit_price` - 影响周期价值
- 删除 `transfer_unit_price` - 影响流量价值
- `v2_server_hysteria` 表:
- 删除 `ignore_client_bandwidth` - 影响带宽配置
- 删除 `obfs_type` - 影响混淆类型配置
### 2. 准备工作
⚠️ 请先完成 Xboard 基础安装(不支持 SQLite):
- [Docker Compose 部署](./docker-compose安装指南.md)
- [aaPanel + Docker 部署](./aapanel+docker安装指南.md)
- [aaPanel 部署](./aapanel安装指南.md)
### 3. 迁移步骤
#### Docker 环境
```bash
# 1. 停止服务
docker compose down
# 2. 清空数据库
docker compose run -it --rm web php artisan db:wipe
# 3. 导入旧数据库(重要)
# 请手动导入 V2board Dev 的数据库
# 4. 执行迁移
docker compose run -it --rm web php artisan migratefromv2b dev231027
```
#### aaPanel 环境
```bash
# 1. 清空数据库
php artisan db:wipe
# 2. 导入旧数据库(重要)
# 请手动导入 V2board Dev 的数据库
# 3. 执行迁移
php artisan migratefromv2b dev231027
```
### 4. 配置迁移
完成数据迁移后,还需要迁移配置文件:
- [配置迁移指南](./config迁移指南.md)
-68
View File
@@ -1,68 +0,0 @@
## V2board wyx2685 迁移指南
本指南介绍如何将 V2board wyx26852023/11/17)版本迁移到 Xboard。
⚠️ 迁移注意事项:
- 将失去设备限制功能
- 将失去 Trojan 的特殊功能
- Hysteria2 线路需要重新配置
### 1. 数据库变更说明
- `v2_plan` 表:
- 删除 `device_limit` (nullable)
- `v2_server_hysteria` 表:
- 删除 `version`
- 删除 `obfs`
- 删除 `obfs_password`
- `v2_server_trojan` 表:
- 删除 `network`
- 删除 `network_settings`
- `v2_user` 表:
- 删除 `device_limit`
### 2. 准备工作
⚠️ 请先完成 Xboard 基础安装(不支持 SQLite):
- [Docker Compose 部署](./docker-compose安装指南.md)
- [aaPanel + Docker 部署](./aapanel+docker安装指南.md)
- [aaPanel 部署](./aapanel安装指南.md)
### 3. 迁移步骤
#### Docker 环境
```bash
# 1. 停止服务
docker compose down
# 2. 清空数据库
docker compose run -it --rm web php artisan db:wipe
# 3. 导入旧数据库(重要)
# 请手动导入 V2board wyx2685 的数据库
# 4. 执行迁移
docker compose run -it --rm web php artisan migratefromv2b wyx2685
```
#### aaPanel 环境
```bash
# 1. 清空数据库
php artisan db:wipe
# 2. 导入旧数据库(重要)
# 请手动导入 V2board wyx2685 的数据库
# 3. 执行迁移
php artisan migratefromv2b wyx2685
```
### 4. 配置迁移
完成数据迁移后,还需要迁移配置文件:
- [配置迁移指南](./config迁移指南.md)