Skip to content

Commit 84927f6

Browse files
committed
feat: 增加OpenMCIM节点部署 没写完(x
1 parent 1b3f32b commit 84927f6

File tree

2 files changed

+117
-0
lines changed

2 files changed

+117
-0
lines changed

src/.vuepress/theme.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ export default hopeTheme({
8484
},
8585
},
8686

87+
markdownHint : { // 启用 GFM 警告
88+
alert: true,
89+
},
90+
8791
blog: true,
8892

8993
//代码高亮

src/posts/develop/OpenMCIM.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: 部署OpenMcim节点
3+
date: 2024-10-07
4+
icon: fa-kit fa-modrinth
5+
category: develop
6+
tag:
7+
- MC
8+
- 服务
9+
---
10+
11+
<!-- markdownlint-disable MD028 -->
12+
13+
> [!info]
14+
> MCIM 需要提供文件镜像,但由于成本问题,以及受到 OpenBMCLAPI 的启发,本项目分发 Mod 文件基于网盘
15+
> 感谢各位的支持~!感谢您为改善国内 Mod 下载环境的贡献!
16+
17+
<!-- markdownlint-enable MD028 -->
18+
19+
## 使用OpenBmclapi
20+
21+
::: tip
22+
我更建议你使用已经修改过的 Node-OpenMcim 执行上线
23+
:::
24+
25+
### 从源码运行
26+
27+
#### 环境
28+
29+
- Node.js 18以上
30+
- Windows/MacOS/Linux, x86/arm均可 (凡是nodejs支持的环境都可以)
31+
32+
#### 设置环境
33+
34+
1.<https://nodejs.org/zh-cn/> 下载LTS版本的nodejs并安装
35+
2. Clone 并安装依赖
36+
37+
```bash
38+
git clone https://github.com/bangbang93/openbmclapi
39+
cd openbmclapi
40+
## 安装依赖
41+
npm ci
42+
## 编译
43+
npm run build
44+
## 运行
45+
node dist/index.js
46+
```
47+
3. 如果你看到了 `CLUSTER_ID is not set` 的报错, 说明一切正常, 接下来 修改代码 使其运行在OpenMCIM
48+
49+
4. 修改 `dist/cluster.js` 文件, 找到
50+
51+
```js
52+
const whiteListDomain = ['localhost', 'bangbang93.com'];
53+
```
54+
55+
修改为
56+
57+
```js
58+
const whiteListDomain = ['localhost', 'bangbang93.com','files.mcimirror.top'];
59+
```
60+
61+
#### 设置参数
62+
63+
在项目根目录创建一个文件, 名为 `.env`
64+
65+
写入如下内容
66+
67+
```env
68+
CLUSTER_ID=你的CLUSTER_ID
69+
CLUSTER_SECRET=你的CLUSTER_SECRET
70+
CLUSTER_PORT=对外访问端口
71+
CLUSTER_BMCLAPI=https://files.mcimirror.top
72+
```
73+
74+
CLUSTER_ID 和 CLUSTER_SECRET 请联系管理员获取
75+
76+
如果配置无误的话, 运行程序, 就会开始拉取文件, 拉取完成后就会开始等待服务器分发请求了
77+
78+
## 使用Go-OpenMcim
79+
80+
## 使用Node-OpenMcim
81+
82+
## 使用反向代理节点
83+
84+
## 特别鸣谢
85+
86+
<VPCard
87+
title="bangbang93"
88+
desc="OpenBmclapi 作者"
89+
logo="https://cdn.akaere.online/https://avatars.githubusercontent.com/u/3430784"
90+
link="https://github.com/bangbang93"
91+
background="rgba(236, 244, 250)"
92+
/>
93+
<VPCard
94+
title="z0z0r4"
95+
desc="Mcmod Info Mirror作者"
96+
logo="https://cdn.akaere.online/https://avatars.githubusercontent.com/u/78744121"
97+
link="https://github.com/z0z0r4"
98+
background="rgba(236, 244, 250)"
99+
/>
100+
<VPCard
101+
title="𝞐𝞙𝞘𝞚𝞛𝞝"
102+
desc="Go-OpenMcim 修改版作者"
103+
logo="https://cdn.akaere.online/https://avatars.githubusercontent.com/u/162766791"
104+
link="https://github.com/WetemCloud"
105+
background="rgba(236, 244, 250)"
106+
/>
107+
<VPCard
108+
title="ZeroWolf"
109+
desc="Node-OpenMcim 作者"
110+
logo="https://cdn.akaere.online/https://avatars.githubusercontent.com/u/142653035"
111+
link="https://github.com/ZeroWolf233"
112+
background="rgba(236, 244, 250)"
113+
/>

0 commit comments

Comments
 (0)