Skip to content

Commit 3ce291c

Browse files
committed
feat: 添加文档链接和 Bash 自动脚本部署指南
1 parent 9f30641 commit 3ce291c

4 files changed

Lines changed: 83 additions & 3 deletions

File tree

app/layout.config.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export const baseOptions: BaseLayoutProps = {
6060
{
6161
type: 'menu',
6262
text: '文档',
63+
url: '/docs',
6364
items: [
6465
{
6566
icon: <BookMarked />,

content/docs/core/bash.mdx

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: Bash 自动脚本
3+
description: 一种自动部署 MixSpace 前后端的 Bash 脚本
4+
icon: SquareTerminal
5+
---
6+
7+
<Callout type="warn">
8+
本脚本由社区用户“[Mikuの鬆](https://github.com/PaloMiku)”维护,如遇问题请前往对应的 Github 仓库提出Issue。
9+
</Callout>
10+
11+
12+
import { ToGithub } from 'app/components/ToGithub'
13+
14+
<ToGithub repo="PaloMiku/MxShell" />
15+
16+
## 介绍
17+
18+
这是一种在服务器自动安装 Docker 和进行 MixSpace 前后端部署的 Bash 脚本,它可以帮助你交互式快速部署 MixSpace。
19+
20+
注意脚本会自动根据是否为中国大陆网络环境按需修改服务器 Docker 安装源和镜像源。
21+
22+
脚本支持交互式安装方式和预配置文件的自动安装方式。
23+
24+
## 使用
25+
26+
在服务器终端运行以下指令,即可自动进入交互式安装。
27+
28+
### 海外服务器
29+
30+
```bash
31+
curl -sSL https://raw.githubusercontent.com/PaloMiku/MxShell/refs/heads/main/install.sh -o install.sh && bash install.sh
32+
```
33+
34+
### 国内服务器
35+
36+
使用 Moeyy 的 GitHub 加速源。
37+
38+
```bash
39+
curl -sSL https://github.moeyy.xyz/https://raw.githubusercontent.com/PaloMiku/MxShell/refs/heads/main/install.sh -o install.sh && bash install.sh
40+
```
41+
42+
## 预配置文件
43+
44+
不建议新手使用,参考下方示例修改并粘贴到 mxconfig.yml 文件,并将其与脚本置于同一目录后运行脚本,脚本会根据配置文件内容自动完成前后端部署。
45+
46+
### 配置文件示例
47+
48+
```yaml
49+
# 后端配置
50+
51+
# JWT 密钥,用于加密用户的 JWT,长度需为 16 到 32 个字符
52+
JWT_SECRET: "your_jwt_secret_here"
53+
54+
# 允许访问的域名,多个域名用英文逗号分隔
55+
ALLOWED_ORIGINS: "example.com,api.example.com"
56+
57+
# MixSpace 容器文件存储目录
58+
TARGET_DIR: "/opt/mxspace"
59+
60+
# 前端配置
61+
FRONTEND:
62+
INSTALL: true
63+
VERSION: "Shiro" # 可选值: Shiro 或 Shiroi
64+
NEXT_PUBLIC_API_URL: "http://127.0.0.1:2333/api/v2"
65+
NEXT_PUBLIC_GATEWAY_URL: "http://127.0.0.1:2333/"
66+
SHIRO_IMAGE: "your-dockerhub-username/shiroi:tag" # 仅在 Shiroi 版本时需要
67+
68+
```
69+
70+
- **`JWT 密钥`**:需要填写长度不小于 16 个字符,不大于 32 个字符的字符串,用于加密用户的 JWT,务必保存好自己的密钥,不要泄露给他人。
71+
- **`被允许的域名`**:需要填写被允许访问容器的域名,通常是前端的域名,如果允许多个域名访问,用英文逗号,分隔。
72+
- **`MixSpace 容器文件存储目录`**:指定文件存储路径,通常是 `/opt/mxspace`
73+
- **`前端安装`**:是否安装前端,true 为安装,false 为跳过,默认为 true。
74+
- **`前端版本`**:可选值为 Shiro 或 Shiroi(闭源)。
75+
- **`前端 API 地址`**:指定后端 API 的 URL,通常为后端加 `/api/v2`
76+
- **`前端网关地址`**:指定后端网关的 URL,通常为你后端的域名。
77+
- **`Shiro 镜像`**:仅在前端版本选择为 Shiroi 版本时需要,填写你自构建的 shiroi docker 镜像信息。

content/docs/core/index.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';
2424
## 快速开始
2525

2626
<Callout type="info">
27-
我们提供了两种部署方式,并且社区也提供了更多的部署方式,你可以根据自己的喜好选择一种部署方式。
27+
我们提供了两种部署方式,社区贡献了一种自动脚本模式,同时社区用户也分享了更多的部署方式,你可以根据自己的喜好选择一种部署方式。
2828
</Callout>
2929

30-
import { Container, Pickaxe, Share2, Ellipsis, Paintbrush } from 'lucide-react';
30+
import { Container, SquareTerminal, Pickaxe, Share2, Ellipsis, Paintbrush } from 'lucide-react';
3131

3232
<Cards>
33-
<Card title="Docker 部署" href="/docs/core/docker" icon={<Container />}>使用Docker部署后端</Card>
33+
<Card title="Docker 部署" href="/docs/core/docker" icon={<Container />}>使用 Docker 部署后端</Card>
3434
<Card title="进阶部署" href="/docs/core/advanced" icon={<Pickaxe />}>使用传统方式部署后端</Card>
35+
<Card title="Bash 脚本部署" href="/docs/core/bash" icon={<SquareTerminal />}>使用 Bash 自动脚本一键部署前后端</Card>
3536
<Card title="拓展内容" href="/docs/core/extra" icon={<Ellipsis />}>部署常见问题与拓展内容</Card>
3637
<Card title="社区分享" href="/docs/core/community" icon={<Share2 />}>了解社区用户们分享的部署方式</Card>
3738
</Cards>

content/docs/core/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"---部署---",
1111
"docker",
1212
"advanced",
13+
"bash",
1314
"extra",
1415
"community"
1516
]

0 commit comments

Comments
 (0)