most-box 0.0.4 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +222 -182
- package/electron/main.js +67 -0
- package/out/404/index.html +2 -2
- package/out/404.html +2 -2
- package/out/__next.__PAGE__.txt +6 -4
- package/out/__next._full.txt +20 -17
- package/out/__next._head.txt +3 -3
- package/out/__next._index.txt +6 -5
- package/out/__next._tree.txt +4 -2
- package/out/_next/static/chunks/003jnm.v5tzw5.js +1 -0
- package/out/_next/static/chunks/00re8v.gbcywn.js +1 -0
- package/out/_next/static/chunks/00s106sbq8t9v.js +1 -0
- package/out/_next/static/chunks/012hi627qrdnn.js +1 -0
- package/out/_next/static/chunks/0174xh3wfsjm1.js +2 -0
- package/out/_next/static/chunks/01xlw8hd842-c.js +1 -0
- package/out/_next/static/chunks/02~o2nmo5pmy1.js +1 -0
- package/out/_next/static/chunks/07t.dhhokszz5.css +1 -0
- package/out/_next/static/chunks/0_wia9ofmsi1c.css +2 -0
- package/out/_next/static/chunks/0ah8fihozo2_u.js +5 -0
- package/out/_next/static/chunks/0bzupvr5gt3k9.js +31 -0
- package/out/_next/static/chunks/0d3shmwh5_nmn.js +1 -0
- package/out/_next/static/chunks/0e_h0d3ekzks8.css +1 -0
- package/out/_next/static/chunks/0gdluj423gso1.js +1 -0
- package/out/_next/static/chunks/0gmoiq06srjay.css +1 -0
- package/out/_next/static/chunks/0ho~log~~-jwp.css +1 -0
- package/out/_next/static/chunks/0imkasy7kb67u.js +1 -0
- package/out/_next/static/chunks/0jjc_b9q_ldi2.js +1 -0
- package/out/_next/static/chunks/0jl~j62iz2uvr.js +1 -0
- package/out/_next/static/chunks/0lqslm813wk_h.js +1 -0
- package/out/_next/static/chunks/{0bogtdbh.dcu1.js → 0n~dq4kpx9xxx.js} +1 -1
- package/out/_next/static/chunks/0pqt~8bl3ukh4.js +4 -0
- package/out/_next/static/chunks/0q782fxxd0lx~.js +1 -0
- package/out/_next/static/chunks/0qub_r0x_r-e9.css +1 -0
- package/out/_next/static/chunks/0slwj0c46k5cu.js +1 -0
- package/out/_next/static/chunks/0sorqk.oc6b7j.css +1 -0
- package/out/_next/static/chunks/0tapzqc6hgvx-.js +1 -0
- package/out/_next/static/chunks/0xsc7z5x8n7wg.js +1 -0
- package/out/_next/static/chunks/0zm~gys2jwl0g.js +1 -0
- package/out/_next/static/chunks/turbopack-0a_g3u0ud~jb8.js +1 -0
- package/out/_not-found/__next._full.txt +19 -15
- package/out/_not-found/__next._head.txt +3 -3
- package/out/_not-found/__next._index.txt +6 -5
- package/out/_not-found/__next._not-found.__PAGE__.txt +9 -0
- package/out/_not-found/__next._not-found.txt +3 -3
- package/out/_not-found/__next._tree.txt +2 -2
- package/out/_not-found/index.html +2 -2
- package/out/_not-found/index.txt +19 -15
- package/out/app/__next._full.txt +20 -0
- package/out/app/__next._head.txt +5 -0
- package/out/app/__next._index.txt +7 -0
- package/out/app/__next._tree.txt +2 -0
- package/out/app/__next.app.__PAGE__.txt +9 -0
- package/out/app/__next.app.txt +5 -0
- package/out/app/index.html +15 -0
- package/out/app/index.txt +20 -0
- package/out/changelog/__next._full.txt +22 -0
- package/out/changelog/__next._head.txt +5 -0
- package/out/changelog/__next._index.txt +7 -0
- package/out/changelog/__next._tree.txt +3 -0
- package/out/changelog/__next.changelog.__PAGE__.txt +10 -0
- package/out/changelog/__next.changelog.txt +5 -0
- package/out/changelog/index.html +15 -0
- package/out/changelog/index.txt +22 -0
- package/out/chat/__next._full.txt +20 -18
- package/out/chat/__next._head.txt +3 -3
- package/out/chat/__next._index.txt +6 -5
- package/out/chat/__next._tree.txt +3 -3
- package/out/chat/__next.chat.__PAGE__.txt +9 -0
- package/out/chat/__next.chat.txt +5 -4
- package/out/chat/index.html +2 -2
- package/out/chat/index.txt +20 -18
- package/out/docs/__next._full.txt +22 -0
- package/out/docs/__next._head.txt +5 -0
- package/out/docs/__next._index.txt +7 -0
- package/out/docs/__next._tree.txt +3 -0
- package/out/docs/__next.docs.__PAGE__.txt +10 -0
- package/out/docs/__next.docs.txt +5 -0
- package/out/docs/getting-started/__next._full.txt +22 -0
- package/out/docs/getting-started/__next._head.txt +5 -0
- package/out/docs/getting-started/__next._index.txt +7 -0
- package/out/docs/getting-started/__next._tree.txt +3 -0
- package/out/docs/getting-started/__next.docs.getting-started.__PAGE__.txt +10 -0
- package/out/docs/getting-started/__next.docs.getting-started.txt +5 -0
- package/out/docs/getting-started/__next.docs.txt +5 -0
- package/out/docs/getting-started/index.html +15 -0
- package/out/docs/getting-started/index.txt +22 -0
- package/out/docs/index.html +15 -0
- package/out/docs/index.txt +22 -0
- package/out/download/__next._full.txt +34 -0
- package/out/download/__next._head.txt +5 -0
- package/out/download/__next._index.txt +7 -0
- package/out/download/__next._tree.txt +4 -0
- package/out/download/__next.download.__PAGE__.txt +16 -0
- package/out/download/__next.download.txt +5 -0
- package/out/download/index.html +15 -0
- package/out/download/index.txt +34 -0
- package/out/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
- package/out/fonts/jetbrains-mono-latin-500-normal.woff2 +0 -0
- package/out/fonts/jetbrains-mono-latin-600-normal.woff2 +0 -0
- package/out/fonts/jetbrains-mono-latin-700-normal.woff2 +0 -0
- package/out/index.html +2 -2
- package/out/index.txt +20 -17
- package/out/ping/__next._full.txt +21 -0
- package/out/ping/__next._head.txt +5 -0
- package/out/ping/__next._index.txt +7 -0
- package/out/ping/__next._tree.txt +4 -0
- package/out/ping/__next.ping.__PAGE__.txt +10 -0
- package/out/ping/__next.ping.txt +5 -0
- package/out/ping/index.html +15 -0
- package/out/ping/index.txt +21 -0
- package/out/pwa-512x512.png +0 -0
- package/out/web3/__next._full.txt +21 -0
- package/out/web3/__next._head.txt +5 -0
- package/out/web3/__next._index.txt +7 -0
- package/out/web3/__next._tree.txt +3 -0
- package/out/web3/__next.web3.__PAGE__.txt +9 -0
- package/out/web3/__next.web3.txt +6 -0
- package/out/web3/ed25519/__next._full.txt +20 -0
- package/out/web3/ed25519/__next._head.txt +5 -0
- package/out/web3/ed25519/__next._index.txt +7 -0
- package/out/web3/ed25519/__next._tree.txt +3 -0
- package/out/web3/ed25519/__next.web3.ed25519.__PAGE__.txt +6 -0
- package/out/web3/ed25519/__next.web3.ed25519.txt +5 -0
- package/out/web3/ed25519/__next.web3.txt +6 -0
- package/out/web3/ed25519/index.html +1 -0
- package/out/web3/ed25519/index.txt +20 -0
- package/out/web3/index.html +15 -0
- package/out/web3/index.txt +21 -0
- package/out/web3/tools/__next._full.txt +20 -0
- package/out/web3/tools/__next._head.txt +5 -0
- package/out/web3/tools/__next._index.txt +7 -0
- package/out/web3/tools/__next._tree.txt +3 -0
- package/out/web3/tools/__next.web3.tools.__PAGE__.txt +6 -0
- package/out/web3/tools/__next.web3.tools.txt +5 -0
- package/out/web3/tools/__next.web3.txt +6 -0
- package/out/web3/tools/index.html +1 -0
- package/out/web3/tools/index.txt +20 -0
- package/package.json +162 -53
- package/public/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
- package/public/fonts/jetbrains-mono-latin-500-normal.woff2 +0 -0
- package/public/fonts/jetbrains-mono-latin-600-normal.woff2 +0 -0
- package/public/fonts/jetbrains-mono-latin-700-normal.woff2 +0 -0
- package/public/pwa-512x512.png +0 -0
- package/server/cli.js +3 -0
- package/server/index.js +995 -0
- package/{src → server/src}/config.js +51 -50
- package/{src → server/src}/core/cid.js +157 -150
- package/{src → server/src}/index.js +1952 -1669
- package/server/src/utils/api.js +68 -0
- package/server/src/utils/avatar.js +11 -0
- package/{src → server/src}/utils/errors.js +70 -66
- package/server/src/utils/mostWallet.js +42 -0
- package/server/src/utils/mp.js +105 -0
- package/{src → server/src}/utils/security.js +173 -169
- package/server/src/utils/userIdentity.js +93 -0
- package/cli.js +0 -2
- package/out/_next/static/chunks/00l-yd3t8dvwz.js +0 -5
- package/out/_next/static/chunks/03k8t3tgym~8~.js +0 -1
- package/out/_next/static/chunks/09vfh8lfuacc0.css +0 -1
- package/out/_next/static/chunks/0dbhjjzl8qfwv.js +0 -1
- package/out/_next/static/chunks/0f73psqhr8dre.css +0 -1
- package/out/_next/static/chunks/0fbi7z4_.4j1j.js +0 -1
- package/out/_next/static/chunks/0ht900cau6_ur.js +0 -31
- package/out/_next/static/chunks/0ohm.ia-4ec60.js +0 -1
- package/out/_next/static/chunks/0u5ydb-f0.vxl.js +0 -1
- package/out/_next/static/chunks/14t2m1on-s5v~.js +0 -1
- package/out/_next/static/chunks/turbopack-076ce9exut_h3.js +0 -1
- package/out/_not-found/__next._not-found/__PAGE__.txt +0 -5
- package/out/app.css +0 -1535
- package/out/bundle.js +0 -107
- package/out/bundle.js.map +0 -7
- package/out/chat/__next.chat/__PAGE__.txt +0 -9
- package/out/chat-page.js +0 -112
- package/out/chat.css +0 -378
- package/out/index.js +0 -148
- package/public/app.css +0 -1535
- package/public/bundle.js +0 -107
- package/public/bundle.js.map +0 -7
- package/public/chat-page.js +0 -112
- package/public/chat.css +0 -378
- package/public/index.js +0 -148
- package/server.js +0 -880
- package/src/utils/api.js +0 -6
- /package/out/_next/static/{0h4f4QFk_KC9FlSRfQACk → sV38nXrv3xVVO6wvSdFlZ}/_buildManifest.js +0 -0
- /package/out/_next/static/{0h4f4QFk_KC9FlSRfQACk → sV38nXrv3xVVO6wvSdFlZ}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{0h4f4QFk_KC9FlSRfQACk → sV38nXrv3xVVO6wvSdFlZ}/_ssgManifest.js +0 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 MOST.BOX
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MOST.BOX
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,182 +1,222 @@
|
|
|
1
|
-
# MostBox
|
|
2
|
-
|
|
3
|
-
[](https://npmjs.com/package/most-box)
|
|
4
|
-
[](https://nodejs.org)
|
|
5
|
-
[](LICENSE)
|
|
6
|
-
|
|
7
|
-
> P2P 文件分享应用。基于 Hyperswarm/Hyperdrive 的去中心化文件分发。
|
|
8
|
-
|
|
9
|
-
## 为什么用 MostBox?
|
|
10
|
-
|
|
11
|
-
| 特性 | MostBox | 微信/QQ | 网盘 |
|
|
12
|
-
| ------------------- | ------- | ------- | ---- |
|
|
13
|
-
| 🔒 无需注册 | ✅ | ❌ | ❌ |
|
|
14
|
-
| 🚀 P2P直连,不限速 | ✅ | ❌ | 限流 |
|
|
15
|
-
| 💾 去中心化存储 | ✅ | ❌ | ❌ |
|
|
16
|
-
| 🌐 开源免费,自托管 | ✅ | ❌ |
|
|
17
|
-
| 📦 无限文件大小 | ✅ | ❌ | 限流 |
|
|
18
|
-
|
|
19
|
-
## 演示
|
|
20
|
-
|
|
21
|
-
在线体验:[Most.Box](https://Most.Box)
|
|
22
|
-
|
|
23
|
-
## 🚀 立即使用
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
npm
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
npx most-box
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
###
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
###
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
###
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
1
|
+
# MostBox:你的数字魔盒
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.com/package/most-box)
|
|
4
|
+
[](https://nodejs.org)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
> P2P 文件分享应用。基于 Hyperswarm/Hyperdrive 的去中心化文件分发。
|
|
8
|
+
|
|
9
|
+
## 为什么用 MostBox?
|
|
10
|
+
|
|
11
|
+
| 特性 | MostBox | 微信/QQ | 网盘 |
|
|
12
|
+
| ------------------- | ------- | ------- | ---- |
|
|
13
|
+
| 🔒 无需注册 | ✅ | ❌ | ❌ |
|
|
14
|
+
| 🚀 P2P直连,不限速 | ✅ | ❌ | 限流 |
|
|
15
|
+
| 💾 去中心化存储 | ✅ | ❌ | ❌ |
|
|
16
|
+
| 🌐 开源免费,自托管 | ✅ | ❌ | |
|
|
17
|
+
| 📦 无限文件大小 | ✅ | ❌ | 限流 |
|
|
18
|
+
|
|
19
|
+
## 演示
|
|
20
|
+
|
|
21
|
+
在线体验:[Most.Box](https://Most.Box)
|
|
22
|
+
|
|
23
|
+
## 🚀 立即使用
|
|
24
|
+
|
|
25
|
+
### 方式一:npm 包(推荐)
|
|
26
|
+
|
|
27
|
+
打开终端,运行:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx most-box@latest
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> 使用 `@latest` 确保每次运行最新版本。
|
|
34
|
+
|
|
35
|
+
浏览器自动访问 **http://localhost:1976**
|
|
36
|
+
|
|
37
|
+
### 方式二:桌面客户端
|
|
38
|
+
|
|
39
|
+
前往 [Most.Box](https://Most.Box/download) 下载桌面客户端,支持 Windows、macOS 和 Linux。
|
|
40
|
+
|
|
41
|
+
## 需求
|
|
42
|
+
|
|
43
|
+
- Node.js >= 18 ([下载地址](https://nodejs.org))
|
|
44
|
+
|
|
45
|
+
## 开发
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git clone <your-repo-url>
|
|
49
|
+
cd most
|
|
50
|
+
npm i
|
|
51
|
+
npm start
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 测试
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm test # 运行全部测试
|
|
58
|
+
npm run test:unit # 只运行单元测试
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 访问场景
|
|
62
|
+
|
|
63
|
+
| 场景 | 命令 | 访问地址 |
|
|
64
|
+
| ---- | ------------------------------------------ | ------------------------- |
|
|
65
|
+
| 本地 | `npx most-box` | `http://localhost:1976` |
|
|
66
|
+
| 内网 | `set MOSTBOX_HOST=0.0.0.0 && npx most-box` | `http://<IP>:1976` |
|
|
67
|
+
| 外网 | Caddy 反向代理 | `https://your-domain.com` |
|
|
68
|
+
|
|
69
|
+
### 内网访问
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
set MOSTBOX_HOST=0.0.0.0
|
|
73
|
+
npx most-box
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 外网访问(Caddy)
|
|
77
|
+
|
|
78
|
+
```caddy
|
|
79
|
+
mostbox.example.com {
|
|
80
|
+
reverse_proxy localhost:1976
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## 核心功能
|
|
85
|
+
|
|
86
|
+
1. **确定性 P2P 文件发布**
|
|
87
|
+
- 采用标准 IPFS UnixFS Chunking 算法计算 CID v1
|
|
88
|
+
- 相同文件生成一致的 CID 链接
|
|
89
|
+
|
|
90
|
+
2. **大文件流式传输**
|
|
91
|
+
- 支持 GB 级别超大文件的发布与下载
|
|
92
|
+
|
|
93
|
+
3. **完整性校验**
|
|
94
|
+
- 下载完成后自动验证 CID,防止数据篡改
|
|
95
|
+
|
|
96
|
+
4. **自定义 most:// 链接**
|
|
97
|
+
- 分享文件生成 `most://<cid>` 格式链接
|
|
98
|
+
- 接收方通过链接直接下载,无需其他配置
|
|
99
|
+
|
|
100
|
+
5. **P2P 频道聊天**
|
|
101
|
+
- 创建或加入频道,与朋友实时聊天
|
|
102
|
+
- 消息通过 P2P 网络复制,服务器只是中转
|
|
103
|
+
- 无需中心化服务器,去中心化聊天
|
|
104
|
+
|
|
105
|
+
6. **网络连通性测试**
|
|
106
|
+
- 内置 Ping 工具检测 P2P 网络状态
|
|
107
|
+
|
|
108
|
+
## 常见问题
|
|
109
|
+
|
|
110
|
+
### 文件存储在哪里?
|
|
111
|
+
|
|
112
|
+
文件以 **P2P 方式** 存储在分享者和接收者的设备上。当文件被分享时,内容会被分片存储在 P2P 网络中。**没有中心化服务器**,真正实现去中心化。
|
|
113
|
+
|
|
114
|
+
### 如何分享文件给其他人?
|
|
115
|
+
|
|
116
|
+
1. 打开 MostBox Web 界面
|
|
117
|
+
2. 上传文件或文件夹
|
|
118
|
+
3. 点击「复制链接」获取 `most://<cid>` 链接
|
|
119
|
+
4. 将链接发送给接收者
|
|
120
|
+
|
|
121
|
+
### most:// 链接是什么?
|
|
122
|
+
|
|
123
|
+
`most://` 是 MostBox 自定义的协议链接,格式为 `most://<cid>`。接收方安装 MostBox 后,点击链接即可自动下载文件。
|
|
124
|
+
|
|
125
|
+
### 支持大文件吗?
|
|
126
|
+
|
|
127
|
+
支持。目前已测试通过 **GB 级别**的大文件传输,采用流式处理,内存占用低。
|
|
128
|
+
|
|
129
|
+
### 频道聊天是什么?
|
|
130
|
+
|
|
131
|
+
频道聊天是 MostBox 的 P2P 即时通讯功能:
|
|
132
|
+
|
|
133
|
+
- 创建一个频道(如 `alice` 或 `team-project`)
|
|
134
|
+
- 将频道名称分享给朋友
|
|
135
|
+
- 朋友加入后即可实时聊天
|
|
136
|
+
- 消息通过 P2P 网络加密传输,服务器只负责建立连接
|
|
137
|
+
|
|
138
|
+
### 如何使用频道聊天?
|
|
139
|
+
|
|
140
|
+
1. 点击左侧「频道」进入聊天页面
|
|
141
|
+
2. 点击「创建频道」创建新频道
|
|
142
|
+
3. 将频道名称分享给朋友
|
|
143
|
+
4. 朋友打开同一页面,输入频道名称加入
|
|
144
|
+
5. 开始聊天!
|
|
145
|
+
|
|
146
|
+
### 如何在其他设备上下载文件?
|
|
147
|
+
|
|
148
|
+
确保设备已安装 Node.js >= 18,然后运行:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npx most-box
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
浏览器访问 `http://localhost:1976`,输入链接即可下载。
|
|
155
|
+
|
|
156
|
+
或者前往 [Most.Box](https://Most.Box/download) 下载桌面客户端。
|
|
157
|
+
|
|
158
|
+
## 路线图
|
|
159
|
+
|
|
160
|
+
### v1.0(当前版本)
|
|
161
|
+
|
|
162
|
+
- ✅ P2P 文件上传与下载
|
|
163
|
+
- ✅ 确定性 CID 生成
|
|
164
|
+
- ✅ 大文件流式传输
|
|
165
|
+
- ✅ most:// 链接分享
|
|
166
|
+
- ✅ Web UI 界面
|
|
167
|
+
- ✅ P2P 频道聊天
|
|
168
|
+
- ✅ 网络连通性测试
|
|
169
|
+
- ✅ Electron 桌面客户端
|
|
170
|
+
|
|
171
|
+
### 长期规划
|
|
172
|
+
|
|
173
|
+
- [ ] 下载体验优化 - 检测是否可下载
|
|
174
|
+
- [ ] P2P 多人视频/语音通话
|
|
175
|
+
- 基于 WebRTC 的端到端加密通话
|
|
176
|
+
- 频道内一键发起通话
|
|
177
|
+
- 屏幕共享与文字聊天
|
|
178
|
+
- [ ] 浏览器扩展
|
|
179
|
+
- [ ] 移动端支持(iOS/Android)
|
|
180
|
+
|
|
181
|
+
## 技术栈
|
|
182
|
+
|
|
183
|
+
- **前端**: React 19, Next.js 16, TypeScript, Zustand, Lucide React
|
|
184
|
+
- **后端**: Hono + @hono/node-server + WebSocket
|
|
185
|
+
- **P2P**: Hyperswarm 4.x, Hyperdrive 13.x, Corestore 7.x
|
|
186
|
+
- **Web3**: ethers.js, Hardhat, Solidity, EIP-712
|
|
187
|
+
- **桌面**: Electron 41, electron-builder
|
|
188
|
+
- **测试**: Node.js built-in test runner
|
|
189
|
+
|
|
190
|
+
## CI/CD
|
|
191
|
+
|
|
192
|
+
发布新版本时,推送 tag 即可自动构建:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
git tag v0.0.7
|
|
196
|
+
git push origin v0.0.7
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
触发后自动执行:
|
|
200
|
+
1. **npm 包发布** — 发布 `most-box` 到 npm registry
|
|
201
|
+
2. **Windows 打包** — 构建 `.exe` 安装包(x64 + arm64)并上传 Release
|
|
202
|
+
3. **macOS 打包** — 构建 `.dmg` 安装包(x64 + arm64)并上传 Release
|
|
203
|
+
4. **Linux 打包** — 构建 `.AppImage` 安装包(x64 + arm64)并上传 Release
|
|
204
|
+
|
|
205
|
+
electron-builder 自动创建 GitHub Release 并附加所有平台安装包。
|
|
206
|
+
|
|
207
|
+
### 配置 Secrets
|
|
208
|
+
|
|
209
|
+
在仓库 Settings → Secrets and variables → Actions 中添加:
|
|
210
|
+
|
|
211
|
+
| Secret | 说明 |
|
|
212
|
+
|--------|------|
|
|
213
|
+
| `NPM_TOKEN` | npm 发布令牌(`npm token create` 生成) |
|
|
214
|
+
|
|
215
|
+
## 社区
|
|
216
|
+
|
|
217
|
+
- **GitHub Discussions**:[提出需求 & 技术讨论](../../discussions)
|
|
218
|
+
- **问题反馈**:[Github issues](../../issues)
|
|
219
|
+
|
|
220
|
+
## 许可证
|
|
221
|
+
|
|
222
|
+
MIT
|
package/electron/main.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { app, BrowserWindow, Menu } from 'electron'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
6
|
+
const PORT = Number(process.env.MOSTBOX_PORT) || 1976
|
|
7
|
+
|
|
8
|
+
let mainWindow = null
|
|
9
|
+
let engine = null
|
|
10
|
+
|
|
11
|
+
function createWindow() {
|
|
12
|
+
mainWindow = new BrowserWindow({
|
|
13
|
+
width: 1200,
|
|
14
|
+
height: 800,
|
|
15
|
+
minWidth: 800,
|
|
16
|
+
minHeight: 600,
|
|
17
|
+
title: 'MostBox',
|
|
18
|
+
autoHideMenuBar: true,
|
|
19
|
+
webPreferences: {
|
|
20
|
+
nodeIntegration: false,
|
|
21
|
+
contextIsolation: true,
|
|
22
|
+
preload: path.join(__dirname, 'preload.js'),
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
mainWindow.loadURL(`http://localhost:${PORT}`)
|
|
27
|
+
|
|
28
|
+
mainWindow.on('closed', () => {
|
|
29
|
+
mainWindow = null
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function startServer() {
|
|
34
|
+
process.env.ELECTRON_APP = 'true'
|
|
35
|
+
|
|
36
|
+
const { main } = await import('../server/index.js')
|
|
37
|
+
engine = await main()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
app.whenReady().then(async () => {
|
|
41
|
+
try {
|
|
42
|
+
await startServer()
|
|
43
|
+
createWindow()
|
|
44
|
+
Menu.setApplicationMenu(null)
|
|
45
|
+
|
|
46
|
+
app.on('activate', () => {
|
|
47
|
+
if (BrowserWindow.getAllWindows().length === 0) {
|
|
48
|
+
createWindow()
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
} catch (err) {
|
|
52
|
+
console.error('[Electron] Failed to start server:', err)
|
|
53
|
+
app.quit()
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
app.on('window-all-closed', () => {
|
|
58
|
+
if (process.platform !== 'darwin') {
|
|
59
|
+
app.quit()
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
app.on('before-quit', () => {
|
|
64
|
+
if (engine && engine.stop) {
|
|
65
|
+
engine.stop().catch(() => {})
|
|
66
|
+
}
|
|
67
|
+
})
|
package/out/404/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="zh-CN"><head><meta charSet="UTF-8"/><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0
|
|
1
|
+
<!DOCTYPE html><html lang="zh-CN" data-scroll-behavior="smooth"><head><meta charSet="UTF-8"/><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/chunks/0_wia9ofmsi1c.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0bzupvr5gt3k9.js"/><script src="/_next/static/chunks/0pqt~8bl3ukh4.js" async=""></script><script src="/_next/static/chunks/0n~dq4kpx9xxx.js" async=""></script><script src="/_next/static/chunks/0174xh3wfsjm1.js" async=""></script><script src="/_next/static/chunks/turbopack-0a_g3u0ud~jb8.js" async=""></script><script src="/_next/static/chunks/0jl~j62iz2uvr.js" async=""></script><script src="/_next/static/chunks/0d3shmwh5_nmn.js" async=""></script><script src="/_next/static/chunks/02~o2nmo5pmy1.js" async=""></script><meta name="robots" content="noindex"/><link rel="icon" href="/favicon.ico"/><meta name="theme-color" content="#5e6ad2"/><title>MostBox</title><meta name="description" content="P2P 文件分享,无需注册"/><script>
|
|
2
2
|
(function() {
|
|
3
3
|
var theme = localStorage.getItem('theme');
|
|
4
4
|
if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
window.onunhandledrejection = function(event) {
|
|
13
13
|
console.error('[Unhandled Promise Rejection]', event.reason);
|
|
14
14
|
};
|
|
15
|
-
</script><div
|
|
15
|
+
</script><div class="not-found-page"><div class="not-found-card"><div class="not-found-icon"><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-compass" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><path d="m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z"></path></svg></div><h1 class="not-found-title">页面未找到</h1><p class="not-found-desc">你访问的页面似乎已经迷失在 P2P 网络中了</p><div class="not-found-actions"><button class="not-found-btn-secondary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-left" aria-hidden="true"><path d="m12 19-7-7 7-7"></path><path d="M19 12H5"></path></svg>上一页</button><a class="not-found-btn-primary" href="/"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-house" aria-hidden="true"><path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"></path><path d="M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path></svg>回首页</a></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0bzupvr5gt3k9.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[14232,[\"/_next/static/chunks/0jl~j62iz2uvr.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"ErrorBoundary\"]\n3:I[39756,[\"/_next/static/chunks/0jl~j62iz2uvr.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n4:I[37457,[\"/_next/static/chunks/0jl~j62iz2uvr.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\"]\n5:I[36768,[\"/_next/static/chunks/0jl~j62iz2uvr.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"/_next/static/chunks/02~o2nmo5pmy1.js\"],\"default\"]\n6:I[47257,[\"/_next/static/chunks/0jl~j62iz2uvr.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"ClientPageRoot\"]\n9:I[97367,[\"/_next/static/chunks/0jl~j62iz2uvr.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"OutletBoundary\"]\na:\"$Sreact.suspense\"\nd:I[97367,[\"/_next/static/chunks/0jl~j62iz2uvr.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"ViewportBoundary\"]\nf:I[97367,[\"/_next/static/chunks/0jl~j62iz2uvr.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"MetadataBoundary\"]\n11:I[68027,[\"/_next/static/chunks/0jl~j62iz2uvr.js\",\"/_next/static/chunks/0d3shmwh5_nmn.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/0_wia9ofmsi1c.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\",\"\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0_wia9ofmsi1c.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/0jl~j62iz2uvr.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/0d3shmwh5_nmn.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"zh-CN\",\"suppressHydrationWarning\":true,\"data-scroll-behavior\":\"smooth\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"meta\",null,{\"charSet\":\"UTF-8\"}],[\"$\",\"meta\",null,{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1.0\"}],[\"$\",\"link\",null,{\"rel\":\"icon\",\"href\":\"/favicon.ico\"}],[\"$\",\"meta\",null,{\"name\":\"theme-color\",\"content\":\"#5e6ad2\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n (function() {\\n var theme = localStorage.getItem('theme');\\n if (theme === 'dark' || (!theme \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.setAttribute('data-theme', 'dark');\\n }\\n })();\\n \"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n window.onerror = function(message, source, lineno, colno, error) {\\n console.error('[Global Error]', { message, source, lineno, colno, error });\\n };\\n window.onunhandledrejection = function(event) {\\n console.error('[Unhandled Promise Rejection]', event.reason);\\n };\\n \"}}],[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"$L5\",null,{}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$L6\",null,{\"Component\":\"$5\",\"serverProvidedParams\":{\"searchParams\":{},\"params\":{},\"promises\":[\"$@7\",\"$@8\"]}}],[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/02~o2nmo5pmy1.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$a\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@b\"}]}]]}],{},null,false,null]},null,false,\"$@c\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$Ld\",null,{\"children\":\"$Le\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lf\",null,{\"children\":[\"$\",\"$a\",null,{\"name\":\"Next.Metadata\",\"children\":\"$L10\"}]}]}],null]}],false]],\"m\":\"$undefined\",\"G\":[\"$11\",[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/0_wia9ofmsi1c.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"sV38nXrv3xVVO6wvSdFlZ\"}\n"])</script><script>self.__next_f.push([1,"12:[]\nc:\"$W12\"\n7:{}\n8:\"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params\"\n"])</script><script>self.__next_f.push([1,"e:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"b:null\n10:[[\"$\",\"title\",\"0\",{\"children\":\"MostBox\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"P2P 文件分享,无需注册\"}]]\n"])</script></body></html>
|