feat: v1.1.0 全平台客户端打包 + 详细服务端部署教程
Client: - 支持 Windows (NSIS安装包+免安装版), macOS (DMG x64/arm64), Linux (AppImage+deb) - 添加 dist:win / dist:mac / dist:linux / dist:all 打包脚本 - 生成应用图标 (icon.png + icon.ico) - Windows x64 安装包已编译: release/FunConnect-1.1.0-Win-x64.exe - 更新 README 包含完整的跨平台构建指南和国内镜像加速说明 Server: - 新增 DEPLOY.md 详细部署教程 (400+行) - Ubuntu主节点完整部署流程 - 工作节点部署和注册 - Web管理面板生产部署 - 防火墙配置 - Nginx反向代理配置 - SSL证书(Let's Encrypt)配置 - 多节点集群架构说明 - 运维管理命令和监控 - 常见问题排查 - 快速部署清单
This commit is contained in:
113
client/README.md
113
client/README.md
@@ -1,6 +1,19 @@
|
||||
# FunConnect Client
|
||||
|
||||
Minecraft 联机桌面客户端,基于 Electron 构建,支持 Windows / macOS / Linux。
|
||||
Minecraft 联机桌面客户端,基于 Electron 构建,支持 **Windows / macOS / Linux** 全平台。
|
||||
|
||||
## 下载
|
||||
|
||||
从 [Releases](https://gt.funmc.cn/xiaobai/FunConnect/releases) 页面下载对应平台的安装包:
|
||||
|
||||
| 平台 | 文件 | 说明 |
|
||||
|------|------|------|
|
||||
| **Windows** | `FunConnect-x.x.x-Win-x64.exe` | 安装包(NSIS) |
|
||||
| **Windows** | `FunConnect-x.x.x-Win-x64.exe` (portable) | 免安装版 |
|
||||
| **macOS (Intel)** | `FunConnect-x.x.x-Mac-x64.dmg` | Intel Mac |
|
||||
| **macOS (Apple Silicon)** | `FunConnect-x.x.x-Mac-arm64.dmg` | M1/M2/M3 Mac |
|
||||
| **Linux** | `FunConnect-x.x.x-Linux-x64.AppImage` | 通用 Linux |
|
||||
| **Linux** | `FunConnect-x.x.x-Linux-x64.deb` | Debian/Ubuntu |
|
||||
|
||||
## 功能
|
||||
|
||||
@@ -12,30 +25,103 @@ Minecraft 联机桌面客户端,基于 Electron 构建,支持 Windows / macO
|
||||
- **系统托盘** - 最小化到托盘,后台运行
|
||||
- **自动重连** - 连接断开后自动尝试重新连接
|
||||
|
||||
## 快速开始
|
||||
## 从源码构建
|
||||
|
||||
### 安装依赖
|
||||
### 前置要求
|
||||
|
||||
- Node.js 18+
|
||||
- npm 9+
|
||||
- Git
|
||||
|
||||
### 1. 安装依赖
|
||||
|
||||
```bash
|
||||
cd client
|
||||
npm install
|
||||
```
|
||||
|
||||
> 如果 Electron 下载慢,使用国内镜像:
|
||||
> **国内镜像加速**(解决 Electron 下载慢):
|
||||
> ```bash
|
||||
> ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ npm install
|
||||
> # 设置镜像
|
||||
> npm config set registry https://registry.npmmirror.com
|
||||
>
|
||||
> # Windows PowerShell
|
||||
> $env:ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/"
|
||||
> $env:ELECTRON_BUILDER_BINARIES_MIRROR="https://npmmirror.com/mirrors/electron-builder-binaries/"
|
||||
> npm install
|
||||
>
|
||||
> # macOS / Linux
|
||||
> ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ \
|
||||
> ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ \
|
||||
> npm install
|
||||
> ```
|
||||
|
||||
### 开发模式
|
||||
### 2. 开发模式
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### 打包发布
|
||||
### 3. 编译打包
|
||||
|
||||
#### Windows(在 Windows 上执行)
|
||||
|
||||
```powershell
|
||||
# 安装程序(NSIS)
|
||||
npm run dist:win
|
||||
|
||||
# 输出:
|
||||
# release/FunConnect-x.x.x-Win-x64.exe (安装包)
|
||||
# release/FunConnect-x.x.x-Win-x64.exe (portable免安装)
|
||||
```
|
||||
|
||||
#### macOS(在 macOS 上执行)
|
||||
|
||||
```bash
|
||||
npm run dist
|
||||
# 输出到 release/ 目录
|
||||
# DMG 安装包
|
||||
npm run dist:mac
|
||||
|
||||
# 输出:
|
||||
# release/FunConnect-x.x.x-Mac-x64.dmg (Intel)
|
||||
# release/FunConnect-x.x.x-Mac-arm64.dmg (Apple Silicon)
|
||||
```
|
||||
|
||||
#### Linux(在 Linux 上执行)
|
||||
|
||||
```bash
|
||||
# AppImage + deb
|
||||
npm run dist:linux
|
||||
|
||||
# 输出:
|
||||
# release/FunConnect-x.x.x-Linux-x64.AppImage
|
||||
# release/FunConnect-x.x.x-Linux-x64.deb
|
||||
```
|
||||
|
||||
#### 全平台(需要对应平台环境)
|
||||
|
||||
```bash
|
||||
npm run dist:all
|
||||
```
|
||||
|
||||
> **注意**:跨平台编译限制——Windows 安装包需要在 Windows 上构建,macOS DMG 需要在 macOS 上构建。Linux AppImage 可在 Linux 或使用 Docker 构建。
|
||||
|
||||
### 4. CI/CD 自动构建(参考)
|
||||
|
||||
如果使用 GitHub Actions 或 GitLab CI,可以用 matrix 策略在多个平台上并行构建:
|
||||
|
||||
```yaml
|
||||
# .gitlab-ci.yml 示例
|
||||
build:
|
||||
stage: build
|
||||
parallel:
|
||||
matrix:
|
||||
- OS: [windows, macos, linux]
|
||||
script:
|
||||
- npm ci
|
||||
- npm run dist
|
||||
artifacts:
|
||||
paths:
|
||||
- client/release/
|
||||
```
|
||||
|
||||
## 使用方法
|
||||
@@ -60,6 +146,9 @@ npm run dist
|
||||
|
||||
```
|
||||
client/
|
||||
├── build/ # 构建资源(图标等)
|
||||
│ ├── icon.png # 应用图标 (256x256)
|
||||
│ └── icon.ico # Windows 图标
|
||||
├── src/main/
|
||||
│ ├── index.ts # Electron 主进程
|
||||
│ ├── preload.ts # 预加载脚本(IPC桥接)
|
||||
@@ -74,9 +163,7 @@ client/
|
||||
└── tsconfig.json
|
||||
```
|
||||
|
||||
## 配置说明
|
||||
|
||||
设置页面中可配置:
|
||||
## 设置说明
|
||||
|
||||
| 设置项 | 默认值 | 说明 |
|
||||
|--------|--------|------|
|
||||
@@ -91,4 +178,4 @@ client/
|
||||
- **TypeScript** - 主进程开发
|
||||
- **electron-store** - 设置持久化
|
||||
- **Axios** - HTTP 请求
|
||||
- **electron-builder** - 打包发布
|
||||
- **electron-builder** - 全平台打包发布
|
||||
|
||||
BIN
client/build/icon.ico
Normal file
BIN
client/build/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
BIN
client/build/icon.png
Normal file
BIN
client/build/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -1,20 +1,25 @@
|
||||
{
|
||||
"name": "funconnect",
|
||||
"version": "1.0.0",
|
||||
"description": "FunMC Minecraft 联机客户端",
|
||||
"version": "1.1.0",
|
||||
"description": "FunConnect - Minecraft 跨平台联机客户端",
|
||||
"main": "dist/main/index.js",
|
||||
"author": "FunMC",
|
||||
"author": "FunMC <funmc@funmc.cn>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build:ts": "tsc",
|
||||
"start": "npm run build:ts && electron .",
|
||||
"dev": "tsc && electron .",
|
||||
"pack": "npm run build:ts && electron-builder --dir",
|
||||
"dist": "npm run build:ts && electron-builder"
|
||||
"dist": "npm run build:ts && electron-builder",
|
||||
"dist:win": "npm run build:ts && electron-builder --win",
|
||||
"dist:mac": "npm run build:ts && electron-builder --mac",
|
||||
"dist:linux": "npm run build:ts && electron-builder --linux",
|
||||
"dist:all": "npm run build:ts && electron-builder --win --mac --linux"
|
||||
},
|
||||
"build": {
|
||||
"appId": "cn.funmc.connect",
|
||||
"productName": "FunConnect",
|
||||
"copyright": "Copyright © 2024 FunMC",
|
||||
"directories": {
|
||||
"output": "release"
|
||||
},
|
||||
@@ -24,12 +29,66 @@
|
||||
"package.json"
|
||||
],
|
||||
"win": {
|
||||
"target": "nsis",
|
||||
"icon": "renderer/icon.ico"
|
||||
"target": [
|
||||
{
|
||||
"target": "nsis",
|
||||
"arch": ["x64", "ia32"]
|
||||
},
|
||||
{
|
||||
"target": "portable",
|
||||
"arch": ["x64"]
|
||||
}
|
||||
],
|
||||
"icon": "build/icon.ico",
|
||||
"artifactName": "FunConnect-${version}-Win-${arch}.${ext}"
|
||||
},
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
"allowToChangeInstallationDirectory": true
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"installerIcon": "build/icon.ico",
|
||||
"uninstallerIcon": "build/icon.ico",
|
||||
"installerHeaderIcon": "build/icon.ico",
|
||||
"createDesktopShortcut": true,
|
||||
"createStartMenuShortcut": true,
|
||||
"shortcutName": "FunConnect"
|
||||
},
|
||||
"mac": {
|
||||
"target": [
|
||||
{
|
||||
"target": "dmg",
|
||||
"arch": ["x64", "arm64"]
|
||||
}
|
||||
],
|
||||
"icon": "build/icon.png",
|
||||
"category": "public.app-category.games",
|
||||
"artifactName": "FunConnect-${version}-Mac-${arch}.${ext}"
|
||||
},
|
||||
"dmg": {
|
||||
"title": "FunConnect ${version}",
|
||||
"contents": [
|
||||
{ "x": 130, "y": 220 },
|
||||
{ "x": 410, "y": 220, "type": "link", "path": "/Applications" }
|
||||
]
|
||||
},
|
||||
"linux": {
|
||||
"target": [
|
||||
{
|
||||
"target": "AppImage",
|
||||
"arch": ["x64"]
|
||||
},
|
||||
{
|
||||
"target": "deb",
|
||||
"arch": ["x64"]
|
||||
}
|
||||
],
|
||||
"icon": "build/icon.png",
|
||||
"category": "Game",
|
||||
"artifactName": "FunConnect-${version}-Linux-${arch}.${ext}",
|
||||
"desktop": {
|
||||
"Name": "FunConnect",
|
||||
"Comment": "Minecraft 联机客户端",
|
||||
"Categories": "Game;Network"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
Reference in New Issue
Block a user