most-box 0.2.0 → 0.2.2

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.
Files changed (166) hide show
  1. package/README.md +69 -9
  2. package/electron/deepLink.js +29 -0
  3. package/electron/main.js +87 -20
  4. package/out/admin/index.html +0 -0
  5. package/out/app/index.html +0 -0
  6. package/out/assets/AppShell-BOtfY12t.js +1 -0
  7. package/out/assets/FilePreviewOverlay-C5qK9HAE.js +1 -0
  8. package/out/assets/LanguageToggle-Di5b88mK.js +1 -0
  9. package/out/assets/LogoIcon-B2fFe0l1.js +1 -0
  10. package/out/assets/MarketingHeader-BOytKcCc.js +1 -0
  11. package/out/assets/MarketingLayout-B8m1Q7Pa.js +1 -0
  12. package/out/assets/{MarketingThemeToggle-DBaC9bjz.js → MarketingThemeToggle-C6fggkl7.js} +1 -1
  13. package/out/assets/{MilkdownEditor-BqJzntYE.js → MilkdownEditor-Cfze75zl.js} +1 -1
  14. package/out/assets/OpenSidebarButton-DDuALgJ2.js +1 -0
  15. package/out/assets/SidebarAccount-bo1ypzrJ.js +1 -0
  16. package/out/assets/arrow-right-RldN7Rwi.js +1 -0
  17. package/out/assets/circle-alert-BQoSDxUe.js +1 -0
  18. package/out/assets/cloud-DHoTMeZY.js +1 -0
  19. package/out/assets/copy-BtJHJnqH.js +1 -0
  20. package/out/assets/download-Bg-OdoxM.js +1 -0
  21. package/out/assets/downloadValidation-CUvbvj9f.js +1 -0
  22. package/out/assets/external-link-m8ZIQe4p.js +1 -0
  23. package/out/assets/file-text-DG1orIkZ.js +1 -0
  24. package/out/assets/game-s6irY8hS.js +1 -0
  25. package/out/assets/hard-drive-BB-sllXA.js +1 -0
  26. package/out/assets/index-3OD3Chi9.css +1 -0
  27. package/out/assets/index-BSOvFG3o.css +1 -0
  28. package/out/assets/index-C0xqKeu-.css +1 -0
  29. package/out/assets/index-CrAXrmfP.js +31 -0
  30. package/out/assets/index.lazy-0Njp0U6I.js +1 -0
  31. package/out/assets/index.lazy-BTndBeBF.js +1 -0
  32. package/out/assets/index.lazy-Bq39jYTl.js +1 -0
  33. package/out/assets/index.lazy-Bu93oGzJ.js +2 -0
  34. package/out/assets/index.lazy-BvdBwgHx.js +1 -0
  35. package/out/assets/index.lazy-CIx8ist6.js +3 -0
  36. package/out/assets/index.lazy-DK7R297q.js +1 -0
  37. package/out/assets/index.lazy-DVOcrcEB.js +2 -0
  38. package/out/assets/index.lazy-DejOniAm.js +1 -0
  39. package/out/assets/index.lazy-DfsgyiMN.js +1 -0
  40. package/out/assets/index.lazy-DpNIiSXF.js +1 -0
  41. package/out/assets/index.lazy-Vnvz-t7T.js +1 -0
  42. package/out/assets/index.lazy-v7nBJ-sF.js +1 -0
  43. package/out/assets/key-round-DIQ3Xt5F.js +1 -0
  44. package/out/assets/lock-tf1t2yuy.js +1 -0
  45. package/out/assets/message-square-DaQH7q-P.js +1 -0
  46. package/out/assets/mp-DvFTsIL9.js +1 -0
  47. package/out/assets/music-DaFvU2DL.js +1 -0
  48. package/out/assets/notebook-pen-CqEFOHKx.js +1 -0
  49. package/out/assets/play-B7q6F75-.js +1 -0
  50. package/out/assets/plus-H2i2mspM.js +1 -0
  51. package/out/assets/refresh-cw-roxAhABl.js +1 -0
  52. package/out/assets/save-DR0O9ReR.js +1 -0
  53. package/out/assets/search-ncblG-zw.js +1 -0
  54. package/out/assets/send-m1XCcuPn.js +1 -0
  55. package/out/assets/shield-check-BwcvTU4U.js +1 -0
  56. package/out/assets/trash-2-CNpsqYc1.js +1 -0
  57. package/out/assets/triangle-alert-DP9EP7IM.js +1 -0
  58. package/out/assets/upload-V--8p13l.js +1 -0
  59. package/out/assets/useChannelMessages-46C52EyL.js +3 -0
  60. package/out/assets/useGameRoom-BtxPpfck.js +1 -0
  61. package/out/assets/useNavigate-DWlBD_-b.js +1 -0
  62. package/out/assets/userStore-C4vdYsQp.js +4 -0
  63. package/out/assets/wallet-CozFU6yK.js +1 -0
  64. package/out/assets/wifi-DIR3g_8A.js +1 -0
  65. package/out/avatars/default/LICENSE.md +7 -0
  66. package/out/avatars/default/dolphin.svg +25 -0
  67. package/out/avatars/default/owl.svg +60 -0
  68. package/out/avatars/default/panda.svg +29 -0
  69. package/out/avatars/default/snow-mountain.svg +100 -0
  70. package/out/avatars/default/tiger.svg +55 -0
  71. package/out/avatars/default/turtle.svg +34 -0
  72. package/out/chat/index.html +0 -0
  73. package/out/chat/join/index.html +0 -0
  74. package/out/download/index.html +4 -3
  75. package/out/game/gandengyan/index.html +0 -0
  76. package/out/game/index.html +0 -0
  77. package/out/game/zhajinhua/index.html +0 -0
  78. package/out/index.html +4 -3
  79. package/out/note/index.html +0 -0
  80. package/out/ping/index.html +4 -3
  81. package/out/{demo → profile}/index.html +0 -0
  82. package/out/web3/index.html +0 -0
  83. package/package.json +9 -1
  84. package/public/avatars/default/LICENSE.md +7 -0
  85. package/public/avatars/default/dolphin.svg +25 -0
  86. package/public/avatars/default/owl.svg +60 -0
  87. package/public/avatars/default/panda.svg +29 -0
  88. package/public/avatars/default/snow-mountain.svg +100 -0
  89. package/public/avatars/default/tiger.svg +55 -0
  90. package/public/avatars/default/turtle.svg +34 -0
  91. package/server/index.js +36 -7
  92. package/server/src/core/channelIdentity.js +6 -11
  93. package/server/src/core/gameRoom.js +15 -5
  94. package/server/src/core/mostLink.js +8 -7
  95. package/server/src/core/zhajinhua.js +6 -0
  96. package/server/src/games/gandengyan.js +10 -0
  97. package/server/src/http/access.js +63 -12
  98. package/server/src/http/app.js +34 -840
  99. package/server/src/http/nodeStatus.js +101 -9
  100. package/server/src/http/routePolicy.js +2 -0
  101. package/server/src/http/routes/channelRoutes.js +163 -0
  102. package/server/src/http/routes/fileRoutes.js +345 -0
  103. package/server/src/http/routes/nodeRoutes.js +323 -0
  104. package/server/src/http/routes/seedRoutes.js +58 -0
  105. package/server/src/index.js +483 -265
  106. package/server/src/node/config.js +2 -6
  107. package/server/src/utils/avatar.js +59 -3
  108. package/server/src/utils/downloadMessages.js +0 -2
  109. package/out/assets/AppShell-CQhg6DJU.js +0 -1
  110. package/out/assets/ChatUi-BepWs-ZU.js +0 -1
  111. package/out/assets/LanguageToggle-CtzCCAYv.js +0 -1
  112. package/out/assets/LogoIcon-Dxto3Sb4.js +0 -1
  113. package/out/assets/MarketingLayout-BQw0IS2i.js +0 -1
  114. package/out/assets/MoveModal-4D9n11Kw.js +0 -1
  115. package/out/assets/Nav-9MDdvgNs.js +0 -1
  116. package/out/assets/NoteSidebar-C-rIt32H.js +0 -1
  117. package/out/assets/OpenSidebarButton-Dd0JmKuE.js +0 -1
  118. package/out/assets/PemBlock-C8dEIzu-.js +0 -1
  119. package/out/assets/SidebarAccount-ClS-N0lq.js +0 -1
  120. package/out/assets/arrow-right-urE9Rd7j.js +0 -1
  121. package/out/assets/channelApi-BwQU0-h1.js +0 -1
  122. package/out/assets/check-DUNsD2t6.js +0 -1
  123. package/out/assets/chevron-down-D6mpsfv4.js +0 -1
  124. package/out/assets/circle-alert-W0iyN4sC.js +0 -1
  125. package/out/assets/cloud-BMyOoC2x.js +0 -1
  126. package/out/assets/code-B1Cb_Icm.js +0 -1
  127. package/out/assets/copy-C1MttOli.js +0 -1
  128. package/out/assets/download-y7SZXu6E.js +0 -1
  129. package/out/assets/downloadValidation-B0p9Ai_9.js +0 -1
  130. package/out/assets/filePreview-UI9NH34f.js +0 -1
  131. package/out/assets/game-CdU3xnZo.js +0 -1
  132. package/out/assets/hard-drive-D13Qbobu.js +0 -1
  133. package/out/assets/image-DJCA16l_.js +0 -1
  134. package/out/assets/index-8eWJAjpY.css +0 -1
  135. package/out/assets/index-BZc4blbW.css +0 -1
  136. package/out/assets/index-BdaFEQG-.css +0 -1
  137. package/out/assets/index-QxXZzOUL.js +0 -33
  138. package/out/assets/index.lazy-BBTTFanX.js +0 -1
  139. package/out/assets/index.lazy-BG4ZylHD.js +0 -2
  140. package/out/assets/index.lazy-Bi-6ZXZX.js +0 -1
  141. package/out/assets/index.lazy-BixWVr0B.js +0 -1
  142. package/out/assets/index.lazy-BjFwNYy5.js +0 -3
  143. package/out/assets/index.lazy-C8EIQsXY.js +0 -2
  144. package/out/assets/index.lazy-CarNe2uu.js +0 -1
  145. package/out/assets/index.lazy-DEuGu3H3.js +0 -1
  146. package/out/assets/index.lazy-GPyILCA7.js +0 -3
  147. package/out/assets/index.lazy-I8ofndXl.js +0 -1
  148. package/out/assets/index.lazy-TxhWsA7y.js +0 -1
  149. package/out/assets/index.lazy-azfky8k7.js +0 -1
  150. package/out/assets/key-round-CZniN9lv.js +0 -1
  151. package/out/assets/lock-D5OSNhep.js +0 -1
  152. package/out/assets/log-out-B6phyZ5z.js +0 -1
  153. package/out/assets/music-CbUskKgg.js +0 -1
  154. package/out/assets/notebook-pen-DqKDQ6MJ.js +0 -1
  155. package/out/assets/play-BIl8q9eU.js +0 -1
  156. package/out/assets/plus-BxxbpH6Q.js +0 -1
  157. package/out/assets/save-DkH1n_Ov.js +0 -1
  158. package/out/assets/search-BQi5Z0E-.js +0 -1
  159. package/out/assets/send-Cl6NtD2T.js +0 -1
  160. package/out/assets/trash-2-BBjpgK_f.js +0 -1
  161. package/out/assets/triangle-alert-l98G8u9O.js +0 -1
  162. package/out/assets/upload-ByP6Ydde.js +0 -1
  163. package/out/assets/useChannelMessages-BgbYfF2c.js +0 -3
  164. package/out/assets/useGameRoom-DPmweWwe.js +0 -1
  165. package/out/assets/wallet-c7zIhNSM.js +0 -1
  166. package/out/assets/wifi-Bm4biAjc.js +0 -1
