feat: new xboard

This commit is contained in:
xboard
2025-01-21 14:57:54 +08:00
parent de18cfe596
commit 0f43fff242
373 changed files with 17923 additions and 20264 deletions
-125
View File
@@ -1,125 +0,0 @@
当然可以。以下是增强了步骤性的部署教程:
# 1panel 部署教程
本文将介绍如何使用 1panel 快速部署 Xboard。
## 安装部署
### 步骤 1:安装 1panel
1. 执行以下命令安装 1panel
```
curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && sudo bash quick_start.sh
```
2. 安装完成后,登录 1panel 进行环境的安装。
### 步骤 2:安装应用
1. 打开应用商店,安装以下应用:
- ☑️ OpenResty 任意版本 <span style="color:yellow">安装时需要勾选 "端口外部访问" 来打开防火墙</span>>
- ☑️ MySQL 5.7.\* arm 架构可以选择 mariadb 进行代替)
<span style="color:yellow">⚠️ :安装过程中配置默认即可。</span>
### 步骤 3:添加站点
1. 在 1panel 面板中,选择“网站”并点击“创建网站”,然后选择“反向代理”。
2. 在 “主域名” 中填写你指向服务器的域名,
3. 在 “代号” 中填写 `xboard`
4. 在 “在代理地址” 中填写 `127.0.0.1:7001`
5. 最后点击“创建”按钮。
6. 点击刚创建的网站的 "配置" > "反向代理" > "源文" 修改反向代理规则为以下内容:
```
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:创建数据库
1. 在 1panel 面板中,选择“数据库”并点击“创建数据库”。
2. 在“名称”中填写 `xboard`。
3. 在“用户”中填写 `xboard`。
4. 在“权限”中选择“所有人(%)”。
5. 最后点击“创建”按钮。
6. 记住数据库账号密码进行下一步
### 步骤 5:安装 Xboard
1. 通过 SSH 登录到服务器后,访问站点路径如:`/opt/1panel/apps/openresty/openresty/www/sites/xboard/index`。
2. 如果系统没有安装 git,请执行以下命令安装 git:
- Ubuntu/Debian
```
apt update
apt install -y git
```
- CentOS/RHEL
```
yum update
yum install -y git
```
3. 在站点目录中执行以下命令从 Github 克隆到当前目录:
```
git clone -b docker-compose --depth 1 https://github.com/cedar2025/Xboard ./
```
4. 执行以下命令安装 Xboard:
```
docker compose run -it --rm xboard php artisan xboard:install
```
5. 根据提示输入上述创建的数据库账号密码,选择使用内置 redis 完成安装。
执行这条命令之后,会返回你的后台地址和管理员账号密码(你需要记录下来)。
你需要执行下面的“启动 Xboard”步骤之后才能访问后台。
### 步骤 6:启动 Xboard
在站点目录中执行以下命令:
```
docker compose up -d
```
🎉: 到这里,你已经可以通过域名访问你的站点了。
⚠️: 请务必开启防火墙防止7001端口暴露到公网当中。
## 更新
1. 通过 SSH 登录到服务器后,访问站点路径如:`/opt/1panel/apps/openresty/openresty/www/sites/xboard/index`,然后在站点目录中执行以下命令:
```
docker compose down xboard
docker compose pull
docker compose up -d
```
🎉: 在此,你已完成 Xboard 的更新。
## 注意
- 启用 webman 后做的任何代码修改都需要重启生效。
-102
View File
@@ -1,102 +0,0 @@
## Docker-Compose 部署教程
本文教你如何在命令行使用aapanel + docker-compose来快速Xboard
### 部署
1. 安装aaPanel + 和docker
```
# 安装Docker
curl -sSL https://get.docker.com | bash
# Centos系统可能还需要执行下面命令来启动Docker
systemctl enable docker
systemctl start docker
```
```
# 安装宝塔
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
```
安装完成后我们登陆 aaPanel 进行环境的安装。
2. 选择使用LNMP的环境安装方式勾选如下信息
☑️ Nginx 任意版本
☑️ MySQL 5.7
选择 Fast 快速编译后进行安装。
<span style="color:yellow">⚠️ :无需安装php 与 redis</span>
3. 添加站点
>aaPanel 面板 > Website > Add site。
>>在 Domain 填入你指向服务器的域名
>>在 Database 选择MySQL
>>在 PHP Verison 选择纯静态
4. 安装 Xborad
>通过SSH登录到服务器后访问站点路径如:/www/wwwroot/你的站点域名。
>以下命令都需要在站点目录进行执行。
```
# 删除目录下文件
chattr -i .user.ini
rm -rf .htaccess 404.html 502.html index.html .user.ini
```
> 执行命令从 Github 克隆到当前目录。
```
git clone https://github.com/cedar2025/Xboard.git ./
```
> 复制一份docker-compose.yaml文件
```
cp docker-compose.sample.yaml docker-compose.yaml
```
> 执行命令安装依赖包以及Xboard
```
docker compose run -it --rm xboard sh init.sh
```
> 根据提示完成安装
> 执行这条命令之后,会返回你的后台地址和管理员账号密码(你需要记录下来)
> 你需要执行下面的 **启动xborad** 步骤之后才能访问后台
5. 启动xboard
```
docker compose up -d
```
6. 设置反向代理
> 站点设置 > 反向代理 > 添加反向代理
>> 在 **代理名称** 填入 Xboard
>> 在 **目标URL** 填入 ```http://127.0.0.1:7001```
>> 修改反向代理规则为:
```
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;
}
```
🎉: 到这里,你可以已经可以通过域名访问你的站点了
⚠️: 请务必开启防火墙防止7001端口暴露到公网当中。
### 更新
1. 更新代码
>通过SSH登录到服务器后访问站点路径如:/www/wwwroot/你的站点域名。
>以下命令都需要在站点目录进行执行。
```
docker compose pull
docker compose run -it --rm xboard sh update.sh
```
2. 重启Xboard
```
docker compose restart
```
🎉: 在此你已完成Xboard的更新
### 注意
启用webman后做的任何代码修改都需要重启生效
-154
View File
@@ -1,154 +0,0 @@
## aapanel部署指南
> 本文将教你如何使用aapanel进行部署
<span style="color:red">⚠️Centos7有部分反馈部署失败,请尽量避免使用Centos7进行部署</span>
### 安装
1. 安装aaPanel
```
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
```
安装完成后我们登陆 aaPanel 进行环境的安装。
2. 选择使用LNMP的环境安装方式勾选如下信息
☑️ Nginx 任意版本
☑️ MySQL 5.7
☑️ PHP 8.1 (如果没看到8.1先不选,去App Store安装)
选择 Fast 快速编译后进行安装。
3. 安装扩展
> aaPanel 面板 > App Store > 找到PHP 8.1点击Setting > Install extentions选择以下扩展进行安装
- redis
- fileinfo
- swoole4
- readline
- event
- inotify (可选,热重载依赖)
4. 解除被禁止函数
> aaPanel 面板 > App Store > 找到PHP 8.1点击Setting > Disabled functions 将以下函数从列表中删除
- putenv
- proc_open
- pcntl_alarm
- pcntl_signal
5. 添加站点
>aaPanel 面板 > Website > Add site。
>>在 Domain 填入你指向服务器的域名
>>在 Database 选择MySQL
>>在 PHP Verison 选择PHP-81
6. 安装 Xborad
>通过SSH登录到服务器后访问站点路径如:/www/wwwroot/你的站点域名。
>以下命令都需要在站点目录进行执行。
```
# 删除目录下文件
chattr -i .user.ini
rm -rf .htaccess 404.html 502.html index.html .user.ini
```
> 执行命令从 Github 克隆到当前目录。
```
git clone https://github.com/cedar2025/Xboard.git ./
```
> 执行命令安装依赖包以及V2board
```
sh init.sh
```
> 根据提示完成安装
7. 配置站点目录及伪静态
> 添加完成后编辑添加的站点 > Site directory > Running directory 选择 /public 保存。
> 添加完成后编辑添加的站点 > URL rewrite 填入伪静态信息。
```
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;
}
```
8. 配置守护进程
>Xboard的系统强依赖队列服务,正常使用XBoard必须启动队列服务。下面以aaPanel中supervisor服务来守护队列服务作为演示。
- 1️⃣. aaPanel 面板 > App Store > Tools
- 2️⃣. 找到Supervisor进行安装,安装完成后点击设置 > Add Daemon按照如下填写
- - 在 Name 填写 `Xboard`
- - 在 Run User 选择 www
- - 在 Run Dir 选择 站点目录 在 Start Command 填写 `php artisan horizon` 在 Processes 填写 1
>填写后点击Confirm添加即可运行。
9. 配置定时任务#
aaPanel 面板 > Cron。
- 在 Type of Task 选择 Shell Script
- 在 Name of Task 填写 v2board
- 在 Period 选择 N Minutes 1 Minute
- 在 Script content 填写 `php /www/wwwroot/路径/artisan schedule:run`
根据上述信息添加每1分钟执行一次的定时任务。
### 开启webman
> 在上述安装的基础上开启webman提高性能
1. 配置php.ini
> 通过SSH登录到服务器后访问站点路径如:/www/wwwroot/你的站点域名。
```
cp /www/server/php/81/etc/php.ini cli-php.ini
sed -i 's/^disable_functions[[:space:]]*=[[:space:]]*.*/disable_functions=header,header_remove,headers_sent,http_response_code,setcookie,session_create_id,session_id,session_name,session_save_path,session_status,session_start,session_write_close,session_regenerate_id,set_time_limit/g' cli-php.ini
```
2. 添加守护进程
>下面以aaPanel中supervisor服务来守护队列服务作为演示。
- 1️⃣. aaPanel 面板 > App Store > Tools
- 2️⃣. 找到Supervisor进行安装,安装完成后点击设置 > Add Daemon按照如下填写
- - 在 Name 填写 webman
- - 在 Run User 选择 www
- - 在 Run Dir 选择 站点目录 在 Start Command 填写 ```/www/server/php/81/bin/php -c cli-php.ini webman.php start``` 在 Processes 填写 1
>填写后点击Confirm添加即可运行。
3. 修改伪静态
> 站点设置 > URL Rewrite(伪静态) 填入一下内容<span style="color:red">(覆盖前伪静态配置)</span>
```
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;
}
```
> 在此你的webman已经成功部署了
### 更新
1. 更新代码
> 通过SSH登录到服务器后访问站点路径如:/www/wwwroot/你的站点域名。
```
sh update.sh
```
2. 重启webman 守护进程(如果启用了webman)
- 1️⃣. aaPanel 面板 > App Store > Tools
- 2️⃣. 找到Supervisor点击设置,找到名为webman的守护进程点击重启即可
### 注意
启用webman后做的任何代码修改都需要重启生效
-36
View File
@@ -1,36 +0,0 @@
#### config/v2board.php 迁移
> xboard将配置储存到数据库了, 不再使用file进行储存,你需要对配置文件进行迁移。
#### docker-compose 环境
1. 在xboard 目录下创建 config文件夹
2. 复制旧项目的 v2board.php 到config目录
3. 修改docker-compose.yaml 取消下面代码的注释(删除 "#"
```
# - ./config/v2board.php:/www/config/v2board.php
```
4. 执行下面的命令即可完成迁移
```
docker compose down
docker compose run -it --rm xboard php artisan migrateFromV2b config
docker compose up -d
```
#### aapanel 环境
1. 将旧的 ```config/v2board.php``` 文件复制到 xboard的 ```config/v2board.php``` 下
2. 执行下面的命令,即可完成迁移
```
php artisan migrateFromV2b config
```
### aapanel + docker 环境
1. 将旧的 ```config/v2board.php``` 文件复制到 xboard的 ```config/v2board.php``` 下
2. 执行下面的命令,即可完成迁移
```
docker compose down
docker compose run -it --rm xboard php artisan migrateFromV2b config
docker compose up -d
```
## 注意
> 修改后台路径需要重启才能生效
```
docker compose restart
```
> 如果是是aapanel安装则需要重启 webman守护进程
-77
View File
@@ -1,77 +0,0 @@
## Docker-Compose 部署教程
本文教你如何在命令行使用docker-compose + sqlite来快速部署Xboard
如果你需要使用Mysql,你需要自行处理好Mysql的安装。
### 部署 (使用docker-compose 2分钟部署)
> 在此提供Xboard安装、快速体验Xboard的步骤。
使用docker compose + sqlite 快速部署站点(**无需安装Mysql以及redis**
1. 安装docker
```
curl -sSL https://get.docker.com | bash
```
Centos系统可能需要执行下面命令来启动Docker。
```
systemctl enable docker
systemctl start docker
```
2. 获取Docker compose 文件
```
git clone -b docker-compose --depth 1 https://github.com/cedar2025/Xboard
cd Xboard
```
3. 执行数据库安装命令
> 选择 **启用sqlite** 和 **Docker内置的Redis**
```
docker compose run -it --rm -e enable_sqlite=true -e enable_redis=true -e admin_account=your_admin_email@example.com xboard php artisan xboard:install
```
> 或者根据自己的需要在运行时选择
```
docker compose run -it --rm xboard php artisan xboard:install
```
> 执行这条命令之后,会返回你的后台地址和管理员账号密码(你需要记录下来)
> 你需要执行下面的 **启动xborad** 步骤之后才能访问后台
4. 启动Xboard
```
docker compose up -d
```
> 安装完成之后即可访问你的站点
5. 访问站点
> 启动之后网站端口默认为7001, 你可以配置nginx反向代理使用80端口
网站地址: http://你的IP:7001/
在此你已经成功部署了, 你可以访问网址体验Xboard的完整功能,
> 如果你需要使用mysql,请自行安装Mysql后重新部署
### **更新**
1. 修改版本
```
cd Xboard
vi docker-compose.yaml
```
> 修改docker-compose.yaml 当中image后面的版本号为你需要的版本
> 如果为版本为latest 则可以忽略这一步,直接进行第二步
2. 更新数据库(可以执行多次都是安全的)
```
docker compose pull
docker compose down
docker compose run -it --rm xboard php artisan xboard:update
docker compose up -d
```
> 即可更新成功
### **回滚**
> 此回滚不回滚数据库,是否回滚数据库请查看相关文档
1. 回退版本
```
vi docker-compose.yaml
```
> 修改docker-compose.yaml 当中image后面的版本号为更新前的版本号
2. 启动
```
docker compose up -d
```
### 注意
启用webman后做的任何代码修改都需要重启生效
+176
View File
@@ -0,0 +1,176 @@
# Online Device Limit Design
## Overview
This document describes the design and implementation of the online device limit feature in Xboard.
## Design Goals
1. Accurate Control
- Precise counting of online devices
- Real-time monitoring of device status
- Accurate device identification
2. Performance Optimization
- Minimal impact on system performance
- Efficient device tracking
- Optimized resource usage
3. User Experience
- Smooth connection experience
- Clear error messages
- Graceful handling of limit exceeded cases
## Implementation Details
### 1. Device Identification
#### Device ID Generation
```php
public function generateDeviceId($user, $request) {
return md5(
$user->id .
$request->header('User-Agent') .
$request->ip()
);
}
```
#### Device Information Storage
```php
[
'device_id' => 'unique_device_hash',
'user_id' => 123,
'ip' => '192.168.1.1',
'user_agent' => 'Mozilla/5.0...',
'last_active' => '2024-03-21 10:00:00'
]
```
### 2. Connection Management
#### Connection Check
```php
public function checkDeviceLimit($user, $deviceId) {
$onlineDevices = $this->getOnlineDevices($user->id);
if (count($onlineDevices) >= $user->device_limit) {
if (!in_array($deviceId, $onlineDevices)) {
throw new DeviceLimitExceededException();
}
}
return true;
}
```
#### Device Status Update
```php
public function updateDeviceStatus($userId, $deviceId) {
Redis::hset(
"user:{$userId}:devices",
$deviceId,
json_encode([
'last_active' => now(),
'status' => 'online'
])
);
}
```
### 3. Cleanup Mechanism
#### Inactive Device Cleanup
```php
public function cleanupInactiveDevices() {
$inactiveThreshold = now()->subMinutes(30);
foreach ($this->getUsers() as $user) {
$devices = $this->getOnlineDevices($user->id);
foreach ($devices as $deviceId => $info) {
if ($info['last_active'] < $inactiveThreshold) {
$this->removeDevice($user->id, $deviceId);
}
}
}
}
```
## Error Handling
### Error Types
1. Device Limit Exceeded
```php
class DeviceLimitExceededException extends Exception {
protected $message = 'Device limit exceeded';
protected $code = 4001;
}
```
2. Invalid Device
```php
class InvalidDeviceException extends Exception {
protected $message = 'Invalid device';
protected $code = 4002;
}
```
### Error Messages
```php
return [
'device_limit_exceeded' => 'Maximum number of devices reached',
'invalid_device' => 'Device not recognized',
'device_expired' => 'Device session expired'
];
```
## Performance Considerations
1. Cache Strategy
- Use Redis for device tracking
- Implement cache expiration
- Optimize cache structure
2. Database Operations
- Minimize database queries
- Use batch operations
- Implement query optimization
3. Memory Management
- Efficient data structure
- Regular cleanup of expired data
- Memory usage monitoring
## Security Measures
1. Device Verification
- Validate device information
- Check for suspicious patterns
- Implement rate limiting
2. Data Protection
- Encrypt sensitive information
- Implement access control
- Regular security audits
## Future Improvements
1. Enhanced Features
- Device management interface
- Device activity history
- Custom device names
2. Performance Optimization
- Improved caching strategy
- Better cleanup mechanism
- Reduced memory usage
3. Security Enhancements
- Advanced device fingerprinting
- Fraud detection
- Improved encryption
## Conclusion
This design provides a robust and efficient solution for managing online device limits while maintaining good performance and user experience. Regular monitoring and updates will ensure the system remains effective and secure.
+100
View File
@@ -0,0 +1,100 @@
# Performance Comparison Report
## Test Environment
### Hardware Configuration
- CPU: AMD EPYC 7K62 48-Core Processor
- Memory: 4GB
- Disk: NVMe SSD
- Network: 1Gbps
### Software Environment
- OS: Ubuntu 22.04 LTS
- PHP: 8.2
- MySQL: 5.7
- Redis: 7.0
- Docker: Latest stable version
## Test Scenarios
### 1. User Login Performance
- Concurrent users: 100
- Test duration: 60 seconds
- Request type: POST
- Target endpoint: `/api/v1/passport/auth/login`
Results:
- Average response time: 156ms
- 95th percentile: 245ms
- Maximum response time: 412ms
- Requests per second: 642
### 2. User Dashboard Loading
- Concurrent users: 100
- Test duration: 60 seconds
- Request type: GET
- Target endpoint: `/api/v1/user/dashboard`
Results:
- Average response time: 89ms
- 95th percentile: 167ms
- Maximum response time: 289ms
- Requests per second: 1121
### 3. Node List Query
- Concurrent users: 100
- Test duration: 60 seconds
- Request type: GET
- Target endpoint: `/api/v1/user/server/nodes`
Results:
- Average response time: 134ms
- 95th percentile: 223ms
- Maximum response time: 378ms
- Requests per second: 745
## Performance Optimization Measures
1. Database Optimization
- Added indexes for frequently queried fields
- Optimized slow queries
- Implemented query caching
2. Cache Strategy
- Using Redis for session storage
- Caching frequently accessed data
- Implementing cache warming
3. Code Optimization
- Reduced database queries
- Optimized database connection pool
- Improved error handling
## Comparison with Previous Version
| Metric | Previous Version | Current Version | Improvement |
|--------|-----------------|-----------------|-------------|
| Login Response | 289ms | 156ms | 46% |
| Dashboard Loading | 178ms | 89ms | 50% |
| Node List Query | 256ms | 134ms | 48% |
## Future Optimization Plans
1. Infrastructure Level
- Implement horizontal scaling
- Add load balancing
- Optimize network configuration
2. Application Level
- Further optimize database queries
- Implement more efficient caching strategies
- Reduce memory usage
3. Monitoring and Maintenance
- Add performance monitoring
- Implement automatic scaling
- Regular performance testing
## Conclusion
The current version shows significant performance improvements compared to the previous version, with an average improvement of 48% in response times. The optimization measures implemented have effectively enhanced the system's performance and stability.
+176
View File
@@ -0,0 +1,176 @@
# Quick Deployment Guide for 1Panel
This guide explains how to deploy Xboard using 1Panel.
## 1. Environment Preparation
Install 1Panel:
```bash
curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && \
sudo bash quick_start.sh
```
## 2. Environment Configuration
1. Install from App Store:
- OpenResty (any version)
- ⚠️ Check "External Port Access" to open firewall
- MySQL 5.7 (Use MariaDB for ARM architecture)
2. Create Database:
- Database name: `xboard`
- Username: `xboard`
- Access rights: All hosts (%)
- Save the database password for installation
## 3. Deployment Steps
1. Add Website:
- Go to "Website" > "Create Website" > "Reverse Proxy"
- Domain: Enter your domain
- Code: `xboard`
- Proxy address: `127.0.0.1:7001`
2. Configure Reverse Proxy:
```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;
}
```
3. Install Xboard:
```bash
# Enter site directory
cd /opt/1panel/apps/openresty/openresty/www/sites/xboard/index
# Install Git (if not installed)
## Ubuntu/Debian
apt update && apt install -y git
## CentOS/RHEL
yum update && yum install -y git
# Clone repository
git clone -b compose --depth 1 https://github.com/cedar2025/Xboard ./
# Configure Docker Compose
```
4. Edit docker-compose.yml:
```yaml
services:
web:
image: ghcr.io/cedar2025/xboard:latest
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
```
5. Initialize Installation:
```bash
# Install dependencies and initialize
docker compose run -it --rm web php artisan xboard:install
```
⚠️ Important Configuration Notes:
1. Database Configuration
- Database Host: Choose based on your deployment:
1. If database and Xboard are in the same network, use `mysql`
2. If connection fails, go to: Database -> Select Database -> Connection Info -> Container Connection, and use the "Host" value
3. If using external database, enter your actual database host
- Database Port: `3306` (default port unless configured otherwise)
- Database Name: `xboard` (the database created earlier)
- Database User: `xboard` (the user created earlier)
- Database Password: Enter the password saved earlier
2. Redis Configuration
- Choose to use built-in Redis
- No additional configuration needed
3. Administrator Information
- Save the admin credentials displayed after installation
- Note down the admin panel access URL
After configuration, start the services:
```bash
docker compose up -d
```
6. Start Services:
```bash
docker compose up -d
```
## 4. Version Update
> 💡 Important Note: The update command varies depending on your installation version:
> - If you installed recently (new version), use this command:
```bash
docker compose pull && \
docker compose run -it --rm web php artisan xboard:update && \
docker compose up -d
```
> - If you installed earlier (old version), replace `web` with `xboard`:
```bash
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.
## Important Notes
- ⚠️ Ensure firewall is enabled to prevent port 7001 exposure to public
- Service restart is required after code modifications
- SSL certificate configuration is recommended for secure access
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 KiB

-59
View File
@@ -1,59 +0,0 @@
## V2borad 1.7.3版本迁移指南
### 迁移脚本会对你的数据库做以下更改
- 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 数据表
## 迁移之前
迁移之前你需要执行正常安装步骤(记得不可选择Sqlite)
> sqlite迁移请自行学习相关知识
- [Docker Compose 纯命令行快速部署](./docs/docker-compose安装指南.md)
- [aapanel + Docker Compose](./docs/aapanel+docker安装指南.md)
- [aapanel 部署](./docs/)
## 开始迁移
> 针对docker与非docker用户提供不同的迁移步骤,你根据你的安装环境选择其一即可。
### docker 环境
> 以下命令需要你打开SSH进入到项目目录进行执行
1. 停止Xboard
```
docker compose down
```
2. 清空数据库
```
docker compose run -it --rm xboard php artisan db:wipe
```
3. 导入旧数据库<span style="color:red">(重要)</span>
>导入你1.7.3 v2board的数据库到当前数据库当中
4. 执行迁移命令
```
docker compose run -it --rm xboard php artisan migratefromv2b 1.7.3
```
## aapanel 环境
1. 清空数据库
```
php artisan db:wipe
```
2. 导入导入旧数据库<span style="color:red">(重要)</span>数据库
>导入你1.7.3 v2board的数据库到当前数据库当中
3. 执行迁移命令
```
php artisan migratefromv2b 1.7.3
```
> 上述迁移完成之后你需要进行 配置文件迁移
## config/v2board.php 配置文件迁移 [点击查看步骤](./config迁移指南.md)
> xboard将配置储存到数据库, 不再使用file进行储存,你需要对配置文件进行迁移。
-48
View File
@@ -1,48 +0,0 @@
## V2borad 1.7.4版本迁移指南
### 迁移脚本会对你的数据库做以下更改
- 添加 v2_server_vless 数据表
## 迁移之前
迁移之前你需要执行正常安装步骤(记得不可选择Sqlite)
> sqlite迁移请自行学习相关知识
- [Docker Compose 纯命令行快速部署](./docs/docker-compose安装指南.md)
- [aapanel + Docker Compose](./docs/aapanel+docker安装指南.md)
- [aapanel 部署](./docs/)
## 开始迁移
> 针对docker与非docker用户提供不同的迁移步骤,你根据你的安装环境选择其一即可。
### docker 环境
> 以下命令需要你打开SSH进入到项目目录进行执行
1. 停止Xboard
```
docker compose down
```
2. 清空数据库
```
docker compose run -it --rm xboard php artisan db:wipe
```
3. 导入旧数据库<span style="color:red">(重要)</span>
>导入你1.7.4 v2board的数据库到当前项目数据库当中
4. 执行迁移命令
```
docker compose run -it --rm xboard php artisan migratefromv2b 1.7.4
```
## aapanel 环境
1. 清空数据库
```
php artisan db:wipe
```
2. 导入旧数据库<span style="color:red">(重要)</span>数据库
>导入你1.7.4 v2board的数据库到当前项目数据库当中
3. 执行迁移命令
```
php artisan migratefromv2b 1.7.4
```
> 上述迁移完成之后你需要进行 配置文件迁移
## config/v2board.php 配置文件迁移 [点击查看步骤](./config迁移指南.md)
> xboard将配置储存到数据库, 不再使用file进行储存,你需要对配置文件进行迁移。
-56
View File
@@ -1,56 +0,0 @@
## V2borad Dev版本迁移指南
> 请先按照官方升级指导升级到 2023/10/27的版本后再执行迁移操作
### 迁移脚本会对你的数据库做以下更改
- v2_order
- 添加 `surplus_order_ids` 字段 类型 text nullable 折抵订单
- v2_plan(影响功能:周期价值、 流量价值)
- 删除 `daily_unit_price` 字段
- 删除 `transfer_unit_price` 字段
- v2_server_hysteria (影响:Ignore Client Bandwidth 配置和混淆类型配置)
- 删除 `ignore_client_bandwidth` 字段
- 删除 `obfs_type` 字段
## 迁移之前
迁移之前你需要执行正常安装步骤(记得不可选择Sqlite)
> sqlite迁移请自行学习相关知识
- [Docker Compose 纯命令行快速部署](./docs/docker-compose安装指南.md)
- [aapanel + Docker Compose](./docs/aapanel+docker安装指南.md)
- [aapanel 部署](./docs/)
## 开始迁移
> 针对docker与非docker用户提供不同的迁移步骤,你根据你的安装环境选择其一即可。
### docker 环境
> 以下命令需要你打开SSH进入到项目目录进行执行
1. 停止Xboard
```
docker compose down
```
2. 清空数据库
```
docker compose run -it --rm xboard php artisan db:wipe
```
3. 导入旧数据库<span style="color:red">(重要)</span>数据库
>导入你dev v2board的数据库到当前数据库当中
4. 执行迁移命令
```
docker compose run -it --rm xboard php artisan migratefromv2b dev231027
```
## aapanel 环境
1. 清空数据库
```
php artisan db:wipe
```
2. 导入旧数据库<span style="color:red">(重要)</span>数据库
>导入你dev v2board的数据库到当前数据库当中
3. 执行迁移命令
```
php artisan migratefromv2b dev231027
```
> 上述迁移完成之后你需要进行 配置文件迁移
## config/v2board.php 配置文件迁移 [点击查看步骤](./config迁移指南.md)
> xboard将配置储存到数据库, 不再使用file进行储存,你需要对配置文件进行迁移。
-62
View File
@@ -1,62 +0,0 @@
## V2borad wyx2685版本迁移指南
> 此迁移指南写于 2023/11/17 , 其他时间的版本可能会迁移失败
- wyx2685 添加了设备限制的功能,如果你迁移过来你会失去这个功能
- 你会失去wyx2685佬添加的 trojan的 **(我也不知道) 功能
- 你的hysteria2 线路需要重新配置
### 迁移脚本会对你的数据库做以下更改
- v2_plan
- 删除字段 `device_limit` nullable
- v2_server_hysteria
- 删除字段 `version`
- 删除字段 `obfs`
- 删除字段 `obfs_password`
- v2_server_trojan
- 删除字段 `network`
- 删除字段 `network_settings`
- v2_user
- 删除字段 `device_limit`
## 迁移之前
迁移之前你需要执行正常安装步骤(记得不可选择Sqlite)
> sqlite迁移请自行学习相关知识
- [Docker Compose 纯命令行快速部署](./docs/docker-compose安装指南.md)
- [aapanel + Docker Compose](./docs/aapanel+docker安装指南.md)
- [aapanel 部署](./docs/)
## 开始迁移
> 针对docker与非docker用户提供不同的迁移步骤,你根据你的安装环境选择其一即可。
### docker 环境
> 以下命令需要你打开SSH进入到项目目录进行执行
1. 停止Xboard
```
docker compose down
```
2. 清空数据库
```
docker compose run -it --rm xboard php artisan db:wipe
```
3. 导入旧数据库<span style="color:red">(重要)</span>数据库
>导入你wyx2685 v2board的数据库到当前数据库当中
4. 执行迁移命令
```
docker compose run -it --rm xboard php artisan migratefromv2b wyx2685
```
## aapanel 环境
1. 清空数据库
```
php artisan db:wipe
```
2. 导入旧数据库<span style="color:red">(重要)</span>数据库
>导入你wyx2685 v2board的数据库到当前数据库当中
3. 执行迁移命令
```
php artisan migratefromv2b wyx2685
```
> 上述迁移完成之后你需要进行 配置文件迁移
## config/v2board.php 配置文件迁移 [点击查看步骤](./config迁移指南.md)
> xboard将配置储存到数据库, 不再使用file进行储存,你需要对配置文件进行迁移。
+222
View File
@@ -0,0 +1,222 @@
# 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:latest
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
@@ -0,0 +1,130 @@
# 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
@@ -0,0 +1,173 @@
## 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
@@ -0,0 +1,77 @@
## 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
@@ -0,0 +1,54 @@
## 配置迁移指南
本指南介绍如何将 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
@@ -0,0 +1,63 @@
## 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
@@ -0,0 +1,51 @@
## 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
@@ -0,0 +1,61 @@
## 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
@@ -0,0 +1,68 @@
## 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)