├── .gitignore ├── .vitepress ├── config.mts └── theme │ ├── components │ ├── ad.vue │ └── tip.vue │ ├── custom.css │ ├── ext-layout.vue │ └── index.mts ├── advanced ├── custom_page.md ├── distributed.md ├── docker.md ├── linux_systemctl.md └── update_panel.md ├── apis ├── api_daemon.md ├── api_dashboard.md ├── api_fileManager.md ├── api_imageManager.md ├── api_instance.md ├── api_users.md ├── get_apikey.md └── html_card.md ├── docker-install.md ├── images ├── custom_page │ ├── adjust_card.png │ ├── custom_button.png │ ├── custom_login_page.png │ ├── custom_view.png │ ├── extend_page_card.png │ ├── html_card.png │ ├── music_and_ssh.png │ ├── preview.gif │ └── terminal_in_home_page.png ├── distributed_principle.svg ├── java_setup.png ├── logo.png ├── mcsm_arch_en.svg └── zh_cn │ ├── distributed_principle.png │ ├── getkey.png │ ├── java_setup.png │ └── to_user_info.png ├── index.md ├── install.md ├── install_manual.md ├── ops ├── cloudflare.md ├── config_files.md ├── from_v9.md ├── mcsm_network.md ├── path_prefix.md └── proxy_https.md ├── package-lock.json ├── package.json ├── setup_any_software.md ├── setup_bedrock_edition.md ├── setup_docker_image.md ├── setup_java_edition.md ├── setup_package.md ├── setup_steam.md └── zh_cn ├── advanced ├── custom_page.md ├── distributed.md ├── docker.md ├── freebsd_rc.md ├── linux_openrc.md ├── linux_systemctl.md ├── openbsd_rc.md └── update_panel.md ├── apis ├── api_daemon.md ├── api_dashboard.md ├── api_fileManager.md ├── api_imageManager.md ├── api_instance.md ├── api_users.md ├── get_apikey.md └── html_card.md ├── docker-install.md ├── index.md ├── ops ├── cloudflare.md ├── config_files.md ├── from_v9.md ├── mcsm_network.md ├── path_prefix.md └── proxy_https.md ├── setup_any_software.md ├── setup_bedrock_edition.md ├── setup_docker_image.md ├── setup_java_edition.md ├── setup_package.md └── setup_steam.md /.gitignore: -------------------------------------------------------------------------------- 1 | .vitepress/dist 2 | .vitepress/cache 3 | node_modules/ -------------------------------------------------------------------------------- /.vitepress/config.mts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vitepress"; 2 | import type { Config as ThemeConfig } from "@vue/theme"; 3 | 4 | // https://vitepress.dev/reference/site-config 5 | export default defineConfig({ 6 | title: "MCSManager", 7 | description: "MCSManager Document", 8 | lastUpdated: true, 9 | 10 | // head section 11 | head: [ 12 | // favicon 13 | ['link', { rel: 'icon', href: '/images/logo.png' }] 14 | ], 15 | 16 | locales: { 17 | root: { 18 | label: "English", 19 | lang: "en", 20 | link: "/", 21 | }, 22 | zh_cn: { 23 | label: "简体中文", 24 | lang: "zh", 25 | link: "/zh_cn/", 26 | }, 27 | }, 28 | themeConfig: { 29 | logo: "/images/logo.png", 30 | sidebar: { 31 | ["/"]: [ 32 | { 33 | text: "Basic Usage", 34 | link: "/", 35 | collapsed: false, 36 | items: [ 37 | { text: "Quick start", link: "/index.md" }, 38 | { 39 | text: "Install via Docker image", 40 | link: "/docker-install.md", 41 | }, 42 | { 43 | text: "Minecraft Server", 44 | collapsed: false, 45 | items: [ 46 | { text: "Dependencies", link: "/setup_package" }, 47 | { text: "Java Edition", link: "/setup_java_edition" }, 48 | { text: "Bedrock Edition", link: "/setup_bedrock_edition" }, 49 | ], 50 | }, 51 | { 52 | text: "Run Docker Image", 53 | link: "/setup_docker_image.md", 54 | }, 55 | { 56 | text: "Steam Game Server", 57 | link: "/setup_steam.md", 58 | }, 59 | { 60 | text: "Other Use Cases", 61 | link: "/setup_any_software.md", 62 | }, 63 | ], 64 | }, 65 | { 66 | text: "Advanced", 67 | collapsed: false, 68 | items: [ 69 | { 70 | text: "Upgrade & Reset", 71 | link: "/advanced/update_panel.md", 72 | }, 73 | { 74 | text: "Distributed Deployment", 75 | link: "/advanced/distributed.md", 76 | }, 77 | { 78 | text: "Isolated Environment", 79 | link: "/advanced/docker.md", 80 | }, 81 | { 82 | text: "Systemd Service", 83 | link: "/advanced/linux_systemctl.md", 84 | }, 85 | { 86 | text: "Custom Layout", 87 | link: "/advanced/custom_page.md", 88 | }, 89 | { 90 | text: "Upgrade from 9.x", 91 | link: "/ops/from_v9.md", 92 | }, 93 | ], 94 | }, 95 | { 96 | text: "Operations", 97 | items: [ 98 | { 99 | text: "Data & Configuration", 100 | link: "/ops/config_files.md", 101 | }, 102 | { 103 | text: "Network Architecture", 104 | link: "/ops/mcsm_network.md", 105 | }, 106 | { 107 | text: "HTTPS Reverse Proxy", 108 | link: "/ops/proxy_https.md", 109 | }, 110 | { 111 | text: "Cloudflare CDN", 112 | link: "/ops/cloudflare.md", 113 | }, 114 | ], 115 | }, 116 | { 117 | text: "Development", 118 | collapsed: false, 119 | items: [ 120 | { 121 | text: "Customize HTML Card", 122 | link: "/apis/html_card.md", 123 | }, 124 | ], 125 | }, 126 | { 127 | text: "API Usage", 128 | collapsed: true, 129 | items: [ 130 | { 131 | text: "Tutorial", 132 | link: "/apis/get_apikey.md", 133 | }, 134 | { 135 | text: "Dashboard", 136 | link: "/apis/api_dashboard.md", 137 | }, 138 | { 139 | text: "User", 140 | link: "/apis/api_users.md", 141 | }, 142 | { 143 | text: "Instance", 144 | link: "/apis/api_instance.md", 145 | }, 146 | { 147 | text: "Nodes", 148 | link: "/apis/api_daemon.md", 149 | }, 150 | { 151 | text: "File", 152 | link: "/apis/api_fileManager.md", 153 | }, 154 | { 155 | text: "Image", 156 | link: "/apis/api_imageManager.md", 157 | }, 158 | ], 159 | }, 160 | ], 161 | ["/zh_cn/"]: [ 162 | { 163 | text: "教程", 164 | items: [ 165 | { 166 | text: "快速开始", 167 | link: "/zh_cn/index.md", 168 | }, 169 | { 170 | text: "使用 Docker 安装面板", 171 | link: "/zh_cn/docker-install.md", 172 | }, 173 | { 174 | text: "搭建 Minecraft 游戏服务器", 175 | collapsed: true, 176 | items: [ 177 | { 178 | text: "一键搭建 Java 版", 179 | link: "/zh_cn/setup_package.md", 180 | }, 181 | { 182 | text: "搭建 Java 版", 183 | link: "/zh_cn/setup_java_edition.md", 184 | }, 185 | { 186 | text: "搭建基岩版", 187 | link: "/zh_cn/setup_bedrock_edition.md", 188 | }, 189 | ], 190 | }, 191 | { 192 | text: "使用 Docker 部署游戏服务器", 193 | link: "/zh_cn/setup_docker_image.md", 194 | }, 195 | { 196 | text: "搭建 Steam 游戏服务器", 197 | link: "/zh_cn/setup_steam.md", 198 | }, 199 | { 200 | text: "其他使用场景", 201 | link: "/zh_cn/setup_any_software.md", 202 | }, 203 | ], 204 | }, 205 | { 206 | text: "高级", 207 | items: [ 208 | { 209 | text: "连接其他机器", 210 | link: "/zh_cn/advanced/distributed.md", 211 | }, 212 | { 213 | text: "更新与重置", 214 | link: "/zh_cn/advanced/update_panel.md", 215 | }, 216 | { 217 | text: "环境隔离", 218 | link: "/zh_cn/advanced/docker.md", 219 | }, 220 | { 221 | text: "systemd 系统服务", 222 | link: "/zh_cn/advanced/linux_systemctl.md", 223 | }, 224 | { 225 | text: "在其他系统添加服务", 226 | collapsed: true, 227 | items: [ 228 | { 229 | text: "OpenRC 系统服务", 230 | link: "/zh_cn/advanced/linux_openrc.md", 231 | }, 232 | { 233 | text: "FreeBSD 系统服务", 234 | link: "/zh_cn/advanced/freebsd_rc.md", 235 | }, 236 | { 237 | text: "OpenBSD 系统服务", 238 | link: "/zh_cn/advanced/openbsd_rc.md", 239 | }, 240 | ], 241 | }, 242 | { 243 | text: "自定义页面", 244 | link: "/zh_cn/advanced/custom_page.md", 245 | }, 246 | { 247 | text: "从 9.X 版本升级", 248 | link: "/zh_cn/ops/from_v9.md", 249 | }, 250 | ], 251 | }, 252 | { 253 | text: "运维", 254 | items: [ 255 | { 256 | text: "数据与配置", 257 | link: "/zh_cn/ops/config_files.md", 258 | }, 259 | { 260 | text: "网络架构", 261 | link: "/zh_cn/ops/mcsm_network.md", 262 | }, 263 | { 264 | text: "使用 HTTPS", 265 | link: "/zh_cn/ops/proxy_https.md", 266 | }, 267 | { 268 | text: "与其他服务共用端口", 269 | link: "/zh_cn/ops/path_prefix.md", 270 | }, 271 | { 272 | text: "使用 CloudFlare CDN", 273 | link: "/zh_cn/ops/cloudflare.md", 274 | }, 275 | ], 276 | }, 277 | { 278 | text: "开发", 279 | items: [{ text: "制作卡片小组件", link: "/zh_cn/apis/html_card.md" }], 280 | }, 281 | { 282 | text: "API 接口", 283 | collapsed: true, 284 | items: [ 285 | { 286 | text: "使用教程", 287 | link: "/zh_cn/apis/get_apikey.md", 288 | }, 289 | { 290 | text: "仪表盘数据", 291 | link: "/zh_cn/apis/api_dashboard.md", 292 | }, 293 | { 294 | text: "用户管理", 295 | link: "/zh_cn/apis/api_users.md", 296 | }, 297 | { 298 | text: "实例管理", 299 | link: "/zh_cn/apis/api_instance.md", 300 | }, 301 | { 302 | text: "节点管理", 303 | link: "/zh_cn/apis/api_daemon.md", 304 | }, 305 | { 306 | text: "文件管理", 307 | link: "/zh_cn/apis/api_fileManager.md", 308 | }, 309 | { 310 | text: "镜像管理", 311 | link: "/zh_cn/apis/api_imageManager.md", 312 | }, 313 | ], 314 | }, 315 | ], 316 | }, 317 | nav: [ 318 | { 319 | text: "Official website", 320 | link: "https://mcsmanager.com/", 321 | }, 322 | ], 323 | socialLinks: [ 324 | { icon: "github", link: "https://github.com/MCSManager/MCSManager" }, 325 | ], 326 | }, 327 | }); 328 | -------------------------------------------------------------------------------- /.vitepress/theme/components/ad.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ item.adText }} 9 | 10 | 11 | 12 | 13 | 14 | 18 | 19 | 购买此处推广位 20 | 21 | 22 | 23 | 24 | 25 | 26 | 61 | 62 | 122 | -------------------------------------------------------------------------------- /.vitepress/theme/components/tip.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | TIP 4 | 5 | 6 | 7 | 8 | 9 | 10 | 31 | -------------------------------------------------------------------------------- /.vitepress/theme/custom.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/.vitepress/theme/custom.css -------------------------------------------------------------------------------- /.vitepress/theme/ext-layout.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /.vitepress/theme/index.mts: -------------------------------------------------------------------------------- 1 | import type { Theme } from "vitepress"; 2 | import DefaultTheme from "vitepress/theme"; 3 | import "./custom.css"; 4 | import ExtLayout from "./ext-layout.vue"; 5 | 6 | // function languageSwitch() { 7 | // if ( 8 | // window.navigator.language.includes("zh") && 9 | // window.location.pathname === "/" 10 | // ) { 11 | // setTimeout(() => { 12 | // window.location.href = "/zh_cn/"; 13 | // }, 2100); 14 | // } 15 | // } 16 | 17 | /** @type {import('vitepress').Theme} */ 18 | export default { 19 | extends: DefaultTheme, 20 | Layout: ExtLayout, 21 | setup() {}, 22 | enhanceApp({ app }) {}, 23 | } satisfies Theme; 24 | -------------------------------------------------------------------------------- /advanced/custom_page.md: -------------------------------------------------------------------------------- 1 | # Custom Layout 2 | 3 | :::tip 4 | Due to the highly customizable interface, the panel display language cannot be switched after setting a custom page. Forced switching may not have the desired effect. 5 | ::: 6 | 7 | ## Cardization 8 | 9 | Starting from `MCSManager v10`, users can customize any visible page by dragging and dropping cards. 10 | 11 |  12 | 13 | ## Customize 14 | 15 | ::: warning 16 | 17 | Please add cards as needed. If too many cards are added to a page, the performance of the web page may decrease. 18 | 19 | ::: 20 | 21 | Click the custom layout button in the upper right corner of the panel on any interface to enter editing mode. 22 | 23 | In edit mode, you can insert a card anywhere, modify the card title, adjust the card size, etc. 24 | 25 | Available cards include but are not limited to time, music, pictures, web pages, panel information, instances, and settings. Everything you see in the panel is a card. 26 | 27 |  28 | 29 |  30 | 31 | ## More than just the homepage 32 | 33 | In addition to several common management pages, MCSManager also allows you to edit various accessible pages such as login pages, ordinary user homepages, and open pages. 34 | 35 |  36 | 37 | ## Manage multiple instances on the home page 38 | 39 | The ability to customize layouts allows you to manage multiple instances on a single page. 40 | 41 |  42 | 43 | ## Extensibility 44 | 45 | The card has extremely high scalability. It allows you to connect to the server using SSH while listening to music in the panel. 46 | 47 |  48 | 49 | ## HTML Card 50 | 51 | You can upload custom HTML as the content of the card. Custom HTML cards have very high scalability. Using custom HTML, you can [self-develop](../apis/html_card.html) more cards or install them. Useful cards developed by others. However, you need to pay attention to security issues when using it. Uploading code from unknown sources may lead to the panel being invaded. 52 | 53 |  54 | 55 |  56 | -------------------------------------------------------------------------------- /advanced/distributed.md: -------------------------------------------------------------------------------- 1 | # Distributed Deployment 2 | 3 | ## About 4 | 5 | If you have multiple physical/virtual servers, MCSManager allows you to manage them all together with a sinlge web interface. 6 | 7 | ## How to Connect 8 | 9 | Before adding daemons to the panel, you need to install MCSManager Panel (daemon) on all the servers you want to manage. You can use the installation script and start **only** the `daemon` service. 10 | 11 | ```bash 12 | # After the installation script finished... 13 | 14 | # [REQUIRED] Stop web service 15 | # If you don't stop the web service, anyone can access the initial setup page and take over your server. 16 | systemctl stop mcsm-web 17 | 18 | # [REQUIRED] Disable the web services from startup 19 | systemctl disable mcsm-web 20 | 21 | # Start only the daemon service. 22 | systemctl start mcsm-daemon 23 | ``` 24 | 25 | Return to the web interface. On the `Daemons` page you can see all connected daemons. If the `connection address` is localhost, this means that the daemon service is deployed on your local server with web ui. You can connect to any server that has a public IP address and installed daemon. 26 | 27 | To add a new daemon, click the `New Daemon` button, fill in all the blanks, and click `Confirm`. 28 | 29 | ## Daemon Key 30 | 31 | The daemon key will be printed out during the startup phase. Althernatively, it can also be found at the following location(s): 32 | 33 | ### Linux 34 | 35 | If you used the installation script to install, the default file path is: 36 | 37 | `/opt/mcsmanager/daemon/data/Config/global.json` 38 | 39 | ### Windows or Linux Manual Installation 40 | 41 | `/daemon/data/Config/global.json` 42 | 43 | ## Connection Protocol 44 | 45 | You can use either `IP` or `domain` for the `Connection Address` field. For advanced users with reverse proxy, `ws://x.x.x.x` or `wss://x.x.x.x` is also supported. 46 | 47 | `ws` refer to `http`, `wss` refer to `https`. 48 | 49 | > If you don't know what it is, just type the IP address or domain without any prefix. 50 | -------------------------------------------------------------------------------- /advanced/docker.md: -------------------------------------------------------------------------------- 1 | # Isolated Environment 2 | 3 | ## Install Docker 4 | 5 | MCSManager requires `Docker` to isolate instances. Once isolated, any changes from instances to the host are strictly restricted, ensuring the security of the host server. 6 | 7 | MCSManager supports Docker (***Linux only***), please install Docker first and make sure that MCSManager has sufficient permissions to access Docker. 8 | 9 | Go to the `Daemons` page, click the `Container` button in the top right corner. You will then be able to manage containers. 10 | 11 | ## User Docker Images 12 | 13 | Go to the `Instance Terminal` page, under `Instance Settings`, enable the `Virtualisation Container (Linux Docker)`. You can then run your instance in a Docker image and use the files in the working directory. 14 | 15 | ## FAQ 16 | 17 | - Q: MCSManager says that Docker is not installed, but it is installed. 18 | 19 | > A: Try restarting MCSManager panel with root privileges. If it works, then this is a permission issue. Otherwise please reinstall Docker. 20 | -------------------------------------------------------------------------------- /advanced/linux_systemctl.md: -------------------------------------------------------------------------------- 1 | # Systemd Service (Linux) 2 | 3 | :::tip 4 | If you installed using the installation script, then you can safely ignore this page. The installation script has already configured the systemd services for you. 5 | ::: 6 | 7 | We can always use an ssh client to connect to the Linux server and run any command. However, when we disconnect the SSH, any program that is running will be stopped too. Also it is not practical to manually start the program each time the server is rebooted. 8 | 9 | Therefore, we can configure the systemd services for MCSManager to start with the system and keep running in the background. 10 | 11 | If you installed MCSManager manually, we recommend that you configure a systemd service for MCSManager. 12 | 13 | ## Sample Configuration 14 | 15 | ### Daemon 16 | `vim /etc/systemd/system/mcsm-daemon.service` 17 | 18 | ``` 19 | [Unit] 20 | Description=MCSManager Daemon 21 | 22 | [Service] 23 | WorkingDirectory=/opt/mcsmanager/daemon 24 | ExecStart=/bin/node app.js 25 | ExecReload=/bin/kill -s HUP $MAINPID 26 | ExecStop=/bin/kill -s QUIT $MAINPID 27 | Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 28 | 29 | [Install] 30 | WantedBy=multi-user.target 31 | ``` 32 | 33 | ### Web 34 | `vim /etc/systemd/system/mcsm-web.service` 35 | 36 | ``` 37 | [Unit] 38 | Description=MCSManager Web 39 | 40 | [Service] 41 | WorkingDirectory=/opt/mcsmanager/web 42 | ExecStart=/bin/node app.js 43 | ExecReload=/bin/kill -s HUP $MAINPID 44 | ExecStop=/bin/kill -s QUIT $MAINPID 45 | Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 46 | 47 | [Install] 48 | WantedBy=multi-user.target 49 | ``` 50 | 51 | ## Commands 52 | 53 | Restart:`systemctl restart mcsm-{daemon,web}.service` 54 | 55 | Start:`systemctl start mcsm-{daemon,web}.service` 56 | 57 | Stop:`systemctl stop mcsm-{daemon,web}.service` 58 | 59 | Disable:`systemctl disable mcsm-{daemon,web}.service` 60 | 61 | Enable:`systemctl enable mcsm-{daemon,web}.service` 62 | 63 | ## Panel Permission 64 | 65 | > If not set, MCSManager will run as the root user by default. This is not advised as it will bring extra risks to the host. It is recommended to use a separate user when starting MCSManager. 66 | 67 | 1. Use the `useradd`, `chmod`, `chown` commands to create a user and set permissions. 68 | 2. Add `User=` to the `[Service]` section. 69 | 3. Reload systemd and restart the service(s). 70 | -------------------------------------------------------------------------------- /advanced/update_panel.md: -------------------------------------------------------------------------------- 1 | # Upgrade & Reset MCSManager 2 | 3 | :::tip 4 | Please backup the `web/data` and `daemon/data` directories to another location before upgrading your panel. 5 | ::: 6 | 7 | ## Before upgrade 8 | 9 | Given MCSManager's distributed architecture, updating all daemons might be time-consuming if you have more than five. We recommend that only updating when we release a major version or security fixes. 10 | 11 | If you have only a few daemons, upgrading your panel should not be a problem. 12 | 13 | ## Updating the Panel 14 | 15 | ### For Windows 16 | 17 | 1. Download the latest zip file from [official website](https://mcsmanager.com). 18 | 2. **Overwrite** the existing panel directory. 19 | 20 | ### Script Update for Linux Version 21 | 22 | If you originally installed MCSManager using the **one-click script**, you can simply run the following command. The one-click installation script supports automatic updates and will not damage your local data. 23 | 24 | After executing the script, there's nothing else you need to do, and your MCSManager should automatically be updated to the latest version. 25 | 26 | ```bash 27 | sudo su -c "wget -qO- https://script.mcsmanager.com/setup.sh | bash" 28 | ``` 29 | 30 | ### Manual Update for Linux Version 31 | 32 | If you originally installed MCSManager **manually**, the one-click installation script will not work for you as it may result in installing two separate instances of the program. 33 | 34 | You will need to visit the official [release page](https://github.com/MCSManager/MCSManager/releases/latest), download the latest code, and overwrite all your existing MCSManager files. 35 | 36 | After overwriting the files, you also need to update the dependencies by navigating to both the `web` and `daemon` directories, and running `npm install --production` in each. This ensures that all required dependencies are updated, otherwise, you may not be able to start the panel! 37 | 38 | ## Reset Admin Account 39 | 40 | If you lost access to the admin account, you can always create a new one with the following steps: 41 | 42 | 1. **Move** the `web/data/User` directory to another location. 43 | 2. Restart MCSManager, the initial setup page will be displayed. 44 | 3. Follow the instructions and create a new admin account. 45 | 4. Move back the `web/data/User` directory. 46 | 5. Restart MCSManager 47 | 48 | ## Reset Everything 49 | 50 | All you need to do is delete the `data` folder. 51 | -------------------------------------------------------------------------------- /apis/api_daemon.md: -------------------------------------------------------------------------------- 1 | # Daemon API 2 | 3 | ## Daemon List 4 | 5 | > see [Dashboard API](./api_dashboard.md#get-overview-info) 6 | 7 | ## Add 8 | 9 | ```http 10 | POST /api/service/remote_service 11 | ``` 12 | 13 | #### Request Body 14 | 15 | ```json 16 | { 17 | "ip": "10.0.0.16", 18 | "port": 24446, 19 | "prefix": "", 20 | "remarks": "MiPad", 21 | "apiKey": "db9516063699446bb95fba51f08603" 22 | } 23 | ``` 24 | 25 | #### Response 26 | 27 | ```json 28 | { 29 | "status": 200, 30 | "data": "499e1012a21443278a7ec63a3a95860b", // Added Daemon ID 31 | "time": 1718594177859 32 | } 33 | ``` 34 | 35 | ## Delete 36 | 37 | ```http 38 | DELETE /api/service/remote_service 39 | ``` 40 | 41 | #### Query Param 42 | 43 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 44 | 45 | ```js 46 | { 47 | uuid: string; // Daemon ID 48 | } 49 | ``` 50 | 51 | #### Response 52 | 53 | ```json 54 | { 55 | "status": 200, 56 | "data": true, 57 | "time": 1718594177859 58 | } 59 | ``` 60 | 61 | ## Try Connect Daemon 62 | 63 | ```http 64 | GET /api/service/link_remote_service 65 | ``` 66 | 67 | #### Query Param 68 | 69 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 70 | 71 | ```js 72 | { 73 | uuid: string; // Daemon ID 74 | } 75 | ``` 76 | 77 | #### Response 78 | 79 | ```json 80 | { 81 | "status": 200, 82 | "data": true, 83 | "time": 1718594177859 84 | } 85 | ``` 86 | 87 | ## Update Daemon Connect Config 88 | 89 | ```http 90 | PUT /api/service/remote_service 91 | ``` 92 | 93 | #### Query Param 94 | 95 | ```js 96 | { 97 | uuid: string; // Daemon ID 98 | } 99 | ``` 100 | 101 | 102 | #### Request Body 103 | 104 | ```json 105 | { 106 | "uuid": "e31986e43c254107951dea97026a3741", 107 | "ip": "162.2.xx.xx", 108 | "port": 24444, 109 | "prefix": "", 110 | "available": false, 111 | "remarks": "My Node", 112 | "apiKey": "" 113 | } 114 | ``` 115 | 116 | #### Response 117 | 118 | ```json 119 | { 120 | "status": 200, 121 | "data": true, 122 | "time": 1718594177859 123 | } 124 | ``` 125 | -------------------------------------------------------------------------------- /apis/api_dashboard.md: -------------------------------------------------------------------------------- 1 | # Dashboard API 2 | 3 | ## Get Overview Data 4 | 5 | ```http 6 | GET /api/overview 7 | ``` 8 | 9 | #### Response 10 | 11 | ```json 12 | { 13 | "status": 200, 14 | "data": { 15 | "version": "10.2.1", 16 | "specifiedDaemonVersion": "4.4.1", 17 | "process": { 18 | "cpu": 0, 19 | "memory": 219439104, // Panel Memory Usage 20 | "cwd": "Z:\\Workspace\\MCSManager\\panel" 21 | }, 22 | "record": { 23 | "logined": 2, 24 | "illegalAccess": 2, 25 | "banips": 0, 26 | "loginFailed": 0 27 | }, 28 | "system": { 29 | "user": { 30 | "uid": -1, 31 | "gid": -1, 32 | "username": "MCSManager", 33 | "homedir": "X:\\Users\\MCSManager", 34 | "shell": null 35 | }, 36 | // Memory usage on the panel 37 | "time": 1718594177859, 38 | "totalmem": 16577519520, 39 | "freemem": 10966386688, 40 | "type": "Windows_NT", 41 | "version": "Windows 10 Pro for Workstations", 42 | "node": "v17.9.1", 43 | "hostname": "MCSManager-Workstation", 44 | 45 | // Linux only 46 | "loadavg": [0, 0, 0], 47 | 48 | "platform": "win32", 49 | "release": "10.0.22631", 50 | "uptime": 905020.0, 51 | "cpu": 0.11684482123110951 52 | }, 53 | 54 | // Memory&CPU usage on the panel (statistical chart) 55 | "chart": { 56 | "system": [ 57 | { 58 | "cpu": 8.1, 59 | "mem": 64.5 60 | } 61 | ], 62 | "request": [ 63 | { 64 | "value": 6, 65 | "totalInstance": 23, 66 | "runningInstance": 3 67 | } 68 | ] 69 | }, 70 | "remoteCount": { 71 | "available": 3, 72 | "total": 3 73 | }, 74 | 75 | // Daemon List 76 | "remote": [ 77 | { 78 | "version": "3.4.0", 79 | "process": { 80 | "cpu": 3550442695, 81 | "memory": 22620272, 82 | "cwd": "/opt/mcsmanager/daemon" 83 | }, 84 | "instance": { 85 | "running": 0, 86 | "total": 6 87 | }, 88 | 89 | // CPU and memory usage on the Daemon. 90 | "system": { 91 | "type": "Linux", 92 | "hostname": "NYA-Dev-01", 93 | "platform": "linux", 94 | "release": "5.15.0-101-generic", 95 | "uptime": 39.63, 96 | "cwd": "/opt/mcsmanager/daemon", 97 | "loadavg": [3.5, 0.85, 0.28], 98 | "freemem": 7254478848, 99 | "cpuUsage": 0.002512562814070307, 100 | "memUsage": 0.12453628345617548, 101 | "totalmem": 8286441472, 102 | "processCpu": 0, 103 | "processMem": 0 104 | }, 105 | 106 | // CPU and memory usage on the Daemon (Chart). 107 | "cpuMemChart": [ 108 | { 109 | "cpu": 0, 110 | "mem": 13 111 | } 112 | ], 113 | 114 | // Daemon UUID 115 | "uuid": "957c6bddf379445c82bac5edf7684bbc", 116 | "ip": "s1.example.com", 117 | "port": 24444, 118 | "prefix": "", 119 | "available": true, 120 | "remarks": "CN-ZJ-DEV-01" 121 | } 122 | ] 123 | }, 124 | "time": 1718594177859 125 | } 126 | ``` 127 | -------------------------------------------------------------------------------- /apis/api_fileManager.md: -------------------------------------------------------------------------------- 1 | # File Manager API 2 | 3 | ## Get File List 4 | 5 | ```http 6 | GET /api/files/list 7 | ``` 8 | 9 | #### Query Param 10 | 11 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 12 | 13 | ```js 14 | { 15 | daemonId: string; 16 | uuid: string; // Instance ID 17 | target: string; // File(name or directory) Path 18 | page: number; 19 | page_size: number; 20 | } 21 | ``` 22 | 23 | #### Response 24 | 25 | ```json 26 | { 27 | "status": 200, 28 | "data": { 29 | "items": [ 30 | { 31 | "name": "Genshin Impact", 32 | "size": 0, // byte 33 | "time": "Fri Jun 07 2024 08:53:34 GMT+0800 (中国标准时间)", 34 | "mode": 777, // Linux file permission 35 | "type": 0 // 0 = Folder, 1 = File 36 | }, 37 | { 38 | "name": "NEKO-MIMI SWEET HOUSEMATES Vol. 1", 39 | "size": 0, 40 | "time": "Thu Jun 06 2024 18:25:14 GMT+0800 (中国标准时间)", 41 | "mode": 777, 42 | "type": 0 43 | }, 44 | { 45 | "name": "Poly Bridge", 46 | "size": 0, 47 | "time": "Thu Jun 06 2024 18:25:14 GMT+0800 (中国标准时间)", 48 | "mode": 777, 49 | "type": 0 50 | }, 51 | { 52 | "name": "Wuthering Waves", 53 | "size": 0, 54 | "time": "Fri Jun 07 2024 04:32:58 GMT+0800 (中国标准时间)", 55 | "mode": 666, 56 | "type": 0 57 | }, 58 | { 59 | "name": "AngryBirdsSeasons", 60 | "size": 0, 61 | "time": "Thu Jun 06 2024 18:25:14 GMT+0800 (中国标准时间)", 62 | "mode": 777, 63 | "type": 0 64 | }, 65 | { 66 | "name": "secret base_君がくれたもの【Covered by Kotoha】.mp4", 67 | "size": 13253857, 68 | "time": "Thu Jun 06 2024 19:37:35 GMT+0800 (中国标准时间)", 69 | "mode": 666, 70 | "type": 1 71 | } 72 | ], 73 | "page": 0, 74 | "pageSize": 100, 75 | "total": 6, 76 | "absolutePath": "\\" 77 | }, 78 | "time": 1718594177859 79 | } 80 | ``` 81 | 82 | ## Get File Contents 83 | 84 | ```http 85 | PUT /api/files/ 86 | ``` 87 | 88 | #### Query Param 89 | 90 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 91 | 92 | ```js 93 | { 94 | daemonId: string; 95 | uuid: string; // Instance ID 96 | } 97 | ``` 98 | 99 | #### Request Body 100 | 101 | ```json 102 | { 103 | "target": "/eula.txt" 104 | } 105 | ``` 106 | 107 | #### Response 108 | 109 | ```json 110 | { 111 | "status": 200, 112 | "data": "eula=false\n", // file content 113 | "time": 1718594177859 114 | } 115 | ``` 116 | 117 | ## Update File 118 | 119 | ```http 120 | PUT /api/files/ 121 | ``` 122 | 123 | #### Query Param 124 | 125 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 126 | 127 | ```js 128 | { 129 | daemonId: string; 130 | uuid: string; // Instance ID 131 | } 132 | ``` 133 | 134 | #### Request Body 135 | 136 | ```json 137 | { 138 | "target": "/eula.txt", 139 | "text": "eula=true\n" // file content 140 | } 141 | ``` 142 | 143 | #### Response 144 | 145 | ```json 146 | { 147 | "status": 200, 148 | "data": true, 149 | "time": 1718594177859 150 | } 151 | ``` 152 | 153 | ## Download File 154 | 155 | ```http 156 | POST /api/files/download 157 | ``` 158 | 159 | #### Query Param 160 | 161 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 162 | 163 | ```js 164 | { 165 | file_name: string; // Path + FileName, Example: /backup/world.zip 166 | daemonId: string; 167 | uuid: string; // Instance ID 168 | } 169 | ``` 170 | 171 | #### Response 172 | 173 | ```json 174 | { 175 | "status": 200, 176 | "data": { 177 | "password": "b2d8a6fa3bc8467ebd1563dc4f7179be1718010317889", 178 | "addr": "localhost:24444" // Daemon Addr 179 | }, 180 | "time": 1718594177859 181 | } 182 | ``` 183 | 184 | #### Usage 185 | 186 | ```http 187 | GET http(s)://{{Daemon Addr}}/download/{{password}}/{{fileName}} 188 | 189 | // For example: 190 | GET http://localhost:24444/download/db8271f526...49468abd74/world.zip 191 | ``` 192 | 193 | ## Upload File 194 | 195 | ### 1. Get Upload Config 196 | 197 | ```http 198 | POST /api/files/upload 199 | ``` 200 | 201 | #### Query Param 202 | 203 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 204 | 205 | ```js 206 | { 207 | upload_dir: string; 208 | daemonId: string; 209 | uuid: string; // Instance ID 210 | } 211 | ``` 212 | 213 | #### Response 214 | 215 | ```json 216 | { 217 | "status": 200, 218 | "data": { 219 | "password": "b2d8a6fa3bc8467ebd1563dc4f7179be1718010317889", 220 | "addr": "localhost:24444" // Daemon Addr 221 | }, 222 | "time": 1718594177859 223 | } 224 | ``` 225 | 226 | ### 2. Upload File 227 | 228 | ```http 229 | POST http(s)://{{Daemon Address}}/upload/{{password}} 230 | ``` 231 | 232 | #### Request Headers 233 | 234 | ```http 235 | Content-Type: multipart/form-data 236 | ``` 237 | 238 | #### Request FormData 239 | 240 | ```http 241 | file: (Binary Data) 242 | ``` 243 | 244 | #### Response 245 | 246 | ``` 247 | OK 248 | ``` 249 | 250 | ## Copy 251 | 252 | ```http 253 | POST /api/files/copy 254 | ``` 255 | 256 | #### Query Param 257 | 258 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 259 | 260 | ```js 261 | { 262 | daemonId: string; 263 | uuid: string; // Instance ID 264 | } 265 | ``` 266 | 267 | #### Request Body 268 | 269 | ```json 270 | { 271 | "targets": [ 272 | [ 273 | "/server.jar", // source 274 | "/cache/server.jar" // target 275 | ] 276 | // ... more 277 | ] 278 | } 279 | ``` 280 | 281 | 282 | 283 | #### Response 284 | 285 | ```json 286 | { 287 | "status": 200, 288 | "data": true, 289 | "time": 1718594177859 290 | } 291 | ``` 292 | 293 | ## Move or Rename 294 | 295 | ```http 296 | PUT /api/files/move 297 | ``` 298 | 299 | #### Query Param 300 | 301 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 302 | 303 | ```js 304 | { 305 | daemonId: string; 306 | uuid: string; // Instance ID 307 | } 308 | ``` 309 | 310 | #### Request Body 311 | 312 | ```json 313 | { 314 | "targets": [ 315 | [ 316 | "/server.jar", // source 317 | "/cache/server.jar" // target 318 | ], 319 | 320 | // support rename 321 | [ 322 | "/ops.json", // source 323 | "/ops.txt" // target 324 | ] 325 | // ... more 326 | ] 327 | } 328 | ``` 329 | 330 | 331 | 332 | #### Response 333 | 334 | ```json 335 | { 336 | "status": 200, 337 | "data": true, 338 | "time": 1718594177859 339 | } 340 | ``` 341 | 342 | ## Zip 343 | 344 | ```http 345 | POST /api/files/compress 346 | ``` 347 | 348 | #### Query Param 349 | 350 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 351 | 352 | ```js 353 | { 354 | daemonId: string; 355 | uuid: string; // Instance ID 356 | } 357 | ``` 358 | 359 | #### Request Body 360 | 361 | ```json 362 | { 363 | "type": 1, 364 | "code": "utf-8", // only utf-8 365 | "source": "/test.zip", // zip file path 366 | "targets": [ 367 | "/world", // support folder 368 | "/config.json", 369 | "/server.jar" 370 | ] 371 | } 372 | ``` 373 | 374 | 375 | 376 | #### Response 377 | 378 | ```json 379 | { 380 | "status": 200, 381 | "data": true, 382 | "time": 1718594177859 383 | } 384 | ``` 385 | 386 | ## Unzip 387 | 388 | ```http 389 | POST /api/files/compress 390 | ``` 391 | 392 | #### Query Param 393 | 394 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 395 | 396 | ```js 397 | { 398 | daemonId: string; 399 | uuid: string; // Instance ID 400 | } 401 | ``` 402 | 403 | #### Request Body 404 | 405 | ```json 406 | { 407 | "type": 2, 408 | "code": "utf-8", // format of the compressed file 409 | // support: utf-8, gbk, big5 410 | "source": "/test.zip", // zip file path 411 | "targets": "/cache" // unzip to 412 | } 413 | ``` 414 | 415 | 416 | 417 | #### Response 418 | 419 | ```json 420 | { 421 | "status": 200, 422 | "data": true, 423 | "time": 1718594177859 424 | } 425 | ``` 426 | 427 | ## Delete 428 | 429 | ```http 430 | DELETE /api/files 431 | ``` 432 | 433 | #### Query Param 434 | 435 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 436 | 437 | ```js 438 | { 439 | daemonId: string; 440 | uuid: string; // Instance ID 441 | } 442 | ``` 443 | 444 | #### Request Body 445 | 446 | ```json 447 | { 448 | "targets": [ 449 | "/world", // support folder 450 | "/cache/config.json", 451 | "/server.jar" 452 | ] 453 | } 454 | ``` 455 | 456 | 457 | 458 | #### Response 459 | 460 | ```json 461 | { 462 | "status": 200, 463 | "data": true, 464 | "time": 1718594177859 465 | } 466 | ``` 467 | 468 | ## Touch File 469 | 470 | ```http 471 | POST /api/files/touch 472 | ``` 473 | 474 | #### Query Param 475 | 476 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 477 | 478 | ```js 479 | { 480 | daemonId: string; 481 | uuid: string; // Instance ID 482 | } 483 | ``` 484 | 485 | #### Request Body 486 | 487 | ```json 488 | { 489 | "target": "/test" // File name 490 | } 491 | ``` 492 | 493 | 494 | 495 | #### Response 496 | 497 | ```json 498 | { 499 | "status": 200, 500 | "data": true, 501 | "time": 1718594177859 502 | } 503 | ``` 504 | 505 | ## Create Folder 506 | 507 | ```http 508 | POST /api/files/mkdir 509 | ``` 510 | 511 | #### Query Param 512 | 513 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 514 | 515 | ```js 516 | { 517 | daemonId: string; 518 | uuid: string; // Instance ID 519 | } 520 | ``` 521 | 522 | #### Request Body 523 | 524 | ```json 525 | { 526 | "target": "/backup" // Folder name 527 | } 528 | ``` 529 | 530 | 531 | 532 | #### Response 533 | 534 | ```json 535 | { 536 | "status": 200, 537 | "data": true, 538 | "time": 1718594177859 539 | } 540 | ``` 541 | -------------------------------------------------------------------------------- /apis/api_imageManager.md: -------------------------------------------------------------------------------- 1 | # Image Manager API 2 | 3 | ## Get Image List 4 | 5 | ```http 6 | GET /api/environment/image 7 | ``` 8 | 9 | #### Query Param 10 | 11 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 12 | 13 | ```js 14 | { 15 | daemonId: string; 16 | } 17 | ``` 18 | 19 | #### Response 20 | 21 | ```json 22 | { 23 | "status": 200, 24 | "data": DockerImageList, 25 | "time": 1718594177859 26 | } 27 | ``` 28 | 29 | > DockerImageList: https://docs.docker.com/engine/api/v1.37/#tag/Image/operation/ImageList 30 | 31 | ## Get Container List 32 | 33 | ```http 34 | GET /api/environment/containers 35 | ``` 36 | 37 | #### Query Param 38 | 39 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 40 | 41 | ```js 42 | { 43 | daemonId: string; 44 | } 45 | ``` 46 | 47 | #### Response 48 | 49 | ```json 50 | { 51 | "status": 200, 52 | "data": DockerContainerList, 53 | "time": 1718594177859 54 | } 55 | ``` 56 | 57 | > DockerContainerList: https://docs.docker.com/engine/api/v1.37/#tag/Container/operation/ContainerList 58 | 59 | ## Get Network Mode List 60 | 61 | ```http 62 | GET /api/environment/network 63 | ``` 64 | 65 | #### Query Param 66 | 67 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 68 | 69 | ```js 70 | { 71 | daemonId: string; 72 | } 73 | ``` 74 | 75 | #### Response 76 | 77 | ```json 78 | { 79 | "status": 200, 80 | "data": DockerNetworkList, 81 | "time": 1718594177859 82 | } 83 | ``` 84 | 85 | > DockerNetworkList: https://docs.docker.com/engine/api/v1.37/#tag/Network/operation/NetworkList 86 | 87 | ## Create Image 88 | 89 | ```http 90 | POST /api/environment/image 91 | ``` 92 | 93 | #### Query Param 94 | 95 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 96 | 97 | ```js 98 | { 99 | daemonId: string, 100 | } 101 | ``` 102 | 103 | #### Request Body 104 | 105 | ```json 106 | { 107 | "dockerFile": "...", // DockerFile Config 108 | "name": "mcsm-custom", // Image Name 109 | "tag": "latest" // Version 110 | } 111 | ``` 112 | 113 | #### Response 114 | 115 | ```json 116 | { 117 | "status": 200, 118 | "data": true, 119 | "time": 1718594177859 120 | } 121 | ``` 122 | 123 | ## Build Progress 124 | 125 | ```http 126 | GET /api/environment/progress 127 | ``` 128 | 129 | #### Query Param 130 | 131 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 132 | 133 | ```js 134 | { 135 | daemonId: string, 136 | } 137 | ``` 138 | 139 | #### Response 140 | 141 | ```json 142 | { 143 | "status": 200, 144 | "data": { 145 | "mcsm-custom:latest": -1 // -1 = Failed, 1 = Building, 2 = Complete 146 | // ...more... 147 | }, 148 | "time": 1718594177859 149 | } 150 | ``` 151 | -------------------------------------------------------------------------------- /apis/api_instance.md: -------------------------------------------------------------------------------- 1 | # Instance API 2 | 3 | ## Instance List 4 | 5 | ```http 6 | GET /api/service/remote_service_instances 7 | ``` 8 | 9 | #### Query Param 10 | 11 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 12 | 13 | ```js 14 | { 15 | daemonId: string; 16 | page: number; 17 | page_size: number; 18 | instance_name?: string; 19 | status: string; 20 | } 21 | ``` 22 | 23 | #### Response 24 | 25 | ```json 26 | { 27 | "status": 200, 28 | "data": { 29 | "maxPage": 1, 30 | "pageSize": 10, 31 | "data": InstanceDetail[] 32 | }, 33 | "time": 1718594177859 34 | } 35 | ``` 36 | 37 | ## Instance Detail 38 | 39 | ```http 40 | GET /api/instance 41 | ``` 42 | 43 | #### Query Param 44 | 45 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 46 | 47 | ```js 48 | { 49 | uuid: string, // Instance ID 50 | daemonId: string, 51 | } 52 | ``` 53 | 54 | #### Response 55 | 56 | ```json 57 | { 58 | "status": 200, 59 | "data": InstanceDetail, 60 | "time": 1718594177859 61 | } 62 | ``` 63 | 64 | ## Create 65 | 66 | ```http 67 | POST /api/instance 68 | ``` 69 | 70 | ##### Query Param 71 | 72 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 73 | 74 | ```js 75 | { 76 | daemonId: string; 77 | } 78 | ``` 79 | 80 | ##### Request Body 81 | 82 | > [InstanceConfig](#type-of-instanceconfig) 83 | 84 | #### Response 85 | 86 | ```json 87 | { 88 | "status": 200, 89 | "data": { 90 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf", 91 | "config": InstanceConfig 92 | }, 93 | "time": 1718594177859 94 | } 95 | ``` 96 | 97 | ## Update Config 98 | 99 | ```http 100 | PUT /api/instance 101 | ``` 102 | 103 | #### Query Param 104 | 105 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 106 | 107 | ```js 108 | { 109 | uuid: string, // Instance ID 110 | daemonId: string, 111 | } 112 | ``` 113 | 114 | #### Request Body 115 | 116 | > [InstanceConfig](#type-of-instanceconfig) 117 | 118 | #### Response 119 | 120 | ```json 121 | { 122 | "status": 200, 123 | "data": { 124 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf" 125 | }, 126 | "time": 1718594177859 127 | } 128 | ``` 129 | 130 | ## Delete 131 | 132 | ```http 133 | DELETE /api/instance 134 | ``` 135 | 136 | #### Query Param 137 | 138 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 139 | 140 | ```js 141 | { 142 | daemonId: string, 143 | } 144 | ``` 145 | 146 | #### Request Body 147 | 148 | ```json 149 | { 150 | "uuids": [ 151 | "50c73059001b436fa85c0d8221c157cf", 152 | "11c2f4c89b9e4e1da819dc56bf16f151" 153 | ], // Instance Id 154 | "deleteFile": false // Delete instance files 155 | } 156 | ``` 157 | 158 | #### Response 159 | 160 | ```json 161 | { 162 | "status": 200, 163 | "data": [ 164 | "50c73059001b436fa85c0d8221c157cf", 165 | "11c2f4c89b9e4e1da819dc56bf16f151" 166 | ], // Instance Id 167 | "time": 1718594177859 168 | } 169 | ``` 170 | 171 | ## Start 172 | 173 | ```http 174 | GET /api/protected_instance/open 175 | ``` 176 | 177 | #### Query Param 178 | 179 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 180 | 181 | ```js 182 | { 183 | uuid: string, // Instance ID 184 | daemonId: string, 185 | } 186 | ``` 187 | 188 | #### Response 189 | 190 | ```json 191 | { 192 | "status": 200, 193 | "data": { 194 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf" 195 | }, 196 | "time": 1718594177859 197 | } 198 | ``` 199 | 200 | ## Stop 201 | 202 | ```http 203 | GET /api/protected_instance/stop 204 | ``` 205 | 206 | #### Query Param 207 | 208 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 209 | 210 | ```js 211 | { 212 | uuid: string, // Instance ID 213 | daemonId: string, 214 | } 215 | ``` 216 | 217 | #### Response 218 | 219 | ```json 220 | { 221 | "status": 200, 222 | "data": { 223 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf" 224 | }, 225 | "time": 1718594177859 226 | } 227 | ``` 228 | 229 | ## Restart 230 | 231 | ```http 232 | GET /api/protected_instance/restart 233 | ``` 234 | 235 | #### Query Param 236 | 237 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 238 | 239 | ```js 240 | { 241 | uuid: string, // Instance ID 242 | daemonId: string, 243 | } 244 | ``` 245 | 246 | #### Response 247 | 248 | ```json 249 | { 250 | "status": 200, 251 | "data": { 252 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf" 253 | }, 254 | "time": 1718594177859 255 | } 256 | ``` 257 | 258 | ## Kill 259 | 260 | ```http 261 | GET /api/protected_instance/kill 262 | ``` 263 | 264 | #### Query Param 265 | 266 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 267 | 268 | ```js 269 | { 270 | uuid: string, // Instance ID 271 | daemonId: string, 272 | } 273 | ``` 274 | 275 | #### Response 276 | 277 | ```json 278 | { 279 | "status": 200, 280 | "data": { 281 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf" 282 | }, 283 | "time": 1718594177859 284 | } 285 | ``` 286 | 287 | ## Batch Operation 288 | 289 | Support operations: `start`, `stop`, `restart`, `kill` 290 | 291 | ```http 292 | POST /api/instance/multi_{{operations}} 293 | ``` 294 | 295 | #### Query Param 296 | 297 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 298 | 299 | ```js 300 | { 301 | instanceUuid: string, 302 | daemonId: string, 303 | }[] 304 | ``` 305 | 306 | #### Response 307 | 308 | ```json 309 | { 310 | "status": 200, 311 | "data": true, 312 | "time": 1718594177859 313 | } 314 | ``` 315 | 316 | ## Update Instance 317 | 318 | ```http 319 | GET /api/protected_instance/asynchronous 320 | ``` 321 | 322 | #### Query Param 323 | 324 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 325 | 326 | ```js 327 | { 328 | uuid: string, // Instance ID 329 | daemonId: string, 330 | task_name: "update" 331 | } 332 | ``` 333 | 334 | #### Response 335 | 336 | ```json 337 | { 338 | "status": 200, 339 | "data": true, 340 | "time": 1718594177859 341 | } 342 | ``` 343 | 344 | ## Send Command 345 | 346 | ```http 347 | GET /api/protected_instance/command 348 | ``` 349 | 350 | #### Query Param 351 | 352 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 353 | 354 | ```js 355 | { 356 | uuid: string, // Instance ID 357 | daemonId: string, 358 | command: string 359 | } 360 | ``` 361 | 362 | #### Response 363 | 364 | ```json 365 | { 366 | "status": 200, 367 | "data": { 368 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf" 369 | }, 370 | "time": 1718594177859 371 | } 372 | ``` 373 | 374 | ## Get output 375 | 376 | ```http 377 | GET /api/protected_instance/outputlog 378 | ``` 379 | 380 | #### Query Param 381 | 382 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 383 | 384 | ```js 385 | { 386 | uuid: string, // Instance ID 387 | daemonId: string, 388 | size?: number // Log size: 1KB ~ 2048KB 389 | // if not set, return all logs 390 | } 391 | ``` 392 | 393 | #### Response 394 | 395 | ```json 396 | { 397 | "status": 200, 398 | "data": "[INFO]: Done (12.138s)! For help, type \"help\"\n", 399 | "time": 1718594177859 400 | } 401 | ``` 402 | 403 | ## Reinstall 404 | 405 | ```http 406 | POST /api/protected_instance/install_instance 407 | ``` 408 | 409 | #### Query Param 410 | 411 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 412 | 413 | ```js 414 | { 415 | daemonId: string, 416 | uuid: string // Instance ID 417 | } 418 | ``` 419 | 420 | #### Request Body 421 | 422 | ```json 423 | { 424 | "targetUrl": "https://files.example.com/Paper-1.20.4.zip", 425 | "title": "Minecraft 1.20.4 Java", 426 | "description": "[Paper] Low hardware configuration machine use, Fast setup." 427 | } 428 | ``` 429 | 430 | #### Response 431 | 432 | ```json 433 | { 434 | "status": 200, 435 | "data": true, 436 | "time": 1718594177859 437 | } 438 | ``` 439 | 440 | ## Type of InstanceConfig 441 | 442 | ```json 443 | { 444 | "nickname": "New Name", 445 | "startCommand": "cmd.exe", 446 | "stopCommand": "^C", 447 | "cwd": "/workspaces/my_server/", 448 | "ie": "gbk", // input encode 449 | "oe": "gbk", // output encode 450 | "createDatetime": 1709631756708, 451 | "lastDatetime": 1709631756708, 452 | "type": "universal", // instance type 453 | "tag": [], 454 | "endTime": 1729631756708, 455 | "fileCode": "gbk", 456 | "processType": "docker", 457 | "updateCommand": "shutdown -s", 458 | "actionCommandList": [], 459 | "crlf": 2, 460 | "docker": DockerConfig, 461 | 462 | // Steam RCON 463 | "enableRcon": true, 464 | "rconPassword": "123456", 465 | "rconPort": 2557, 466 | "rconIp": "192.168.1.233", 467 | 468 | // Old fields 469 | "terminalOption": { 470 | "haveColor": false, 471 | "pty": true, 472 | }, 473 | "eventTask": { 474 | "autoStart": false, 475 | "autoRestart": true, 476 | "ignore": false, 477 | }, 478 | "pingConfig": { 479 | "ip": "", 480 | "port": 25565, 481 | "type": 1, 482 | } 483 | } 484 | ``` 485 | 486 | ## Type of InstanceDetail 487 | 488 | ```json 489 | { 490 | "config": InstanceConfig, 491 | "info": { 492 | "currentPlayers": -1, 493 | "fileLock": 0, 494 | "maxPlayers": -1, 495 | "openFrpStatus": false, 496 | "playersChart": [], 497 | "version": "", 498 | }, 499 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf", 500 | "processInfo": { 501 | "cpu": 0, 502 | "memory": 0, 503 | "ppid": 0, 504 | "pid": 0, 505 | "ctime": 0, 506 | "elapsed": 0, 507 | "timestamp": 0 508 | }, 509 | "space": 0, 510 | "started": 6, // start count 511 | "status": 3, // -1 = busy, 512 | // 0 = stopped, 513 | // 1 = stopping, 514 | // 2 = starting, 515 | // 3 = running 516 | } 517 | ``` 518 | 519 | ## Type of Instance DockerConfig 520 | 521 | ```json 522 | { 523 | "containerName": "", 524 | "image": "mcsm-ubuntu:22.04", 525 | "memory": 1024, // MB 526 | "ports": ["25565:25565/tcp"], 527 | "extraVolumes": [], 528 | "maxSpace": null, 529 | "network": null, 530 | "io": null, 531 | "networkMode": "bridge", 532 | "networkAliases": [], 533 | "cpusetCpus": "", 534 | "cpuUsage": 100, 535 | "workingDir": "", 536 | "env": [] 537 | } 538 | ``` 539 | -------------------------------------------------------------------------------- /apis/api_users.md: -------------------------------------------------------------------------------- 1 | # Users API 2 | 3 | ## Get User List 4 | 5 | ```http 6 | GET /api/auth/search 7 | ``` 8 | 9 | #### Query Param 10 | 11 | The parameters here are **URL Query parameters**, which are presented in JSON format for better illustration. 12 | 13 | ```js 14 | { 15 | userName?: string 16 | page: number 17 | page_size: number 18 | role?: string // User permission 19 | // 1=User, 10=Admin, -1=Banned user 20 | } 21 | ``` 22 | 23 | #### Response 24 | 25 | ```json 26 | { 27 | "status": 200, 28 | "data": { 29 | "data": [ 30 | { 31 | "uuid": "55a8120adb4f4bb3bee672ef305bae62", 32 | "userName": "Admin", 33 | "passWord": "", 34 | "passWordType": 1, 35 | "salt": "", 36 | "permission": 10, // 1=User, 10=Admin, -1=Banned user 37 | "registerTime": "10/28/2023, 5:38:44 PM", 38 | "loginTime": "10/14/2023, 1:01:58 AM", 39 | // List of instances owned by the user 40 | "instances": [ 41 | { 42 | "instanceUuid": "82e856fd33424e018fc2c007e1a3c4d3", 43 | "daemonId": "1fcdacc01eac44a7bf8fe83d34215d05" 44 | } 45 | ], 46 | "apiKey": "", 47 | "isInit": false, 48 | "secret": "", 49 | "open2FA": false 50 | } 51 | ], 52 | "maxPage": 1, 53 | "page": 1, 54 | "pageSize": 20, 55 | "total": 6 56 | }, 57 | "time": 1718594177859 58 | } 59 | ``` 60 | 61 | ## Create User 62 | 63 | ```http 64 | POST /api/auth 65 | ``` 66 | 67 | #### Request Body 68 | 69 | ```json 70 | { 71 | "username": string, 72 | "password": string, 73 | "permission": number // 1=User, 10=Admin, -1=Banned user 74 | } 75 | ``` 76 | 77 | #### Response 78 | 79 | ```json 80 | { 81 | "status": 200, 82 | "time": 1718594177859, 83 | "data": { 84 | "uuid": "046afc351bfb44a99aa5641c06e70e5a", // new user's uuid 85 | "userName": "Admin", // new user's username 86 | "permission": 1 // new user's permission 87 | } 88 | } 89 | ``` 90 | 91 | ## Update User 92 | 93 | ```http 94 | PUT /api/auth 95 | ``` 96 | 97 | #### Request Body 98 | 99 | ```json 100 | { 101 | "uuid": string, // UUID of the target user 102 | "config": { 103 | // target user info 104 | "uuid": string, 105 | "userName": string, 106 | "loginTime": string, 107 | "registerTime": string, 108 | "instances": InstanceDetail[], // user instances 109 | // You can assign instances to users here 110 | "permission": number, // 1=User, 10=Admin, -1=Banned user 111 | "apiKey": string, 112 | "isInit": boolean, 113 | "secret": string, 114 | "open2FA": boolean, 115 | } 116 | } 117 | ``` 118 | 119 | > For information about InstanceDetail, see [this](./api_instance.md#type-of-instancedetail) 120 | 121 | #### Response 122 | 123 | ```json 124 | { 125 | "status": 200, 126 | "data": true, 127 | "time": 1718594177859 128 | } 129 | ``` 130 | 131 | ## Delete User 132 | 133 | ```http 134 | DELETE /api/auth 135 | ``` 136 | 137 | #### Request Body 138 | 139 | ```js 140 | ["user uuid"]; // UUID of the target users 141 | ``` 142 | 143 | #### Response 144 | 145 | ```json 146 | { 147 | "status": 200, 148 | "data": true, 149 | "time": 1718594177859 150 | } 151 | ``` 152 | -------------------------------------------------------------------------------- /apis/get_apikey.md: -------------------------------------------------------------------------------- 1 | # API Tutorial 2 | 3 | ## API Key 4 | 5 | :::tip 6 | If you are on an admin account, your API key will also have admin privileges. Please do not disclose your API key. 7 | ::: 8 | 9 | As shown in the image, 10 | 11 | 12 | 13 | Generate and copy this API key, it will have the same rights as your current account. 14 | 15 | 16 | 17 | ## Example Usages 18 | 19 | Suppose you are an admin, and you want to use the API to `get a list of daemons`. You need to use any programming language or HTTP tool to send the following request: 20 | 21 | ```bash 22 | GET http://example.com/api/service/remote_services_system?apikey= 23 | Content-Type: application/json; charset=utf-8 24 | X-Requested-With: XMLHttpRequest 25 | ``` 26 | 27 | :::warning 28 | If not otherwise specified, **these HTTP request headers are required**. 29 | 30 | - X-Requested-With: XMLHttpRequest 31 | - Content-Type: application/json; charset=utf-8 32 | 33 | ::: 34 | 35 | You will get all daemon's data: 36 | 37 | ```json 38 | { 39 | // status parameter 40 | // 200: Normal, and returns the corresponding content 41 | // 400: Incorrect request parameters 42 | // 403: Insufficient permissions 43 | // 500: Program error 44 | "status": 200, 45 | // Responded node list 46 | "data": [ 47 | { 48 | "version": "3.9.0", 49 | "process": { 50 | "cpu": 5625000, 51 | "memory": 132437320, 52 | "cwd": "D:\\Workspace\\MCSM\\MCSManager-Daemon" 53 | }, 54 | "instance": { 55 | "running": 1, 56 | "total": 6 57 | }, 58 | "system": { 59 | "type": "Windows_NT", 60 | "hostname": "MyComputer", 61 | "platform": "win32", 62 | "release": "11.0.22000", 63 | "uptime": 410445, 64 | "cwd": "D:\\Workspace\\MCSM\\MCSManager-Daemon", 65 | "loadavg": [0, 0, 0], 66 | "freemem": 5700775936, 67 | "cpuUsage": 0.0490009222256379, 68 | "memUsage": 0.6651475749266619, 69 | "totalmem": 17024741376, 70 | "processCpu": 0, 71 | "processMem": 0 72 | } 73 | } 74 | ], 75 | // The time when the request finished processing, can be used to measure latency. 76 | "time": 1643879914006 77 | } 78 | ``` 79 | -------------------------------------------------------------------------------- /apis/html_card.md: -------------------------------------------------------------------------------- 1 | # Creating a Card Component 2 | 3 | :::tip 4 | This feature requires some knowledge of JavaScript development and may be somewhat unstable. 5 | 6 | **It is not recommended to use scripts from others as this could lead to your panel being compromised.** 7 | ::: 8 | 9 | After enabling the design mode in the MCSManager web interface, there is an option `Extend Page Card` when you add a new card. This card allows you to upload your own `HTML` file, which runs directly in the frontend web environment. This is fundamentally different from the `Embedded Web Card` because you can access most frontend HTML nodes and operate the API provided by MCSManager. 10 | 11 | ```html 12 | 13 | 14 | 15 | 16 | Hello World 17 | Button 18 | 19 | 20 | 21 | 39 | 40 | 41 | ``` 42 | 43 | ## JavaScript Sandbox Mechanism 44 | 45 | To prevent multiple cards from interfering with each other loaded on the same page, MCSManager has created a simple JavaScript sandbox mechanism. Its working principle is to proxy the window object. Any changes you make to the window object will not affect others. 46 | 47 | ### HTML Card 1 48 | 49 | ```js 50 | window.$onMounted = function () { 51 | window.name = "foo"; // Define a global variable 52 | }; 53 | ``` 54 | 55 | ### HTML Card 2 56 | 57 | ```js 58 | window.$onMounted = function () { 59 | setTimeout(() => { 60 | console.log(window.name); // undefined 61 | }, 10000); 62 | }; 63 | ``` 64 | 65 | ## CSS Style Pollution 66 | 67 | MCSManager does not isolate CSS styles. It's up to you or other developers to constrain CSS styles. Any definition you make to CSS will affect the entire MCSManager webpage. 68 | 69 | ## Card API 70 | 71 | We provide you with several APIs for use in your script. 72 | 73 | ```js 74 | window.$onMounted = function () { 75 | // Card mount complete event. 76 | }; 77 | window.$onUnmounted = function () { 78 | // Card unmount complete event. 79 | }; 80 | 81 | // Real window object, i.e., the window object of the MCSManager web frontend. 82 | window.$realWindow; 83 | 84 | // Axios library for sending requests. 85 | // Reference: https://axios-http.com/docs/example 86 | window.$axios; 87 | 88 | // Current MCSManager interface theme, light or dark (light/dark). 89 | window.$theme; 90 | ``` 91 | -------------------------------------------------------------------------------- /docker-install.md: -------------------------------------------------------------------------------- 1 | # Installing MCSManager Panel Using Docker 2 | 3 | :::tip 4 | Installing the panel via Docker requires some complex configurations. Make sure you have the necessary knowledge for this. Otherwise, it is recommended to use the one-click installation script. 5 | ::: 6 | 7 | ## Install Docker 8 | 9 | ```bash 10 | curl -fsSL https://get.docker.com -o get-docker.sh 11 | sudo sh get-docker.sh 12 | ``` 13 | 14 | ## Install MCSManager 15 | 16 | In the following commands, replace all `` with the **actual storage path** where your data will be stored. This path needs to be persistent. The installation paths for the web and daemon services can be different. 17 | 18 | ### Install via docker-compose 19 | 20 | ```yaml 21 | # docker-compose.yml 22 | services: 23 | web: 24 | image: githubyumao/mcsmanager-web:latest 25 | ports: 26 | - "23333:23333" 27 | volumes: 28 | - /etc/localtime:/etc/localtime:ro 29 | - /web/data:/opt/mcsmanager/web/data 30 | - /web/logs:/opt/mcsmanager/web/logs 31 | 32 | daemon: 33 | image: githubyumao/mcsmanager-daemon:latest 34 | restart: unless-stopped 35 | ports: 36 | - "24444:24444" 37 | environment: 38 | - MCSM_DOCKER_WORKSPACE_PATH=/daemon/data/InstanceData 39 | volumes: 40 | - /etc/localtime:/etc/localtime:ro 41 | - /daemon/data:/opt/mcsmanager/daemon/data 42 | - /daemon/logs:/opt/mcsmanager/daemon/logs 43 | - /var/run/docker.sock:/var/run/docker.sock 44 | ``` 45 | 46 | ```bash 47 | mkdir -p 48 | cd 49 | vim docker-compose.yml # Insert the docker-compose.yml content here 50 | docker compose pull && docker compose up -d 51 | ``` 52 | 53 | ### Install via Command Line 54 | 55 | ```bash 56 | docker pull githubyumao/mcsmanager-daemon:latest 57 | docker pull githubyumao/mcsmanager-web:latest 58 | 59 | # Note: In the following commands, replace `${CHANGE_ME_TO_INSTALL_PATH}` 60 | # with your actual data storage path, which needs to be persistent. 61 | 62 | # Start the MCSManager Daemon 63 | docker run -v /etc/localtime:/etc/localtime:ro \ 64 | -v ${CHANGE_ME_TO_INSTALL_PATH}/daemon/data:/opt/mcsmanager/daemon/data \ 65 | -v ${CHANGE_ME_TO_INSTALL_PATH}/daemon/logs:/opt/mcsmanager/daemon/logs \ 66 | -v /var/run/docker.sock:/var/run/docker.sock \ 67 | -e MCSM_DOCKER_WORKSPACE_PATH=${CHANGE_ME_TO_INSTALL_PATH}/daemon/data/InstanceData \ 68 | -p 24444:24444 \ 69 | -d githubyumao/mcsmanager-daemon:latest 70 | 71 | 72 | # Start the MCSManager Web Panel 73 | docker run \ 74 | -v /etc/localtime:/etc/localtime:ro \ 75 | -v ${CHANGE_ME_TO_INSTALL_PATH}/web/data:/opt/mcsmanager/web/data \ 76 | -v ${CHANGE_ME_TO_INSTALL_PATH}/web/logs:/opt/mcsmanager/web/logs \ 77 | -p 23333:23333 \ 78 | -d githubyumao/mcsmanager-web:latest 79 | ``` 80 | 81 | ### Configure the Panel 82 | 83 | Once installed and running, you can access the panel at `http://:23333`. 84 | 85 | You might encounter some errors when accessing the panel, as the Web panel may not be connected to the daemon. You will need to configure them to communicate. 86 | 87 | #### Connect the Node 88 | 89 | Click on `Nodes` in the top navigation bar, then click on `Add Node`. Fill in your server's **public IP**, secret key, and the default `24444` port. 90 | 91 | Run the command `cat /daemon/data/Config/global.json` to view the daemon's secret key. 92 | 93 | For more details, you can refer to: [Connecting to Other Machines](./advanced/distributed.html). 94 | -------------------------------------------------------------------------------- /images/custom_page/adjust_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/custom_page/adjust_card.png -------------------------------------------------------------------------------- /images/custom_page/custom_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/custom_page/custom_button.png -------------------------------------------------------------------------------- /images/custom_page/custom_login_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/custom_page/custom_login_page.png -------------------------------------------------------------------------------- /images/custom_page/custom_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/custom_page/custom_view.png -------------------------------------------------------------------------------- /images/custom_page/extend_page_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/custom_page/extend_page_card.png -------------------------------------------------------------------------------- /images/custom_page/html_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/custom_page/html_card.png -------------------------------------------------------------------------------- /images/custom_page/music_and_ssh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/custom_page/music_and_ssh.png -------------------------------------------------------------------------------- /images/custom_page/preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/custom_page/preview.gif -------------------------------------------------------------------------------- /images/custom_page/terminal_in_home_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/custom_page/terminal_in_home_page.png -------------------------------------------------------------------------------- /images/java_setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/java_setup.png -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/logo.png -------------------------------------------------------------------------------- /images/mcsm_arch_en.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Web Frontend(Browser)Web Frontend...DaemonDaemonActual ProcessActual ProcessActual ProcessActual ProcessActual ProcessActual ProcessDaemonDaemonActual ProcessActual ProcessActual ProcessActual ProcessDaemonDaemonActual ProcessActual ProcessActual ProcessActual ProcessContainerContainerPhysical HostPhysical HostPhysical HostPhysical HostHigh Bandwidth transmissionHigh Bandwidth transmission(Authenticated with the Panel)(Authenticated with the Pa...The PanelThe PanelDaemonDaemonUser DataorDatabaseUser Data...HTTP/SocketHTTP/SocketControlControlControlControlFile/TCPFile/TCPPhysical HostPhysical HostText is not SVG - cannot display -------------------------------------------------------------------------------- /images/zh_cn/distributed_principle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/zh_cn/distributed_principle.png -------------------------------------------------------------------------------- /images/zh_cn/getkey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/zh_cn/getkey.png -------------------------------------------------------------------------------- /images/zh_cn/java_setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/zh_cn/java_setup.png -------------------------------------------------------------------------------- /images/zh_cn/to_user_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MCSManager/Documentation/acdfaf97665bddd469a2aa0a35470a79eca96edb/images/zh_cn/to_user_info.png -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | # Quick start 2 | 3 | ## What's this? 4 | 5 | MCSManager is an **open-source, distributed, out-of-the-box control panel that supports `Minecraft` and `Steam game servers`**. 6 | 7 | MCSManager has gained a certain level of popularity within `Minecraft` and `other gaming communities`. It helps you manage multiple physical machines, configure game servers on any host, and offers a secure and reliable multi-user permission system. MCSManager is a one-stop solution for most server hosting senarios. 8 | 9 | ## Dependencies 10 | 11 | By default, **The installation script should already include all required environments**, so you don't need to worry about environment requirements. 12 | 13 | But if you install it manually, you need to meet the `Node 16+` runtime environment. 14 | 15 | ## Linux Installation Script 16 | 17 | Because it needs to be registered to the system service, **The installation script must be run with root.** 18 | 19 | ```bash 20 | sudo su -c "wget -qO- https://script.mcsmanager.com/setup.sh | bash" 21 | ``` 22 | 23 | ### Startup Method 24 | 25 | ```bash 26 | # Start the panel daemon first. 27 | # This is a service process used for process control and terminal management. 28 | systemctl start mcsm-daemon.service 29 | # Start the panel web service again. 30 | # This is used to implement services that support web page access and user management. 31 | systemctl start mcsm-web.service 32 | 33 | # Restart panel command 34 | systemctl restart mcsm-daemon.service 35 | systemctl restart mcsm-web.service 36 | 37 | # Stop panel command 38 | systemctl stop mcsm-web.service 39 | systemctl stop mcsm-daemon.service 40 | 41 | ``` 42 | 43 | :::tip 44 | If the `systemctl` command **cannot start** the panel, you can refer to the `Startup Method` in the `Manual installation` below to start MCSManager. 45 | But this requires you to use other background running programs to take over it, otherwise when your `SSH` terminal is disconnected, the manually started MCSManager panel will also be forcibly terminated by the system. 46 | 47 | The panel web service is a service that provides user management and web page access functions, and the daemon process is a service that provides process management and container management. Both are indispensable. If a certain function is not working properly, you can restart only this part of the service to hot-fix the problem. 48 | ::: 49 | 50 | ## Linux Manual Installation 51 | 52 | ```bash 53 | # Switch to the installation directory, you can also change to other directories. 54 | cd /opt/ 55 | 56 | # Download Node.js 20.11. If you already have Node.js 16+ installed, ignore this step. 57 | wget https://nodejs.org/dist/v20.11.0/node-v20.11.0-linux-x64.tar.xz 58 | tar -xvf node-v20.11.0-linux-x64.tar.xz 59 | 60 | # Add NodeJS to system PATH 61 | ln -s /opt/node-v20.11.0-linux-x64/bin/node /usr/bin/node 62 | ln -s /opt/node-v20.11.0-linux-x64/bin/npm /usr/bin/npm 63 | 64 | # Prepare MCSM's installation directory 65 | mkdir /opt/mcsmanager/ 66 | cd /opt/mcsmanager/ 67 | 68 | # Download MCSManager 69 | wget https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz 70 | 71 | # Unzip to the installation directory 72 | tar -zxf mcsmanager_linux_release.tar.gz 73 | 74 | ``` 75 | 76 | ### Startup Method 77 | 78 | ```bash 79 | #Install dependent libraries 80 | ./install.sh 81 | 82 | # Please use the Screen program to open two terminal windows (or other takeover programs) 83 | 84 | # Start the node program first 85 | ./start-daemon.sh 86 | 87 | # Start the Web panel service in the second terminal 88 | ./start-web.sh 89 | 90 | # Access http://localhost:23333/ for the web interface 91 | # Generally speaking, network applications will automatically scan and connect to the local daemon. 92 | # Default ports that need to be opened: 23333 and 24444 93 | ``` 94 | 95 | ### Stop Panel 96 | 97 | Just enter two terminals and execute `Ctrl+C`. 98 | 99 | ## Windows Installation 100 | 101 | Just [download the ZIP file](https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_windows_release.zip) and decompress it to run without any installation dependencies and without polluting the registry. 102 | 103 | ### Startup Method 104 | 105 | Execute `start.bat` or `run.bat`, etc. If the compressed package contains `launcher.exe`, you can use it to start the panel. 106 | 107 | ### Stop Panel 108 | 109 | Enter `Ctrl+C` in the two terminal console windows of the panel to close normally. 110 | -------------------------------------------------------------------------------- /install.md: -------------------------------------------------------------------------------- 1 | # Install panel 2 | 3 | ## Linux 4 | 5 | ```bash 6 | wget -qO- https://gitee.com/mcsmanager/script/raw/master/setup.sh | bash 7 | ``` 8 | 9 | If the Linux next-key script installation fails, you can [go here](https://github.com/MCSManager/MCSManager#linux) to install it manually. 10 | 11 | > Note: Repeated installation is prohibited. Repeated installation will cause all data in the original panel to be deleted. If you need to update the panel, please refer to the "Update Panel" chapter. 12 | 13 | ## Windows 14 | 15 | [Download Zip](https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_windows_release.zip) 16 | 17 | Just download and run, without any installation dependencies and without polluting the registry. 18 | 19 | # launch panel 20 | 21 | ## Linux 22 | 23 | You can use the following commands only after using the one-click installation script. If you install manually, please visit [Readme.md](https://github.com/MCSManager/MCSManager/blob/master/README.md) to view. 24 | 25 | ```bash 26 | # Start the panel daemon first. 27 | # This is a service process used for process control and terminal management. 28 | systemctl start mcsm-daemon.service 29 | # Start the panel web service again. 30 | # This is used to implement services that support web page access and user management. 31 | systemctl start mcsm-web.service 32 | 33 | # Restart panel command 34 | systemctl restart mcsm-daemon.service 35 | systemctl restart mcsm-web.service 36 | 37 | # Stop panel command 38 | systemctl stop mcsm-web.service 39 | systemctl stop mcsm-daemon.service 40 | 41 | ``` 42 | 43 | > The panel web service is a service that provides user management and web page access functions, and the daemon process is a service that provides process management and container management. Both are indispensable. If a certain function is not working properly, you can restart only this part of the service to hot-fix the problem. 44 | 45 | ## Windows 46 | 47 | Close the panel: Enter `Ctrl+C` in the two terminal console windows of the panel to close it normally. If it doesn't work, you can directly click the close button in the upper right corner. 48 | 49 | Start the panel: Execute `start.bat` or `run.bat`, etc. If the compressed package contains `launcher.exe`, you can use it to start the panel. 50 | 51 | ## Related Links 52 | 53 | Official website: [https://mcsmanager.com](https://mcsmanager.com) 54 | 55 | Github development team homepage: [https://github.com/MCSManager](https://github.com/MCSManager) 56 | 57 | Github discussion area: [https://github.com/MCSManager/MCSManager/issues](https://github.com/MCSManager/MCSManager/issues) 58 | 59 | QQ group: [198646856](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=NjZnbz2w1oEhjHbcL8nyxoxtrbtmFlp5&authKey=ktl9iperzg%2BdAjJeyZJ6hDSd1aZksO8uTpEbWeqY6XU1K6 lg005nqPGlZ2SQp6Sx&noverify=0&group_code=198646856) 60 | 61 | ## Donate 62 | 63 | Aida Donation Platform Address: [https://afdian.net/@mcsmanager](https://afdian.net/@mcsmanager) 64 | 65 | > Support the development team so that the software can be continuously updated and iterated and serve everyone. 66 | 67 | ## Running environment 68 | 69 | By default, the one-click installation script should already contain all required environments. 70 | 71 | In special cases, you need to meet the `Node 14+` runtime environment 72 | 73 | To download the Node environment, go to: [https://nodejs.org/zh-cn/](https://nodejs.org/zh-cn/) 74 | -------------------------------------------------------------------------------- /install_manual.md: -------------------------------------------------------------------------------- 1 | ## Manual Installation 2 | 3 | ### Linux 4 | 5 | ```bash 6 | # Create /opt directory if not already 7 | mkdir /opt 8 | # Switch to /opt 9 | cd /opt/ 10 | # Download Node.js 20.11. If you already have Node.js 16+ installed, ignore this step. 11 | wget https://nodejs.org/dist/v20.11.0/node-v20.11.0-linux-x64.tar.xz 12 | # Decompress Node.js source 13 | tar -xvf node-v20.11.0-linux-x64.tar.xz 14 | # Add Node.js to system PATH 15 | ln -s /opt/node-v20.11.0-linux-x64/bin/node /usr/bin/node 16 | ln -s /opt/node-v20.11.0-linux-x64/bin/npm /usr/bin/npm 17 | 18 | # Prepare MCSM's installation directory 19 | mkdir /opt/mcsmanager/ 20 | cd /opt/mcsmanager/ 21 | 22 | # Download MCSManager 23 | wget https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz 24 | tar -zxf mcsmanager_linux_release.tar.gz 25 | 26 | # Install dependencies 27 | ./install-dependency.sh 28 | 29 | # Please open two terminals or screens. 30 | 31 | # Start the daemon first. 32 | ./start-daemon.sh 33 | 34 | # Start the web interface at the second terminal or screen. 35 | ./start-web.sh 36 | 37 | # For web access, go to http://localhost:23333/ 38 | # In general, the web interface will automatically scan and add the local daemon. 39 | ``` 40 | 41 | --- 42 | -------------------------------------------------------------------------------- /ops/cloudflare.md: -------------------------------------------------------------------------------- 1 | # Using Cloudflare CDN 2 | 3 | :::tip 4 | **Before reading this section, please fully understand the [「Network Architecture」](./mcsm_network) and [「HTTPS Reverse Proxy」](./proxy_https.md) chapters**. \ 5 | This section is intended for users of Cloudflare CDN. 6 | ::: 7 | 8 | This section explains how to access the daemon from the panel while using Cloudflare as a proxy. 9 | 10 | Note that Cloudflare only serves as a CDN and does **NOT** provide port conversion services. That is, the port Cloudflare uses to access the **source server** is the **SAME** as the port users use to access Cloudflare. 11 | 12 | If you want multiple daemons to share one public port, consider using different subdomains and configure Nginx to forward differently based on the domain. 13 | 14 | :::warning 15 | Cloudflare only support the following HTTPS ports: 16 | 17 | - 443 18 | - 2053 19 | - 2083 20 | - 2087 21 | - 2096 22 | - 8443 23 | 24 | Please choose one of the above ports as the external HTTPS port. 25 | ::: 26 | 27 | ## 1. Configure DNS 28 | 29 | 1. Log in to the Cloudflare console and open the sub-panel for your domain. 30 | 2. In the `DNS` submenu in the sidebar, find `Records`, and add a new `A` or `CNAME` record pointing to your host. 31 | 3. Ensure `Proxy Status` is set to `DNS only` at this moment and save. 32 | 33 | ## 2. Configure HTTPS Reverse Proxy 34 | 35 | Before configuring Cloudflare CDN, (if not already) follow the [「HTTPS Reverse Proxy」](./proxy_https.md) section and enable HTTPS for your panel and daemon(s) using **one of the ports mentioned above**. You can use a `self-signed` or `Cloudflare's` SSL certificate. 36 | 37 | Please make sure you can connect via a browser using the domain configured before continue. 38 | 39 | ### Using Cloudflare's Certificate: 40 | 41 | 1. Open the Cloudflare panel and the sub-panel for your domain. 42 | 2. In the `SSL/TLS` submenu, find the `Origin Server` option and open it. 43 | 3. Click `create certificate`, and choose private key type, domain, and validity period (recommended: `ECC` private key type, keep domain `default`, and select `15 years` validity). 44 | 4. Copy and save the certificate and key. 45 | 46 | ### Using a Self-Signed Certificate: 47 | 48 | ``` 49 | #Generate a Self-Signed Certificate using OpenSSL 50 | openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 51 | ``` 52 | 53 | ## 3. Configure Cloudflare 54 | 55 | Open the Cloudflare panel and the sub-panel for your domain, and open the `SSL/TLS` menu. 56 | 57 | 1. If you're using a `self-signed certificate`, change the SSL/TLS **`encryption mode`** to **`Full`**. 58 | 2. If you're using a Cloudflare certificate, you can choose between **`Strict`** or **`Full`**. In general, **`Full`** is sufficient for **`most`** users. 59 | 60 | In the `DNS` submenu, find `Records`. 61 | 62 | 1. Edit the `A` or `CNAME` record you just added. 63 | 2. Change `Proxy Status` to `Proxied` and save. 64 | 65 | ## 4. Test Access 66 | 67 | Using the domain configured in **step two**, test access **again** with your browser. 68 | 69 | If it displays correctly, congratulations! You have successfully enabled Cloudflare for your panel and/or node!\ 70 | Now, you can add nodes to your panel following the steps in the [「HTTPS Reverse Proxy」](./proxy_https.md) section. 71 | 72 | If the test fails, you may need to manually clear the DNS cache and retry. 73 | -------------------------------------------------------------------------------- /ops/config_files.md: -------------------------------------------------------------------------------- 1 | # Data & Configs 2 | 3 | ## Configurations 4 | 5 | ### Web UI 6 | 7 | `/data/SystemConfig/config.json` 8 | 9 | ```json 10 | { 11 | "httpPort": 23333, // Web UI listening port 12 | "httpIp": null, // Bind IP address, can be useful with multiple NICs 13 | "crossDomain": true, // Allow cross origin 14 | "gzip": false, // enable gzip decompression 15 | "loginCheckIp": false, // Block IP address after too many login attemps 16 | "loginInfo": "foo", // Login UI hint 17 | "canFileManager": true, // Allow all users to use file management 18 | "language": "zh_cn", // UI language 19 | "quickInstallAddr": "https://raw.githubusercontent.com/MCSManager/Script/refs/heads/master/templates.json", // Quick install json file path/address 20 | 21 | "redisUrl": "", // Redis database, NOT RECOMMAND 22 | "dataPort": 23334, // Deprecated 23 | "forwardType": 1, // Deprecated 24 | "zipType": 1, // Deprecated 25 | "maxCompress": 1, // Max number of concurrent compression tasks, Deprecated. 26 | "maxDownload": 10 // Max number of concurrent downloading tasks, Deprecated. 27 | } 28 | ``` 29 | 30 | ### Daemon 31 | 32 | `/data/Config/global.json` 33 | 34 | ```json 35 | { 36 | "version": 2, 37 | "ip": "", // Bind IP address, can be useful with multiple NICs 38 | "port": 24444, // Daemon listening port 39 | "key": "c043e149c9bc44d922ea3be6ff6406abc7b778981c3feb6", // Daemon key 40 | "maxFileTask": 2, // Max concurrent decompression tasks per instance 41 | "maxZipFileSize": 60, // Max allowed file size for decompression in GB 42 | "language": "zh_cn", // Daemon language 43 | "defaultInstancePath": "" // Default directory for instances, blank for auto 44 | } 45 | ``` 46 | 47 | ## Instance Data Location 48 | 49 | Instance data files are player data, maps, plugins, etc. By default, they are stored at `/data/InstanceData//`. 50 | 51 | Instance configurations are stored in\ 52 | `/data/InstanceConfig/.json`, \ 53 | this file contains all configurations like `startup commands` for the selected instance. 54 | -------------------------------------------------------------------------------- /ops/from_v9.md: -------------------------------------------------------------------------------- 1 | # Upgrading from MCSManager 9.x 2 | 3 | :::tip 4 | The configurations, file formats, and API usage in MCSManager 10 are slightly different than version 9.x. However, 90% of the API calls can still be used as it. 5 | ::: 6 | 7 | ## Where is my Current Data? 8 | 9 | If your version 9.x was installed using the one-click script, on Linux, your data is located in: 10 | 11 | - Instance-related data: `/opt/mcsmanager/daemon/data` 12 | 13 | - User-related data: `/opt/mcsmanager/web/data` 14 | 15 | Similarly, on Windows, the data is in the `daemon` and `web` directories respectively. 16 | 17 | ## Upgrading Steps 18 | 19 | 1. Download and extract the latest MCSManager 10.x release package. 20 | 21 | 2. Shut down all panel services and back up your data. 22 | 23 | > Simply copy all the files in `daemon/data` and `web/data` to complete the backup. 24 | 25 | 3. Enter the `daemon` and `web` directories of the 9.x version. 26 | 27 | 4. Delete all files in the 9.x files **except for `daemon/data` and `web/data`**, then copy the daemon and web folders from the 10.x version into the corresponding folders. 28 | 29 | 5. Start the panel. 30 | 31 | :::tip 32 | You must delete the old code and then copy the new code into the folder, rather than overwriting the files. Many users have pointed out that overwriting files often leads to problems due to extra files from the old version. 33 | ::: 34 | 35 | ## Upgrading APIs 36 | 37 | If you are using MCSManager 9.x version of Discord bot, QQ bot, SDK, and unofficial tools, you may need to contact the developer for adaptation. 38 | 39 | There are several breaking updates in 10.x, including: 40 | 41 | **1. Update to User Information API:** 42 | 43 | **In 9.x, assigning an instance to a user looked like this:** 44 | 45 | ```js 46 | { 47 | "userName": "lmh", 48 | // more... 49 | "instances": [ 50 | { 51 | "instanceUuid": "bc3cd400b8f54be2b14078c7dd4d1820", 52 | "serviceUuid": "af7acf6cb7414d13916b9a9bd39a2b60" 53 | } 54 | ], 55 | } 56 | ``` 57 | 58 | **Now in 10.x, `serviceUuid` is changed to `daemonId`:** 59 | 60 | ```js 61 | { 62 | "userName": "lmh", 63 | // more... 64 | "instances": [ 65 | { 66 | "instanceUuid": "d0999ed2c57348868f56d11d2edf8806", 67 | "daemonId": "2068878ada35464c940bf84750b20333" 68 | }, 69 | ], 70 | } 71 | ``` 72 | 73 | **2. Instance expiry time, creation time, and last start time are upgraded from text format to timestamp format.** 74 | 75 | **9.x** 76 | 77 | ```js 78 | { 79 | "nickname": "Test Instance", 80 | "startCommand": "java -Xmx4G -jar server.jar -nogui", 81 | "stopCommand": "stop", 82 | // ... more 83 | "createDatetime": "10/14/2023", 84 | "lastDatetime": "12/24/2023 16:28", 85 | "endTime": "2/12/2025, 5:45:44 PM", 86 | } 87 | ``` 88 | 89 | **10.x** 90 | 91 | ```js 92 | { 93 | "nickname": "Test Instance", 94 | "startCommand": "java -Xmx4G -jar server.jar -nogui", 95 | "stopCommand": "stop", 96 | // ... more 97 | "createDatetime": 1709631756708, 98 | "lastDatetime": 1710330661317, 99 | "endTime": 0, 100 | } 101 | ``` 102 | **3. Docker field `extraVolumes` of User Information updated to use `|` for separation, not supporting definitions like `:ro`.** 103 | 104 | This is mainly for compatibility with Windows Docker. 105 | 106 | **10.x** 107 | 108 | ```js 109 | // more... 110 | "docker": { 111 | "containerName": "", 112 | // more... 113 | "extraVolumes": [ 114 | "myhost/a/b/|container/work" 115 | ], 116 | } 117 | ``` 118 | **4. Change of the daemon ID parameter.** 119 | 120 | For example, the API to start an instance: 121 | 122 | **9.X** 123 | 124 | ```http 125 | POST /api/protected_instance/open?remote_uuid={Daemon ID}&uuid={Instance ID}&apikey={Api Key} 126 | ``` 127 | 128 | **10.X** 129 | 130 | ```http 131 | // remote_uuid --> daemonId 132 | POST /api/protected_instance/open?daemonId={Daemon ID}&uuid={Instance ID}&apikey={Api Key} 133 | ``` 134 | 135 | Note: This change is optional. `10.x` still supports the `remote_uuid` parameter, but it's not recommended as it could be removed anytime in the future without notice. 136 | -------------------------------------------------------------------------------- /ops/mcsm_network.md: -------------------------------------------------------------------------------- 1 | # Network Architecture 2 | 3 | :::tip 4 | If you want a proper reverse proxy, you have to first understand how MCSManager manages its network traffic. On this page, we briefly discussed the network principle of MCSManager. 5 | ::: 6 | 7 | Let's start with the daemons. MCSManager manages **multiple machines** together with a single `Panel`. The local/remote machines that were connected and managed is what we called `daemon`. 8 | 9 | Suppose there are many users uploading files to different daemons, **if all files are transferred via the panel, the panel will become a bottleneck**, especially for remote daemons. 10 | 11 | Therefore, we offload all operations that might require **a large bandwidth** directly to the daemon. Once authorized by the panel, the traffic (e.g. file uploading, console logs) will go ***directly*** from the browswer to the corresponding `daemon`. This will greatly reduce the load on the panel itself. 12 | 13 | ## Project Architecture 14 | 15 | MCSManager has two parts: one **Panel** (Web Panel) and one **Daemon**. 16 | 17 | 18 | **The Panel** 19 | 20 | - User Management 21 | - Connect to Daemon(s) 22 | - Authentication for Most Operations 23 | - API 24 | - More... 25 | 26 | **The Daemon** 27 | 28 | - Process Management (Where Instances Run) 29 | - Docker Image Management 30 | - File Management 31 | - Realtime Terminal Communication 32 | - More... 33 | 34 | ## What Does This Mean? 35 | 36 | This distributed architecture will make configuration for reverse proxy ***harder***. For most applications, we only need to configure a single port for reverse proxy. However, for MCSManager, at least ***two ports*** need to be configured: one for the **web panel** and one for the **daemon**. If you have more than one daemon, the reverse proxy for each daemon needs to be configured separately. 37 | 38 | In addition, if you plan to support HTTPS with reverse proxy, you will have to configure HTTPS for all daemons. This is a hard requirement by the browser, otherwise, the browser will refuse to connect to daemons without HTTPS. 39 | 40 | ## Theory 41 | 42 | In general, the browser will need to be able to interact with the daemon directly to transfer files and console logs. 43 | 44 | Consequently, the IP address for each daemon ***CAN NOT*** be a LAN address. In that case, the daemon status will stay at `Connecting`, and all users will not be able to access the panel from the public internet. 45 | 46 |  47 | -------------------------------------------------------------------------------- /ops/path_prefix.md: -------------------------------------------------------------------------------- 1 | # Share port with other services 2 | 3 | ::: tip 4 | To read and use this chapter** you must know reverse proxy of Nginx or other software and basic Linux operation and maintenance knowledge**. 5 | ::: 6 | 7 | If you want MCSManager and other services to use the same port, there are the following solutions: 8 | 9 | - Use different domain names sni to distinguish. 10 | - **Add URL path prefix to localize the service. ** 11 | 12 | This section mainly explains the second type. 13 | 14 | ## What is URL path prefix? 15 | 16 | For example: the URL when accessing the MCSManager panel is `http://localhost:23333/`. If you configure the URL prefix to `/mcsm/`, the panel's URL becomes `http://localhost:23333/mcsm/`. 17 | 18 | Suppose you also have a service called `Jenkins` and set the path prefix to `/jenkins/`. At this point you can merge the two services via a reverse proxy. 19 | 20 | For example, reverse proxy to `https://example.com[:443]`, then you can access the MCSM panel through `https://example.com/mcsm/` and also through `https://example .com/jenkins/` to access Jenkins. 21 | 22 | ## Reverse proxy 23 | 24 | For the configuration of Nginx, see [Configuring HTTPS](proxy_https). 25 | 26 | What we need to do now is to modify the `location` item in the original configuration. For example, if your path prefix is `/mcsm/`, then replace the original 27 | 28 | ```conf 29 | location/{ 30 | #... 31 | } 32 | ``` 33 | 34 | Change to 35 | 36 | ```conf 37 | location /mcsm { 38 | #... 39 | } 40 | ``` 41 | 42 | Just restart nginx. 43 | 44 | ## Change configuration 45 | 46 | The `prefix` item in the [Configuration File] (config_files) of Daemon and Web programs is the path prefix configuration item. 47 | 48 | Change it to your desired path prefix and restart MCSM. When you visit again at this time, you will find that you have been automatically redirected to the corresponding page with the path prefix added. 49 | 50 | ::: warning 51 | The path prefix should start with `/`, such as `/mcsm/`. 52 | ::: 53 | 54 | ::: tip 55 | The `/` at the end of the path prefix is recommended. 56 | 57 | If not added, such as `/mcsm`, then `/mcsmapi/xxx` will also be matched and processed as `/api/xxx`. 58 | ::: 59 | 60 | Next, after the Daemon adds the path prefix configuration and restarts, you will find that the panel cannot successfully connect to the remote node. 61 | 62 | At this time, you need to enter the `Node` menu in the panel, select the corresponding node, click the `Settings` button, and fill in the corresponding `Path Prefix` item. If filled in correctly, you should be able to connect to the Daemon program normally after saving. 63 | -------------------------------------------------------------------------------- /ops/proxy_https.md: -------------------------------------------------------------------------------- 1 | # Reverse Proxy for HTTPS 2 | 3 | :::tip 4 | **Make sure you FULLY understand the [Network Architecture](/ops/mcsm_network.md) before continue.** 5 | ::: 6 | 7 | ## Generate SSL Certificate 8 | 9 | The following websites provide free 90-days SSL certificate for your domain. You can also choose other providers. 10 | 11 | > https://zerossl.com/ 12 | 13 | You can also choose to get a certificate from `Let's Encrypt`, `Other CA`, or `Self-Signed Certificate`. Note, that a self-signed certificate is not trusted by OS and browser by default, it has to be added to the certificate store manually. 14 | 15 | ``` 16 | #Generate a Self-Signed Certificate using OpenSSL 17 | openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 18 | ``` 19 | 20 | ## Locate the Config Location 21 | 22 | We use `Nginx` as an example, as it is the most prevalent reverse proxy on the field. For `Apache` or `Caddy`, feel free to come up with your own configuration. 23 | 24 | By default, Nginx stores configurations in `/etc/nginx/nginx.conf`. For different Linux distributions, the location might be slightly different. 25 | 26 | ## Prepare the Certificate Chain 27 | 28 | Ignore this step if a self-signed certificate is being used. 29 | 30 | **Prepare the following files**: 31 | 32 | 1. Issued certificate, e.g. **_domain.crt_**。 33 | 2. Certificate of CA, can be downloaded from their website. e.g. **_ca.crt_**. 34 | 3. Private key of issued certificate, e.g. **_domain.key_**。 35 | 36 | We will use **_domain.crt_**, **_ca.crt_**, **_domain.key_** as examples in this tutorial. 37 | 38 | If you are using `Nginx` as the reverse proxy, open **_domain.crt_** and **_ca.crt_** with any editor, and copy the content of **_ca.crt_** to the bottom of **_domain.crt_**. 39 | 40 | ## Prepare the Reverse Proxy 41 | 42 | Please ensure that the following files and configurations are ready before starting. You may adjust them according to your need. 43 | 44 | 1. Configured cert chain and path: `/etc/nginx/ssl/domain.crt`. 45 | 2. Private key of the cert and path: `/etc/nginx/ssl/domain.key`. 46 | 3. Nginx main config location: `/etc/nginx/nginx.conf`. 47 | 4. Current (non-SSL) local address and port for the daemon: `127.0.0.1:24444`. 48 | 5. Current (non-SSL) local address and port for the panel: `127.0.0.1:23333`. 49 | 6. HTTPS port for the daemon: `12444`. 50 | 7. HTTPS port for the panel: `12333`. 51 | 8. [***If use domain***] Domain correctly resolved to the public IP. 52 | 9. Firewall allowed or port forwarded `12444` and `12333`. 53 | 54 | ## Reverse Proxy for the Daemon 55 | 56 | Below is a sample configuration, you can change the port or adjust the settings according to your actual situation.\ 57 | Save as `daemon_https.conf` and put it in the `/etc/nginx/sites-enabled`directory\ 58 | You can also place the configuration directly at the end of the `nginx.conf` file (before the last curly brace).\ 59 | In case of multiple daemons, simple add the following configuration repeatedly with different ports and addresses. 60 | 61 | ```nginx 62 | # MCSManager Daemon 63 | server { 64 | # Public HTTPS port for the daemon (use multiple `listen` directive for multiple ports) 65 | listen 12444 ssl http2; #IPV4 66 | listen [::]:12444 ssl http2; #IPv6 67 | 68 | # Enable HSTS. Once enabled, it will enforce the use of HTTPS to connect to daemons and will continue for a year after this policy is cancelled, unless manually cleared in the browser. 69 | # Disable by default, uncomment to enable. 70 | #add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; 71 | 72 | # DNS resolver, only required when the traffic will be forwarded to a remote daemon connected via a domain. 73 | resolver 8.8.8.8; 74 | 75 | # Automatically redirect HTTP to HTTPS 76 | error_page 497 https://$host:$server_port$request_uri; 77 | 78 | proxy_hide_header Upgrade; 79 | location / { 80 | # Request Headers. No need to change in general 81 | proxy_set_header Host $host; 82 | proxy_set_header X-Real-Ip $remote_addr; 83 | proxy_set_header X-Forwarded-For $remote_addr; 84 | proxy_set_header REMOTE-HOST $remote_addr; 85 | 86 | # Target daemon address and port. Support domain and HTTPS. 87 | proxy_pass http://127.0.0.1:24444; 88 | 89 | # Support WebSocket 90 | proxy_set_header Upgrade $http_upgrade; 91 | proxy_set_header Connection "upgrade"; 92 | 93 | # Max size for a single file being transferred. 0 for unlimited. 94 | client_max_body_size 0; 95 | 96 | # Disable cache 97 | proxy_request_buffering off; 98 | proxy_buffering off; 99 | } 100 | # Path to HTTPS certificate and key 101 | ssl_certificate /etc/nginx/ssl/domain.crt; 102 | ssl_certificate_key /etc/nginx/ssl/domain.key; 103 | 104 | # Enable gzip by default 105 | gzip on; 106 | 107 | # File that will be compressed during transfer 108 | gzip_types text/plain text/css application/javascript application/xml application/json; 109 | 110 | # Enable compression with reverse proxy 111 | gzip_proxied any; 112 | 113 | # Compression level during transmission; the higher the level, the more CPU is used for compression. 114 | # The maximum level is 9, but usually, level 5 is sufficient 115 | gzip_comp_level 5; 116 | 117 | # Only compress when the size during transmission reaches 1k, as compressing smaller content is pointless. 118 | gzip_min_length 1k; 119 | 120 | # intermediate configuration 121 | ssl_protocols TLSv1.2 TLSv1.3; 122 | ssl_ecdh_curve X25519:prime256v1:secp384r1; 123 | ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305; 124 | ssl_prefer_server_ciphers off; 125 | # see also ssl_session_ticket_key alternative to stateful session cache 126 | ssl_session_timeout 1d; 127 | } 128 | ``` 129 | 130 | ## Reverse Proxy for the Panel 131 | 132 | Below is a sample configuration, you can change the port or adjust the settings according to your actual situation.\ 133 | Save as `web_https.conf` and put it in the `/etc/nginx/sites-enabled`directory\ 134 | You can also place the configuration directly at the end of the `nginx.conf` file (before the last curly brace). 135 | 136 | ```nginx 137 | # MCSManager Panel 138 | server { 139 | # Public HTTPS port for the panel (use multiple `listen` directive for multiple ports) 140 | listen 12333 ssl http2; #IPV4 141 | listen [::]:12333 ssl http2; #IPv6 142 | 143 | # Enable HSTS. Once enabled, it will enforce the use of HTTPS to connect to the panel and will continue for a year after this policy is cancelled, unless manually cleared in the browser. 144 | # Disable by default, uncomment to enable. 145 | #add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; 146 | 147 | # DNS resolver, only required when the traffic will be forwarded to a remote panel connected via a domain. 148 | resolver 8.8.8.8; 149 | 150 | # Automatically redirect HTTP to HTTPS 151 | error_page 497 https://$host:$server_port$request_uri; 152 | 153 | proxy_hide_header Upgrade; 154 | location / { 155 | # Request Headers. No need to change in general 156 | proxy_set_header Host $host; 157 | proxy_set_header X-Real-Ip $remote_addr; 158 | proxy_set_header X-Forwarded-For $remote_addr; 159 | proxy_set_header REMOTE-HOST $remote_addr; 160 | 161 | # Target daemon address and port. Support domain and HTTPS. 162 | proxy_pass http://127.0.0.1:23333; 163 | 164 | # Support WebSocket 165 | proxy_set_header Upgrade $http_upgrade; 166 | proxy_set_header Connection "upgrade"; 167 | 168 | # Max size for a single file being transferred. 0 for unlimited. 169 | client_max_body_size 0; 170 | 171 | # Disable cache 172 | proxy_request_buffering off; 173 | proxy_buffering off; 174 | 175 | # Only allow clients to send cookies over HTTPS. 176 | proxy_cookie_flags ~ secure; 177 | } 178 | 179 | # Path to HTTPS certificate and key 180 | ssl_certificate /etc/nginx/ssl/domain.crt; 181 | ssl_certificate_key /etc/nginx/ssl/domain.key; 182 | 183 | # Enable gzip by default 184 | gzip on; 185 | 186 | # File that will be compressed during transfer 187 | gzip_types text/plain text/css application/javascript application/xml application/json; 188 | 189 | # Enable compression with reverse proxy 190 | gzip_proxied any; 191 | 192 | # Compression level during transmission; the higher the level, the more CPU is used for compression. 193 | # The maximum level is 9, but usually, level 5 is sufficient 194 | gzip_comp_level 5; 195 | 196 | # Only compress when the size during transmission reaches 1k, as compressing smaller content is pointless. 197 | gzip_min_length 1k; 198 | 199 | # intermediate configuration 200 | ssl_protocols TLSv1.2 TLSv1.3; 201 | ssl_ecdh_curve X25519:prime256v1:secp384r1; 202 | ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305; 203 | ssl_prefer_server_ciphers off; 204 | # see also ssl_session_ticket_key alternative to stateful session cache 205 | ssl_session_timeout 1d; 206 | } 207 | ``` 208 | 209 | ## Verify Nginx Configuration 210 | 211 | Once the configuration is ready, use `sudo nginx -t` to tset the configuration. 212 | 213 | ```log 214 | nginx: the configuration file /etc/nginx/nginx.conf syntax is ok 215 | nginx: configuration file /etc/nginx/nginx.conf test is successful 216 | ``` 217 | 218 | Once succeeded, use `sudo nginx -s reload` to reload Nginx. 219 | 220 | ```log 221 | 2024/01/27 22:57:17 [notice] 4826#4826: signal process started 222 | ``` 223 | 224 | Suppose the domain being used is **_domain.com_** , and the HTTPS port is `12333` (for daemon) and `12444` (for panel), we can then access the following URL using any browser: 225 | 226 | ```txt 227 | Panel: https://domain.com:12333/ 228 | Daemon: https://domain.com:12444/ 229 | ``` 230 | 231 | For the daemon, if the following content is displayed, the HTTPS reverse proxy is successfully configured! 232 | 233 | > [MCSManager Daemon] Status: OK | reference: https://mcsmanager.com/ 234 | 235 | For the web, if the login page is displayed correctly, the HTTPS reverse proxy is successfully configured! 236 | 237 | ## Connect via HTTPS 238 | 239 | At this point, if you acess the web panel, you'll find that you can log in without problem. 240 | 241 | **However** 242 | 243 | If you enter any instance console to upload or download files, etc., you will find that it **still doesn't work** properly. This is because MCSManager requires the browser to connect **directly** to remote daemon. Since you've upgraded to HTTPS, the browser **refuses** to use the Websocket+HTTP protocol to connect to remote daemon! 244 | 245 | > [Why does the browser need to connect directly to the remote daemons?](mcsm_network) 246 | 247 | Go to the `Daemons` tab, you might find connections to remote daemons using `localhost`, `123.x.x.x`, or other domains. A reverse proxy for each remote daemon **_must be configured separately_**, so that they all use HTTPS to connect. 248 | 249 | Once configured, replace the original `localhost`, `123.x.x.x`, or `domain.com` with `wss://localhost`, `wss://123.x.x.x`, or `wss://domain.com` respectively. 250 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "documentation", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "dev": "vitepress dev --port 5174", 8 | "build": "vitepress build", 9 | "preview": "vitepress preview" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/MCSManager/Documentation.git" 14 | }, 15 | "author": "", 16 | "license": "MIT", 17 | "bugs": { 18 | "url": "https://github.com/MCSManager/Documentation/issues" 19 | }, 20 | "homepage": "https://github.com/MCSManager/Documentation#readme", 21 | "devDependencies": { 22 | "less": "^4.2.0", 23 | "vitepress": "^1.0.0-rc.32" 24 | }, 25 | "dependencies": { 26 | "@vue/theme": "^2.2.5" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /setup_any_software.md: -------------------------------------------------------------------------------- 1 | # Other Use Cases 2 | 3 | ## What Else can MCSManager do? 4 | 5 | Now you should have deployed at least one instance, but there is more to discover! 6 | 7 | MCSManager can start any Docker image (e.g. `mysql:8`). You can also run any command you want like `cmd.exe` or `bash` directly without Docker, just like an `SSH Client`. 8 | 9 | All in all, you can run **any application** using MCSManager! -------------------------------------------------------------------------------- /setup_bedrock_edition.md: -------------------------------------------------------------------------------- 1 | # Setup Bedrock Edition Server 2 | 3 | ## System Requirments 4 | 5 | To help prevent errors, we recommend using the **latest popular Linux distributions**, such as `Ubuntu 22.04 LTS`. 6 | 7 | For Windows, we suggest using `Windows Server 2016`, `Windows 10`, or the latest stable version. 8 | 9 | ## Windows 10 | 11 | ### Downloading Server Core 12 | 13 | You will find the latest official Bedrock Edition server core on [the official Minecraft Bedrock website](https://www.minecraft.net/en-us/download/server/bedrock). 14 | 15 | ### Starting the Server 16 | 17 | 1. Log in to the panel, and go to `Instances`. 18 | 2. Click `Create` button, and select `Minecraft Server (Bedrock)`. 19 | 3. Select the machine (node) where you would like to deploy the server. 20 | 4. Fill in the blanks and type `bedrock_server.exe` into the startup command. 21 | 5. `bedrock_server.exe` is the name of the server core. 22 | 6. Upload the core zip file that you downloaded. 23 | 7. Wait for upload and unzip. Then open the instance terminal. 24 | 8. Click `Start` button on the top-right of the page. 25 | 9. Have fun! 26 | 27 | ### `Missing xxx.dll` or `Fail to start`? 28 | 29 | Install Microsoft VC++ from microsoft official website. 30 | 31 | ## Linux 32 | 33 | ### Downloading Server Core 34 | 35 | You will find the latest official Bedrock Edition server core on [the official Minecraft Bedrock website](https://www.minecraft.net/en-us/download/server/bedrock). 36 | 37 | ### Starting the Server 38 | 39 | 1. Log in to the panel, and go to `Instances`. 40 | 2. Click `Create` button, and select `Minecraft Server (Bedrock)`. 41 | 3. Select the machine (node) where you would like to deploy the server. 42 | 4. Fill in the blanks and type `./bedrock_server`,`bedrock_server` into the startup command. 43 | 5. `bedrock_server` is the name of the server core. 44 | 6. Upload the core zip file that you downloaded. 45 | 7. Wait for upload and unzip. Then open the instance terminal. 46 | 8. Click `Start` button on the top-right of the page. 47 | 9. Have fun! 48 | 49 | --- 50 | 51 | ### ERROR? 52 | 53 | ``` 54 | [MCSMANAGER] [ERROR] The instance appears to exit shortly after startup, which may be due to an incorrect launch command or configuration error. 55 | ``` 56 | 57 | There are many factors that will cause this problem, here are the **three** most common problems and solution: 58 | 59 | - Incorrect startup command 60 | - Insufficient running permission 61 | - Missing running environment 62 | 63 | --- 64 | 65 | #### Incorrect Startup Command 66 | 67 | ```bash 68 | ./bedrock_server 69 | # bedrock_server is the name of the server core binary. 70 | #You can also write an sh script and run with sh .sh 71 | ``` 72 | 73 | --- 74 | 75 | #### Insufficient Permission & Missing Running Environment 76 | 77 | ```bash 78 | # ERROR 79 | Instance process/container failed to start (PID is empty). Possible reasons are: 80 | 1. Incorrect startup command. Please check the startup command and parameters in the instance settings. 81 | 2. Incorrect or missing system environment, such as Java environment, etc. 82 | 83 | ...... 84 | 85 | Please report this information to the administrator, technical support, or troubleshoot yourself. 86 | 87 | 88 | [MCSMANAGER] [ERROR] Failed to start instance, please check the startup command, host environment, or configurations. 89 | ``` 90 | 91 | If you are **the server admin**, make sure **the directory (Server)** has 755 permission. If not, change the permission using file management; If yes, check the integrity of the core. 92 | 93 | In case of a environment problem, try reinstalling or updating the OS, still happens? Google it! 94 | 95 | --- 96 | 97 | #### Instance started successfully, but can't log on to the server? 98 | 99 | In this situation, check your firewall or security group settings, and make sure to allow inbound and/or outbound traffic for the port(s) you are using. If the problem still exists, check the network connectivity. 100 | -------------------------------------------------------------------------------- /setup_docker_image.md: -------------------------------------------------------------------------------- 1 | # Running Docker Image 2 | 3 | ## Selecting Docker Image 4 | 5 | You can use any docker images found on the [Docker Hub](https://hub.docker.com). 6 | 7 | For example `mysql:8.3.0`,`cm2network/csgo:latest`,`jammsen/palworld-dedicated-server`. 8 | 9 | You can also create your own Docker image using a `Dockerfile`. 10 | 11 | ## Using Docker Image 12 | 13 | On the `Instances` page, click the `Create` button. Select `Use Docker Image` and follow the instructions to complete the remaining setup. 14 | 15 | ::: tip 16 | You don't have to pull the docker image before starting the instance, MCSManager will do it for you if needed. 17 | ::: 18 | -------------------------------------------------------------------------------- /setup_java_edition.md: -------------------------------------------------------------------------------- 1 | # Setup Java Edition Server 2 | 3 | ::: tip 4 | This section assumes that you already have JRE installed. If not, see [Dependencies](/setup_package.md). 5 | ::: 6 | 7 | ## Download Server Core 8 | 9 | The server core is the essential part of a Minecraft server. In general, all other required files will be generated by the core once started. 10 | 11 | We will use Paper core as an example. Here are some popular versions 12 | 13 | - [1.18.2](https://api.papermc.io/v2/projects/paper/versions/1.18.2/builds/388/downloads/paper-1.18.2-388.jar) 14 | - [1.19.4](https://api.papermc.io/v2/projects/paper/versions/1.19.4/builds/524/downloads/paper-1.19.4-524.jar) 15 | - [1.20.4](https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/389/downloads/paper-1.20.4-389.jar) 16 | 17 | > More versions:https://papermc.io/downloads 18 | 19 | --- 20 | 21 | ## Deployment 22 | 23 | Start by clicking the `Create` button on the top of the page, and select `Minecraft Java Edition`. Pick the `node` you want and click on `Upload Server Core`. 24 | - Once uploaded, enter the following in the `Startup Command` field" 25 | 26 | 27 | ```bash 28 | java -Dfile.encoding=UTF-8 -jar "paper-.jar" 29 | ``` 30 | 31 | :::tip 32 | You can provide many more arguments in the startup command. Feel free to explore more possibilities! 33 | ::: 34 | 35 | 36 | ## Starting Minecraft Server 37 | 38 | After creating the instance, navigate to the instance console and start it by clicking the `Start` button located in the top-right corner. 39 | 40 | ## EULA 41 | 42 | ::: warning 43 | If you do not agree to the Mojang's End-User License Agreement (EULA), you will not be able to start your server. 44 | ::: 45 | 46 | To start the server for the first time, you must accept the `End-User License Agreement (EULA)`. To accept EULA, go to `Configuration Files`, and you will see `eula.txt`, click `edit` and select `yes`. 47 | 48 | If you can't find this file, try starting your server. 49 | -------------------------------------------------------------------------------- /setup_package.md: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | 3 | ## Install Java Environment 4 | 5 | Before running the Minecraft Java Edition server, it is necessary to install the right Java Runtime Environment (JRE). If you are unsure about which Java version to use, take a look at the following table: 6 | 7 | | JRE Version | Minecraft Version | 8 | | --------------- | :---------------------------------------------------------: | 9 | | Java8 | 1.7.x,1.8.x,1.9.x,1.10.x,1.12.x,1.13.x,1.15.x,1.16.x | 10 | | Java16 & Java17 | 1.17.x | 11 | | Java17 | 1.18.x | 12 | | Java17 or above | 1.18.x & 1.19.x & 1.20.x | 13 | 14 | :::tip 15 | Avoid using JRE version 20 as it may cause errors. 16 | 17 | Some plugins have their own Java requriements. If you are unsure, check with the plugin developer for supported JRE version(s). 18 | ::: 19 | 20 | ### For Windows 21 | 22 | - [(Oracle) Java JDK 8](https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html) 23 | - [(Oracle) Java JDK 11](https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html) 24 | - [(Oracle) Java JDK 17](https://download.oracle.com/java/17/latest/jdk-17_windows-x64_bin.exe) 25 | 26 | > JRE 16 and above only support x86_64/amd64 systems. 27 | 28 | ## Setup with pre-build packages 29 | 30 | :::tip 31 | Please ensure that you have installed the correct version of JRE. You can check it by using the command `java -version`. 32 | ::: 33 | 34 | 1. Go to the Instance page and click the `Create` button to create a new instance. 35 | 2. Select `Minecraft Server (Java)`. 36 | 3. Select the machine (node) where you would like to deploy the server. 37 | 4. Select one pre-build package, and click `install`. Then provide any required data. 38 | 5. Wait for installation, and then go to `Instance terminal`. 39 | 6. Click `start` button on the top-right. 40 | 41 | If you see something like this, the server should have started successfully. 42 | 43 |  44 | -------------------------------------------------------------------------------- /setup_steam.md: -------------------------------------------------------------------------------- 1 | # Setup Steam Game Server 2 | 3 | :::tip 4 | If you are using Linux, we recommend that you deploy the steam server using a Docker image. [More information](/setup_docker_image.md) 5 | ::: 6 | 7 | ## Install SteamCMD 8 | 9 | No matter which Steam game server you want to run, `PalWorld`, `CS2`, `ARK`, or others, `SteamCMD` is required to download and update the server. 10 | 11 | - [For Windows SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD#Windows) 12 | 13 | - [For Linux SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD#Linux) 14 | 15 | ## Create an Instance 16 | 17 | 1. Go to the `Instances` page and click the `Create` button. 18 | 2. Select `Steam Game Server`. 19 | 3. Select the machine (node) where you would like to deploy the server. 20 | 4. Select `No Additional File Required`. 21 | 5. Configure the startup command following the official documentation (if any). 22 | 23 | ## Obtain the Installation Command 24 | 25 | **_Note: This is NOT the startup command_**\ 26 | The same command is used to install and update the server. Each Steam game server has a unique `APP ID`, you will need this ID before running the following command: 27 | :::tip 28 | The `APP ID` for the game itself and it's dedicated server is usually different. In most cases, we want to use the one for the dedicated server. [Find the APP ID](https://steamdb.info/) 29 | ::: 30 | 31 | ```bash 32 | "" +force_install_dir "{mcsm_workspace}" +login anonymous "+app_update validate" +quit 33 | ``` 34 | 35 | `Project Zomboid Dedicated Server` as an example: 36 | 37 | ```bash 38 | "C:/SteamCMD/steamcmd.exe" +force_install_dir "/dir/to/your/game/" +login anonymous "+app_update 380870 validate" +quit 39 | ``` 40 | 41 | ## Configure the MCSManager 42 | 43 | Add the `steamcmd ....` command obtained in the previous step to the `Update Command` in the `Instance Settings`. Click the `Update` button to install/Update the Steam server. 44 | 45 | Once installed/updated, click the 'Start' button to start your server. 46 | 47 | Finally, based on the game server setup guide you chose, enter the server start command and click the "Start" button to run your Steam game server. 48 | 49 | ## FAQs 50 | 51 | ### What is the start command? 52 | 53 | The start command varies for different Steam games. You should refer to the setup guide for this specific game server or look up articles from other users who have set up the same server. Follow the instructions there to enter the correct start command. 54 | 55 | ### The server started successfully, but commands don’t work and there’s no output in the terminal 56 | 57 | This might happen if the Steam game server does not support standard input streams. You can use the `RCON protocol` provided by MCSManager to send commands to the server. There is an `RCON protocol` option button in the lower right corner of the terminal console. 58 | 59 | If even the `RCON protocol` cannot successfully send commands, it’s possible that `MCSManager` does not support this type of Steam game server. 60 | 61 | You may want to try setting up your Steam server using a `Linux + Docker` combination, which typically offers the best compatibility. 62 | -------------------------------------------------------------------------------- /zh_cn/advanced/custom_page.md: -------------------------------------------------------------------------------- 1 | # 自定义页面 2 | 3 | :::tip 4 | 由于界面的高度可定制化,设置自定义页面后将无法切换面板显示语言。强制切换可能无法达到预期的效果。 5 | ::: 6 | 7 | ## 卡片化 8 | 9 | 自 `MCSManager 10` 起,用户可使用拖拽卡片的方式自定义任何能看到的页面。 10 | 11 |  12 | 13 | ## 自定义 14 | 15 | ::: warning 16 | 17 | 请按需添加卡片,若一个页面添加过多卡片,可能导致网页性能下降。 18 | 19 | ::: 20 | 21 | 在任意界面点击面板右上角的自定义布局按钮,既可进入编辑模式。 22 | 23 | 在编辑模式中,您可以在任意位置插入卡片,修改卡片标题,调整卡片尺寸等。 24 | 25 | 可用的卡片包括但不仅限于时间、音乐、图片、网页、面板信息、实例、设置。您在面板中看到的一切,他们皆为卡片。 26 | 27 |  28 | 29 |  30 | 31 | ## 不止主页 32 | 33 | 除了常见的几个管理页面,MCSManager 还允许您编辑登录页、普通用户主页、开放页等各种能访问到的页面。 34 | 35 |  36 | 37 | ## 在主页管理多个实例 38 | 39 | 通过自定义布局的功能,可以让您在一个页面上管理多个实例。 40 | 41 |  42 | 43 | ## 扩展性 44 | 45 | 卡片拥有极高的扩展性,他可以让您在面板中一边听音乐一边使用 SSH 连接服务器 46 | 47 |  48 | 49 | ## HTML 卡片 50 | 51 | 您可以上传自定义 HTML 作为卡片的内容,自定义 HTML 卡片拥有非常高的扩展性,使用自定义 HTML ,您可以[自行开发](../apis/html_card.html)更多卡片,也可以安装其他人开发的实用卡片。不过使用时需要注意安全问题,上传来源不明的代码可能导致面板被入侵。 52 | 53 |  54 | 55 |  56 | -------------------------------------------------------------------------------- /zh_cn/advanced/distributed.md: -------------------------------------------------------------------------------- 1 | # 连接其他机器 2 | 3 | ## 这是什么? 4 | 5 | 如果你有多台物理主机可供使用,MCSManager 面板支持将多台主机连接起来,你将可以通过一个网页控制所有机器并且分配实例到任何一台机器上。 6 | 7 | ## 如何连接 8 | 9 | 首先,请在每一个需要连接的机器上安装 `MCSManager`,可以使用一键脚本安装,然后**可以只启动** `Daemon` 服务。 10 | 11 | ```bash 12 | # 一键脚本安装后... 13 | 14 | # 停止面板网页服务(必须) 15 | # 如果不停止则有可能让其他人访问到面板初始化用户界面,从而入侵你的主机 16 | systemctl stop mcsm-web 17 | 18 | # 禁用开机自启网页服务(必须) 19 | systemctl disable mcsm-web 20 | 21 | systemctl start mcsm-daemon # 只启动面板守护进程服务,用来作为被控端 22 | ``` 23 | 24 | 接下来,回到主面板,在导航栏的 `节点管理` 界面,可以看见所有的守护进程,如果是 Localhost 则代表此服务在本地,你可以在全世界任何一台拥有公网 IP 的服务器上部署远程守护进程,然后利用此界面连接它。 25 | 26 | 点击 `新增远程节点`,填写相关信息,点击连接即可。 27 | 28 | ## 远程节点的密钥 29 | 30 | 密钥默认情况下会在启动时输出显示,请及时复制,或者去以下地方查找: 31 | 32 | ### Linux 33 | 34 | 如果你使用一键安装脚本安装,那么默认路径应该是: 35 | 36 | `/opt/mcsmanager/daemon/data/Config/global.json` 37 | 38 | ### Windows 39 | 40 | `<面板安装路径>/daemon/data/Config/global.json` 41 | 42 | ## 连接协议 43 | 44 | 填写 `远程服务所在主机的IP地址` 时,你可以直接填写域名或 IP,但是如果有特殊需求,你也可以以 `ws://x.x.x.x` 或 `wss://x.x.x.x` 选择连接协议。 45 | 46 | `ws` 对于 `http`,`wss` 对应 `https`。 47 | 48 | > 如果你不知道这些意味着什么,那么就只需要填写 IP 地址,不需要带有任何前缀即可。 49 | -------------------------------------------------------------------------------- /zh_cn/advanced/docker.md: -------------------------------------------------------------------------------- 1 | # 环境隔离 2 | 3 | ## 安装 Docker 4 | 5 | MCSManager 需要依赖 Docker 来实现实例的环境隔离;隔离后,实例对系统的任何操作都将只是在有限的范围内进行,可以确保宿主机的安全性。 6 | 7 | 面板支持 Docker 容器软件(仅 Linux),请先[安装 Docker](https://docs.docker.com/desktop/install/linux-install/) 并且确保 MCSManager 有足够的权限访问 Docker。 8 | 9 | 前往节点管理,在节点的右上角处有一个`容器`的按钮,进入后可以你将可以根据 Dockerfile 创建容器,删除容器等操作。 10 | 11 | ## 使用镜像 12 | 13 | 前往实例控制台,在实例详细设置对话框中可以启用 Docker 模式,接下来你将可以让当前实例运行在某个镜像中,并且可以直接使用工作目录里面的文件。 14 | 15 | ## 常见问题 16 | 17 | - Q: 面板提示 Docker 未安装,但实际上已经安装 18 | 19 | > A: 请使用 root 账号重启 MCSManager 面板,如果成功则代表是权限分配出现问题,否则的话请重新安装 Docker。 -------------------------------------------------------------------------------- /zh_cn/advanced/freebsd_rc.md: -------------------------------------------------------------------------------- 1 | # FreeBSD 服务配置 2 | 3 | 众所周知,通过 SSH 客户端访问 BSD Kornshell 启动的任何软件,会在 SSH 连接断开时自动退出,此时如果我们希望 MCSManager 在 FreeBSD 中长期运行,那么我们可以编写服务让其在后台长期运行。 4 | 5 | 如果你是手动安装的 MCSManager,那么建议你将 MCSManager 配置为系统服务。 6 | 7 | ## 配置 8 | 9 | :::tip 10 | 以下配置是基于通过`pkg install node`安装的 Node.js 编写的 11 | ::: 12 | 13 | :::tip 14 | 切勿将服务配置文件保存到`/etc/rc.d`,以免更新补丁或安装软件包时丢失服务配置 15 | ::: 16 | 17 | **vim /usr/local/etc/rc.d/mcsmd** 18 | 19 | ``` 20 | #!/bin/sh 21 | 22 | # PROVIDE: mcsmd 23 | # REQUIRE: DAEMON 24 | # KEYWORD: shutdown 25 | 26 | . /etc/rc.subr 27 | 28 | name="mcsmd" 29 | rcvar="mcsmd_enable" 30 | 31 | workdir="/usr/local/mcsmanager/daemon" 32 | user="root" 33 | pidfile="/var/run/mcsmd.pid" 34 | 35 | start_cmd="${name}_start" 36 | stop_cmd="${name}_stop" 37 | reload_cmd="${name}_reload" 38 | 39 | mcsmd_start() 40 | { 41 | cd ${workdir} 42 | /usr/sbin/daemon -p ${pidfile} -u ${user} /usr/local/bin/node app.js > /dev/null 43 | } 44 | 45 | mcsmd_stop() 46 | { 47 | if [ -f $pidfile ]; then 48 | kill -QUIT $(cat $pidfile) 49 | rm $pidfile 50 | fi 51 | } 52 | 53 | mcsmd_reload() 54 | { 55 | if [ -f $pidfile ]; then 56 | kill -HUP $(cat $pidfile) 57 | fi 58 | } 59 | 60 | load_rc_config $name 61 | run_rc_command "$1" 62 | ``` 63 | 64 | **echo 'mcsmd_enable="YES"' >> /etc/rc.conf** 65 | 66 | **vim /usr/local/etc/rc.d/mcsmw** 67 | 68 | ``` 69 | #!/bin/sh 70 | 71 | # PROVIDE: mcsmw 72 | # REQUIRE: DAEMON 73 | # KEYWORD: shutdown 74 | 75 | . /etc/rc.subr 76 | 77 | name="mcsmw" 78 | rcvar="mcsmw_enable" 79 | 80 | workdir="/usr/local/mcsmanager/web" 81 | user="root" 82 | pidfile="/var/run/mcsmw.pid" 83 | 84 | start_cmd="${name}_start" 85 | stop_cmd="${name}_stop" 86 | reload_cmd="${name}_reload" 87 | 88 | mcsmw_start() 89 | { 90 | cd ${workdir} 91 | /usr/sbin/daemon -p ${pidfile} -u ${user} /usr/local/bin/node app.js > /dev/null 92 | } 93 | 94 | mcsmw_stop() 95 | { 96 | if [ -f $pidfile ]; then 97 | kill -QUIT $(cat $pidfile) 98 | rm $pidfile 99 | fi 100 | } 101 | 102 | mcsmw_reload() 103 | { 104 | if [ -f $pidfile ]; then 105 | kill -HUP $(cat $pidfile) 106 | fi 107 | } 108 | 109 | load_rc_config $name 110 | run_rc_command "$1" 111 | ``` 112 | 113 | **echo 'mcsmw_enable="YES"' >> /etc/rc.conf** 114 | 115 | 编辑完毕后请使用`chmod +x /usr/local/etc/rc.d/mcsm*`,否则无法执行服务! 116 | 117 | 118 | ## 命令用法 119 | 120 | 重启: 121 | `service mcsmd onerestart` 122 | `service mcsmw onerestart` 123 | 124 | 启动: 125 | `service mcsmd onestart` 126 | `service mcsmw onestart` 127 | 128 | 停止: 129 | `service mcsmd onestop` 130 | `service mcsmw onestop` 131 | 132 | 禁用: 133 | 编辑`/etc/rc.conf`,在`mcsmd_enable="YES"`和/或`mcsmw_enable="YES"`前添加`#` 134 | 135 | 启用: 136 | 编辑`/etc/rc.conf`,去除在`#mcsmd_enable="YES"`和/或`#mcsmw_enable="YES"`前的`#` 137 | 138 | ## 修改用户权限 139 | 140 | > 在默认的服务配置内未修改用户的情况下,服务会以 root 用户运行,从而给服务器带来潜在安全隐患,推荐更改运行该服务的用户(daemon_user)来保证安全。 141 | 142 | 1. 通过`useradd` `chmod` `chown`等命令来创建用户并修改相关用户权限。 143 | 2. 修改 `user` 属性 144 | 3. 重新启动服务 145 | -------------------------------------------------------------------------------- /zh_cn/advanced/linux_openrc.md: -------------------------------------------------------------------------------- 1 | # 注册到 Linux OpenRC 系统服务 2 | 3 | :::tip 4 | 本教程仅限于使用Alpine、Devuan、Artix、Slackware等基于OpenRC的发行版的用户,如果您不使用此类发行版或者不懂,请移步systemd服务设置教程 5 | ::: 6 | 7 | 众所周知,通过 SSH 客户端访问 Linux 启动的任何软件,会在 SSH 连接断开时自动退出,此时如果我们希望 MCSManager 在 Linux 中长期运行,那么我们可以编写服务让其在后台长期运行。 8 | 9 | 如果你是手动安装的 MCSManager,那么建议你将 MCSManager 配置为系统服务。 10 | 11 | ## 配置 12 | 13 | **vim /etc/init.d/mcsmd** 14 | 15 | ``` 16 | #!/sbin/openrc-run 17 | 18 | name=$RC_SVCNAME 19 | description="MCSManager Daemon" 20 | supervisor="supervise-daemon" 21 | command="/bin/node" 22 | command_args="app.js" 23 | supervise_daemon_args=" -d /opt/mcsmanager/daemon -e "PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"\"" 24 | command_user="root" 25 | 26 | stop() { 27 | ebegin "Stopping $RC_SVCNAME" 28 | /bin/kill -s QUIT $MAINPID 29 | eend $? 30 | } 31 | 32 | reload() { 33 | ebegin "Reloading $RC_SVCNAME" 34 | /bin/kill -s HUP $MAINPID 35 | eend $? 36 | } 37 | ``` 38 | 39 | **vim /etc/init.d/mcsmw** 40 | 41 | ``` 42 | #!/sbin/openrc-run 43 | 44 | name=$RC_SVCNAME 45 | description="MCSManager Web" 46 | supervisor="supervise-daemon" 47 | command="/bin/node" 48 | command_args="app.js" 49 | supervise_daemon_args=" -d /opt/mcsmanager/web -e "PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"\"" 50 | command_user="root" 51 | 52 | stop() { 53 | ebegin "Stopping $RC_SVCNAME" 54 | /bin/kill -s QUIT $MAINPID 55 | eend $? 56 | } 57 | 58 | reload() { 59 | ebegin "Reloading $RC_SVCNAME" 60 | /bin/kill -s HUP $MAINPID 61 | eend $? 62 | } 63 | ``` 64 | 65 | 编辑完毕后请使用`chmod +x /etc/init.d/mcsm*`,否则无法执行服务! 66 | 67 | 68 | ## 命令用法 69 | 70 | 重启: 71 | `service mcsmd restart` 72 | `service mcsmw restart` 73 | 74 | 启动: 75 | `service mcsmd start` 76 | `service mcsmw start` 77 | 78 | 停止: 79 | `service mcsmd stop` 80 | `service mcsmw stop` 81 | 82 | 禁用: 83 | `rc-update del mcsmd` 84 | `rc-update del mcsmw` 85 | 86 | 启用: 87 | `rc-update add mcsmd` 88 | `rc-update add mcsmw` 89 | 90 | ## 修改用户权限 91 | 92 | > 在默认的服务配置内未修改用户的情况下,服务会以 root 用户运行,从而给服务器带来潜在安全隐患,推荐更改运行该服务的用户(command_user)来保证安全。 93 | 94 | 1. 通过`useradd` `chmod` `chown`等命令来创建用户并修改相关用户权限。 95 | 2. 修改 `command_user` 属性 96 | 3. 重新启动服务 -------------------------------------------------------------------------------- /zh_cn/advanced/linux_systemctl.md: -------------------------------------------------------------------------------- 1 | # 注册到 Linux systemd 系统服务 2 | 3 | :::tip 4 | 如果你是通过一键安装脚本安装的,这个教程对你而言是无用的,因为已经自动配置完毕。 5 | ::: 6 | 7 | :::tip 8 | 使用Alpine、Devuan、Artix、Slackware等基于OpenRC的发行版的用户请移步OpenRC服务设置教程 9 | ::: 10 | 11 | 众所周知,通过 SSH 客户端访问 Linux 启动的任何软件,会在 SSH 连接断开时自动退出,此时如果我们希望 MCSManager 在 Linux 中长期运行,那么我们可以编写服务让其在后台长期运行。 12 | 13 | 如果你是手动安装的 MCSManager,那么建议你将 MCSManager 配置为系统服务。 14 | 15 | ## 配置 16 | 17 | **vim /etc/systemd/system/mcsm-daemon.service** 18 | 19 | ``` 20 | [Unit] 21 | Description=MCSManager Daemon 22 | 23 | [Service] 24 | WorkingDirectory=/opt/mcsmanager/daemon 25 | ExecStart=/bin/node app.js 26 | ExecReload=/bin/kill -s HUP $MAINPID 27 | ExecStop=/bin/kill -s QUIT $MAINPID 28 | Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 29 | User=root 30 | 31 | [Install] 32 | WantedBy=multi-user.target 33 | ``` 34 | 35 | **vim /etc/systemd/system/mcsm-web.service** 36 | 37 | ``` 38 | [Unit] 39 | Description=MCSManager Web 40 | 41 | [Service] 42 | WorkingDirectory=/opt/mcsmanager/web 43 | ExecStart=/bin/node app.js 44 | ExecReload=/bin/kill -s HUP $MAINPID 45 | ExecStop=/bin/kill -s QUIT $MAINPID 46 | Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 47 | User=root 48 | 49 | [Install] 50 | WantedBy=multi-user.target 51 | ``` 52 | 53 | ## 命令用法 54 | 55 | 重启:`systemctl restart mcsm-{daemon,web}.service` 56 | 57 | 启动:`systemctl start mcsm-{daemon,web}.service` 58 | 59 | 停止:`systemctl stop mcsm-{daemon,web}.service` 60 | 61 | 禁用:`systemctl disable mcsm-{daemon,web}.service` 62 | 63 | 启用:`systemctl enable mcsm-{daemon,web}.service` 64 | 65 | ## 修改用户权限 66 | 67 | > 在 systemd 的服务配置内未指定用户的情况下,服务会以 root 用户运行,从而给服务器带来潜在安全隐患,推荐更改运行该服务的用户来保证安全。 68 | 69 | 1. 通过`useradd` `chmod` `chown`等命令来创建用户并修改相关用户权限。 70 | 2. 在 `[Service]` 栏目中修改 `User`属性(如果没有就添加一个) 71 | 3. 重新启动服务 72 | -------------------------------------------------------------------------------- /zh_cn/advanced/openbsd_rc.md: -------------------------------------------------------------------------------- 1 | # OpenBSD 服务配置 2 | 3 | 众所周知,通过 SSH 客户端访问 BSD Kornshell 启动的任何软件,会在 SSH 连接断开时自动退出,此时如果我们希望 MCSManager 在 OpenBSD 中长期运行,那么我们可以编写服务让其在后台长期运行。 4 | 5 | 如果你是手动安装的 MCSManager,那么建议你将 MCSManager 配置为系统服务。 6 | 7 | ## 配置 8 | 9 | :::tip 10 | 以下配置是基于通过`pkg_add node`安装的 Node.js 编写的 11 | ::: 12 | 13 | **vim /etc/rc.d/mcsmd** 14 | 15 | ``` 16 | #!/bin/ksh 17 | 18 | daemon_execdir="/usr/local/mcsmanager/daemon" 19 | daemon="/usr/local/bin/node" 20 | daemon_flags="app.js" 21 | daemon_user="root" 22 | 23 | . /etc/rc.d/rc.subr 24 | 25 | rc_bg=YES 26 | rc_reload=NO 27 | 28 | rc_start() { 29 | rc_exec ". ~/.profile; ${daemon} ${daemon_flags}" 30 | } 31 | 32 | rc_cmd $1 33 | ``` 34 | 35 | **vim /etc/rc.d/mcsmw** 36 | 37 | ``` 38 | #!/bin/ksh 39 | 40 | daemon_execdir="/usr/local/mcsmanager/web" 41 | daemon="/usr/local/bin/node" 42 | daemon_flags="app.js" 43 | daemon_user="root" 44 | 45 | . /etc/rc.d/rc.subr 46 | 47 | rc_bg=YES 48 | rc_reload=NO 49 | 50 | rc_start() { 51 | rc_exec ". ~/.profile; ${daemon} ${daemon_flags}" 52 | } 53 | 54 | rc_cmd $1 55 | ``` 56 | 57 | 编辑完毕后请使用`chmod +x /etc/rc.d/mcsm*`,否则无法执行服务! 58 | 59 | 60 | ## 命令用法 61 | 62 | 重启: 63 | `rcctl restart mcsmd` 64 | `rcctl restart mcsmw` 65 | 66 | 启动: 67 | `rcctl start mcsmd` 68 | `rcctl start mcsmw` 69 | 70 | 停止: 71 | `rcctl stop mcsmd` 72 | `rcctl stop mcsmw` 73 | 74 | 禁用: 75 | `rcctl disable mcsmd` 76 | `rcctl disable mcsmw` 77 | 78 | 启用: 79 | `rcctl enable mcsmd` 80 | `rcctl enable mcsmw` 81 | 82 | ## 修改用户权限 83 | 84 | > 在默认的服务配置内未修改用户的情况下,服务会以 root 用户运行,从而给服务器带来潜在安全隐患,推荐更改运行该服务的用户(daemon_user)来保证安全。 85 | 86 | 1. 通过`useradd` `chmod` `chown`等命令来创建用户并修改相关用户权限。 87 | 2. 修改 `daemon_user` 属性 88 | 3. 重新启动服务 -------------------------------------------------------------------------------- /zh_cn/advanced/update_panel.md: -------------------------------------------------------------------------------- 1 | # 更新与重置面板 2 | 3 | :::tip 4 | 如果你担心更新导致数据丢失,先将 web/data,daemon/data 移动到其他上层目录。更新完毕后再移动回来即可保证数据安全性。 5 | 6 | 若您的版本在 2024/09/29 前发布,请在更新前先删除 lib 文件夹内所有 pty 程序,以便修复 pty 僵尸进程问题。 7 | ::: 8 | 9 | ## 更新须知 10 | 11 | 因为采用守护进程分布式部署,如果你的节点超过 5 个,那么更新将有点麻烦,建议保留观望,待累积更新到一定程度后再一并更新。 12 | 13 | 如果你的节点很少,那么可以更新到最新版本。 14 | 15 | ## 开始更新 16 | 17 | ### Windows 版更新 18 | 19 | 1. [前往官方网站](https://mcsmanager.com),下载最新的压缩文件。 20 | 21 | 2. **覆盖**代码文件即可。 22 | 23 | ### Linux 版脚本更新 24 | 25 | 如果你**当初是使用的一键脚本**安装,那么你只需执行以下命令即可,一键安装脚本支持自动更新,不会损害本地数据。 26 | 27 | 执行脚本之后,不需要再做其他事情,你的 MCSManager 应该会自动到最新版本。 28 | 29 | ```bash 30 | sudo su -c "wget -qO- https://script.mcsmanager.com/setup_cn.sh | bash" 31 | ``` 32 | 33 | ### Linux 版手动更新 34 | 35 | 如果你**当初是手动安装**的 MCSManager 面板,那么一键安装脚本将不适用于你,因为这会导致安装两份程序。 36 | 37 | 你必须前往官方[发行记录](https://github.com/MCSManager/MCSManager/releases/latest),下载最新的代码并且覆盖你的 MCSManager 所有文件。 38 | 39 | 覆盖文件之后,还需要更新依赖库,进入 `web` 和 `daemon` 目录,分别执行一次 `npm install --production` 命令来确保依赖库得到更新,否则你可能无法启动面板! 40 | 41 | ## 重置管理账号 42 | 43 | 如果你忘记了管理员密码,你可以将 `/data/User` 目录移动到其他目录,接下来重启面板,这会让面板进入`面板第一次安装`的状态,你可以重新设置你的管理员账号密码,再将原先里面的 `json` 文件原封不动的移动回去即可,需要再重启一次面板。 44 | 45 | ## 完全重置面板 46 | 47 | 你只需要删除 `data` 目录,即可重置所有数据。 48 | -------------------------------------------------------------------------------- /zh_cn/apis/api_daemon.md: -------------------------------------------------------------------------------- 1 | # 节点 API 2 | 3 | ## 节点列表 4 | 5 | > 请参考 [仪表盘 API](./api_dashboard.md#get-overview-info) 6 | 7 | ## 添加节点 8 | 9 | ```http 10 | POST /api/service/remote_service 11 | ``` 12 | 13 | #### 请求示例 14 | 15 | ```json 16 | { 17 | "ip": "10.0.0.16", 18 | "port": 24446, 19 | "prefix": "", 20 | "remarks": "MiPad", 21 | "apiKey": "db9516063699446bb95fba51f08603" 22 | } 23 | ``` 24 | 25 | #### 返回示例 26 | 27 | ```json 28 | { 29 | "status": 200, 30 | "data": "499e1012a21443278a7ec63a3a95860b", // 新增节点的节点 ID 31 | "time": 1718594177859 32 | } 33 | ``` 34 | 35 | ## 删除节点 36 | 37 | ```http 38 | DELETE /api/service/remote_service 39 | ``` 40 | 41 | #### Query 参数 42 | 43 | ```js 44 | { 45 | uuid: string; // 节点 ID 46 | } 47 | ``` 48 | 49 | #### 返回示例 50 | 51 | ```json 52 | { 53 | "status": 200, 54 | "data": true, 55 | "time": 1718594177859 56 | } 57 | ``` 58 | 59 | ## 连接节点 60 | 61 | ```http 62 | GET /api/service/link_remote_service 63 | ``` 64 | 65 | #### Query 参数 66 | 67 | ```js 68 | { 69 | uuid: string; //节点 ID 70 | } 71 | ``` 72 | 73 | #### 返回示例 74 | 75 | ```json 76 | { 77 | "status": 200, 78 | "data": true, 79 | "time": 1718594177859 80 | } 81 | ``` 82 | 83 | ## 更新节点连接参数 84 | 85 | ```http 86 | PUT /api/service/remote_service 87 | ``` 88 | 89 | ### Query 参数 90 | 91 | ```js 92 | { 93 | uuid: string; // Daemon ID 94 | } 95 | ``` 96 | 97 | ### Body 参数 98 | 99 | ```json 100 | { 101 | "ip": "162.2.xx.xx", 102 | "port": 24444, 103 | "prefix": "", 104 | "available": false, 105 | "remarks": "My Node", 106 | "apiKey": "" 107 | } 108 | ``` 109 | 110 | #### 返回示例 111 | 112 | ```json 113 | { 114 | "status": 200, 115 | "data": true, 116 | "time": 1718594177859 117 | } 118 | ``` 119 | -------------------------------------------------------------------------------- /zh_cn/apis/api_dashboard.md: -------------------------------------------------------------------------------- 1 | # 仪表盘 API 2 | 3 | ## 获取概览数据 4 | 5 | ```http 6 | GET /api/overview 7 | ``` 8 | 9 | #### 返回 10 | 11 | ```json 12 | { 13 | "status": 200, 14 | "data": { 15 | "version": "10.2.1", 16 | "specifiedDaemonVersion": "4.4.1", 17 | "process": { 18 | "cpu": 0, 19 | "memory": 219439104, // Panel Memory Usage 20 | "cwd": "Z:\\Workspace\\MCSManager\\panel" 21 | }, 22 | "record": { 23 | "logined": 2, 24 | "illegalAccess": 2, 25 | "banips": 0, 26 | "loginFailed": 0 27 | }, 28 | "system": { 29 | "user": { 30 | "uid": -1, 31 | "gid": -1, 32 | "username": "MCSManager", 33 | "homedir": "X:\\Users\\MCSManager", 34 | "shell": null 35 | }, 36 | // 面板上的内存使用情况 37 | "time": 1718594177859, 38 | "totalmem": 16577519520, 39 | "freemem": 10966386688, 40 | "type": "Windows_NT", 41 | "version": "Windows 10 Pro for Workstations", 42 | "node": "v17.9.1", 43 | "hostname": "MCSManager-Workstation", 44 | 45 | // 仅限 Linux 46 | "loadavg": [0, 0, 0], 47 | 48 | "platform": "win32", 49 | "release": "10.0.22631", 50 | "uptime": 905020.0, 51 | "cpu": 0.11684482123110951 52 | }, 53 | 54 | // 面板上的内存和 CPU 使用情况(统计图) 55 | "chart": { 56 | "system": [ 57 | { 58 | "cpu": 8.1, 59 | "mem": 64.5 60 | } 61 | ], 62 | "request": [ 63 | { 64 | "value": 6, 65 | "totalInstance": 23, 66 | "runningInstance": 3 67 | } 68 | ] 69 | }, 70 | "remoteCount": { 71 | "available": 3, 72 | "total": 3 73 | }, 74 | 75 | // Daemon List 76 | "remote": [ 77 | { 78 | "version": "3.4.0", 79 | "process": { 80 | "cpu": 3550442695, 81 | "memory": 22620272, 82 | "cwd": "/opt/mcsmanager/daemon" 83 | }, 84 | "instance": { 85 | "running": 0, 86 | "total": 6 87 | }, 88 | 89 | // Daemon 上的 CPU 和内存使用情况。 90 | "system": { 91 | "type": "Linux", 92 | "hostname": "NYA-Dev-01", 93 | "platform": "linux", 94 | "release": "5.15.0-101-generic", 95 | "uptime": 39.63, 96 | "cwd": "/opt/mcsmanager/daemon", 97 | "loadavg": [3.5, 0.85, 0.28], 98 | "freemem": 7254478848, 99 | "cpuUsage": 0.002512562814070307, 100 | "memUsage": 0.12453628345617548, 101 | "totalmem": 8286441472, 102 | "processCpu": 0, 103 | "processMem": 0 104 | }, 105 | 106 | // 节点上的CPU和内存使用情况(图表). 107 | "cpuMemChart": [ 108 | { 109 | "cpu": 0, 110 | "mem": 13 111 | } 112 | ], 113 | 114 | // 节点 UUID 115 | "uuid": "957c6bddf379445c82bac5edf7684bbc", 116 | "ip": "s1.example.com", 117 | "port": 24444, 118 | "prefix": "", 119 | "available": true, 120 | "remarks": "CN-ZJ-DEV-01" 121 | } 122 | ] 123 | }, 124 | "time": 1718594177859 125 | } 126 | ``` 127 | -------------------------------------------------------------------------------- /zh_cn/apis/api_fileManager.md: -------------------------------------------------------------------------------- 1 | # 文件管理api 2 | 3 | ## 获取文库列表 4 | 5 | ```http 6 | GET /api/files/list 7 | ``` 8 | 9 | #### Query 查询参数 10 | 11 | ```js 12 | { 13 | daemonId: string; 14 | uuid: string; // 你的 Instance ID 15 | target: string; // 文件(名称或目录)路径 16 | page: number; 17 | page_size: number; 18 | } 19 | ``` 20 | 21 | #### 返回示例 22 | 23 | ```json 24 | { 25 | "status": 200, 26 | "data": { 27 | "items": [ 28 | { 29 | "name": "Genshin Impact", 30 | "size": 0, // byte 31 | "time": "Fri Jun 07 2024 08:53:34 GMT+0800 (中国标准时间)", 32 | "mode": 777, // Linux file permission 33 | "type": 0 // 0 = Folder, 1 = File 34 | }, 35 | { 36 | "name": "NEKO-MIMI SWEET HOUSEMATES Vol. 1", 37 | "size": 0, 38 | "time": "Thu Jun 06 2024 18:25:14 GMT+0800 (中国标准时间)", 39 | "mode": 777, 40 | "type": 0 41 | }, 42 | { 43 | "name": "Poly Bridge", 44 | "size": 0, 45 | "time": "Thu Jun 06 2024 18:25:14 GMT+0800 (中国标准时间)", 46 | "mode": 777, 47 | "type": 0 48 | }, 49 | { 50 | "name": "Wuthering Waves", 51 | "size": 0, 52 | "time": "Fri Jun 07 2024 04:32:58 GMT+0800 (中国标准时间)", 53 | "mode": 666, 54 | "type": 0 55 | }, 56 | { 57 | "name": "AngryBirdsSeasons", 58 | "size": 0, 59 | "time": "Thu Jun 06 2024 18:25:14 GMT+0800 (中国标准时间)", 60 | "mode": 777, 61 | "type": 0 62 | }, 63 | { 64 | "name": "secret base_君がくれたもの【Covered by Kotoha】.mp4", 65 | "size": 13253857, 66 | "time": "Thu Jun 06 2024 19:37:35 GMT+0800 (中国标准时间)", 67 | "mode": 666, 68 | "type": 1 69 | } 70 | ], 71 | "page": 0, 72 | "pageSize": 100, 73 | "total": 6, 74 | "absolutePath": "\\" 75 | }, 76 | "time": 1718594177859 77 | } 78 | ``` 79 | 80 | ## 获取文件内容 81 | 82 | ```http 83 | PUT /api/files/ 84 | ``` 85 | 86 | #### Query 查询参数 87 | 88 | ```js 89 | { 90 | daemonId: string; 91 | uuid: string; // Instance ID 92 | } 93 | ``` 94 | 95 | #### Body 请求体 96 | 97 | ```json 98 | { 99 | "target": "/eula.txt" 100 | } 101 | ``` 102 | 103 | #### 返回示例 104 | 105 | ```json 106 | { 107 | "status": 200, 108 | "data": "eula=false\n", // 文件内容 109 | "time": 1718594177859 110 | } 111 | ``` 112 | 113 | ## 更新文件 114 | 115 | ```http 116 | PUT /api/files/ 117 | ``` 118 | 119 | #### Query 查询参数 120 | 121 | ```js 122 | { 123 | daemonId: string; 124 | uuid: string; // Instance ID 125 | } 126 | ``` 127 | 128 | #### Body 请求体 129 | 130 | ```json 131 | { 132 | "target": "/eula.txt", 133 | "text": "eula=true\n" // file content 134 | } 135 | ``` 136 | 137 | #### Response 响应体 138 | 139 | ```json 140 | { 141 | "status": 200, 142 | "data": true, 143 | "time": 1718594177859 144 | } 145 | ``` 146 | 147 | ## 下载文件 148 | 149 | 需要先获取下载配置,然后通过获取到的下载配置下载文件。 150 | 151 | ```http 152 | POST /api/files/download 153 | ``` 154 | 155 | #### Query 查询参数 156 | 157 | ```js 158 | { 159 | file_name: string; // 路径+名字, 示例: /backup/world.zip 160 | daemonId: string; 161 | uuid: string; // Instance ID 162 | } 163 | ``` 164 | 165 | #### Response 响应体 166 | 167 | ```json 168 | { 169 | "status": 200, 170 | "data": { 171 | "password": "b2d8a6fa3bc8467ebd1563dc4f7179be1718010317889", 172 | "addr": "localhost:24444" // 节点地址 173 | }, 174 | "time": 1718594177859 175 | } 176 | ``` 177 | 178 | #### 下载文件 179 | 180 | ```http 181 | GET http(s)://{{Daemon Addr}}/download/{{password}}/{{fileName}} 182 | 183 | // 示例: 184 | GET http://localhost:24444/download/db8271f526...49468abd74/world.zip 185 | ``` 186 | 187 | ## 上传文件 188 | 189 | ### 1.获得上传配置 190 | 191 | ```http 192 | POST /api/files/upload 193 | ``` 194 | 195 | #### Query 查询参数 196 | 197 | ```js 198 | { 199 | upload_dir: string; 200 | daemonId: string; 201 | uuid: string; // Instance ID 202 | } 203 | ``` 204 | 205 | #### Response 响应体 206 | 207 | ```json 208 | { 209 | "status": 200, 210 | "data": { 211 | "password": "b2d8a6fa3bc8467ebd1563dc4f7179be1718010317889", 212 | "addr": "localhost:24444" // 节点地址 213 | }, 214 | "time": 1718594177859 215 | } 216 | ``` 217 | 218 | ### 2. 上传文件 219 | 220 | ```http 221 | POST http(s)://{{Daemon Address}}/upload/{{password}} 222 | ``` 223 | 224 | #### Request Headers 请求头 225 | 226 | ```http 227 | Content-Type: multipart/form-data 228 | ``` 229 | 230 | #### Form Data 表单数据(请求体) 231 | 232 | ```http 233 | file: (二进制数据) 234 | ``` 235 | 236 | #### Response 响应体 237 | 238 | ``` 239 | OK 240 | ``` 241 | 242 | ## 复制文件 243 | 244 | ```http 245 | POST /api/files/copy 246 | ``` 247 | 248 | #### Query 查询参数 249 | 250 | ```js 251 | { 252 | daemonId: string; 253 | uuid: string; // Instance ID 254 | } 255 | ``` 256 | 257 | #### Body 请求体 258 | 259 | ```json 260 | { 261 | "targets": [ 262 | [ 263 | "/server.jar", // source 264 | "/cache/server.jar" // target 265 | ] 266 | // ... more 267 | ] 268 | } 269 | ``` 270 | 271 | #### Response 响应体 272 | 273 | ```json 274 | { 275 | "status": 200, 276 | "data": true, 277 | "time": 1718594177859 278 | } 279 | ``` 280 | 281 | ## 移动或重命名 282 | 283 | ```http 284 | PUT /api/files/move 285 | ``` 286 | 287 | #### Query 查询参数 288 | 289 | ```js 290 | { 291 | daemonId: string; 292 | uuid: string; // Instance ID 293 | } 294 | ``` 295 | 296 | #### Body 请求体 297 | 298 | ```json 299 | { 300 | "targets": [ 301 | [ 302 | "/server.jar", // 原来 303 | "/cache/server.jar" // 现在 304 | ], 305 | 306 | // support rename 307 | [ 308 | "/ops.json", // 原来 309 | "/ops.txt" // 现在 310 | ] 311 | // ... more 312 | ] 313 | } 314 | ``` 315 | 316 | #### Response 响应体 317 | 318 | ```json 319 | { 320 | "status": 200, 321 | "data": true, 322 | "time": 1718594177859 323 | } 324 | ``` 325 | 326 | ## 压缩文件 327 | 328 | ```http 329 | POST /api/files/compress 330 | ``` 331 | 332 | #### Query 查询参数 333 | 334 | ```js 335 | { 336 | daemonId: string; 337 | uuid: string; // Instance ID 338 | } 339 | ``` 340 | 341 | #### Body 请求体 342 | 343 | ```json 344 | { 345 | "type": 1, 346 | "code": "utf-8", // only utf-8 347 | "source": "/test.zip", // zip 文件路径 348 | "targets": [ 349 | "/world", // 支持文件夹 350 | "/config.json", 351 | "/server.jar" 352 | ] 353 | } 354 | ``` 355 | 356 | #### Response 响应体 357 | 358 | ```json 359 | { 360 | "status": 200, 361 | "data": true, 362 | "time": 1718594177859 363 | } 364 | ``` 365 | 366 | ## 解压文件 367 | 368 | ```http 369 | POST /api/files/compress 370 | ``` 371 | 372 | #### Query 查询参数 373 | 374 | ```js 375 | { 376 | daemonId: string; 377 | uuid: string; // Instance ID 378 | } 379 | ``` 380 | 381 | #### Request Body 请求体 382 | 383 | ```json 384 | { 385 | "type": 2, 386 | "code": "utf-8", // 压缩文件的编码 387 | // 可选: utf-8, gbk, big5 388 | "source": "/test.zip", // 压缩文件路径 389 | "targets": "/cache" // 解压到什么地方 390 | } 391 | ``` 392 | 393 | 394 | 395 | #### 返回示例 396 | 397 | ```json 398 | { 399 | "status": 200, 400 | "data": true, 401 | "time": 1718594177859 402 | } 403 | ``` 404 | 405 | ## 删除文件 406 | 407 | ```http 408 | DELETE /api/files 409 | ``` 410 | 411 | #### Query 查询参数 412 | ```js 413 | { 414 | daemonId: string; 415 | uuid: string; // Instance ID 416 | } 417 | ``` 418 | 419 | #### Request Body 请求体 420 | 421 | ```json 422 | { 423 | "targets": [ 424 | "/world", // 支持删除文件夹 425 | "/cache/config.json", 426 | "/server.jar" 427 | ] 428 | } 429 | ``` 430 | 431 | 432 | 433 | #### 返回示例 434 | 435 | ```json 436 | { 437 | "status": 200, 438 | "data": true, 439 | "time": 1718594177859 440 | } 441 | ``` 442 | 443 | ## Touch File 新建文件 444 | 445 | ```http 446 | POST /api/files/touch 447 | ``` 448 | 449 | #### Query 查询参数 450 | 451 | ```js 452 | { 453 | daemonId: string; 454 | uuid: string; // Instance ID 455 | } 456 | ``` 457 | 458 | #### Request Body 请求体 459 | ```json 460 | { 461 | "target": "/test" // 文件名 462 | } 463 | ``` 464 | 465 | 466 | 467 | #### 返回示例 468 | 469 | ```json 470 | { 471 | "status": 200, 472 | "data": true, 473 | "time": 1718594177859 474 | } 475 | ``` 476 | 477 | ## 新建文件夹 478 | 479 | ```http 480 | POST /api/files/mkdir 481 | ``` 482 | 483 | #### Query 查询参数 484 | 485 | ```js 486 | { 487 | daemonId: string; 488 | uuid: string; // Instance ID 489 | } 490 | ``` 491 | 492 | #### Request Body 请求体 493 | 494 | ```json 495 | { 496 | "target": "/backup" // 文件夹名字 497 | } 498 | ``` 499 | 500 | 501 | 502 | #### 返回示例 503 | 504 | ```json 505 | { 506 | "status": 200, 507 | "data": true, 508 | "time": 1718594177859 509 | } 510 | ``` 511 | -------------------------------------------------------------------------------- /zh_cn/apis/api_imageManager.md: -------------------------------------------------------------------------------- 1 | # dockers 镜像管理 API 2 | 3 | ## 获取镜像列表 4 | 5 | ```http 6 | GET /api/environment/image 7 | ``` 8 | 9 | #### Query 参数 10 | 11 | ```js 12 | { 13 | daemonId: string; 14 | } 15 | ``` 16 | 17 | #### 返回示例 18 | 19 | ```json 20 | { 21 | "status": 200, 22 | "data": DockerImageList, 23 | "time": 1718594177859 24 | } 25 | ``` 26 | 27 | > DockerImageList详见: https://docs.docker.com/engine/api/v1.37/#tag/Image/operation/ImageList 28 | 29 | ## 获取容器列表 30 | 31 | ```http 32 | GET /api/environment/containers 33 | ``` 34 | 35 | #### Query 参数 36 | 37 | ```js 38 | { 39 | daemonId: string; 40 | } 41 | ``` 42 | 43 | #### 返回示例 44 | 45 | ```json 46 | { 47 | "status": 200, 48 | "data": DockerContainerList, 49 | "time": 1718594177859 50 | } 51 | ``` 52 | 53 | > DockerContainerList详见: https://docs.docker.com/engine/api/v1.37/#tag/Container/operation/ContainerList 54 | 55 | ## 获取网络接口列表 56 | 57 | ```http 58 | GET /api/environment/network 59 | ``` 60 | 61 | #### Query 参数 62 | 63 | ```js 64 | { 65 | daemonId: string; 66 | } 67 | ``` 68 | 69 | #### 返回示例 70 | 71 | ```json 72 | { 73 | "status": 200, 74 | "data": DockerNetworkList, 75 | "time": 1718594177859 76 | } 77 | ``` 78 | 79 | > DockerNetworkList详见: https://docs.docker.com/engine/api/v1.37/#tag/Network/operation/NetworkList 80 | 81 | ## 新增镜像 82 | 83 | ```http 84 | POST /api/environment/image 85 | ``` 86 | 87 | #### Query 参数 88 | 89 | ```js 90 | { 91 | daemonId: string, 92 | } 93 | ``` 94 | 95 | #### 请求正文 96 | 97 | ```json 98 | { 99 | "dockerFile": "...", // DockerFile Config 100 | "name": "mcsm-custom", // Image Name 101 | "tag": "latest" // Version 102 | } 103 | ``` 104 | 105 | #### 返回示例 106 | 107 | ```json 108 | { 109 | "status": 200, 110 | "data": true, 111 | "time": 1718594177859 112 | } 113 | ``` 114 | 115 | ## 构建进度 116 | 117 | ```http 118 | GET /api/environment/progress 119 | ``` 120 | 121 | #### Query 参数 122 | 123 | ```js 124 | { 125 | daemonId: string, 126 | } 127 | ``` 128 | 129 | #### 返回示例 130 | 131 | ```json 132 | { 133 | "status": 200, 134 | "data": { 135 | "mcsm-custom:latest": -1 // -1 = Failed, 1 = Building, 2 = Complete 136 | // ...more... 137 | }, 138 | "time": 1718594177859 139 | } 140 | ``` 141 | -------------------------------------------------------------------------------- /zh_cn/apis/api_instance.md: -------------------------------------------------------------------------------- 1 | # 实例 API 2 | 3 | ## 实例列表 4 | 5 | ```http 6 | GET /api/service/remote_service_instances 7 | ``` 8 | 9 | #### Query 参数 10 | 11 | ```js 12 | { 13 | daemonId: string; 14 | page: number; 15 | page_size: number; 16 | instance_name?: string; 17 | status: string; 18 | } 19 | ``` 20 | 21 | #### 返回示例 22 | 23 | ```json 24 | { 25 | "status": 200, 26 | "data": { 27 | "maxPage": 1, 28 | "pageSize": 10, 29 | "data": InstanceDetail[] 30 | }, 31 | "time": 1718594177859 32 | } 33 | ``` 34 | 35 | > 请看[实例详细信息](#实例详细形信息) 36 | 37 | ## 实例详情 38 | 39 | ```http 40 | GET /api/instance 41 | ``` 42 | 43 | #### Query 参数 44 | 45 | ```js 46 | { 47 | uuid: string, // Instance ID 48 | daemonId: string, 49 | } 50 | ``` 51 | 52 | #### 返回示例 53 | 54 | ```json 55 | { 56 | "status": 200, 57 | "data": InstanceDetail, 58 | "time": 1718594177859 59 | } 60 | ``` 61 | 62 | > 请看[实例详细信息](#实例详细形信息) 63 | 64 | ## 创建实例 65 | 66 | ```http 67 | POST /api/instance 68 | ``` 69 | 70 | ##### Query 参数 71 | 72 | ```js 73 | { 74 | daemonId: string; 75 | } 76 | ``` 77 | 78 | ##### 请求正文示例 79 | 80 | > 请看[实例配置示例](#实例配置示例) 81 | 82 | #### 返回示例 83 | 84 | ```json 85 | { 86 | "status": 200, 87 | "data": { 88 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf", 89 | "config": InstanceConfig 90 | }, 91 | "time": 1718594177859 92 | } 93 | ``` 94 | 95 | ## 更新实例配置 96 | 97 | ```http 98 | PUT /api/instance 99 | ``` 100 | 101 | #### Query 参数 102 | 103 | ```js 104 | { 105 | uuid: string, // Instance ID 106 | daemonId: string, 107 | } 108 | ``` 109 | 110 | #### 请求正文示例 111 | 112 | > 请看[实例配置示例](#实例配置示例) 113 | 114 | #### 返回示例 115 | 116 | ```json 117 | { 118 | "status": 200, 119 | "data": { 120 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf" 121 | }, 122 | "time": 1718594177859 123 | } 124 | ``` 125 | 126 | ## 删除实例 127 | 128 | ```http 129 | DELETE /api/instance 130 | ``` 131 | 132 | #### Query 参数 133 | 134 | ```js 135 | { 136 | daemonId: string, 137 | } 138 | ``` 139 | 140 | #### 请求正文示例 141 | 142 | ```json 143 | { 144 | "uuids": [ 145 | "50c73059001b436fa85c0d8221c157cf", 146 | "11c2f4c89b9e4e1da819dc56bf16f151" 147 | ], // Instance Id 148 | "deleteFile": false // 是否删除实例文件 149 | } 150 | ``` 151 | 152 | #### 返回示例 153 | 154 | ```json 155 | { 156 | "status": 200, 157 | "data": [ 158 | "50c73059001b436fa85c0d8221c157cf", 159 | "11c2f4c89b9e4e1da819dc56bf16f151" 160 | ], // Instance Id 161 | "time": 1718594177859 162 | } 163 | ``` 164 | 165 | ## 启动实例 166 | 167 | ```http 168 | GET /api/protected_instance/open 169 | ``` 170 | 171 | #### Query 参数 172 | 173 | ```js 174 | { 175 | uuid: string, // Instance ID 176 | daemonId: string, 177 | } 178 | ``` 179 | 180 | #### 返回示例 181 | 182 | ```json 183 | { 184 | "status": 200, 185 | "data": { 186 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf" 187 | }, 188 | "time": 1718594177859 189 | } 190 | ``` 191 | 192 | ## 停止实例 193 | 194 | ```http 195 | GET /api/protected_instance/stop 196 | ``` 197 | 198 | #### Query 参数 199 | 200 | ```js 201 | { 202 | uuid: string, // Instance ID 203 | daemonId: string, 204 | } 205 | ``` 206 | 207 | #### 返回示例 208 | 209 | ```json 210 | { 211 | "status": 200, 212 | "data": { 213 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf" 214 | }, 215 | "time": 1718594177859 216 | } 217 | ``` 218 | 219 | ## 重启实例 220 | 221 | ```http 222 | GET /api/protected_instance/restart 223 | ``` 224 | 225 | #### Query 参数 226 | 227 | ```js 228 | { 229 | uuid: string, // Instance ID 230 | daemonId: string, 231 | } 232 | ``` 233 | 234 | #### 返回示例 235 | 236 | ```json 237 | { 238 | "status": 200, 239 | "data": { 240 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf" 241 | }, 242 | "time": 1718594177859 243 | } 244 | ``` 245 | 246 | ## 强制结束实例进程 247 | 248 | ```http 249 | GET /api/protected_instance/kill 250 | ``` 251 | 252 | #### Query 参数 253 | 254 | ```js 255 | { 256 | uuid: string, // Instance ID 257 | daemonId: string, 258 | } 259 | ``` 260 | 261 | #### 返回示例 262 | 263 | ```json 264 | { 265 | "status": 200, 266 | "data": { 267 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf" 268 | }, 269 | "time": 1718594177859 270 | } 271 | ``` 272 | 273 | ## 批量操作 274 | 275 | operations 可填: `start`, `stop`, `restart`, `kill` 276 | 277 | ```http 278 | POST /api/instance/multi_{{operations}} 279 | ``` 280 | 281 | #### Query 参数 282 | 283 | ```js 284 | { 285 | instanceUuid: string, 286 | daemonId: string, 287 | }[] 288 | ``` 289 | 290 | #### 返回示例 291 | 292 | ```json 293 | { 294 | "status": 200, 295 | "data": true, 296 | "time": 1718594177859 297 | } 298 | ``` 299 | 300 | ## 更新实例 301 | 302 | ```http 303 | GET /api/protected_instance/asynchronous 304 | ``` 305 | 306 | #### Query 参数 307 | 308 | ```js 309 | { 310 | uuid: string, // Instance ID 311 | daemonId: string, 312 | task_name: "update" 313 | } 314 | ``` 315 | 316 | #### 返回示例 317 | 318 | ```json 319 | { 320 | "status": 200, 321 | "data": true, 322 | "time": 1718594177859 323 | } 324 | ``` 325 | 326 | ## 发送命令 327 | 328 | ```http 329 | GET /api/protected_instance/command 330 | ``` 331 | 332 | #### Query 参数 333 | 334 | ```js 335 | { 336 | uuid: string, // Instance ID 337 | daemonId: string, 338 | command: string 339 | } 340 | ``` 341 | 342 | #### 返回示例 343 | 344 | ```json 345 | { 346 | "status": 200, 347 | "data": { 348 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf" 349 | }, 350 | "time": 1718594177859 351 | } 352 | ``` 353 | 354 | ## 获取输出 355 | 356 | ```http 357 | GET /api/protected_instance/outputlog 358 | ``` 359 | 360 | #### Query 参数 361 | 362 | ```js 363 | { 364 | uuid: string, // Instance ID 365 | daemonId: string, 366 | size?: number // 获取的日志大小: 1KB ~ 2048KB 367 | // 如果未设置,则返回所有日志 368 | } 369 | ``` 370 | 371 | #### 返回示例 372 | 373 | ```json 374 | { 375 | "status": 200, 376 | "data": "[INFO]: Done (12.138s)! For help, type \"help\"\n", 377 | "time": 1718594177859 378 | } 379 | ``` 380 | 381 | ## 重新安装 382 | 383 | ```http 384 | POST /api/protected_instance/install_instance 385 | ``` 386 | 387 | #### Query 参数 388 | 389 | ```js 390 | { 391 | daemonId: string, 392 | uuid: string // Instance ID 393 | } 394 | ``` 395 | 396 | #### 请求正文示例 397 | 398 | ```json 399 | { 400 | "targetUrl": "https://files.example.com/Paper-1.20.4.zip", 401 | "title": "Minecraft 1.20.4 Java", 402 | "description": "[Paper] Low hardware configuration machine use, Fast setup." 403 | } 404 | ``` 405 | 406 | #### 返回示例 407 | 408 | ```json 409 | { 410 | "status": 200, 411 | "data": true, 412 | "time": 1718594177859 413 | } 414 | ``` 415 | 416 | ## 实例配置示例 417 | 418 | ```json 419 | { 420 | "nickname": "New Name", 421 | "startCommand": "cmd.exe", 422 | "stopCommand": "^C", 423 | "cwd": "/workspaces/my_server/", 424 | "ie": "gbk", // 输入 encode 425 | "oe": "gbk", // 输出 encode 426 | "createDatetime": 1709631756708, 427 | "lastDatetime": 1709631756708, 428 | "type": "universal", // 实例类型 429 | "tag": [], 430 | "endTime": 1709631756708, 431 | "fileCode": "gbk", 432 | "processType": "docker", 433 | "updateCommand": "shutdown -s", 434 | "actionCommandList": [], 435 | "crlf": 2, 436 | "docker": DockerConfig, 437 | 438 | // Steam RCON 439 | "enableRcon": true, 440 | "rconPassword": "123456", 441 | "rconPort": 2557, 442 | "rconIp": "192.168.1.233", 443 | 444 | // 终端选项 445 | "terminalOption": { 446 | "haveColor": false, 447 | "pty": true, 448 | }, 449 | "eventTask": { 450 | "autoStart": false, 451 | "autoRestart": true, 452 | "ignore": false, 453 | }, 454 | "pingConfig": { 455 | "ip": "", 456 | "port": 25565, 457 | "type": 1, 458 | } 459 | } 460 | ``` 461 | 462 | ## 实例详细形信息 463 | 464 | ```json 465 | { 466 | "config": InstanceConfig, 467 | "info": { 468 | "currentPlayers": -1, 469 | "fileLock": 0, 470 | "maxPlayers": -1, 471 | "openFrpStatus": false, 472 | "playersChart": [], 473 | "version": "", 474 | }, 475 | "instanceUuid": "50c73059001b436fa85c0d8221c157cf", 476 | "processInfo": { 477 | "cpu": 0, 478 | "memory": 0, 479 | "ppid": 0, 480 | "pid": 0, 481 | "ctime": 0, 482 | "elapsed": 0, 483 | "timestamp": 0 484 | }, 485 | "space": 0, 486 | "started": 6, // 启动次数 487 | "status": 3, // -1 = 忙碌, 488 | // 0 = 停止, 489 | // 1 = 停止中, 490 | // 2 = 启动中, 491 | // 3 = 运行中 492 | } 493 | ``` 494 | 495 | ## 实例的 docker 配置 496 | 497 | ```json 498 | { 499 | "containerName": "", 500 | "image": "mcsm-ubuntu:22.04", 501 | "memory": 1024, // MB 502 | "ports": ["25565:25565/tcp"], 503 | "extraVolumes": [], 504 | "maxSpace": null, 505 | "network": null, 506 | "io": null, 507 | "networkMode": "bridge", 508 | "networkAliases": [], 509 | "cpusetCpus": "", 510 | "cpuUsage": 100, 511 | "workingDir": "", 512 | "env": [] 513 | } 514 | ``` 515 | -------------------------------------------------------------------------------- /zh_cn/apis/api_users.md: -------------------------------------------------------------------------------- 1 | # 用户 API 2 | 3 | ## 获取 用户 列表 4 | 5 | ```http 6 | GET /api/auth/search 7 | ``` 8 | 9 | #### Query 参数 10 | 11 | ```js 12 | { 13 | userName?: string 14 | page: number 15 | page_size: number 16 | role?: string // 用户权限 17 | // 1=用户, 10=管理员, -1=被封禁的用户 18 | } 19 | ``` 20 | 21 | #### 返回示例 22 | 23 | ```json 24 | { 25 | "status": 200, 26 | "data": { 27 | "data": [ 28 | { 29 | "uuid": "55a8120adb4f4bb3bee672ef305bae62", 30 | "userName": "Admin", 31 | "passWord": "", 32 | "passWordType": 1, 33 | "salt": "", 34 | "permission": 10, // 1=用户, 10=管理员, -1=被封禁的用户 35 | "registerTime": "10/28/2023, 5:38:44 PM", 36 | "loginTime": "10/14/2023, 1:01:58 AM", 37 | // 用户拥有的实例列表 38 | "instances": [ 39 | { 40 | "instanceUuid": "82e856fd33424e018fc2c007e1a3c4d3", 41 | "daemonId": "1fcdacc01eac44a7bf8fe83d34215d05" 42 | } 43 | ], 44 | "apiKey": "", 45 | "isInit": false, 46 | "secret": "", 47 | "open2FA": false 48 | } 49 | ], 50 | "maxPage": 1, 51 | "page": 1, 52 | "pageSize": 20, 53 | "total": 6 54 | }, 55 | "time": 1718594177859 56 | } 57 | ``` 58 | 59 | ## 创建 用户 60 | 61 | ```http 62 | POST /api/auth 63 | ``` 64 | 65 | #### 请求正文 66 | 67 | ```json 68 | { 69 | "username": string, 70 | "password": string, 71 | "permission": number // 1=用户, 10=管理员, -1=被封禁的用户 72 | } 73 | ``` 74 | 75 | #### 返回示例 76 | 77 | ```json 78 | { 79 | "status": 200, 80 | "time": 1718594177859, 81 | "data": { 82 | "uuid": "046afc351bfb44a99aa5641c06e70e5a", // 新用户的 UUID 83 | "userName": "Admin", // 新用户的用户名 84 | "permission": 1 //新用户的权限 85 | } 86 | } 87 | ``` 88 | 89 | ## 更新用户数据 90 | 91 | ```http 92 | PUT /api/auth 93 | ``` 94 | 95 | #### 请求正文 96 | 97 | ```json 98 | { 99 | "uuid": string, //目标用户的 UUID 100 | "config": { 101 | // 目标用户信息 102 | "uuid": string, 103 | "userName": string, 104 | "loginTime": string, 105 | "registerTime": string, 106 | "instances": InstanceDetail[], // 用户拥有的实例 107 | // 您可以在此处为用户分配实例 108 | "permission": number, // 1=用户, 10=管理员, -1=被封禁的用户 109 | "apiKey": string, 110 | "isInit": boolean, 111 | "secret": string, 112 | "open2FA": boolean, 113 | } 114 | } 115 | ``` 116 | 117 | > 有关InstanceDetail的信息,[这请参考这里](./api_instance.md#示例详细信息) 118 | 119 | #### 返回示例 120 | 121 | ```json 122 | { 123 | "status":200 , 124 | "data": true, 125 | "time": 1718594177859 126 | } 127 | ``` 128 | 129 | ## 删除用户 130 | 131 | ```http 132 | DELETE /api/auth 133 | ``` 134 | 135 | #### 请求正文 136 | 137 | ```js 138 | ["user uuid"]; // 目标用户的UUID 139 | ``` 140 | 141 | #### 返回示例 142 | 143 | ```json 144 | { 145 | "status": 200, 146 | "data": true, 147 | "time": 1718594177859 148 | } 149 | ``` 150 | -------------------------------------------------------------------------------- /zh_cn/apis/get_apikey.md: -------------------------------------------------------------------------------- 1 | # API 使用教程 2 | 3 | ## API Key 4 | 5 | :::tip 6 | 如果你是管理员账号,那么你的 APIKEY 将同时拥有管理员权限,请不要泄漏你的 APIKEY。 7 | 8 | 如果您需要制作外接程序,请牢记将API写入后端进行隐藏! 9 | ::: 10 | 11 | 如图所示 12 | 13 | 14 | 15 | 生成并复制此 API 密钥,它将具有与您当前帐户相同的权限。 16 | 17 | 18 | 19 | ## 示例用法 20 | 21 | 假设您是一名管理员,并且希望使用 API 来“获取远程节点列表”。您需要使用任何编程语言或 HTTP 工具来发送以下请求: 22 | 23 | ```bash 24 | GET http://demo.com/api/service/remote_services_system?apikey=<你的 Api Key> 25 | Content-Type: application/json; charset=utf-8 26 | X-Requested-With: XMLHttpRequest 27 | 28 | 注意:URL后面一定要加入 apikey 参数,否则权限不足 29 | ``` 30 | 31 | :::warning 32 | 如果没有另行指定,**这些 HTTP 请求头是必需的**。 33 | 34 | - X-Requested-With: XMLHttpRequest 35 | - Content-Type: application/json; charset=utf-8 36 | 37 | ::: 38 | 39 | 您将获得所有节点的所有数据: 40 | 41 | ```json 42 | { 43 | // 状态参数 44 | // 200:正常,返回相应内容 45 | // 400:请求参数不正确 46 | // 403:权限不足 47 | // 500:程序错误 48 | "status": 200, 49 | // 响应节点列表 50 | "data": [ 51 | { 52 | "version": "3.9.0", 53 | "process": { 54 | "cpu": 5625000 //CPU 使用 55 | "memory": 132437320, // 内存使用 56 | "cwd": "D:\\Workspace\\MCSM\\MCSManager-Daemon" //守护进程 目录 57 | }, 58 | "instance": { 59 | "running": 1, // 运行的实例 60 | "total": 6 // 总共实例 61 | }, 62 | "system": { 63 | "type": "Windows_NT", //系统类型 64 | "hostname": "MyComputer", //系统名称 65 | "platform": "win32", //系统平台 66 | "release": "11.0.22000", //版本 67 | "uptime": 410445, //在线时长 68 | "cwd": "D:\\Workspace\\MCSM\\MCSManager-Daemon", //守护进程 目录 69 | "loadavg": [0, 0, 0], //负载 70 | "freemem": 5700775936, //剩余内存 71 | "cpuUsage": 0.0490009222256379, //CPU使用 72 | "memUsage": 0.6651475749266619, //内存使用 73 | "totalmem": 17024741376, //总内存 74 | "processCpu": 0, 75 | "processMem": 0 76 | } 77 | } 78 | ], 79 | // 请求完成处理的时间可用于测量延迟。 80 | "time": 1643879914006 81 | } 82 | ``` 83 | -------------------------------------------------------------------------------- /zh_cn/apis/html_card.md: -------------------------------------------------------------------------------- 1 | # 制作卡片小组件 2 | 3 | :::tip 4 | 此功能需要一些 JavaScript 开发知识。 5 | 6 | **不建议使用其他人的脚本,因为这可能会导致您的面板受到损害** 7 | ::: 8 | 9 | 在 MCSManager web 界面中启用设计模式后,添加新卡片时有一个选项“扩展页面卡片”。此卡片允许您上传自己的 “HTML” 文件,该文件直接在前端 web 环境中运行。这与“嵌入式 Web 卡片”有根本不同,因为您可以访问大多数前端 HTML 节点并操作 MCSManager 提供的 API 。 10 | 11 | ```html 12 | 13 | 14 | 15 | 16 | Hello World 17 | Button 18 | 19 | 20 | 21 | 39 | 40 | 41 | ``` 42 | 43 | ## JavaScript 沙盒机制 44 | 45 | 为了防止加载在同一页面上的多张卡片相互干扰, MCSManager 创建了一个简单的 JavaScript 沙盒机制。其工作原理是代理窗口对象。对窗口对象所做的任何更改都不会影响其他对象。 46 | 47 | ### HTML 卡片实例 1 48 | 49 | ```js 50 | window.$onMounted = function () { 51 | window.name = "foo"; // 定义一个全局变量 52 | }; 53 | ``` 54 | 55 | ### HTML 卡片实例 2 56 | 57 | ```js 58 | window.$onMounted = function () { 59 | setTimeout(() => { 60 | console.log(window.name); // 输出 undefined,因为卡片1的js脚本不会污染到其他任何卡片 61 | }, 10000); 62 | }; 63 | ``` 64 | 65 | ## CSS 样式污染 66 | 67 | MCSManager 不隔离 CSS 样式。约束 CSS 样式取决于您或其他开发人员。您对 CSS 所做的任何定义都会影响整个 MCSManager 网页。 68 | 69 | ## Card API 70 | 71 | 我们为您的脚本提供了几个 API。 72 | 73 | ```js 74 | window.$onMounted = function () { 75 | // 卡片挂载完成事件。 76 | }; 77 | window.$onUnmounted = function () { 78 | // 卡片卸载完成事件。 79 | }; 80 | 81 | // 真实窗口对象,即 MCSManager web 前端的窗口对象。 82 | window.$realWindow; 83 | 84 | // Axios 库用于发送请求。 85 | //参考:https://axios-http.com/docs/example 86 | window.$axios; 87 | 88 | //当前 MCSManager 界面主题,亮或暗(亮/暗)。 89 | window.$theme; 90 | ``` 91 | -------------------------------------------------------------------------------- /zh_cn/docker-install.md: -------------------------------------------------------------------------------- 1 | # 使用 Docker 安装面板 2 | 3 | :::tip 4 | 使用 Docker 镜像安装面板需要额外进行一些复杂的配置,请确保您已掌握这些知识,否则请使用一键安装脚本来安装面板, 5 | ::: 6 | 7 | ## 安装 Docker 8 | 9 | ```bash 10 | export DOWNLOAD_URL=https://mirrors.ustc.edu.cn/docker-ce # 国内需要执行这步 11 | curl -fsSL https://get.docker.com -o get-docker.sh 12 | sudo sh get-docker.sh 13 | ``` 14 | 15 | ## 安装 MCSManager 16 | 17 | 下列命令中,所有的 `` 需要**替换为你实际数据存储**的位置,该位置需要被持久化,web 和 daemon 的安装位置可以不同。 18 | 19 | ### docker-compose 安装 20 | 21 | ```yaml 22 | # docker-compose.yml 23 | services: 24 | web: 25 | image: githubyumao/mcsmanager-web:latest 26 | ports: 27 | - "23333:23333" 28 | volumes: 29 | - /etc/localtime:/etc/localtime:ro 30 | - /web/data:/opt/mcsmanager/web/data 31 | - /web/logs:/opt/mcsmanager/web/logs 32 | 33 | daemon: 34 | image: githubyumao/mcsmanager-daemon:latest 35 | restart: unless-stopped 36 | ports: 37 | - "24444:24444" 38 | environment: 39 | - MCSM_DOCKER_WORKSPACE_PATH=/daemon/data/InstanceData 40 | volumes: 41 | - /etc/localtime:/etc/localtime:ro 42 | - /daemon/data:/opt/mcsmanager/daemon/data 43 | - /daemon/logs:/opt/mcsmanager/daemon/logs 44 | - /var/run/docker.sock:/var/run/docker.sock 45 | ``` 46 | 47 | ```bash 48 | mkdir -p 49 | cd 50 | vim docker-compose.yml # 这里写入上面的docker-compose.yml的内容 51 | docker compose pull && docker compose up -d 52 | ``` 53 | 54 | ### 命令行安装 55 | 56 | ```bash 57 | # 拉取镜像,在中国的服务器需要自己配置加速镜像源 58 | docker pull githubyumao/mcsmanager-daemon:latest 59 | docker pull githubyumao/mcsmanager-web:latest 60 | 61 | # 注意:下列命令中,所有的 `${CHANGE_ME_TO_INSTALL_PATH}` 62 | # 需要替换为你实际数据存储的位置,该位置需要被持久化 63 | 64 | # 启动 MCSManager 守护进程端 65 | docker run -v /etc/localtime:/etc/localtime:ro \ 66 | -v ${CHANGE_ME_TO_INSTALL_PATH}/daemon/data:/opt/mcsmanager/daemon/data \ 67 | -v ${CHANGE_ME_TO_INSTALL_PATH}/daemon/logs:/opt/mcsmanager/daemon/logs \ 68 | -v /var/run/docker.sock:/var/run/docker.sock \ 69 | -e MCSM_DOCKER_WORKSPACE_PATH=${CHANGE_ME_TO_INSTALL_PATH}/daemon/data/InstanceData \ 70 | -p 24444:24444 \ 71 | -d githubyumao/mcsmanager-daemon:latest 72 | 73 | 74 | # 启动 MCSManager Web 端 75 | docker run \ 76 | -v /etc/localtime:/etc/localtime:ro \ 77 | -v ${CHANGE_ME_TO_INSTALL_PATH}/web/data:/opt/mcsmanager/web/data \ 78 | -v ${CHANGE_ME_TO_INSTALL_PATH}/web/logs:/opt/mcsmanager/web/logs \ 79 | -p 23333:23333 \ 80 | -d githubyumao/mcsmanager-web:latest 81 | 82 | ``` 83 | 84 | ### 配置面板 85 | 86 | 安装并启动之后,你可以通过 `http://<你的公网IP>:23333` 访问面板。 87 | 88 | 此时你进入面板,应该会出现一些错误,因为面板 Web 端没有成功连接到守护进程端,需要配置让它们联系到一起。 89 | 90 | #### 连接节点 91 | 92 | 点击顶部导航栏 `节点`,点击右侧的 `新增节点`,填写你的服务器**公网 IP**,密钥和默认的 `24444` 端口。 93 | 94 | 执行指令 `cat /daemon/data/Config/global.json` 可以查看守护进程密钥。 95 | 96 | 具体流程可以参考:[连接其他机器](./advanced/distributed.html) 97 | -------------------------------------------------------------------------------- /zh_cn/index.md: -------------------------------------------------------------------------------- 1 | # 快速开始 2 | 3 | ## 这是什么? 4 | 5 | MCSManager 是一款开源,分布式,一键部署,支持 `Minecraft` 和 `Steam 游戏服务器` 的控制面板。 6 | 7 | MCSManager 在 `Minecraft` 和 `其他游戏` 社区内中已有一定的流行程度,它可以帮助你集中管理多个物理服务器,动态在任何主机上创建游戏服务端,并且提供安全可靠的多用户权限系统,可以很轻松的帮助你管理多个服务器。 8 | 9 | ## 环境要求 10 | 11 | 默认情况下,**自动安装脚本应该已经包含一切所需环境**,所以你不需要关心环境要求。 12 | 13 | 但如果是手动安装的情况下,你需满足 `Node 16+` 运行时环境。 14 | 15 | ## Linux 自动安装 16 | 17 | 因为需要注册到系统服务,一键安装脚本**必须使用 root 权限**运行。 18 | 19 | ```bash 20 | sudo su -c "wget -qO- https://script.mcsmanager.com/setup_cn.sh | bash" 21 | ``` 22 | 23 | ### 启动方式 24 | 25 | ```bash 26 | # 先启动面板守护进程。 27 | # 这是用于进程控制,终端管理的服务进程。 28 | systemctl start mcsm-daemon.service 29 | # 再启动面板 Web 服务。 30 | # 这是用来实现支持网页访问和用户管理的服务。 31 | systemctl start mcsm-web.service 32 | 33 | # 重启面板命令 34 | systemctl restart mcsm-daemon.service 35 | systemctl restart mcsm-web.service 36 | 37 | # 停止面板命令 38 | systemctl stop mcsm-web.service 39 | systemctl stop mcsm-daemon.service 40 | 41 | ``` 42 | 43 | :::tip 44 | 如果 `systemctl` 命令**无法启动**面板,可以参考下文的 `手动安装` 中的 `启动方式` 来启动 MCSManager。 45 | 但这需要你用其他后台运行程序来接管它,否则当你的 `SSH` 终端断开之时,手动启动的 MCSManager 面板也会随之被系统强制结束。 46 | 47 | 面板 Web 服务是提供用户管理与网页访问功能的服务,守护进程是提供进程管理和容器管理的服务,两者缺一不可。如果某个功能不正常,可以只重启这一部分的服务来热修复问题。 48 | ::: 49 | 50 | ## Linux 手动安装 51 | 52 | ```bash 53 | # 切换到安装目录,你也可以换成其他的目录。 54 | cd /opt/ 55 | 56 | # 下载 NodeJS 运行时环境,如果你已经安装了 NodeJS,请忽略此步骤。 57 | wget https://nodejs.org/dist/v20.11.0/node-v20.11.0-linux-x64.tar.xz 58 | tar -xvf node-v20.11.0-linux-x64.tar.xz 59 | 60 | # 添加 NodeJS 到系统环境变量 61 | ln -s /opt/node-v20.11.0-linux-x64/bin/node /usr/bin/node 62 | ln -s /opt/node-v20.11.0-linux-x64/bin/npm /usr/bin/npm 63 | 64 | # 进入你的安装目录 65 | mkdir /opt/mcsmanager/ 66 | cd /opt/mcsmanager/ 67 | 68 | # 下载 MCSManager(如果无法下载可以先科学上网下载再上传到服务器) 69 | wget https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz 70 | 71 | # 解压到安装目录 72 | tar -zxf mcsmanager_linux_release.tar.gz 73 | 74 | ``` 75 | 76 | ### 启动方式 77 | 78 | ```bash 79 | # 安装依赖库 80 | ./install.sh 81 | 82 | # 请使用 Screen 程序打开两个终端窗口(或者其他接管程序) 83 | 84 | # 先启动节点程序 85 | ./start-daemon.sh 86 | 87 | # 在第二个终端启动 Web 面板服务 88 | ./start-web.sh 89 | 90 | # 为网络界面访问 http://localhost:23333/ 91 | # 一般来说,网络应用会自动扫描并连接到本地守护进程。 92 | # 默认需要开放的端口:23333 和 24444 93 | ``` 94 | 95 | ### 关闭面板 96 | 97 | 只需分别进入两个终端执行 `Ctrl+C` 即可。 98 | 99 | ## Windows 安装 100 | 101 | 仅需点击[官网](https://mcsmanager.com/)首页的下载按钮即可,解压后即可运行,无任何安装依赖,不污染注册表。 102 | 103 | ### 启动方式 104 | 105 | 执行 `start.bat` 或 `运行.bat` 等,如果压缩包内部含有 `启动器.exe`,则可使用它来启动面板。 106 | 107 | ### 如何关闭? 108 | 109 | 在面板两个终端控制台窗口输入 `Ctrl+C` 即可正常关闭。 110 | -------------------------------------------------------------------------------- /zh_cn/ops/cloudflare.md: -------------------------------------------------------------------------------- 1 | # 使用 Cloudflare 代理 2 | 3 | :::tip 4 | **在阅读本章节之前请充分理解[「网络架构」](./mcsm_network)和[「使用 HTTPS」](./proxy_https.md)章节。** 5 | 本章节适用人群为 Cloudflare CDN 的使用者 6 | ::: 7 | 8 | 在本章节会讲解如何在使用 Cloudflare 代理的同时,可以让面板访问到守护进程。\ 9 | **注意** Cloudflare 仅作为 CDN 存在,并**不提供端口转换**服务。即 Cloudflare 访问源服务器的端口与用户访问 Cloudflare 的端口**一致**。\ 10 | 如果您有多个节点共享一个端口,可以使用不同域名并配置 Nginx 根据来源转发至不同节点。 11 | 12 | :::warning 13 | Cloudflare 的 CDN 只支持以下端口作为 HTTPS 端口转发: 14 | 15 | - 443 16 | - 2053 17 | - 2083 18 | - 2087 19 | - 2096 20 | - 8443 21 | 22 | 请选择以上端口作为守护进程的转发端口 23 | ::: 24 | 25 | ## 1. 设置域名 DNS 解析 26 | 27 | 1. 登录 Cloudflare 控制台并打开域名的子面板。 28 | 2. 在侧边栏的 `DNS` 的小菜单中找到 `记录`,并添加一个新的 A 或 CNAME 记录指向您的主机。 29 | 3. 确保 `代理状态` 为 `仅DNS` 并保存。 30 | 31 | ## 2. 配置 HTTPS 反向代理 32 | 33 | 在正式配置 Cloudflare CDN 之前,请先参考[「使用 HTTPS」](./proxy_https.md)章节,使用**上面之一**的端口为面板和节点启用 HTTPS。 34 | 您可以使用自签或来自 Cloudflare 的 SSL 证书。\ 35 | 配置完成后,请确保可以正确使用域名及证书连接. 36 | 37 | ### 使用 Cloudflare 的证书 38 | 39 | 1. 打开 Cloudflare 面板并打开域名的子面板 40 | 2. 在侧边栏的`SSL/TLS`的小菜单中找到`源服务器`选项并打开 41 | 3. 点击创建证书,并根据自身情况选择私钥类型、域名、有效期(推荐私钥类型为 ECC,域名栏保持默认,和选择 15 年有效期) 42 | 4. 复制证书和密钥并保存 43 | 44 | ### 使用自签证书 45 | 46 | ``` 47 | #Generate a Self-Signed Certificate using OpenSSL 48 | openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 49 | ``` 50 | 51 | ## 3. 配置 Cloudflare 52 | 53 | 打开 Cloudflare 面板并打开域名的子面板, 打开`SSL/TLS`小菜单。 54 | 55 | 1. 如果您使用自签证书,**把`SSL/TLS的加密模式`改成`完全`**。 56 | 2. 如果您使用 Cloudflare 证书,您可以自由选择 **`严格`** 或 **`完全`**。一般情况下 **`完全`** 足够绝大多数用户使用。 57 | 58 | 在侧边栏的 `DNS` 的小菜单中找到 `记录` 59 | 60 | 1. 编辑刚刚添加的 A 或 CNAME 记录。 61 | 2. 更改 `代理状态` 为 `已代理` 并保存。 62 | 63 | ## 4. 测试访问 64 | 65 | 使用第二步中配置的域名,再次使用浏览器测试访问。 66 | 67 | 如果可以正常显示,恭喜您已成功为您的面板或节点启用了 Cloudflare!\ 68 | 您现在可以根据[「使用 HTTPS」](./proxy_https.md)章节中的步骤添加节点至面板。 69 | 70 | 如果测试失败,您可能需要手动清除 DNS 解析缓存并重试。 71 | -------------------------------------------------------------------------------- /zh_cn/ops/config_files.md: -------------------------------------------------------------------------------- 1 | # 数据与配置 2 | 3 | ## 配置文件 4 | 5 | ### 面板 6 | 7 | `/data/SystemConfig/config.json` 8 | 9 | ```json 10 | { 11 | "httpPort": 23333, // Web 面板端口 12 | "httpIp": null, // 绑定IP,多张网卡时可使用 13 | "prefix": "", // http路径前缀 14 | "crossDomain": true, // 是否准许跨域 15 | "gzip": false, // 是否开启 gzip 压缩 16 | "loginCheckIp": false, // 同IP登录次数过多自动锁定 17 | "loginInfo": "foo", // 登录界面提示文字 18 | "canFileManager": true, // 是否准许所有用户使用文件管理功能 19 | "language": "zh_cn", // 面板语言 20 | "quickInstallAddr": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/quick_install.json", // 快速部署说明地址 21 | 22 | "redisUrl": "", // Redis 数据库接入,不推荐使用 23 | "dataPort": 23334, // 已弃用 24 | "forwardType": 1, // 已弃用 25 | "zipType": 1, // 已弃用 26 | "maxCompress": 1, // 最大同时压缩任务数,已弃用 27 | "maxDownload": 10 // 最大同时下载任务数,已弃用 28 | } 29 | ``` 30 | 31 | ### 节点 32 | 33 | `/data/Config/global.json` 34 | 35 | ```json 36 | { 37 | "version": 2, 38 | "ip": "", // 绑定IP,多张网卡时可使用 39 | "port": 24444, // 节点端口 40 | "prefix": "", // http, websocket 路径前缀 41 | "key": "c043e149c9bc44d922ea3be6ff6406abc7b778981c3feb6", // 节点密钥 42 | "maxFileTask": 2, // 每个实例,最大同时解压缩任务数 43 | "maxZipFileSize": 60, // 最大文件解压缩限制,单位(GB) 44 | "language": "zh_cn", // 节点端语言 45 | "defaultInstancePath": "" // 节点实例文件储存目录,空代表自动 46 | } 47 | ``` 48 | 49 | ## 实例的文件储存在何处? 50 | 51 | 实例文件指的是 `地图`,`玩家数据` 和 `插件` 等,它们都存放在对应的节点机器上,它们储存在 `/data/InstanceData/<实例ID>/` 目录中。 52 | 53 | 实例的配置文件在 `/data/InstanceConfig/<实例ID>.json`,这里储存了每个实例的配置,启动命令和参数等信息。 54 | -------------------------------------------------------------------------------- /zh_cn/ops/from_v9.md: -------------------------------------------------------------------------------- 1 | # 从 9.x 版本升级 2 | 3 | :::tip 4 | MCSManager 10.x 版本的配置文件,数据文件格式 和 API 相比 9.x 版本都有些许差异,但是 90% 的 API 依然可以正常使用。 5 | ::: 6 | 7 | ## 我的数据储存在哪里? 8 | 9 | 如果你已经安装 9.x 版本并且使用的是一键安装脚本,在 Linux 下,你的数据在: 10 | 11 | - 实例相关的数据:`/opt/mcsmanager/daemon/data` 12 | 13 | - 用户相关的数据:`/opt/mcsmanager/web/data` 14 | 15 | Windows 下同理,分别在 `daemon` 和 `web` 两个文件夹中。 16 | 17 | ## 步骤 18 | 19 | 1. 下载最新的 MCSManager 10.x 发行版包,并解压它。 20 | 21 | 2. 关闭面板所有服务,备份你的 9.x 数据。 22 | 23 | > 只需复制 daemon/data,web/data 这两个目录中的所有文件即可完成备份。 24 | 25 | 3. 分别进入 9.x 版本的 `daemon` 和 `web` 两个文件夹。 26 | 27 | 4. 删除 9.x 文件中**除了 daemon/data,web/data 之外**的所有文件,然后将 10.x 版本的里面的 daemon 和 web 文件夹分别复制到对应的文件夹中,这样就可以确保数据不会损坏的情况下,升级到 10.x 版本。 28 | 29 | 5. 启动面板。 30 | 31 | :::tip 32 | 你必须删除旧代码再复制新代码到文件夹中,而不是直接覆盖文件,有很多用户指出直接采用覆盖文件的做法有很大概率会出现问题,这是因为覆盖文件之后的旧版本残留文件依然在影响着新版本。 33 | ::: 34 | 35 | ## API 升级 36 | 37 | 如果你正在使用 MCSManager 9.x 版本的 Discord 机器人,QQ 机器人,SDK,和非官方开发的工具,可能会需要联系作者进行适配。 38 | 39 | 10.x 有一部分的破坏性更新,分别如下: 40 | 41 | **1. 对应更新用户信息的 API,给用户分配实例时,原本的数据格式是这样:** 42 | 43 | **9.x** 44 | 45 | ```js 46 | { 47 | "userName": "lmh", 48 | // more... 49 | "instances": [ 50 | { 51 | "instanceUuid": "bc3cd400b8f54be2b14078c7dd4d1820", 52 | "serviceUuid": "af7acf6cb7414d13916b9a9bd39a2b60" 53 | } 54 | ], 55 | } 56 | ``` 57 | 58 | 现在需要这样,我们将 `serviceUuid` 改成了 `daemonId`: 59 | 60 | **10.x** 61 | 62 | ```js 63 | { 64 | "userName": "lmh", 65 | // more... 66 | "instances": [ 67 | { 68 | "instanceUuid": "d0999ed2c57348868f56d11d2edf8806", 69 | "daemonId": "2068878ada35464c940bf84750b20333" 70 | }, 71 | ], 72 | } 73 | ``` 74 | 75 | **2. 实例到期时间,创建时间,最后启动时间从原本的文本形式升级到时间戳格式。** 76 | 77 | **9.x** 78 | 79 | ```js 80 | { 81 | "nickname": "Test Instance", 82 | "startCommand": "java -Xmx4G -jar server.jar -nogui", 83 | "stopCommand": "stop", 84 | // ... more 85 | "createDatetime": "10/14/2023", 86 | "lastDatetime": "12/24/2023 16:28", 87 | "endTime": "2/12/2025, 5:45:44 PM", 88 | } 89 | ``` 90 | 91 | **10.x** 92 | 93 | ```js 94 | { 95 | "nickname": "Test Instance", 96 | "startCommand": "java -Xmx4G -jar server.jar -nogui", 97 | "stopCommand": "stop", 98 | // ... more 99 | "createDatetime": 1709631756708, 100 | "lastDatetime": 1710330661317, 101 | "endTime": 0, 102 | } 103 | ``` 104 | 105 | **3. 用户信息 Docker 字段中的 `extraVolumes` 升级使用 `|` 进行分割,不支持 `:ro` 等定义。** 106 | 107 | 这种更改主要是为了兼容 Windows Docker。 108 | 109 | **10.x** 110 | 111 | ```js 112 | // more... 113 | "docker": { 114 | "containerName": "", 115 | // more... 116 | "extraVolumes": [ 117 | "myhost/a/b/|container/work" 118 | ], 119 | } 120 | ``` 121 | 122 | **4. API 守护进程 ID 参数更改** 123 | 124 | 这里以开启实例的 API 举例: 125 | 126 | **9.X** 127 | 128 | ```http 129 | POST /api/protected_instance/open?remote_uuid={Daemon ID}&uuid={Instance ID}&apikey={Api Key} 130 | ``` 131 | 132 | **10.X** 133 | 134 | ```http 135 | // remote_uuid --> daemonId 136 | POST /api/protected_instance/open?daemonId={Daemon ID}&uuid={Instance ID}&apikey={Api Key} 137 | ``` 138 | 139 | 注意:此更改是可选的,`10.x` 依然兼容 `remote_uuid` 参数,但不推荐。 140 | -------------------------------------------------------------------------------- /zh_cn/ops/mcsm_network.md: -------------------------------------------------------------------------------- 1 | # 网络架构 2 | 3 | :::tip 4 | 你想要了解如何完美的进行反向代理,就必须先了解这个软件的网络是如何运作的。本章节将尽可能简单通俗的讲解 MCSManager 分布式网络通信原理。 5 | ::: 6 | 7 | 首先我们知道 MCSManager 是支持将**多台机器**连接起来,由 `面板` 统一管理的,而被连接的本地主机或远程主机,我们称之为 `节点`。 8 | 9 | 那么如果有很多用户同时上传文件到不同的 `节点`,**如果所有上传文件的流量全部经过面板来转发,势必会造成宽带供不应求,甚至崩溃**。 10 | 11 | 为此,我们将所有**大流量**的操作,只让 `面板` 负责授权,由浏览器**直接连接** `节点` 传输数据(比如文件上传,控制台实时日志)等。如此一来,流量就平均分摊到各个节点,不会导致 `面板` 侧占满的情况。 12 | 13 | ## 子项目职责 14 | 15 | 整体项目总共分为两个部分,一个面板端(Web Panel),一个节点端(Daemon)。 16 | 17 | **面板端的功能划分:** 18 | 19 | - 用户管理 20 | - 连接节点 21 | - 大多数操作的权限认证与授权 22 | - API 接口提供 23 | - 更多... 24 | 25 | **节点端的功能划分** 26 | 27 | - 真实的进程管理(你的实例进程实际运行处) 28 | - Docker 容器管理 29 | - 文件管理 30 | - 终端实时通信 31 | - 更多... 32 | 33 | ## 这会影响到什么吗? 34 | 35 | 这会**严重加剧反向代理和 HTTPS 配置难度**。通常来说,配置反向代理只需要一个端口即可,但是由于 MCSManager 分布式的设计,你必须配置至少两个端口,如果你加入 HTTPS 配置,由于浏览器对于 HTTPS 网站的要求是所有连接必须全部是 HTTPS 协议,为此你需要为每一个远程节点全部配置并支持 HTTPS 才能成功。 36 | 37 | ## 原理图 38 | 39 | 在无其他配置和因素下,浏览器需要与守护进程进行直接访问,以便于文件上传下载和实时数据传输,从而减小面板端的流量压力。 40 | 41 | 正因如此,连接守护进程的 IP 地址不得使用内网段,否则外部用户将无法访问到守护进程并且会一直显示 `连接中` 字样。 42 | 43 | 右键新标签页打开可以放大。 44 | 45 |  46 | -------------------------------------------------------------------------------- /zh_cn/ops/path_prefix.md: -------------------------------------------------------------------------------- 1 | # 与其他服务共用端口 2 | 3 | ::: tip 4 | 阅读和使用本章节**你必须知晓 Nginx 或其他软件的反向代理和基础的 Linux 运维知识**。 5 | ::: 6 | 7 | 如果希望 MCSManager 和其它服务使用同一个端口,有以下解决方案: 8 | 9 | - 使用不同域名 sni 区分。 10 | - **添加 URL 路径前缀来区服服务。** 11 | 12 | 本节主要讲解第二种。 13 | 14 | ## 什么是 URL 路径前缀 15 | 16 | 列如:访问 MCSManager 面板时的 URL 是 `http://localhost:23333/`。如果将 URL 前缀配置为 `/mcsm/`,那么面板的 URL 会变为 `http://localhost:23333/mcsm/`。 17 | 18 | 假设你还有一个叫 `Jenkins` 的服务,将路径前缀设置成了 `/jenkins/`。此时你可以通过反向代理合并这两个服务。 19 | 20 | 例如,反向代理到 `https://example.com[:443]`,那么,你可以通过 `https://example.com/mcsm/` 访问到 MCSM 面板,同时通过 `https://example.com/jenkins/` 访问到 Jenkins。 21 | 22 | ## 反向代理 23 | 24 | Nginx 的配置参见[配置 HTTPS](proxy_https)。 25 | 26 | 现在我们要做的是修改原先配置中的 `location` 项。例如你的路径前缀是 `/mcsm/`,那么将原先的 27 | 28 | ```conf 29 | location / { 30 | # ... 31 | } 32 | ``` 33 | 34 | 改为 35 | 36 | ```conf 37 | location /mcsm { 38 | # ... 39 | } 40 | ``` 41 | 42 | 重启 nginx 即可。 43 | 44 | ## 更改配置 45 | 46 | 在 Daemon 和 Web 程序的[配置文件](config_files)中的 `prefix` 项即为路径前缀配置项。 47 | 48 | 将其修改为你想要的路径前缀,然后重启 MCSM。此时你再访问,会发现已经被自动重定向到对应的**添加了路径前缀**的页面。 49 | 50 | ::: warning 51 | 路径前缀应该以 `/` 开头,如 `/mcsm/`。 52 | ::: 53 | 54 | ::: tip 55 | 路径前缀末尾的 `/` 建议添加。 56 | 57 | 如果没加,例如 `/mcsm`,那么 `/mcsmapi/xxx` 也会被匹配,并且被作为 `/api/xxx` 处理。 58 | ::: 59 | 60 | 接下来,在 Daemon 添加了路径前缀配置并且重启之后,你会发现面板无法成功连接到远程节点。 61 | 62 | 此时,你需要进入面板中的 `节点` 菜单,选择对应的节点,点击 `设置` 按钮,填写对应的 `路径前缀` 项。如果填写正确,那么保存后应该可以正常连接到 Daemon 程序。 63 | -------------------------------------------------------------------------------- /zh_cn/ops/proxy_https.md: -------------------------------------------------------------------------------- 1 | # 配置 HTTPS 2 | 3 | :::tip 4 | **请确保你已经充分理解「网络架构」章节。** 5 | ::: 6 | 7 | ## 生成 SSL 证书 8 | 9 | 可以在免费 SSL 的网站上,为自己的域名生成 90 天免费且可无限续签的证书: 10 | 11 | > https://ohttps.com/ 12 | > https://www.mianfeissl.com/ 13 | 14 | 如果你没有域名,想直接用 IP 地址访问,可以在此生成证书: 15 | 16 | > https://zerossl.com/ 17 | 18 | 你也可以选择使用`Let's Encrypt`、`其他CA`或`自签名SSL证书`。注意自签名证书默认不被操作系统及浏览器信任,需要手动加入信任链。 19 | 20 | ```使用OpenSSL生成自签名证书 21 | openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 22 | ``` 23 | 24 | ## 定位配置文件位置 25 | 26 | 本教程以 `Nginx` 配置为例,如果使用 `Apache` 等其他软件则需要根据实际情况调整配置。 27 | 28 | Nginx 配置一般位于`/etc/nginx/nginx.conf` 也可能根据发行版不同略有区别。 29 | 30 | ## 准备证书链文件 31 | 32 | 如果你使用自签名证书可忽略此步骤。 33 | 34 | 请准备以下文件: 35 | 36 | 1. 已签发的证书,例如 **_domain.crt_**。 37 | 2. 签发证书的中级 CA,可从签发机构网站下载。例如 **_ca.crt_**。 38 | 3. 已签发证书对应的私钥,例如 **_domain.key_**。 39 | 40 | 后续示例均将使用 **_domain.crt_**, **_ca.crt_**, **_domain.key_** 作为示例名。 41 | 42 | 如果你使用`Nginx`反向代理, 使用任意编辑器打开 **_domain.crt_** 与 **_ca.crt_** , 并将 **_ca.crt_** 的内容复制到 **_domain.crt_** 文件最下方。 43 | 44 | ## 准备反向代理配置文件 45 | 46 | 在开始前请确保以下文件及配置准备完毕,可根据实际情况调整: 47 | 48 | 1. 已配置好的证书链文件及路径: `/etc/nginx/ssl/domain.crt`。 49 | 2. 已签发证书对应的私钥及路径: `/etc/nginx/ssl/domain.key`。 50 | 3. Nginx 配置文件位置: `/etc/nginx/nginx.conf`。 51 | 4. 未开启 SSL 的节点地址及端口: `127.0.0.1:24444`。 52 | 5. 未开启 SSL 的面板地址及端口: `127.0.0.1:23333`。 53 | 6. 即将开启的节点 HTTPS 端口: `12444`。 54 | 7. 即将开启的面板 HTTPS 端口: `12333`。 55 | 8. [***如使用域名***] 域名已正确解析到 IP。 56 | 9. 防火墙或端口映射已放行端口`12444`与`12333`。 57 | 58 | ## 为节点开启反向代理 59 | 60 | 以下为示例配置,你可根据实际情况更改端口或调整配置。\ 61 | 更改完成后保存为`daemon_https.conf`文件并放入`/etc/nginx/sites-enabled`目录.\ 62 | 你也可以将配置直接放入`nginx.conf`文件末尾(最后一个大括号前)。\ 63 | 如果你有多个节点,只需以不同的端口与地址重复添加下列配置即可。 64 | 65 | ```nginx 66 | # MCSManager 守护节点 67 | server { 68 | # 节点 公网HTTPS端口(可用多个listen监听多个端口) 69 | listen 12444 ssl http2; #IPV4 70 | listen [::]:12444 ssl http2; #IPv6 71 | 72 | # 开启HSTS 开启后将强制使用HTTPS连接节点并在取消此策略后持续一年除非在浏览器手动清除策略。 73 | # 默认未开启,可取消注释开启. 74 | #add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; 75 | 76 | # DNS服务器,仅在目标节点需要使用域名连接时需要。 77 | resolver 8.8.8.8; 78 | 79 | # 自动重定向HTTP连接至HTTPS 80 | error_page 497 https://$host:$server_port$request_uri; 81 | 82 | proxy_hide_header Upgrade; 83 | location / { 84 | # 请求头 一般无需更改 85 | proxy_set_header Host $host; 86 | proxy_set_header X-Real-Ip $remote_addr; 87 | proxy_set_header X-Forwarded-For $remote_addr; 88 | proxy_set_header REMOTE-HOST $remote_addr; 89 | 90 | #目标节点的地址与端口。支持使用域名及https连接。 91 | proxy_pass http://127.0.0.1:24444; 92 | 93 | # 支持反代 WebSocket 94 | proxy_set_header Upgrade $http_upgrade; 95 | proxy_set_header Connection "upgrade"; 96 | 97 | # 最大文件上传大小限制。设置0为不限制 98 | client_max_body_size 0; 99 | 100 | # 关闭缓存 101 | proxy_request_buffering off; 102 | proxy_buffering off; 103 | } 104 | # HTTPS 证书与私钥位置 105 | ssl_certificate /etc/nginx/ssl/domain.crt; 106 | ssl_certificate_key /etc/nginx/ssl/domain.key; 107 | 108 | # 传输时默认开启gzip压缩 109 | gzip on; 110 | 111 | # 传输时会被压缩的类型(应当依据文件压缩效果添加) 112 | gzip_types text/plain text/css application/javascript application/xml application/json; 113 | 114 | # 反向代理时,启用压缩 115 | gzip_proxied any; 116 | 117 | # 传输时压缩等级,等级越高压缩消耗CPU越多,最高9级,通常5级就够了 118 | gzip_comp_level 5; 119 | 120 | # 传输时大小达到1k才压缩,压缩小内容无意义 121 | gzip_min_length 1k; 122 | 123 | # intermediate configuration 124 | ssl_protocols TLSv1.2 TLSv1.3; 125 | ssl_ecdh_curve X25519:prime256v1:secp384r1; 126 | ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305; 127 | ssl_prefer_server_ciphers off; 128 | # see also ssl_session_ticket_key alternative to stateful session cache 129 | ssl_session_timeout 1d; 130 | } 131 | ``` 132 | 133 | ## 为面板开启反向代理 134 | 135 | 以下为示例配置,你可根据实际情况更改端口或调整配置。\ 136 | 更改完成后保存为`web_https.conf`文件并放入`/etc/nginx/sites-enabled`目录。\ 137 | 你也可以将配置直接放入`nginx.conf`文件末尾(最后一个大括号前)。 138 | 139 | ```nginx 140 | # MCSManager 面板 141 | server { 142 | # 面板端公网HTTPS端口(可用多个listen监听多个端口) 143 | listen 12333 ssl http2; #IPV4 144 | listen [::]:12333 ssl http2; #IPv6 145 | 146 | # 开启HSTS 开启后将强制使用HTTPS连接面板并在取消此策略后持续一年除非在浏览器手动清除策略。 147 | # 默认未开启,可取消注释开启. 148 | #add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; 149 | 150 | # 自动重定向HTTP连接至HTTPS 151 | error_page 497 https://$host:$server_port$request_uri; 152 | 153 | proxy_hide_header Upgrade; 154 | location / { 155 | # 请求头 一般无需更改 156 | proxy_set_header Host $host; 157 | proxy_set_header X-Real-Ip $remote_addr; 158 | proxy_set_header X-Forwarded-For $remote_addr; 159 | proxy_set_header REMOTE-HOST $remote_addr; 160 | 161 | #目标面板的地址与端口。支持使用域名及https连接。 162 | proxy_pass http://127.0.0.1:23333; 163 | 164 | # 支持反代 WebSocket 165 | proxy_set_header Upgrade $http_upgrade; 166 | proxy_set_header Connection "upgrade"; 167 | 168 | # 最大文件上传大小限制。设置0为不限制 169 | client_max_body_size 0; 170 | 171 | # 关闭缓存 172 | proxy_request_buffering off; 173 | proxy_buffering off; 174 | 175 | # 仅允许客户端使用 HTTPS 发送 Cookie 176 | proxy_cookie_flags ~ secure; 177 | } 178 | 179 | # HTTPS 证书与私钥位置 180 | ssl_certificate /etc/nginx/ssl/domain.crt; 181 | ssl_certificate_key /etc/nginx/ssl/domain.key; 182 | 183 | # 传输时默认开启gzip压缩 184 | gzip on; 185 | 186 | # 传输时会被压缩的类型(应当依据文件压缩效果添加) 187 | gzip_types text/plain text/css application/javascript application/xml application/json; 188 | 189 | # 反向代理时,启用压缩 190 | gzip_proxied any; 191 | 192 | # 传输时压缩等级,等级越高压缩消耗CPU越多,最高9级,通常5级就够了 193 | gzip_comp_level 5; 194 | 195 | # 传输时大小达到1k才压缩,压缩小内容无意义 196 | gzip_min_length 1k; 197 | 198 | # intermediate configuration 199 | ssl_protocols TLSv1.2 TLSv1.3; 200 | ssl_ecdh_curve X25519:prime256v1:secp384r1; 201 | ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305; 202 | ssl_prefer_server_ciphers off; 203 | # see also ssl_session_ticket_key alternative to stateful session cache 204 | ssl_session_timeout 1d; 205 | } 206 | ``` 207 | 208 | ## 确认反向代理生效 209 | 210 | 当你完成上述配置添加后,可以使用命令`sudo nginx -t`来测试配置是否存在问题。 211 | 212 | ```log 213 | nginx: the configuration file /etc/nginx/nginx.conf syntax is ok 214 | nginx: configuration file /etc/nginx/nginx.conf test is successful 215 | ``` 216 | 217 | 测试成功后使用命令`sudo nginx -s reload` 来使 Nginx 配置生效。 218 | 219 | ```log 220 | 2024/01/27 22:57:17 [notice] 4826#4826: signal process started 221 | ``` 222 | 223 | 假如域名是 **_domain.com_** ,反向代理后的端口是`12333`与`12444`,那么浏览器需要使用这个地址访问: 224 | 225 | ```txt 226 | 面板地址: https://domain.com:12333/ 227 | 节点地址: https://domain.com:12444/ 228 | ``` 229 | 230 | 使用节点地址通过浏览器访问。如果你看到网页显示下列内容,则节点反代已正确配置。 231 | 232 | > [MCSManager Daemon] Status: OK | reference: https://mcsmanager.com/ 233 | 234 | 使用面板地址通过浏览器访问。如果你看到网页显示出 MCSManager 登陆页面,则面板反代已正确配置。 235 | 236 | ## 配置 MCSM 使用 HTTPS 连接 237 | 238 | 此时如果你访问网页,你会发现你可以登录并且使用面板。 239 | 240 | **但是** 241 | 242 | 如果你进入实例控制台界面,上传文件,下载文件等,就会发现依然**无法正常使用**,这是因为 MCSManager 要求浏览器能够直接连接到远程节点,由于你升级到了 HTTPS,导致浏览器**拒绝**使用 Websocket+HTTP 协议连接远程节点! 243 | 244 | > [为什么浏览器要连接远程节点?](mcsm_network) 245 | 246 | 进入`节点管理`,你会发现可能是使用 `localhost`,`123.x.x.x` 或其他域名连接到远程节点的,此时你必须要给每一个远程节点**分别配置一次反向代理**,让它们全部使用 HTTPS+Websocket 连接。 247 | 248 | 配置完成后,使用 `wss://localhost`,`wss://123.x.x.x` 或 `wss://domain.com` 替换原有的`localhost`,`123.x.x.x` 或 `domain.com`即可。 249 | -------------------------------------------------------------------------------- /zh_cn/setup_any_software.md: -------------------------------------------------------------------------------- 1 | # 其他使用场景 2 | 3 | ## 还能做些什么? 4 | 5 | 想必你已经用 MCSManager 部署过至少一个应用程序,此时你是否在想还能不能部署一些其他的应用程序? 6 | 7 | 很显然,这是可以的,你可以在 MCSManager 上运行任何 Docker 镜像,比如 `mysql:8`。你也可以在不依靠 Docker 启动 `cmd.exe` `bash` 等命令,就像一个 `SSH 客户端` 一样。 8 | 9 | 简而言之,你可以在 MCSManager 上部署任何应用程序! 10 | -------------------------------------------------------------------------------- /zh_cn/setup_bedrock_edition.md: -------------------------------------------------------------------------------- 1 | # 搭建 Minecraft 基岩版服务器 2 | 3 | ## 环境要求 4 | 5 | `Linux` 建议使用较新版本的 Linux 发行版,否则容易出现环境不兼容导致无法启动,建议使用 `Ubuntu 22.04` 及以上版本。 6 | 7 | `Windows` 端建议使用 `Windows server 2016`,`Windows 10` 及以上版本。 8 | 9 | ## Windows 版本 10 | 11 | ### 获取服务端 12 | 13 | 最新的官方基岩版服务端可在 [Minecraft 基岩版官网](https://www.minecraft.net/zh-hans/download/server/bedrock) 获取。 14 | 15 | 若想要获取较老版本的服务端,请到第三方论坛 [MineBBS](https://www.minebbs.com/bds/history) 寻找对应版本的服务端。 16 | 17 | ### 通过面板启动 18 | 19 | - 进入面板,进入 `应用实例` 菜单。 20 | - 点击`新建示例`并选择 Minecraft 基岩版版游戏服务器。 21 | - 选择需部署的节点。 22 | - 填写信息,启动命令填写 `bedrock_server.exe`。 23 | - `bedrock_server.exe` 为服务端文件名称。 24 | - 上传你下载的 官方基岩版 Windows 版本服务端压缩包。 25 | - 等待上传并解压完毕,进入控制台。 26 | - 点击控制台右上操作键开启实例即可。 27 | 28 | ### 出现提示框提示 `未找到 xxx.dll` 或 `启动失败` ? 29 | 30 | 请从安全的渠道下载 Microsoft VC++ 运行库文件进行安装,补全运行环境。 31 | 32 | ## Linux 版 33 | 34 | ### 下载服务端软件 35 | 36 | 最新的官方基岩版服务端可在 [Minecraft 基岩版官网](https://www.minecraft.net/zh-hans/download/server/bedrock) 获取。 37 | 38 | 若想要获取较老版本的服务端,请到第三方论坛 [MineBBS](https://www.minebbs.com/bds/history) 寻找对应版本的服务端。 39 | 40 | ### 通过面板启动 41 | 42 | - 进入面板,进入 `应用实例` 菜单。 43 | - 选择 Minecraft 基岩版版游戏服务器。 44 | - 选择需部署的节点,选择上传服务端文件压缩包。 45 | - 填写信息,启动命令填写 `./bedrock_server`,`bedrock_server` 为服务端文件名称,具体请视情况而定。 46 | - 上传你下载的官方基岩版 Ubuntu 版本服务端压缩包。 47 | - 等待上传并解压完毕,进入控制台。 48 | - 点击控制台右上操作键开启实例即可。 49 | 50 | ### 无法成功启动? 51 | 52 | ``` 53 | [MCSMANAGER] [错误] 实例启动失败,请检查启动命令,主机环境和配置文件等 54 | ``` 55 | 56 | 出现这类问题的原因有很多种,目前已知**三种**情况: 57 | 58 | 1. 启动命令编写错误。 59 | 2. 服务端程序没有运行权限。 60 | 3. Ubuntu 系统环境缺少必要的依赖。 61 | 62 | **第一种** 63 | 64 | 错误解决方案:填写正确的启动命令 65 | 66 | ```bash 67 | ./bedrock_server 68 | # bedrock_server 为服务端名称,或者你可以选择创建一个 sh 脚本文件,写入启动命令 sh <你的脚本名字>.sh 69 | ``` 70 | 71 | **第二种**和**第三种**错误具体表现为: 72 | 73 | ``` 74 | [MCSMANAGER] [ERROR] 检测到实例进程/容器启动失败(PID 为空),其可能的原因是: 75 | 1. 实例启动命令编写错误,请前往实例设置界面检查启动命令与参数。 76 | 2. 系统主机环境不正确或缺少环境,如 Java 环境等。 77 | 78 | 原生启动命令: 79 | ./bedrock_server 80 | 81 | 请将此信息报告给管理员,技术人员或自行排查故障。 82 | 83 | 84 | [MCSMANAGER] [错误] 实例启动失败,请检查启动命令,主机环境和配置文件等 85 | ``` 86 | 87 | 如果你是**面板服务器管理者**,请检查**服务端**文件是否给予了 755 权限,如未给予则请前往面板文件管理中给予,如果给予了权限,启动依旧报错,请检查服务端文件是否完整正确下载。 88 | 89 | 如果提示依赖报错,请尝试重装 Ubuntu 系统或升级 Ubuntu 系统版本,重装后还是报同错误,请将错误输出复制到百度,自行搜索解决方案。 90 | 91 | ### 启动正常,但无法进入游戏服务器? 92 | 93 | 这种情况多半是**安全组没放行**,请在**服务商安全组面板放行你的服务端端口**,并在**系统防火墙**一并放行。 如果还是无法连接,请联系你的服务商检查网络情况。 94 | -------------------------------------------------------------------------------- /zh_cn/setup_docker_image.md: -------------------------------------------------------------------------------- 1 | # 使用 Docker 镜像部署游戏服务器 2 | 3 | ## 选择一个镜像 4 | 5 | 你可以使用在 [https://hub.docker.com/](https://hub.docker.com/) 能搜索到的任何镜像。 6 | 7 | 列如 `mysql:8.3.0`,`cm2network/csgo:latest`,`jammsen/palworld-dedicated-server` 等比较主流的镜像。 8 | 9 | 你也可以使用 `Dockerfile` 来自己构建一个属于自己的镜像。 10 | 11 | ## 使用镜像 12 | 13 | 在 MCSManager 中选择 `新建实例`,选择 `使用 Docker 镜像`,接下来只需要按照界面上的提示,填写相关的参数即可。 14 | 15 | 创建后,可以直接启动实例,不必提前 `docker pull` 镜像,MCSManager 会自动识别镜像是否存在,并且在启动前提前拉取镜像。 16 | 17 | 18 | 19 | :::tip 20 | 如果你的服务器在中国大陆地区,你可能需要配置中国 Docker 镜像源,否则将极大的影响你的镜像下载速度。 21 | ::: 22 | -------------------------------------------------------------------------------- /zh_cn/setup_java_edition.md: -------------------------------------------------------------------------------- 1 | # 搭建 Minecraft Java 版服务器 2 | 3 | :::tip 4 | 本章节已默认你配置好了 Java 环境,如果没有请参考「一键搭建 Java 版」前半部分章节。 5 | ::: 6 | 7 | ## 下载服务端软件 8 | 9 | 部署服务器的本质其实和你在手机上运行 APP 的操作一致,你需要一个服务端软件(又称服务器核心)来实现 Minecraft 服务器部署。 10 | 11 | 这里我们使用 Paper 服务端软件来做示例,以下是一些常见版本: 12 | 13 | - [1.18.2](https://api.papermc.io/v2/projects/paper/versions/1.18.2/builds/388/downloads/paper-1.18.2-388.jar) 14 | - [1.19.4](https://api.papermc.io/v2/projects/paper/versions/1.19.4/builds/524/downloads/paper-1.19.4-524.jar) 15 | - [1.20.4](https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/389/downloads/paper-1.20.4-389.jar) 16 | 17 | > 更多版本:https://papermc.io/downloads 18 | 19 | 20 | 21 | ## 使用面板部署 22 | 23 | 点击顶部 `应用实例` 按钮,选择 `Minecraft Java 版游戏服务器` ,选择需要部署的 `节点`,选择 `上传单个服务端软件` ,上传你下载的 `jar` 格式文件。 24 | 25 | 在实例 `启动命令` 处填写: 26 | 27 | ```bash 28 | java -Dfile.encoding=UTF-8 -jar "刚刚下载的jar文件名,例如:paper-1.19.4-516.jar" 29 | ``` 30 | 31 | :::tip 32 | 启动命令还有更多有趣的玩法,后续你可以自己探索。 33 | ::: 34 | 35 | 36 | 37 | ## 启动服务器 38 | 39 | 在创建完毕后对页面进入 `实例控制台` 或点击顶部的 `应用实例`,再点击应用实例进入并启动它。 40 | 41 | 最后,你的服务器应该会正常运行。 42 | 43 | 44 | 45 | ## 同意 EULA 协议 46 | 47 | 第一次启动很有可能会启动失败,会有类似于 `EULA` 等字样的错误,这个是你需要更改一个 `txt` 文件来代表你同意最终用户协议。 48 | 49 | 点击功能组的 `服务端配置文件` 选项,将 `eula.txt` 的选项从 `否` 改为 `是`,保存文件 50 | -------------------------------------------------------------------------------- /zh_cn/setup_package.md: -------------------------------------------------------------------------------- 1 | # 一键搭建 Minecraft Java 版服务器 2 | 3 | ## 安装 Java 环境 4 | 5 | 在开始运行 Java 服务端之前 Java 运行库是必不可少的,以下是一些 `Minecraft` 不同版本所需的对应的 Java 版本运行库列表: 6 | 7 | | 需要的 Java 版本 | Minecraft 游戏版本 | 8 | | ---------------- | :---------------------------------------------------------: | 9 | | Java8 | 1.7.x,1.8.x,1.9.x,1.10.x,1.12.x,1.13.x,1.15.x,1.16.x | 10 | | Java16&Java17 | 1.17.x | 11 | | Java17 | 1.18.x | 12 | | Java17 及更高 | 1.18.x&1.19.x&1.20.x | 13 | 14 | :::tip 15 | 如果你使用 17 更高版本,请不要使用 Java 20 版本,可能存在兼容性问题。 16 | 17 | 你始终应该查看自己的插件支持哪些 Java 版本再做出抉择,如果插件没有声明,请询问插件开发者,以免引起不必要的麻烦。 18 | ::: 19 | 20 | ### Windows 版下载 21 | 22 | - [(Oracle) Java JDK 8](https://repo.huaweicloud.com/java/jdk/8u202-b08/jdk-8u202-windows-x64.exe) 23 | - [(Azul) Java JDK 11](https://cdn.azul.com/zulu/bin/zulu11.62.17-ca-jdk11.0.18-win_x64.msi) 24 | - [(Oracle) Java JDK 17](https://download.oracle.com/java/17/latest/jdk-17_windows-x64_bin.exe) 25 | 26 | > Java16 以及更高版本仅可以在 64 位系统上运行。 27 | 28 | ## 使用预制包一键开服 29 | 30 | :::tip 31 | 请确保你已成功安装 Java 版本,使用 java -version 命令可以确认是否安装成功。 32 | ::: 33 | 34 | - 点击顶部菜单栏的 `应用实例` 并新建一个应用实例。 35 | - 选择 Minecraft Java 版游戏服务器。 36 | - 选择需部署的节点,选择 Minecraft 快速部署。 37 | - 选择一个你需要的整合包,点击安装,输入实例名称。 38 | - 等待安装完毕后进入实例控制台。 39 | - 点击右上操作键开启服务器。 40 | 41 | 随后,启动 Minecraft 服务器,如果看见如下信息代表启动成功: 42 | 43 |  44 | -------------------------------------------------------------------------------- /zh_cn/setup_steam.md: -------------------------------------------------------------------------------- 1 | # 搭建 Steam 游戏服务器 2 | 3 | :::tip 4 | 如果你是 Linux 服务器,我们推荐你使用 Docker 镜像来部署你的 Steam 游戏服务器,请参考「使用 Docker 镜像部署」章节。 5 | ::: 6 | 7 | ## 下载 Steam 服务器程序 8 | 9 | 无论你是想架设 `Palworld`,`CSGO2`,`ARK` 还是其他 Steam 游戏,官方提供的 `SteamCMD` 命令行工具都可以帮助你快速建立 Steam 游戏服务器,MCSManager 面板也依赖它来运行 Steam 游戏服务器。 10 | 11 | - [下载 Windows 版 SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD#Windows) 12 | 13 | - [下载 Linux 版 SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD#Linux) 14 | 15 | ## 新建实例 16 | 17 | - 前往 `应用实例` 功能新增一个实例。 18 | - 选择新增类型为 Steam 游戏服务器。 19 | - 选择 `无需额外文件`。 20 | - 启动命令请根据 Steam 游戏的官方文档来配置。 21 | - 创建成功 22 | 23 | ## 获取部署命令 24 | 25 | 每一款 Steam 游戏都有一个 `APP ID`,你需要获取到这个 ID,并且编写如下命令: 26 | 27 | ```bash 28 | "" +force_install_dir "{mcsm_workspace}" +login anonymous "+app_update validate" +quit 29 | ``` 30 | 31 | 列如: 32 | 33 | ```bash 34 | "C:/SteamCMD/steamcmd.exe" +force_install_dir "{mcsm_workspace}" +login anonymous "+app_update 380870 validate" +quit 35 | ``` 36 | 37 | ## 设置到 MCSManager 38 | 39 | 将刚刚 `steamcmd...` 命令写到 MCSManager `实例设置` 的 `更新命令`,在 `控制台` 网页中找到 `更新` 按钮即可运行此命令,从而安装你的 Steam 游戏服务器。 40 | 41 | 最后,根据你选择的游戏服务器架设介绍,填写服务器启动命令,轻点 `开启` 按钮,即可运行你的 Steam 游戏服务器。 42 | 43 | ## 常见问题 44 | 45 | ### 启动命令是什么? 46 | 47 | 不同的 Steam 游戏启动命令都有不同,你应该前往此游戏服务器架设说明文档,或其他人开服介绍文章,参考里面的内容填写启动命令。 48 | 49 | ### 启动成功,但输入命令无效且终端上没有输出 50 | 51 | 可能是此 Steam 游戏服务器程序不支持程序的标准输入流,你可以使用 MCSManager 提供的 `RCON 协议` 来给服务器发送命令,在终端控制台右下角有一个 `RCON 协议` 选项按钮。 52 | 53 | 如果 `RCON 协议` 都无法成功发送命令,那么可能 `MCSManager` 对此类型的 Steam 游戏服务器不支持。 54 | 55 | 可以尝试使用 `Linux + Docker` 组合来架设你的 Steam 服务器,这种兼容性通常是最高的。 56 | --------------------------------------------------------------------------------
购买此处推广位