mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 10:38:14 -05:00
Merge pull request #30 from rebecca554owen/dev
更新1paenl教程,删除多开教程,更新docker生成,方便fork分支用户自行修改以及测试。
This commit is contained in:
commit
0b58ac5779
2
.github/workflows/docker-publish.yml
vendored
2
.github/workflows/docker-publish.yml
vendored
@ -78,7 +78,7 @@ jobs:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: ${{ env.REGISTRY }}/cedar2025/xboard:latest,${{ env.REGISTRY }}/cedar2025/xboard,${{ env.REGISTRY }}/cedar2025/xboard:${{ steps.get_version.outputs.version }}
|
||||
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/xboard:latest,${{ env.REGISTRY }}/${{ github.repository_owner }}/xboard,${{ env.REGISTRY }}/${{ github.repository_owner }}/xboard:${{ steps.get_version.outputs.version }}
|
||||
|
||||
# Sign the resulting Docker image digest except on PRs.
|
||||
# This will only write to the public Rekor transparency log when the Docker
|
||||
|
@ -1,120 +1,37 @@
|
||||
**本篇教程默认你具备一定的Linux基础操作,原来网站搭建在宝塔或者aapanel上。**
|
||||
**本篇教程适用于原来网站搭建在宝塔或者aapanel上的v2board/xboard,以及新安装xboard。**
|
||||
---
|
||||
1.迁移之前,登录aapanel后台>网站>站点目录,把`config/v2board.php`下载,复制 `网站路径`,SSH连接到v2board的VPS。
|
||||
```
|
||||
cd /www/wwwroot/你的站点域名
|
||||
bash update.sh
|
||||
```
|
||||
更新至v2board 1.7.4 / dev 或者wyx2685 分支最新版。
|
||||
1.迁移之前,更新至v2board/xboard 分支最新版。
|
||||
|
||||
2.在aaPanel 面板 > 数据库,点击备份你的旧版数据库。
|
||||
2.登录 aapanel后台> 数据库,点击备份并下载你的旧版数据库。
|
||||
v2board用户还需要在 >网站>站点目录,把`config/v2board.php`下载。
|
||||
|
||||
3.安装并登录到1panel >应用商店,安装 OpenResty、MySql。
|
||||
## 新安装从这里开始
|
||||
3.安装1panel ,安装依赖,不喜欢vim可以用 nano 或者 Finalshell 直接编辑
|
||||
```
|
||||
apt install curl vim -y # 安装依赖,不喜欢vim可以用 nano 或者 Finalshell 直接编辑
|
||||
apt install -y curl vim
|
||||
```
|
||||
```
|
||||
curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && bash quick_start.sh
|
||||
```
|
||||
|
||||
4.登录到1panel > 数据库,创建MySQL数据库,上传并导入v2board数据库备份。
|
||||
|
||||
4.登录到1panel >应用商店,安装 OpenResty、MySql 5.7。
|
||||
安装完成后,1panel > 数据库,创建MySQL数据库。
|
||||
1panel > 网站,使用 OpenResty 创建一个反向代理到 127.0.0.1:7001 。
|
||||
5.回到SSH终端,获取Docker compose 文件
|
||||
```
|
||||
git clone -b docker-compose --depth 1 https://github.com/cedar2025/Xboard
|
||||
cd Xboard
|
||||
git clone https://github.com/cedar2025/Xboard && cd Xboard && cp docker-compose.sample.yaml docker-compose.yaml
|
||||
```
|
||||
在1panel >文件,上传v2board.php到Xboard目录下。
|
||||
|
||||
6.编辑`.env` 文件,填写Mysql数据库信息
|
||||
6. *初始化,用于生成 .env文件*
|
||||
```
|
||||
vim .env #编辑环境变量
|
||||
rm -f .env && touch .env && docker compose run -it --rm xboard sh init.sh
|
||||
```
|
||||
7. 迁移用户此时可以导入xboard数据库。
|
||||
xboard迁移用户和新安装用户,可以启动容器。
|
||||
```
|
||||
APP_NAME=XBoard
|
||||
APP_ENV=local
|
||||
APP_KEY=base64:PZXk5vTuTinfeEVG5FpYv2l6WEhLsyvGpiWK7IgJJ60=
|
||||
APP_DEBUG=false
|
||||
APP_URL=http://localhost
|
||||
|
||||
ADMIN_SETTING_CACHE=60 #设置缓存时间(单位秒)
|
||||
#LaravelS配置
|
||||
LARAVELS_LISTEN_IP=0.0.0.0
|
||||
LARAVELS_LISTEN_PORT=80
|
||||
LARAVELS_HANDLE_STATIC=true
|
||||
LARAVELS_MAX_REQUEST=1000
|
||||
LARAVELS_WORKER_NUM=2
|
||||
LARAVELS_TIMER=true
|
||||
|
||||
APP_RUNNING_IN_CONSOLE=true
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=mysql # 桥接模式连接容器可以写成mysql
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=xboard
|
||||
DB_USERNAME=xboard
|
||||
DB_PASSWORD=root_password # 点击 1panel>数据库>Mysql 复制密码
|
||||
|
||||
REDIS_HOST=/run/redis-socket/redis.sock # 内置Redis
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=0
|
||||
|
||||
#默认将队列驱动和缓存驱动都修改为了redis,请务必安装redis
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=redis
|
||||
QUEUE_CONNECTION=redis
|
||||
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_HOST=smtp.mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS=null
|
||||
MAIL_FROM_NAME=null
|
||||
MAILGUN_DOMAIN=
|
||||
MAILGUN_SECRET=
|
||||
|
||||
# 用于阻止重复安装
|
||||
INSTALLED=true
|
||||
docker compose up -d
|
||||
```
|
||||
## 新安装到此结束。
|
||||
|
||||
7.修改docker-compose.yaml
|
||||
```
|
||||
vim docker-compose.yaml
|
||||
```
|
||||
```
|
||||
version: '3'
|
||||
services:
|
||||
xboard:
|
||||
image: ghcr.io/cedar2025/xboard:latest
|
||||
volumes:
|
||||
- ./.env:/www/.env
|
||||
- ./.docker/.data/:/www/.docker/.data/
|
||||
# - ./config/v2board.php:/www/config/v2board.php
|
||||
- redis-socket:/run/redis-socket # 挂载socket
|
||||
environment:
|
||||
- docker=true #用于给安装脚本判断是否为docker环境
|
||||
depends_on:
|
||||
- redis
|
||||
network_mode: 1panel-network
|
||||
ports:
|
||||
- 127.0.0.1:7001:7001
|
||||
redis:
|
||||
build:
|
||||
context: .docker/services/redis
|
||||
volumes:
|
||||
- ./.docker/.data/redis:/data/ # 挂载redis持久化数据
|
||||
- redis-socket:/run/redis-socket # 挂载socket
|
||||
volumes:
|
||||
redis-socket:
|
||||
networks:
|
||||
persist:
|
||||
external: true
|
||||
```
|
||||
8.根据v2board数据库版本执行对应的迁移数据库命令
|
||||
8.v2board用户根据对应的数据库版本执行迁移命令。
|
||||
```
|
||||
docker compose run -it --rm xboard php artisan migratefromv2b 1.7.3
|
||||
```
|
||||
@ -127,15 +44,15 @@ docker compose run -it --rm xboard php artisan migratefromv2b dev231027
|
||||
```
|
||||
docker compose run -it --rm xboard php artisan migratefromv2b wyx2685
|
||||
```
|
||||
9.执行迁移配置命令
|
||||
9.v2board用户,在1panel >文件,上传v2board.php到Xboard目录下,接着执行命令迁移配置到数据库。
|
||||
```
|
||||
docker compose run -it --rm xboard php artisan migrateFromV2b config
|
||||
```
|
||||
10.启动
|
||||
10.启动容器,否则网站上不去。
|
||||
```
|
||||
docker compose up -d
|
||||
```
|
||||
11.在Xboard目录下停止并更新后启动。
|
||||
11.后续更新。
|
||||
```
|
||||
docker compose down && docker compose pull && docker compose up -d
|
||||
docker compose pull && docker compose up -d
|
||||
```
|
||||
|
@ -1,50 +0,0 @@
|
||||
**本篇教程默认你已经安装了1panel,并部署单个Xboard容器运行成功。**
|
||||
|
||||
1.在1panel >文件,复制 Xboard 文件夹,重命名为 Xbaord-1 ,并修改`.env`文件。
|
||||
```
|
||||
#省略
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=mysql
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=xboard1 # 新数据库
|
||||
DB_USERNAME=xboard1 # 账号密码
|
||||
DB_PASSWORD=root_password
|
||||
|
||||
REDIS_HOST=/run/redis-socket/redis.sock # 内置Redis不用变
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=0
|
||||
#省略
|
||||
```
|
||||
|
||||
2.1panel>文件,修改 Xboard-1 默认的docker-compose.yaml
|
||||
```
|
||||
version: '3'
|
||||
services:
|
||||
xboard-1:
|
||||
image: ghcr.io/cedar2025/xboard:latest
|
||||
volumes:
|
||||
- ./.env:/www/.env
|
||||
- ./.docker/.data/:/www/.docker/.data/
|
||||
# - ./config/v2board.php:/www/config/v2board.php
|
||||
- redis-socket:/run/redis-socket # 挂载socket
|
||||
environment:
|
||||
- docker=true #用于给安装脚本判断是否为docker环境
|
||||
depends_on:
|
||||
- redis-1
|
||||
network_mode: 1panel-network
|
||||
ports:
|
||||
- 127.0.0.1:7002:7001 #端口不要跟原来的冲突
|
||||
redis-1:
|
||||
build:
|
||||
context: .docker/services/redis
|
||||
volumes:
|
||||
- ./.docker/.data/redis:/data/ # 挂载redis持久化数据
|
||||
- redis-socket:/run/redis-socket # 挂载socket
|
||||
|
||||
```
|
||||
启动 Xboard-1
|
||||
```
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
3.在1panel>网站,用openresty分别反代`127.0.0.1:7001` ,`127.0.0.1:7002` 两个站点。
|
Loading…
Reference in New Issue
Block a user