@@ -0,0 +1,100 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 25.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
5
+ <path style="fill:#88B154;" d="M65.03,92.69c0,0-60.23,18.39-60.36,19.72c-0.13,1.33,24.11,12.02,64.62,11.46
6
+ c38.64-0.53,53.57-10.39,53.83-11.46S66.36,92.42,65.03,92.69z"/>
7
+ <path style="fill:#9EA2A3;" d="M62.26,42.15l-4.31-5.42c0,0-6.96,7.3-8.84,9.29c-1.88,1.99-3.33,3.14-4.23,5.01
8
+ c-1.29,2.67-5.38,25.72-5.38,25.72L27.67,88.9c0,0-2.23-1.39-2.78-0.94S6.22,110.01,6.22,110.01l-1.56,2.39c0,0,3.6,0.8,4.71,0.69
9
+ c0.54-0.05,3.2-0.66,6.21-0.97c3.17-0.33,7.22-0.06,7.67-0.11c0.51-0.05,2.27-0.57,2.27-0.57l15.74-9.39l12.5-0.48l12.26,2.58
10
+ l23.21,1.11l12.71-19.01L74.31,49.66L62.26,42.15z"/>
11
+ <path style="fill:#717A7C;" d="M28.55,97.77c0,0-0.43-1.23-0.75-2.14c-0.32-0.91-0.13-6.73-0.13-6.73s7.21,4.26,8.01,4.96
12
+ s7.94,5.15,7.94,5.15l4.3-0.11l0.87,1.93c0,0-6.19,2.94-8.23,3.59c-2.04,0.64-15.11,7.29-15.09,7.04c0.04-0.52,3.4-5.33,3.4-5.33
13
+ L28.55,97.77z"/>
14
+ <path style="fill:#798082;" d="M80.73,103.46l-49.26,7.78c0,0-2.38,2.11-2.14,2.67c0.24,0.56,9.33,2.25,12.47,2.65
15
+ c3.14,0.4,24.61,1.61,26.94,1.45c2.33-0.16,26.14-1.37,29.44-1.77c3.3-0.4,14.39-1.17,15.12-1.5c1.41-0.64,7.88-4.13,7.88-4.13
16
+ s-7.24-11.42-8.69-14.16c-1.45-2.73-3.86-7.64-5.55-9.33s-2.9-2.41-2.9-2.41s-2.28-5.3-4.94-8.68c-2.65-3.38-6.28-8.85-7.13-9.69
17
+ c-3.19-3.18-3.28-3.48-3.28-3.48l2,24.1c0,0-3.7,7.4-4.99,9.41C84.43,98.4,80.73,103.46,80.73,103.46z"/>
18
+ <path style="fill:#717A7C;" d="M63.03,27.62l-0.97,19.62l11.41,7.08c0,0,3.43,8.79,3.59,9.6c0.16,0.8-0.15,2.97,0.17,3.53
19
+ c0.32,0.56,6.23,4.63,6.46,4.64c1.31,0.07,4.02-0.4,3.86-0.64s1.08-5.46,1.08-5.46s-7.84-12.71-9.53-16.25
20
+ c-1.69-3.54-8.04-12.71-8.77-14.24s-4.18-6.6-4.91-7.4S63.52,27.06,63.03,27.62z"/>
21
+ <path style="fill:#C0C0C0;" d="M68.02,65.05c0,0,5.39-8.88,5.55-10.24s-4.34-9.65-5.47-12.63c-1.13-2.98-4.1-9.09-4.42-9.89
22
+ c-0.32-0.8-0.64-4.66-0.64-4.66s-2.25,2.41-3.06,4.34c-0.8,1.93-3.83,6.68-3.83,6.68s1.9,11.02,2.63,15.76
23
+ c0.72,4.75,1.26,10.98,1.15,11.21c-0.69,1.4-5.33,12.68-5.33,12.68s-0.6,5.47-0.04,6.03c0.56,0.56,3.81,1.3,4.06,0.92
24
+ c0.49-0.73,0.48-3.5,0.48-3.5s9.02-12.18,9.31-12.78C68.52,68.74,68.02,65.05,68.02,65.05z"/>
25
+ <path style="fill:#C0C0C0;" d="M49.64,65.92c-0.03-1.21-1.8-6.95-2.12-8.24c-0.32-1.29-1-7.66-1.89-7.66
26
+ c-0.88,0-4.96,11.22-5.37,12.27c-0.4,1.05-6.11,13.35-6.84,14.8c-0.72,1.45-4.02,7.72-4.66,8.77s-1.49,2.83-1.49,2.83l16.34,10.33
27
+ l5.9-0.67c0,0-3.45-9.27-4.26-11.36s-1.77-5.47-1.77-5.47s1.87-4.48,3.09-7.7C47.8,70.58,49.68,67.12,49.64,65.92z"/>
28
+ <path style="fill:#C0C0C0;" d="M25.32,87.97c0.04,0.15,0.25,3.92,0.14,6.17c-0.11,2.26-0.55,4.52-0.55,4.52l-7.28,7.6l-0.23,1.71
29
+ c0,0-11.06,3.91-11.78,4.13c-0.72,0.22-0.95,0.3-0.95,0.3s-1.5-0.91,2.99-5.81c5.8-6.33,13.22-15,14.16-16.09
30
+ C23.49,88.57,25.21,87.52,25.32,87.97z"/>
31
+ <path style="fill:#33632C;" d="M106.71,99.82c-0.6-0.25-2.13,6.52-2.45,8.91c-0.32,2.39-1.17,6.93-0.95,7.38
32
+ c0.64,1.27,7.46,0.43,8.12-0.66c0.19-0.31-0.77-5.4-1.46-7.55C109.03,104.96,108.26,100.47,106.71,99.82z"/>
33
+ <path style="fill:#33632C;" d="M118.66,91.29c-0.94,0.04-1.94,8.25-2.56,10.04c-0.7,2.03-3.04,11.64-2.07,12.74
34
+ c0.97,1.1,4.68,0.23,6.06-0.17c1.33-0.38,2.48-1.02,2.8-1.73s-0.44-6.44-1.36-10.44C120.59,97.68,120.14,91.22,118.66,91.29z"/>
35
+ <path style="fill:#C0C0C0;" d="M31.47,111.25c0,0,2.59,0.98,11.46,1.53c8.87,0.55,13.23,0.5,13.23,0.5l20.26-2.96l4.6-7.28
36
+ c0,0-6.12-0.23-9.37-0.34c-3.25-0.11-8.1-0.13-8.32-0.73c-0.22-0.61,5.47-4.74,7.07-5.56c1.6-0.83,5.46-1.27,6.34-2.2
37
+ c0.88-0.94,12-7.21,13.37-7.26c1.38-0.06,5.68,2.59,6.5,2.31c0.83-0.28-2.86-10.04-3.35-11.87c-0.04-0.16-1.99-9.67-2.05-9.85
38
+ c-0.46-1.41-1.87-5.07-2.76-4.63c-0.88,0.44-2.37,3.8-3.47,7.16s-1.76,5.13-2.31,5.95s-6.94,4.91-7.83,5.84
39
+ c-0.88,0.94-3.53,2.92-5.13,3.58c-1.6,0.66-3.14,0.66-4.3,1.71c-1.16,1.05-2.59,2.87-4.19,4.57c-1.6,1.71-4.85,5.63-5.92,6.59
40
+ s-2.03,1.89-2.03,1.89s-7.73,2.19-10.33,3.45C40.36,104.92,30.8,111.08,31.47,111.25z"/>
41
+ <path style="fill:#FFFFFF;" d="M111.79,52.02c-0.85,0.85-0.88,2.2,0.06,2.97c0.83,0.69,2.2,0.24,2.71-0.38
42
+ c0.51-0.62,0.45-1.97-0.23-2.65S112.3,51.51,111.79,52.02z"/>
43
+ <path style="opacity:0.5;fill:#FFFFFF;" d="M112.07,64.67c-0.91,1-0.61,2.49,0.23,3.04c0.84,0.55,2.1,0.5,2.72-0.26
44
+ c0.55-0.68,0.61-2.04-0.23-2.88C114.06,63.84,112.66,64.02,112.07,64.67z"/>
45
+ <path style="opacity:0.6;fill:#FFFFFF;" d="M86,32.06c-0.26,0.83,0.26,1.77,1.05,1.91c0.83,0.15,1.68-0.09,1.91-0.88
46
+ c0.23-0.8-0.06-1.8-1.2-2C86.62,30.89,86.13,31.61,86,32.06z"/>
47
+ <path style="fill:#FFFFFF;" d="M94.54,46.11c0,0,0.74-2.72,1.28-2.81c0.54-0.09,1.62,2.92,1.62,2.92s2.69,0.09,2.78,0.51
48
+ c0.09,0.43-1.9,2.04-1.9,2.04s0.74,2.52,0.43,2.84c-0.31,0.31-2.78-1.28-2.78-1.28s-2.21,1.87-2.72,1.53
49
+ c-0.51-0.34,0.43-3.15,0.43-3.15s-2.1-1.5-2.13-2.01C91.51,46.19,94.54,46.11,94.54,46.11z"/>
50
+ <path style="fill:#FFFFFF;" d="M33.54,38.62c0,0,0.97-2.79,1.56-2.82c0.58-0.03,1.43,2.79,1.43,2.79s2.88,0.03,3.08,0.45
51
+ c0.25,0.54-1.85,2.37-1.85,2.37s0.68,2.72,0.36,3.05c-0.36,0.36-2.85-1.07-2.85-1.07s-2.56,1.78-3.11,1.3
52
+ c-0.48-0.42,0.52-3.31,0.52-3.31s-2.4-1.75-2.27-2.24C30.58,38.46,33.54,38.62,33.54,38.62z"/>
53
+ <path style="opacity:0.5;fill:#FFFFFF;" d="M11.86,46.11c-0.6-0.03-1.42,0.57-1.42,1.6c0,0.76,0.73,1.39,1.36,1.39
54
+ c0.91,0,1.54-0.69,1.51-1.48C13.27,46.59,12.49,46.14,11.86,46.11z"/>
55
+ <path style="fill:#FFFFFF;" d="M18.47,61.03c0.06,1.14,0.63,2.11,2.11,2.07s2.7-2.31,1.29-3.64C20.46,58.13,18.39,59.5,18.47,61.03z
56
+ "/>
57
+ <path style="fill:#FFFFFF;" d="M8.65,74.98c0.7,0.78,2.38,0.47,2.42-0.9c0.04-1.25-0.59-1.84-1.76-1.68
58
+ C8.15,72.56,7.8,74.03,8.65,74.98z"/>
59
+ <path style="fill:#FFFFFF;" d="M28.46,90.36l-1.83-2.32l-3.57,1.64l-8.3,13.42l2.84,3.2c0,0,6.95-3.82,7.69-3.97
60
+ c1.11-0.23,4.83-0.08,4.83-0.08L28.46,90.36z"/>
61
+ <path style="fill:#8CC2EA;" d="M28.73,102.23l5.62,0.1c0,0,6,1.87,8.6,1.32c2.6-0.55,5.54-2.95,5.54-2.95s2.27-0.92,1.14-2.23
62
+ c-0.26-0.3-1.96-0.77-6.59-1.93s-5.23-2.06-5.23-2.06s-5.39-3.74-7.32-5.19c-1.93-1.45-3.84-1.47-3.84-1.47s1.24,4.58,1.52,7.33
63
+ C28.44,97.9,28.73,102.23,28.73,102.23z"/>
64
+ <path style="fill:#C6E4F7;" d="M5.76,108.94c-0.7,0.85,4.39-0.68,6.34-1.15c2.49-0.6,5.52-1.51,5.52-1.51l0.8-6.08
65
+ c0,0,5.21-9.36,5.89-10.14s3.32-2.09,3.32-2.09s-1.58-0.79-2.67-0.85c-1.85-0.1-5.38,4.01-7.22,6.42c-1.83,2.41-5.02,6.76-5.02,6.76
66
+ s-1.49,0.4-3.01,2.54C7.42,106.08,5.76,108.94,5.76,108.94z"/>
67
+ <path style="fill:#33632C;" d="M39.8,90.59c-0.68-0.07-1.54,2.2-2,3.89c-0.33,1.19-2.46,7.22-2.71,8.39
68
+ c-0.26,1.18-1.58,4.66-1.22,4.82c0.36,0.15,1.53,0.42,2.15,0.17c0.16-0.06,2.33-1.56,3.9-2.5c1.57-0.94,3.12-1.79,3.12-1.85
69
+ c0-0.61-1.2-6.23-1.33-6.98C41.34,94.38,40.86,90.7,39.8,90.59z"/>
70
+ <path style="fill:#33632C;" d="M45.91,92.85c-0.59,0.2-1.32,2.48-2.01,4.84c-0.44,1.49-1.72,5.96-1.41,6.18
71
+ c0.31,0.22,3.34,0.26,4.62-0.38c1.23-0.62,2.11-1.4,2.27-1.84c0.16-0.44-1.24-4.32-1.78-5.74C47.18,94.84,46.53,92.63,45.91,92.85z"
72
+ />
73
+ <path style="fill:#9EA2A3;" d="M46.59,70.45l-12.36,4.93l-0.99,2.13c0,0,1.92,2.15,3.26,3.6c1.16,1.25,4.26,2.91,4.81,4.03
74
+ c1.08,2.2,5.31,4.46,7.42,5.52s2.2-0.18,2.2-0.18L46.59,70.45z"/>
75
+ <path style="fill:#9EA2A3;" d="M51.86,99.47l-2.46,1.79c0,0,2.65,1.77,4.61,2.36c1.96,0.59,5.1,1.76,8.43,2.35
76
+ c3.33,0.59,6.47,0.2,8.62,0.39c2.16,0.2,6.56,2.38,6.56,2.38s0.93-1.91,1.86-3.23c0.93-1.31,1.24-2.04,1.24-2.04l-8.46-1.84
77
+ L51.86,99.47z"/>
78
+ <path style="fill:#33632C;" d="M76.52,106.03c-0.72,0.06-1.73,5.46-2.09,6.66c-0.2,0.68-1.87,5.33-1.42,6.11
79
+ c0.9,1.6,8.3,1.17,8.63,0.33c0.32-0.84-2.11-6.46-2.56-7.5C78.62,110.61,77.58,105.94,76.52,106.03z"/>
80
+ <path style="fill:#FFFFFF;" d="M45.93,49.43L35.02,76.17c0,0,0.68,1.06,1.64,2.22c0.97,1.16,4.54,4.05,5.7,4.92s1.26,1.64,2.7,2.61
81
+ c1.45,0.97,6.66,3.48,8.5,4.44c1.83,0.97,4.92,2.61,4.92,2.61s-3.09,3.19-3.96,4.44c-0.87,1.26-1.61,2.48-1.61,2.48l15.99,2.44
82
+ c0,0,27.88-12.48,27.7-13.09s-1.15-14.13-1.73-14.81c-0.58-0.68-6.47-10.14-6.47-10.14l-5.89-0.87l-9.27-17.57l-9.75-15.93
83
+ l-6.66,10.33l-3.57,6.56L45.93,49.43z"/>
84
+ <path style="fill:#8CC2EA;" d="M58.58,87.17c-0.11,0.67,1.64,3.48,2.41,3.38c0.77-0.1,5.31-4.05,6.47-4.83
85
+ c1.16-0.77,7.92-5.12,9.46-6.08c1.54-0.97,5.6-4.51,5.89-5.02c0.38-0.69,1.59-6.9,1.83-7.72c0.11-0.36,2.4-2.16,2.65-1.85
86
+ c0.5,0.61,2.66,6.58,3.14,8.22c0.48,1.64,3.38,13.23,3.57,14c0.29,1.14,2.41,3.28,4.15,2.22c1.74-1.06,6.51-2.97,7.07-3.88
87
+ c0.3-0.48-3.82-6.53-6.03-9.69s-4.26-6.48-6.3-9.31c-1.67-2.32-2.71-3.76-3.82-4.35c-1.12-0.59-2.07,0.78-2.07,0.78
88
+ s-8.16-14.11-9.61-16.62c-1.45-2.51-9.12-14.56-11.03-17.33c-1.25-1.82-2.03-2.35-3.2-1.68c-1.17,0.66-0.54,5.59-0.54,5.59
89
+ s10.93,20.92,10.43,22.3c-0.51,1.38-4.54,8.79-6.76,13.23C64.08,72.98,58.87,85.44,58.58,87.17z"/>
90
+ <path style="fill:#C6E4F7;" d="M46.93,51.59c0.8-1.2,7.69,14.34,9.43,14.53s2.9-11.87,2.7-14.58c-0.19-2.7,0-11.68,0.77-13.61
91
+ c0.77-1.93,2.8-4.92,2.8-4.92s1.13-2.4,1.24-3.04c0.33-1.85-0.11-2.82-0.11-2.82s-1.13,0.26-2.2,1.71
92
+ c-1.06,1.45-5.43,9.78-5.43,9.78s-5.48,5.48-7.02,6.54c-1.54,1.06-3.77,2.41-4.25,3.28c-0.48,0.87-4.25,11.35-6.08,15.54
93
+ c-2.28,5.24-4.48,9.7-4.56,11.38c-0.02,0.33,1.8,2.22,1.8,2.22s1.53-2.94,3.36-7.76S46.14,52.79,46.93,51.59z"/>
94
+ <path style="fill:#C6E4F7;" d="M54.05,98.12c0,0-1.45,1.89-1.28,2.18c0.48,0.82,7.55,2.89,8.8,3.09s8.4,0.87,10.81,0.68
95
+ c2.41-0.19,8.34-0.61,8.34-0.61s3.92-4.7,4.88-5.48c0.97-0.77,6.08-2.7,6.08-2.7l6.32-5.7c0,0-1.84-0.13-2.75-0.67
96
+ s-1.25-1.65-1.25-1.65s-4.44,2.51-6.28,3.48c-1.83,0.97-8.88,3.28-10.91,4.44s-7.72,4.05-7.72,4.05s-10.04,0.77-11.01,0.48
97
+ C57.13,99.44,54.05,98.12,54.05,98.12z"/>
98
+ <path style="opacity:0.5;fill:#FFFFFF;" d="M35.53,20.08c-0.91,1-0.61,2.49,0.23,3.04c0.84,0.55,2.1,0.5,2.72-0.26
99
+ c0.55-0.68,0.61-2.04-0.23-2.88C37.52,19.26,36.11,19.44,35.53,20.08z"/>
100
+ </svg>
@@ -0,0 +1,55 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
5
+ <path style="fill:#FFD2B1;" d="M14.72,40.48c0,0-10.98,19.29-10,35.76s5.35,20.55,15.77,25.48c10.42,4.93,10.56-49.55,10.56-49.55
6
+ L14.72,40.48z"/>
7
+ <path style="fill:#FFD2B1;" d="M112.84,37.95L98.39,54c0,0,2.35,48.85,4.74,49.27c2.39,0.42,14.5-4.79,18.3-12.53
8
+ s2.14-20.7,1.27-25.2C121.01,56.81,112.84,37.95,112.84,37.95z"/>
9
+ <path style="fill:#FF8E01;" d="M64.23,8.81c-10.42-0.13-20.08,3.24-20.08,3.24S26.69-0.62,14.86,9.51
10
+ C0.09,22.18,13.17,40.76,14.3,42.03s6.19,13.23,6.19,13.23s-3.1,12.11-3.24,20.55c-0.2,11.84,2.39,25.53,2.39,25.53
11
+ s4.93,2.21,9.43,3.75c3.62,1.24,5.91,1.55,7.18,2.53c1.27,0.99,9.43,12.39,19.01,13.94c8.45,1.37,21.96,0.42,29.28-7.32
12
+ c5.61-5.93,6.76-7.46,7.74-8.02c0.99-0.56,13.33-3.33,13.33-3.33s4.27-20.74,4.27-29.75s-1.13-16.19-1.13-16.19l4.79-12.39
13
+ c0,0,15.49-19.85,1.27-31.96c-13.09-11.15-27.87,0.84-27.87,0.84S75.49,8.95,64.23,8.81z"/>
14
+ <path style="fill:#FF6011;" d="M19.08,16.41c8.45-7.34,15.63-0.14,15.63,0.56c0,0.34-4.92,3.23-8.87,6.9
15
+ c-4.2,3.9-7.45,8.59-7.88,8.59C17.11,32.46,11.62,22.89,19.08,16.41z"/>
16
+ <path style="fill:#FF6011;" d="M109.47,18.38c-5.2-4.79-13.66-0.7-13.94,0c-0.14,0.35,4.5,3.55,8.02,7.04
17
+ c3.65,3.62,6.75,7.67,7.04,7.74C111.15,33.3,116.5,24.86,109.47,18.38z"/>
18
+ <path style="fill:#FFD2B1;" d="M39.78,87.36c0,0-0.29,28.59,22.81,27.87c27.17-0.84,23.51-26.61,23.51-26.61L39.78,87.36z"/>
19
+ <path style="fill:#FEA7A5;" d="M63.43,81.17c0,0-18.58,9.71-18.44,9.15c0.07-0.27,4.63,3.25,9.38,7c5.19,4.1,18.76,1.14,18.76,1.14
20
+ l8.89-8.01L63.43,81.17z"/>
21
+ <path style="fill:#FFFFFF;" d="M64.56,64.13c0,0-22.52-10.84-30.13-0.28s0,21.4,5.35,23.51s13.8,9.43,13.8,9.43s1.41-2.96,1.27-4.36
22
+ c-0.14-1.41-1.13-5.77-1.13-5.77l9.71-5.49l7.88,7.18c0,0-1.13,7.18-0.56,8.02s4.93-0.99,4.93-0.99l2.25-7.04
23
+ c0,0,5.4-0.33,8.92-0.75c3.52-0.42,10.93-5.3,10.09-13.89s-8.59-13.51-14.5-13.37C76.52,60.47,64.56,64.13,64.56,64.13z"/>
24
+ <path style="fill:#2F2F2F;" d="M90.88,86.66c-0.58-1.44-10.14-1.83-16.33-5.49c-6.5-3.84-6.05-8.31-6.05-8.31s4.68-2.39,8.87-5.49
25
+ c4.19-3.1,7.79-6.84,6.62-8.87c-2.77-4.79-11.54,1.55-19.85,1.13c-8.03-0.41-18.61-5.28-20.41-2.67c-1.9,2.75,1.85,7.02,6.34,10.28
26
+ c4.49,3.26,9.71,5.49,9.71,5.49s0,5.63-7.18,8.73c-8.02,3.46-15.58,3.24-16.05,3.66c-1.41,1.27,0.53,2.66,2.11,3.24
27
+ c1.55,0.56,3.24,0.56,3.24,0.56s1.27,10.98,21.54,11.4c19.71,0.41,20.41-9.85,20.41-9.85s1.97-0.42,3.84-1.11
28
+ S91.3,87.71,90.88,86.66z M63.15,95.67c-11.68-0.14-15.63-5.49-15.63-5.49s4.36,0,7.46-0.7c3.83-0.87,8.31-4.65,8.31-4.65
29
+ s3.65,3.84,6.76,4.93c2.82,0.99,8.02,1.55,8.02,1.55S74.83,95.81,63.15,95.67z"/>
30
+ <path style="fill:#2F2F2F;" d="M47.94,41.61c0,3.46-2.98,6.33-6.48,6.9c-3.45,0.56-6.62-2.46-6.48-7.04
31
+ c0.11-3.46,3.08-5.63,6.62-5.63S47.94,37.88,47.94,41.61z"/>
32
+ <path style="fill:#2F2F2F;" d="M86.94,48.23c-3.28-1.11-5.25-3.92-4.42-7.9c0.9-4.35,3.94-6.09,8.22-4.49
33
+ c3.24,1.21,4.76,5.31,3.73,8.69C93.56,47.52,90.47,49.42,86.94,48.23z"/>
34
+ <path style="fill:#2F2F2F;" d="M102.05,41.14c-1.37,1.55-5.2,0.34-5.73,2.44c-0.75,3,7.23,5.63,10.14,1.78
35
+ c2.91-3.85-0.37-12.43-3.1-10.61C101.68,35.88,103.46,39.54,102.05,41.14z"/>
36
+ <path style="fill:#2F2F2F;" d="M109.47,38.32c-1.06,0.43,0.19,3.85,0.66,6.48s0,7.04-1.5,8.82c-1.5,1.78-2.91,1.31-2.91,1.31
37
+ s-3.56-6.42-5.44-3.85c-1.78,2.44,2.06,2.82,1.6,7.6c-0.47,4.79-3.78,7.17-0.38,7.88c1.78,0.38,3.57-2.91,3.57-2.91
38
+ s5.82,0.09,8.73-6.76c2.19-5.15,0.84-9.01-0.19-12.95S109.93,38.14,109.47,38.32z"/>
39
+ <path style="fill:#2F2F2F;" d="M110.03,69.2c-3.57,3.94-8.82,8.35-9.2,9.48c-0.38,1.13-0.38,3.75,4.79,2.91s10.04-5.63,11.59-8.59
40
+ c2.03-3.87,2.77-10.37,1.64-12.72c-1.13-2.35-3.19-1.22-3.85,0.75C114.35,63.01,111.39,67.7,110.03,69.2z"/>
41
+ <path style="fill:#2F2F2F;" d="M28.56,38.79c-0.09-2.35,2.25-4.41,0.84-5.63c-1.87-1.62-6.95,2.82-5.35,8.17s7.92,4.69,8.96,3.85
42
+ c1.74-1.41,0.46-2.66-0.47-3.1C31.1,41.4,28.65,41.08,28.56,38.79z"/>
43
+ <path style="fill:#2F2F2F;" d="M23.87,52.59c0,0,2.16-3.57,3.94-2.06c1.78,1.5-2.16,4.04-1.69,8.35s2.91,7.51,1.69,8.73
44
+ c-1.69,1.69-4.32-1.88-5.16-3.19c-0.84-1.31-1.41-3.1-1.41-3.1s-5.82-4.79-6.85-10.7c-0.8-4.57,0.47-9.85,3.28-12.39
45
+ c1.92-1.73,2.89-1.71,3.66-0.94c1.13,1.13-1.88,5.63-0.84,10.04C21.52,51.75,23.87,52.59,23.87,52.59z"/>
46
+ <path style="fill:#2F2F2F;" d="M19.84,69.67c-2.58-3.22-7.18-10.77-8.92-10.14c-2.06,0.75-1.69,10.53,3.19,16.14
47
+ c6.19,7.13,14.17,7.04,15.11,4.13C29.91,77.66,24.34,75.3,19.84,69.67z"/>
48
+ <path style="fill:#2F2F2F;" d="M58.36,9.02c0,0,0.7,5.07-4.86,6.69s-8.94-0.44-8.73,4.08c0.11,2.25,2.51,3.37,4.93,3.52
49
+ c2.42,0.15,4.82-0.75,6.12-1.27c2.82-1.13,7.32-6.69,8.09-6.83c0.77-0.14,3.17,3.8,8.02,5.91c2.22,0.96,5.04,1.77,7.2,1.48
50
+ c2.27-0.3,4.17-1.83,3.99-4.79C83,15.57,79.76,16.69,74.41,15s-4.6-5.82-4.6-5.82s-3.99-0.38-5.96-0.38
51
+ C61.88,8.81,58.36,9.02,58.36,9.02z"/>
52
+ <path style="fill:#2F2F2F;" d="M64.2,20c-1.1-0.02-3.73,3.52-6.19,4.72s-7.74,1.48-8.38,3.73c-0.63,2.25,1.34,4.93,6.69,4.22
53
+ c5.54-0.73,7.39-5.07,8.09-5.14c0.7-0.07,2.96,5.07,9.01,5.56c5.21,0.42,6.64-4.01,5-5.49c-2.25-2.04-6.26-2.53-8.24-3.45
54
+ C67.84,23.06,65.19,20.02,64.2,20z"/>
55
+ </svg>
@@ -0,0 +1,34 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
5
+ <path style="fill:#BDCF47;" d="M112.7,59.21c0,0,3.94-2.21,4.93-2.77c0.99-0.56,4.6-2.82,5.91-0.84c0.77,1.16-0.7,4.44-3.05,7.86
6
+ c-2.14,3.13-7.12,9.56-7.4,10.83c-0.28,1.27,1.11,6.36,1.53,8.33c0.42,1.97,1.74,6.71,1.17,8.54s-3.43,6.85-10.75,6.76
7
+ c-5.82-0.07-7.51-1.78-7.7-2.82c-0.14-0.75-0.56-3.24-0.56-3.24s-4.79,2.96-7.04,4.08s-8.31,4.22-8.31,4.22s1.17,5.35,1.36,7.51
8
+ c0.19,2.16,0.86,5.25-0.28,7.32c-1.03,1.88-4.25,5.02-11.83,4.97c-5.92-0.04-7.41-1.88-8.35-3c-0.94-1.13-1.13-6.48-1.13-7.6
9
+ s-0.19-5.07-0.19-5.07s-8.02-0.4-12.86-0.75c-4.38-0.32-10.16-0.99-10.16-0.99s0.21,2.33,0.42,4.01c0.19,1.5,0.23,4.64-1.34,6.17
10
+ c-2.11,2.06-7.56,2.21-10.56,1.92c-3-0.28-7.18-1.83-8.4-4.55c-1.22-2.72,0.38-6.29,1.03-8.35c0.58-1.81,1.6-4.41,1.22-5.16
11
+ c-0.38-0.75-4.04-1.69-9.29-6.95c-5.26-5.26-12.13-23.52,3.28-36.23c15.49-12.76,43.81,1.1,45.31,2.04
12
+ C61.2,56.41,112.7,59.21,112.7,59.21z"/>
13
+ <path style="fill:#6E823A;" d="M66.25,25.28C52.32,25.9,41.87,32.8,36.68,40.34c-3.1,4.5-4.65,7.74-4.65,7.74s4.81,0.14,9.15,2.46
14
+ c5,2.67,10.8,5.56,14.61,18.13c2.87,9.5,3.98,18.53,11.44,20.52c8.45,2.25,28.16,1.13,37.59-8.02s11.26-16.05,8.87-25.06
15
+ s-13.17-25.05-28.16-29.28C79.06,25,72.58,25,66.25,25.28z"/>
16
+ <path style="fill:#484E23;" d="M111.93,51.32c-0.42-0.99-1.3-2.5-1.3-2.5s-0.07,2.05-0.25,3.13c-0.28,1.76-1.25,5.42-1.81,4.88
17
+ c-1-0.97-5.73-6.92-7.98-10.23c-1.71-2.52-7.6-9.11-7.74-11.26c-0.07-1.06,1.27-4.65,1.27-4.65s-1.22-0.7-2.35-1.34
18
+ c-0.88-0.49-2.16-1.03-2.16-1.03s-0.77,4.9-1.62,5.82c-0.75,0.81-5.32,2.6-8.87,3.94c-4.29,1.62-8.45,3.73-10,4.01
19
+ c-1.36,0.25-9.09-1.41-12-1.97c-3.66-0.7-9.18-2.26-10.45-3.17c-1.48-1.06-3.07-3.78-3.07-3.78s-0.89,0.61-1.78,1.31
20
+ c-0.88,0.69-2.02,2.06-2.02,2.06s2.31,2.32,2.44,3.18c0.18,1.2-1.27,2.83-2.46,4.38c-0.72,0.93-2.75,4.85-2.75,4.85
21
+ s0.97,0.09,2.15,0.63c1.23,0.57,2.38,1.16,2.38,1.16s2.97-6.9,4.9-7.53c1.65-0.54,6.3,0.99,9.68,1.69
22
+ c4.79,0.99,9.64,1.87,10.66,3.17c1.06,1.34,2.06,6.68,3.03,11.19C70.89,64.2,73.64,77.02,73,78c-0.63,0.99-5.7,0.63-8.59,0.28
23
+ c-2.45-0.3-6.41-1.76-6.41-1.76s0.58,2.11,0.77,2.67c0.28,0.81,1.16,3.06,1.16,3.06s5.67,2.5,22.42,0.95s25.03-12.96,27.38-18.02
24
+ c3.14-6.78,3.54-10.39,3.54-10.39S112.35,52.31,111.93,51.32z M96.65,73.21c-4.24,2.67-15.2,5.49-17.18,4.43
25
+ c-1.58-0.85-3.94-13.94-5.07-19.78c-0.72-3.74-2.45-9.42-1.41-11.19c0.7-1.2,4.79-2.99,7.81-4.4c2.87-1.33,6.97-3.13,8.17-2.99
26
+ c1.7,0.2,5.35,6.12,9.01,11.19c3.66,5.07,7.67,10.35,7.74,12.18C105.81,64.49,101.02,70.47,96.65,73.21z"/>
27
+ <path style="fill:#2A2B28;" d="M41.18,65.86c0.5,2.83-0.95,5.75-4.07,6.02c-2.56,0.22-4.59-1.57-5.09-4.4
28
+ c-0.5-2.83,1.14-5.49,3.68-5.94C38.22,61.09,40.68,63.02,41.18,65.86z"/>
29
+ <path style="fill:#2A2B28;" d="M22.82,66.11c0.07,2.84-2.42,5.69-5.5,5.11c-2.53-0.48-3.99-2.73-3.71-5.55
30
+ c0.29-2.82,2.59-4.9,5.15-4.65S22.75,63.15,22.82,66.11z"/>
31
+ <path style="fill:#2A2B28;" d="M30.77,76.59c1.16-0.79,3.1-2.67,4.36-1.06c1.27,1.62-0.92,3.1-2.18,4.01
32
+ c-1.27,0.92-4.08,3.17-6.12,3.17c-1.9,0-4.79-2.32-6.62-3.87c-1.49-1.26-2.18-2.89-1.34-3.87s2.14-0.62,3.24,0.35
33
+ c1.27,1.13,3.72,3.38,4.72,3.38C27.81,78.71,29.22,77.65,30.77,76.59z"/>
34
+ </svg>
package/server/index.js CHANGED
@@ -18,8 +18,31 @@ import {
18
18
 
19
19
  export { createApp } from './src/http/app.js'
20
20
 
21
- const PORT = DEFAULT_NODE_PORT
22
- const HOST = DEFAULT_NODE_HOST
21
+ export function parseRuntimeArgs(argv = process.argv.slice(2)) {
22
+ const options = {}
23
+
24
+ for (let index = 0; index < argv.length; index += 1) {
25
+ const arg = argv[index]
26
+ if (arg === '--host') {
27
+ options.host = String(argv[index + 1] || '').trim()
28
+ index += 1
29
+ } else if (arg.startsWith('--host=')) {
30
+ options.host = arg.slice('--host='.length).trim()
31
+ }
32
+ }
33
+
34
+ return options
35
+ }
36
+
37
+ function getRuntimeHost(nodeConfig, runtimeArgs) {
38
+ return runtimeArgs.host || nodeConfig.host || DEFAULT_NODE_HOST
39
+ }
40
+
41
+ function getDisplayHost(host) {
42
+ if (host === '0.0.0.0') return 'localhost'
43
+ if (host === '::') return '[::1]'
44
+ return host
45
+ }
23
46
 
24
47
  function cleanUploadTempDir() {
25
48
  if (!fs.existsSync(UPLOAD_TMP_DIR)) return
@@ -221,6 +244,9 @@ export async function main() {
221
244
  console.log(`[MostBox] Storage: ${dataPath}`)
222
245
 
223
246
  const nodeConfig = configStore.getNodeConfig()
247
+ const runtimeArgs = parseRuntimeArgs()
248
+ const port = DEFAULT_NODE_PORT
249
+ const host = getRuntimeHost(nodeConfig, runtimeArgs)
224
250
  const engine = new MostBoxEngine({
225
251
  dataPath,
226
252
  maxFileSize: nodeConfig.maxFileSizeBytes,
@@ -231,8 +257,8 @@ export async function main() {
231
257
  const serverInstanceRef = { current: null }
232
258
 
233
259
  const appRuntime = createApp(engine, {
234
- port: PORT,
235
- host: HOST,
260
+ port,
261
+ host,
236
262
  configStore,
237
263
  nodeLogger,
238
264
  wssRef,
@@ -253,15 +279,18 @@ export async function main() {
253
279
  appRuntime.appendNodeLog({
254
280
  event: 'node:ready',
255
281
  message: 'Node daemon ready',
256
- data: { dataPath, port: PORT },
282
+ data: { dataPath, host, port },
257
283
  })
258
284
  appRuntime.broadcastNodeStatus()
259
285
 
260
286
  serverInstanceRef.current = serve(
261
- { fetch: appRuntime.app.fetch, port: PORT, hostname: HOST },
287
+ { fetch: appRuntime.app.fetch, port, hostname: host },
262
288
  () => {
263
- const displayUrl = `http://localhost:${PORT}`
289
+ const displayUrl = `http://${getDisplayHost(host)}:${port}`
264
290
  console.log(`[MostBox] Server running at ${displayUrl}`)
291
+ if (host !== DEFAULT_NODE_HOST) {
292
+ console.log(`[MostBox] Listening on ${host}:${port}`)
293
+ }
265
294
  }
266
295
  )
267
296
 
@@ -5,9 +5,7 @@ export const TRANSIENT_CHANNEL_TYPES = new Set(['game'])
5
5
  export const CHANNEL_DISCOVERY_TIMEOUT = 600
6
6
  export const CHANNEL_CANDIDATE_TTL = 30 * 1000
7
7
 
8
- const CHANNEL_FINGERPRINT_BYTES = 8
9
8
  const CHANNEL_WRITER_ID_BYTES = 8
10
- const CHANNEL_KEY_SEPARATOR = '.'
11
9
 
12
10
  export function normalizeChannelDisplayName(input, fallbackAddress = '') {
13
11
  const value = String(input || '').trim()
@@ -24,25 +22,22 @@ export function normalizeChannelId(input) {
24
22
  return String(input || '').trim()
25
23
  }
26
24
 
27
- export function createChannelFingerprint() {
28
- return crypto.randomBytes(CHANNEL_FINGERPRINT_BYTES).toString('hex')
29
- }
30
-
31
25
  export function createChannelWriterId() {
32
26
  return crypto.randomBytes(CHANNEL_WRITER_ID_BYTES).toString('hex')
33
27
  }
34
28
 
35
- export function buildChannelKey(channelId, fingerprint) {
36
- return `${channelId}${CHANNEL_KEY_SEPARATOR}${fingerprint}`
29
+ export function buildChannelKey(channelId) {
30
+ return normalizeChannelId(channelId)
37
31
  }
38
32
 
39
33
  export function normalizeChannelKey(input) {
40
34
  return String(input || '').trim()
41
35
  }
42
36
 
43
- export function getChannelFingerprintFromKey(channelId, channelKey) {
44
- const prefix = `${channelId}${CHANNEL_KEY_SEPARATOR}`
45
- return channelKey.startsWith(prefix) ? channelKey.slice(prefix.length) : ''
37
+ export function isSpecialChannel(channel = {}) {
38
+ return [channel.name, channel.channelId, channel.channelKey].some(value =>
39
+ String(value || '').includes('.')
40
+ )
46
41
  }
47
42
 
48
43
  export function uniqueStrings(values = []) {
@@ -110,7 +110,7 @@ export function deriveGameRoomLobby(messages = [], options = {}) {
110
110
  if (!event) continue
111
111
 
112
112
  if (event.event === 'room:create') {
113
- const player = createPlayerFromPayload(event.payload?.player, message.author)
113
+ const player = createPlayerFromPayload(event.payload?.player, message)
114
114
  if (!player) continue
115
115
  if (!hostAddress) hostAddress = player.address
116
116
  upsertPlayer(players, playerMap, player)
@@ -118,7 +118,7 @@ export function deriveGameRoomLobby(messages = [], options = {}) {
118
118
  }
119
119
 
120
120
  if (event.event === 'player:join') {
121
- const player = createPlayerFromPayload(event.payload?.player, message.author)
121
+ const player = createPlayerFromPayload(event.payload?.player, message)
122
122
  if (player) upsertPlayer(players, playerMap, player)
123
123
  continue
124
124
  }
@@ -157,18 +157,28 @@ export function getLatestGameState(messages = [], options = {}) {
157
157
  return latest
158
158
  }
159
159
 
160
- export function createPlayerFromPayload(input, author) {
160
+ export function createPlayerFromPayload(input, messageOrAuthor) {
161
161
  if (!input || typeof input !== 'object') return null
162
+ const message =
163
+ messageOrAuthor && typeof messageOrAuthor === 'object'
164
+ ? messageOrAuthor
165
+ : { author: messageOrAuthor }
166
+ const author = message.author
162
167
  const address = normalizeAddress(input.address || author)
163
168
  if (!address || normalizeAddress(author) !== address) return null
164
- const name = String(input.name || '').trim().slice(0, 50) || shortAddress(address)
169
+ const name =
170
+ String(message.authorName || input.name || '').trim().slice(0, 50) ||
171
+ shortAddress(address)
172
+ const avatar = String(message.avatar || input.avatar || '').trim()
165
173
  const publicKey = String(input.publicKey || '').trim()
166
- return {
174
+ const player = {
167
175
  address,
168
176
  name,
169
177
  publicKey,
170
178
  joinedAt: Number(input.joinedAt || Date.now()),
171
179
  }
180
+ if (avatar) player.avatar = avatar.slice(0, 4096)
181
+ return player
172
182
  }
173
183
 
174
184
  export function normalizeGamePlayer(input) {
@@ -9,7 +9,6 @@ export const MOST_LINK_ERROR_CODES = {
9
9
  INVALID_URL: 'invalid_url',
10
10
  INVALID_PROTOCOL: 'invalid_protocol',
11
11
  UNSUPPORTED_PATH: 'unsupported_path',
12
- FILENAME_REQUIRED: 'filename_required',
13
12
  UNSUPPORTED_QUERY_PARAM: 'unsupported_query_param',
14
13
  }
15
14
 
@@ -79,7 +78,7 @@ export function parseMostLink(link) {
79
78
  }
80
79
 
81
80
  const cidString = url.hostname
82
- const fileName = url.searchParams.get('filename')
81
+ const rawFileName = url.searchParams.get('filename')
83
82
  const unsupportedParam = [...url.searchParams.keys()].find(
84
83
  key => key !== 'filename'
85
84
  )
@@ -89,10 +88,6 @@ export function parseMostLink(link) {
89
88
  return invalidLink(validation.errorCode)
90
89
  }
91
90
 
92
- if (!fileName || !fileName.trim()) {
93
- return invalidLink(MOST_LINK_ERROR_CODES.FILENAME_REQUIRED)
94
- }
95
-
96
91
  if (unsupportedParam) {
97
92
  return invalidLink(
98
93
  MOST_LINK_ERROR_CODES.UNSUPPORTED_QUERY_PARAM,
@@ -100,9 +95,15 @@ export function parseMostLink(link) {
100
95
  )
101
96
  }
102
97
 
98
+ const fileName = rawFileName?.trim() || cidString
99
+
103
100
  return { cid: cidString, fileName }
104
101
  }
105
102
 
106
103
  export function buildMostLink(cid, fileName) {
107
- return `most://${cid}?filename=${encodeURIComponent(fileName)}`
104
+ const trimmedFileName = String(fileName || '').trim()
105
+ if (!trimmedFileName) {
106
+ return `most://${cid}`
107
+ }
108
+ return `most://${cid}?filename=${encodeURIComponent(trimmedFileName)}`
108
109
  }
@@ -196,6 +196,7 @@ export function startRound({ roomCode, players, hostAddress, previousSeq = 0, pr
196
196
  return {
197
197
  address: player.address,
198
198
  name: player.name,
199
+ avatar: cleanAvatar(player.avatar),
199
200
  publicKey: player.publicKey,
200
201
  chips: Number(player.chips) - ZHJ_ANTE,
201
202
  status: 'active',
@@ -597,6 +598,7 @@ function normalizeRoundPlayer(input) {
597
598
  return {
598
599
  address,
599
600
  name: String(input.name || shortAddress(address)).slice(0, 50),
601
+ avatar: cleanAvatar(input.avatar),
600
602
  publicKey: String(input.publicKey || ''),
601
603
  chips: Math.max(0, Number(input.chips) || 0),
602
604
  status: input.status === 'folded' ? 'folded' : 'active',
@@ -614,6 +616,10 @@ function shortAddress(address) {
614
616
  return address ? `${address.slice(0, 6)}...${address.slice(-4)}` : ''
615
617
  }
616
618
 
619
+ function cleanAvatar(value) {
620
+ return String(value || '').trim().slice(0, 4096)
621
+ }
622
+
617
623
  function clone(value) {
618
624
  return JSON.parse(JSON.stringify(value))
619
625
  }
@@ -18,6 +18,7 @@ export function createGanDengYanRoom({
18
18
  roomPlayers.unshift({
19
19
  address: normalizeAddress(ownerAddress),
20
20
  name: cleanName(ownerName),
21
+ avatar: '',
21
22
  })
22
23
  }
23
24
 
@@ -29,6 +30,7 @@ export function createGanDengYanRoom({
29
30
  players: roomPlayers.slice(0, 6).map((player, seat) => ({
30
31
  address: player.address,
31
32
  name: cleanName(player.name),
33
+ avatar: cleanAvatar(player.avatar),
32
34
  seat,
33
35
  hand: [],
34
36
  handCount: 0,
@@ -62,6 +64,7 @@ export function syncGanDengYanLobby(room, players = []) {
62
64
  .map((player, seat) => ({
63
65
  address: player.address,
64
66
  name: cleanName(player.name),
67
+ avatar: cleanAvatar(player.avatar),
65
68
  seat,
66
69
  hand: [],
67
70
  handCount: 0,
@@ -257,6 +260,7 @@ export function publicGanDengYanRoom(room) {
257
260
  players: orderedPlayers(room).map(player => ({
258
261
  address: player.address,
259
262
  name: player.name,
263
+ avatar: cleanAvatar(player.avatar),
260
264
  seat: player.seat,
261
265
  handCount: player.hand?.length ?? player.handCount ?? 0,
262
266
  score: Number(player.score ?? INITIAL_SCORE),
@@ -431,6 +435,7 @@ function normalizePlayers(players) {
431
435
  .map(player => ({
432
436
  address: normalizeAddress(player.address),
433
437
  name: cleanName(player.name),
438
+ avatar: cleanAvatar(player.avatar),
434
439
  publicKey: String(player.publicKey || ''),
435
440
  }))
436
441
  .filter(player => {
@@ -446,6 +451,7 @@ function normalizeRoundPlayer(input) {
446
451
  return {
447
452
  address,
448
453
  name: cleanName(input.name),
454
+ avatar: cleanAvatar(input.avatar),
449
455
  seat: Number(input.seat || 0),
450
456
  hand: Array.isArray(input.hand) ? input.hand.map(normalizeCard).filter(Boolean) : [],
451
457
  handCount: Number(input.handCount || 0),
@@ -679,3 +685,7 @@ function normalizeAddress(value) {
679
685
  function cleanName(name) {
680
686
  return String(name || '玩家').trim().slice(0, 16) || '玩家'
681
687
  }
688
+
689
+ function cleanAvatar(avatar) {
690
+ return String(avatar || '').trim().slice(0, 4096)
691
+ }
@@ -37,6 +37,53 @@ function isLocalHostname(hostname) {
37
37
  return ['localhost', '127.0.0.1', '::1', '[::1]'].includes(value)
38
38
  }
39
39
 
40
+ function normalizeNetworkAddress(address) {
41
+ const value = String(address || '')
42
+ .trim()
43
+ .toLowerCase()
44
+ .replace(/^\[|\]$/g, '')
45
+
46
+ if (value.startsWith('::ffff:')) {
47
+ return value.slice('::ffff:'.length)
48
+ }
49
+
50
+ return value
51
+ }
52
+
53
+ export function isPrivateNetworkHostname(hostname) {
54
+ const value = normalizeNetworkAddress(hostname)
55
+
56
+ if (value === '::1' || value === 'localhost') {
57
+ return true
58
+ }
59
+
60
+ if (
61
+ value.includes(':') &&
62
+ (value.startsWith('fc') ||
63
+ value.startsWith('fd') ||
64
+ value.startsWith('fe80:'))
65
+ ) {
66
+ return true
67
+ }
68
+
69
+ const parts = value.split('.').map(part => Number(part))
70
+ if (
71
+ parts.length !== 4 ||
72
+ parts.some(part => !Number.isInteger(part) || part < 0 || part > 255)
73
+ ) {
74
+ return false
75
+ }
76
+
77
+ const [first, second] = parts
78
+ return (
79
+ first === 10 ||
80
+ first === 127 ||
81
+ (first === 169 && second === 254) ||
82
+ (first === 172 && second >= 16 && second <= 31) ||
83
+ (first === 192 && second === 168)
84
+ )
85
+ }
86
+
40
87
  export function isPublicListenHost(listenHost) {
41
88
  const hostname = extractHostname(listenHost)
42
89
  if (!hostname) return false
@@ -76,23 +123,27 @@ export function isLoopbackRemoteAddress(address) {
76
123
  )
77
124
  }
78
125
 
79
- export function isLocalRequest(c) {
126
+ export function isLocalRequest(c, options = {}) {
80
127
  const host = c.req.header('host')
81
- if (host) {
82
- return isLocalRequestHost(host)
128
+ if (host && isLocalRequestHost(host)) {
129
+ return true
83
130
  }
84
- const clientIp =
85
- c.req.header('x-forwarded-for') ||
86
- c.env?.incoming?.socket?.remoteAddress ||
87
- ''
88
- return isLoopbackRemoteAddress(clientIp)
131
+ const clientIp = c.env?.incoming?.socket?.remoteAddress || ''
132
+ return (
133
+ isLoopbackRemoteAddress(clientIp) ||
134
+ (options.trustPrivateNetwork && isPrivateNetworkHostname(clientIp))
135
+ )
89
136
  }
90
137
 
91
- export function isLocalUpgradeRequest(req) {
92
- if (req.headers.host) {
93
- return isLocalRequestHost(req.headers.host)
138
+ export function isLocalUpgradeRequest(req, options = {}) {
139
+ if (req.headers.host && isLocalRequestHost(req.headers.host)) {
140
+ return true
94
141
  }
95
- return isLoopbackRemoteAddress(req.socket?.remoteAddress)
142
+ const remoteAddress = req.socket?.remoteAddress
143
+ return (
144
+ isLoopbackRemoteAddress(remoteAddress) ||
145
+ (options.trustPrivateNetwork && isPrivateNetworkHostname(remoteAddress))
146
+ )
96
147
  }
97
148
 
98
149
  export function isRemoteAccessRequest({ invite, origin, listenHost, local }) {