From a38e7c6e8cb4bdd323dae1302f576b2a8d4e938d Mon Sep 17 00:00:00 2001 From: BlueFunny_ Date: Mon, 28 Nov 2022 12:19:52 +0800 Subject: [PATCH 001/463] Optimize the installation process --- deb/src/DEBIAN/preinst.sh | 41 +++++++++++++++++---------------------- deb_setup.sh | 39 ++++++++++++++++--------------------- setup.sh | 10 ++++++++++ 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/deb/src/DEBIAN/preinst.sh b/deb/src/DEBIAN/preinst.sh index ad9706d..af99458 100644 --- a/deb/src/DEBIAN/preinst.sh +++ b/deb/src/DEBIAN/preinst.sh @@ -100,24 +100,8 @@ CheckMCSM() { # Switch to update mode installMode="upgrade" - # Prepare for backup old data - mkdir -p /tmp/mcsmanager/data - - # A little easteregg - # Maybe you wanna play Inscryption? - LEcho cyan "[-] 正在将 旧数据 打包并移动至临时文件夹..." "[-] Packing and moving old data to temporary folder..." - - # Backup old data - if [ -d ${mcsmOldPath}/daemon/data ]; then - mv -f ${mcsmOldPath}/daemon/data /tmp/mcsmanager/data/daemon - else - LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - fi - if [ -d ${mcsmOldPath}/web/data ]; then - mv -f ${mcsmOldPath}/web/data /tmp/mcsmanager/data/web - else - LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - fi + # Move old MCSM to backup path + mv -f ${mcsmOldPath} ${mcsmOldPath}.bak # Remove old service if [ -f /etc/systemd/system/mcsm-daemon.service ]; then @@ -242,10 +226,11 @@ Install() { # Check install mode if [ "${installMode}" == "upgrade" ]; then - LEcho cyan "[-] 正在移动旧数据..." "[-] Moving old data..." - mv -f /tmp/mcsmanager/data/daemon ${mcsmPath}/daemon/data || LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - mv -f /tmp/mcsmanager/data/web ${mcsmPath}/web/data || LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - rm -rf /tmp/mcsmanager + mv -f ${mcsmOldPath}.bak/daemon/data/ ${mcsmPath}/daemon/data/ + mv -f ${mcsmOldPath}.bak/web/data/ ${mcsmPath}/web/data/ + if [ ! -d ${mcsmPath}/daemon/data/ ] || [ ! -d ${mcsmPath}/web/data/ ]; then + LEcho yellow "[!] 部分数据迁移失败, 您可能需要到 ${mcsmOldPath}.bak 手动进行迁移" "[!] Some data migration failed, you may need to manually migrate to ${mcsmOldPath}.bak" + fi LEcho green "[√] 数据迁移完成" "[√] Data migration completed" fi return @@ -271,6 +256,16 @@ Clean() { if [ -d "${mcsmPath}" ]; then rm -rf "${mcsmPath}" fi + + # Check install mode + if [ ${mcsmOldPath} == "upgrade" ]; then + LEcho cyan "[-] 检测到旧版 MCSManager 备份, 自动恢复中" "[-] Old version of MCSManager backup detected, automatic recovery" + if ! mv -f ${mcsmOldPath}.bak ${mcsmOldPath}; then + LEcho yellow "[!] 旧版 MCSManager 备份文件移动失败, 请手动移动 ${mcsmOldPath}.bak 至 ${mcsmOldPath}" "[!] Old version of MCSManager backup file move failed, please manually move ${mcsmOldPath}.bak to ${mcsmOldPath}" + else + rm -rf ${mcsmOldPath}.bak + fi + fi return } @@ -293,4 +288,4 @@ LEcho cyan "+------------------------------------------------------------------- ## Try to cheat APT Init Install -exit 0 \ No newline at end of file +exit 0 diff --git a/deb_setup.sh b/deb_setup.sh index 0f2cfe4..1570c0f 100644 --- a/deb_setup.sh +++ b/deb_setup.sh @@ -164,24 +164,8 @@ CheckMCSM() { # Switch to update mode installMode="upgrade" - # Prepare for backup old data - mkdir -p /tmp/mcsmanager/data - - # A little easteregg - # Maybe you wanna play Inscryption? - LEcho cyan "[-] 正在将 旧数据 打包并移动至临时文件夹..." "[-] Packing and moving old data to temporary folder..." - - # Backup old data - if [ -d ${mcsmOldPath}/daemon/data ]; then - mv -f ${mcsmOldPath}/daemon/data /tmp/mcsmanager/data/daemon - else - LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - fi - if [ -d ${mcsmOldPath}/web/data ]; then - mv -f ${mcsmOldPath}/web/data /tmp/mcsmanager/data/web - else - LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - fi + # Move old MCSM to backup path + mv -f ${mcsmOldPath} ${mcsmOldPath}.bak # Remove old service if [ -f /etc/systemd/system/mcsm-daemon.service ]; then @@ -306,10 +290,11 @@ Install() { # Check install mode if [ "${installMode}" == "upgrade" ]; then - LEcho cyan "[-] 正在移动旧数据..." "[-] Moving old data..." - mv -f /tmp/mcsmanager/data/daemon ${mcsmPath}/daemon/data || LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - mv -f /tmp/mcsmanager/data/web ${mcsmPath}/web/data || LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - rm -rf /tmp/mcsmanager + mv -f ${mcsmOldPath}.bak/daemon/data/ ${mcsmPath}/daemon/data/ + mv -f ${mcsmOldPath}.bak/web/data/ ${mcsmPath}/web/data/ + if [ ! -d ${mcsmPath}/daemon/data/ ] || [ ! -d ${mcsmPath}/web/data/ ]; then + LEcho yellow "[!] 部分数据迁移失败, 您可能需要到 ${mcsmOldPath}.bak 手动进行迁移" "[!] Some data migration failed, you may need to manually migrate to ${mcsmOldPath}.bak" + fi LEcho green "[√] 数据迁移完成" "[√] Data migration completed" fi LEcho cyan "[-] 正在注册系统服务..." "[-] Registering system service..." @@ -420,6 +405,16 @@ Clean() { if [ -d "${mcsmPath}" ]; then rm -rf "${mcsmPath}" fi + + # Check install mode + if [ ${mcsmOldPath} == "upgrade" ]; then + LEcho cyan "[-] 检测到旧版 MCSManager 备份, 自动恢复中" "[-] Old version of MCSManager backup detected, automatic recovery" + if ! mv -f ${mcsmOldPath}.bak ${mcsmOldPath}; then + LEcho yellow "[!] 旧版 MCSManager 备份文件移动失败, 请手动移动 ${mcsmOldPath}.bak 至 ${mcsmOldPath}" "[!] Old version of MCSManager backup file move failed, please manually move ${mcsmOldPath}.bak to ${mcsmOldPath}" + else + rm -rf ${mcsmOldPath}.bak + fi + fi return } diff --git a/setup.sh b/setup.sh index c0c6aa4..5402ff3 100644 --- a/setup.sh +++ b/setup.sh @@ -49,6 +49,16 @@ Install_Node() { tar -zxf node-"$node"-linux-"$arch".tar.gz rm -rf node-"$node"-linux-"$arch".tar.gz + + if [ ! -L /usr/bin/node ] && [ ! -f /usr/bin/node ];then + ln -s "$node_install_path"/bin/node /usr/bin/node + fi + if [ ! -L /usr/bin/npm ] && [ ! -f /usr/bin/npm ];then + ln -s "$node_install_path"/bin/npm /usr/bin/npm + fi + + chmod +x "$node_install_path"/bin/node + chmod +x "$node_install_path"/bin/npm if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] then From d31a23cc4e7c53e1de38c5fde5ac987641aa8091 Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 12 Dec 2022 16:09:53 +0800 Subject: [PATCH 002/463] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4878d4b..96d303e 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,9 @@ The files here are all platform-wide install, delete, update scripts, etc. for M The default installation script on the official website is the `setup_en.sh` file of this repository. -Contains multiple languages. +English: [setup_en.sh](setup_en.sh) + +Chinese: [setup.sh](setup.sh) +
From 5199e0bcad6c601c32e547d46a5d701654fd1f67 Mon Sep 17 00:00:00 2001 From: YaoSiQian <2229561981@qq.com> Date: Tue, 17 Jan 2023 02:00:56 +0800 Subject: [PATCH 003/463] Cloning Simplify --- deb/pack/amd64/DEBIAN/preinst | 6 ++---- deb/pack/arm/DEBIAN/preinst | 6 ++---- deb/pack/arm64/DEBIAN/preinst | 6 ++---- deb/pack/i386/DEBIAN/preinst | 6 ++---- deb/pack/ppc64le/DEBIAN/preinst | 6 ++---- deb/pack/s390x/DEBIAN/preinst | 6 ++---- deb/src/DEBIAN/preinst.sh | 6 ++---- deb_setup.sh | 6 ++---- setup.sh | 10 ++-------- setup_en.sh | 10 ++-------- 10 files changed, 20 insertions(+), 48 deletions(-) diff --git a/deb/pack/amd64/DEBIAN/preinst b/deb/pack/amd64/DEBIAN/preinst index 7a8cac7..4ae8dc6 100644 --- a/deb/pack/amd64/DEBIAN/preinst +++ b/deb/pack/amd64/DEBIAN/preinst @@ -212,13 +212,11 @@ Install() { # Download MCSM Daemon LEcho echo "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon + git clone --single-branch -b master --depth 1 ${daemonCloneURL} daemon # Download MCSM Web LEcho echo "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web + git clone --single-branch -b master --depth 1 ${webCloneURL} web # Install MCSM Daemon LEcho echo "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." diff --git a/deb/pack/arm/DEBIAN/preinst b/deb/pack/arm/DEBIAN/preinst index 7a8cac7..4ae8dc6 100644 --- a/deb/pack/arm/DEBIAN/preinst +++ b/deb/pack/arm/DEBIAN/preinst @@ -212,13 +212,11 @@ Install() { # Download MCSM Daemon LEcho echo "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon + git clone --single-branch -b master --depth 1 ${daemonCloneURL} daemon # Download MCSM Web LEcho echo "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web + git clone --single-branch -b master --depth 1 ${webCloneURL} web # Install MCSM Daemon LEcho echo "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." diff --git a/deb/pack/arm64/DEBIAN/preinst b/deb/pack/arm64/DEBIAN/preinst index 7a8cac7..4ae8dc6 100644 --- a/deb/pack/arm64/DEBIAN/preinst +++ b/deb/pack/arm64/DEBIAN/preinst @@ -212,13 +212,11 @@ Install() { # Download MCSM Daemon LEcho echo "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon + git clone --single-branch -b master --depth 1 ${daemonCloneURL} daemon # Download MCSM Web LEcho echo "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web + git clone --single-branch -b master --depth 1 ${webCloneURL} web # Install MCSM Daemon LEcho echo "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." diff --git a/deb/pack/i386/DEBIAN/preinst b/deb/pack/i386/DEBIAN/preinst index 7a8cac7..4ae8dc6 100644 --- a/deb/pack/i386/DEBIAN/preinst +++ b/deb/pack/i386/DEBIAN/preinst @@ -212,13 +212,11 @@ Install() { # Download MCSM Daemon LEcho echo "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon + git clone --single-branch -b master --depth 1 ${daemonCloneURL} daemon # Download MCSM Web LEcho echo "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web + git clone --single-branch -b master --depth 1 ${webCloneURL} web # Install MCSM Daemon LEcho echo "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." diff --git a/deb/pack/ppc64le/DEBIAN/preinst b/deb/pack/ppc64le/DEBIAN/preinst index 7a8cac7..4ae8dc6 100644 --- a/deb/pack/ppc64le/DEBIAN/preinst +++ b/deb/pack/ppc64le/DEBIAN/preinst @@ -212,13 +212,11 @@ Install() { # Download MCSM Daemon LEcho echo "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon + git clone --single-branch -b master --depth 1 ${daemonCloneURL} daemon # Download MCSM Web LEcho echo "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web + git clone --single-branch -b master --depth 1 ${webCloneURL} web # Install MCSM Daemon LEcho echo "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." diff --git a/deb/pack/s390x/DEBIAN/preinst b/deb/pack/s390x/DEBIAN/preinst index 7a8cac7..4ae8dc6 100644 --- a/deb/pack/s390x/DEBIAN/preinst +++ b/deb/pack/s390x/DEBIAN/preinst @@ -212,13 +212,11 @@ Install() { # Download MCSM Daemon LEcho echo "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon + git clone --single-branch -b master --depth 1 ${daemonCloneURL} daemon # Download MCSM Web LEcho echo "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web + git clone --single-branch -b master --depth 1 ${webCloneURL} web # Install MCSM Daemon LEcho echo "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." diff --git a/deb/src/DEBIAN/preinst.sh b/deb/src/DEBIAN/preinst.sh index af99458..41a7edc 100644 --- a/deb/src/DEBIAN/preinst.sh +++ b/deb/src/DEBIAN/preinst.sh @@ -196,13 +196,11 @@ Install() { # Download MCSM Daemon LEcho cyan "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon + git clone --single-branch -b master --depth 1 ${daemonCloneURL} daemon # Download MCSM Web LEcho cyan "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web + git clone --single-branch -b master --depth 1 ${webCloneURL} web # Install MCSM Daemon LEcho cyan "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." diff --git a/deb_setup.sh b/deb_setup.sh index 1570c0f..68d57d9 100644 --- a/deb_setup.sh +++ b/deb_setup.sh @@ -260,13 +260,11 @@ Install() { # Download MCSM Daemon LEcho cyan "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon + git clone --single-branch -b master --depth 1 ${daemonCloneURL} daemon # Download MCSM Web LEcho cyan "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web + git clone --single-branch -b master --depth 1 ${webCloneURL} web # Install MCSM Daemon LEcho cyan "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." diff --git a/setup.sh b/setup.sh index 5402ff3..bc6b8a1 100644 --- a/setup.sh +++ b/setup.sh @@ -113,10 +113,7 @@ Install_MCSManager() { then echo_cyan "[↓] Git 克隆 MCSManager-Daemon..." else echo_cyan "[↓] Git clone MCSManager-Daemon..." fi - git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git - - # echo "[-] mv MCSManager-Daemon-Production daemon" - mv MCSManager-Daemon-Production daemon + git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git daemon # echo "[→] cd daemon" cd daemon || exit @@ -134,10 +131,7 @@ Install_MCSManager() { then echo_cyan "[↓] Git 克隆 MCSManager-Web..." else echo_cyan "[↓] Git clone MCSManager-Web..." fi - git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Web-Production.git - - # echo "[-] mv MCSManager-Web-Production web" - mv MCSManager-Web-Production web + git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Web-Production.git web # echo "[→] cd web" cd web || exit diff --git a/setup_en.sh b/setup_en.sh index dd41f55..90f389e 100644 --- a/setup_en.sh +++ b/setup_en.sh @@ -84,10 +84,7 @@ Install_MCSManager() { cd ${mcsmanager_install_path} || exit echo_cyan "[↓] Git clone MCSManager-Daemon..." - git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Daemon-Production.git - - # echo "[-] mv MCSManager-Daemon-Production daemon" - mv MCSManager-Daemon-Production daemon + git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Daemon-Production.git daemon # echo "[→] cd daemon" cd daemon || exit @@ -99,10 +96,7 @@ Install_MCSManager() { cd .. echo_cyan "[↓] Git clone MCSManager-Web..." - git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Web-Production.git - - # echo "[-] mv MCSManager-Web-Production web" - mv MCSManager-Web-Production web + git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Web-Production.git web # echo "[→] cd web" cd web || exit From 2ec045618c9c0aed5ba82876bbace7750034881b Mon Sep 17 00:00:00 2001 From: BlueFunny_ <53890138+FunnyShadow@users.noreply.github.com> Date: Sat, 21 Jan 2023 11:48:26 +0800 Subject: [PATCH 004/463] Some updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### Scripts - Removed the content about deb (mainly because no one has been using it, I'm too lazy to rewrite it) - Fix encoding and line break issues - Complete refactoring of the main installation script (The old one is kept as `setup_old.sh`) #### Readme - Adding Chinese documentation - Add one-click installation command --- #### 脚本相关 - 删除了所有关于 APT 安装包 (deb) 的内容 (主要是没啥人用它, 我也懒得重写了) - 修复了编码以及换行符的问题 - 完全重构主安装脚本 (旧的保留为 `setup_old.sh`) #### Readme 相关 - 添加了新的中文文档 - 添加了一键安装命令 --- .gitignore | 36 +- LICENSE | 42 +- README.md | 11 +- README_cn.md | 23 + deb/README.md | 15 - deb/pack/amd64/DEBIAN/control | 9 - deb/pack/amd64/DEBIAN/postinst | 129 ------ deb/pack/amd64/DEBIAN/preinst | 280 ------------ deb/pack/amd64/DEBIAN/prerm | 86 ---- deb/pack/arm/DEBIAN/control | 9 - deb/pack/arm/DEBIAN/postinst | 129 ------ deb/pack/arm/DEBIAN/preinst | 280 ------------ deb/pack/arm/DEBIAN/prerm | 86 ---- deb/pack/arm64/DEBIAN/control | 9 - deb/pack/arm64/DEBIAN/postinst | 129 ------ deb/pack/arm64/DEBIAN/preinst | 280 ------------ deb/pack/arm64/DEBIAN/prerm | 86 ---- deb/pack/build.sh | 67 --- deb/pack/i386/DEBIAN/control | 9 - deb/pack/i386/DEBIAN/postinst | 129 ------ deb/pack/i386/DEBIAN/preinst | 280 ------------ deb/pack/i386/DEBIAN/prerm | 86 ---- deb/pack/ppc64le/DEBIAN/control | 9 - deb/pack/ppc64le/DEBIAN/postinst | 129 ------ deb/pack/ppc64le/DEBIAN/preinst | 280 ------------ deb/pack/ppc64le/DEBIAN/prerm | 86 ---- deb/pack/s390x/DEBIAN/control | 9 - deb/pack/s390x/DEBIAN/postinst | 129 ------ deb/pack/s390x/DEBIAN/preinst | 280 ------------ deb/pack/s390x/DEBIAN/prerm | 86 ---- deb/src/DEBIAN/postinst.sh | 165 ------- deb/src/DEBIAN/preinst.sh | 291 ------------ deb/src/DEBIAN/prerm.sh | 86 ---- deb_remove.sh | 86 ---- deb_setup.sh | 442 ------------------ setup.sh | 757 ++++++++++++++++++++----------- setup_old.sh | 371 +++++++++++++++ update_gbk.bat | 92 ++-- 38 files changed, 981 insertions(+), 4527 deletions(-) create mode 100644 README_cn.md delete mode 100644 deb/README.md delete mode 100644 deb/pack/amd64/DEBIAN/control delete mode 100644 deb/pack/amd64/DEBIAN/postinst delete mode 100644 deb/pack/amd64/DEBIAN/preinst delete mode 100644 deb/pack/amd64/DEBIAN/prerm delete mode 100644 deb/pack/arm/DEBIAN/control delete mode 100644 deb/pack/arm/DEBIAN/postinst delete mode 100644 deb/pack/arm/DEBIAN/preinst delete mode 100644 deb/pack/arm/DEBIAN/prerm delete mode 100644 deb/pack/arm64/DEBIAN/control delete mode 100644 deb/pack/arm64/DEBIAN/postinst delete mode 100644 deb/pack/arm64/DEBIAN/preinst delete mode 100644 deb/pack/arm64/DEBIAN/prerm delete mode 100644 deb/pack/build.sh delete mode 100644 deb/pack/i386/DEBIAN/control delete mode 100644 deb/pack/i386/DEBIAN/postinst delete mode 100644 deb/pack/i386/DEBIAN/preinst delete mode 100644 deb/pack/i386/DEBIAN/prerm delete mode 100644 deb/pack/ppc64le/DEBIAN/control delete mode 100644 deb/pack/ppc64le/DEBIAN/postinst delete mode 100644 deb/pack/ppc64le/DEBIAN/preinst delete mode 100644 deb/pack/ppc64le/DEBIAN/prerm delete mode 100644 deb/pack/s390x/DEBIAN/control delete mode 100644 deb/pack/s390x/DEBIAN/postinst delete mode 100644 deb/pack/s390x/DEBIAN/preinst delete mode 100644 deb/pack/s390x/DEBIAN/prerm delete mode 100644 deb/src/DEBIAN/postinst.sh delete mode 100644 deb/src/DEBIAN/preinst.sh delete mode 100644 deb/src/DEBIAN/prerm.sh delete mode 100644 deb_remove.sh delete mode 100644 deb_setup.sh create mode 100644 setup_old.sh diff --git a/.gitignore b/.gitignore index 5d947ca..9067b5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,18 @@ -# Build and Release Folders -bin-debug/ -bin-release/ -[Oo]bj/ -[Bb]in/ - -# Other files and folders -.settings/ - -# Executables -*.swf -*.air -*.ipa -*.apk - -# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` -# should NOT be excluded as they contain compiler settings and other important -# information for Eclipse / Flash Builder. +# Build and Release Folders +bin-debug/ +bin-release/ +[Oo]bj/ +[Bb]in/ + +# Other files and folders +.settings/ + +# Executables +*.swf +*.air +*.ipa +*.apk + +# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` +# should NOT be excluded as they contain compiler settings and other important +# information for Eclipse / Flash Builder. diff --git a/LICENSE b/LICENSE index 431912a..bfd24f9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2021 Suwings - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2021 Suwings + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 4878d4b..732728c 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,18 @@
## What is this? +[中文文档]() The files here are all platform-wide install, delete, update scripts, etc. for MCSManager 9. -The default installation script on the official website is the `setup_en.sh` file of this repository. +The default installation script on the official website is the `setup.sh` file of this repository, it contains multiple languages. -Contains multiple languages. +You can also use the following one-click command to perform a quick installation + +## Installation commands + +```bash + +```
diff --git a/README_cn.md b/README_cn.md new file mode 100644 index 0000000..4ff917d --- /dev/null +++ b/README_cn.md @@ -0,0 +1,23 @@ +MCSManager.png + +
+ +[MCSManager 9 官方网站](http://mcsmanager.com/) + +
+ +## 这是什么? + +这里是 Ubuntu / Debian / CentOS 等 Linux 系系统的 MCSManager 9 安装, 卸载, 升级脚本等的集中存储库 + +官网上默认的安装脚本为本仓库中的 `setup.sh` , 它包含多种语言支持 + +你也可以使用下列一键命令安装 MCSManager 9 + +## 安装命令 + +```bash + +``` + +
diff --git a/deb/README.md b/deb/README.md deleted file mode 100644 index 1312914..0000000 --- a/deb/README.md +++ /dev/null @@ -1,15 +0,0 @@ -此部分主要为 MCSManager 在 Debian/Ubuntu 系统上的发布版的源码 - -本部分分为两个模块, `deb` 和 `src` -`pack`: 编译模块, 此模块内的一级文件夹为架构名称, 编译时除 `一级文件夹\DEBIAN\control` 文件不会改变以外, 其他文件均由 `src` 模块内的所有文件覆盖, 如需编辑源码请见下面的 `src` 模块介绍 -`src`: 源码模块, 此模块内的所有文件在编译阶段会覆盖掉 `pack` 模块内所有文件 - -如果你需要将此部分源码打包成可以直接使用 `apt` 或 `dpkg` 等工具可直接安装的 `deb` 程序包的话, 你需要先安装 `dpkg`, 然后运行以下命令 - -```bash -git clone https://github.com/MCSManager/Script.git -cd Script/deb/pack -bash build.sh -``` - -当显示 `Build complete` 时证明构建已成功, `build.sh` 同文件夹内应该会出现不同架构的 `deb` 程序包 \ No newline at end of file diff --git a/deb/pack/amd64/DEBIAN/control b/deb/pack/amd64/DEBIAN/control deleted file mode 100644 index 14cde5f..0000000 --- a/deb/pack/amd64/DEBIAN/control +++ /dev/null @@ -1,9 +0,0 @@ -Package:MCSManager -Version:9 -Section:stable -Priority:optional -Depends:wget,curl,git,tar,sudo -Suggests:language-pack-zh-hans,fonts-droid-fallback,ttf-wqy-zenhei,ttf-wqy-microhei,fonts-arphic-ukai,fonts-arphic-uming -Architecture:amd64 -Maintainer:unitwk -Description:A multilingual, lightweight, out-of-the-box, and multi-instance Minecraft server control panel with Docker support. diff --git a/deb/pack/amd64/DEBIAN/postinst b/deb/pack/amd64/DEBIAN/postinst deleted file mode 100644 index 56d465a..0000000 --- a/deb/pack/amd64/DEBIAN/postinst +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## Install Mode -if [ -d /tmp/mcsmanager/data ]; then - installMode="upgrade" -else - installMode="install" -fi - -## Other -firewall="" - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho echo "[-] 正在启动 MCSManager..." "[-] Starting MCSManager..." - - # Start MCSM service - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - systemctl start mcsm-daemon.service - systemctl start mcsm-web.service - - # Check MCSM service - if ! systemctl is-active --quiet mcsm-daemon.service || ! systemctl --quiet is-active mcsm-web.service; then - systemctl status mcsm-{web,daemon}.service - LEcho error "[x] MCSManager 启动失败" "[x] MCSManager failed to start" - fi - - # Allow ports - if command -v ufw; then - ufw allow 23333/tcp - ufw allow 24444/tcp - elif command -v iptables-save; then - iptables -A INPUT -p tcp --dport 23333 -j ACCEPT - iptables -A INPUT -p tcp --dport 24444 -j ACCEPT - iptables-save - else - firewall="problem" - fi - - # Output auth information - AuthInfo - return -} - -## Access Information -AuthInfo() { - if [ ${installMode} == "upgrade" ]; then - ip="$(curl -s https://ipconfig.io)" - port=$(cat ${mcsmPath}/web/data/SystemConfig/config.json | grep "httpPort" | tr -cd '0-9') - daemonPort=$(cat ${mcsmPath}/daemon/data/Config/global.json | grep "port" | tr -cd '0-9') - fi - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan "欢迎使用 MCSManager, 您可以通过以下方式访问 MCSManager " "Welcome to MCSManager, you can access it by the following ways" - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan_n "控制面板地址: " "Web Service Address: " - - [ ${installMode} == "upgrade" ] && LEcho cyan "http://${ip}:${port}" "http://${ip}:${port}" - [ ${installMode} == "upgrade" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - [ ${installMode} == "upgrade" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - - [ ${installMode} == "install" ] && LEcho cyan "http://localhost:23333" "http://localhost:23333" - [ ${installMode} == "install" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports 23333 and 24444 to use the service properly on the Internet." - [ ${installMode} == "install" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports 23333 and 24444 to use the service properly on the Internet." - - LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More info: https://docs.mcsmanager.com/" - LEcho cyan "==================================================================" "==================================================================" - return -} - -### Start ### -Start -exit 0 diff --git a/deb/pack/amd64/DEBIAN/preinst b/deb/pack/amd64/DEBIAN/preinst deleted file mode 100644 index 7a8cac7..0000000 --- a/deb/pack/amd64/DEBIAN/preinst +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### - -## Files -mcsmOldPath="/opt/mcsmanager" -mcsmPath="/opt/mcsmanager" -nodePath="${mcsmPath}/node" - -## Node -nodeVersion="18.12.1" -node="${nodePath}/bin/node" -npm="${node} ${nodePath}/bin/npm" - -## Install Mode -installMode="install" - -## URL -daemonCloneURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" -webCloneURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" -nodeMirror="https://npmmirror.com/mirrors/node" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## CDN -CN=0 - -## Other -try=1 - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Init ### -## Check environment -Init() { - LEcho echo "[-] 正在初始化环境..." "[-] Initializing environment..." - - # Check functions - CheckMCSM - CheckCN - CheckNodejs - - LEcho echo "[-] 环境初始化完成" "[-] Environment initialization completed" - return -} - -## Check if MCSM is installed -CheckMCSM() { - if [ -d ${mcsmOldPath} ]; then - LEcho yellow "[-] 检测到已安装的 MCSManager, 切换为更新模式..." "[-] MCSManager has been installed, switching to update mode..." - - # Switch to update mode - installMode="upgrade" - - # Prepare for backup old data - mkdir -p /tmp/mcsmanager/data - - # A little easteregg - # Maybe you wanna play Inscryption? - LEcho echo "[-] 正在将 旧数据 打包并移动至临时文件夹..." "[-] Packing and moving old data to temporary folder..." - - # Backup old data - if [ -d ${mcsmOldPath}/daemon/data ]; then - mv -f ${mcsmOldPath}/daemon/data /tmp/mcsmanager/data/daemon - else - LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - fi - if [ -d ${mcsmOldPath}/web/data ]; then - mv -f ${mcsmOldPath}/web/data /tmp/mcsmanager/data/web - else - LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - fi - - # Remove old service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove old data - if [ -d ${mcsmOldPath} ]; then - rm -rf ${mcsmOldPath} - fi - - # Remove old link - if [ -L /usr/bin/mcsmanager ]; then - rm -f /usr/bin/mcsmanager - fi - fi - - # Prepare for a new install - mkdir -p ${nodePath} - return -} - -## Check if the system is Chinese -CheckCN() { - if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then - LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China" - [ "${zh}" == 1 ] && read -e -r -p "[?] 是否选用中国镜像完成安装? [y/n] " input - [ "${zh}" == 0 ] && read -e -r -p "[?] Whether to use the Chinese mirror to complete the installation? [y/n] " input - case ${input} in - [yY][eE][sS] | [yY]) - LEcho echo "[-] 选用中国镜像" "[-] Use Chinese mirror" - CN=1 - ;; - *) - LEcho echo "[-] 不选用中国镜像" "[-] Do not use Chinese mirror" - ;; - esac - fi - if [ "${CN}" == 1 ]; then - daemonCloneURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" - webCloneURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" - export N_NODE_MIRROR=${nodeMirror} - fi - return -} - -## Check nodejs -CheckNodejs() { - if ! /usr/local/bin/n -V; then - if [ "${CN}" == 1 ]; then - npm i -g n --registry=https://registry.npmmirror.com - else - npm i -g n - fi - fi - while true; do - if /usr/local/bin/n ${nodeVersion} -d || [ ${try} == 3 ]; then - break - else - LEcho yellow "[!] 安装 Node.js ${nodeVersion} 失败, 重试中... (${try}/3)" "[!] Failed to install Node.js ${nodeVersion}, retrying... (${try}/3)" - fi - sleep 3 - try=${try}+1 - done - cp -r /usr/local/n/versions/node/${nodeVersion}/* ${nodePath}/ - /usr/local/bin/n rm ${nodeVersion} - if ! ${node} --version; then - LEcho error "[x] 未能成功安装最新版本 Node.js" "[x] Failed to install the latest version of Node.js" - fi - LEcho echo "=============== Node Version ===============" "=============== Node Version ===============" - LEcho echo "Node 版本: $(${node} --version)" "Node Version: $(${node} --version)" - LEcho echo "NPM 版本: $(${npm} --version)" "NPM Version: $(${npm} --version)" - LEcho echo "============================================" "============================================" - return -} - -### Main ### -## Main Install Function -Install() { - LEcho echo "[-] 正在安装 MCSManager ..." "[-] Installing MCSManager ..." - - # Move to MCSM - cd ${mcsmPath} || LEcho error "[x] 未能成功进入 MCSM 安装目录" "[x] Failed to enter the MCSM installation directory" - - # Download MCSM Daemon - LEcho echo "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon - - # Download MCSM Web - LEcho echo "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web - - # Install MCSM Daemon - LEcho echo "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." - cd daemon || LEcho error "[x] 未能成功进入 MCSM Daemon 安装目录" "[x] Failed to enter the MCSM Daemon installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - # Install MCSM Web - LEcho echo "[+] 正在安装 MCSManager Web..." "[+] Installing MCSManager Web..." - cd ../web || LEcho error "[x] 未能成功进入 MCSM Web 安装目录" "[x] Failed to enter the MCSManager Web installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - LEcho green "[√] MCSManager 安装完成" "[√] MCSManager installation completed" - - # Check install mode - if [ "${installMode}" == "upgrade" ]; then - LEcho echo "[-] 正在移动旧数据..." "[-] Moving old data..." - mv -f /tmp/mcsmanager/data/daemon ${mcsmPath}/daemon/data || LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - mv -f /tmp/mcsmanager/data/web ${mcsmPath}/web/data || LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - rm -rf /tmp/mcsmanager - LEcho green "[√] 数据迁移完成" "[√] Data migration completed" - fi - return -} - -### Other ### -## Clean up -Clean() { - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - return -} - -### Start ### -Init -Install -exit 0 \ No newline at end of file diff --git a/deb/pack/amd64/DEBIAN/prerm b/deb/pack/amd64/DEBIAN/prerm deleted file mode 100644 index 05c41dd..0000000 --- a/deb/pack/amd64/DEBIAN/prerm +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Uninstall Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -### Tools ### -# Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho cyan "[-] 正在卸载 MCSManager..." "[-] Uninstalling MCSManager..." - - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - - LEcho green "[+] MCSManager 卸载成功!" "[+] MCSManager Uninstalled!" - return -} - -### Start ### -Start -exit 0 \ No newline at end of file diff --git a/deb/pack/arm/DEBIAN/control b/deb/pack/arm/DEBIAN/control deleted file mode 100644 index 2eb1a9e..0000000 --- a/deb/pack/arm/DEBIAN/control +++ /dev/null @@ -1,9 +0,0 @@ -Package:MCSManager -Version:9 -Section:stable -Priority:optional -Depends:wget,curl,git,tar,sudo -Suggests:language-pack-zh-hans,fonts-droid-fallback,ttf-wqy-zenhei,ttf-wqy-microhei,fonts-arphic-ukai,fonts-arphic-uming -Architecture:arm -Maintainer:unitwk -Description:A multilingual, lightweight, out-of-the-box, and multi-instance Minecraft server control panel with Docker support. diff --git a/deb/pack/arm/DEBIAN/postinst b/deb/pack/arm/DEBIAN/postinst deleted file mode 100644 index 56d465a..0000000 --- a/deb/pack/arm/DEBIAN/postinst +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## Install Mode -if [ -d /tmp/mcsmanager/data ]; then - installMode="upgrade" -else - installMode="install" -fi - -## Other -firewall="" - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho echo "[-] 正在启动 MCSManager..." "[-] Starting MCSManager..." - - # Start MCSM service - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - systemctl start mcsm-daemon.service - systemctl start mcsm-web.service - - # Check MCSM service - if ! systemctl is-active --quiet mcsm-daemon.service || ! systemctl --quiet is-active mcsm-web.service; then - systemctl status mcsm-{web,daemon}.service - LEcho error "[x] MCSManager 启动失败" "[x] MCSManager failed to start" - fi - - # Allow ports - if command -v ufw; then - ufw allow 23333/tcp - ufw allow 24444/tcp - elif command -v iptables-save; then - iptables -A INPUT -p tcp --dport 23333 -j ACCEPT - iptables -A INPUT -p tcp --dport 24444 -j ACCEPT - iptables-save - else - firewall="problem" - fi - - # Output auth information - AuthInfo - return -} - -## Access Information -AuthInfo() { - if [ ${installMode} == "upgrade" ]; then - ip="$(curl -s https://ipconfig.io)" - port=$(cat ${mcsmPath}/web/data/SystemConfig/config.json | grep "httpPort" | tr -cd '0-9') - daemonPort=$(cat ${mcsmPath}/daemon/data/Config/global.json | grep "port" | tr -cd '0-9') - fi - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan "欢迎使用 MCSManager, 您可以通过以下方式访问 MCSManager " "Welcome to MCSManager, you can access it by the following ways" - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan_n "控制面板地址: " "Web Service Address: " - - [ ${installMode} == "upgrade" ] && LEcho cyan "http://${ip}:${port}" "http://${ip}:${port}" - [ ${installMode} == "upgrade" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - [ ${installMode} == "upgrade" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - - [ ${installMode} == "install" ] && LEcho cyan "http://localhost:23333" "http://localhost:23333" - [ ${installMode} == "install" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports 23333 and 24444 to use the service properly on the Internet." - [ ${installMode} == "install" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports 23333 and 24444 to use the service properly on the Internet." - - LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More info: https://docs.mcsmanager.com/" - LEcho cyan "==================================================================" "==================================================================" - return -} - -### Start ### -Start -exit 0 diff --git a/deb/pack/arm/DEBIAN/preinst b/deb/pack/arm/DEBIAN/preinst deleted file mode 100644 index 7a8cac7..0000000 --- a/deb/pack/arm/DEBIAN/preinst +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### - -## Files -mcsmOldPath="/opt/mcsmanager" -mcsmPath="/opt/mcsmanager" -nodePath="${mcsmPath}/node" - -## Node -nodeVersion="18.12.1" -node="${nodePath}/bin/node" -npm="${node} ${nodePath}/bin/npm" - -## Install Mode -installMode="install" - -## URL -daemonCloneURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" -webCloneURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" -nodeMirror="https://npmmirror.com/mirrors/node" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## CDN -CN=0 - -## Other -try=1 - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Init ### -## Check environment -Init() { - LEcho echo "[-] 正在初始化环境..." "[-] Initializing environment..." - - # Check functions - CheckMCSM - CheckCN - CheckNodejs - - LEcho echo "[-] 环境初始化完成" "[-] Environment initialization completed" - return -} - -## Check if MCSM is installed -CheckMCSM() { - if [ -d ${mcsmOldPath} ]; then - LEcho yellow "[-] 检测到已安装的 MCSManager, 切换为更新模式..." "[-] MCSManager has been installed, switching to update mode..." - - # Switch to update mode - installMode="upgrade" - - # Prepare for backup old data - mkdir -p /tmp/mcsmanager/data - - # A little easteregg - # Maybe you wanna play Inscryption? - LEcho echo "[-] 正在将 旧数据 打包并移动至临时文件夹..." "[-] Packing and moving old data to temporary folder..." - - # Backup old data - if [ -d ${mcsmOldPath}/daemon/data ]; then - mv -f ${mcsmOldPath}/daemon/data /tmp/mcsmanager/data/daemon - else - LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - fi - if [ -d ${mcsmOldPath}/web/data ]; then - mv -f ${mcsmOldPath}/web/data /tmp/mcsmanager/data/web - else - LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - fi - - # Remove old service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove old data - if [ -d ${mcsmOldPath} ]; then - rm -rf ${mcsmOldPath} - fi - - # Remove old link - if [ -L /usr/bin/mcsmanager ]; then - rm -f /usr/bin/mcsmanager - fi - fi - - # Prepare for a new install - mkdir -p ${nodePath} - return -} - -## Check if the system is Chinese -CheckCN() { - if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then - LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China" - [ "${zh}" == 1 ] && read -e -r -p "[?] 是否选用中国镜像完成安装? [y/n] " input - [ "${zh}" == 0 ] && read -e -r -p "[?] Whether to use the Chinese mirror to complete the installation? [y/n] " input - case ${input} in - [yY][eE][sS] | [yY]) - LEcho echo "[-] 选用中国镜像" "[-] Use Chinese mirror" - CN=1 - ;; - *) - LEcho echo "[-] 不选用中国镜像" "[-] Do not use Chinese mirror" - ;; - esac - fi - if [ "${CN}" == 1 ]; then - daemonCloneURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" - webCloneURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" - export N_NODE_MIRROR=${nodeMirror} - fi - return -} - -## Check nodejs -CheckNodejs() { - if ! /usr/local/bin/n -V; then - if [ "${CN}" == 1 ]; then - npm i -g n --registry=https://registry.npmmirror.com - else - npm i -g n - fi - fi - while true; do - if /usr/local/bin/n ${nodeVersion} -d || [ ${try} == 3 ]; then - break - else - LEcho yellow "[!] 安装 Node.js ${nodeVersion} 失败, 重试中... (${try}/3)" "[!] Failed to install Node.js ${nodeVersion}, retrying... (${try}/3)" - fi - sleep 3 - try=${try}+1 - done - cp -r /usr/local/n/versions/node/${nodeVersion}/* ${nodePath}/ - /usr/local/bin/n rm ${nodeVersion} - if ! ${node} --version; then - LEcho error "[x] 未能成功安装最新版本 Node.js" "[x] Failed to install the latest version of Node.js" - fi - LEcho echo "=============== Node Version ===============" "=============== Node Version ===============" - LEcho echo "Node 版本: $(${node} --version)" "Node Version: $(${node} --version)" - LEcho echo "NPM 版本: $(${npm} --version)" "NPM Version: $(${npm} --version)" - LEcho echo "============================================" "============================================" - return -} - -### Main ### -## Main Install Function -Install() { - LEcho echo "[-] 正在安装 MCSManager ..." "[-] Installing MCSManager ..." - - # Move to MCSM - cd ${mcsmPath} || LEcho error "[x] 未能成功进入 MCSM 安装目录" "[x] Failed to enter the MCSM installation directory" - - # Download MCSM Daemon - LEcho echo "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon - - # Download MCSM Web - LEcho echo "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web - - # Install MCSM Daemon - LEcho echo "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." - cd daemon || LEcho error "[x] 未能成功进入 MCSM Daemon 安装目录" "[x] Failed to enter the MCSM Daemon installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - # Install MCSM Web - LEcho echo "[+] 正在安装 MCSManager Web..." "[+] Installing MCSManager Web..." - cd ../web || LEcho error "[x] 未能成功进入 MCSM Web 安装目录" "[x] Failed to enter the MCSManager Web installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - LEcho green "[√] MCSManager 安装完成" "[√] MCSManager installation completed" - - # Check install mode - if [ "${installMode}" == "upgrade" ]; then - LEcho echo "[-] 正在移动旧数据..." "[-] Moving old data..." - mv -f /tmp/mcsmanager/data/daemon ${mcsmPath}/daemon/data || LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - mv -f /tmp/mcsmanager/data/web ${mcsmPath}/web/data || LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - rm -rf /tmp/mcsmanager - LEcho green "[√] 数据迁移完成" "[√] Data migration completed" - fi - return -} - -### Other ### -## Clean up -Clean() { - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - return -} - -### Start ### -Init -Install -exit 0 \ No newline at end of file diff --git a/deb/pack/arm/DEBIAN/prerm b/deb/pack/arm/DEBIAN/prerm deleted file mode 100644 index 05c41dd..0000000 --- a/deb/pack/arm/DEBIAN/prerm +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Uninstall Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -### Tools ### -# Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho cyan "[-] 正在卸载 MCSManager..." "[-] Uninstalling MCSManager..." - - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - - LEcho green "[+] MCSManager 卸载成功!" "[+] MCSManager Uninstalled!" - return -} - -### Start ### -Start -exit 0 \ No newline at end of file diff --git a/deb/pack/arm64/DEBIAN/control b/deb/pack/arm64/DEBIAN/control deleted file mode 100644 index 8d30a3c..0000000 --- a/deb/pack/arm64/DEBIAN/control +++ /dev/null @@ -1,9 +0,0 @@ -Package:MCSManager -Version:9 -Section:stable -Priority:optional -Depends:wget,curl,git,tar,sudo -Suggests:language-pack-zh-hans,fonts-droid-fallback,ttf-wqy-zenhei,ttf-wqy-microhei,fonts-arphic-ukai,fonts-arphic-uming -Architecture:arm64 -Maintainer:unitwk -Description:A multilingual, lightweight, out-of-the-box, and multi-instance Minecraft server control panel with Docker support. diff --git a/deb/pack/arm64/DEBIAN/postinst b/deb/pack/arm64/DEBIAN/postinst deleted file mode 100644 index 56d465a..0000000 --- a/deb/pack/arm64/DEBIAN/postinst +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## Install Mode -if [ -d /tmp/mcsmanager/data ]; then - installMode="upgrade" -else - installMode="install" -fi - -## Other -firewall="" - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho echo "[-] 正在启动 MCSManager..." "[-] Starting MCSManager..." - - # Start MCSM service - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - systemctl start mcsm-daemon.service - systemctl start mcsm-web.service - - # Check MCSM service - if ! systemctl is-active --quiet mcsm-daemon.service || ! systemctl --quiet is-active mcsm-web.service; then - systemctl status mcsm-{web,daemon}.service - LEcho error "[x] MCSManager 启动失败" "[x] MCSManager failed to start" - fi - - # Allow ports - if command -v ufw; then - ufw allow 23333/tcp - ufw allow 24444/tcp - elif command -v iptables-save; then - iptables -A INPUT -p tcp --dport 23333 -j ACCEPT - iptables -A INPUT -p tcp --dport 24444 -j ACCEPT - iptables-save - else - firewall="problem" - fi - - # Output auth information - AuthInfo - return -} - -## Access Information -AuthInfo() { - if [ ${installMode} == "upgrade" ]; then - ip="$(curl -s https://ipconfig.io)" - port=$(cat ${mcsmPath}/web/data/SystemConfig/config.json | grep "httpPort" | tr -cd '0-9') - daemonPort=$(cat ${mcsmPath}/daemon/data/Config/global.json | grep "port" | tr -cd '0-9') - fi - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan "欢迎使用 MCSManager, 您可以通过以下方式访问 MCSManager " "Welcome to MCSManager, you can access it by the following ways" - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan_n "控制面板地址: " "Web Service Address: " - - [ ${installMode} == "upgrade" ] && LEcho cyan "http://${ip}:${port}" "http://${ip}:${port}" - [ ${installMode} == "upgrade" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - [ ${installMode} == "upgrade" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - - [ ${installMode} == "install" ] && LEcho cyan "http://localhost:23333" "http://localhost:23333" - [ ${installMode} == "install" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports 23333 and 24444 to use the service properly on the Internet." - [ ${installMode} == "install" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports 23333 and 24444 to use the service properly on the Internet." - - LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More info: https://docs.mcsmanager.com/" - LEcho cyan "==================================================================" "==================================================================" - return -} - -### Start ### -Start -exit 0 diff --git a/deb/pack/arm64/DEBIAN/preinst b/deb/pack/arm64/DEBIAN/preinst deleted file mode 100644 index 7a8cac7..0000000 --- a/deb/pack/arm64/DEBIAN/preinst +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### - -## Files -mcsmOldPath="/opt/mcsmanager" -mcsmPath="/opt/mcsmanager" -nodePath="${mcsmPath}/node" - -## Node -nodeVersion="18.12.1" -node="${nodePath}/bin/node" -npm="${node} ${nodePath}/bin/npm" - -## Install Mode -installMode="install" - -## URL -daemonCloneURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" -webCloneURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" -nodeMirror="https://npmmirror.com/mirrors/node" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## CDN -CN=0 - -## Other -try=1 - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Init ### -## Check environment -Init() { - LEcho echo "[-] 正在初始化环境..." "[-] Initializing environment..." - - # Check functions - CheckMCSM - CheckCN - CheckNodejs - - LEcho echo "[-] 环境初始化完成" "[-] Environment initialization completed" - return -} - -## Check if MCSM is installed -CheckMCSM() { - if [ -d ${mcsmOldPath} ]; then - LEcho yellow "[-] 检测到已安装的 MCSManager, 切换为更新模式..." "[-] MCSManager has been installed, switching to update mode..." - - # Switch to update mode - installMode="upgrade" - - # Prepare for backup old data - mkdir -p /tmp/mcsmanager/data - - # A little easteregg - # Maybe you wanna play Inscryption? - LEcho echo "[-] 正在将 旧数据 打包并移动至临时文件夹..." "[-] Packing and moving old data to temporary folder..." - - # Backup old data - if [ -d ${mcsmOldPath}/daemon/data ]; then - mv -f ${mcsmOldPath}/daemon/data /tmp/mcsmanager/data/daemon - else - LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - fi - if [ -d ${mcsmOldPath}/web/data ]; then - mv -f ${mcsmOldPath}/web/data /tmp/mcsmanager/data/web - else - LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - fi - - # Remove old service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove old data - if [ -d ${mcsmOldPath} ]; then - rm -rf ${mcsmOldPath} - fi - - # Remove old link - if [ -L /usr/bin/mcsmanager ]; then - rm -f /usr/bin/mcsmanager - fi - fi - - # Prepare for a new install - mkdir -p ${nodePath} - return -} - -## Check if the system is Chinese -CheckCN() { - if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then - LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China" - [ "${zh}" == 1 ] && read -e -r -p "[?] 是否选用中国镜像完成安装? [y/n] " input - [ "${zh}" == 0 ] && read -e -r -p "[?] Whether to use the Chinese mirror to complete the installation? [y/n] " input - case ${input} in - [yY][eE][sS] | [yY]) - LEcho echo "[-] 选用中国镜像" "[-] Use Chinese mirror" - CN=1 - ;; - *) - LEcho echo "[-] 不选用中国镜像" "[-] Do not use Chinese mirror" - ;; - esac - fi - if [ "${CN}" == 1 ]; then - daemonCloneURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" - webCloneURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" - export N_NODE_MIRROR=${nodeMirror} - fi - return -} - -## Check nodejs -CheckNodejs() { - if ! /usr/local/bin/n -V; then - if [ "${CN}" == 1 ]; then - npm i -g n --registry=https://registry.npmmirror.com - else - npm i -g n - fi - fi - while true; do - if /usr/local/bin/n ${nodeVersion} -d || [ ${try} == 3 ]; then - break - else - LEcho yellow "[!] 安装 Node.js ${nodeVersion} 失败, 重试中... (${try}/3)" "[!] Failed to install Node.js ${nodeVersion}, retrying... (${try}/3)" - fi - sleep 3 - try=${try}+1 - done - cp -r /usr/local/n/versions/node/${nodeVersion}/* ${nodePath}/ - /usr/local/bin/n rm ${nodeVersion} - if ! ${node} --version; then - LEcho error "[x] 未能成功安装最新版本 Node.js" "[x] Failed to install the latest version of Node.js" - fi - LEcho echo "=============== Node Version ===============" "=============== Node Version ===============" - LEcho echo "Node 版本: $(${node} --version)" "Node Version: $(${node} --version)" - LEcho echo "NPM 版本: $(${npm} --version)" "NPM Version: $(${npm} --version)" - LEcho echo "============================================" "============================================" - return -} - -### Main ### -## Main Install Function -Install() { - LEcho echo "[-] 正在安装 MCSManager ..." "[-] Installing MCSManager ..." - - # Move to MCSM - cd ${mcsmPath} || LEcho error "[x] 未能成功进入 MCSM 安装目录" "[x] Failed to enter the MCSM installation directory" - - # Download MCSM Daemon - LEcho echo "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon - - # Download MCSM Web - LEcho echo "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web - - # Install MCSM Daemon - LEcho echo "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." - cd daemon || LEcho error "[x] 未能成功进入 MCSM Daemon 安装目录" "[x] Failed to enter the MCSM Daemon installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - # Install MCSM Web - LEcho echo "[+] 正在安装 MCSManager Web..." "[+] Installing MCSManager Web..." - cd ../web || LEcho error "[x] 未能成功进入 MCSM Web 安装目录" "[x] Failed to enter the MCSManager Web installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - LEcho green "[√] MCSManager 安装完成" "[√] MCSManager installation completed" - - # Check install mode - if [ "${installMode}" == "upgrade" ]; then - LEcho echo "[-] 正在移动旧数据..." "[-] Moving old data..." - mv -f /tmp/mcsmanager/data/daemon ${mcsmPath}/daemon/data || LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - mv -f /tmp/mcsmanager/data/web ${mcsmPath}/web/data || LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - rm -rf /tmp/mcsmanager - LEcho green "[√] 数据迁移完成" "[√] Data migration completed" - fi - return -} - -### Other ### -## Clean up -Clean() { - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - return -} - -### Start ### -Init -Install -exit 0 \ No newline at end of file diff --git a/deb/pack/arm64/DEBIAN/prerm b/deb/pack/arm64/DEBIAN/prerm deleted file mode 100644 index 05c41dd..0000000 --- a/deb/pack/arm64/DEBIAN/prerm +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Uninstall Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -### Tools ### -# Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho cyan "[-] 正在卸载 MCSManager..." "[-] Uninstalling MCSManager..." - - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - - LEcho green "[+] MCSManager 卸载成功!" "[+] MCSManager Uninstalled!" - return -} - -### Start ### -Start -exit 0 \ No newline at end of file diff --git a/deb/pack/build.sh b/deb/pack/build.sh deleted file mode 100644 index 8b12c1f..0000000 --- a/deb/pack/build.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - - -echo "Building..." - -# Find dpkg -if ! command -v dpkg;then - echo "Error: dpkg not found" - exit 1 -fi - -# Some prepare work -[ -f ../src/DEBIAN/postinst.sh ] && mv -f ../src/DEBIAN/postinst.sh ../src/DEBIAN/postinst -[ -f ../src/DEBIAN/preinst.sh ] && mv -f ../src/DEBIAN/preinst.sh ../src/DEBIAN/preinst -[ -f ../src/DEBIAN/prerm.sh ] && mv -f ../src/DEBIAN/prerm.sh ../src/DEBIAN/prerm - -# Remove old files -echo "Remove old files..." -rm -rf ./*/DEBIAN/preinst -rm -rf ./*/DEBIAN/postinst -rm -rf ./*/DEBIAN/prerm - -echo "Copy new script files..." -cp -r -v ../src/DEBIAN/* ./amd64/DEBIAN/ -cp -r -v ../src/DEBIAN/* ./arm64/DEBIAN/ -cp -r -v ../src/DEBIAN/* ./arm/DEBIAN/ -cp -r -v ../src/DEBIAN/* ./i386/DEBIAN/ -cp -r -v ../src/DEBIAN/* ./ppc64le/DEBIAN/ -cp -r -v ../src/DEBIAN/* ./s390x/DEBIAN/ - -# Set Premission -echo "Set Permission..." -chmod 775 ./*/DEBIAN/pre* -chmod 775 ./*/DEBIAN/post* -chown -R debian ./* - -[ -f ../src/DEBIAN/postinst ] && mv -f ../src/DEBIAN/postinst ../src/DEBIAN/postinst.sh -[ -f ../src/DEBIAN/preinst ] && mv -f ../src/DEBIAN/preinst ../src/DEBIAN/preinst.sh -[ -f ../src/DEBIAN/prerm ] && mv -f ../src/DEBIAN/prerm ../src/DEBIAN/prerm.sh - -# Build -if ! dpkg -b ./amd64/ MCSManager-amd64.deb; then - echo "Error: Build amd64 arch deb failed" - exit 1 -fi -if ! dpkg -b ./arm/ MCSManager-arm.deb; then - echo "Error: Build arm arch deb failed" - exit 1 -fi -if ! dpkg -b ./arm64/ MCSManager-arm64.deb; then - echo "Error: Build arm64 arch deb failed" - exit 1 -fi -if ! dpkg -b ./i386/ MCSManager-i386.deb; then - echo "Error: Build i386 arch deb failed" - exit 1 -fi -if ! dpkg -b ./ppc64le/ MCSManager-ppc64le.deb; then - echo "Error: Build ppc64le arch deb failed" - exit 1 -fi -if ! dpkg -b ./s390x/ MCSManager-s390x.deb; then - echo "Error: Build s390x arch deb failed" - exit 1 -fi - -echo "Build complete" diff --git a/deb/pack/i386/DEBIAN/control b/deb/pack/i386/DEBIAN/control deleted file mode 100644 index 145a2df..0000000 --- a/deb/pack/i386/DEBIAN/control +++ /dev/null @@ -1,9 +0,0 @@ -Package:MCSManager -Version:9 -Section:stable -Priority:optional -Depends:wget,curl,git,tar,sudo -Suggests:language-pack-zh-hans,fonts-droid-fallback,ttf-wqy-zenhei,ttf-wqy-microhei,fonts-arphic-ukai,fonts-arphic-uming -Architecture:i386 -Maintainer:unitwk -Description:A multilingual, lightweight, out-of-the-box, and multi-instance Minecraft server control panel with Docker support. diff --git a/deb/pack/i386/DEBIAN/postinst b/deb/pack/i386/DEBIAN/postinst deleted file mode 100644 index 56d465a..0000000 --- a/deb/pack/i386/DEBIAN/postinst +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## Install Mode -if [ -d /tmp/mcsmanager/data ]; then - installMode="upgrade" -else - installMode="install" -fi - -## Other -firewall="" - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho echo "[-] 正在启动 MCSManager..." "[-] Starting MCSManager..." - - # Start MCSM service - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - systemctl start mcsm-daemon.service - systemctl start mcsm-web.service - - # Check MCSM service - if ! systemctl is-active --quiet mcsm-daemon.service || ! systemctl --quiet is-active mcsm-web.service; then - systemctl status mcsm-{web,daemon}.service - LEcho error "[x] MCSManager 启动失败" "[x] MCSManager failed to start" - fi - - # Allow ports - if command -v ufw; then - ufw allow 23333/tcp - ufw allow 24444/tcp - elif command -v iptables-save; then - iptables -A INPUT -p tcp --dport 23333 -j ACCEPT - iptables -A INPUT -p tcp --dport 24444 -j ACCEPT - iptables-save - else - firewall="problem" - fi - - # Output auth information - AuthInfo - return -} - -## Access Information -AuthInfo() { - if [ ${installMode} == "upgrade" ]; then - ip="$(curl -s https://ipconfig.io)" - port=$(cat ${mcsmPath}/web/data/SystemConfig/config.json | grep "httpPort" | tr -cd '0-9') - daemonPort=$(cat ${mcsmPath}/daemon/data/Config/global.json | grep "port" | tr -cd '0-9') - fi - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan "欢迎使用 MCSManager, 您可以通过以下方式访问 MCSManager " "Welcome to MCSManager, you can access it by the following ways" - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan_n "控制面板地址: " "Web Service Address: " - - [ ${installMode} == "upgrade" ] && LEcho cyan "http://${ip}:${port}" "http://${ip}:${port}" - [ ${installMode} == "upgrade" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - [ ${installMode} == "upgrade" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - - [ ${installMode} == "install" ] && LEcho cyan "http://localhost:23333" "http://localhost:23333" - [ ${installMode} == "install" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports 23333 and 24444 to use the service properly on the Internet." - [ ${installMode} == "install" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports 23333 and 24444 to use the service properly on the Internet." - - LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More info: https://docs.mcsmanager.com/" - LEcho cyan "==================================================================" "==================================================================" - return -} - -### Start ### -Start -exit 0 diff --git a/deb/pack/i386/DEBIAN/preinst b/deb/pack/i386/DEBIAN/preinst deleted file mode 100644 index 7a8cac7..0000000 --- a/deb/pack/i386/DEBIAN/preinst +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### - -## Files -mcsmOldPath="/opt/mcsmanager" -mcsmPath="/opt/mcsmanager" -nodePath="${mcsmPath}/node" - -## Node -nodeVersion="18.12.1" -node="${nodePath}/bin/node" -npm="${node} ${nodePath}/bin/npm" - -## Install Mode -installMode="install" - -## URL -daemonCloneURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" -webCloneURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" -nodeMirror="https://npmmirror.com/mirrors/node" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## CDN -CN=0 - -## Other -try=1 - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Init ### -## Check environment -Init() { - LEcho echo "[-] 正在初始化环境..." "[-] Initializing environment..." - - # Check functions - CheckMCSM - CheckCN - CheckNodejs - - LEcho echo "[-] 环境初始化完成" "[-] Environment initialization completed" - return -} - -## Check if MCSM is installed -CheckMCSM() { - if [ -d ${mcsmOldPath} ]; then - LEcho yellow "[-] 检测到已安装的 MCSManager, 切换为更新模式..." "[-] MCSManager has been installed, switching to update mode..." - - # Switch to update mode - installMode="upgrade" - - # Prepare for backup old data - mkdir -p /tmp/mcsmanager/data - - # A little easteregg - # Maybe you wanna play Inscryption? - LEcho echo "[-] 正在将 旧数据 打包并移动至临时文件夹..." "[-] Packing and moving old data to temporary folder..." - - # Backup old data - if [ -d ${mcsmOldPath}/daemon/data ]; then - mv -f ${mcsmOldPath}/daemon/data /tmp/mcsmanager/data/daemon - else - LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - fi - if [ -d ${mcsmOldPath}/web/data ]; then - mv -f ${mcsmOldPath}/web/data /tmp/mcsmanager/data/web - else - LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - fi - - # Remove old service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove old data - if [ -d ${mcsmOldPath} ]; then - rm -rf ${mcsmOldPath} - fi - - # Remove old link - if [ -L /usr/bin/mcsmanager ]; then - rm -f /usr/bin/mcsmanager - fi - fi - - # Prepare for a new install - mkdir -p ${nodePath} - return -} - -## Check if the system is Chinese -CheckCN() { - if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then - LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China" - [ "${zh}" == 1 ] && read -e -r -p "[?] 是否选用中国镜像完成安装? [y/n] " input - [ "${zh}" == 0 ] && read -e -r -p "[?] Whether to use the Chinese mirror to complete the installation? [y/n] " input - case ${input} in - [yY][eE][sS] | [yY]) - LEcho echo "[-] 选用中国镜像" "[-] Use Chinese mirror" - CN=1 - ;; - *) - LEcho echo "[-] 不选用中国镜像" "[-] Do not use Chinese mirror" - ;; - esac - fi - if [ "${CN}" == 1 ]; then - daemonCloneURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" - webCloneURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" - export N_NODE_MIRROR=${nodeMirror} - fi - return -} - -## Check nodejs -CheckNodejs() { - if ! /usr/local/bin/n -V; then - if [ "${CN}" == 1 ]; then - npm i -g n --registry=https://registry.npmmirror.com - else - npm i -g n - fi - fi - while true; do - if /usr/local/bin/n ${nodeVersion} -d || [ ${try} == 3 ]; then - break - else - LEcho yellow "[!] 安装 Node.js ${nodeVersion} 失败, 重试中... (${try}/3)" "[!] Failed to install Node.js ${nodeVersion}, retrying... (${try}/3)" - fi - sleep 3 - try=${try}+1 - done - cp -r /usr/local/n/versions/node/${nodeVersion}/* ${nodePath}/ - /usr/local/bin/n rm ${nodeVersion} - if ! ${node} --version; then - LEcho error "[x] 未能成功安装最新版本 Node.js" "[x] Failed to install the latest version of Node.js" - fi - LEcho echo "=============== Node Version ===============" "=============== Node Version ===============" - LEcho echo "Node 版本: $(${node} --version)" "Node Version: $(${node} --version)" - LEcho echo "NPM 版本: $(${npm} --version)" "NPM Version: $(${npm} --version)" - LEcho echo "============================================" "============================================" - return -} - -### Main ### -## Main Install Function -Install() { - LEcho echo "[-] 正在安装 MCSManager ..." "[-] Installing MCSManager ..." - - # Move to MCSM - cd ${mcsmPath} || LEcho error "[x] 未能成功进入 MCSM 安装目录" "[x] Failed to enter the MCSM installation directory" - - # Download MCSM Daemon - LEcho echo "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon - - # Download MCSM Web - LEcho echo "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web - - # Install MCSM Daemon - LEcho echo "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." - cd daemon || LEcho error "[x] 未能成功进入 MCSM Daemon 安装目录" "[x] Failed to enter the MCSM Daemon installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - # Install MCSM Web - LEcho echo "[+] 正在安装 MCSManager Web..." "[+] Installing MCSManager Web..." - cd ../web || LEcho error "[x] 未能成功进入 MCSM Web 安装目录" "[x] Failed to enter the MCSManager Web installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - LEcho green "[√] MCSManager 安装完成" "[√] MCSManager installation completed" - - # Check install mode - if [ "${installMode}" == "upgrade" ]; then - LEcho echo "[-] 正在移动旧数据..." "[-] Moving old data..." - mv -f /tmp/mcsmanager/data/daemon ${mcsmPath}/daemon/data || LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - mv -f /tmp/mcsmanager/data/web ${mcsmPath}/web/data || LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - rm -rf /tmp/mcsmanager - LEcho green "[√] 数据迁移完成" "[√] Data migration completed" - fi - return -} - -### Other ### -## Clean up -Clean() { - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - return -} - -### Start ### -Init -Install -exit 0 \ No newline at end of file diff --git a/deb/pack/i386/DEBIAN/prerm b/deb/pack/i386/DEBIAN/prerm deleted file mode 100644 index 05c41dd..0000000 --- a/deb/pack/i386/DEBIAN/prerm +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Uninstall Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -### Tools ### -# Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho cyan "[-] 正在卸载 MCSManager..." "[-] Uninstalling MCSManager..." - - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - - LEcho green "[+] MCSManager 卸载成功!" "[+] MCSManager Uninstalled!" - return -} - -### Start ### -Start -exit 0 \ No newline at end of file diff --git a/deb/pack/ppc64le/DEBIAN/control b/deb/pack/ppc64le/DEBIAN/control deleted file mode 100644 index ba2131e..0000000 --- a/deb/pack/ppc64le/DEBIAN/control +++ /dev/null @@ -1,9 +0,0 @@ -Package:MCSManager -Version:9 -Section:stable -Priority:optional -Depends:wget,curl,git,tar,sudo -Suggests:language-pack-zh-hans,fonts-droid-fallback,ttf-wqy-zenhei,ttf-wqy-microhei,fonts-arphic-ukai,fonts-arphic-uming -Architecture:ppc64le -Maintainer:unitwk -Description:A multilingual, lightweight, out-of-the-box, and multi-instance Minecraft server control panel with Docker support. diff --git a/deb/pack/ppc64le/DEBIAN/postinst b/deb/pack/ppc64le/DEBIAN/postinst deleted file mode 100644 index 56d465a..0000000 --- a/deb/pack/ppc64le/DEBIAN/postinst +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## Install Mode -if [ -d /tmp/mcsmanager/data ]; then - installMode="upgrade" -else - installMode="install" -fi - -## Other -firewall="" - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho echo "[-] 正在启动 MCSManager..." "[-] Starting MCSManager..." - - # Start MCSM service - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - systemctl start mcsm-daemon.service - systemctl start mcsm-web.service - - # Check MCSM service - if ! systemctl is-active --quiet mcsm-daemon.service || ! systemctl --quiet is-active mcsm-web.service; then - systemctl status mcsm-{web,daemon}.service - LEcho error "[x] MCSManager 启动失败" "[x] MCSManager failed to start" - fi - - # Allow ports - if command -v ufw; then - ufw allow 23333/tcp - ufw allow 24444/tcp - elif command -v iptables-save; then - iptables -A INPUT -p tcp --dport 23333 -j ACCEPT - iptables -A INPUT -p tcp --dport 24444 -j ACCEPT - iptables-save - else - firewall="problem" - fi - - # Output auth information - AuthInfo - return -} - -## Access Information -AuthInfo() { - if [ ${installMode} == "upgrade" ]; then - ip="$(curl -s https://ipconfig.io)" - port=$(cat ${mcsmPath}/web/data/SystemConfig/config.json | grep "httpPort" | tr -cd '0-9') - daemonPort=$(cat ${mcsmPath}/daemon/data/Config/global.json | grep "port" | tr -cd '0-9') - fi - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan "欢迎使用 MCSManager, 您可以通过以下方式访问 MCSManager " "Welcome to MCSManager, you can access it by the following ways" - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan_n "控制面板地址: " "Web Service Address: " - - [ ${installMode} == "upgrade" ] && LEcho cyan "http://${ip}:${port}" "http://${ip}:${port}" - [ ${installMode} == "upgrade" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - [ ${installMode} == "upgrade" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - - [ ${installMode} == "install" ] && LEcho cyan "http://localhost:23333" "http://localhost:23333" - [ ${installMode} == "install" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports 23333 and 24444 to use the service properly on the Internet." - [ ${installMode} == "install" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports 23333 and 24444 to use the service properly on the Internet." - - LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More info: https://docs.mcsmanager.com/" - LEcho cyan "==================================================================" "==================================================================" - return -} - -### Start ### -Start -exit 0 diff --git a/deb/pack/ppc64le/DEBIAN/preinst b/deb/pack/ppc64le/DEBIAN/preinst deleted file mode 100644 index 7a8cac7..0000000 --- a/deb/pack/ppc64le/DEBIAN/preinst +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### - -## Files -mcsmOldPath="/opt/mcsmanager" -mcsmPath="/opt/mcsmanager" -nodePath="${mcsmPath}/node" - -## Node -nodeVersion="18.12.1" -node="${nodePath}/bin/node" -npm="${node} ${nodePath}/bin/npm" - -## Install Mode -installMode="install" - -## URL -daemonCloneURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" -webCloneURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" -nodeMirror="https://npmmirror.com/mirrors/node" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## CDN -CN=0 - -## Other -try=1 - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Init ### -## Check environment -Init() { - LEcho echo "[-] 正在初始化环境..." "[-] Initializing environment..." - - # Check functions - CheckMCSM - CheckCN - CheckNodejs - - LEcho echo "[-] 环境初始化完成" "[-] Environment initialization completed" - return -} - -## Check if MCSM is installed -CheckMCSM() { - if [ -d ${mcsmOldPath} ]; then - LEcho yellow "[-] 检测到已安装的 MCSManager, 切换为更新模式..." "[-] MCSManager has been installed, switching to update mode..." - - # Switch to update mode - installMode="upgrade" - - # Prepare for backup old data - mkdir -p /tmp/mcsmanager/data - - # A little easteregg - # Maybe you wanna play Inscryption? - LEcho echo "[-] 正在将 旧数据 打包并移动至临时文件夹..." "[-] Packing and moving old data to temporary folder..." - - # Backup old data - if [ -d ${mcsmOldPath}/daemon/data ]; then - mv -f ${mcsmOldPath}/daemon/data /tmp/mcsmanager/data/daemon - else - LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - fi - if [ -d ${mcsmOldPath}/web/data ]; then - mv -f ${mcsmOldPath}/web/data /tmp/mcsmanager/data/web - else - LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - fi - - # Remove old service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove old data - if [ -d ${mcsmOldPath} ]; then - rm -rf ${mcsmOldPath} - fi - - # Remove old link - if [ -L /usr/bin/mcsmanager ]; then - rm -f /usr/bin/mcsmanager - fi - fi - - # Prepare for a new install - mkdir -p ${nodePath} - return -} - -## Check if the system is Chinese -CheckCN() { - if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then - LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China" - [ "${zh}" == 1 ] && read -e -r -p "[?] 是否选用中国镜像完成安装? [y/n] " input - [ "${zh}" == 0 ] && read -e -r -p "[?] Whether to use the Chinese mirror to complete the installation? [y/n] " input - case ${input} in - [yY][eE][sS] | [yY]) - LEcho echo "[-] 选用中国镜像" "[-] Use Chinese mirror" - CN=1 - ;; - *) - LEcho echo "[-] 不选用中国镜像" "[-] Do not use Chinese mirror" - ;; - esac - fi - if [ "${CN}" == 1 ]; then - daemonCloneURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" - webCloneURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" - export N_NODE_MIRROR=${nodeMirror} - fi - return -} - -## Check nodejs -CheckNodejs() { - if ! /usr/local/bin/n -V; then - if [ "${CN}" == 1 ]; then - npm i -g n --registry=https://registry.npmmirror.com - else - npm i -g n - fi - fi - while true; do - if /usr/local/bin/n ${nodeVersion} -d || [ ${try} == 3 ]; then - break - else - LEcho yellow "[!] 安装 Node.js ${nodeVersion} 失败, 重试中... (${try}/3)" "[!] Failed to install Node.js ${nodeVersion}, retrying... (${try}/3)" - fi - sleep 3 - try=${try}+1 - done - cp -r /usr/local/n/versions/node/${nodeVersion}/* ${nodePath}/ - /usr/local/bin/n rm ${nodeVersion} - if ! ${node} --version; then - LEcho error "[x] 未能成功安装最新版本 Node.js" "[x] Failed to install the latest version of Node.js" - fi - LEcho echo "=============== Node Version ===============" "=============== Node Version ===============" - LEcho echo "Node 版本: $(${node} --version)" "Node Version: $(${node} --version)" - LEcho echo "NPM 版本: $(${npm} --version)" "NPM Version: $(${npm} --version)" - LEcho echo "============================================" "============================================" - return -} - -### Main ### -## Main Install Function -Install() { - LEcho echo "[-] 正在安装 MCSManager ..." "[-] Installing MCSManager ..." - - # Move to MCSM - cd ${mcsmPath} || LEcho error "[x] 未能成功进入 MCSM 安装目录" "[x] Failed to enter the MCSM installation directory" - - # Download MCSM Daemon - LEcho echo "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon - - # Download MCSM Web - LEcho echo "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web - - # Install MCSM Daemon - LEcho echo "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." - cd daemon || LEcho error "[x] 未能成功进入 MCSM Daemon 安装目录" "[x] Failed to enter the MCSM Daemon installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - # Install MCSM Web - LEcho echo "[+] 正在安装 MCSManager Web..." "[+] Installing MCSManager Web..." - cd ../web || LEcho error "[x] 未能成功进入 MCSM Web 安装目录" "[x] Failed to enter the MCSManager Web installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - LEcho green "[√] MCSManager 安装完成" "[√] MCSManager installation completed" - - # Check install mode - if [ "${installMode}" == "upgrade" ]; then - LEcho echo "[-] 正在移动旧数据..." "[-] Moving old data..." - mv -f /tmp/mcsmanager/data/daemon ${mcsmPath}/daemon/data || LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - mv -f /tmp/mcsmanager/data/web ${mcsmPath}/web/data || LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - rm -rf /tmp/mcsmanager - LEcho green "[√] 数据迁移完成" "[√] Data migration completed" - fi - return -} - -### Other ### -## Clean up -Clean() { - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - return -} - -### Start ### -Init -Install -exit 0 \ No newline at end of file diff --git a/deb/pack/ppc64le/DEBIAN/prerm b/deb/pack/ppc64le/DEBIAN/prerm deleted file mode 100644 index 05c41dd..0000000 --- a/deb/pack/ppc64le/DEBIAN/prerm +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Uninstall Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -### Tools ### -# Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho cyan "[-] 正在卸载 MCSManager..." "[-] Uninstalling MCSManager..." - - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - - LEcho green "[+] MCSManager 卸载成功!" "[+] MCSManager Uninstalled!" - return -} - -### Start ### -Start -exit 0 \ No newline at end of file diff --git a/deb/pack/s390x/DEBIAN/control b/deb/pack/s390x/DEBIAN/control deleted file mode 100644 index 2b44ac1..0000000 --- a/deb/pack/s390x/DEBIAN/control +++ /dev/null @@ -1,9 +0,0 @@ -Package:MCSManager -Version:9 -Section:stable -Priority:optional -Depends:wget,curl,git,tar,sudo -Suggests:language-pack-zh-hans,fonts-droid-fallback,ttf-wqy-zenhei,ttf-wqy-microhei,fonts-arphic-ukai,fonts-arphic-uming -Architecture:s390x -Maintainer:unitwk -Description:A multilingual, lightweight, out-of-the-box, and multi-instance Minecraft server control panel with Docker support. diff --git a/deb/pack/s390x/DEBIAN/postinst b/deb/pack/s390x/DEBIAN/postinst deleted file mode 100644 index 56d465a..0000000 --- a/deb/pack/s390x/DEBIAN/postinst +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## Install Mode -if [ -d /tmp/mcsmanager/data ]; then - installMode="upgrade" -else - installMode="install" -fi - -## Other -firewall="" - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho echo "[-] 正在启动 MCSManager..." "[-] Starting MCSManager..." - - # Start MCSM service - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - systemctl start mcsm-daemon.service - systemctl start mcsm-web.service - - # Check MCSM service - if ! systemctl is-active --quiet mcsm-daemon.service || ! systemctl --quiet is-active mcsm-web.service; then - systemctl status mcsm-{web,daemon}.service - LEcho error "[x] MCSManager 启动失败" "[x] MCSManager failed to start" - fi - - # Allow ports - if command -v ufw; then - ufw allow 23333/tcp - ufw allow 24444/tcp - elif command -v iptables-save; then - iptables -A INPUT -p tcp --dport 23333 -j ACCEPT - iptables -A INPUT -p tcp --dport 24444 -j ACCEPT - iptables-save - else - firewall="problem" - fi - - # Output auth information - AuthInfo - return -} - -## Access Information -AuthInfo() { - if [ ${installMode} == "upgrade" ]; then - ip="$(curl -s https://ipconfig.io)" - port=$(cat ${mcsmPath}/web/data/SystemConfig/config.json | grep "httpPort" | tr -cd '0-9') - daemonPort=$(cat ${mcsmPath}/daemon/data/Config/global.json | grep "port" | tr -cd '0-9') - fi - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan "欢迎使用 MCSManager, 您可以通过以下方式访问 MCSManager " "Welcome to MCSManager, you can access it by the following ways" - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan_n "控制面板地址: " "Web Service Address: " - - [ ${installMode} == "upgrade" ] && LEcho cyan "http://${ip}:${port}" "http://${ip}:${port}" - [ ${installMode} == "upgrade" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - [ ${installMode} == "upgrade" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - - [ ${installMode} == "install" ] && LEcho cyan "http://localhost:23333" "http://localhost:23333" - [ ${installMode} == "install" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports 23333 and 24444 to use the service properly on the Internet." - [ ${installMode} == "install" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports 23333 and 24444 to use the service properly on the Internet." - - LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More info: https://docs.mcsmanager.com/" - LEcho cyan "==================================================================" "==================================================================" - return -} - -### Start ### -Start -exit 0 diff --git a/deb/pack/s390x/DEBIAN/preinst b/deb/pack/s390x/DEBIAN/preinst deleted file mode 100644 index 7a8cac7..0000000 --- a/deb/pack/s390x/DEBIAN/preinst +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### - -## Files -mcsmOldPath="/opt/mcsmanager" -mcsmPath="/opt/mcsmanager" -nodePath="${mcsmPath}/node" - -## Node -nodeVersion="18.12.1" -node="${nodePath}/bin/node" -npm="${node} ${nodePath}/bin/npm" - -## Install Mode -installMode="install" - -## URL -daemonCloneURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" -webCloneURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" -nodeMirror="https://npmmirror.com/mirrors/node" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## CDN -CN=0 - -## Other -try=1 - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Init ### -## Check environment -Init() { - LEcho echo "[-] 正在初始化环境..." "[-] Initializing environment..." - - # Check functions - CheckMCSM - CheckCN - CheckNodejs - - LEcho echo "[-] 环境初始化完成" "[-] Environment initialization completed" - return -} - -## Check if MCSM is installed -CheckMCSM() { - if [ -d ${mcsmOldPath} ]; then - LEcho yellow "[-] 检测到已安装的 MCSManager, 切换为更新模式..." "[-] MCSManager has been installed, switching to update mode..." - - # Switch to update mode - installMode="upgrade" - - # Prepare for backup old data - mkdir -p /tmp/mcsmanager/data - - # A little easteregg - # Maybe you wanna play Inscryption? - LEcho echo "[-] 正在将 旧数据 打包并移动至临时文件夹..." "[-] Packing and moving old data to temporary folder..." - - # Backup old data - if [ -d ${mcsmOldPath}/daemon/data ]; then - mv -f ${mcsmOldPath}/daemon/data /tmp/mcsmanager/data/daemon - else - LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - fi - if [ -d ${mcsmOldPath}/web/data ]; then - mv -f ${mcsmOldPath}/web/data /tmp/mcsmanager/data/web - else - LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - fi - - # Remove old service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove old data - if [ -d ${mcsmOldPath} ]; then - rm -rf ${mcsmOldPath} - fi - - # Remove old link - if [ -L /usr/bin/mcsmanager ]; then - rm -f /usr/bin/mcsmanager - fi - fi - - # Prepare for a new install - mkdir -p ${nodePath} - return -} - -## Check if the system is Chinese -CheckCN() { - if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then - LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China" - [ "${zh}" == 1 ] && read -e -r -p "[?] 是否选用中国镜像完成安装? [y/n] " input - [ "${zh}" == 0 ] && read -e -r -p "[?] Whether to use the Chinese mirror to complete the installation? [y/n] " input - case ${input} in - [yY][eE][sS] | [yY]) - LEcho echo "[-] 选用中国镜像" "[-] Use Chinese mirror" - CN=1 - ;; - *) - LEcho echo "[-] 不选用中国镜像" "[-] Do not use Chinese mirror" - ;; - esac - fi - if [ "${CN}" == 1 ]; then - daemonCloneURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" - webCloneURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" - export N_NODE_MIRROR=${nodeMirror} - fi - return -} - -## Check nodejs -CheckNodejs() { - if ! /usr/local/bin/n -V; then - if [ "${CN}" == 1 ]; then - npm i -g n --registry=https://registry.npmmirror.com - else - npm i -g n - fi - fi - while true; do - if /usr/local/bin/n ${nodeVersion} -d || [ ${try} == 3 ]; then - break - else - LEcho yellow "[!] 安装 Node.js ${nodeVersion} 失败, 重试中... (${try}/3)" "[!] Failed to install Node.js ${nodeVersion}, retrying... (${try}/3)" - fi - sleep 3 - try=${try}+1 - done - cp -r /usr/local/n/versions/node/${nodeVersion}/* ${nodePath}/ - /usr/local/bin/n rm ${nodeVersion} - if ! ${node} --version; then - LEcho error "[x] 未能成功安装最新版本 Node.js" "[x] Failed to install the latest version of Node.js" - fi - LEcho echo "=============== Node Version ===============" "=============== Node Version ===============" - LEcho echo "Node 版本: $(${node} --version)" "Node Version: $(${node} --version)" - LEcho echo "NPM 版本: $(${npm} --version)" "NPM Version: $(${npm} --version)" - LEcho echo "============================================" "============================================" - return -} - -### Main ### -## Main Install Function -Install() { - LEcho echo "[-] 正在安装 MCSManager ..." "[-] Installing MCSManager ..." - - # Move to MCSM - cd ${mcsmPath} || LEcho error "[x] 未能成功进入 MCSM 安装目录" "[x] Failed to enter the MCSM installation directory" - - # Download MCSM Daemon - LEcho echo "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon - - # Download MCSM Web - LEcho echo "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web - - # Install MCSM Daemon - LEcho echo "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." - cd daemon || LEcho error "[x] 未能成功进入 MCSM Daemon 安装目录" "[x] Failed to enter the MCSM Daemon installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - # Install MCSM Web - LEcho echo "[+] 正在安装 MCSManager Web..." "[+] Installing MCSManager Web..." - cd ../web || LEcho error "[x] 未能成功进入 MCSM Web 安装目录" "[x] Failed to enter the MCSManager Web installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - LEcho green "[√] MCSManager 安装完成" "[√] MCSManager installation completed" - - # Check install mode - if [ "${installMode}" == "upgrade" ]; then - LEcho echo "[-] 正在移动旧数据..." "[-] Moving old data..." - mv -f /tmp/mcsmanager/data/daemon ${mcsmPath}/daemon/data || LEcho yellow "[-] 未检测到旧版 Daemon 数据, 跳过迁移..." "[-] Old Daemon data was not detected, skipping migration..." - mv -f /tmp/mcsmanager/data/web ${mcsmPath}/web/data || LEcho yellow "[-] 未检测到旧版 Web 数据, 跳过迁移..." "[-] Old Web data was not detected, skipping migration..." - rm -rf /tmp/mcsmanager - LEcho green "[√] 数据迁移完成" "[√] Data migration completed" - fi - return -} - -### Other ### -## Clean up -Clean() { - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - return -} - -### Start ### -Init -Install -exit 0 \ No newline at end of file diff --git a/deb/pack/s390x/DEBIAN/prerm b/deb/pack/s390x/DEBIAN/prerm deleted file mode 100644 index 05c41dd..0000000 --- a/deb/pack/s390x/DEBIAN/prerm +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Uninstall Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -### Tools ### -# Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho cyan "[-] 正在卸载 MCSManager..." "[-] Uninstalling MCSManager..." - - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - - LEcho green "[+] MCSManager 卸载成功!" "[+] MCSManager Uninstalled!" - return -} - -### Start ### -Start -exit 0 \ No newline at end of file diff --git a/deb/src/DEBIAN/postinst.sh b/deb/src/DEBIAN/postinst.sh deleted file mode 100644 index 62e21ac..0000000 --- a/deb/src/DEBIAN/postinst.sh +++ /dev/null @@ -1,165 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" -nodePath="${mcsmPath}/node" - -## Node -node="${nodePath}/bin/node" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## Install Mode -if [ -d /tmp/mcsmanager/data ]; then - installMode="upgrade" -else - installMode="install" -fi - -## Other -#firewall="" - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho cyan "[-] 正在注册系统服务..." "[-] Registering system service..." - - echo " -[Unit] -Description=MCSManager Daemon - -[Service] -WorkingDirectory=/opt/mcsmanager/daemon -ExecStart=${node} app.js -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service - - echo " -[Unit] -Description=MCSManager Web - -[Service] -WorkingDirectory=/opt/mcsmanager/web -ExecStart=${node} app.js -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-web.service - - LEcho cyan "[-] 正在启动 MCSManager..." "[-] Starting MCSManager..." - - # Start MCSM service - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - systemctl start mcsm-daemon.service - systemctl start mcsm-web.service - - # Check MCSM service - if ! systemctl is-active --quiet mcsm-daemon.service || ! systemctl --quiet is-active mcsm-web.service; then - systemctl status mcsm-{web,daemon}.service - LEcho error "[x] MCSManager 启动失败" "[x] MCSManager failed to start" - fi - - # Allow ports - if command -v ufw; then - ufw allow 23333/tcp - ufw allow 24444/tcp - elif command -v iptables-save; then - iptables -A INPUT -p tcp --dport 23333 -j ACCEPT - iptables -A INPUT -p tcp --dport 24444 -j ACCEPT - iptables-save - #else - # firewall="problem" - fi - - # Output auth information - AuthInfo - return -} - -## Access Information -AuthInfo() { - if [ ${installMode} == "upgrade" ]; then - ip="$(curl -s https://ipconfig.io)" - port=$(cat ${mcsmPath}/web/data/SystemConfig/config.json | grep "httpPort" | tr -cd '0-9') - daemonPort=$(cat ${mcsmPath}/daemon/data/Config/global.json | grep "port" | tr -cd '0-9') - fi - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan "欢迎使用 MCSManager, 您可以通过以下方式访问 MCSManager " "Welcome to MCSManager, you can access it by the following ways" - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan_n "控制面板地址: " "Web Service Address: " - - [ ${installMode} == "upgrade" ] && LEcho cyan "http://${ip}:${port}" "http://${ip}:${port}" - [ ${installMode} == "upgrade" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - #[ ${installMode} == "upgrade" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - - [ ${installMode} == "install" ] && LEcho cyan "http://localhost:23333" "http://localhost:23333" - [ ${installMode} == "install" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports 23333 and 24444 to use the service properly on the Internet." - #[ ${installMode} == "install" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports 23333 and 24444 to use the service properly on the Internet." - - LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More info: https://docs.mcsmanager.com/" - LEcho cyan "==================================================================" "==================================================================" - return -} - -### Start ### -Start -exit 0 diff --git a/deb/src/DEBIAN/preinst.sh b/deb/src/DEBIAN/preinst.sh deleted file mode 100644 index af99458..0000000 --- a/deb/src/DEBIAN/preinst.sh +++ /dev/null @@ -1,291 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### - -## Files -mcsmOldPath="/opt/mcsmanager" -mcsmPath="/opt/mcsmanager" -nodePath="${mcsmPath}/node" - -## Node -nodeVersion="14.19.1" -node="${nodePath}/bin/node" -npm="${node} ${nodePath}/bin/npm" - -## Install Mode -installMode="install" - -## URL -daemonCloneURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" -webCloneURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" -nodeMirror="https://npmmirror.com/mirrors/node" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## CDN -CN=0 - -## Other -try=1 - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Init ### -## Check environment -Init() { - LEcho cyan "[-] 正在初始化环境..." "[-] Initializing environment..." - - # Check functions - CheckMCSM - CheckCN - CheckNodejs - - LEcho cyan "[-] 环境初始化完成" "[-] Environment initialization completed" - return -} - -## Check if MCSM is installed -CheckMCSM() { - if [ -d ${mcsmOldPath} ]; then - LEcho yellow "[-] 检测到已安装的 MCSManager, 切换为更新模式..." "[-] MCSManager has been installed, switching to update mode..." - - # Switch to update mode - installMode="upgrade" - - # Move old MCSM to backup path - mv -f ${mcsmOldPath} ${mcsmOldPath}.bak - - # Remove old service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove old data - if [ -d ${mcsmOldPath} ]; then - rm -rf ${mcsmOldPath} - fi - - # Remove old link - if [ -L /usr/bin/mcsmanager ]; then - rm -f /usr/bin/mcsmanager - fi - fi - - # Prepare for a new install - mkdir -p ${nodePath} - return -} - -## Check if the system is Chinese -CheckCN() { - if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then - LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China" - [ "${zh}" == 1 ] && read -e -r -p "[?] 是否选用中国镜像完成安装? [y/n] " input - [ "${zh}" == 0 ] && read -e -r -p "[?] Whether to use the Chinese mirror to complete the installation? [y/n] " input - case ${input} in - [yY][eE][sS] | [yY]) - LEcho cyan "[-] 选用中国镜像" "[-] Use Chinese mirror" - CN=1 - ;; - *) - LEcho cyan "[-] 不选用中国镜像" "[-] Do not use Chinese mirror" - ;; - esac - fi - if [ "${CN}" == 1 ]; then - daemonCloneURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" - webCloneURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" - export N_NODE_MIRROR=${nodeMirror} - fi - return -} - -## Check nodejs -CheckNodejs() { - if ! /usr/local/bin/n -V; then - if [ "${CN}" == 1 ]; then - npm i -g n --registry=https://registry.npmmirror.com - else - npm i -g n - fi - fi - while true; do - if /usr/local/bin/n ${nodeVersion} -q -d || [ ${try} == 3 ]; then - break - else - LEcho yellow "[!] 安装 Node.js ${nodeVersion} 失败, 重试中... (${try}/3)" "[!] Failed to install Node.js ${nodeVersion}, retrying... (${try}/3)" - fi - sleep 3 - try=${try}+1 - done - cp -r /usr/local/n/versions/node/${nodeVersion}/* ${nodePath}/ - /usr/local/bin/n rm ${nodeVersion} - if ! ${node} --version; then - LEcho error "[x] 未能成功安装最新版本 Node.js" "[x] Failed to install the latest version of Node.js" - fi - LEcho cyan "=============== Node Version ===============" "=============== Node Version ===============" - LEcho cyan "Node 版本: $(${node} --version)" "Node Version: $(${node} --version)" - LEcho cyan "NPM 版本: $(${npm} --version)" "NPM Version: $(${npm} --version)" - LEcho cyan "============================================" "============================================" - return -} - -### Main ### -## Main Install Function -Install() { - LEcho cyan "[-] 正在安装 MCSManager ..." "[-] Installing MCSManager ..." - - # Move to MCSM - cd ${mcsmPath} || LEcho error "[x] 未能成功进入 MCSM 安装目录" "[x] Failed to enter the MCSM installation directory" - - # Download MCSM Daemon - LEcho cyan "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon - - # Download MCSM Web - LEcho cyan "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web - - # Install MCSM Daemon - LEcho cyan "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." - cd daemon || LEcho error "[x] 未能成功进入 MCSM Daemon 安装目录" "[x] Failed to enter the MCSM Daemon installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - # Install MCSM Web - LEcho cyan "[+] 正在安装 MCSManager Web..." "[+] Installing MCSManager Web..." - cd ../web || LEcho error "[x] 未能成功进入 MCSM Web 安装目录" "[x] Failed to enter the MCSManager Web installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - LEcho green "[√] MCSManager 安装完成" "[√] MCSManager installation completed" - - # Check install mode - if [ "${installMode}" == "upgrade" ]; then - mv -f ${mcsmOldPath}.bak/daemon/data/ ${mcsmPath}/daemon/data/ - mv -f ${mcsmOldPath}.bak/web/data/ ${mcsmPath}/web/data/ - if [ ! -d ${mcsmPath}/daemon/data/ ] || [ ! -d ${mcsmPath}/web/data/ ]; then - LEcho yellow "[!] 部分数据迁移失败, 您可能需要到 ${mcsmOldPath}.bak 手动进行迁移" "[!] Some data migration failed, you may need to manually migrate to ${mcsmOldPath}.bak" - fi - LEcho green "[√] 数据迁移完成" "[√] Data migration completed" - fi - return -} - -### Other ### -## Clean up -Clean() { - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - - # Check install mode - if [ ${mcsmOldPath} == "upgrade" ]; then - LEcho cyan "[-] 检测到旧版 MCSManager 备份, 自动恢复中" "[-] Old version of MCSManager backup detected, automatic recovery" - if ! mv -f ${mcsmOldPath}.bak ${mcsmOldPath}; then - LEcho yellow "[!] 旧版 MCSManager 备份文件移动失败, 请手动移动 ${mcsmOldPath}.bak 至 ${mcsmOldPath}" "[!] Old version of MCSManager backup file move failed, please manually move ${mcsmOldPath}.bak to ${mcsmOldPath}" - else - rm -rf ${mcsmOldPath}.bak - fi - fi - return -} - -### Start ### -LEcho cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2022 MCSManager All rights reserved. -+---------------------------------------------------------------------- -| Shell Install Script by Nuomiaa & CreeperKong -+---------------------------------------------------------------------- -" "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2022 MCSManager All rights reserved. -+---------------------------------------------------------------------- -| Shell Install Script by Nuomiaa & CreeperKong -+---------------------------------------------------------------------- -" -## Try to cheat APT -Init -Install -exit 0 diff --git a/deb/src/DEBIAN/prerm.sh b/deb/src/DEBIAN/prerm.sh deleted file mode 100644 index 05c41dd..0000000 --- a/deb/src/DEBIAN/prerm.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Uninstall Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -### Tools ### -# Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho cyan "[-] 正在卸载 MCSManager..." "[-] Uninstalling MCSManager..." - - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - - LEcho green "[+] MCSManager 卸载成功!" "[+] MCSManager Uninstalled!" - return -} - -### Start ### -Start -exit 0 \ No newline at end of file diff --git a/deb_remove.sh b/deb_remove.sh deleted file mode 100644 index 05c41dd..0000000 --- a/deb_remove.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Uninstall Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -### Tools ### -# Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Main ### -Start() { - LEcho cyan "[-] 正在卸载 MCSManager..." "[-] Uninstalling MCSManager..." - - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - - LEcho green "[+] MCSManager 卸载成功!" "[+] MCSManager Uninstalled!" - return -} - -### Start ### -Start -exit 0 \ No newline at end of file diff --git a/deb_setup.sh b/deb_setup.sh deleted file mode 100644 index 1570c0f..0000000 --- a/deb_setup.sh +++ /dev/null @@ -1,442 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Remake By BlueFunny_ - -### Variables ### - -## Files -mcsmOldPath="/opt/mcsmanager" -mcsmPath="/opt/mcsmanager" -nodePath="${mcsmPath}/node" - -## Node -nodeVersion="14.19.1" -node="${nodePath}/bin/node" -npm="${node} ${nodePath}/bin/npm" - -## Install Mode -installMode="install" - -## URL -daemonCloneURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" -webCloneURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" -nodeMirror="https://npmmirror.com/mirrors/node" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## CDN -CN=0 - -## Other -try=1 - -### Tools ### -## Localize echo -LEcho() { - case $1 in - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - error) - Clean - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Init ### -## Check environment -Init() { - LEcho cyan "[-] 正在初始化环境..." "[-] Initializing environment..." - - # Check functions - CheckMCSM - CheckCommand - CheckCN - CheckNodejs - - LEcho cyan "[-] 环境初始化完成" "[-] Environment initialization completed" - return -} - -## Check if all necessary software is installed -CheckCommand() { - LEcho cyan "[-] 正在检查依赖..." "[-] Checking dependencies..." - - # Check git - if [[ $(command -v git) == "" ]]; then - LEcho yellow "[-] 未安装 git" "[-] git is not installed" - LEcho cyan "[-] 正在自动安装 git..." "[-] Automatically installing git..." - [[ $(command -v apt) != "" ]] && apt install -y git - [[ $(command -v yum) != "" ]] && yum install -y git - [[ $(command -v pacman) != "" ]] && pacman -S git - [[ $(command -v dnf) != "" ]] && dnf install -y git - if [[ $(command -v git) == "" ]]; then LEcho error "[x] 未能自动安装 git, 请手动安装或重试" "[x] Unable to automatically install git, please manually install or try again"; fi - fi - - # Check curl - if [ "$(command -v curl)" == "" ]; then - LEcho yellow "[-] 未安装 curl" "[-] curl is not installed" - LEcho cyan "[-] 正在自动安装 curl..." "[-] Automatically installing curl..." - [[ $(command -v apt) != "" ]] && apt install -y curl - [[ $(command -v yum) != "" ]] && yum install -y curl - [[ $(command -v pacman) != "" ]] && pacman -S curl - [[ $(command -v dnf) != "" ]] && dnf install -y curl - if [[ $(command -v curl) == "" ]]; then LEcho error "[x] 未能自动安装 curl, 请手动安装或重试" "[x] Unable to automatically install curl, please manually install or try again"; fi - fi - - # Check wget - if [ "$(command -v wget)" == "" ]; then - LEcho yellow "[-] 未安装 wget" "[-] wget is not installed" - LEcho cyan "[-] 正在自动安装 wget..." "[-] Automatically installing wget..." - [[ $(command -v apt) != "" ]] && apt install -y wget - [[ $(command -v yum) != "" ]] && yum install -y wget - [[ $(command -v pacman) != "" ]] && pacman -S wget - [[ $(command -v dnf) != "" ]] && dnf install -y wget - if [[ $(command -v wget) == "" ]]; then LEcho error "[x] 未能自动安装 wget, 请手动安装或重试" "[x] Unable to automatically install wget, please manually install or try again"; fi - fi - - # Check tar - if [ "$(command -v tar)" == "" ]; then - LEcho yellow "[-] 未安装 tar" "[-] tar is not installed" - LEcho cyan "[-] 正在自动安装 tar..." "[-] Automatically installing tar..." - [[ $(command -v apt) != "" ]] && apt install -y tar - [[ $(command -v yum) != "" ]] && yum install -y tar - [[ $(command -v pacman) != "" ]] && pacman -S tar - [[ $(command -v dnf) != "" ]] && dnf install -y tar - if [[ $(command -v tar) == "" ]]; then LEcho error "[x] 未能自动安装 tar, 请手动安装或重试" "[x] Unable to automatically install tar, please manually install or try again"; fi - fi - - # Check npm - if [ "$(command -v npm)" == "" ]; then - LEcho yellow "[-] 未安装 npm" "[-] npm is not installed" - LEcho cyan "[-] 正在自动安装 npm..." "[-] Automatically installing npm..." - [[ $(command -v apt) != "" ]] && apt install -y npm - [[ $(command -v yum) != "" ]] && yum install -y npm - [[ $(command -v pacman) != "" ]] && pacman -S npm - [[ $(command -v dnf) != "" ]] && dnf install -y npm - if [[ $(command -v npm) == "" ]]; then LEcho error "[x] 未能自动安装 npm, 请手动安装或重试" "[x] Unable to automatically install npm, please manually install or try again"; fi - fi - - LEcho cyan "[-] 依赖检查完成" "[-] Dependency check completed" - return -} - -## Check if MCSM is installed -CheckMCSM() { - if [ -d ${mcsmOldPath} ]; then - LEcho yellow "[-] 检测到已安装的 MCSManager, 切换为更新模式..." "[-] MCSManager has been installed, switching to update mode..." - - # Switch to update mode - installMode="upgrade" - - # Move old MCSM to backup path - mv -f ${mcsmOldPath} ${mcsmOldPath}.bak - - # Remove old service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove old data - if [ -d ${mcsmOldPath} ]; then - rm -rf ${mcsmOldPath} - fi - - # Remove old link - if [ -L /usr/bin/mcsmanager ]; then - rm -f /usr/bin/mcsmanager - fi - fi - - # Prepare for a new install - mkdir -p ${nodePath} - return -} - -## Check if the system is Chinese -CheckCN() { - if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then - LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China" - [ "${zh}" == 1 ] && read -e -r -p "[?] 是否选用中国镜像完成安装? [y/n] " input - [ "${zh}" == 0 ] && read -e -r -p "[?] Whether to use the Chinese mirror to complete the installation? [y/n] " input - case ${input} in - [yY][eE][sS] | [yY]) - LEcho cyan "[-] 选用中国镜像" "[-] Use Chinese mirror" - CN=1 - ;; - *) - LEcho cyan "[-] 不选用中国镜像" "[-] Do not use Chinese mirror" - ;; - esac - fi - if [ "${CN}" == 1 ]; then - daemonCloneURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" - webCloneURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" - export N_NODE_MIRROR=${nodeMirror} - fi - return -} - -## Check nodejs -CheckNodejs() { - if ! /usr/local/bin/n -V; then - if [ "${CN}" == 1 ]; then - npm i -g n --registry=https://registry.npmmirror.com - else - npm i -g n - fi - fi - while true; do - if /usr/local/bin/n ${nodeVersion} -q -d || [ ${try} == 3 ]; then - break - else - LEcho yellow "[!] 安装 Node.js ${nodeVersion} 失败, 重试中... (${try}/3)" "[!] Failed to install Node.js ${nodeVersion}, retrying... (${try}/3)" - fi - sleep 3 - try=${try}+1 - done - cp -r /usr/local/n/versions/node/${nodeVersion}/* ${nodePath}/ - /usr/local/bin/n rm ${nodeVersion} - if ! ${node} --version; then - LEcho error "[x] 未能成功安装最新版本 Node.js" "[x] Failed to install the latest version of Node.js" - fi - LEcho yellow "=============== Node Version ===============" "=============== Node Version ===============" - LEcho yellow "Node 版本: $(${node} --version)" "Node Version: $(${node} --version)" - LEcho yellow "NPM 版本: $(${npm} --version)" "NPM Version: $(${npm} --version)" - LEcho yellow "============================================" "============================================" - return -} - -### Main ### -## Main Install Function -Install() { - LEcho cyan "[-] 正在安装 MCSManager ..." "[-] Installing MCSManager ..." - - # Move to MCSM - cd ${mcsmPath} || LEcho error "[x] 未能成功进入 MCSM 安装目录" "[x] Failed to enter the MCSM installation directory" - - # Download MCSM Daemon - LEcho cyan "[↓] 正在下载 MCSManager Daemon..." "[↓] Downloading MCSManager Daemon..." - git clone --single-branch -b master --depth 1 ${daemonCloneURL} - mv -f MCSManager-Daemon-Production daemon - - # Download MCSM Web - LEcho cyan "[↓] 正在下载 MCSManager Web..." "[↓] Downloading MCSManager Web..." - git clone --single-branch -b master --depth 1 ${webCloneURL} - mv -f MCSManager-Web-Production web - - # Install MCSM Daemon - LEcho cyan "[+] 正在安装 MCSManager Daemon..." "[+] Installing MCSManager Daemon..." - cd daemon || LEcho error "[x] 未能成功进入 MCSM Daemon 安装目录" "[x] Failed to enter the MCSM Daemon installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - # Install MCSM Web - LEcho cyan "[+] 正在安装 MCSManager Web..." "[+] Installing MCSManager Web..." - cd ../web || LEcho error "[x] 未能成功进入 MCSM Web 安装目录" "[x] Failed to enter the MCSManager Web installation directory" - if [ "${CN}" == 1 ]; then - ${npm} i --registry=https://registry.npmmirror.com - else - ${npm} i - fi - - LEcho green "[√] MCSManager 安装完成" "[√] MCSManager installation completed" - - # Check install mode - if [ "${installMode}" == "upgrade" ]; then - mv -f ${mcsmOldPath}.bak/daemon/data/ ${mcsmPath}/daemon/data/ - mv -f ${mcsmOldPath}.bak/web/data/ ${mcsmPath}/web/data/ - if [ ! -d ${mcsmPath}/daemon/data/ ] || [ ! -d ${mcsmPath}/web/data/ ]; then - LEcho yellow "[!] 部分数据迁移失败, 您可能需要到 ${mcsmOldPath}.bak 手动进行迁移" "[!] Some data migration failed, you may need to manually migrate to ${mcsmOldPath}.bak" - fi - LEcho green "[√] 数据迁移完成" "[√] Data migration completed" - fi - LEcho cyan "[-] 正在注册系统服务..." "[-] Registering system service..." - - echo " -[Unit] -Description=MCSManager Daemon - -[Service] -WorkingDirectory=/opt/mcsmanager/daemon -ExecStart=${node} app.js -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service - - echo " -[Unit] -Description=MCSManager Web - -[Service] -WorkingDirectory=/opt/mcsmanager/web -ExecStart=${node} app.js -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-web.service - - LEcho cyan "[-] 正在启动 MCSManager..." "[-] Starting MCSManager..." - - # Start MCSM service - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - systemctl start mcsm-daemon.service - systemctl start mcsm-web.service - - # Check MCSM service - if ! systemctl is-active --quiet mcsm-daemon.service || ! systemctl --quiet is-active mcsm-web.service; then - systemctl status mcsm-{web,daemon}.service - LEcho error "[x] MCSManager 启动失败" "[x] MCSManager failed to start" - fi - - # Allow ports - if command -v ufw; then - ufw allow 23333/tcp - ufw allow 24444/tcp - elif command -v iptables-save; then - iptables -A INPUT -p tcp --dport 23333 -j ACCEPT - iptables -A INPUT -p tcp --dport 24444 -j ACCEPT - iptables-save - #else - # firewall="problem" - fi - - # Output auth information - AuthInfo - return -} - -## Access Information -AuthInfo() { - if [ ${installMode} == "upgrade" ]; then - ip="$(curl -s https://ipconfig.io)" - port=$(cat ${mcsmPath}/web/data/SystemConfig/config.json | grep "httpPort" | tr -cd '0-9') - daemonPort=$(cat ${mcsmPath}/daemon/data/Config/global.json | grep "port" | tr -cd '0-9') - fi - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan "欢迎使用 MCSManager, 您可以通过以下方式访问 MCSManager " "Welcome to MCSManager, you can access it by the following ways" - LEcho cyan "==================================================================" "==================================================================" - LEcho cyan_n "控制面板地址: " "Web Service Address: " - - [ ${installMode} == "upgrade" ] && LEcho cyan "http://${ip}:${port}" "http://${ip}:${port}" - [ ${installMode} == "upgrade" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - #[ ${installMode} == "upgrade" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 ${port} 和 ${daemonPort} 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports ${port} and ${daemonPort} to use the service properly on the Internet." - - [ ${installMode} == "install" ] && LEcho cyan "http://localhost:23333" "http://localhost:23333" - [ ${installMode} == "install" ] && LEcho yellow "若无法访问面板, 请检查 [云防火墙 / 安全组] 是否有放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "You must expose ports 23333 and 24444 to use the service properly on the Internet." - #[ ${installMode} == "install" ] && [ ${firewall} == "problem" ] && LEcho red "您的服务器没有安装防火墙, 请自行放行面板 23333 和 24444 端口, 控制面板需要这两个端口才能正常工作" "Your server does not have a firewall installed, please expose ports 23333 and 24444 to use the service properly on the Internet." - - LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More info: https://docs.mcsmanager.com/" - LEcho cyan "==================================================================" "==================================================================" - return -} - -### Other ### -## Clean up -Clean() { - # Remove service - if [ -f /etc/systemd/system/mcsm-daemon.service ]; then - systemctl is-active --quiet mcsm-daemon && systemctl stop mcsm-daemon - systemctl disable mcsm-daemon - rm -f /etc/systemd/system/mcsm-daemon.service - fi - if [ -f /etc/systemd/system/mcsm-web.service ]; then - systemctl is-active --quiet mcsm-web && systemctl stop mcsm-web - systemctl disable mcsm-web - rm -f /etc/systemd/system/mcsm-web.service - fi - systemctl daemon-reload - - # Remove MCSManager - if [ -d "${mcsmPath}" ]; then - rm -rf "${mcsmPath}" - fi - - # Check install mode - if [ ${mcsmOldPath} == "upgrade" ]; then - LEcho cyan "[-] 检测到旧版 MCSManager 备份, 自动恢复中" "[-] Old version of MCSManager backup detected, automatic recovery" - if ! mv -f ${mcsmOldPath}.bak ${mcsmOldPath}; then - LEcho yellow "[!] 旧版 MCSManager 备份文件移动失败, 请手动移动 ${mcsmOldPath}.bak 至 ${mcsmOldPath}" "[!] Old version of MCSManager backup file move failed, please manually move ${mcsmOldPath}.bak to ${mcsmOldPath}" - else - rm -rf ${mcsmOldPath}.bak - fi - fi - return -} - -### Start ### -LEcho cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2022 MCSManager All rights reserved. -+---------------------------------------------------------------------- -| Shell Install Script by Nuomiaa & CreeperKong -| Remake By BlueFunny_ -+---------------------------------------------------------------------- -" "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2022 MCSManager All rights reserved. -+---------------------------------------------------------------------- -| Shell Install Script by Nuomiaa & CreeperKong -| Remake By BlueFunny_ -+---------------------------------------------------------------------- -" -## Try to cheat APT -Init -Install -exit 0 diff --git a/setup.sh b/setup.sh index 5402ff3..5fcc2ec 100644 --- a/setup.sh +++ b/setup.sh @@ -1,187 +1,446 @@ -#!/bin/bash -printf "\033c" +#!/usr/bin/env bash + +#### MCSM Install Script +#### Made By nuomiaa, CreeperKong, unitwk +#### Recode By BlueFunny_ + +### Variables ### +## Files +mcsmPath="/opt/mcsmanager" +mcsmDaemonDPath="${mcsmPath}/daemon/data" +mcsmWebDPath="${mcsmPath}/web/data" +nodePath="${mcsmPath}/node" +tmpPath="/tmp/mcsmanager-setup" + +## Node +nodeVersion="v14.19.1" +node="${nodePath}/bin/node" +npm="${nodePath}/bin/npm" + +## Setup tools mode +mode="install" + +## URL +nodeMirror="https://nodejs.org/dist" +daemonCloneURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" +webCloneURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" +nodeFileURL="${nodeMirror}/${nodeVersion}/node-${nodeVersion}-linux-${arch}.tar.gz" +nodeHashURL="${nodeMirror}/${nodeVersion}/SHASUMS256.txt" + +## Language +if [ "$(locale -a | grep "zh_CN")" != "" ]; then + zh=1 + export LANG="zh_CN.UTF-8" +else + zh=0 +fi -error="" -node="v14.19.1" +## Other +try=1 +os=$(uname -a) arch=$(uname -m) -mcsmanager_install_path="/opt/mcsmanager" -zh=$([[ $(locale -a) =~ "zh" ]] && echo 1; export LANG=zh_CN.UTF-8 || echo 0) - -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 +skipNodeInstall=0 +skipMCSMInstall=0 + +### Tools ### +## Localize echo +# $1: color +# $2: zh +# $3: en +LEcho() { + case $1 in + # Red color echo + red) + [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" + ;; + + # Green color echo + green) + [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" + ;; + + # Cyan color echo + cyan) + [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" + ;; + + # Cyan color echo (No line break) + cyan_n) + [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" + [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" + ;; + + # Yellow color echo + yellow) + [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" + ;; + + # Red error echo + error) + echo '=================================================' + [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" + echo '=================================================' + exit 1 + ;; + + # No color echo + *) + [ "${zh}" == 1 ] && echo "$2" + [ "${zh}" == 0 ] && echo "$3" + ;; + esac + return } -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} +### Entry Point ### +## Program entry point +Main() { + LEcho cyan "[-] 正在检查环境..." "[-] Initializing environment..." -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} + # Check mode + if [ "$1" == "uninstall" ]; then + mode="uninstall" + fi -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} + # Create temp dir + if ! [ ! -d "${tmpPath}" ] && mkdir -p "${tmpPath}" || rm -rf "${tmpPath}" && mkdir -p "${tmpPath}"; then + CheckRoot + LEcho error "[x] 未能成功创建临时目录, 请检查权限" "[x] Failed to create temporary directory, please check permissions" + fi + + # Check functions collection + if [ "${mode}" == "install" ]; then + # Install + CheckSystem + CheckOldFiles "$1" + CheckNetwork + CheckCN + SetArgs "$1" "$2" + + LEcho cyan "[-] 环境检查完毕, 开始安装 MCSManager" "[-] Environment check completed, start installing MCSManager" + + Install + + if [ -d "${tmpPath}"/mcsmanager ] || [ -d "${tmpPath}"/node ]; then + LEcho cyan "[-] 检测到备份文件, 正在恢复中..." "[-] Backup files detected, recovering..." + MirgrateFiles + fi + else + # Uninstall + CheckRoot + CheckInstall + + LEcho cyan "[-] 环境校验完毕, 开始卸载 MCSManager" "[-] Environment check completed, start uninstalling MCSManager" -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" + Remove "$1" + fi + + return } -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" +### Init ### +## Check if mcsm installed +CheckInstall() { + if [ ! -d ${mcsmPath} ]; then + LEcho error "[x] 检测到您没有安装 MCSManager, 谨慎的拒绝卸载请求" "[x] It is detected that you have not installed MCSManager, and the uninstall request is rejected" + fi + return } -Install_Node() { - if [ "$zh" == 1 ]; - then echo_cyan_n "[+] 安装 Node 环境... " - else echo_cyan_n "[+] Install Node environment... " +## Check OS +CheckOS() { + if [ "$(echo "${os}" | grep "Ubuntu")" == "" ] && [ "$(echo "${os}" | grep "Debian")" == "" ] && [ "$(echo "${os}" | grep "CentOS")" == "" ]; then + LEcho error "[x] 本脚本仅支持 Ubuntu/Debian/CentOS 系统!" "[x] This script only supports Ubuntu/Debian/CentOS systems!" fi + return +} - rm -irf "$node_install_path" +## Check user permission +CheckRoot() { + if [ "$(whoami)" != "root" ]; then + LEcho error "[x] 请使用 root 用户或者使用 sudo 命令执行脚本!" "[x] Please use root user or use sudo command to execute the script!" + fi + return +} - cd /opt || exit +## Check system environment +CheckSystem() { + # Function reuse + CheckRoot + CheckOS - wget -o /dev/null https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz + # Check Tools + if [ -f /etc/redhat-release ]; then + yum install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" + else + apt-get install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" + fi - tar -zxf node-"$node"-linux-"$arch".tar.gz + # Check Arch + case "${arch}" in + x86_64) + arch=x64 + ;; + aarch64) + arch=arm64 + ;; + arm) + arch=armv7l + ;; + ppc64le) + arch=ppc64le + ;; + s390x) + arch=s390x + ;; + *) + LEcho error "[x] 当前系统架构暂不受 Node.js 支持, 无法安装 MCSManager" "[x] The current system architecture is not supported by Node.js, MCSManager cannot be installed" + ;; + esac + + LEcho green "[√] 系统环境检查完成" "[√] System environment check completed" + return +} - rm -rf node-"$node"-linux-"$arch".tar.gz - - if [ ! -L /usr/bin/node ] && [ ! -f /usr/bin/node ];then - ln -s "$node_install_path"/bin/node /usr/bin/node - fi - if [ ! -L /usr/bin/npm ] && [ ! -f /usr/bin/npm ];then - ln -s "$node_install_path"/bin/npm /usr/bin/npm +## Check if MCSManager is already installed on system +CheckOldFiles() { + # Check old MCSManager files + if [ -d ${mcsmPath} ]; then + LEcho echo "[-] 检测到旧版本 MCSManager, 正在迁移文件中" "[-] Old version MCSManager detected, migrating files" + # Create backup dir + [ ! -d ${tmpPath}/mcsmanager ] && mkdir -p ${tmpPath}/mcsmanager + [ ! -d ${tmpPath}/systemd ] && mkdir -p ${tmpPath}/systemd + + # Stop service + systemctl stop mcsm-daemson.service + systemctl stop mcsm-web.service + systemctl disable mcsm-daemon.service + systemctl disable mcsm-web.service + + # Move files + mv -f ${mcsmPath}/web ${tmpPath}/mcsmanager/web + mv -f ${mcsmPath}/daemon ${tmpPath}/mcsmanager/daemon + mv -f /etc/systemd/system/mcsm-daemon.service "${tmpPath}"/systemd/mcsm-daemon.service + mv -f /etc/systemd/system/mcsm-web.service "${tmpPath}"/systemd/mcsm-web.service fi - chmod +x "$node_install_path"/bin/node - chmod +x "$node_install_path"/bin/npm + # Check old node files + if [ -d ${nodePath} ]; then + LEcho echo "[-] 检测到旧版本 Node.js, 正在比对版本中" "[-] Old version Node.js detected, comparing versions" - if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] - then - if [ "$zh" == 1 ]; - then echo_green "成功" - else echo_green "Success" - fi - else - if [ "$zh" == 1 ]; - then - echo_red "失败" - Red_Error "[x] Node 安装失败!" - else - echo_red "Failed" - Red_Error "[x] Node installation failed!" + # Check node version + if [ "$(${node} -v)" == "${nodeVersion}" ]; then + LEcho echo "[-] Node.js 版本匹配, 跳过 Node.js 下载" "[-] Node.js version matches, skipping Node.js download" + mv -f ${nodePath} ${tmpPath}/node + skipNodeInstall=1 fi fi - echo - echo_yellow "=============== Node Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node Version ===============" - echo + # Remove old files + Remove "$1" - sleep 3 + # Create new dir + mkdir -p ${mcsmPath} + + LEcho green "[√] 旧文件检查完毕" "[√] Old file check completed" + return } -Install_MCSManager() { - if [ "$zh" == 1 ]; - then echo_cyan "[+] 安装 MCSManager..." - else echo_cyan "[+] Install MCSManager..." +# Check network +CheckNetwork() { + if [ "$(curl -m 10 -s https://www.baidu.com)" == "" ]; then + LEcho error "[x] 未能成功连接到网络, 请检查网络连接后重试" "[x] Failed to connect to the network, please check the network connection and try again" fi + LEcho green "[√] 网络连接正常" "[√] Network connection is normal" + return +} - # 删除服务 - rm -f /etc/systemd/system/mcsm-daemon.service - rm -f /etc/systemd/system/mcsm-web.service +# Check if the server is in China +CheckCN() { + if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then + # LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China" + # [ "${zh}" == 1 ] && read -e -r -p "[?] 是否选用中国镜像完成安装? [y/n] " input + # [ "${zh}" == 0 ] && read -e -r -p "[?] Whether to use the Chinese mirror to complete the installation? [y/n] " input + # case ${input} in + # [yY][eE][sS] | [yY]) + # LEcho cyan "[-] 选用中国镜像" "[-] Use Chinese mirror" + # daemonCloneURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" + # webCloneURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" + # nodeMirror="https://npmmirror.com/mirrors/node" + # ;; + # *) + # LEcho cyan "[-] 不选用中国镜像" "[-] Do not use Chinese mirror" + # ;; + # esac + LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国, 已自动切换为中国镜像源" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China, and the Chinese mirror source has been automatically switched" + daemonCloneURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" + webCloneURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" + nodeMirror="https://npmmirror.com/mirrors/node" + else + LEcho cyan "[-] 检测服务器地理位置出错, 跳过检测" "[-] Error detecting server location, skipping detection" + fi + LEcho green "[√] 服务器地理位置检查完毕" "[√] Location check completed" + return +} - # 重载 - systemctl daemon-reload - - # echo "[x] Delete the original MCSManager" - rm -irf ${mcsmanager_install_path} +# Set Debug Args +SetArgs() { + # Warning + LEcho yellow "[!] 检测到您已启用 debug 功能, 安装可能会导致不可预知的错误" "[!] Debug mode is enabled, installation may cause unpredictable errors" + LEcho yellow "[!] 此模式导致的任何问题都不会得到解决" "[!] Any problems caused by this mode will not be solved" + + # Set args + if [ "$1" != "" ] && [ "$1" != "remove" ]; then + if [ "$1" == "force" ]; then + LEcho echo "[-] 强制下载 Node.js" "[-] Force download Node.js" + skipNodeInstall=0 + fi + if [ "$1" == "skipnode" ]; then + LEcho echo "[-] 已跳过 Node.js 安装" "[-] Skipped Node.js installation" + skipNodeInstall=1 + fi + if [ "$1" == "skipmcsm" ]; then + LEcho echo "[-] 已跳过 MCSManager 安装" "[-] Skipped MCSManager installation" + skipMCSMInstall=1 + fi + if [ "$1" == "custom" ] && [ "$2" != "" ]; then + LEcho echo "[-] 自定义安装路径为: $2" "[-] Custom installation path: $2" + mcsmPath="$2" + fi + if [ "$1" == "node" ] && [ "$2" != "" ]; then + LEcho echo "[-] 自定义 Node.js 下载链接为: $2" "[-] Custom Node.js download link: $2" + nodeMirror="$2" + fi + fi +} - # echo "[+] mkdir -p ${mcsmanager_install_path}" - mkdir -p ${mcsmanager_install_path} || exit +### Main ### +## Main install function +Install() { + InstallNode + [ ${skipMCSMInstall} != 1 ] && InstallMCSM +} - # echo "[→] cd ${mcsmanager_install_path}" - cd ${mcsmanager_install_path} || exit +## Install Node.js +InstallNode() { + if [ ${skipNodeInstall} == 1 ]; then + if [ ! -d ${tmpPath}/node ]; then + LEcho echo "[-] 跳过 Node.js 安装" "[-] Skipped Node.js installation" + else + mv -f ${tmpPath}/node ${nodePath} + fi + else + LEcho echo "[+] 正在安装 Node.js" "[+] Installing Node.js" - if [ "$zh" == 1 ]; - then echo_cyan "[↓] Git 克隆 MCSManager-Daemon..." - else echo_cyan "[↓] Git clone MCSManager-Daemon..." - fi - git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git + # Download Node.js + wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.tar.gz "${nodeFileURL}" + wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.sha256 "${nodeHashURL}" - # echo "[-] mv MCSManager-Daemon-Production daemon" - mv MCSManager-Daemon-Production daemon + # Check hash + cat ${tmpPath}/node.sha256 | grep "${nodeVersion}/node-${nodeVersion}-linux-${arch}.tar.gz" | tee ${tmpPath}/node.sha256 + cd ${tmpPath} || LEcho red "[x] 校验出错, 无法继续进行下一步, 退回操作中..." "[x] Verification error, unable to continue to the next step, returning to operation..." && Revert + sha256sum -c ${tmpPath}/node.sha256 || LEcho red "[x] 校验出错, 无法继续进行下一步, 退回操作中..." "[x] Verification error, unable to continue to the next step, returning to operation..." && Revert - # echo "[→] cd daemon" - cd daemon || exit + # Extract Node.js + tar -xzvf ${tmpPath}/node.tar.gz -C ${nodePath} --strip-components=1 - if [ "$zh" == 1 ]; - then echo_cyan "[+] 安装 MCSManager-Daemon 依赖库..." - else echo_cyan "[+] Install MCSManager-Daemon dependencies..." - fi - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com > error + # Set permission + chmod +x ${node} + chmod +x ${npm} - # echo "[←] cd .." - cd .. + # Check Node.js installation + if ! ${node} -v; then + LEcho red "[x] Node.js 安装失败, 无法继续进行下一步, 退回操作中..." "[x] Node.js installation failed, please check the network connection" + Revert + fi + if ! ${npm} -v; then + LEcho red "[x] Node.js 安装失败, 无法继续进行下一步, 退回操作中..." "[x] Node.js installation failed, please check the network connection" + Revert + fi - if [ "$zh" == 1 ]; - then echo_cyan "[↓] Git 克隆 MCSManager-Web..." - else echo_cyan "[↓] Git clone MCSManager-Web..." + # Output Node.js version + echo + LEcho cyan "=============== Node 版本 ===============" "=============== Node Version ===============" + LEcho cyan_n " Node: " " Node: " + LEcho echo "$("${node}" -v)" "$("${node}" -v)" + LEcho cyan_n " NPM: " " NPM: " + LEcho echo "v$("${npm}" -v)" "v$("${npm}" -v)" + LEcho cyan "=========================================" "=============== Node Version ===============" + echo + + sleep 3 + LEcho green "[√] Node.js 安装完毕" "[√] Node.js installation completed" fi - git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Web-Production.git - - # echo "[-] mv MCSManager-Web-Production web" - mv MCSManager-Web-Production web + return +} - # echo "[→] cd web" - cd web || exit +## Install MCSManager +InstallMCSM() { + # Clone MCSManager daemon and web + git clone --single-branch -b master --depth 1 ${daemonCloneURL} "${mcsmPath}/daemon" + git clone --single-branch -b master --depth 1 ${webCloneURL} "${mcsmPath}/web" - if [ "$zh" == 1 ]; - then echo_cyan "[+] 安装 MCSManager-Web 依赖库..." - else echo_cyan "[+] Install MCSManager-Web dependencies..." - fi - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com > error + # Install Node.js dependencies + cd "${mcsmPath}/daemon" || LEcho red "[x] 无法进入 MCSManager 守护进程目录, 无法继续进行下一步, 退回操作中..." "[x] Unable to enter the MCSManager daemon directory, unable to continue to the next step, returning to operation..." && Revert + ${npm} install --registry=https://registry.npmmirror.com >error + cd "${mcsmPath}/web" || LEcho red "[x] 无法进入 MCSManager 网页面板目录, 无法继续进行下一步, 退回操作中..." "[x] Unable to enter the MCSManager web directory, unable to continue to the next step, returning to operation..." && Revert + ${npm} install --registry=https://registry.npmmirror.com >error + # Output MCSManager install path echo - echo_yellow "=============== MCSManager ===============" - echo_green " Daemon: ${mcsmanager_install_path}/daemon" - echo_green " Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" + LEcho cyan "=============== MCSManager 安装目录 ===============" "=============== MCSManager Install Path ===============" + LEcho cyan_n " Daemon: " " Daemon: " + LEcho echo "${mcsmPath}/daemon" "${mcsmPath}/daemon" + LEcho cyan_n " Web: " " Web: " + LEcho echo "${mcsmPath}/web" "${mcsmPath}/web" + LEcho cyan "==================================================" "=============== MCSManager Install Path ===============" echo - if [ "$zh" == 1 ]; - then echo_green "[+] MCSManager 安装成功!" - else echo_green "[+] MCSManager installation success!" + + # Function reuse + CreateService + MirgrateFiles + + # Test the availability of MCSManager + if ! systemctl start mcsm-web; then + LEcho red "[x] MCSManager 网页面板启动失败, 无法继续进行下一步, 退回操作中..." "[x] MCSManager installation failed, unable to continue to the next step, returning to operation..." && Revert + else + systemctl stop mcsm-web + fi + if ! systemctl start mcsm-daemon; then + LEcho red "[x] MCSManager 守护进程启动失败, 无法继续进行下一步, 退回操作中..." "[x] MCSManager installation failed, unable to continue to the next step, returning to operation..." && Revert + else + systemctl stop mcsm-daemon fi + LEcho green "[√] MCSManager 安装完毕" "[√] MCSManager installation completed" + sleep 3 + Output + return } -Create_Service() { - if [ "$zh" == 1 ]; - then echo_cyan "[+] 创建 MCSManager 服务..." - else echo_cyan "[+] Create MCSManager service..." - fi - +## Create systemd service +CreateService() { + # Write systemd service echo " [Unit] Description=MCSManager Daemon [Service] WorkingDirectory=/opt/mcsmanager/daemon -ExecStart=${node_install_path}/bin/node app.js +ExecStart=${nodePath}/bin/node app.js ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-daemon.service +" >/etc/systemd/system/mcsm-daemon.service echo " [Unit] @@ -189,173 +448,143 @@ Description=MCSManager Web [Service] WorkingDirectory=/opt/mcsmanager/web -ExecStart=${node_install_path}/bin/node app.js +ExecStart=${nodePath}/bin/node app.js ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-web.service +" >/etc/systemd/system/mcsm-web.service - # 重载 + # Enable systemd service systemctl daemon-reload - - # 创建 Daemon 服务 systemctl enable mcsm-daemon.service --now - - # 创建 Web 服务 systemctl enable mcsm-web.service --now sleep 3 + return +} + +## Mirgrate data +MirgrateFiles() { + # Mirgrate mcsmanager data + if [ -d "${tmpPath}"/mcsmanager ]; then + [ ! -d "${mcsmWebDPath}" ] && mv -f "${tmpPath}"/mcsmanager/web/data "${mcsmWebDPath}" || rm -rf ${mcsmWebDPath} && mv -f "${tmpPath}"/mcsmanager/web/data "${mcsmWebDPath}" + [ ! -d "${mcsmWebDPath}" ] && mv -f "${tmpPath}"/mcsmanager/daemon/data "${mcsmDaemonDPath}" || rm -rf ${mcsmDaemonDPath} && mv -f "${tmpPath}"/mcsmanager/daemon/data "${mcsmDaemonDPath}" + fi + + # Mirgrate old node files + if [ -d "${tmpPath}"/node ]; then + mv -f "${tmpPath}"/node "${nodePath}" + fi +} +## Output MCSManager information +Output() { printf "\033c" - echo_yellow "==================================================================" - if [ "$zh" == 1 ]; - then - echo_green "欢迎使用 MCSManager,您可以通过以下方式访问:" - echo_yellow "==================================================================" - echo_cyan_n "控制面板地址: "; echo_yellow "http://localhost:23333" - echo_red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" - echo_yellow "==================================================================" - echo_cyan "重启 systemctl restart mcsm-{daemon,web}.service" - echo_cyan "禁用 systemctl disable mcsm-{daemon,web}.service" - echo_cyan "启用 systemctl enable mcsm-{daemon,web}.service" - echo_cyan "启动 systemctl start mcsm-{daemon,web}.service" - echo_cyan "停止 systemctl stop mcsm-{daemon,web}.service" - echo_cyan "更多使用说明,请参考:https://docs.mcsmanager.com/" - else - echo_green "Welcome to MCSManager, you can access it by the following ways:" - echo_yellow "==================================================================" - echo_cyan_n "Web Service Address: "; echo_yellow "http://localhost:23333" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow "==================================================================" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_cyan "systemctl disable mcsm-{daemon,web}.service" - echo_cyan "systemctl enable mcsm-{daemon,web}.service" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "More info: https://docs.mcsmanager.com/" + LEcho yellow "==================================================================" "==================================================================" + LEcho green "欢迎使用 MCSManager, 您可以通过以下方式访问: " "Welcome to use MCSManager, you can access it through the following ways:" + LEcho yellow "==================================================================" "==================================================================" + LEcho cyan_n "控制面板地址: " "Control panel address: " + LEcho yellow "http://localhost:23333" "http://localhost:23333" + LEcho red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" "If you can't access the panel, please check if the firewall/security group has opened the panel 23333 and 24444 ports. The control panel needs these two ports to work properly." + LEcho yellow "==================================================================" "==================================================================" + LEcho cyan "重启 systemctl restart mcsm-{daemon,web}.service" "Restart systemctl restart mcsm-{daemon,web}.service" + LEcho cyan "禁用 systemctl disable mcsm-{daemon,web}.service" "Disable systemctl disable mcsm-{daemon,web}.service" + LEcho cyan "启用 systemctl enable mcsm-{daemon,web}.service" "Enable systemctl enable mcsm-{daemon,web}.service" + LEcho cyan "启动 systemctl start mcsm-{daemon,web}.service" "Start systemctl start mcsm-{daemon,web}.service" + LEcho cyan "停止 systemctl stop mcsm-{daemon,web}.service" "Stop systemctl stop mcsm-{daemon,web}.service" + LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More usage instructions, please refer to: https://docs.mcsmanager.com/" + LEcho yellow "==================================================================" "==================================================================" +} + +## Main remove function +Remove() { + # Stop systemd service + if [ "$1" != "remove" ]; then + systemctl stop mcsm-daemson.service + systemctl stop mcsm-web.service + systemctl disable mcsm-daemon.service + systemctl disable mcsm-web.service fi - echo_yellow "==================================================================" - + # Remove systemd service + [ -f /etc/systemd/system/mcsm-daemon.service ] && rm -rf /etc/systemd/system/mcsm-daemon.service + [ -f /etc/systemd/system/mcsm-daemon.service ] && rm -rf /etc/systemd/system/mcsm-web.service + systemctl daemon-reload + # Ask if data is retained + if [ -d "${mcsmDaemonDPath}" ] || [ -d "${mcsmWebDPath}" ]; then + LEcho yellow "[?] 是否保留数据?" "[?] Do you want to keep the data?" + read -r -p "[y/N]:" input + case ${input} in + [yY][eE][sS] | [yY]) + LEcho echo "[-] 保留数据" "[-] Keep data" + mv -f "${mcsmDaemonDPath}" "${tmpPath}"/mcsmanager/daemon + mv -f "${mcsmWebDPath}" "${tmpPath}"/mcsmanager/web + rm -rf "${mcsmPath}" + mv -f "${tmpPath}"/mcsmanager "${mcsmPath}.old" + ;; + *) + LEcho echo "[-] 删除数据" "[-] Delete data" + rm -rf "${mcsmPath}" + ;; + esac + fi + return } +### Other Functions ### +## Revert Script Operation +Revert() { + # Remove new files + rm -rf "${mcsmPath}" + rm -rf "${nodePath}" + rm -rf /etc/systemd/system/mcsm-daemon.service + rm -rf /etc/systemd/system/mcsm-web.service + + # Restore old files + mv -f "${tmpPath}"/mcsmanager "${mcsmPath}" + mv -f "${tmpPath}"/node "${nodePath}" + mv -f "${tmpPath}"/systemd/mcsm-daemon.service /etc/systemd/system/mcsm-daemon.service + mv -f "${tmpPath}"/systemd/mcsm-web.service /etc/systemd/system/mcsm-web.service + + # Re-enable systemd service + systemctl daemon-reload + systemctl enable mcsm-daemon.service + systemctl enable mcsm-web.service -# ----------------- 程序启动 ----------------- + Clean -# 删除 Shell 脚本自身 -rm -f "$0" + LEcho error "[x] 安装失败" "[x] Installation failed" +} -# 检查执行用户权限 -if [ "$(whoami)" != "root" ]; then - if [ "$zh" == 1 ]; - then Red_Error "[x] 请使用 root 权限执行 MCSManager 安装命令!" - else Red_Error "[x] Please execute the MCSManager installation command with root permission!" - fi -fi +## Clean Function +Clean() { + rm -rf "${tmpPath}" + rm -rf "$0" + return +} -echo_cyan "+---------------------------------------------------------------------- +### Start ### +LEcho cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +| Copyright © 2022 MCSManager All rights reserved. ++---------------------------------------------------------------------- +| Shell Install Script by Nuomiaa & CreeperKong +| Remake By BlueFunny_ ++---------------------------------------------------------------------- +" "+---------------------------------------------------------------------- | MCSManager Installer +---------------------------------------------------------------------- | Copyright © 2022 MCSManager All rights reserved. +---------------------------------------------------------------------- | Shell Install Script by Nuomiaa & CreeperKong +| Remake By BlueFunny_ +---------------------------------------------------------------------- " - -# 环境检查 -if [ "$arch" == x86_64 ]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [ $arch == aarch64 ]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [ $arch == arm ]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [ $arch == ppc64le ]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [ $arch == s390x ]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - if [ "$zh" == 1 ]; - then Red_Error "[x] 抱歉,暂不支持您的 体系架构($arch)!" - else Red_Error "[x] Sorry, this architecture is not supported yet!" - fi - exit -fi - -# 定义变量 Node 安装目录 -node_install_path="/opt/node-$node-linux-$arch" - -# 检查网络连接 -if [ "$zh" == 1 ]; - then - echo_cyan "[-] 体系架构:$arch" - else - echo_cyan "[-] Architecture: $arch" -fi - -# MCSManager 已安装 -if [ -d "$mcsmanager_install_path" ]; then - printf "\033c" - if [ "$zh" == 1 ]; - then echo_red "---------------------------------------------------- -检查到已有 MCSManager 安装在 \"$mcsmanager_install_path\" -继续安装会删除原有 MCSManager 面版的所有数据! ----------------------------------------------------- -将在 10 秒后继续安装,取消请按 Ctrl + Z/C 键!" - else echo_red "---------------------------------------------------- -MCSManager is installed at \"$mcsmanager_install_path\" -Continuing the installation will delete the original MCSManager! ----------------------------------------------------- -Installation will continue in 10 seconds, press Ctrl + Z/C to cancel!" - fi - sleep 10 -fi - -# 安装相关软件 -if [ "$zh" == 1 ]; - then echo_cyan_n "[-] 安装相关软件(git,tar)... " - else echo_cyan_n "[+] Installing dependent software(git,tar)... " -fi -if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; -elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; -elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; -elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; -fi - -# 判断相关软件是否安装成功 -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] - then - if [ "$zh" == 1 ]; - then echo_green "成功" - else echo_green "Success" - fi - else - if [ "$zh" == 1 ]; - then echo_red "失败" - else echo_red "Failed" - fi - echo "$error" - if [ "$zh" == 1 ]; - then Red_Error "[x] 相关软件安装失败,请手动安装 git 和 tar 软件包!" - else Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - fi - exit -fi - - -# 安装 Node 环境 -Install_Node - -# 安装 MCSManager -Install_MCSManager - -# 创建 MCSManager 后台服务 -Create_Service +Main "$1" "$2" "$3" +Clean +exit 0 diff --git a/setup_old.sh b/setup_old.sh new file mode 100644 index 0000000..dfd530e --- /dev/null +++ b/setup_old.sh @@ -0,0 +1,371 @@ +#!/bin/bash +printf "\033c" + +error="" +node="v14.19.1" +arch=$(uname -m) +mcsmanager_install_path="/opt/mcsmanager" +zh=$( + [[ $(locale -a) =~ "zh" ]] && echo 1 + export LANG=zh_CN.UTF-8 || echo 0 +) + +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} + +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} + +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} + +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} + +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +Install_Node() { + if [ "$zh" == 1 ]; then + echo_cyan_n "[+] 安装 Node 环境... " + else + echo_cyan_n "[+] Install Node environment... " + fi + + rm -irf "$node_install_path" + + cd /opt || exit + + wget -o /dev/null https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz + + tar -zxf node-"$node"-linux-"$arch".tar.gz + + rm -rf node-"$node"-linux-"$arch".tar.gz + + if [ ! -L /usr/bin/node ] && [ ! -f /usr/bin/node ]; then + ln -s "$node_install_path"/bin/node /usr/bin/node + fi + if [ ! -L /usr/bin/npm ] && [ ! -f /usr/bin/npm ]; then + ln -s "$node_install_path"/bin/npm /usr/bin/npm + fi + + chmod +x "$node_install_path"/bin/node + chmod +x "$node_install_path"/bin/npm + + if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ]; then + if [ "$zh" == 1 ]; then + echo_green "成功" + else + echo_green "Success" + fi + else + if [ "$zh" == 1 ]; then + echo_red "失败" + Red_Error "[x] Node 安装失败!" + else + echo_red "Failed" + Red_Error "[x] Node installation failed!" + fi + fi + + echo + echo_yellow "=============== Node Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node Version ===============" + echo + + sleep 3 +} + +Install_MCSManager() { + if [ "$zh" == 1 ]; then + echo_cyan "[+] 安装 MCSManager..." + else + echo_cyan "[+] Install MCSManager..." + fi + + # 删除服务 + rm -f /etc/systemd/system/mcsm-daemon.service + rm -f /etc/systemd/system/mcsm-web.service + + # 重载 + systemctl daemon-reload + + # echo "[x] Delete the original MCSManager" + rm -irf ${mcsmanager_install_path} + + # echo "[+] mkdir -p ${mcsmanager_install_path}" + mkdir -p ${mcsmanager_install_path} || exit + + # echo "[→] cd ${mcsmanager_install_path}" + cd ${mcsmanager_install_path} || exit + + if [ "$zh" == 1 ]; then + echo_cyan "[↓] Git 克隆 MCSManager-Daemon..." + else + echo_cyan "[↓] Git clone MCSManager-Daemon..." + fi + git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git daemon + + # echo "[→] cd daemon" + cd daemon || exit + + if [ "$zh" == 1 ]; then + echo_cyan "[+] 安装 MCSManager-Daemon 依赖库..." + else + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + fi + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com >error + + # echo "[←] cd .." + cd .. + + if [ "$zh" == 1 ]; then + echo_cyan "[↓] Git 克隆 MCSManager-Web..." + else + echo_cyan "[↓] Git clone MCSManager-Web..." + fi + git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Web-Production.git web + + # echo "[→] cd web" + cd web || exit + + if [ "$zh" == 1 ]; then + echo_cyan "[+] 安装 MCSManager-Web 依赖库..." + else + echo_cyan "[+] Install MCSManager-Web dependencies..." + fi + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com >error + + echo + echo_yellow "=============== MCSManager ===============" + echo_green " Daemon: ${mcsmanager_install_path}/daemon" + echo_green " Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + if [ "$zh" == 1 ]; then + echo_green "[+] MCSManager 安装成功!" + else + echo_green "[+] MCSManager installation success!" + fi + + sleep 3 +} + +Create_Service() { + if [ "$zh" == 1 ]; then + echo_cyan "[+] 创建 MCSManager 服务..." + else + echo_cyan "[+] Create MCSManager service..." + fi + + echo " +[Unit] +Description=MCSManager Daemon + +[Service] +WorkingDirectory=/opt/mcsmanager/daemon +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" >/etc/systemd/system/mcsm-daemon.service + + echo " +[Unit] +Description=MCSManager Web + +[Service] +WorkingDirectory=/opt/mcsmanager/web +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" >/etc/systemd/system/mcsm-web.service + + # 重载 + systemctl daemon-reload + + # 创建 Daemon 服务 + systemctl enable mcsm-daemon.service --now + + # 创建 Web 服务 + systemctl enable mcsm-web.service --now + + sleep 3 + + printf "\033c" + echo_yellow "==================================================================" + if [ "$zh" == 1 ]; then + echo_green "欢迎使用 MCSManager,您可以通过以下方式访问:" + echo_yellow "==================================================================" + echo_cyan_n "控制面板地址: " + echo_yellow "http://localhost:23333" + echo_red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" + echo_yellow "==================================================================" + echo_cyan "重启 systemctl restart mcsm-{daemon,web}.service" + echo_cyan "禁用 systemctl disable mcsm-{daemon,web}.service" + echo_cyan "启用 systemctl enable mcsm-{daemon,web}.service" + echo_cyan "启动 systemctl start mcsm-{daemon,web}.service" + echo_cyan "停止 systemctl stop mcsm-{daemon,web}.service" + echo_cyan "更多使用说明,请参考:https://docs.mcsmanager.com/" + else + echo_green "Welcome to MCSManager, you can access it by the following ways:" + echo_yellow "==================================================================" + echo_cyan_n "Web Service Address: " + echo_yellow "http://localhost:23333" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow "==================================================================" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_cyan "systemctl disable mcsm-{daemon,web}.service" + echo_cyan "systemctl enable mcsm-{daemon,web}.service" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "More info: https://docs.mcsmanager.com/" + fi + echo_yellow "==================================================================" + +} + +# ----------------- 程序启动 ----------------- + +# 删除 Shell 脚本自身 +rm -f "$0" + +# 检查执行用户权限 +if [ "$(whoami)" != "root" ]; then + if [ "$zh" == 1 ]; then + Red_Error "[x] 请使用 root 权限执行 MCSManager 安装命令!" + else + Red_Error "[x] Please execute the MCSManager installation command with root permission!" + fi +fi + +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +| Copyright © 2022 MCSManager All rights reserved. ++---------------------------------------------------------------------- +| Shell Install Script by Nuomiaa & CreeperKong ++---------------------------------------------------------------------- +" + +# 环境检查 +if [ "$arch" == x86_64 ]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [ $arch == aarch64 ]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [ $arch == arm ]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [ $arch == ppc64le ]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [ $arch == s390x ]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + if [ "$zh" == 1 ]; then + Red_Error "[x] 抱歉,暂不支持您的 体系架构($arch)!" + else + Red_Error "[x] Sorry, this architecture is not supported yet!" + fi + exit +fi + +# 定义变量 Node 安装目录 +node_install_path="/opt/node-$node-linux-$arch" + +# 检查网络连接 +if [ "$zh" == 1 ]; then + echo_cyan "[-] 体系架构:$arch" +else + echo_cyan "[-] Architecture: $arch" +fi + +# MCSManager 已安装 +if [ -d "$mcsmanager_install_path" ]; then + printf "\033c" + if [ "$zh" == 1 ]; then + echo_red "---------------------------------------------------- +检查到已有 MCSManager 安装在 \"$mcsmanager_install_path\" +继续安装会删除原有 MCSManager 面版的所有数据! +---------------------------------------------------- +将在 10 秒后继续安装,取消请按 Ctrl + Z/C 键!" + else + echo_red "---------------------------------------------------- +MCSManager is installed at \"$mcsmanager_install_path\" +Continuing the installation will delete the original MCSManager! +---------------------------------------------------- +Installation will continue in 10 seconds, press Ctrl + Z/C to cancel!" + fi + sleep 10 +fi + +# 安装相关软件 +if [ "$zh" == 1 ]; then + echo_cyan_n "[-] 安装相关软件(git,tar)... " +else + echo_cyan_n "[+] Installing dependent software(git,tar)... " +fi +if [ -x "$(command -v yum)" ]; then + yum install -y git tar >error +elif [ -x "$(command -v apt-get)" ]; then + apt-get install -y git tar >error +elif [ -x "$(command -v pacman)" ]; then + pacman -Syu --noconfirm git tar >error +elif [ -x "$(command -v zypper)" ]; then + zypper --non-interactive install git tar >error +fi + +# 判断相关软件是否安装成功 +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then + if [ "$zh" == 1 ]; then + echo_green "成功" + else + echo_green "Success" + fi +else + if [ "$zh" == 1 ]; then + echo_red "失败" + else + echo_red "Failed" + fi + echo "$error" + if [ "$zh" == 1 ]; then + Red_Error "[x] 相关软件安装失败,请手动安装 git 和 tar 软件包!" + else + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" + fi + exit +fi + +# 安装 Node 环境 +Install_Node + +# 安装 MCSManager +Install_MCSManager + +# 创建 MCSManager 后台服务 +Create_Service diff --git a/update_gbk.bat b/update_gbk.bat index dfe249c..827d64e 100644 --- a/update_gbk.bat +++ b/update_gbk.bat @@ -1,47 +1,47 @@ -@echo off - -Title MCSManager-Web �Զ����� - -color 9 -echo ###################################################### -echo # # -echo # MCSManager-Web �Զ����� # -echo # by Ŵ��(nuomiaa) # -echo # # -echo ###################################################### -echo. -echo [-] ��� Git �Ƿ�װ... - -for /F %%i in ('git --version') ^ -do ( - set vars1=%%i -) - -echo. - -if "%vars1%"=="git" ( - echo [-] Git �Ѱ�װ - echo. - - echo [-] ��ʼ�� Git - git init - git remote add origin https://github.com.cnpmjs.org/mcsmanager/mcsmanager-web-production.git - git fetch --all - git reset --hard origin/master - echo. - - echo [-] ������ȡ���°汾... - git pull origin master - - echo [-] ������ɣ� -) else ( - echo [x] Git δ��װ������ʹ�� winget ��װ... - winget install --id Git.Git -e --source winget - - color 4 - echo [-] ��װ�����ѽ��������������нű���鰲װ�� - echo [-] �� Git ��װʧ�ܣ����ֶ���װ Git: https://git-scm.com/download/win -) - - +@echo off + +Title MCSManager-Web �Զ����� + +color 9 +echo ###################################################### +echo # # +echo # MCSManager-Web �Զ����� # +echo # by Ŵ��(nuomiaa) # +echo # # +echo ###################################################### +echo. +echo [-] ��� Git �Ƿ�װ... + +for /F %%i in ('git --version') ^ +do ( + set vars1=%%i +) + +echo. + +if "%vars1%"=="git" ( + echo [-] Git �Ѱ�װ + echo. + + echo [-] ��ʼ�� Git + git init + git remote add origin https://github.com.cnpmjs.org/mcsmanager/mcsmanager-web-production.git + git fetch --all + git reset --hard origin/master + echo. + + echo [-] ������ȡ���°汾... + git pull origin master + + echo [-] ������ɣ� +) else ( + echo [x] Git δ��װ������ʹ�� winget ��װ... + winget install --id Git.Git -e --source winget + + color 4 + echo [-] ��װ�����ѽ��������������нű���鰲װ�� + echo [-] �� Git ��װʧ�ܣ����ֶ���װ Git: https://git-scm.com/download/win +) + + pause \ No newline at end of file From 6cb3b2b379526ee0416cb710f595ce7094953984 Mon Sep 17 00:00:00 2001 From: BlueFunny_ <53890138+FunnyShadow@users.noreply.github.com> Date: Sat, 21 Jan 2023 12:02:56 +0800 Subject: [PATCH 005/463] Readme Fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed a Readme problem (I forgot I didn't finish my Readme.md, fuck) - 修正了一个 Readme 的问题(我忘记我 Readme.md 没敲完了, 淦) --- README.md | 5 ++--- README_cn.md | 8 +++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 732728c..28da690 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,11 @@
-[Official Website](http://mcsmanager.com/) +[Official Website](http://mcsmanager.com/) | [中文文档](https://github.com/MCSManager/Script/blob/master/README_cn.md) | [Gitee](https://gitee.com/mcsmanager/script)
## What is this? -[中文文档]() The files here are all platform-wide install, delete, update scripts, etc. for MCSManager 9. @@ -18,7 +17,7 @@ You can also use the following one-click command to perform a quick installation ## Installation commands ```bash - +wget https://raw.githubusercontent.com/MCSManager/Script/master/setup.sh -O setup.sh && bash setup.sh ```
diff --git a/README_cn.md b/README_cn.md index 4ff917d..87f191c 100644 --- a/README_cn.md +++ b/README_cn.md @@ -2,7 +2,7 @@
-[MCSManager 9 官方网站](http://mcsmanager.com/) +[MCSManager 9 官方网站](http://mcsmanager.com/) | [English](https://github.com/MCSManager/Script/blob/master/README.md) | [Gitee 仓库](https://gitee.com/mcsmanager/script)
@@ -17,7 +17,13 @@ ## 安装命令 ```bash +wget https://raw.githubusercontent.com/MCSManager/Script/master/setup.sh -O setup.sh && bash setup.sh +``` + +当然, 一般国内用户因为某些神奇的原因都连不上 Github, 下方为 Gitee 国内镜像源链接 +```bash +wget https://gitee.com/mcsmanager/script/raw/master/setup.sh -O setup.sh && bash setup.sh ```
From 21576d6433a5cd50c1161297e48d92b25d6cb72b Mon Sep 17 00:00:00 2001 From: BlueFunny_ <53890138+FunnyShadow@users.noreply.github.com> Date: Sat, 21 Jan 2023 12:37:23 +0800 Subject: [PATCH 006/463] Update setup.sh --- setup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 5fcc2ec..99b55c6 100644 --- a/setup.sh +++ b/setup.sh @@ -108,7 +108,8 @@ Main() { fi # Create temp dir - if ! [ ! -d "${tmpPath}" ] && mkdir -p "${tmpPath}" || rm -rf "${tmpPath}" && mkdir -p "${tmpPath}"; then + [ ! -d "${tmpPath}" ] && mkdir -p "${tmpPath}" || rm -rf "${tmpPath}" && mkdir -p "${tmpPath}" + if [ -d "${tmpPath}" ]; then CheckRoot LEcho error "[x] 未能成功创建临时目录, 请检查权限" "[x] Failed to create temporary directory, please check permissions" fi From 40977376ab676123956c7b1886d8cbffd907a651 Mon Sep 17 00:00:00 2001 From: BlueFunny_ <53890138+FunnyShadow@users.noreply.github.com> Date: Sat, 21 Jan 2023 12:38:36 +0800 Subject: [PATCH 007/463] Update setup.sh --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 99b55c6..29b68c8 100644 --- a/setup.sh +++ b/setup.sh @@ -109,7 +109,7 @@ Main() { # Create temp dir [ ! -d "${tmpPath}" ] && mkdir -p "${tmpPath}" || rm -rf "${tmpPath}" && mkdir -p "${tmpPath}" - if [ -d "${tmpPath}" ]; then + if [ ! -d "${tmpPath}" ]; then CheckRoot LEcho error "[x] 未能成功创建临时目录, 请检查权限" "[x] Failed to create temporary directory, please check permissions" fi From 2c8afdcae24faae4eb4eb558b7ea9963223478c3 Mon Sep 17 00:00:00 2001 From: BlueFunny_ <53890138+FunnyShadow@users.noreply.github.com> Date: Sat, 21 Jan 2023 12:51:12 +0800 Subject: [PATCH 008/463] Update setup.sh --- setup.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index 29b68c8..d1dfcd0 100644 --- a/setup.sh +++ b/setup.sh @@ -85,6 +85,7 @@ LEcho() { [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" echo '=================================================' + Clean exit 1 ;; @@ -108,7 +109,7 @@ Main() { fi # Create temp dir - [ ! -d "${tmpPath}" ] && mkdir -p "${tmpPath}" || rm -rf "${tmpPath}" && mkdir -p "${tmpPath}" + [ ! -d "${tmpPath}" ] && mkdir -p "${tmpPath}" || rm -rf "${tmpPath}" && mkdir -p "${tmpPath}" if [ ! -d "${tmpPath}" ]; then CheckRoot LEcho error "[x] 未能成功创建临时目录, 请检查权限" "[x] Failed to create temporary directory, please check permissions" @@ -556,15 +557,12 @@ Revert() { systemctl enable mcsm-daemon.service systemctl enable mcsm-web.service - Clean - LEcho error "[x] 安装失败" "[x] Installation failed" } ## Clean Function Clean() { rm -rf "${tmpPath}" - rm -rf "$0" return } From 3e73eaab7f1cf68bf0e4098c4ae75d197afd0840 Mon Sep 17 00:00:00 2001 From: BlueFunny_ <53890138+FunnyShadow@users.noreply.github.com> Date: Sat, 21 Jan 2023 14:21:34 +0800 Subject: [PATCH 009/463] Update setup.sh --- setup.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index d1dfcd0..d643566 100644 --- a/setup.sh +++ b/setup.sh @@ -41,6 +41,7 @@ os=$(uname -a) arch=$(uname -m) skipNodeInstall=0 skipMCSMInstall=0 +oldSystem=0 ### Tools ### ## Localize echo @@ -109,7 +110,7 @@ Main() { fi # Create temp dir - [ ! -d "${tmpPath}" ] && mkdir -p "${tmpPath}" || rm -rf "${tmpPath}" && mkdir -p "${tmpPath}" + [ ! -d "${tmpPath}" ] && mkdir -p "${tmpPath}" || rm -rf "${tmpPath}" && mkdir -p "${tmpPath}" if [ ! -d "${tmpPath}" ]; then CheckRoot LEcho error "[x] 未能成功创建临时目录, 请检查权限" "[x] Failed to create temporary directory, please check permissions" @@ -159,6 +160,16 @@ CheckOS() { if [ "$(echo "${os}" | grep "Ubuntu")" == "" ] && [ "$(echo "${os}" | grep "Debian")" == "" ] && [ "$(echo "${os}" | grep "CentOS")" == "" ]; then LEcho error "[x] 本脚本仅支持 Ubuntu/Debian/CentOS 系统!" "[x] This script only supports Ubuntu/Debian/CentOS systems!" fi + if [ "$(cat /etc/redhat-release | grep ' 6.' | grep -iE 'centos|Red Hat')" ]; then + LEcho yellow "[!] 检测到您的系统版本过低, 可能会存在一定的兼容性问题, 请了解" "[!] It is detected that your system version is too low, there may be certain compatibility issues, please understand" + LEcho cyan "[-] 切换为兼容性模式" "[-] Switch to compatibility mode" + oldSystem=1 + fi + if [ "$(cat /etc/issue | grep Ubuntu | awk '{print $2}' | cut -f 1 -d '.')" ] && [ "$(cat /etc/issue | grep Ubuntu | awk '{print $2}' | cut -f 1 -d '.')" -lt "16" ]; then + LEcho yellow "[!] 检测到您的系统版本过低, 可能会存在一定的兼容性问题, 请了解" "[!] It is detected that your system version is too low, there may be certain compatibility issues, please understand" + LEcho cyan "[-] 切换为兼容性模式" "[-] Switch to compatibility mode" + oldSystem=1 + fi return } @@ -180,7 +191,11 @@ CheckSystem() { if [ -f /etc/redhat-release ]; then yum install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" else - apt-get install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" + if [ ${oldSystem} == 1 ]; then + apt-get install --force-yes git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" + else + apt-get install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" + fi fi # Check Arch From 5bf21d0d420bb34518766be7a1bc31931a89f0ea Mon Sep 17 00:00:00 2001 From: BlueFunny_ <53890138+FunnyShadow@users.noreply.github.com> Date: Sat, 21 Jan 2023 14:25:30 +0800 Subject: [PATCH 010/463] Update setup.sh --- setup.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index d643566..32d38c8 100644 --- a/setup.sh +++ b/setup.sh @@ -192,7 +192,7 @@ CheckSystem() { yum install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" else if [ ${oldSystem} == 1 ]; then - apt-get install --force-yes git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" + apt-get install --force-yes -y git tar wget curl systemctl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" else apt-get install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" fi @@ -355,8 +355,13 @@ InstallNode() { LEcho echo "[+] 正在安装 Node.js" "[+] Installing Node.js" # Download Node.js - wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.tar.gz "${nodeFileURL}" - wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.sha256 "${nodeHashURL}" + if [ ${oldSystem} != 1 ]; then + wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.tar.gz "${nodeFileURL}" + wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.sha256 "${nodeHashURL}" + else + wget -t ${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.tar.gz "${nodeFileURL}" + wget -t ${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.sha256 "${nodeHashURL}" + fi # Check hash cat ${tmpPath}/node.sha256 | grep "${nodeVersion}/node-${nodeVersion}-linux-${arch}.tar.gz" | tee ${tmpPath}/node.sha256 From 47abc16b9ea8b4e16fa377e6062ea1da0b541941 Mon Sep 17 00:00:00 2001 From: BlueFunny_ <53890138+FunnyShadow@users.noreply.github.com> Date: Sat, 21 Jan 2023 14:29:26 +0800 Subject: [PATCH 011/463] Update setup.sh --- setup.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index 32d38c8..c6a1c48 100644 --- a/setup.sh +++ b/setup.sh @@ -161,14 +161,16 @@ CheckOS() { LEcho error "[x] 本脚本仅支持 Ubuntu/Debian/CentOS 系统!" "[x] This script only supports Ubuntu/Debian/CentOS systems!" fi if [ "$(cat /etc/redhat-release | grep ' 6.' | grep -iE 'centos|Red Hat')" ]; then - LEcho yellow "[!] 检测到您的系统版本过低, 可能会存在一定的兼容性问题, 请了解" "[!] It is detected that your system version is too low, there may be certain compatibility issues, please understand" - LEcho cyan "[-] 切换为兼容性模式" "[-] Switch to compatibility mode" - oldSystem=1 + # LEcho yellow "[!] 检测到您的系统版本过低, 可能会存在一定的兼容性问题, 请了解" "[!] It is detected that your system version is too low, there may be certain compatibility issues, please understand" + # LEcho cyan "[-] 切换为兼容性模式" "[-] Switch to compatibility mode" + # oldSystem=1 + LEcho error "[x] 本脚本不支持 CentOS 6, 请升级到 CentOS 7 或更高版本" "[x] This script does not support CentOS 6, please upgrade to CentOS 7 or higher" fi if [ "$(cat /etc/issue | grep Ubuntu | awk '{print $2}' | cut -f 1 -d '.')" ] && [ "$(cat /etc/issue | grep Ubuntu | awk '{print $2}' | cut -f 1 -d '.')" -lt "16" ]; then - LEcho yellow "[!] 检测到您的系统版本过低, 可能会存在一定的兼容性问题, 请了解" "[!] It is detected that your system version is too low, there may be certain compatibility issues, please understand" - LEcho cyan "[-] 切换为兼容性模式" "[-] Switch to compatibility mode" - oldSystem=1 + # LEcho yellow "[!] 检测到您的系统版本过低, 可能会存在一定的兼容性问题, 请了解" "[!] It is detected that your system version is too low, there may be certain compatibility issues, please understand" + # LEcho cyan "[-] 切换为兼容性模式" "[-] Switch to compatibility mode" + # oldSystem=1 + LEcho error "[x] 本脚本不支持 Ubuntu 14, 请升级到 Ubuntu 16 或更高版本" "[x] This script does not support Ubuntu 14, please upgrade to Ubuntu 16 or higher" fi return } From a589e538c3bb0c868b04bd287a8afa9684ed5e63 Mon Sep 17 00:00:00 2001 From: BlueFunny_ <53890138+FunnyShadow@users.noreply.github.com> Date: Sat, 21 Jan 2023 14:32:53 +0800 Subject: [PATCH 012/463] Update setup.sh --- setup.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/setup.sh b/setup.sh index c6a1c48..bea835f 100644 --- a/setup.sh +++ b/setup.sh @@ -41,7 +41,7 @@ os=$(uname -a) arch=$(uname -m) skipNodeInstall=0 skipMCSMInstall=0 -oldSystem=0 +#oldSystem=0 ### Tools ### ## Localize echo @@ -193,11 +193,12 @@ CheckSystem() { if [ -f /etc/redhat-release ]; then yum install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" else - if [ ${oldSystem} == 1 ]; then - apt-get install --force-yes -y git tar wget curl systemctl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" - else - apt-get install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" - fi + #if [ ${oldSystem} == 1 ]; then + # apt-get install --force-yes -y git tar wget curl systemctl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" + #else + # apt-get install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" + #fi + apt-get install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" fi # Check Arch @@ -357,13 +358,15 @@ InstallNode() { LEcho echo "[+] 正在安装 Node.js" "[+] Installing Node.js" # Download Node.js - if [ ${oldSystem} != 1 ]; then - wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.tar.gz "${nodeFileURL}" - wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.sha256 "${nodeHashURL}" - else - wget -t ${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.tar.gz "${nodeFileURL}" - wget -t ${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.sha256 "${nodeHashURL}" - fi + #if [ ${oldSystem} != 1 ]; then + # wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.tar.gz "${nodeFileURL}" + # wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.sha256 "${nodeHashURL}" + #else + # wget -t ${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.tar.gz "${nodeFileURL}" + # wget -t ${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.sha256 "${nodeHashURL}" + #fi + wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.tar.gz "${nodeFileURL}" + wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.sha256 "${nodeHashURL}" # Check hash cat ${tmpPath}/node.sha256 | grep "${nodeVersion}/node-${nodeVersion}-linux-${arch}.tar.gz" | tee ${tmpPath}/node.sha256 From 83bb8d1d701c2617725ab2581a2d42527ca03b4f Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 12:09:49 +0800 Subject: [PATCH 013/463] Update readme --- README.md | 2 +- README_cn.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 28da690..3d08d19 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The files here are all platform-wide install, delete, update scripts, etc. for MCSManager 9. -The default installation script on the official website is the `setup.sh` file of this repository, it contains multiple languages. +The default installation script on the official website is the `setup.sh` file of gitee repository, it contains multiple languages. You can also use the following one-click command to perform a quick installation diff --git a/README_cn.md b/README_cn.md index 87f191c..5f55c3a 100644 --- a/README_cn.md +++ b/README_cn.md @@ -10,7 +10,7 @@ 这里是 Ubuntu / Debian / CentOS 等 Linux 系系统的 MCSManager 9 安装, 卸载, 升级脚本等的集中存储库 -官网上默认的安装脚本为本仓库中的 `setup.sh` , 它包含多种语言支持 +官网上默认的安装脚本为 Gitee 仓库中的 `setup.sh` , 它包含多种语言支持 你也可以使用下列一键命令安装 MCSManager 9 From 27fe32897dfa4438258f0d04f719f96afaedf6f2 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 12:11:20 +0800 Subject: [PATCH 014/463] Installer refactoring --- setup.sh => setup.sh.bak | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename setup.sh => setup.sh.bak (100%) diff --git a/setup.sh b/setup.sh.bak similarity index 100% rename from setup.sh rename to setup.sh.bak From 7631a277a8259c1d16ceb7c3b539a9610ba608c7 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 15:52:26 +0800 Subject: [PATCH 015/463] Deprecated --- update_gbk.bat | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 update_gbk.bat diff --git a/update_gbk.bat b/update_gbk.bat deleted file mode 100644 index 827d64e..0000000 --- a/update_gbk.bat +++ /dev/null @@ -1,47 +0,0 @@ -@echo off - -Title MCSManager-Web �Զ����� - -color 9 -echo ###################################################### -echo # # -echo # MCSManager-Web �Զ����� # -echo # by Ŵ��(nuomiaa) # -echo # # -echo ###################################################### -echo. -echo [-] ��� Git �Ƿ�װ... - -for /F %%i in ('git --version') ^ -do ( - set vars1=%%i -) - -echo. - -if "%vars1%"=="git" ( - echo [-] Git �Ѱ�װ - echo. - - echo [-] ��ʼ�� Git - git init - git remote add origin https://github.com.cnpmjs.org/mcsmanager/mcsmanager-web-production.git - git fetch --all - git reset --hard origin/master - echo. - - echo [-] ������ȡ���°汾... - git pull origin master - - echo [-] ������ɣ� -) else ( - echo [x] Git δ��װ������ʹ�� winget ��װ... - winget install --id Git.Git -e --source winget - - color 4 - echo [-] ��װ�����ѽ��������������нű���鰲װ�� - echo [-] �� Git ��װʧ�ܣ����ֶ���װ Git: https://git-scm.com/download/win -) - - -pause \ No newline at end of file From 8d2890c5e15f047f76725145c4101fff8d1ee6a9 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 15:52:33 +0800 Subject: [PATCH 016/463] Deprecated --- setup_en.sh | 263 ---------------------------------------------------- 1 file changed, 263 deletions(-) delete mode 100644 setup_en.sh diff --git a/setup_en.sh b/setup_en.sh deleted file mode 100644 index 90f389e..0000000 --- a/setup_en.sh +++ /dev/null @@ -1,263 +0,0 @@ -#!/bin/bash -printf "\033c" - -error="" -node="v14.19.1" -arch=$(uname -m) -mcsmanager_install_path="/opt/mcsmanager" - -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 -} - -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} - -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} - -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} - -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" -} - -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} - -Install_Node() { - echo_cyan_n "[+] Install Node environment... " - - rm -irf "$node_install_path" - - cd /opt || exit - - wget -o /dev/null https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz - - tar -zxf node-"$node"-linux-"$arch".tar.gz - - rm -rf node-"$node"-linux-"$arch".tar.gz - - if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] - then - echo_green "Success" - else - echo_red "Failed" - Red_Error "[x] Node installation failed!" - fi - - echo - echo_yellow "=============== Node Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node Version ===============" - echo - - sleep 3 -} - -Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." - - # delete service - rm -f /etc/systemd/system/mcsm-daemon.service - rm -f /etc/systemd/system/mcsm-web.service - - # reload - systemctl daemon-reload - - # echo "[x] Delete the original MCSManager" - rm -irf ${mcsmanager_install_path} - - # echo "[+] mkdir -p ${mcsmanager_install_path}" - mkdir -p ${mcsmanager_install_path} || exit - - # echo "[→] cd ${mcsmanager_install_path}" - cd ${mcsmanager_install_path} || exit - - echo_cyan "[↓] Git clone MCSManager-Daemon..." - git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Daemon-Production.git daemon - - # echo "[→] cd daemon" - cd daemon || exit - - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com > error - - # echo "[←] cd .." - cd .. - - echo_cyan "[↓] Git clone MCSManager-Web..." - git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Web-Production.git web - - # echo "[→] cd web" - cd web || exit - - echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com > error - - echo - echo_yellow "=============== MCSManager ===============" - echo_green " Daemon: ${mcsmanager_install_path}/daemon" - echo_green " Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" - - sleep 3 -} - -Create_Service() { - echo_cyan "[+] Create MCSManager service..." - - echo " -[Unit] -Description=MCSManager Daemon - -[Service] -WorkingDirectory=/opt/mcsmanager/daemon -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - -[Install] -WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-daemon.service - - echo " -[Unit] -Description=MCSManager Web - -[Service] -WorkingDirectory=/opt/mcsmanager/web -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - -[Install] -WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-web.service - - systemctl daemon-reload - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - - sleep 3 - - printf "\033c" - echo_yellow "==================================================================" - echo_green "Welcome to MCSManager, you can access it by the following ways:" - echo_yellow "==================================================================" - echo_cyan_n "Daemon Service Address: "; echo_yellow "http://localhost:24444" - echo_cyan_n "Web Service Address: "; echo_yellow "http://localhost:23333" - echo_cyan_n "Username: "; echo_yellow "root" - echo_cyan_n "Password: "; echo_yellow "123456" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow "==================================================================" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_cyan "systemctl disable mcsm-{daemon,web}.service" - echo_cyan "systemctl enable mcsm-{daemon,web}.service" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "More info: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" - - -} - - -# ----------------- Program Start ----------------- - -# delete the shell script itself -rm -f "$0" - -# Check execute user permissions -if [ "$(whoami)" != "root" ]; then - Red_Error "[x] Please execute the MCSManager installation command with root permission!" -fi - -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2022 MCSManager All rights reserved. -+---------------------------------------------------------------------- -| Shell Install Script by Nuomiaa & CreeperKong -+---------------------------------------------------------------------- -" - -# Environmental inspection -if [ "$arch" == x86_64 ]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [ $arch == aarch64 ]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [ $arch == arm ]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [ $arch == ppc64le ]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [ $arch == s390x ]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - Red_Error "[x] Sorry, this architecture is not supported yet!" - exit -fi - -# Define the variable Node installation directory -node_install_path="/opt/node-$node-linux-$arch" - -# Check network connection -echo_cyan "[-] Architecture: $arch" - -# MCSManager Installed -if [ -d "$mcsmanager_install_path" ]; then - printf "\033c" - echo_red "---------------------------------------------------- -MCSManager is installed at \"$mcsmanager_install_path\" -Continuing the installation will delete the original MCSManager! ----------------------------------------------------- -Installation will continue in 10 seconds, press Ctrl + Z/C to cancel!" - sleep 10 -fi - -# Install related software -echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; -elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; -elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; -elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; -fi - -# Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] - then - echo_green "Success" - else - echo_red "Failed" - echo "$error" - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - exit -fi - - -# Install the Node environment -Install_Node - -# Install MCSManager -Install_MCSManager - -# Create MCSManager background service -Create_Service From 1161147f088a482dc51b6a4f308c4d44e9228e90 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 18:12:53 +0800 Subject: [PATCH 017/463] Smaller, Better, Stroger ! --- setup.sh | 422 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 422 insertions(+) create mode 100644 setup.sh diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..d304de4 --- /dev/null +++ b/setup.sh @@ -0,0 +1,422 @@ +#!/usr/bin/env bash + +#### MCSManager Installer +#### Made by BlueFunny +#### Originally written by nuomiaa, CreeperKong, unitwk + +#### Copyright © 2023 MCSManager All rights reserved. + +### Variables +## Files +# MCSManager +mcsmPath="/opt/mcsmanager" +daemonPath="$mcsmPath/daemon" +webPath="$mcsmPath/web" + +# Node.js +nodePath="$mcsmPath/node" +nodeBin="$nodePath/bin/node" +npmBin="$nodePath/bin/npm" + +# Junk +tmpDir="/tmp/mcsmanager" + +## Node info +nodeVer="v16.13.0" + +## Install mode +mode="install" + +## URLs +# Node.js +nodeBaseURL="https://nodejs.org/dist" +nodeFileURL="$nodeBaseURL/$nodeVer/node-$nodeVer-linux-$arch.tar.gz" +nodeHashURL="$nodeBaseURL/$nodeVer/SHASUMS256.txt" + +# MCSManager +daemonURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" +webURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" + +## Language +if [ "$(echo "$LANG" | grep "zh_CN")" != "" ]; then + zh=1 +else + zh=0 +fi + +## Debug +debug=0 + +## Other +cn=0 + +### Functions +## Localize echo +# $1: color +# $2: zh +# $3: en +LEcho() { + case $1 in + # Red color echo + red) + [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" + ;; + + # Green color echo + green) + [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" + ;; + + # Cyan color echo + cyan) + [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" + ;; + + # Cyan color echo (No line break) + cyan_n) + [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" + [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" + ;; + + # Yellow color echo + yellow) + [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" + ;; + + # Red error echo + error) + Clean + echo '=================================================' + [ "$zh" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" + [ "$zh" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" + echo '=================================================' + exit 1 + ;; + + # Debug echo + debug) + [ "$debug" == 1 ] && printf '\033[1;35m%b\033[0m\n' "[DEBUG] $2" + ;; + + # No color echo + *) + [ "$zh" == 1 ] && echo "$2" + [ "$zh" == 0 ] && echo "$3" + ;; + esac + return +} + +## Check root +CheckRoot() { + if [[ $EUID -ne 0 ]]; then + LEcho debug "User: $(whoami)" + LEcho debug "EUID: $EUID" + LEcho error "[!] 请使用 root 用户运行此脚本" "[!] Please run this script as root" + fi + return +} + +## Detect server geographic location +CheckCN() { + LEcho echo "[*] 正在检查服务器地理位置" "[*] Checking server location" + if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then + LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国, 已自动切换为中国镜像源" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China, and the Chinese mirror source has been automatically switched" + LEcho debug "==============================================" + LEcho debug "Raw data: $(curl -m 10 -s https://ipapi.co/json)" + LEcho debug "==============================================" + daemonURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" + webURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" + nodeBaseURL="https://npmmirror.com/mirrors/node" + cn=1 + else + LEcho cyan "[-] 检测服务器地理位置出错, 跳过检测" "[-] Error detecting server location, skipping detection" + fi + return +} + +## Detect system architecture +CheckArch() { + LEcho echo "[*] 正在检查系统架构" "[*] Checking system architecture" + LEcho debug "Raw architecture: $arch" + arch=$(uname -m) + case $arch in + x86_64) + arch="x64" + ;; + aarch64) + arch="arm64" + ;; + arm) + arch="armv7l" + ;; + ppc64le) + arch="ppc64le" + ;; + s390x) + arch="s390x" + ;; + *) + LEcho error "[x] MCSManager 暂不支持当前系统架构" "[x] MCSManager does not currently support the current system architecture" + ;; + esac + return +} + +## Detect system version +CheckOS() { + if [ -f /etc/os-release ]; then + # shellcheck source=/dev/null + . /etc/os-release + LEcho debug "========================================" + LEcho debug "Raw data: $(cat /etc/os-release)" + LEcho debug "========================================" + case "$ID" in + debian|ubuntu) + os="debian" + ;; + centos|rhel|fedora) + os="redhat" + ;; + *) + LEcho error "[x] 本脚本仅支持 Ubuntu/Debian/CentOS 系统!" "[x] This script only supports Ubuntu/Debian/CentOS systems!" + ;; + esac + else + LEcho error "[x] 未能正常检测到系统类型, 无法继续安装" "[x] Unable to detect system type, installation cannot continue" + fi + return +} + +## Detect nodejs version +CheckNode() { + if command -v node > /dev/null; then + if [ "$(node -v | cut -c2- | awk -F. '{print $1}')" -ge 14 ]; then + return 0 + fi + fi + return 1 +} + +## Main GUI +GUI(){ + clear + LEcho cyan "===============================================" "===============================================" + LEcho cyan "MCSManager Installer" "MCSManager Installer" + LEcho cyan "===============================================" "===============================================" + LEcho cyan "1. 安装 MCSManager" "1. Install MCSManager" + LEcho cyan "2. 卸载 MCSManager" "2. Uninstall MCSManager" + LEcho cyan "3. 退出" "3. Exit" + LEcho cyan "===============================================" "===============================================" + LEcho cyan_n "请输入选项: " "Please enter an option: " + read -r option + case $option in + 1) + Install + ;; + 2) + Remove + ;; + 3) + return + ;; + *) + LEcho error "[x] 无效的选项" "[x] Invalid option" + GUI + ;; + esac + return +} + +## Install MCSManager +Install() { + clear + LEcho cyan "[-] 开始安装 MCSManager" "[-] Start installing MCSManager" + # Init work environment + LEcho cyan "[*] 正在初始化工作环境" "[*] Initializing work environment" + mkdir -p $tmpDir + + # Detect old MCSManager + [ -d $mcsmPath ] && LEcho yellow "[!] 检测到旧版 MCSManager, 切换为更新模式" "[!] Old version of MCSManager detected, switch to update mode" + [ -d $mcsmPath ] && mode="update" + mkdir -p $mcsmPath + + # Install dependencies + LEcho cyan "[*] 正在安装安装所需的工具" "[*] Installing the tools required for installation" + if [ "$os" == "debian" ]; then + apt-get update + apt-get install -y curl git wget + elif [ "$os" == "redhat" ]; then + yum install -y curl git wget + fi + + # Install nodejs + if ! CheckNode;then + LEcho cyan "[*] 正在安装 Node.js" "[*] Installing Node.js" + # Download nodejs files + wget -t=3 -q --no-check-certificate --show-progress -O $tmpDir/node.tar.gz "$nodeFileURL" + wget -t=3 -q --no-check-certificate --show-progress -O $tmpDir/node.sha256 "$nodeHashURL" + + # Check nodejs files + if [ "$(sha256sum $tmpDir/node.tar.gz | awk '{print $1}')" != "$(cat $tmpDir/node.sha256)" ]; then + LEcho error "[x] Node.js 安装包校验失败, 请重试" "[x] Node.js installation package verification failed, please try again" + fi + + # Install nodejs + tar -xzf $tmpDir/node.tar.gz -C $tmpDir + cp -r "$tmpDir/node-$nodeVer-linux-$arch/*" $nodePath + + LEcho cyan "===============================================" "===============================================" + LEcho cyan "Node.js 版本: $($nodeBin --version)" "Node.js version: $($nodeBin --version)" + LEcho cyan "NPM 版本: $($npmBin -v)" "NPM version: $($npmBin -v)" + LEcho cyan "===============================================" "===============================================" + else + Lecho cyan "[-] 检测到已安装 Node.js, 跳过安装" "[-] Detected installed Node.js, skip installation" + fi + + # Install MCSManager + if [ $mode == "update" ];then + LEcho cyan "[*] 正在更新 MCSManager 前端管理面板" "[*] Updating MCSManager web panel" + + cd $webPath || LEcho error "[x] 无法进入 MCSManager 前端管理面板目录, 请检查权限" "[x] Unable to enter MCSManager web panel directory, please check permissions" + + # Clone MCSManager web panel + git remote set-url origin $webURL + git fetch origin + git checkout master + git reset --hard origin/master + git pull + + LEcho cyan "[*] 正在更新 MCSManager 守护晨曦股" "[*] Updating MCSManager daemon" + + cd $daemonPath || LEcho error "[x] 无法进入 MCSManager 守护程序目录, 请检查权限" "[x] Unable to enter MCSManager daemon directory, please check permissions" + + # Clone MCSManager daemon + git remote set-url origin $daemonURL + git fetch origin + git checkout master + git reset --hard origin/master + git pull + else + # Clone MCSManager web panel + LEcho cyan "[*] 正在安装 MCSManager 前端管理面板" "[*] Installing MCSManager web panel" + git clone --single-branch -b master --depth 1 $webURL $webPath + + # Clone MCSManager daemon + LEcho cyan "[*] 正在安装 MCSManager 守护程序" "[*] Installing MCSManager web panel" + git clone --single-branch -b master --depth 1 $daemonURL $daemonPath + fi + # Update dependencies + LEcho cyan "[*] 正在更新依赖" "[*] Updating dependencies" + cd $webPath || LEcho error "[x] 无法进入 MCSManager 前端管理目录, 请检查权限" "[x] Unable to enter MCSManager web panel directory, please check permissions" + [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com + [ $cn == 0 ] && $npmBin install + cd $daemonPath || LEcho error "[x] 无法进入 MCSManager 守护程序目录, 请检查权限" "[x] Unable to enter MCSManager daemon directory, please check permissions" + [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com + [ $cn == 0 ] && $npmBin install + + # Create systemd service + LEcho cyan "[*] 正在创建 systemd 服务" "[*] Creating systemd service" + cat > /etc/systemd/system/mcsm-web.service << EOF + [Unit] + Description=MCSManager Web Panel Service + After=network.target + + [Service] + User=root + WorkingDirectory="$webPath" + ExecStart="$nodeBin" "$webPath/app.js" + Restart=always + + [Install] + WantedBy=multi-user.target +EOF + cat > /etc/systemd/system/mcsm-daemon.service << EOF + [Unit] + Description=MCSManager Daemon Service + After=network.target + + [Service] + User=root + WorkingDirectory="$daemonPath" + ExecStart="$nodeBin" "$daemonPath/app.js" + Restart=always + + [Install] + WantedBy=multi-user.target +EOF + # Enable systemd service + LEcho cyan "[*] 正在启动 MCSManager 服务" "[*] Starting MCSManager services" + systemctl daemon-reload + systemctl enable mcsm-web --now || LEcho error "[x] 无法启动 MCSManager 前端管理面板服务" "[x] Unable to start MCSManager web panel service" + systemctl enable mcsm-daemon --now || LEcho error "[x] 无法启动 MCSManager 守护程序服务" "[x] Unable to start MCSManager daemon service" + + # Output login info + LEcho green "[√] MCSManager 安装完毕" "[√] MCSManager installation completed" + LEcho yellow "==================================================================" "==================================================================" + LEcho green "欢迎使用 MCSManager, 您可以通过以下方式访问: " "Welcome to use MCSManager, you can access it through the following ways:" + LEcho yellow "==================================================================" "==================================================================" + LEcho cyan_n "控制面板地址: " "Control panel address: " + LEcho yellow "http://localhost:23333" "http://localhost:23333" + LEcho red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" "If you can't access the panel, please check if the firewall/security group has opened the panel 23333 and 24444 ports. The control panel needs these two ports to work properly." + LEcho yellow "==================================================================" "==================================================================" + LEcho cyan "重启 systemctl restart mcsm-{daemon,web}.service" "Restart systemctl restart mcsm-{daemon,web}.service" + LEcho cyan "禁用 systemctl disable mcsm-{daemon,web}.service" "Disable systemctl disable mcsm-{daemon,web}.service" + LEcho cyan "启用 systemctl enable mcsm-{daemon,web}.service" "Enable systemctl enable mcsm-{daemon,web}.service" + LEcho cyan "启动 systemctl start mcsm-{daemon,web}.service" "Start systemctl start mcsm-{daemon,web}.service" + LEcho cyan "停止 systemctl stop mcsm-{daemon,web}.service" "Stop systemctl stop mcsm-{daemon,web}.service" + LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More usage instructions, please refer to: https://docs.mcsmanager.com/" + LEcho yellow "==================================================================" "==================================================================" + + # Clean up + rm -rf $tmpDir + return +} + +## Remove MCSManager +Remove() { + clear + LEcho yellow "==================================================================" "==================================================================" + LEcho yellow "[!] 你确定要删除 MCSManager 吗" "[!] Are you sure you want to delete MCSManager" + LEcho yellow "[!] 删除 MCSManager 后, 所有服务器数据将会丢失" "[!] All server data will be lost after deleting MCSManager" + LEcho yellow "[!] 请在 10 秒内按下 Ctrl + C 取消删除" "[!] Please press Ctrl + C within 10 seconds to cancel deletion" + LEcho yellow "==================================================================" "==================================================================" + sleep 10 + + LEcho cyan "[*] 正在停止 MCSManager 服务" "[*] Stopping MCSManager service" + systemctl disable mcsm-daemon --now || LEcho error "[x] 无法停止 MCSManager 守护程序服务" "[x] Unable to stop MCSManager daemon service" + systemctl disable mcsm-web --now || LEcho error "[x] 无法停止 MCSManager 前端管理面板服务" "[x] Unable to stop MCSManager web panel service" + + LEcho cyan "[*] 正在删除 MCSManager 服务" "[*] Deleting MCSManager service" + rm -rf /etc/systemd/system/mcsm-daemon.service + rm -rf /etc/systemd/system/mcsm-web.service + systemctl daemon-reload + + LEcho cyan "[*] 正在删除 MCSManager 目录" "[*] Deleting MCSManager directory" + rm -rf $mcsmPath + + LEcho green "[√] MCSManager 删除完毕" "[√] MCSManager deletion completed" + return +} + +## Clean up +Clean() { + LEcho cyan "[*] 正在清理残余文件" "[*] Cleaning up" + rm -rf $tmpDir + [ $mode != "update" ] && rm -rf $mcsmPath + return +} + +### Start + +LEcho echo "[-] 正在检查基础环境, 请稍等" "[-] Checking basic environment, please wait" +CheckRoot +CheckArch +CheckOS +CheckCN +GUI +LEcho cyan "[-] 期待与您的下次见面" "[-] Looking forward to seeing you again" \ No newline at end of file From 92076ad9fb5fa2e3206b472c55d2fd426aba5494 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 18:48:20 +0800 Subject: [PATCH 018/463] Fixed some stupid questions --- setup.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index d304de4..aed8135 100644 --- a/setup.sh +++ b/setup.sh @@ -275,7 +275,7 @@ Install() { LEcho cyan "NPM 版本: $($npmBin -v)" "NPM version: $($npmBin -v)" LEcho cyan "===============================================" "===============================================" else - Lecho cyan "[-] 检测到已安装 Node.js, 跳过安装" "[-] Detected installed Node.js, skip installation" + LEcho cyan "[-] 检测到已安装 Node.js, 跳过安装" "[-] Detected installed Node.js, skip installation" fi # Install MCSManager @@ -328,8 +328,8 @@ Install() { [Service] User=root - WorkingDirectory="$webPath" - ExecStart="$nodeBin" "$webPath/app.js" + WorkingDirectory="\$webPath" + ExecStart="\$nodeBin" "\$webPath/app.js" Restart=always [Install] @@ -342,8 +342,8 @@ EOF [Service] User=root - WorkingDirectory="$daemonPath" - ExecStart="$nodeBin" "$daemonPath/app.js" + WorkingDirectory="\$daemonPath" + ExecStart="\$nodeBin" "\$daemonPath/app.js" Restart=always [Install] From d75edb05bad7036669aecc7abc9278ffd12961ee Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 18:56:19 +0800 Subject: [PATCH 019/463] Improve the installed Node detection function --- setup.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index aed8135..0c42cfd 100644 --- a/setup.sh +++ b/setup.sh @@ -44,6 +44,10 @@ else zh=0 fi +## Systemd service command +webExecStart="\"$nodeBin\" \"$webPath/app.js\"" +daemonExecStart="\"$nodeBin\" \"$daemonPath/app.js\"" + ## Debug debug=0 @@ -276,6 +280,8 @@ Install() { LEcho cyan "===============================================" "===============================================" else LEcho cyan "[-] 检测到已安装 Node.js, 跳过安装" "[-] Detected installed Node.js, skip installation" + nodeBin="$(which node)" + npmBin="$(which npm)" fi # Install MCSManager @@ -328,8 +334,8 @@ Install() { [Service] User=root - WorkingDirectory="\$webPath" - ExecStart="\$nodeBin" "\$webPath/app.js" + WorkingDirectory=\"$webPath\" + ExecStart=$webExecStart Restart=always [Install] @@ -342,8 +348,8 @@ EOF [Service] User=root - WorkingDirectory="\$daemonPath" - ExecStart="\$nodeBin" "\$daemonPath/app.js" + WorkingDirectory=\"$daemonPath\" + ExecStart=$daemonExecStart Restart=always [Install] @@ -390,15 +396,15 @@ Remove() { LEcho cyan "[*] 正在停止 MCSManager 服务" "[*] Stopping MCSManager service" systemctl disable mcsm-daemon --now || LEcho error "[x] 无法停止 MCSManager 守护程序服务" "[x] Unable to stop MCSManager daemon service" systemctl disable mcsm-web --now || LEcho error "[x] 无法停止 MCSManager 前端管理面板服务" "[x] Unable to stop MCSManager web panel service" - + LEcho cyan "[*] 正在删除 MCSManager 服务" "[*] Deleting MCSManager service" rm -rf /etc/systemd/system/mcsm-daemon.service rm -rf /etc/systemd/system/mcsm-web.service systemctl daemon-reload - + LEcho cyan "[*] 正在删除 MCSManager 目录" "[*] Deleting MCSManager directory" rm -rf $mcsmPath - + LEcho green "[√] MCSManager 删除完毕" "[√] MCSManager deletion completed" return } From 34c57ccf4b7463c55adee025e3cd29d72486c202 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 19:14:07 +0800 Subject: [PATCH 020/463] fix --- setup.sh | 56 ++++++++++++++++++++++++-------------------------------- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/setup.sh b/setup.sh index 0c42cfd..00bca7c 100644 --- a/setup.sh +++ b/setup.sh @@ -118,8 +118,6 @@ LEcho() { ## Check root CheckRoot() { if [[ $EUID -ne 0 ]]; then - LEcho debug "User: $(whoami)" - LEcho debug "EUID: $EUID" LEcho error "[!] 请使用 root 用户运行此脚本" "[!] Please run this script as root" fi return @@ -128,11 +126,9 @@ CheckRoot() { ## Detect server geographic location CheckCN() { LEcho echo "[*] 正在检查服务器地理位置" "[*] Checking server location" - if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then + server_ip=$(curl -s ifconfig.me) + if [[ "$(curl -s "http://ip-api.com/json/${server_ip}?fields=countryCode" | jq -r '.countryCode')" == "CN" ]]; then LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国, 已自动切换为中国镜像源" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China, and the Chinese mirror source has been automatically switched" - LEcho debug "==============================================" - LEcho debug "Raw data: $(curl -m 10 -s https://ipapi.co/json)" - LEcho debug "==============================================" daemonURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" webURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" nodeBaseURL="https://npmmirror.com/mirrors/node" @@ -146,7 +142,6 @@ CheckCN() { ## Detect system architecture CheckArch() { LEcho echo "[*] 正在检查系统架构" "[*] Checking system architecture" - LEcho debug "Raw architecture: $arch" arch=$(uname -m) case $arch in x86_64) @@ -176,9 +171,6 @@ CheckOS() { if [ -f /etc/os-release ]; then # shellcheck source=/dev/null . /etc/os-release - LEcho debug "========================================" - LEcho debug "Raw data: $(cat /etc/os-release)" - LEcho debug "========================================" case "$ID" in debian|ubuntu) os="debian" @@ -253,9 +245,9 @@ Install() { LEcho cyan "[*] 正在安装安装所需的工具" "[*] Installing the tools required for installation" if [ "$os" == "debian" ]; then apt-get update - apt-get install -y curl git wget + apt-get install -y curl git wget jq elif [ "$os" == "redhat" ]; then - yum install -y curl git wget + yum install -y curl git wget jq fi # Install nodejs @@ -328,32 +320,32 @@ Install() { # Create systemd service LEcho cyan "[*] 正在创建 systemd 服务" "[*] Creating systemd service" cat > /etc/systemd/system/mcsm-web.service << EOF - [Unit] - Description=MCSManager Web Panel Service - After=network.target +[Unit] +Description=MCSManager Web Panel Service +After=network.target - [Service] - User=root - WorkingDirectory=\"$webPath\" - ExecStart=$webExecStart - Restart=always +[Service] +User=root +WorkingDirectory="$webPath" +ExecStart=$webExecStart +Restart=always - [Install] - WantedBy=multi-user.target +[Install] +WantedBy=multi-user.target EOF cat > /etc/systemd/system/mcsm-daemon.service << EOF - [Unit] - Description=MCSManager Daemon Service - After=network.target +[Unit] +Description=MCSManager Daemon Service +After=network.target - [Service] - User=root - WorkingDirectory=\"$daemonPath\" - ExecStart=$daemonExecStart - Restart=always +[Service] +User=root +WorkingDirectory="$daemonPath" +ExecStart=$daemonExecStart +Restart=always - [Install] - WantedBy=multi-user.target +[Install] +WantedBy=multi-user.target EOF # Enable systemd service LEcho cyan "[*] 正在启动 MCSManager 服务" "[*] Starting MCSManager services" From 033914a9a3d8c8281cdbd85f2af49a2ac6f63042 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 19:20:24 +0800 Subject: [PATCH 021/463] fix --- setup.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index 00bca7c..314bfe6 100644 --- a/setup.sh +++ b/setup.sh @@ -133,8 +133,6 @@ CheckCN() { webURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" nodeBaseURL="https://npmmirror.com/mirrors/node" cn=1 - else - LEcho cyan "[-] 检测服务器地理位置出错, 跳过检测" "[-] Error detecting server location, skipping detection" fi return } @@ -326,7 +324,7 @@ After=network.target [Service] User=root -WorkingDirectory="$webPath" +WorkingDirectory=$webPath ExecStart=$webExecStart Restart=always @@ -340,7 +338,7 @@ After=network.target [Service] User=root -WorkingDirectory="$daemonPath" +WorkingDirectory=$daemonPath ExecStart=$daemonExecStart Restart=always @@ -350,8 +348,13 @@ EOF # Enable systemd service LEcho cyan "[*] 正在启动 MCSManager 服务" "[*] Starting MCSManager services" systemctl daemon-reload - systemctl enable mcsm-web --now || LEcho error "[x] 无法启动 MCSManager 前端管理面板服务" "[x] Unable to start MCSManager web panel service" - systemctl enable mcsm-daemon --now || LEcho error "[x] 无法启动 MCSManager 守护程序服务" "[x] Unable to start MCSManager daemon service" + if [ $mode == "update" ];then + systemctl restart mcsm-web || LEcho error "[x] 无法启动 MCSManager 前端管理面板服务" "[x] Unable to start MCSManager web panel service" + systemctl restart mcsm-daemon || LEcho error "[x] 无法启动 MCSManager 守护程序服务" "[x] Unable to start MCSManager daemon service" + else + systemctl enable mcsm-web --now || LEcho error "[x] 无法启动 MCSManager 前端管理面板服务" "[x] Unable to start MCSManager web panel service" + systemctl enable mcsm-daemon --now || LEcho error "[x] 无法启动 MCSManager 守护程序服务" "[x] Unable to start MCSManager daemon service" + fi # Output login info LEcho green "[√] MCSManager 安装完毕" "[√] MCSManager installation completed" From e315f4e98f9d377956b9bc05a467c0319d41d0f9 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 19:21:56 +0800 Subject: [PATCH 022/463] fix --- setup.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 314bfe6..31ce1d8 100644 --- a/setup.sh +++ b/setup.sh @@ -125,7 +125,7 @@ CheckRoot() { ## Detect server geographic location CheckCN() { - LEcho echo "[*] 正在检查服务器地理位置" "[*] Checking server location" + LEcho cyan "[*] 正在检查服务器地理位置" "[*] Checking server location" server_ip=$(curl -s ifconfig.me) if [[ "$(curl -s "http://ip-api.com/json/${server_ip}?fields=countryCode" | jq -r '.countryCode')" == "CN" ]]; then LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国, 已自动切换为中国镜像源" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China, and the Chinese mirror source has been automatically switched" @@ -139,7 +139,7 @@ CheckCN() { ## Detect system architecture CheckArch() { - LEcho echo "[*] 正在检查系统架构" "[*] Checking system architecture" + LEcho cyan "[*] 正在检查系统架构" "[*] Checking system architecture" arch=$(uname -m) case $arch in x86_64) @@ -166,6 +166,7 @@ CheckArch() { ## Detect system version CheckOS() { + LEcho cyan "[*] 正在检查系统版本" "[*] Checking system version" if [ -f /etc/os-release ]; then # shellcheck source=/dev/null . /etc/os-release From 86c96fe28f88b640077ba5b3b75c333d77a4a780 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 19:26:43 +0800 Subject: [PATCH 023/463] Fix a color question --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 31ce1d8..2930ead 100644 --- a/setup.sh +++ b/setup.sh @@ -415,7 +415,7 @@ Clean() { ### Start -LEcho echo "[-] 正在检查基础环境, 请稍等" "[-] Checking basic environment, please wait" +LEcho cyan "[-] 正在检查基础环境, 请稍等" "[-] Checking basic environment, please wait" CheckRoot CheckArch CheckOS From e93bf10dae01bfb02a46fb016f1751cee8e2d2cb Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 19:28:13 +0800 Subject: [PATCH 024/463] Fixed a priority issue --- setup.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index 2930ead..37e4ab3 100644 --- a/setup.sh +++ b/setup.sh @@ -44,10 +44,6 @@ else zh=0 fi -## Systemd service command -webExecStart="\"$nodeBin\" \"$webPath/app.js\"" -daemonExecStart="\"$nodeBin\" \"$daemonPath/app.js\"" - ## Debug debug=0 @@ -318,6 +314,9 @@ Install() { # Create systemd service LEcho cyan "[*] 正在创建 systemd 服务" "[*] Creating systemd service" + + webExecStart="\"$nodeBin\" \"$webPath/app.js\"" + daemonExecStart="\"$nodeBin\" \"$daemonPath/app.js\"" cat > /etc/systemd/system/mcsm-web.service << EOF [Unit] Description=MCSManager Web Panel Service From d89591bc2123456f20db821bf8a90fc38590e34b Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 21:03:45 +0800 Subject: [PATCH 025/463] Bring forward the tool installation operation --- setup.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/setup.sh b/setup.sh index 37e4ab3..27ab570 100644 --- a/setup.sh +++ b/setup.sh @@ -180,6 +180,15 @@ CheckOS() { else LEcho error "[x] 未能正常检测到系统类型, 无法继续安装" "[x] Unable to detect system type, installation cannot continue" fi + + # Install dependencies + LEcho cyan "[*] 正在安装安装所需的工具" "[*] Installing the tools required for installation" + if [ "$os" == "debian" ]; then + apt-get update + apt-get install -y curl git wget jq + elif [ "$os" == "redhat" ]; then + yum install -y curl git wget jq + fi return } @@ -236,15 +245,6 @@ Install() { [ -d $mcsmPath ] && mode="update" mkdir -p $mcsmPath - # Install dependencies - LEcho cyan "[*] 正在安装安装所需的工具" "[*] Installing the tools required for installation" - if [ "$os" == "debian" ]; then - apt-get update - apt-get install -y curl git wget jq - elif [ "$os" == "redhat" ]; then - yum install -y curl git wget jq - fi - # Install nodejs if ! CheckNode;then LEcho cyan "[*] 正在安装 Node.js" "[*] Installing Node.js" From 03cdece0f0b68301958dd58ad0193ef50e16ce47 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 21:14:22 +0800 Subject: [PATCH 026/463] Fix the problem that RHEL cannot install some software --- setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.sh b/setup.sh index 27ab570..4814de5 100644 --- a/setup.sh +++ b/setup.sh @@ -187,6 +187,7 @@ CheckOS() { apt-get update apt-get install -y curl git wget jq elif [ "$os" == "redhat" ]; then + yum install -y epel-release yum install -y curl git wget jq fi return From cbcc457281d6869509e1d0ce789325cade68f720 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 21:22:57 +0800 Subject: [PATCH 027/463] Fix no error handler for Node installation errors --- setup.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index 4814de5..cfe2bba 100644 --- a/setup.sh +++ b/setup.sh @@ -250,8 +250,8 @@ Install() { if ! CheckNode;then LEcho cyan "[*] 正在安装 Node.js" "[*] Installing Node.js" # Download nodejs files - wget -t=3 -q --no-check-certificate --show-progress -O $tmpDir/node.tar.gz "$nodeFileURL" - wget -t=3 -q --no-check-certificate --show-progress -O $tmpDir/node.sha256 "$nodeHashURL" + wget -q --no-check-certificate --show-progress -O $tmpDir/node.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" + wget -q --no-check-certificate --show-progress -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" # Check nodejs files if [ "$(sha256sum $tmpDir/node.tar.gz | awk '{print $1}')" != "$(cat $tmpDir/node.sha256)" ]; then @@ -262,10 +262,14 @@ Install() { tar -xzf $tmpDir/node.tar.gz -C $tmpDir cp -r "$tmpDir/node-$nodeVer-linux-$arch/*" $nodePath - LEcho cyan "===============================================" "===============================================" - LEcho cyan "Node.js 版本: $($nodeBin --version)" "Node.js version: $($nodeBin --version)" - LEcho cyan "NPM 版本: $($npmBin -v)" "NPM version: $($npmBin -v)" - LEcho cyan "===============================================" "===============================================" + if command -v $nodeBin > /dev/null; then + LEcho cyan "===============================================" "===============================================" + LEcho cyan "Node.js 版本: $($nodeBin --version)" "Node.js version: $($nodeBin --version)" + LEcho cyan "NPM 版本: $($npmBin -v)" "NPM version: $($npmBin -v)" + LEcho cyan "===============================================" "===============================================" + else + LEcho error "[x] Node.js 安装失败, 请重试" "[x] Node.js installation failed, please try again" + fi else LEcho cyan "[-] 检测到已安装 Node.js, 跳过安装" "[-] Detected installed Node.js, skip installation" nodeBin="$(which node)" From 4edf404e95c0e50d1d5bda32cf6cc0db0f30cc95 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 21:39:51 +0800 Subject: [PATCH 028/463] Modify the download command to make it available on RHEL --- setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index cfe2bba..74469bb 100644 --- a/setup.sh +++ b/setup.sh @@ -226,7 +226,7 @@ GUI(){ return ;; *) - LEcho error "[x] 无效的选项" "[x] Invalid option" + LEcho red "[x] 无效的选项" "[x] Invalid option" GUI ;; esac @@ -250,8 +250,8 @@ Install() { if ! CheckNode;then LEcho cyan "[*] 正在安装 Node.js" "[*] Installing Node.js" # Download nodejs files - wget -q --no-check-certificate --show-progress -O $tmpDir/node.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" - wget -q --no-check-certificate --show-progress -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" + wget -q --no-check-certificate -O $tmpDir/node.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" + wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" # Check nodejs files if [ "$(sha256sum $tmpDir/node.tar.gz | awk '{print $1}')" != "$(cat $tmpDir/node.sha256)" ]; then From 0295f10d48ba442fe723769b594407a0496624f9 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 22:08:28 +0800 Subject: [PATCH 029/463] fix --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 74469bb..c59913b 100644 --- a/setup.sh +++ b/setup.sh @@ -30,8 +30,6 @@ mode="install" ## URLs # Node.js nodeBaseURL="https://nodejs.org/dist" -nodeFileURL="$nodeBaseURL/$nodeVer/node-$nodeVer-linux-$arch.tar.gz" -nodeHashURL="$nodeBaseURL/$nodeVer/SHASUMS256.txt" # MCSManager daemonURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" @@ -250,6 +248,8 @@ Install() { if ! CheckNode;then LEcho cyan "[*] 正在安装 Node.js" "[*] Installing Node.js" # Download nodejs files + nodeFileURL="$nodeBaseURL/$nodeVer/node-$nodeVer-linux-$arch.tar.gz" + nodeHashURL="$nodeBaseURL/$nodeVer/SHASUMS256.txt" wget -q --no-check-certificate -O $tmpDir/node.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" From ba71ae596e20de6ebdee834b91463a0e8598d283 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 22:13:08 +0800 Subject: [PATCH 030/463] fix --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index c59913b..7385cd2 100644 --- a/setup.sh +++ b/setup.sh @@ -254,7 +254,7 @@ Install() { wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" # Check nodejs files - if [ "$(sha256sum $tmpDir/node.tar.gz | awk '{print $1}')" != "$(cat $tmpDir/node.sha256)" ]; then + if [ "$(sha256sum $tmpDir/node.tar.gz | awk '{print $1}')" != "$(cat $tmpDir/node.sha256 | grep "node-$nodeVer-linux-$arch.tar.gz")" ]; then LEcho error "[x] Node.js 安装包校验失败, 请重试" "[x] Node.js installation package verification failed, please try again" fi From 15fcc850083e340fb1f9f76d64edc9f660242fdb Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 22:15:25 +0800 Subject: [PATCH 031/463] fix --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 7385cd2..3b24c10 100644 --- a/setup.sh +++ b/setup.sh @@ -254,7 +254,7 @@ Install() { wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" # Check nodejs files - if [ "$(sha256sum $tmpDir/node.tar.gz | awk '{print $1}')" != "$(cat $tmpDir/node.sha256 | grep "node-$nodeVer-linux-$arch.tar.gz")" ]; then + if [ "$(sha256sum $tmpDir/node.tar.gz)" != "$(cat $tmpDir/node.sha256 | grep "node-$nodeVer-linux-$arch.tar.gz")" ]; then LEcho error "[x] Node.js 安装包校验失败, 请重试" "[x] Node.js installation package verification failed, please try again" fi From b4a2e46ab1b338283c02d68359af3f6572ffa10d Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 22:18:39 +0800 Subject: [PATCH 032/463] fix --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 3b24c10..1f3feb2 100644 --- a/setup.sh +++ b/setup.sh @@ -250,7 +250,7 @@ Install() { # Download nodejs files nodeFileURL="$nodeBaseURL/$nodeVer/node-$nodeVer-linux-$arch.tar.gz" nodeHashURL="$nodeBaseURL/$nodeVer/SHASUMS256.txt" - wget -q --no-check-certificate -O $tmpDir/node.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" + wget -q --no-check-certificate -O $tmpDir/node-$nodeVer-linux-$arch.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" # Check nodejs files From f833a3e7bb58c31a3e72cf4c9a2bcd1bcca9f361 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 22:20:27 +0800 Subject: [PATCH 033/463] last fix? --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 1f3feb2..949ce2d 100644 --- a/setup.sh +++ b/setup.sh @@ -254,12 +254,12 @@ Install() { wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" # Check nodejs files - if [ "$(sha256sum $tmpDir/node.tar.gz)" != "$(cat $tmpDir/node.sha256 | grep "node-$nodeVer-linux-$arch.tar.gz")" ]; then + if [ "$(sha256sum $tmpDir/node-$nodeVer-linux-$arch.tar.gz)" != "$(cat $tmpDir/node.sha256 | grep "node-$nodeVer-linux-$arch.tar.gz")" ]; then LEcho error "[x] Node.js 安装包校验失败, 请重试" "[x] Node.js installation package verification failed, please try again" fi # Install nodejs - tar -xzf $tmpDir/node.tar.gz -C $tmpDir + tar -xzf $tmpDir/node-$nodeVer-linux-$arch.tar.gz -C $tmpDir cp -r "$tmpDir/node-$nodeVer-linux-$arch/*" $nodePath if command -v $nodeBin > /dev/null; then From 770acce4903246c640395c0e17d0fcc3fd783866 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 22:23:06 +0800 Subject: [PATCH 034/463] Fix a copyright problem --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 949ce2d..57a6228 100644 --- a/setup.sh +++ b/setup.sh @@ -122,7 +122,7 @@ CheckCN() { LEcho cyan "[*] 正在检查服务器地理位置" "[*] Checking server location" server_ip=$(curl -s ifconfig.me) if [[ "$(curl -s "http://ip-api.com/json/${server_ip}?fields=countryCode" | jq -r '.countryCode')" == "CN" ]]; then - LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国, 已自动切换为中国镜像源" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China, and the Chinese mirror source has been automatically switched" + LEcho yellow "[!] 根据 'ip-api.com' 提供的信息, 当前服务器可能在中国, 已自动切换为中国镜像源" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China, and the Chinese mirror source has been automatically switched" daemonURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" webURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" nodeBaseURL="https://npmmirror.com/mirrors/node" From 1c306d2d8ad06e40e0d8104674f5f1e950f1ed61 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 22:30:55 +0800 Subject: [PATCH 035/463] fix --- setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 57a6228..6ef804c 100644 --- a/setup.sh +++ b/setup.sh @@ -250,16 +250,16 @@ Install() { # Download nodejs files nodeFileURL="$nodeBaseURL/$nodeVer/node-$nodeVer-linux-$arch.tar.gz" nodeHashURL="$nodeBaseURL/$nodeVer/SHASUMS256.txt" - wget -q --no-check-certificate -O $tmpDir/node-$nodeVer-linux-$arch.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" + wget -q --no-check-certificate -O $tmpDir/node.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" # Check nodejs files - if [ "$(sha256sum $tmpDir/node-$nodeVer-linux-$arch.tar.gz)" != "$(cat $tmpDir/node.sha256 | grep "node-$nodeVer-linux-$arch.tar.gz")" ]; then + if ! grep "node-$nodeVer-linux-$arch.tar.gz" sha256sum.txt | cut -d ' ' -f 1 | xargs sha256sum -c $tmpDir/node.tar.gz; then LEcho error "[x] Node.js 安装包校验失败, 请重试" "[x] Node.js installation package verification failed, please try again" fi # Install nodejs - tar -xzf $tmpDir/node-$nodeVer-linux-$arch.tar.gz -C $tmpDir + tar -xzf "$tmpDir/node.tar.gz" -C $tmpDir cp -r "$tmpDir/node-$nodeVer-linux-$arch/*" $nodePath if command -v $nodeBin > /dev/null; then From e6b254a662eaaa461dd86d4c630ec659eb5d91e4 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 22:31:56 +0800 Subject: [PATCH 036/463] fix --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 6ef804c..e1390be 100644 --- a/setup.sh +++ b/setup.sh @@ -254,7 +254,7 @@ Install() { wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" # Check nodejs files - if ! grep "node-$nodeVer-linux-$arch.tar.gz" sha256sum.txt | cut -d ' ' -f 1 | xargs sha256sum -c $tmpDir/node.tar.gz; then + if ! grep "node-$nodeVer-linux-$arch.tar.gz" $tmpDir/node.sha256 | cut -d ' ' -f 1 | xargs sha256sum -c $tmpDir/node.tar.gz; then LEcho error "[x] Node.js 安装包校验失败, 请重试" "[x] Node.js installation package verification failed, please try again" fi From 1a87b536aa1f36b2eba4aba9a0a711d9a06153d9 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 22:52:09 +0800 Subject: [PATCH 037/463] That's it for tonight. --- setup.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index e1390be..1df7c8c 100644 --- a/setup.sh +++ b/setup.sh @@ -254,13 +254,15 @@ Install() { wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" # Check nodejs files - if ! grep "node-$nodeVer-linux-$arch.tar.gz" $tmpDir/node.sha256 | cut -d ' ' -f 1 | xargs sha256sum -c $tmpDir/node.tar.gz; then + if [ "$(sha256sum $tmpDir/node.tar.gz | cut -d ' ' -f 1)" != "$(grep "node-$nodeVer-linux-$arch.tar.gz" $tmpDir/node.sha256 | cut -d ' ' -f 1)" ]; then LEcho error "[x] Node.js 安装包校验失败, 请重试" "[x] Node.js installation package verification failed, please try again" fi # Install nodejs + [ -d $nodePath ] && rm -rf $nodePath + mkdir -p $nodePath tar -xzf "$tmpDir/node.tar.gz" -C $tmpDir - cp -r "$tmpDir/node-$nodeVer-linux-$arch/*" $nodePath + mv -f "$tmpDir/node-$nodeVer-linux-$arch/*" $nodePath if command -v $nodeBin > /dev/null; then LEcho cyan "===============================================" "===============================================" From c8a3bd59c74edf2ca8ca20651233ec7142dcff93 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 23:02:11 +0800 Subject: [PATCH 038/463] Last fix?! --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 1df7c8c..e4f0051 100644 --- a/setup.sh +++ b/setup.sh @@ -262,7 +262,7 @@ Install() { [ -d $nodePath ] && rm -rf $nodePath mkdir -p $nodePath tar -xzf "$tmpDir/node.tar.gz" -C $tmpDir - mv -f "$tmpDir/node-$nodeVer-linux-$arch/*" $nodePath + mv -f "$tmpDir/node-$nodeVer-linux-$arch/" "$mcsmPath/node" if command -v $nodeBin > /dev/null; then LEcho cyan "===============================================" "===============================================" From 0b180fcd7470c8ff77d1e8f5f5c2c9784cd833ff Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Fri, 17 Mar 2023 23:03:41 +0800 Subject: [PATCH 039/463] ok, last fix now(maybe? --- setup.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index e4f0051..c12beff 100644 --- a/setup.sh +++ b/setup.sh @@ -261,8 +261,7 @@ Install() { # Install nodejs [ -d $nodePath ] && rm -rf $nodePath mkdir -p $nodePath - tar -xzf "$tmpDir/node.tar.gz" -C $tmpDir - mv -f "$tmpDir/node-$nodeVer-linux-$arch/" "$mcsmPath/node" + tar -xzf "$tmpDir/node.tar.gz" -C $nodePath if command -v $nodeBin > /dev/null; then LEcho cyan "===============================================" "===============================================" From 1dc7c6deae0615c4707efd819beecbaea59b92a3 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Sat, 18 Mar 2023 11:09:44 +0800 Subject: [PATCH 040/463] Smaller! Better! Stronger! --- setup.sh | 76 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/setup.sh b/setup.sh index c12beff..87c4dd6 100644 --- a/setup.sh +++ b/setup.sh @@ -16,7 +16,7 @@ webPath="$mcsmPath/web" # Node.js nodePath="$mcsmPath/node" nodeBin="$nodePath/bin/node" -npmBin="$nodePath/bin/npm" +npmBin="$nodeBin $nodePath/bin/npm" # Junk tmpDir="/tmp/mcsmanager" @@ -178,7 +178,7 @@ CheckOS() { else LEcho error "[x] 未能正常检测到系统类型, 无法继续安装" "[x] Unable to detect system type, installation cannot continue" fi - + # Install dependencies LEcho cyan "[*] 正在安装安装所需的工具" "[*] Installing the tools required for installation" if [ "$os" == "debian" ]; then @@ -261,14 +261,9 @@ Install() { # Install nodejs [ -d $nodePath ] && rm -rf $nodePath mkdir -p $nodePath - tar -xzf "$tmpDir/node.tar.gz" -C $nodePath + tar -xzf "$tmpDir/node.tar.gz" -C $nodePath --strip-components=1 - if command -v $nodeBin > /dev/null; then - LEcho cyan "===============================================" "===============================================" - LEcho cyan "Node.js 版本: $($nodeBin --version)" "Node.js version: $($nodeBin --version)" - LEcho cyan "NPM 版本: $($npmBin -v)" "NPM version: $($npmBin -v)" - LEcho cyan "===============================================" "===============================================" - else + if ! command -v $nodeBin ; then LEcho error "[x] Node.js 安装失败, 请重试" "[x] Node.js installation failed, please try again" fi else @@ -277,6 +272,11 @@ Install() { npmBin="$(which npm)" fi + LEcho yellow "===============================================" "===============================================" + LEcho cyan "Node.js 版本: $($nodeBin --version)" "Node.js version: $($nodeBin --version)" + LEcho cyan "NPM 版本: $($npmBin -v)" "NPM version: $($npmBin -v)" + LEcho yellow "===============================================" "===============================================" + # Install MCSManager if [ $mode == "update" ];then LEcho cyan "[*] 正在更新 MCSManager 前端管理面板" "[*] Updating MCSManager web panel" @@ -288,7 +288,7 @@ Install() { git fetch origin git checkout master git reset --hard origin/master - git pull + git pull LEcho cyan "[*] 正在更新 MCSManager 守护晨曦股" "[*] Updating MCSManager daemon" @@ -299,24 +299,24 @@ Install() { git fetch origin git checkout master git reset --hard origin/master - git pull + git pull else # Clone MCSManager web panel LEcho cyan "[*] 正在安装 MCSManager 前端管理面板" "[*] Installing MCSManager web panel" - git clone --single-branch -b master --depth 1 $webURL $webPath + git clone --single-branch -b master --depth 1 $webURL $webPath # Clone MCSManager daemon LEcho cyan "[*] 正在安装 MCSManager 守护程序" "[*] Installing MCSManager web panel" - git clone --single-branch -b master --depth 1 $daemonURL $daemonPath + git clone --single-branch -b master --depth 1 $daemonURL $daemonPath fi # Update dependencies LEcho cyan "[*] 正在更新依赖" "[*] Updating dependencies" cd $webPath || LEcho error "[x] 无法进入 MCSManager 前端管理目录, 请检查权限" "[x] Unable to enter MCSManager web panel directory, please check permissions" - [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com - [ $cn == 0 ] && $npmBin install + [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com + [ $cn == 0 ] && $npmBin install cd $daemonPath || LEcho error "[x] 无法进入 MCSManager 守护程序目录, 请检查权限" "[x] Unable to enter MCSManager daemon directory, please check permissions" - [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com - [ $cn == 0 ] && $npmBin install + [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com + [ $cn == 0 ] && $npmBin install # Create systemd service LEcho cyan "[*] 正在创建 systemd 服务" "[*] Creating systemd service" @@ -364,20 +364,22 @@ EOF # Output login info LEcho green "[√] MCSManager 安装完毕" "[√] MCSManager installation completed" - LEcho yellow "==================================================================" "==================================================================" - LEcho green "欢迎使用 MCSManager, 您可以通过以下方式访问: " "Welcome to use MCSManager, you can access it through the following ways:" - LEcho yellow "==================================================================" "==================================================================" - LEcho cyan_n "控制面板地址: " "Control panel address: " - LEcho yellow "http://localhost:23333" "http://localhost:23333" + sleep 3 + clear + LEcho yellow "==================================================================" "==================================================================" + LEcho green "欢迎使用 MCSManager, 您可以通过以下方式访问: " "Welcome to MCSManager, you can access it through the following ways:" + LEcho yellow "==================================================================" "==================================================================" + LEcho cyan_n "控制面板默认访问地址: " "Control panel default address: " + LEcho yellow "http://localhost:23333" "http://localhost:23333" LEcho red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" "If you can't access the panel, please check if the firewall/security group has opened the panel 23333 and 24444 ports. The control panel needs these two ports to work properly." - LEcho yellow "==================================================================" "==================================================================" - LEcho cyan "重启 systemctl restart mcsm-{daemon,web}.service" "Restart systemctl restart mcsm-{daemon,web}.service" - LEcho cyan "禁用 systemctl disable mcsm-{daemon,web}.service" "Disable systemctl disable mcsm-{daemon,web}.service" - LEcho cyan "启用 systemctl enable mcsm-{daemon,web}.service" "Enable systemctl enable mcsm-{daemon,web}.service" - LEcho cyan "启动 systemctl start mcsm-{daemon,web}.service" "Start systemctl start mcsm-{daemon,web}.service" - LEcho cyan "停止 systemctl stop mcsm-{daemon,web}.service" "Stop systemctl stop mcsm-{daemon,web}.service" - LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More usage instructions, please refer to: https://docs.mcsmanager.com/" - LEcho yellow "==================================================================" "==================================================================" + LEcho yellow "==================================================================" "==================================================================" + LEcho cyan "启动 MCSM: systemctl start mcsm-{daemon,web}.service" "Start MCSM: systemctl start mcsm-{daemon,web}.service" + LEcho cyan "重启 MCSM: systemctl restart mcsm-{daemon,web}.service" "Restart MCSM: systemctl restart mcsm-{daemon,web}.service" + LEcho cyan "停止 MCSM: systemctl stop mcsm-{daemon,web}.service" "Stop MCSM: systemctl stop mcsm-{daemon,web}.service" + LEcho cyan "启用自启动: systemctl enable mcsm-{daemon,web}.service" "Enable: systemctl enable mcsm-{daemon,web}.service" + LEcho cyan "禁用自启动: systemctl disable mcsm-{daemon,web}.service" "Disable: systemctl disable mcsm-{daemon,web}.service" + LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More usage instructions, please refer to: https://docs.mcsmanager.com/" + LEcho yellow "==================================================================" "==================================================================" # Clean up rm -rf $tmpDir @@ -387,16 +389,16 @@ EOF ## Remove MCSManager Remove() { clear - LEcho yellow "==================================================================" "==================================================================" - LEcho yellow "[!] 你确定要删除 MCSManager 吗" "[!] Are you sure you want to delete MCSManager" - LEcho yellow "[!] 删除 MCSManager 后, 所有服务器数据将会丢失" "[!] All server data will be lost after deleting MCSManager" - LEcho yellow "[!] 请在 10 秒内按下 Ctrl + C 取消删除" "[!] Please press Ctrl + C within 10 seconds to cancel deletion" - LEcho yellow "==================================================================" "==================================================================" + LEcho yellow "==================================================================" "==================================================================" + LEcho yellow "[!] 你确定要卸载 MCSManager 吗" "[!] Are you sure you want to uninstall MCSManager" + LEcho yellow "[!] 卸载 MCSManager 后, 所有由 MCSManager 自动创建实例文件夹内的服务器数据将会丢失" "[!] After uninstalling MCSManager, all server data in the automatically created instance folder will be lost" + LEcho yellow "[!] 请在 10 秒内按下 Ctrl + C 取消卸载" "[!] Please press Ctrl + C within 10 seconds to cancel the uninstall" + LEcho yellow "==================================================================" "==================================================================" sleep 10 LEcho cyan "[*] 正在停止 MCSManager 服务" "[*] Stopping MCSManager service" - systemctl disable mcsm-daemon --now || LEcho error "[x] 无法停止 MCSManager 守护程序服务" "[x] Unable to stop MCSManager daemon service" - systemctl disable mcsm-web --now || LEcho error "[x] 无法停止 MCSManager 前端管理面板服务" "[x] Unable to stop MCSManager web panel service" + systemctl disable mcsm-daemon --now || LEcho error "[x] 无法停止 MCSManager 守护程序服务" "[x] Unable to stop MCSManager daemon service" + systemctl disable mcsm-web --now || LEcho error "[x] 无法停止 MCSManager 前端管理面板服务" "[x] Unable to stop MCSManager web panel service" LEcho cyan "[*] 正在删除 MCSManager 服务" "[*] Deleting MCSManager service" rm -rf /etc/systemd/system/mcsm-daemon.service From b549fc99199637f1929f5a40e9e479dccd9ca905 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Sat, 18 Mar 2023 12:29:11 +0800 Subject: [PATCH 041/463] Remove GUI and uninstall feature --- setup.sh | 58 +------------------------------------------------------- 1 file changed, 1 insertion(+), 57 deletions(-) diff --git a/setup.sh b/setup.sh index 87c4dd6..cbb85da 100644 --- a/setup.sh +++ b/setup.sh @@ -201,36 +201,6 @@ CheckNode() { return 1 } -## Main GUI -GUI(){ - clear - LEcho cyan "===============================================" "===============================================" - LEcho cyan "MCSManager Installer" "MCSManager Installer" - LEcho cyan "===============================================" "===============================================" - LEcho cyan "1. 安装 MCSManager" "1. Install MCSManager" - LEcho cyan "2. 卸载 MCSManager" "2. Uninstall MCSManager" - LEcho cyan "3. 退出" "3. Exit" - LEcho cyan "===============================================" "===============================================" - LEcho cyan_n "请输入选项: " "Please enter an option: " - read -r option - case $option in - 1) - Install - ;; - 2) - Remove - ;; - 3) - return - ;; - *) - LEcho red "[x] 无效的选项" "[x] Invalid option" - GUI - ;; - esac - return -} - ## Install MCSManager Install() { clear @@ -386,32 +356,6 @@ EOF return } -## Remove MCSManager -Remove() { - clear - LEcho yellow "==================================================================" "==================================================================" - LEcho yellow "[!] 你确定要卸载 MCSManager 吗" "[!] Are you sure you want to uninstall MCSManager" - LEcho yellow "[!] 卸载 MCSManager 后, 所有由 MCSManager 自动创建实例文件夹内的服务器数据将会丢失" "[!] After uninstalling MCSManager, all server data in the automatically created instance folder will be lost" - LEcho yellow "[!] 请在 10 秒内按下 Ctrl + C 取消卸载" "[!] Please press Ctrl + C within 10 seconds to cancel the uninstall" - LEcho yellow "==================================================================" "==================================================================" - sleep 10 - - LEcho cyan "[*] 正在停止 MCSManager 服务" "[*] Stopping MCSManager service" - systemctl disable mcsm-daemon --now || LEcho error "[x] 无法停止 MCSManager 守护程序服务" "[x] Unable to stop MCSManager daemon service" - systemctl disable mcsm-web --now || LEcho error "[x] 无法停止 MCSManager 前端管理面板服务" "[x] Unable to stop MCSManager web panel service" - - LEcho cyan "[*] 正在删除 MCSManager 服务" "[*] Deleting MCSManager service" - rm -rf /etc/systemd/system/mcsm-daemon.service - rm -rf /etc/systemd/system/mcsm-web.service - systemctl daemon-reload - - LEcho cyan "[*] 正在删除 MCSManager 目录" "[*] Deleting MCSManager directory" - rm -rf $mcsmPath - - LEcho green "[√] MCSManager 删除完毕" "[√] MCSManager deletion completed" - return -} - ## Clean up Clean() { LEcho cyan "[*] 正在清理残余文件" "[*] Cleaning up" @@ -427,5 +371,5 @@ CheckRoot CheckArch CheckOS CheckCN -GUI +Install LEcho cyan "[-] 期待与您的下次见面" "[-] Looking forward to seeing you again" \ No newline at end of file From de7c4dc2494495f71da4cb2b0cde4bab89583ca9 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Sat, 18 Mar 2023 12:47:43 +0800 Subject: [PATCH 042/463] Fix the problem of incomplete systemd file --- setup_cn.sh | 381 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 381 insertions(+) create mode 100644 setup_cn.sh diff --git a/setup_cn.sh b/setup_cn.sh new file mode 100644 index 0000000..a2d5dca --- /dev/null +++ b/setup_cn.sh @@ -0,0 +1,381 @@ +#!/usr/bin/env bash + +#### MCSManager Installer +#### Made by BlueFunny +#### Originally written by nuomiaa, CreeperKong, unitwk + +#### Copyright © 2023 MCSManager All rights reserved. + +### Variables +## Files +# MCSManager +mcsmPath="/opt/mcsmanager" +daemonPath="$mcsmPath/daemon" +webPath="$mcsmPath/web" + +# Node.js +nodePath="$mcsmPath/node" +nodeBin="$nodePath/bin/node" +npmBin="$nodeBin $nodePath/bin/npm" + +# Junk +tmpDir="/tmp/mcsmanager" + +## Node info +nodeVer="v16.13.0" + +## Install mode +mode="install" + +## URLs +# Node.js +nodeBaseURL="https://nodejs.org/dist" + +# MCSManager +daemonURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" +webURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" + +## Language +if [ "$(echo "$LANG" | grep "zh_CN")" != "" ]; then + zh=1 +else + zh=0 +fi + +## Debug +debug=0 + +## Other +cn=0 + +### Functions +## Localize echo +# $1: color +# $2: zh +# $3: en +LEcho() { + case $1 in + # Red color echo + red) + [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" + ;; + + # Green color echo + green) + [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" + ;; + + # Cyan color echo + cyan) + [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" + ;; + + # Cyan color echo (No line break) + cyan_n) + [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" + [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" + ;; + + # Yellow color echo + yellow) + [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" + ;; + + # Red error echo + error) + Clean + echo '=================================================' + [ "$zh" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" + [ "$zh" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" + echo '=================================================' + exit 1 + ;; + + # Debug echo + debug) + [ "$debug" == 1 ] && printf '\033[1;35m%b\033[0m\n' "[DEBUG] $2" + ;; + + # No color echo + *) + [ "$zh" == 1 ] && echo "$2" + [ "$zh" == 0 ] && echo "$3" + ;; + esac + return +} + +## Check root +CheckRoot() { + if [[ $EUID -ne 0 ]]; then + LEcho error "[!] 请使用 root 用户运行此脚本" "[!] Please run this script as root" + fi + return +} + +## Detect server geographic location +CheckCN() { + LEcho cyan "[*] 正在检查服务器地理位置" "[*] Checking server location" + server_ip=$(curl -s ifconfig.me) + if [[ "$(curl -s "http://ip-api.com/json/${server_ip}?fields=countryCode" | jq -r '.countryCode')" == "CN" ]]; then + LEcho yellow "[!] 根据 'ip-api.com' 提供的信息, 当前服务器可能在中国, 已自动切换为中国镜像源" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China, and the Chinese mirror source has been automatically switched" + daemonURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" + webURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" + nodeBaseURL="https://npmmirror.com/mirrors/node" + cn=1 + fi + return +} + +## Detect system architecture +CheckArch() { + LEcho cyan "[*] 正在检查系统架构" "[*] Checking system architecture" + arch=$(uname -m) + case $arch in + x86_64) + arch="x64" + ;; + aarch64) + arch="arm64" + ;; + arm) + arch="armv7l" + ;; + ppc64le) + arch="ppc64le" + ;; + s390x) + arch="s390x" + ;; + *) + LEcho error "[x] MCSManager 暂不支持当前系统架构" "[x] MCSManager does not currently support the current system architecture" + ;; + esac + return +} + +## Detect system version +CheckOS() { + LEcho cyan "[*] 正在检查系统版本" "[*] Checking system version" + if [ -f /etc/os-release ]; then + # shellcheck source=/dev/null + . /etc/os-release + case "$ID" in + debian|ubuntu) + os="debian" + ;; + centos|rhel|fedora) + os="redhat" + ;; + *) + LEcho error "[x] 本脚本仅支持 Ubuntu/Debian/CentOS 系统!" "[x] This script only supports Ubuntu/Debian/CentOS systems!" + ;; + esac + else + LEcho error "[x] 未能正常检测到系统类型, 无法继续安装" "[x] Unable to detect system type, installation cannot continue" + fi + + # Install dependencies + LEcho cyan "[*] 正在安装安装所需的工具" "[*] Installing the tools required for installation" + if [ "$os" == "debian" ]; then + apt-get update + apt-get install -y curl git wget jq + elif [ "$os" == "redhat" ]; then + yum install -y epel-release + yum install -y curl git wget jq + fi + return +} + +## Detect nodejs version +CheckNode() { + if command -v node > /dev/null; then + if [ "$(node -v | cut -c2- | awk -F. '{print $1}')" -ge 14 ]; then + return 0 + fi + fi + return 1 +} + +## Install MCSManager +Install() { + clear + LEcho cyan "[-] 开始安装 MCSManager" "[-] Start installing MCSManager" + # Init work environment + LEcho cyan "[*] 正在初始化工作环境" "[*] Initializing work environment" + mkdir -p $tmpDir + + # Detect old MCSManager + [ -d $mcsmPath ] && LEcho yellow "[!] 检测到旧版 MCSManager, 切换为更新模式" "[!] Old version of MCSManager detected, switch to update mode" + [ -d $mcsmPath ] && mode="update" + mkdir -p $mcsmPath + + # Install nodejs + if ! CheckNode;then + LEcho cyan "[*] 正在安装 Node.js" "[*] Installing Node.js" + # Download nodejs files + nodeFileURL="$nodeBaseURL/$nodeVer/node-$nodeVer-linux-$arch.tar.gz" + nodeHashURL="$nodeBaseURL/$nodeVer/SHASUMS256.txt" + wget -q --no-check-certificate -O $tmpDir/node.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" + wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" + + # Check nodejs files + if [ "$(sha256sum $tmpDir/node.tar.gz | cut -d ' ' -f 1)" != "$(grep "node-$nodeVer-linux-$arch.tar.gz" $tmpDir/node.sha256 | cut -d ' ' -f 1)" ]; then + LEcho error "[x] Node.js 安装包校验失败, 请重试" "[x] Node.js installation package verification failed, please try again" + fi + + # Install nodejs + [ -d $nodePath ] && rm -rf $nodePath + mkdir -p $nodePath + tar -xzf "$tmpDir/node.tar.gz" -C $nodePath --strip-components=1 + + if ! command -v $nodeBin ; then + LEcho error "[x] Node.js 安装失败, 请重试" "[x] Node.js installation failed, please try again" + fi + else + LEcho cyan "[-] 检测到已安装 Node.js, 跳过安装" "[-] Detected installed Node.js, skip installation" + nodeBin="$(which node)" + npmBin="$(which npm)" + fi + + LEcho yellow "===============================================" "===============================================" + LEcho cyan "Node.js 版本: $($nodeBin --version)" "Node.js version: $($nodeBin --version)" + LEcho cyan "NPM 版本: $($npmBin -v)" "NPM version: $($npmBin -v)" + LEcho yellow "===============================================" "===============================================" + + # Install MCSManager + if [ $mode == "update" ];then + LEcho cyan "[*] 正在更新 MCSManager 前端管理面板" "[*] Updating MCSManager web panel" + + cd $webPath || LEcho error "[x] 无法进入 MCSManager 前端管理面板目录, 请检查权限" "[x] Unable to enter MCSManager web panel directory, please check permissions" + + # Clone MCSManager web panel + git remote set-url origin $webURL + git fetch origin + git checkout master + git reset --hard origin/master + git pull + + LEcho cyan "[*] 正在更新 MCSManager 守护晨曦股" "[*] Updating MCSManager daemon" + + cd $daemonPath || LEcho error "[x] 无法进入 MCSManager 守护程序目录, 请检查权限" "[x] Unable to enter MCSManager daemon directory, please check permissions" + + # Clone MCSManager daemon + git remote set-url origin $daemonURL + git fetch origin + git checkout master + git reset --hard origin/master + git pull + else + # Clone MCSManager web panel + LEcho cyan "[*] 正在安装 MCSManager 前端管理面板" "[*] Installing MCSManager web panel" + git clone --single-branch -b master --depth 1 $webURL $webPath + + # Clone MCSManager daemon + LEcho cyan "[*] 正在安装 MCSManager 守护程序" "[*] Installing MCSManager web panel" + git clone --single-branch -b master --depth 1 $daemonURL $daemonPath + fi + # Update dependencies + LEcho cyan "[*] 正在更新依赖" "[*] Updating dependencies" + cd $webPath || LEcho error "[x] 无法进入 MCSManager 前端管理目录, 请检查权限" "[x] Unable to enter MCSManager web panel directory, please check permissions" + [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com + [ $cn == 0 ] && $npmBin install + cd $daemonPath || LEcho error "[x] 无法进入 MCSManager 守护程序目录, 请检查权限" "[x] Unable to enter MCSManager daemon directory, please check permissions" + [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com + [ $cn == 0 ] && $npmBin install + + # Create systemd service + LEcho cyan "[*] 正在创建 systemd 服务" "[*] Creating systemd service" + + webExecStart="\"$nodeBin\" \"$webPath/app.js\"" + daemonExecStart="\"$nodeBin\" \"$daemonPath/app.js\"" + cat > /etc/systemd/system/mcsm-web.service << EOF +[Unit] +Description=MCSManager Web Panel Service +After=network.target + +[Service] +User=root +WorkingDirectory=$webPath +ExecStart=$webExecStart +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment=\"PATH=${PATH}\" +Restart=always + +[Install] +WantedBy=multi-user.target +EOF + cat > /etc/systemd/system/mcsm-daemon.service << EOF +[Unit] +Description=MCSManager Daemon Service +After=network.target + +[Service] +User=root +WorkingDirectory=$daemonPath +ExecStart=$daemonExecStart +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment=\"PATH=${PATH}\" +Restart=always + +[Install] +WantedBy=multi-user.target +EOF + # Enable systemd service + LEcho cyan "[*] 正在启动 MCSManager 服务" "[*] Starting MCSManager services" + systemctl daemon-reload + if [ $mode == "update" ];then + systemctl restart mcsm-web || LEcho error "[x] 无法启动 MCSManager 前端管理面板服务" "[x] Unable to start MCSManager web panel service" + systemctl restart mcsm-daemon || LEcho error "[x] 无法启动 MCSManager 守护程序服务" "[x] Unable to start MCSManager daemon service" + else + systemctl enable mcsm-web --now || LEcho error "[x] 无法启动 MCSManager 前端管理面板服务" "[x] Unable to start MCSManager web panel service" + systemctl enable mcsm-daemon --now || LEcho error "[x] 无法启动 MCSManager 守护程序服务" "[x] Unable to start MCSManager daemon service" + fi + + # Output login info + LEcho green "[√] MCSManager 安装完毕" "[√] MCSManager installation completed" + sleep 3 + clear + LEcho yellow "==================================================================" "==================================================================" + LEcho green "欢迎使用 MCSManager, 您可以通过以下方式访问: " "Welcome to MCSManager, you can access it through the following ways:" + LEcho yellow "==================================================================" "==================================================================" + LEcho cyan_n "控制面板默认访问地址: " "Control panel default address: " + LEcho yellow "http://localhost:23333" "http://localhost:23333" + LEcho red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" "If you can't access the panel, please check if the firewall/security group has opened the panel 23333 and 24444 ports. The control panel needs these two ports to work properly." + LEcho yellow "==================================================================" "==================================================================" + LEcho cyan "启动 MCSM: systemctl start mcsm-{daemon,web}.service" "Start MCSM: systemctl start mcsm-{daemon,web}.service" + LEcho cyan "重启 MCSM: systemctl restart mcsm-{daemon,web}.service" "Restart MCSM: systemctl restart mcsm-{daemon,web}.service" + LEcho cyan "停止 MCSM: systemctl stop mcsm-{daemon,web}.service" "Stop MCSM: systemctl stop mcsm-{daemon,web}.service" + LEcho cyan "启用自启动: systemctl enable mcsm-{daemon,web}.service" "Enable: systemctl enable mcsm-{daemon,web}.service" + LEcho cyan "禁用自启动: systemctl disable mcsm-{daemon,web}.service" "Disable: systemctl disable mcsm-{daemon,web}.service" + LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More usage instructions, please refer to: https://docs.mcsmanager.com/" + LEcho yellow "==================================================================" "==================================================================" + + # Clean up + rm -rf $tmpDir + return +} + +## Clean up +Clean() { + LEcho cyan "[*] 正在清理残余文件" "[*] Cleaning up" + rm -rf $tmpDir + [ $mode != "update" ] && rm -rf $mcsmPath + return +} + +### Start + +LEcho cyan "[-] 正在检查基础环境, 请稍等" "[-] Checking basic environment, please wait" +CheckRoot +CheckArch +CheckOS +CheckCN +Install +LEcho cyan "[-] 期待与您的下次见面" "[-] Looking forward to seeing you again" \ No newline at end of file From 4756cb728b9e7192fc52fa6032be85b8c6cccda1 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Sat, 18 Mar 2023 12:48:25 +0800 Subject: [PATCH 043/463] Restore the original script --- setup.sh | 650 +++++++++++++++++++++++++-------------------------- setup_en.sh | 263 +++++++++++++++++++++ setup_old.sh | 371 ----------------------------- 3 files changed, 586 insertions(+), 698 deletions(-) create mode 100644 setup_en.sh delete mode 100644 setup_old.sh diff --git a/setup.sh b/setup.sh index cbb85da..dfd530e 100644 --- a/setup.sh +++ b/setup.sh @@ -1,375 +1,371 @@ -#!/usr/bin/env bash +#!/bin/bash +printf "\033c" -#### MCSManager Installer -#### Made by BlueFunny -#### Originally written by nuomiaa, CreeperKong, unitwk +error="" +node="v14.19.1" +arch=$(uname -m) +mcsmanager_install_path="/opt/mcsmanager" +zh=$( + [[ $(locale -a) =~ "zh" ]] && echo 1 + export LANG=zh_CN.UTF-8 || echo 0 +) -#### Copyright © 2023 MCSManager All rights reserved. +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} -### Variables -## Files -# MCSManager -mcsmPath="/opt/mcsmanager" -daemonPath="$mcsmPath/daemon" -webPath="$mcsmPath/web" +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} -# Node.js -nodePath="$mcsmPath/node" -nodeBin="$nodePath/bin/node" -npmBin="$nodeBin $nodePath/bin/npm" +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} -# Junk -tmpDir="/tmp/mcsmanager" +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} -## Node info -nodeVer="v16.13.0" +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} -## Install mode -mode="install" +Install_Node() { + if [ "$zh" == 1 ]; then + echo_cyan_n "[+] 安装 Node 环境... " + else + echo_cyan_n "[+] Install Node environment... " + fi -## URLs -# Node.js -nodeBaseURL="https://nodejs.org/dist" + rm -irf "$node_install_path" -# MCSManager -daemonURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" -webURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" + cd /opt || exit -## Language -if [ "$(echo "$LANG" | grep "zh_CN")" != "" ]; then - zh=1 -else - zh=0 -fi + wget -o /dev/null https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz -## Debug -debug=0 - -## Other -cn=0 - -### Functions -## Localize echo -# $1: color -# $2: zh -# $3: en -LEcho() { - case $1 in - # Red color echo - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - - # Green color echo - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - - # Cyan color echo - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - - # Cyan color echo (No line break) - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - - # Yellow color echo - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - - # Red error echo - error) - Clean - echo '=================================================' - [ "$zh" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "$zh" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - - # Debug echo - debug) - [ "$debug" == 1 ] && printf '\033[1;35m%b\033[0m\n' "[DEBUG] $2" - ;; - - # No color echo - *) - [ "$zh" == 1 ] && echo "$2" - [ "$zh" == 0 ] && echo "$3" - ;; - esac - return -} + tar -zxf node-"$node"-linux-"$arch".tar.gz -## Check root -CheckRoot() { - if [[ $EUID -ne 0 ]]; then - LEcho error "[!] 请使用 root 用户运行此脚本" "[!] Please run this script as root" + rm -rf node-"$node"-linux-"$arch".tar.gz + + if [ ! -L /usr/bin/node ] && [ ! -f /usr/bin/node ]; then + ln -s "$node_install_path"/bin/node /usr/bin/node + fi + if [ ! -L /usr/bin/npm ] && [ ! -f /usr/bin/npm ]; then + ln -s "$node_install_path"/bin/npm /usr/bin/npm fi - return -} -## Detect server geographic location -CheckCN() { - LEcho cyan "[*] 正在检查服务器地理位置" "[*] Checking server location" - server_ip=$(curl -s ifconfig.me) - if [[ "$(curl -s "http://ip-api.com/json/${server_ip}?fields=countryCode" | jq -r '.countryCode')" == "CN" ]]; then - LEcho yellow "[!] 根据 'ip-api.com' 提供的信息, 当前服务器可能在中国, 已自动切换为中国镜像源" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China, and the Chinese mirror source has been automatically switched" - daemonURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" - webURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" - nodeBaseURL="https://npmmirror.com/mirrors/node" - cn=1 + chmod +x "$node_install_path"/bin/node + chmod +x "$node_install_path"/bin/npm + + if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ]; then + if [ "$zh" == 1 ]; then + echo_green "成功" + else + echo_green "Success" + fi + else + if [ "$zh" == 1 ]; then + echo_red "失败" + Red_Error "[x] Node 安装失败!" + else + echo_red "Failed" + Red_Error "[x] Node installation failed!" + fi fi - return -} -## Detect system architecture -CheckArch() { - LEcho cyan "[*] 正在检查系统架构" "[*] Checking system architecture" - arch=$(uname -m) - case $arch in - x86_64) - arch="x64" - ;; - aarch64) - arch="arm64" - ;; - arm) - arch="armv7l" - ;; - ppc64le) - arch="ppc64le" - ;; - s390x) - arch="s390x" - ;; - *) - LEcho error "[x] MCSManager 暂不支持当前系统架构" "[x] MCSManager does not currently support the current system architecture" - ;; - esac - return + echo + echo_yellow "=============== Node Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node Version ===============" + echo + + sleep 3 } -## Detect system version -CheckOS() { - LEcho cyan "[*] 正在检查系统版本" "[*] Checking system version" - if [ -f /etc/os-release ]; then - # shellcheck source=/dev/null - . /etc/os-release - case "$ID" in - debian|ubuntu) - os="debian" - ;; - centos|rhel|fedora) - os="redhat" - ;; - *) - LEcho error "[x] 本脚本仅支持 Ubuntu/Debian/CentOS 系统!" "[x] This script only supports Ubuntu/Debian/CentOS systems!" - ;; - esac +Install_MCSManager() { + if [ "$zh" == 1 ]; then + echo_cyan "[+] 安装 MCSManager..." + else + echo_cyan "[+] Install MCSManager..." + fi + + # 删除服务 + rm -f /etc/systemd/system/mcsm-daemon.service + rm -f /etc/systemd/system/mcsm-web.service + + # 重载 + systemctl daemon-reload + + # echo "[x] Delete the original MCSManager" + rm -irf ${mcsmanager_install_path} + + # echo "[+] mkdir -p ${mcsmanager_install_path}" + mkdir -p ${mcsmanager_install_path} || exit + + # echo "[→] cd ${mcsmanager_install_path}" + cd ${mcsmanager_install_path} || exit + + if [ "$zh" == 1 ]; then + echo_cyan "[↓] Git 克隆 MCSManager-Daemon..." else - LEcho error "[x] 未能正常检测到系统类型, 无法继续安装" "[x] Unable to detect system type, installation cannot continue" + echo_cyan "[↓] Git clone MCSManager-Daemon..." fi + git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git daemon + + # echo "[→] cd daemon" + cd daemon || exit - # Install dependencies - LEcho cyan "[*] 正在安装安装所需的工具" "[*] Installing the tools required for installation" - if [ "$os" == "debian" ]; then - apt-get update - apt-get install -y curl git wget jq - elif [ "$os" == "redhat" ]; then - yum install -y epel-release - yum install -y curl git wget jq + if [ "$zh" == 1 ]; then + echo_cyan "[+] 安装 MCSManager-Daemon 依赖库..." + else + echo_cyan "[+] Install MCSManager-Daemon dependencies..." fi - return -} + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com >error -## Detect nodejs version -CheckNode() { - if command -v node > /dev/null; then - if [ "$(node -v | cut -c2- | awk -F. '{print $1}')" -ge 14 ]; then - return 0 - fi + # echo "[←] cd .." + cd .. + + if [ "$zh" == 1 ]; then + echo_cyan "[↓] Git 克隆 MCSManager-Web..." + else + echo_cyan "[↓] Git clone MCSManager-Web..." fi - return 1 -} + git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Web-Production.git web -## Install MCSManager -Install() { - clear - LEcho cyan "[-] 开始安装 MCSManager" "[-] Start installing MCSManager" - # Init work environment - LEcho cyan "[*] 正在初始化工作环境" "[*] Initializing work environment" - mkdir -p $tmpDir - - # Detect old MCSManager - [ -d $mcsmPath ] && LEcho yellow "[!] 检测到旧版 MCSManager, 切换为更新模式" "[!] Old version of MCSManager detected, switch to update mode" - [ -d $mcsmPath ] && mode="update" - mkdir -p $mcsmPath - - # Install nodejs - if ! CheckNode;then - LEcho cyan "[*] 正在安装 Node.js" "[*] Installing Node.js" - # Download nodejs files - nodeFileURL="$nodeBaseURL/$nodeVer/node-$nodeVer-linux-$arch.tar.gz" - nodeHashURL="$nodeBaseURL/$nodeVer/SHASUMS256.txt" - wget -q --no-check-certificate -O $tmpDir/node.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" - wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" - - # Check nodejs files - if [ "$(sha256sum $tmpDir/node.tar.gz | cut -d ' ' -f 1)" != "$(grep "node-$nodeVer-linux-$arch.tar.gz" $tmpDir/node.sha256 | cut -d ' ' -f 1)" ]; then - LEcho error "[x] Node.js 安装包校验失败, 请重试" "[x] Node.js installation package verification failed, please try again" - fi - - # Install nodejs - [ -d $nodePath ] && rm -rf $nodePath - mkdir -p $nodePath - tar -xzf "$tmpDir/node.tar.gz" -C $nodePath --strip-components=1 - - if ! command -v $nodeBin ; then - LEcho error "[x] Node.js 安装失败, 请重试" "[x] Node.js installation failed, please try again" - fi + # echo "[→] cd web" + cd web || exit + + if [ "$zh" == 1 ]; then + echo_cyan "[+] 安装 MCSManager-Web 依赖库..." else - LEcho cyan "[-] 检测到已安装 Node.js, 跳过安装" "[-] Detected installed Node.js, skip installation" - nodeBin="$(which node)" - npmBin="$(which npm)" + echo_cyan "[+] Install MCSManager-Web dependencies..." fi - - LEcho yellow "===============================================" "===============================================" - LEcho cyan "Node.js 版本: $($nodeBin --version)" "Node.js version: $($nodeBin --version)" - LEcho cyan "NPM 版本: $($npmBin -v)" "NPM version: $($npmBin -v)" - LEcho yellow "===============================================" "===============================================" - - # Install MCSManager - if [ $mode == "update" ];then - LEcho cyan "[*] 正在更新 MCSManager 前端管理面板" "[*] Updating MCSManager web panel" - - cd $webPath || LEcho error "[x] 无法进入 MCSManager 前端管理面板目录, 请检查权限" "[x] Unable to enter MCSManager web panel directory, please check permissions" - - # Clone MCSManager web panel - git remote set-url origin $webURL - git fetch origin - git checkout master - git reset --hard origin/master - git pull - - LEcho cyan "[*] 正在更新 MCSManager 守护晨曦股" "[*] Updating MCSManager daemon" - - cd $daemonPath || LEcho error "[x] 无法进入 MCSManager 守护程序目录, 请检查权限" "[x] Unable to enter MCSManager daemon directory, please check permissions" - - # Clone MCSManager daemon - git remote set-url origin $daemonURL - git fetch origin - git checkout master - git reset --hard origin/master - git pull + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com >error + + echo + echo_yellow "=============== MCSManager ===============" + echo_green " Daemon: ${mcsmanager_install_path}/daemon" + echo_green " Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + if [ "$zh" == 1 ]; then + echo_green "[+] MCSManager 安装成功!" + else + echo_green "[+] MCSManager installation success!" + fi + + sleep 3 +} + +Create_Service() { + if [ "$zh" == 1 ]; then + echo_cyan "[+] 创建 MCSManager 服务..." else - # Clone MCSManager web panel - LEcho cyan "[*] 正在安装 MCSManager 前端管理面板" "[*] Installing MCSManager web panel" - git clone --single-branch -b master --depth 1 $webURL $webPath - - # Clone MCSManager daemon - LEcho cyan "[*] 正在安装 MCSManager 守护程序" "[*] Installing MCSManager web panel" - git clone --single-branch -b master --depth 1 $daemonURL $daemonPath + echo_cyan "[+] Create MCSManager service..." fi - # Update dependencies - LEcho cyan "[*] 正在更新依赖" "[*] Updating dependencies" - cd $webPath || LEcho error "[x] 无法进入 MCSManager 前端管理目录, 请检查权限" "[x] Unable to enter MCSManager web panel directory, please check permissions" - [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com - [ $cn == 0 ] && $npmBin install - cd $daemonPath || LEcho error "[x] 无法进入 MCSManager 守护程序目录, 请检查权限" "[x] Unable to enter MCSManager daemon directory, please check permissions" - [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com - [ $cn == 0 ] && $npmBin install - - # Create systemd service - LEcho cyan "[*] 正在创建 systemd 服务" "[*] Creating systemd service" - - webExecStart="\"$nodeBin\" \"$webPath/app.js\"" - daemonExecStart="\"$nodeBin\" \"$daemonPath/app.js\"" - cat > /etc/systemd/system/mcsm-web.service << EOF + + echo " [Unit] -Description=MCSManager Web Panel Service -After=network.target +Description=MCSManager Daemon [Service] -User=root -WorkingDirectory=$webPath -ExecStart=$webExecStart -Restart=always +WorkingDirectory=/opt/mcsmanager/daemon +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -EOF - cat > /etc/systemd/system/mcsm-daemon.service << EOF +" >/etc/systemd/system/mcsm-daemon.service + + echo " [Unit] -Description=MCSManager Daemon Service -After=network.target +Description=MCSManager Web [Service] -User=root -WorkingDirectory=$daemonPath -ExecStart=$daemonExecStart -Restart=always +WorkingDirectory=/opt/mcsmanager/web +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -EOF - # Enable systemd service - LEcho cyan "[*] 正在启动 MCSManager 服务" "[*] Starting MCSManager services" +" >/etc/systemd/system/mcsm-web.service + + # 重载 systemctl daemon-reload - if [ $mode == "update" ];then - systemctl restart mcsm-web || LEcho error "[x] 无法启动 MCSManager 前端管理面板服务" "[x] Unable to start MCSManager web panel service" - systemctl restart mcsm-daemon || LEcho error "[x] 无法启动 MCSManager 守护程序服务" "[x] Unable to start MCSManager daemon service" + + # 创建 Daemon 服务 + systemctl enable mcsm-daemon.service --now + + # 创建 Web 服务 + systemctl enable mcsm-web.service --now + + sleep 3 + + printf "\033c" + echo_yellow "==================================================================" + if [ "$zh" == 1 ]; then + echo_green "欢迎使用 MCSManager,您可以通过以下方式访问:" + echo_yellow "==================================================================" + echo_cyan_n "控制面板地址: " + echo_yellow "http://localhost:23333" + echo_red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" + echo_yellow "==================================================================" + echo_cyan "重启 systemctl restart mcsm-{daemon,web}.service" + echo_cyan "禁用 systemctl disable mcsm-{daemon,web}.service" + echo_cyan "启用 systemctl enable mcsm-{daemon,web}.service" + echo_cyan "启动 systemctl start mcsm-{daemon,web}.service" + echo_cyan "停止 systemctl stop mcsm-{daemon,web}.service" + echo_cyan "更多使用说明,请参考:https://docs.mcsmanager.com/" else - systemctl enable mcsm-web --now || LEcho error "[x] 无法启动 MCSManager 前端管理面板服务" "[x] Unable to start MCSManager web panel service" - systemctl enable mcsm-daemon --now || LEcho error "[x] 无法启动 MCSManager 守护程序服务" "[x] Unable to start MCSManager daemon service" + echo_green "Welcome to MCSManager, you can access it by the following ways:" + echo_yellow "==================================================================" + echo_cyan_n "Web Service Address: " + echo_yellow "http://localhost:23333" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow "==================================================================" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_cyan "systemctl disable mcsm-{daemon,web}.service" + echo_cyan "systemctl enable mcsm-{daemon,web}.service" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "More info: https://docs.mcsmanager.com/" fi - - # Output login info - LEcho green "[√] MCSManager 安装完毕" "[√] MCSManager installation completed" - sleep 3 - clear - LEcho yellow "==================================================================" "==================================================================" - LEcho green "欢迎使用 MCSManager, 您可以通过以下方式访问: " "Welcome to MCSManager, you can access it through the following ways:" - LEcho yellow "==================================================================" "==================================================================" - LEcho cyan_n "控制面板默认访问地址: " "Control panel default address: " - LEcho yellow "http://localhost:23333" "http://localhost:23333" - LEcho red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" "If you can't access the panel, please check if the firewall/security group has opened the panel 23333 and 24444 ports. The control panel needs these two ports to work properly." - LEcho yellow "==================================================================" "==================================================================" - LEcho cyan "启动 MCSM: systemctl start mcsm-{daemon,web}.service" "Start MCSM: systemctl start mcsm-{daemon,web}.service" - LEcho cyan "重启 MCSM: systemctl restart mcsm-{daemon,web}.service" "Restart MCSM: systemctl restart mcsm-{daemon,web}.service" - LEcho cyan "停止 MCSM: systemctl stop mcsm-{daemon,web}.service" "Stop MCSM: systemctl stop mcsm-{daemon,web}.service" - LEcho cyan "启用自启动: systemctl enable mcsm-{daemon,web}.service" "Enable: systemctl enable mcsm-{daemon,web}.service" - LEcho cyan "禁用自启动: systemctl disable mcsm-{daemon,web}.service" "Disable: systemctl disable mcsm-{daemon,web}.service" - LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More usage instructions, please refer to: https://docs.mcsmanager.com/" - LEcho yellow "==================================================================" "==================================================================" - - # Clean up - rm -rf $tmpDir - return -} + echo_yellow "==================================================================" -## Clean up -Clean() { - LEcho cyan "[*] 正在清理残余文件" "[*] Cleaning up" - rm -rf $tmpDir - [ $mode != "update" ] && rm -rf $mcsmPath - return } -### Start +# ----------------- 程序启动 ----------------- + +# 删除 Shell 脚本自身 +rm -f "$0" + +# 检查执行用户权限 +if [ "$(whoami)" != "root" ]; then + if [ "$zh" == 1 ]; then + Red_Error "[x] 请使用 root 权限执行 MCSManager 安装命令!" + else + Red_Error "[x] Please execute the MCSManager installation command with root permission!" + fi +fi + +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +| Copyright © 2022 MCSManager All rights reserved. ++---------------------------------------------------------------------- +| Shell Install Script by Nuomiaa & CreeperKong ++---------------------------------------------------------------------- +" + +# 环境检查 +if [ "$arch" == x86_64 ]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [ $arch == aarch64 ]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [ $arch == arm ]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [ $arch == ppc64le ]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [ $arch == s390x ]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + if [ "$zh" == 1 ]; then + Red_Error "[x] 抱歉,暂不支持您的 体系架构($arch)!" + else + Red_Error "[x] Sorry, this architecture is not supported yet!" + fi + exit +fi + +# 定义变量 Node 安装目录 +node_install_path="/opt/node-$node-linux-$arch" + +# 检查网络连接 +if [ "$zh" == 1 ]; then + echo_cyan "[-] 体系架构:$arch" +else + echo_cyan "[-] Architecture: $arch" +fi + +# MCSManager 已安装 +if [ -d "$mcsmanager_install_path" ]; then + printf "\033c" + if [ "$zh" == 1 ]; then + echo_red "---------------------------------------------------- +检查到已有 MCSManager 安装在 \"$mcsmanager_install_path\" +继续安装会删除原有 MCSManager 面版的所有数据! +---------------------------------------------------- +将在 10 秒后继续安装,取消请按 Ctrl + Z/C 键!" + else + echo_red "---------------------------------------------------- +MCSManager is installed at \"$mcsmanager_install_path\" +Continuing the installation will delete the original MCSManager! +---------------------------------------------------- +Installation will continue in 10 seconds, press Ctrl + Z/C to cancel!" + fi + sleep 10 +fi + +# 安装相关软件 +if [ "$zh" == 1 ]; then + echo_cyan_n "[-] 安装相关软件(git,tar)... " +else + echo_cyan_n "[+] Installing dependent software(git,tar)... " +fi +if [ -x "$(command -v yum)" ]; then + yum install -y git tar >error +elif [ -x "$(command -v apt-get)" ]; then + apt-get install -y git tar >error +elif [ -x "$(command -v pacman)" ]; then + pacman -Syu --noconfirm git tar >error +elif [ -x "$(command -v zypper)" ]; then + zypper --non-interactive install git tar >error +fi + +# 判断相关软件是否安装成功 +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then + if [ "$zh" == 1 ]; then + echo_green "成功" + else + echo_green "Success" + fi +else + if [ "$zh" == 1 ]; then + echo_red "失败" + else + echo_red "Failed" + fi + echo "$error" + if [ "$zh" == 1 ]; then + Red_Error "[x] 相关软件安装失败,请手动安装 git 和 tar 软件包!" + else + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" + fi + exit +fi + +# 安装 Node 环境 +Install_Node + +# 安装 MCSManager +Install_MCSManager -LEcho cyan "[-] 正在检查基础环境, 请稍等" "[-] Checking basic environment, please wait" -CheckRoot -CheckArch -CheckOS -CheckCN -Install -LEcho cyan "[-] 期待与您的下次见面" "[-] Looking forward to seeing you again" \ No newline at end of file +# 创建 MCSManager 后台服务 +Create_Service diff --git a/setup_en.sh b/setup_en.sh new file mode 100644 index 0000000..90f389e --- /dev/null +++ b/setup_en.sh @@ -0,0 +1,263 @@ +#!/bin/bash +printf "\033c" + +error="" +node="v14.19.1" +arch=$(uname -m) +mcsmanager_install_path="/opt/mcsmanager" + +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} + +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} + +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} + +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} + +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +Install_Node() { + echo_cyan_n "[+] Install Node environment... " + + rm -irf "$node_install_path" + + cd /opt || exit + + wget -o /dev/null https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz + + tar -zxf node-"$node"-linux-"$arch".tar.gz + + rm -rf node-"$node"-linux-"$arch".tar.gz + + if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] + then + echo_green "Success" + else + echo_red "Failed" + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node Version ===============" + echo + + sleep 3 +} + +Install_MCSManager() { + echo_cyan "[+] Install MCSManager..." + + # delete service + rm -f /etc/systemd/system/mcsm-daemon.service + rm -f /etc/systemd/system/mcsm-web.service + + # reload + systemctl daemon-reload + + # echo "[x] Delete the original MCSManager" + rm -irf ${mcsmanager_install_path} + + # echo "[+] mkdir -p ${mcsmanager_install_path}" + mkdir -p ${mcsmanager_install_path} || exit + + # echo "[→] cd ${mcsmanager_install_path}" + cd ${mcsmanager_install_path} || exit + + echo_cyan "[↓] Git clone MCSManager-Daemon..." + git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Daemon-Production.git daemon + + # echo "[→] cd daemon" + cd daemon || exit + + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com > error + + # echo "[←] cd .." + cd .. + + echo_cyan "[↓] Git clone MCSManager-Web..." + git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Web-Production.git web + + # echo "[→] cd web" + cd web || exit + + echo_cyan "[+] Install MCSManager-Web dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com > error + + echo + echo_yellow "=============== MCSManager ===============" + echo_green " Daemon: ${mcsmanager_install_path}/daemon" + echo_green " Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" + + sleep 3 +} + +Create_Service() { + echo_cyan "[+] Create MCSManager service..." + + echo " +[Unit] +Description=MCSManager Daemon + +[Service] +WorkingDirectory=/opt/mcsmanager/daemon +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +[Install] +WantedBy=multi-user.target +" > /etc/systemd/system/mcsm-daemon.service + + echo " +[Unit] +Description=MCSManager Web + +[Service] +WorkingDirectory=/opt/mcsmanager/web +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +[Install] +WantedBy=multi-user.target +" > /etc/systemd/system/mcsm-web.service + + systemctl daemon-reload + systemctl enable mcsm-daemon.service --now + systemctl enable mcsm-web.service --now + + sleep 3 + + printf "\033c" + echo_yellow "==================================================================" + echo_green "Welcome to MCSManager, you can access it by the following ways:" + echo_yellow "==================================================================" + echo_cyan_n "Daemon Service Address: "; echo_yellow "http://localhost:24444" + echo_cyan_n "Web Service Address: "; echo_yellow "http://localhost:23333" + echo_cyan_n "Username: "; echo_yellow "root" + echo_cyan_n "Password: "; echo_yellow "123456" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow "==================================================================" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_cyan "systemctl disable mcsm-{daemon,web}.service" + echo_cyan "systemctl enable mcsm-{daemon,web}.service" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "More info: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" + + +} + + +# ----------------- Program Start ----------------- + +# delete the shell script itself +rm -f "$0" + +# Check execute user permissions +if [ "$(whoami)" != "root" ]; then + Red_Error "[x] Please execute the MCSManager installation command with root permission!" +fi + +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +| Copyright © 2022 MCSManager All rights reserved. ++---------------------------------------------------------------------- +| Shell Install Script by Nuomiaa & CreeperKong ++---------------------------------------------------------------------- +" + +# Environmental inspection +if [ "$arch" == x86_64 ]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [ $arch == aarch64 ]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [ $arch == arm ]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [ $arch == ppc64le ]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [ $arch == s390x ]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + Red_Error "[x] Sorry, this architecture is not supported yet!" + exit +fi + +# Define the variable Node installation directory +node_install_path="/opt/node-$node-linux-$arch" + +# Check network connection +echo_cyan "[-] Architecture: $arch" + +# MCSManager Installed +if [ -d "$mcsmanager_install_path" ]; then + printf "\033c" + echo_red "---------------------------------------------------- +MCSManager is installed at \"$mcsmanager_install_path\" +Continuing the installation will delete the original MCSManager! +---------------------------------------------------- +Installation will continue in 10 seconds, press Ctrl + Z/C to cancel!" + sleep 10 +fi + +# Install related software +echo_cyan_n "[+] Installing dependent software(git,tar)... " +if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; +elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; +elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; +elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; +fi + +# Determine whether the relevant software is installed successfully +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] + then + echo_green "Success" + else + echo_red "Failed" + echo "$error" + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" + exit +fi + + +# Install the Node environment +Install_Node + +# Install MCSManager +Install_MCSManager + +# Create MCSManager background service +Create_Service diff --git a/setup_old.sh b/setup_old.sh deleted file mode 100644 index dfd530e..0000000 --- a/setup_old.sh +++ /dev/null @@ -1,371 +0,0 @@ -#!/bin/bash -printf "\033c" - -error="" -node="v14.19.1" -arch=$(uname -m) -mcsmanager_install_path="/opt/mcsmanager" -zh=$( - [[ $(locale -a) =~ "zh" ]] && echo 1 - export LANG=zh_CN.UTF-8 || echo 0 -) - -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 -} - -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} - -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} - -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} - -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" -} - -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} - -Install_Node() { - if [ "$zh" == 1 ]; then - echo_cyan_n "[+] 安装 Node 环境... " - else - echo_cyan_n "[+] Install Node environment... " - fi - - rm -irf "$node_install_path" - - cd /opt || exit - - wget -o /dev/null https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz - - tar -zxf node-"$node"-linux-"$arch".tar.gz - - rm -rf node-"$node"-linux-"$arch".tar.gz - - if [ ! -L /usr/bin/node ] && [ ! -f /usr/bin/node ]; then - ln -s "$node_install_path"/bin/node /usr/bin/node - fi - if [ ! -L /usr/bin/npm ] && [ ! -f /usr/bin/npm ]; then - ln -s "$node_install_path"/bin/npm /usr/bin/npm - fi - - chmod +x "$node_install_path"/bin/node - chmod +x "$node_install_path"/bin/npm - - if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ]; then - if [ "$zh" == 1 ]; then - echo_green "成功" - else - echo_green "Success" - fi - else - if [ "$zh" == 1 ]; then - echo_red "失败" - Red_Error "[x] Node 安装失败!" - else - echo_red "Failed" - Red_Error "[x] Node installation failed!" - fi - fi - - echo - echo_yellow "=============== Node Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node Version ===============" - echo - - sleep 3 -} - -Install_MCSManager() { - if [ "$zh" == 1 ]; then - echo_cyan "[+] 安装 MCSManager..." - else - echo_cyan "[+] Install MCSManager..." - fi - - # 删除服务 - rm -f /etc/systemd/system/mcsm-daemon.service - rm -f /etc/systemd/system/mcsm-web.service - - # 重载 - systemctl daemon-reload - - # echo "[x] Delete the original MCSManager" - rm -irf ${mcsmanager_install_path} - - # echo "[+] mkdir -p ${mcsmanager_install_path}" - mkdir -p ${mcsmanager_install_path} || exit - - # echo "[→] cd ${mcsmanager_install_path}" - cd ${mcsmanager_install_path} || exit - - if [ "$zh" == 1 ]; then - echo_cyan "[↓] Git 克隆 MCSManager-Daemon..." - else - echo_cyan "[↓] Git clone MCSManager-Daemon..." - fi - git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git daemon - - # echo "[→] cd daemon" - cd daemon || exit - - if [ "$zh" == 1 ]; then - echo_cyan "[+] 安装 MCSManager-Daemon 依赖库..." - else - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - fi - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com >error - - # echo "[←] cd .." - cd .. - - if [ "$zh" == 1 ]; then - echo_cyan "[↓] Git 克隆 MCSManager-Web..." - else - echo_cyan "[↓] Git clone MCSManager-Web..." - fi - git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Web-Production.git web - - # echo "[→] cd web" - cd web || exit - - if [ "$zh" == 1 ]; then - echo_cyan "[+] 安装 MCSManager-Web 依赖库..." - else - echo_cyan "[+] Install MCSManager-Web dependencies..." - fi - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com >error - - echo - echo_yellow "=============== MCSManager ===============" - echo_green " Daemon: ${mcsmanager_install_path}/daemon" - echo_green " Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - if [ "$zh" == 1 ]; then - echo_green "[+] MCSManager 安装成功!" - else - echo_green "[+] MCSManager installation success!" - fi - - sleep 3 -} - -Create_Service() { - if [ "$zh" == 1 ]; then - echo_cyan "[+] 创建 MCSManager 服务..." - else - echo_cyan "[+] Create MCSManager service..." - fi - - echo " -[Unit] -Description=MCSManager Daemon - -[Service] -WorkingDirectory=/opt/mcsmanager/daemon -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service - - echo " -[Unit] -Description=MCSManager Web - -[Service] -WorkingDirectory=/opt/mcsmanager/web -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-web.service - - # 重载 - systemctl daemon-reload - - # 创建 Daemon 服务 - systemctl enable mcsm-daemon.service --now - - # 创建 Web 服务 - systemctl enable mcsm-web.service --now - - sleep 3 - - printf "\033c" - echo_yellow "==================================================================" - if [ "$zh" == 1 ]; then - echo_green "欢迎使用 MCSManager,您可以通过以下方式访问:" - echo_yellow "==================================================================" - echo_cyan_n "控制面板地址: " - echo_yellow "http://localhost:23333" - echo_red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" - echo_yellow "==================================================================" - echo_cyan "重启 systemctl restart mcsm-{daemon,web}.service" - echo_cyan "禁用 systemctl disable mcsm-{daemon,web}.service" - echo_cyan "启用 systemctl enable mcsm-{daemon,web}.service" - echo_cyan "启动 systemctl start mcsm-{daemon,web}.service" - echo_cyan "停止 systemctl stop mcsm-{daemon,web}.service" - echo_cyan "更多使用说明,请参考:https://docs.mcsmanager.com/" - else - echo_green "Welcome to MCSManager, you can access it by the following ways:" - echo_yellow "==================================================================" - echo_cyan_n "Web Service Address: " - echo_yellow "http://localhost:23333" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow "==================================================================" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_cyan "systemctl disable mcsm-{daemon,web}.service" - echo_cyan "systemctl enable mcsm-{daemon,web}.service" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "More info: https://docs.mcsmanager.com/" - fi - echo_yellow "==================================================================" - -} - -# ----------------- 程序启动 ----------------- - -# 删除 Shell 脚本自身 -rm -f "$0" - -# 检查执行用户权限 -if [ "$(whoami)" != "root" ]; then - if [ "$zh" == 1 ]; then - Red_Error "[x] 请使用 root 权限执行 MCSManager 安装命令!" - else - Red_Error "[x] Please execute the MCSManager installation command with root permission!" - fi -fi - -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2022 MCSManager All rights reserved. -+---------------------------------------------------------------------- -| Shell Install Script by Nuomiaa & CreeperKong -+---------------------------------------------------------------------- -" - -# 环境检查 -if [ "$arch" == x86_64 ]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [ $arch == aarch64 ]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [ $arch == arm ]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [ $arch == ppc64le ]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [ $arch == s390x ]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - if [ "$zh" == 1 ]; then - Red_Error "[x] 抱歉,暂不支持您的 体系架构($arch)!" - else - Red_Error "[x] Sorry, this architecture is not supported yet!" - fi - exit -fi - -# 定义变量 Node 安装目录 -node_install_path="/opt/node-$node-linux-$arch" - -# 检查网络连接 -if [ "$zh" == 1 ]; then - echo_cyan "[-] 体系架构:$arch" -else - echo_cyan "[-] Architecture: $arch" -fi - -# MCSManager 已安装 -if [ -d "$mcsmanager_install_path" ]; then - printf "\033c" - if [ "$zh" == 1 ]; then - echo_red "---------------------------------------------------- -检查到已有 MCSManager 安装在 \"$mcsmanager_install_path\" -继续安装会删除原有 MCSManager 面版的所有数据! ----------------------------------------------------- -将在 10 秒后继续安装,取消请按 Ctrl + Z/C 键!" - else - echo_red "---------------------------------------------------- -MCSManager is installed at \"$mcsmanager_install_path\" -Continuing the installation will delete the original MCSManager! ----------------------------------------------------- -Installation will continue in 10 seconds, press Ctrl + Z/C to cancel!" - fi - sleep 10 -fi - -# 安装相关软件 -if [ "$zh" == 1 ]; then - echo_cyan_n "[-] 安装相关软件(git,tar)... " -else - echo_cyan_n "[+] Installing dependent software(git,tar)... " -fi -if [ -x "$(command -v yum)" ]; then - yum install -y git tar >error -elif [ -x "$(command -v apt-get)" ]; then - apt-get install -y git tar >error -elif [ -x "$(command -v pacman)" ]; then - pacman -Syu --noconfirm git tar >error -elif [ -x "$(command -v zypper)" ]; then - zypper --non-interactive install git tar >error -fi - -# 判断相关软件是否安装成功 -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then - if [ "$zh" == 1 ]; then - echo_green "成功" - else - echo_green "Success" - fi -else - if [ "$zh" == 1 ]; then - echo_red "失败" - else - echo_red "Failed" - fi - echo "$error" - if [ "$zh" == 1 ]; then - Red_Error "[x] 相关软件安装失败,请手动安装 git 和 tar 软件包!" - else - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - fi - exit -fi - -# 安装 Node 环境 -Install_Node - -# 安装 MCSManager -Install_MCSManager - -# 创建 MCSManager 后台服务 -Create_Service From 6b505c9378a587f14c75d5de72e538293f151c9c Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Tue, 21 Mar 2023 22:27:12 +0800 Subject: [PATCH 044/463] Add Docker installation method --- README.md | 8 +++- README_cn.md | 10 ++++- docker/README.md | 76 +++++++++++++++++++++++++++++++++ docker/README_cn.md | 77 ++++++++++++++++++++++++++++++++++ docker/examples/cn/daemon.yaml | 15 +++++++ docker/examples/cn/full.yaml | 28 +++++++++++++ docker/examples/cn/web.yaml | 15 +++++++ docker/examples/en/daemon.yaml | 15 +++++++ docker/examples/en/full.yaml | 28 +++++++++++++ docker/examples/en/web.yaml | 15 +++++++ 10 files changed, 284 insertions(+), 3 deletions(-) create mode 100644 docker/README.md create mode 100644 docker/README_cn.md create mode 100644 docker/examples/cn/daemon.yaml create mode 100644 docker/examples/cn/full.yaml create mode 100644 docker/examples/cn/web.yaml create mode 100644 docker/examples/en/daemon.yaml create mode 100644 docker/examples/en/full.yaml create mode 100644 docker/examples/en/web.yaml diff --git a/README.md b/README.md index 3d08d19..4b77c7f 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,16 @@ The default installation script on the official website is the `setup.sh` file o You can also use the following one-click command to perform a quick installation -## Installation commands +## Installation method + +### One-click installation command ```bash wget https://raw.githubusercontent.com/MCSManager/Script/master/setup.sh -O setup.sh && bash setup.sh ``` +### Docker (Beta) + +Please check this [tutorial](https://github.com/MCSManager/Script/blob/master/docker/README.md) +
diff --git a/README_cn.md b/README_cn.md index 5f55c3a..5a49951 100644 --- a/README_cn.md +++ b/README_cn.md @@ -14,16 +14,22 @@ 你也可以使用下列一键命令安装 MCSManager 9 -## 安装命令 +## 安装方法 + +### 一键命令安装 ```bash wget https://raw.githubusercontent.com/MCSManager/Script/master/setup.sh -O setup.sh && bash setup.sh ``` -当然, 一般国内用户因为某些神奇的原因都连不上 Github, 下方为 Gitee 国内镜像源链接 +_当然, 一般国内用户因为某些神奇的原因都连不上 Github, 下方为 Gitee 国内镜像源链接_ ```bash wget https://gitee.com/mcsmanager/script/raw/master/setup.sh -O setup.sh && bash setup.sh ``` +### Docker (Beta) + +请查看此[教程](https://github.com/MCSManager/Script/blob/master/docker/README_cn.md) +
diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..8e0ccc3 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,76 @@ +# Install MCSManager with Docker + +## Prerequisites + +You need to prepare the following before installation: + +- `docker` version `17.12.0+` has been installed +- `docker-compose` has been installed + +## Start installation + +First, use the following command to create the basic directory of `docker-compose` + +```bash +mkdir -p mcsmanager +cd mcsmanager +``` + +Then, create an empty file named `docker-compose.yaml` + +```bash +touch docker-compose.yaml +``` + +If you are a new user, please copy the configuration file below, modify the part marked with comments, and paste it into `docker-compose.yaml` + +If you cannot copy or paste this file, you can also click [here](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/full.yaml) to get the sample file + +```yaml +version: "2.4" + +services: + web: + image: bluefunny/mcsm-web:latest + volumes: + # This is the MCSManager control panel log storage directory + # The default is [/var/logs/mcsmanager/web] + - /var/logs/mcsmanager/web:/logs + + # This is the MCSManager control panel log storage directory + # The default is the data/web folder under the current directory + - ./data/web:/data + network_mode: host + command: /start + + daemon: + image: bluefunny/mcsm-daemon:latest + volumes: + # This is the MCSManager control panel log storage directory + # The default is [/var/logs/mcsmanager/daemon] + - /var/logs/mcsmanager/daemon:/logs + + # This is the MCSManager control panel log storage directory + # The default is the data/daemon folder under the current directory + - ./data/daemon:/data + network_mode: host + command: /start +``` + +If you are an old user and only plan to install a certain component of MCSManager (such as only installing the MCSManager daemon), please refer to the following two sample files and modify the part marked with comments + +- [MCSManager web](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/web.yaml) +- [MCSManager daemon](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/daemon.yaml) + +After all the above operations are completed, please run the following command to start MCSManager + +```bash +docker-compose -f docker-compose.yaml up -d +``` + +If everything runs normally, you can soon access `http://127.0.0.1:23333` to view the panel you just built! + +If you modify (or update) the `docker-compose.yaml` file later, please move it back to the directory and run the following command to make the modification take effect + +```bash +docker-compose up -d diff --git a/docker/README_cn.md b/docker/README_cn.md new file mode 100644 index 0000000..e78511a --- /dev/null +++ b/docker/README_cn.md @@ -0,0 +1,77 @@ +# 通过 Docker 安装 MCSManager + +## 预先准备 + +你需要提前做好以下几点准备 + +- 已经安装了 `17.12.0+` 版本的 `docker` +- 已经安装了 `docker-compose` + +## 开始安装 + +首先, 请先使用以下命令创建 `docker-compose` 基本目录 + +```bash +mkdir -p mcsmanager +cd mcsmanager +``` + +然后, 创建一个名为 `docker-compose.yaml` 的空文件 + +```bash +touch docker-compose.yaml +``` + +如果你是一个新用户, 请复制下面的配置文件, 修改其中注释标出的部分, 粘贴到 `docker-compose.yaml` 中即可 + +如果你无法复制或粘贴此文件, 你也可以[点击此处](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/full.yaml)获取示例文件 + +```yaml +version: "2.4" + +services: + web: + image: bluefunny/mcsm-web:latest + volumes: + # 此处为 MCSManager 控制面板日志存储目录 + # 默认为 [/var/logs/mcsmanager/web] + - /var/logs/mcsmanager/web:/logs + + # 此处为 MCSManager 控制面板日志存储目录 + # 默认为当前目录下的 data/web 文件夹 + - ./data/web:/data + network_mode: host + command: /start + + daemon: + image: bluefunny/mcsm-daemon:latest + volumes: + # 此处为 MCSManager 控制面板日志存储目录 + # 默认为 [/var/logs/mcsmanager/daemon] + - /var/logs/mcsmanager/daemon:/logs + + # 此处为 MCSManager 控制面板日志存储目录 + # 默认为当前目录下的 data/daemon 文件夹 + - ./data/daemon:/data + network_mode: host + command: /start +``` + +如果你是一个老用户, 并且只准备安装 MCSManager 的某个组件 (如仅安装 MCSManager 守护程序), 请查看下面这两个示例文件, 并修改其中注释标出的部分 + +- [MCSManager 控制面板](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/web.yaml) +- [MCSManager 守护程序](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/daemon.yaml) + +当上述操作全部完成后, 请运行以下命令以启动 MCSManager + +```bash +docker-compose -f docker-compose.yaml up -d +``` + +如果一切都运行正常, 那么不久后你就可以访问 `http://127.0.0.1:23333` 来查看你刚刚搭建好的面板了 ! + +如果你后期修改(或更新)了 `docker-compose.yaml` 文件, 请重新移动到该目录, 并运行以下命令以使修改生效 + +```bash +docker-compose up -d +``` diff --git a/docker/examples/cn/daemon.yaml b/docker/examples/cn/daemon.yaml new file mode 100644 index 0000000..903bce3 --- /dev/null +++ b/docker/examples/cn/daemon.yaml @@ -0,0 +1,15 @@ +version: "2.4" + +services: + daemon: + image: bluefunny/mcsm-daemon:latest + volumes: + # 此处为 MCSManager 守护程序日志存储目录 + # 默认为 [/var/logs/mcsmanager/daemon] + - /var/logs/mcsmanager/daemon:/logs + + # 此处为 MCSManager 守护程序日志存储目录 + # 默认为当前目录下的 data/daemon 文件夹 + - ./data/daemon:/data + network_mode: host + command: /start diff --git a/docker/examples/cn/full.yaml b/docker/examples/cn/full.yaml new file mode 100644 index 0000000..15ad729 --- /dev/null +++ b/docker/examples/cn/full.yaml @@ -0,0 +1,28 @@ +version: "2.4" + +services: + web: + image: bluefunny/mcsm-web:latest + volumes: + # 此处为 MCSManager 控制面板日志存储目录 + # 默认为 [/var/logs/mcsmanager/web] + - /var/logs/mcsmanager/web:/logs + + # 此处为 MCSManager 控制面板日志存储目录 + # 默认为当前目录下的 data/web 文件夹 + - ./data/web:/data + network_mode: host + command: /start + + daemon: + image: bluefunny/mcsm-daemon:latest + volumes: + # 此处为 MCSManager 守护程序日志存储目录 + # 默认为 [/var/logs/mcsmanager/daemon] + - /var/logs/mcsmanager/daemon:/logs + + # 此处为 MCSManager 守护程序日志存储目录 + # 默认为当前目录下的 data/daemon 文件夹 + - ./data/daemon:/data + network_mode: host + command: /start diff --git a/docker/examples/cn/web.yaml b/docker/examples/cn/web.yaml new file mode 100644 index 0000000..6f612b3 --- /dev/null +++ b/docker/examples/cn/web.yaml @@ -0,0 +1,15 @@ +version: "2.4" + +services: + web: + image: bluefunny/mcsm-web:latest + volumes: + # 此处为 MCSManager 控制面板日志存储目录 + # 默认为 [/var/logs/mcsmanager/web] + - /var/logs/mcsmanager/web:/logs + + # 此处为 MCSManager 控制面板日志存储目录 + # 默认为当前目录下的 data/web 文件夹 + - ./data/web:/data + network_mode: host + command: /start diff --git a/docker/examples/en/daemon.yaml b/docker/examples/en/daemon.yaml new file mode 100644 index 0000000..4ae4580 --- /dev/null +++ b/docker/examples/en/daemon.yaml @@ -0,0 +1,15 @@ +version: "2.4" + +services: + daemon: + image: bluefunny/mcsm-daemon:latest + volumes: + # This is the MCSManager web panel log storage directory + # Default is [/var/logs/mcsmanager/daemon] + - /var/logs/mcsmanager/daemon:/logs + + # This is the MCSManager daemon data storage directory + # Default is the data/daemon folder in the current directory + - ./data/daemon:/data + network_mode: host + command: /start diff --git a/docker/examples/en/full.yaml b/docker/examples/en/full.yaml new file mode 100644 index 0000000..f8d00ce --- /dev/null +++ b/docker/examples/en/full.yaml @@ -0,0 +1,28 @@ +version: "2.4" + +services: + web: + image: bluefunny/mcsm-web:latest + volumes: + # This is the MCSManager web panel log storage directory + # The default is [/var/logs/mcsmanager/web] + - /var/logs/mcsmanager/web:/logs + + # This is the MCSManager web panel data storage directory + # The default is the data/web folder in the current directory + - ./data/web:/data + network_mode: host + command: /start + + daemon: + image: bluefunny/mcsm-daemon:latest + volumes: + # This is the MCSManager daemon log storage directory + # The default is [/var/logs/mcsmanager/daemon] + - /var/logs/mcsmanager/daemon:/logs + + # This is the MCSManager daemon data storage directory + # The default is the data/daemon folder in the current directory + - ./data/daemon:/data + network_mode: host + command: /start diff --git a/docker/examples/en/web.yaml b/docker/examples/en/web.yaml new file mode 100644 index 0000000..cb5ae2b --- /dev/null +++ b/docker/examples/en/web.yaml @@ -0,0 +1,15 @@ +version: "2.4" + +services: + web: + image: bluefunny/mcsm-web:latest + volumes: + # This is the MCSManager daemon log storage directory + # The default is [/var/logs/mcsmanager/web] + - /var/logs/mcsmanager/web:/logs + + # This is the MCSManager daemon data storage directory + # The default is the data/web folder in the current directory + - ./data/web:/data + network_mode: host + command: /start From e036a473b1bbd4d6f5ea8113d67993302d52e2cb Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 22 Mar 2023 17:16:04 +0800 Subject: [PATCH 045/463] Emergency fix for data loss issue --- setup_cn.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index a2d5dca..eae0d82 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -109,6 +109,11 @@ LEcho() { return } +# Detect old MCSManager +[ -d $mcsmPath ] && LEcho yellow "[!] 检测到旧版 MCSManager, 切换为更新模式" "[!] Old version of MCSManager detected, switch to update mode" +[ -d $mcsmPath ] && mode="update" +[ ! -d $mcsmPath ] && mkdir -p $mcsmPath + ## Check root CheckRoot() { if [[ $EUID -ne 0 ]]; then @@ -178,7 +183,7 @@ CheckOS() { else LEcho error "[x] 未能正常检测到系统类型, 无法继续安装" "[x] Unable to detect system type, installation cannot continue" fi - + # Install dependencies LEcho cyan "[*] 正在安装安装所需的工具" "[*] Installing the tools required for installation" if [ "$os" == "debian" ]; then @@ -209,11 +214,6 @@ Install() { LEcho cyan "[*] 正在初始化工作环境" "[*] Initializing work environment" mkdir -p $tmpDir - # Detect old MCSManager - [ -d $mcsmPath ] && LEcho yellow "[!] 检测到旧版 MCSManager, 切换为更新模式" "[!] Old version of MCSManager detected, switch to update mode" - [ -d $mcsmPath ] && mode="update" - mkdir -p $mcsmPath - # Install nodejs if ! CheckNode;then LEcho cyan "[*] 正在安装 Node.js" "[*] Installing Node.js" @@ -258,7 +258,7 @@ Install() { git fetch origin git checkout master git reset --hard origin/master - git pull + git pull LEcho cyan "[*] 正在更新 MCSManager 守护晨曦股" "[*] Updating MCSManager daemon" @@ -269,24 +269,24 @@ Install() { git fetch origin git checkout master git reset --hard origin/master - git pull + git pull else # Clone MCSManager web panel LEcho cyan "[*] 正在安装 MCSManager 前端管理面板" "[*] Installing MCSManager web panel" - git clone --single-branch -b master --depth 1 $webURL $webPath + git clone --single-branch -b master --depth 1 $webURL $webPath # Clone MCSManager daemon LEcho cyan "[*] 正在安装 MCSManager 守护程序" "[*] Installing MCSManager web panel" - git clone --single-branch -b master --depth 1 $daemonURL $daemonPath + git clone --single-branch -b master --depth 1 $daemonURL $daemonPath fi # Update dependencies LEcho cyan "[*] 正在更新依赖" "[*] Updating dependencies" cd $webPath || LEcho error "[x] 无法进入 MCSManager 前端管理目录, 请检查权限" "[x] Unable to enter MCSManager web panel directory, please check permissions" - [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com - [ $cn == 0 ] && $npmBin install + [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com + [ $cn == 0 ] && $npmBin install cd $daemonPath || LEcho error "[x] 无法进入 MCSManager 守护程序目录, 请检查权限" "[x] Unable to enter MCSManager daemon directory, please check permissions" - [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com - [ $cn == 0 ] && $npmBin install + [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com + [ $cn == 0 ] && $npmBin install # Create systemd service LEcho cyan "[*] 正在创建 systemd 服务" "[*] Creating systemd service" From 57d4eb36252f723f44df4d1d608fa71bf4ce0453 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 22 Mar 2023 17:32:36 +0800 Subject: [PATCH 046/463] Fix a f**king problem --- setup_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index eae0d82..c7d7b58 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -260,7 +260,7 @@ Install() { git reset --hard origin/master git pull - LEcho cyan "[*] 正在更新 MCSManager 守护晨曦股" "[*] Updating MCSManager daemon" + LEcho cyan "[*] 正在更新 MCSManager 守护程序" "[*] Updating MCSManager daemon" cd $daemonPath || LEcho error "[x] 无法进入 MCSManager 守护程序目录, 请检查权限" "[x] Unable to enter MCSManager daemon directory, please check permissions" From 2c14ea06bd39f0bde7cdfd522340417df563c866 Mon Sep 17 00:00:00 2001 From: unitwk Date: Wed, 22 Mar 2023 17:37:38 +0800 Subject: [PATCH 047/463] Update README_cn.md --- README_cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_cn.md b/README_cn.md index 5a49951..824d0ca 100644 --- a/README_cn.md +++ b/README_cn.md @@ -22,7 +22,7 @@ wget https://raw.githubusercontent.com/MCSManager/Script/master/setup.sh -O setup.sh && bash setup.sh ``` -_当然, 一般国内用户因为某些神奇的原因都连不上 Github, 下方为 Gitee 国内镜像源链接_ +_当然, 一般国内用户因为众所周知的原因都连不上 Github, 下方为 Gitee 国内镜像源链接_ ```bash wget https://gitee.com/mcsmanager/script/raw/master/setup.sh -O setup.sh && bash setup.sh From f785157683d78f59a2a48747a630997e16694619 Mon Sep 17 00:00:00 2001 From: BlueFunny Date: Thu, 23 Mar 2023 08:55:34 +0800 Subject: [PATCH 048/463] Deprecated --- setup.sh.bak | 614 --------------------------------------------------- setup_en.sh | 263 ---------------------- 2 files changed, 877 deletions(-) delete mode 100644 setup.sh.bak delete mode 100644 setup_en.sh diff --git a/setup.sh.bak b/setup.sh.bak deleted file mode 100644 index bea835f..0000000 --- a/setup.sh.bak +++ /dev/null @@ -1,614 +0,0 @@ -#!/usr/bin/env bash - -#### MCSM Install Script -#### Made By nuomiaa, CreeperKong, unitwk -#### Recode By BlueFunny_ - -### Variables ### -## Files -mcsmPath="/opt/mcsmanager" -mcsmDaemonDPath="${mcsmPath}/daemon/data" -mcsmWebDPath="${mcsmPath}/web/data" -nodePath="${mcsmPath}/node" -tmpPath="/tmp/mcsmanager-setup" - -## Node -nodeVersion="v14.19.1" -node="${nodePath}/bin/node" -npm="${nodePath}/bin/npm" - -## Setup tools mode -mode="install" - -## URL -nodeMirror="https://nodejs.org/dist" -daemonCloneURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" -webCloneURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" -nodeFileURL="${nodeMirror}/${nodeVersion}/node-${nodeVersion}-linux-${arch}.tar.gz" -nodeHashURL="${nodeMirror}/${nodeVersion}/SHASUMS256.txt" - -## Language -if [ "$(locale -a | grep "zh_CN")" != "" ]; then - zh=1 - export LANG="zh_CN.UTF-8" -else - zh=0 -fi - -## Other -try=1 -os=$(uname -a) -arch=$(uname -m) -skipNodeInstall=0 -skipMCSMInstall=0 -#oldSystem=0 - -### Tools ### -## Localize echo -# $1: color -# $2: zh -# $3: en -LEcho() { - case $1 in - # Red color echo - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - - # Green color echo - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - - # Cyan color echo - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - - # Cyan color echo (No line break) - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - - # Yellow color echo - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - - # Red error echo - error) - echo '=================================================' - [ "${zh}" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - Clean - exit 1 - ;; - - # No color echo - *) - [ "${zh}" == 1 ] && echo "$2" - [ "${zh}" == 0 ] && echo "$3" - ;; - esac - return -} - -### Entry Point ### -## Program entry point -Main() { - LEcho cyan "[-] 正在检查环境..." "[-] Initializing environment..." - - # Check mode - if [ "$1" == "uninstall" ]; then - mode="uninstall" - fi - - # Create temp dir - [ ! -d "${tmpPath}" ] && mkdir -p "${tmpPath}" || rm -rf "${tmpPath}" && mkdir -p "${tmpPath}" - if [ ! -d "${tmpPath}" ]; then - CheckRoot - LEcho error "[x] 未能成功创建临时目录, 请检查权限" "[x] Failed to create temporary directory, please check permissions" - fi - - # Check functions collection - if [ "${mode}" == "install" ]; then - # Install - CheckSystem - CheckOldFiles "$1" - CheckNetwork - CheckCN - SetArgs "$1" "$2" - - LEcho cyan "[-] 环境检查完毕, 开始安装 MCSManager" "[-] Environment check completed, start installing MCSManager" - - Install - - if [ -d "${tmpPath}"/mcsmanager ] || [ -d "${tmpPath}"/node ]; then - LEcho cyan "[-] 检测到备份文件, 正在恢复中..." "[-] Backup files detected, recovering..." - MirgrateFiles - fi - else - # Uninstall - CheckRoot - CheckInstall - - LEcho cyan "[-] 环境校验完毕, 开始卸载 MCSManager" "[-] Environment check completed, start uninstalling MCSManager" - - Remove "$1" - fi - - return -} - -### Init ### -## Check if mcsm installed -CheckInstall() { - if [ ! -d ${mcsmPath} ]; then - LEcho error "[x] 检测到您没有安装 MCSManager, 谨慎的拒绝卸载请求" "[x] It is detected that you have not installed MCSManager, and the uninstall request is rejected" - fi - return -} - -## Check OS -CheckOS() { - if [ "$(echo "${os}" | grep "Ubuntu")" == "" ] && [ "$(echo "${os}" | grep "Debian")" == "" ] && [ "$(echo "${os}" | grep "CentOS")" == "" ]; then - LEcho error "[x] 本脚本仅支持 Ubuntu/Debian/CentOS 系统!" "[x] This script only supports Ubuntu/Debian/CentOS systems!" - fi - if [ "$(cat /etc/redhat-release | grep ' 6.' | grep -iE 'centos|Red Hat')" ]; then - # LEcho yellow "[!] 检测到您的系统版本过低, 可能会存在一定的兼容性问题, 请了解" "[!] It is detected that your system version is too low, there may be certain compatibility issues, please understand" - # LEcho cyan "[-] 切换为兼容性模式" "[-] Switch to compatibility mode" - # oldSystem=1 - LEcho error "[x] 本脚本不支持 CentOS 6, 请升级到 CentOS 7 或更高版本" "[x] This script does not support CentOS 6, please upgrade to CentOS 7 or higher" - fi - if [ "$(cat /etc/issue | grep Ubuntu | awk '{print $2}' | cut -f 1 -d '.')" ] && [ "$(cat /etc/issue | grep Ubuntu | awk '{print $2}' | cut -f 1 -d '.')" -lt "16" ]; then - # LEcho yellow "[!] 检测到您的系统版本过低, 可能会存在一定的兼容性问题, 请了解" "[!] It is detected that your system version is too low, there may be certain compatibility issues, please understand" - # LEcho cyan "[-] 切换为兼容性模式" "[-] Switch to compatibility mode" - # oldSystem=1 - LEcho error "[x] 本脚本不支持 Ubuntu 14, 请升级到 Ubuntu 16 或更高版本" "[x] This script does not support Ubuntu 14, please upgrade to Ubuntu 16 or higher" - fi - return -} - -## Check user permission -CheckRoot() { - if [ "$(whoami)" != "root" ]; then - LEcho error "[x] 请使用 root 用户或者使用 sudo 命令执行脚本!" "[x] Please use root user or use sudo command to execute the script!" - fi - return -} - -## Check system environment -CheckSystem() { - # Function reuse - CheckRoot - CheckOS - - # Check Tools - if [ -f /etc/redhat-release ]; then - yum install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" - else - #if [ ${oldSystem} == 1 ]; then - # apt-get install --force-yes -y git tar wget curl systemctl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" - #else - # apt-get install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" - #fi - apt-get install -y git tar wget curl || LEcho error "[x] 未能成功安装必备软件包" "[x] Failed to install required software packages" - fi - - # Check Arch - case "${arch}" in - x86_64) - arch=x64 - ;; - aarch64) - arch=arm64 - ;; - arm) - arch=armv7l - ;; - ppc64le) - arch=ppc64le - ;; - s390x) - arch=s390x - ;; - *) - LEcho error "[x] 当前系统架构暂不受 Node.js 支持, 无法安装 MCSManager" "[x] The current system architecture is not supported by Node.js, MCSManager cannot be installed" - ;; - esac - - LEcho green "[√] 系统环境检查完成" "[√] System environment check completed" - return -} - -## Check if MCSManager is already installed on system -CheckOldFiles() { - # Check old MCSManager files - if [ -d ${mcsmPath} ]; then - LEcho echo "[-] 检测到旧版本 MCSManager, 正在迁移文件中" "[-] Old version MCSManager detected, migrating files" - # Create backup dir - [ ! -d ${tmpPath}/mcsmanager ] && mkdir -p ${tmpPath}/mcsmanager - [ ! -d ${tmpPath}/systemd ] && mkdir -p ${tmpPath}/systemd - - # Stop service - systemctl stop mcsm-daemson.service - systemctl stop mcsm-web.service - systemctl disable mcsm-daemon.service - systemctl disable mcsm-web.service - - # Move files - mv -f ${mcsmPath}/web ${tmpPath}/mcsmanager/web - mv -f ${mcsmPath}/daemon ${tmpPath}/mcsmanager/daemon - mv -f /etc/systemd/system/mcsm-daemon.service "${tmpPath}"/systemd/mcsm-daemon.service - mv -f /etc/systemd/system/mcsm-web.service "${tmpPath}"/systemd/mcsm-web.service - fi - - # Check old node files - if [ -d ${nodePath} ]; then - LEcho echo "[-] 检测到旧版本 Node.js, 正在比对版本中" "[-] Old version Node.js detected, comparing versions" - - # Check node version - if [ "$(${node} -v)" == "${nodeVersion}" ]; then - LEcho echo "[-] Node.js 版本匹配, 跳过 Node.js 下载" "[-] Node.js version matches, skipping Node.js download" - mv -f ${nodePath} ${tmpPath}/node - skipNodeInstall=1 - fi - fi - - # Remove old files - Remove "$1" - - # Create new dir - mkdir -p ${mcsmPath} - - LEcho green "[√] 旧文件检查完毕" "[√] Old file check completed" - return -} - -# Check network -CheckNetwork() { - if [ "$(curl -m 10 -s https://www.baidu.com)" == "" ]; then - LEcho error "[x] 未能成功连接到网络, 请检查网络连接后重试" "[x] Failed to connect to the network, please check the network connection and try again" - fi - LEcho green "[√] 网络连接正常" "[√] Network connection is normal" - return -} - -# Check if the server is in China -CheckCN() { - if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then - # LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China" - # [ "${zh}" == 1 ] && read -e -r -p "[?] 是否选用中国镜像完成安装? [y/n] " input - # [ "${zh}" == 0 ] && read -e -r -p "[?] Whether to use the Chinese mirror to complete the installation? [y/n] " input - # case ${input} in - # [yY][eE][sS] | [yY]) - # LEcho cyan "[-] 选用中国镜像" "[-] Use Chinese mirror" - # daemonCloneURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" - # webCloneURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" - # nodeMirror="https://npmmirror.com/mirrors/node" - # ;; - # *) - # LEcho cyan "[-] 不选用中国镜像" "[-] Do not use Chinese mirror" - # ;; - # esac - LEcho yellow "[!] 根据 'ipapi.co' 提供的信息, 当前服务器可能在中国, 已自动切换为中国镜像源" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China, and the Chinese mirror source has been automatically switched" - daemonCloneURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" - webCloneURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" - nodeMirror="https://npmmirror.com/mirrors/node" - else - LEcho cyan "[-] 检测服务器地理位置出错, 跳过检测" "[-] Error detecting server location, skipping detection" - fi - LEcho green "[√] 服务器地理位置检查完毕" "[√] Location check completed" - return -} - -# Set Debug Args -SetArgs() { - # Warning - LEcho yellow "[!] 检测到您已启用 debug 功能, 安装可能会导致不可预知的错误" "[!] Debug mode is enabled, installation may cause unpredictable errors" - LEcho yellow "[!] 此模式导致的任何问题都不会得到解决" "[!] Any problems caused by this mode will not be solved" - - # Set args - if [ "$1" != "" ] && [ "$1" != "remove" ]; then - if [ "$1" == "force" ]; then - LEcho echo "[-] 强制下载 Node.js" "[-] Force download Node.js" - skipNodeInstall=0 - fi - if [ "$1" == "skipnode" ]; then - LEcho echo "[-] 已跳过 Node.js 安装" "[-] Skipped Node.js installation" - skipNodeInstall=1 - fi - if [ "$1" == "skipmcsm" ]; then - LEcho echo "[-] 已跳过 MCSManager 安装" "[-] Skipped MCSManager installation" - skipMCSMInstall=1 - fi - if [ "$1" == "custom" ] && [ "$2" != "" ]; then - LEcho echo "[-] 自定义安装路径为: $2" "[-] Custom installation path: $2" - mcsmPath="$2" - fi - if [ "$1" == "node" ] && [ "$2" != "" ]; then - LEcho echo "[-] 自定义 Node.js 下载链接为: $2" "[-] Custom Node.js download link: $2" - nodeMirror="$2" - fi - fi -} - -### Main ### -## Main install function -Install() { - InstallNode - [ ${skipMCSMInstall} != 1 ] && InstallMCSM -} - -## Install Node.js -InstallNode() { - if [ ${skipNodeInstall} == 1 ]; then - if [ ! -d ${tmpPath}/node ]; then - LEcho echo "[-] 跳过 Node.js 安装" "[-] Skipped Node.js installation" - else - mv -f ${tmpPath}/node ${nodePath} - fi - else - LEcho echo "[+] 正在安装 Node.js" "[+] Installing Node.js" - - # Download Node.js - #if [ ${oldSystem} != 1 ]; then - # wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.tar.gz "${nodeFileURL}" - # wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.sha256 "${nodeHashURL}" - #else - # wget -t ${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.tar.gz "${nodeFileURL}" - # wget -t ${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.sha256 "${nodeHashURL}" - #fi - wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.tar.gz "${nodeFileURL}" - wget -t=${try} -q --no-check-certificate --show-progress -O ${tmpPath}/node.sha256 "${nodeHashURL}" - - # Check hash - cat ${tmpPath}/node.sha256 | grep "${nodeVersion}/node-${nodeVersion}-linux-${arch}.tar.gz" | tee ${tmpPath}/node.sha256 - cd ${tmpPath} || LEcho red "[x] 校验出错, 无法继续进行下一步, 退回操作中..." "[x] Verification error, unable to continue to the next step, returning to operation..." && Revert - sha256sum -c ${tmpPath}/node.sha256 || LEcho red "[x] 校验出错, 无法继续进行下一步, 退回操作中..." "[x] Verification error, unable to continue to the next step, returning to operation..." && Revert - - # Extract Node.js - tar -xzvf ${tmpPath}/node.tar.gz -C ${nodePath} --strip-components=1 - - # Set permission - chmod +x ${node} - chmod +x ${npm} - - # Check Node.js installation - if ! ${node} -v; then - LEcho red "[x] Node.js 安装失败, 无法继续进行下一步, 退回操作中..." "[x] Node.js installation failed, please check the network connection" - Revert - fi - if ! ${npm} -v; then - LEcho red "[x] Node.js 安装失败, 无法继续进行下一步, 退回操作中..." "[x] Node.js installation failed, please check the network connection" - Revert - fi - - # Output Node.js version - echo - LEcho cyan "=============== Node 版本 ===============" "=============== Node Version ===============" - LEcho cyan_n " Node: " " Node: " - LEcho echo "$("${node}" -v)" "$("${node}" -v)" - LEcho cyan_n " NPM: " " NPM: " - LEcho echo "v$("${npm}" -v)" "v$("${npm}" -v)" - LEcho cyan "=========================================" "=============== Node Version ===============" - echo - - sleep 3 - LEcho green "[√] Node.js 安装完毕" "[√] Node.js installation completed" - fi - return -} - -## Install MCSManager -InstallMCSM() { - # Clone MCSManager daemon and web - git clone --single-branch -b master --depth 1 ${daemonCloneURL} "${mcsmPath}/daemon" - git clone --single-branch -b master --depth 1 ${webCloneURL} "${mcsmPath}/web" - - # Install Node.js dependencies - cd "${mcsmPath}/daemon" || LEcho red "[x] 无法进入 MCSManager 守护进程目录, 无法继续进行下一步, 退回操作中..." "[x] Unable to enter the MCSManager daemon directory, unable to continue to the next step, returning to operation..." && Revert - ${npm} install --registry=https://registry.npmmirror.com >error - cd "${mcsmPath}/web" || LEcho red "[x] 无法进入 MCSManager 网页面板目录, 无法继续进行下一步, 退回操作中..." "[x] Unable to enter the MCSManager web directory, unable to continue to the next step, returning to operation..." && Revert - ${npm} install --registry=https://registry.npmmirror.com >error - - # Output MCSManager install path - echo - LEcho cyan "=============== MCSManager 安装目录 ===============" "=============== MCSManager Install Path ===============" - LEcho cyan_n " Daemon: " " Daemon: " - LEcho echo "${mcsmPath}/daemon" "${mcsmPath}/daemon" - LEcho cyan_n " Web: " " Web: " - LEcho echo "${mcsmPath}/web" "${mcsmPath}/web" - LEcho cyan "==================================================" "=============== MCSManager Install Path ===============" - echo - - # Function reuse - CreateService - MirgrateFiles - - # Test the availability of MCSManager - if ! systemctl start mcsm-web; then - LEcho red "[x] MCSManager 网页面板启动失败, 无法继续进行下一步, 退回操作中..." "[x] MCSManager installation failed, unable to continue to the next step, returning to operation..." && Revert - else - systemctl stop mcsm-web - fi - if ! systemctl start mcsm-daemon; then - LEcho red "[x] MCSManager 守护进程启动失败, 无法继续进行下一步, 退回操作中..." "[x] MCSManager installation failed, unable to continue to the next step, returning to operation..." && Revert - else - systemctl stop mcsm-daemon - fi - - LEcho green "[√] MCSManager 安装完毕" "[√] MCSManager installation completed" - - sleep 3 - Output - return -} - -## Create systemd service -CreateService() { - # Write systemd service - echo " -[Unit] -Description=MCSManager Daemon - -[Service] -WorkingDirectory=/opt/mcsmanager/daemon -ExecStart=${nodePath}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service - - echo " -[Unit] -Description=MCSManager Web - -[Service] -WorkingDirectory=/opt/mcsmanager/web -ExecStart=${nodePath}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-web.service - - # Enable systemd service - systemctl daemon-reload - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - - sleep 3 - return -} - -## Mirgrate data -MirgrateFiles() { - # Mirgrate mcsmanager data - if [ -d "${tmpPath}"/mcsmanager ]; then - [ ! -d "${mcsmWebDPath}" ] && mv -f "${tmpPath}"/mcsmanager/web/data "${mcsmWebDPath}" || rm -rf ${mcsmWebDPath} && mv -f "${tmpPath}"/mcsmanager/web/data "${mcsmWebDPath}" - [ ! -d "${mcsmWebDPath}" ] && mv -f "${tmpPath}"/mcsmanager/daemon/data "${mcsmDaemonDPath}" || rm -rf ${mcsmDaemonDPath} && mv -f "${tmpPath}"/mcsmanager/daemon/data "${mcsmDaemonDPath}" - fi - - # Mirgrate old node files - if [ -d "${tmpPath}"/node ]; then - mv -f "${tmpPath}"/node "${nodePath}" - fi -} - -## Output MCSManager information -Output() { - printf "\033c" - LEcho yellow "==================================================================" "==================================================================" - LEcho green "欢迎使用 MCSManager, 您可以通过以下方式访问: " "Welcome to use MCSManager, you can access it through the following ways:" - LEcho yellow "==================================================================" "==================================================================" - LEcho cyan_n "控制面板地址: " "Control panel address: " - LEcho yellow "http://localhost:23333" "http://localhost:23333" - LEcho red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" "If you can't access the panel, please check if the firewall/security group has opened the panel 23333 and 24444 ports. The control panel needs these two ports to work properly." - LEcho yellow "==================================================================" "==================================================================" - LEcho cyan "重启 systemctl restart mcsm-{daemon,web}.service" "Restart systemctl restart mcsm-{daemon,web}.service" - LEcho cyan "禁用 systemctl disable mcsm-{daemon,web}.service" "Disable systemctl disable mcsm-{daemon,web}.service" - LEcho cyan "启用 systemctl enable mcsm-{daemon,web}.service" "Enable systemctl enable mcsm-{daemon,web}.service" - LEcho cyan "启动 systemctl start mcsm-{daemon,web}.service" "Start systemctl start mcsm-{daemon,web}.service" - LEcho cyan "停止 systemctl stop mcsm-{daemon,web}.service" "Stop systemctl stop mcsm-{daemon,web}.service" - LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More usage instructions, please refer to: https://docs.mcsmanager.com/" - LEcho yellow "==================================================================" "==================================================================" -} - -## Main remove function -Remove() { - # Stop systemd service - if [ "$1" != "remove" ]; then - systemctl stop mcsm-daemson.service - systemctl stop mcsm-web.service - systemctl disable mcsm-daemon.service - systemctl disable mcsm-web.service - fi - - # Remove systemd service - [ -f /etc/systemd/system/mcsm-daemon.service ] && rm -rf /etc/systemd/system/mcsm-daemon.service - [ -f /etc/systemd/system/mcsm-daemon.service ] && rm -rf /etc/systemd/system/mcsm-web.service - systemctl daemon-reload - - # Ask if data is retained - if [ -d "${mcsmDaemonDPath}" ] || [ -d "${mcsmWebDPath}" ]; then - LEcho yellow "[?] 是否保留数据?" "[?] Do you want to keep the data?" - read -r -p "[y/N]:" input - case ${input} in - [yY][eE][sS] | [yY]) - LEcho echo "[-] 保留数据" "[-] Keep data" - mv -f "${mcsmDaemonDPath}" "${tmpPath}"/mcsmanager/daemon - mv -f "${mcsmWebDPath}" "${tmpPath}"/mcsmanager/web - rm -rf "${mcsmPath}" - mv -f "${tmpPath}"/mcsmanager "${mcsmPath}.old" - ;; - *) - LEcho echo "[-] 删除数据" "[-] Delete data" - rm -rf "${mcsmPath}" - ;; - esac - fi - return -} - -### Other Functions ### -## Revert Script Operation -Revert() { - # Remove new files - rm -rf "${mcsmPath}" - rm -rf "${nodePath}" - rm -rf /etc/systemd/system/mcsm-daemon.service - rm -rf /etc/systemd/system/mcsm-web.service - - # Restore old files - mv -f "${tmpPath}"/mcsmanager "${mcsmPath}" - mv -f "${tmpPath}"/node "${nodePath}" - mv -f "${tmpPath}"/systemd/mcsm-daemon.service /etc/systemd/system/mcsm-daemon.service - mv -f "${tmpPath}"/systemd/mcsm-web.service /etc/systemd/system/mcsm-web.service - - # Re-enable systemd service - systemctl daemon-reload - systemctl enable mcsm-daemon.service - systemctl enable mcsm-web.service - - LEcho error "[x] 安装失败" "[x] Installation failed" -} - -## Clean Function -Clean() { - rm -rf "${tmpPath}" - return -} - -### Start ### -LEcho cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2022 MCSManager All rights reserved. -+---------------------------------------------------------------------- -| Shell Install Script by Nuomiaa & CreeperKong -| Remake By BlueFunny_ -+---------------------------------------------------------------------- -" "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2022 MCSManager All rights reserved. -+---------------------------------------------------------------------- -| Shell Install Script by Nuomiaa & CreeperKong -| Remake By BlueFunny_ -+---------------------------------------------------------------------- -" -Main "$1" "$2" "$3" -Clean -exit 0 diff --git a/setup_en.sh b/setup_en.sh deleted file mode 100644 index 90f389e..0000000 --- a/setup_en.sh +++ /dev/null @@ -1,263 +0,0 @@ -#!/bin/bash -printf "\033c" - -error="" -node="v14.19.1" -arch=$(uname -m) -mcsmanager_install_path="/opt/mcsmanager" - -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 -} - -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} - -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} - -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} - -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" -} - -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} - -Install_Node() { - echo_cyan_n "[+] Install Node environment... " - - rm -irf "$node_install_path" - - cd /opt || exit - - wget -o /dev/null https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz - - tar -zxf node-"$node"-linux-"$arch".tar.gz - - rm -rf node-"$node"-linux-"$arch".tar.gz - - if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] - then - echo_green "Success" - else - echo_red "Failed" - Red_Error "[x] Node installation failed!" - fi - - echo - echo_yellow "=============== Node Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node Version ===============" - echo - - sleep 3 -} - -Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." - - # delete service - rm -f /etc/systemd/system/mcsm-daemon.service - rm -f /etc/systemd/system/mcsm-web.service - - # reload - systemctl daemon-reload - - # echo "[x] Delete the original MCSManager" - rm -irf ${mcsmanager_install_path} - - # echo "[+] mkdir -p ${mcsmanager_install_path}" - mkdir -p ${mcsmanager_install_path} || exit - - # echo "[→] cd ${mcsmanager_install_path}" - cd ${mcsmanager_install_path} || exit - - echo_cyan "[↓] Git clone MCSManager-Daemon..." - git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Daemon-Production.git daemon - - # echo "[→] cd daemon" - cd daemon || exit - - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com > error - - # echo "[←] cd .." - cd .. - - echo_cyan "[↓] Git clone MCSManager-Web..." - git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Web-Production.git web - - # echo "[→] cd web" - cd web || exit - - echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com > error - - echo - echo_yellow "=============== MCSManager ===============" - echo_green " Daemon: ${mcsmanager_install_path}/daemon" - echo_green " Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" - - sleep 3 -} - -Create_Service() { - echo_cyan "[+] Create MCSManager service..." - - echo " -[Unit] -Description=MCSManager Daemon - -[Service] -WorkingDirectory=/opt/mcsmanager/daemon -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - -[Install] -WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-daemon.service - - echo " -[Unit] -Description=MCSManager Web - -[Service] -WorkingDirectory=/opt/mcsmanager/web -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - -[Install] -WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-web.service - - systemctl daemon-reload - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - - sleep 3 - - printf "\033c" - echo_yellow "==================================================================" - echo_green "Welcome to MCSManager, you can access it by the following ways:" - echo_yellow "==================================================================" - echo_cyan_n "Daemon Service Address: "; echo_yellow "http://localhost:24444" - echo_cyan_n "Web Service Address: "; echo_yellow "http://localhost:23333" - echo_cyan_n "Username: "; echo_yellow "root" - echo_cyan_n "Password: "; echo_yellow "123456" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow "==================================================================" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_cyan "systemctl disable mcsm-{daemon,web}.service" - echo_cyan "systemctl enable mcsm-{daemon,web}.service" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "More info: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" - - -} - - -# ----------------- Program Start ----------------- - -# delete the shell script itself -rm -f "$0" - -# Check execute user permissions -if [ "$(whoami)" != "root" ]; then - Red_Error "[x] Please execute the MCSManager installation command with root permission!" -fi - -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2022 MCSManager All rights reserved. -+---------------------------------------------------------------------- -| Shell Install Script by Nuomiaa & CreeperKong -+---------------------------------------------------------------------- -" - -# Environmental inspection -if [ "$arch" == x86_64 ]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [ $arch == aarch64 ]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [ $arch == arm ]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [ $arch == ppc64le ]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [ $arch == s390x ]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - Red_Error "[x] Sorry, this architecture is not supported yet!" - exit -fi - -# Define the variable Node installation directory -node_install_path="/opt/node-$node-linux-$arch" - -# Check network connection -echo_cyan "[-] Architecture: $arch" - -# MCSManager Installed -if [ -d "$mcsmanager_install_path" ]; then - printf "\033c" - echo_red "---------------------------------------------------- -MCSManager is installed at \"$mcsmanager_install_path\" -Continuing the installation will delete the original MCSManager! ----------------------------------------------------- -Installation will continue in 10 seconds, press Ctrl + Z/C to cancel!" - sleep 10 -fi - -# Install related software -echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; -elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; -elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; -elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; -fi - -# Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] - then - echo_green "Success" - else - echo_red "Failed" - echo "$error" - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - exit -fi - - -# Install the Node environment -Install_Node - -# Install MCSManager -Install_MCSManager - -# Create MCSManager background service -Create_Service From de2885cfa3e2b6cde81475c813b719b29d068710 Mon Sep 17 00:00:00 2001 From: BlueFunny Date: Thu, 23 Mar 2023 08:56:21 +0800 Subject: [PATCH 049/463] Add copyright information --- setup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.sh b/setup.sh index dfd530e..9c4e4d3 100644 --- a/setup.sh +++ b/setup.sh @@ -1,4 +1,10 @@ #!/bin/bash + +#### MCSManager Command Line Interface +#### Made by nuomiaa, CreeperKong, unitwk + +#### Copyright © 2023 MCSManager All rights reserved. + printf "\033c" error="" From fb781f11329b4a4b9320baa8ac4235503dda6ebc Mon Sep 17 00:00:00 2001 From: BlueFunny Date: Thu, 23 Mar 2023 10:08:22 +0800 Subject: [PATCH 050/463] Complete start/stop management function --- cli.sh | 373 +++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 258 insertions(+), 115 deletions(-) diff --git a/cli.sh b/cli.sh index 7fe12e9..bfd5bff 100644 --- a/cli.sh +++ b/cli.sh @@ -1,128 +1,271 @@ -#!/bin/bash -printf "\033c" +#!/usr/bin/env bash -Red_Error() { - printf '\033[1;31;40m%b\033[0m\n' "$@" -} - -echo "============= MCSManager 命令行 =============== -(1) 重启面版服务 (8) 重启守护进程 -(2) 停止面版服务 (9) 停止守护进程 -(3) 启动面版服务 (10) 启动守护进程 -(4) 禁用面版服务 (11) 禁用守护进程 -(5) 启用面版服务 (12) 启用守护进程 -(6) 修改管理密码 (13) 清理面版日志 -(7) 卸载管理面版 (14) 全部重启 -(0) 退出 -===============================================" - -read -r -p "[-] 请输入命令编号: " cmd; - -if [ "$cmd" ] && [ "$cmd" -gt 0 ] && [ "$cmd" -lt 15 ]; then - echo "===============================================" - echo "[-] 正在执行($cmd)..." - echo "===============================================" -fi +#### MCSManager Command Line Interface +#### Made by BlueFunny -if [ "$cmd" == 1 ] -then - systemctl restart mcsm-web.service -elif [ "$cmd" == 2 ] -then - systemctl stop mcsm-web.service -elif [ "$cmd" == 3 ] -then - systemctl start mcsm-web.service -elif [ "$cmd" == 4 ] -then - systemctl disable mcsm-web.service -elif [ "$cmd" == 5 ] -then - systemctl enable mcsm-web.service -elif [ "$cmd" == 6 ] -then - read -r -p "[+] 请输入新密码: " new1; +#### Copyright © 2023 MCSManager All rights reserved. - if [ "${#new1}" -lt 6 ]; then - echo "===============================================" - echo "[x] 密码长度不能小于 6" - exit - fi +### Variables +## Files +mcsmPath="/opt/mcsmanager" +daemonPath="$mcsmPath/daemon" +webPath="$mcsmPath/web" - read -r -p "[+] 请再次输入新密码: " new2; +## Installed status +daemonInstalled=0 +webInstalled=0 +status=0 - if [ "$new1" != "$new2" ]; then - echo "===============================================" - echo "[x] 两次输入的密码不一致" - exit - fi +## Running status +daemonRunning=0 +webRunning=0 - echo "[-] 修改 MCSManager-Web root 密码..." - passWord_old=$(awk -F"\"" '/passWord/{print $4}' /opt/mcsmanager/web/data/User/root.json) - passWord_new=$(echo -n "$new2" | md5sum | cut -d ' ' -f1) - sed -e "s@$passWord_old@$passWord_new@g" -i /opt/mcsmanager/web/data/User/root.json - - echo "[-] 重启 MCSManager-Web 服务..." - systemctl restart mcsm-web.service - - echo "[+] root 密码已更新!" -elif [ "$cmd" == 7 ] -then - Red_Error "[!] 卸载后无法找回数据,请先备份必要数据!" - read -r -p "[-] 确认已了解以上内容,我确定已备份完成 (输入yes继续卸载): " yes; - if [ "$yes" != "yes" ]; then - echo "===============================================" - echo "已取消!" - exit - fi - - echo "[-] MCSManager 服务正在运行,停止服务..." - systemctl stop mcsm-{daemon,web}.service - systemctl disable mcsm-{daemon,web}.service - - echo "[x] 删除 MCSManager 服务" - rm -f /etc/systemd/system/mcsm-daemon.service - rm -f /etc/systemd/system/mcsm-web.service +## Language +if [ "$(echo "$LANG" | grep "zh_CN")" != "" ]; then + zh=1 +else + zh=0 +fi - echo "[-] 重载服务配置文件" - systemctl daemon-reload +### Functions +## Localize echo +# $1: color +# $2: zh +# $3: en +LEcho() { + case $1 in + # Red color echo + red) + [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" + ;; + + # Green color echo + green) + [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" + ;; + + # Cyan color echo + cyan) + [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" + ;; + + # Cyan color echo (No line break) + cyan_n) + [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" + [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" + ;; + + # Yellow color echo + yellow) + [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" + [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" + ;; + + # Red error echo + error) + Clean + echo '=================================================' + [ "$zh" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" + [ "$zh" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" + echo '=================================================' + exit 1 + ;; + + # Debug echo + debug) + [ "$debug" == 1 ] && printf '\033[1;35m%b\033[0m\n' "[DEBUG] $2" + ;; + + # No color echo + *) + [ "$zh" == 1 ] && echo "$2" + [ "$zh" == 0 ] && echo "$3" + ;; + esac + return +} - echo "[x] 删除 MCSManager 相关文件" - rm -irf /opt/mcsmanager +## Check the user is root +CheckRoot() { + if [ "$(whoami)" != "root" ]; then + LEcho error "请使用 root 用户执行此命令" "Please run this command as root" + fi + return +} - echo "[x] 删除 MCSManager-命令行 相关文件" - rm -f /usr/local/bin/mcsm - rm -f /opt/mcsm.sh +## Check mcsmanager installtion status +CheckInstall() { + if [ -d "$daemonPath" ]; then + daemonInstalled=1 + fi + if [ -d "$webPath" ]; then + webInstalled=1 + fi + if [ $daemonInstalled == 1 ] && [ $webInstalled == 0 ] ;then + status=1 + return + elif [ $daemonInstalled == 0 ] && [ $webInstalled == 1 ];then + status=2 + return + elif [ $daemonInstalled == 1 ] && [ $webInstalled == 1 ];then + status=3 + return + fi + LEcho error "[x] MCSManager 已损坏, 请尝试使用修复命令修复环境" "[x] MCSManager is broken, please try to use the repair command to repair the environment" +} - echo "===============================================" - echo -e "\033[1;32m卸载完成,感谢使用 MCSManager!\033[0m" +## Check mcsmanager running status +CheckRun() { + if [ "$(systemctl is-active mcsm-web)" == "active" ];then + webRunning=1 + fi + if [ "$(systemctl is-active mcsm-daemon)" == "active" ];then + daemonRunning=1 + fi + return +} -elif [ "$cmd" == 8 ] -then - systemctl restart mcsm-daemon.service -elif [ "$cmd" == 9 ] -then - systemctl stop mcsm-daemon.service -elif [ "$cmd" == 10 ] -then - systemctl start mcsm-daemon.service -elif [ "$cmd" == 11 ] -then - systemctl disable mcsm-daemon.service -elif [ "$cmd" == 12 ] -then - systemctl enable mcsm-daemon.service -elif [ "$cmd" == 13 ] -then - rm -ifr /opt/mcsmanager/web/logs - mkdir -p /opt/mcsmanager/web/logs - echo "[-] 已清空日志!" -elif [ "$cmd" == 14 ] -then - systemctl restart mcsm-{daemon,web}.service -else - echo "===============================================" - echo "[-] 已取消" -fi +## Check +CheckMCSM() { + CheckInstall + CheckRun +} +## GUI +GUI() { + LEcho yellow "===============================================" "===============================================" + LEcho cyan "MCSManager 命令行 v 1.0 " "MCSManager Command Line Interface v 1.0 " + LEcho yellow "===============================================" "===============================================" + LEcho cyan_n "(1) 启停管理" "(1) Start/Stop Control" + LEcho cyan "(2) 修改管理面板用户名" "(2) Modify the management panel username" + LEcho cyan "(3) 修改管理面板密码" "(3) Modify the management panel password" + LEcho cyan "(4) 修复 MCSManager" "(4) Repair MCSManager" + LEcho cyan "(5) 检查 MCSManager 更新" "(5) Check MCSManager update" + LEcho cyan "(6) 清理 MCSManager 日志" "(6) Clean MCSManager log" + LEcho cyan "(7) 退出" "(7) Exit" + LEcho yellow "===============================================" "===============================================" + LEcho cyan_n "请输入选项: " "Please enter an option: " + read -r option + case $option in + 1) + StartStop + ;; + 2) + ChangeUsername + ;; + 3) + ChangePassword + ;; + 4) + Repair + ;; + 5) + CheckUpdate + ;; + 6) + CleanLog + ;; + 7) + exit 0 + ;; + *) + LEcho error "[x] 无效的选项, 请纠正输入" "[x] Invalid option, please correct the input" + ;; + esac + LEcho error "[x] 未知错误, 请尝试使用修复命令修复环境" "[x] Unknown error, please try to use the repair command to repair the environment" +} +## Start/Stop control +StartStop() { + LEcho yellow "===============================================" "===============================================" + [ $status = 1 ] && LEcho cyan_n "当前 MCSManager 控制面板状态:" "Current MCSManager web panel status:" + [ $webRunning = 0 ] && LEcho red " 已停止" " Stopped" + [ $webRunning = 1 ] && LEcho green " 正在运行中" " Running" + [ $status = 2 ] && LEcho cyan_n "当前 MCSManager 守护程序状态:" "Current MCSManager daemon status:" + [ $daemonRunning = 0 ] && LEcho red " 已停止" " Stopped" + [ $daemonRunning = 1 ] && LEcho green " 正在运行中" " Running" + LEcho yellow "===============================================" "===============================================" + LEcho cyan_n "(1) 启动/重启" "(1) Start / Restart" + [ $status = 1 ] && LEcho cyan "控制面板" "web panel" + [ $status = 2 ] && LEcho cyan "守护程序" "daemon" + [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" + LEcho cyan_n "(2) 停止" "(2) Stop" + [ $status = 1 ] && LEcho cyan "控制面板" "web panel" + [ $status = 2 ] && LEcho cyan "守护程序" "daemon" + [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" + LEcho cyan "(3) 启用" "(3) Enable" + [ $status = 1 ] && LEcho cyan "控制面板" "web panel" + [ $status = 2 ] && LEcho cyan "守护程序" "daemon" + [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" + LEcho cyan "(4) 禁用" "(4) Disable" + [ $status = 1 ] && LEcho cyan "控制面板" "web panel" + [ $status = 2 ] && LEcho cyan "守护程序" "daemon" + [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" + LEcho cyan "(5) 返回" "(4) Back" + LEcho yellow "===============================================" "===============================================" + LEcho cyan_n "请输入选项: " "Please enter an option: " + read -r option + case $option in + 1) + if [ "$status" = 1 ]; then + systemctl restart mcsm-web || LEcho error "[x] 控制面板启动失败" "[x] Web panel start failed" + elif [ "$status" = 2 ]; then + systemctl restart mcsm-daemon || LEcho error "[x] 守护程序启动失败" "[x] Daemon start failed" + elif [ "$status" = 3 ]; then + systemctl restart mcsm-web || LEcho error "[x] 控制面板 & 守护程序启动失败" "[x] Web panel & daemon start failed" + systemctl start mcsm-daemon || LEcho error "[x] 控制面板 & 守护程序启动失败" "[x] Web panel & daemon start failed" + fi + LEcho green "[√] 启动成功" "[√] Start successfully" + sleep 3 + StartStop + ;; + 2) + if [ "$status" = 1 ]; then + systemctl stop mcsm-web || LEcho error "[x] 控制面板停止失败" "[x] Web panel stop failed" + elif [ "$status" = 2 ]; then + systemctl stop mcsm-daemon || LEcho error "[x] 守护程序停止失败" "[x] Daemon stop failed" + elif [ "$status" = 3 ]; then + systemctl stop mcsm-web || LEcho error "[x] 控制面板 & 守护程序停止失败" "[x] Web panel & daemon stop failed" + systemctl stop mcsm-daemon || LEcho error "[x] 控制面板 & 守护程序停止失败" "[x] Web panel & daemon stop failed" + fi + LEcho green "[√] 停止成功" "[√] Stop successfully" + sleep 3 + StartStop + ;; + 3) + if [ "$status" = 1 ]; then + systemctl enable mcsm-web || LEcho error "[x] 控制面板启用失败" "[x] Web panel enable failed" + elif [ "$status" = 2 ]; then + systemctl enable mcsm-daemon || LEcho error "[x] 守护程序启用失败" "[x] Daemon enable failed" + elif [ "$status" = 3 ]; then + systemctl enable mcsm-web || LEcho error "[x] 控制面板 & 守护程序启用失败" "[x] Web panel & daemon enable failed" + systemctl enable mcsm-daemon || LEcho error "[x] 控制面板 & 守护程序启用失败" "[x] Web panel & daemon enable failed" + fi + LEcho green "[√] 启用成功" "[√] Enable successfully" + sleep 3 + StartStop + ;; + 4) + if [ "$status" = 1 ]; then + systemctl disable mcsm-web || LEcho error "[x] 控制面板禁用失败" "[x] Web panel disable failed" + elif [ "$status" = 2 ]; then + systemctl disable mcsm-daemon || LEcho error "[x] 守护程序禁用失败" "[x] Daemon disable failed" + elif [ "$status" = 3 ]; then + systemctl disable mcsm-web && systemctl disable mcsm-daemon || LEcho error "[x] 控制面板 & 守护程序禁用失败" "[x] Web panel & daemon disable failed" + fi + LEcho green "[√] 禁用成功" "[√] Disable successfully" + sleep 3 + StartStop + ;; + 5) + GUI + ;; + *) + LEcho error "[x] 无效的选项, 请纠正输入" "[x] Invalid option, please correct the input" + ;; + esac + LEcho error "[x] 未知错误, 请尝试使用修复命令修复环境" "[x] Unknown error, please try to use the repair command to repair the environment" +} \ No newline at end of file From 36a83b6c10f2d93b2698b514626dd3019bb61f4e Mon Sep 17 00:00:00 2001 From: BlueFunny Date: Thu, 23 Mar 2023 10:09:07 +0800 Subject: [PATCH 051/463] Complete start/stop management function --- cli.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cli.sh b/cli.sh index bfd5bff..83af320 100644 --- a/cli.sh +++ b/cli.sh @@ -74,11 +74,6 @@ LEcho() { exit 1 ;; - # Debug echo - debug) - [ "$debug" == 1 ] && printf '\033[1;35m%b\033[0m\n' "[DEBUG] $2" - ;; - # No color echo *) [ "$zh" == 1 ] && echo "$2" @@ -254,7 +249,8 @@ StartStop() { elif [ "$status" = 2 ]; then systemctl disable mcsm-daemon || LEcho error "[x] 守护程序禁用失败" "[x] Daemon disable failed" elif [ "$status" = 3 ]; then - systemctl disable mcsm-web && systemctl disable mcsm-daemon || LEcho error "[x] 控制面板 & 守护程序禁用失败" "[x] Web panel & daemon disable failed" + systemctl disable mcsm-web || LEcho error "[x] 控制面板 & 守护程序禁用失败" "[x] Web panel & daemon disable failed" + systemctl disable mcsm-daemon || LEcho error "[x] 控制面板 & 守护程序禁用失败" "[x] Web panel & daemon disable failed" fi LEcho green "[√] 禁用成功" "[√] Disable successfully" sleep 3 From e70a839d1c5a22806a782a7e851f03b3963f76f0 Mon Sep 17 00:00:00 2001 From: BlueFunny Date: Thu, 23 Mar 2023 10:23:49 +0800 Subject: [PATCH 052/463] Delete the password change function (this function is not available at this stage) --- cli.sh | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/cli.sh b/cli.sh index 83af320..e0b3f24 100644 --- a/cli.sh +++ b/cli.sh @@ -135,12 +135,10 @@ GUI() { LEcho cyan "MCSManager 命令行 v 1.0 " "MCSManager Command Line Interface v 1.0 " LEcho yellow "===============================================" "===============================================" LEcho cyan_n "(1) 启停管理" "(1) Start/Stop Control" - LEcho cyan "(2) 修改管理面板用户名" "(2) Modify the management panel username" - LEcho cyan "(3) 修改管理面板密码" "(3) Modify the management panel password" - LEcho cyan "(4) 修复 MCSManager" "(4) Repair MCSManager" - LEcho cyan "(5) 检查 MCSManager 更新" "(5) Check MCSManager update" - LEcho cyan "(6) 清理 MCSManager 日志" "(6) Clean MCSManager log" - LEcho cyan "(7) 退出" "(7) Exit" + LEcho cyan "(2) 修复 MCSManager" "(2) Repair MCSManager" + LEcho cyan "(3) 检查 MCSManager 更新" "(3) Check MCSManager update" + LEcho cyan "(4) 清理 MCSManager 日志" "(4) Clean MCSManager log" + LEcho cyan "(5) 退出" "(5) Exit" LEcho yellow "===============================================" "===============================================" LEcho cyan_n "请输入选项: " "Please enter an option: " read -r option @@ -149,21 +147,15 @@ GUI() { StartStop ;; 2) - ChangeUsername - ;; - 3) - ChangePassword - ;; - 4) Repair ;; - 5) + 3) CheckUpdate ;; - 6) + 4) CleanLog ;; - 7) + 5) exit 0 ;; *) @@ -264,4 +256,6 @@ StartStop() { ;; esac LEcho error "[x] 未知错误, 请尝试使用修复命令修复环境" "[x] Unknown error, please try to use the repair command to repair the environment" -} \ No newline at end of file +} + +ChangeUsername \ No newline at end of file From f4825cb50cd8ba65499a980b2d2face71c0914c1 Mon Sep 17 00:00:00 2001 From: BlueFunny Date: Thu, 23 Mar 2023 10:25:07 +0800 Subject: [PATCH 053/463] Fix a hint problem --- cli.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cli.sh b/cli.sh index e0b3f24..3a73444 100644 --- a/cli.sh +++ b/cli.sh @@ -86,7 +86,7 @@ LEcho() { ## Check the user is root CheckRoot() { if [ "$(whoami)" != "root" ]; then - LEcho error "请使用 root 用户执行此命令" "Please run this command as root" + LEcho error "[x] 请使用 root 用户执行此命令" "[x] Please run this command as root" fi return } @@ -258,4 +258,3 @@ StartStop() { LEcho error "[x] 未知错误, 请尝试使用修复命令修复环境" "[x] Unknown error, please try to use the repair command to repair the environment" } -ChangeUsername \ No newline at end of file From 3d6f405d6c7bf554049f7a99ed832b8c58eff988 Mon Sep 17 00:00:00 2001 From: BlueFunny Date: Thu, 23 Mar 2023 11:04:18 +0800 Subject: [PATCH 054/463] Add the function of passing reference to run --- cli.sh | 115 +++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 74 insertions(+), 41 deletions(-) diff --git a/cli.sh b/cli.sh index 3a73444..16db14d 100644 --- a/cli.sh +++ b/cli.sh @@ -83,6 +83,15 @@ LEcho() { return } +Check() { + if [ "$1" != 2 ];then + CheckRoot + CheckInstall + CheckRun + fi + CheckArgs "$1" +} + ## Check the user is root CheckRoot() { if [ "$(whoami)" != "root" ]; then @@ -91,6 +100,29 @@ CheckRoot() { return } +## Check command args +CheckArgs() { + case "${1}" in + 2) + Repair + ;; + 3) + CheckUpdate + ;; + 4) + CleanLog + ;; + 11 | 12 | 13 | 14) + StartStop "$1" + ;; + *) + LEcho error "[x] 无效的参数, 请纠正输入" "[x] Invalid parameter, please correct the input" + ;; + esac + + return +} + ## Check mcsmanager installtion status CheckInstall() { if [ -d "$daemonPath" ]; then @@ -123,12 +155,6 @@ CheckRun() { return } -## Check -CheckMCSM() { - CheckInstall - CheckRun -} - ## GUI GUI() { LEcho yellow "===============================================" "===============================================" @@ -144,7 +170,7 @@ GUI() { read -r option case $option in 1) - StartStop + StartStop $1 ;; 2) Repair @@ -167,36 +193,40 @@ GUI() { ## Start/Stop control StartStop() { - LEcho yellow "===============================================" "===============================================" - [ $status = 1 ] && LEcho cyan_n "当前 MCSManager 控制面板状态:" "Current MCSManager web panel status:" - [ $webRunning = 0 ] && LEcho red " 已停止" " Stopped" - [ $webRunning = 1 ] && LEcho green " 正在运行中" " Running" - [ $status = 2 ] && LEcho cyan_n "当前 MCSManager 守护程序状态:" "Current MCSManager daemon status:" - [ $daemonRunning = 0 ] && LEcho red " 已停止" " Stopped" - [ $daemonRunning = 1 ] && LEcho green " 正在运行中" " Running" - LEcho yellow "===============================================" "===============================================" - LEcho cyan_n "(1) 启动/重启" "(1) Start / Restart" - [ $status = 1 ] && LEcho cyan "控制面板" "web panel" - [ $status = 2 ] && LEcho cyan "守护程序" "daemon" - [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" - LEcho cyan_n "(2) 停止" "(2) Stop" - [ $status = 1 ] && LEcho cyan "控制面板" "web panel" - [ $status = 2 ] && LEcho cyan "守护程序" "daemon" - [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" - LEcho cyan "(3) 启用" "(3) Enable" - [ $status = 1 ] && LEcho cyan "控制面板" "web panel" - [ $status = 2 ] && LEcho cyan "守护程序" "daemon" - [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" - LEcho cyan "(4) 禁用" "(4) Disable" - [ $status = 1 ] && LEcho cyan "控制面板" "web panel" - [ $status = 2 ] && LEcho cyan "守护程序" "daemon" - [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" - LEcho cyan "(5) 返回" "(4) Back" - LEcho yellow "===============================================" "===============================================" - LEcho cyan_n "请输入选项: " "Please enter an option: " - read -r option + if [ "$1" != "" ];then + option=$1 + else + LEcho yellow "===============================================" "===============================================" + [ $status = 1 ] && LEcho cyan_n "当前 MCSManager 控制面板状态:" "Current MCSManager web panel status:" + [ $webRunning = 0 ] && LEcho red " 已停止" " Stopped" + [ $webRunning = 1 ] && LEcho green " 正在运行中" " Running" + [ $status = 2 ] && LEcho cyan_n "当前 MCSManager 守护程序状态:" "Current MCSManager daemon status:" + [ $daemonRunning = 0 ] && LEcho red " 已停止" " Stopped" + [ $daemonRunning = 1 ] && LEcho green " 正在运行中" " Running" + LEcho yellow "===============================================" "===============================================" + LEcho cyan_n "(11) 启动/重启" "(11) Start / Restart" + [ $status = 1 ] && LEcho cyan "控制面板" "web panel" + [ $status = 2 ] && LEcho cyan "守护程序" "daemon" + [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" + LEcho cyan_n "(12) 停止" "(12) Stop" + [ $status = 1 ] && LEcho cyan "控制面板" "web panel" + [ $status = 2 ] && LEcho cyan "守护程序" "daemon" + [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" + LEcho cyan "(13) 启用" "(13) Enable" + [ $status = 1 ] && LEcho cyan "控制面板" "web panel" + [ $status = 2 ] && LEcho cyan "守护程序" "daemon" + [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" + LEcho cyan "(14) 禁用" "(14) Disable" + [ $status = 1 ] && LEcho cyan "控制面板" "web panel" + [ $status = 2 ] && LEcho cyan "守护程序" "daemon" + [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" + LEcho cyan "(15) 返回" "(15) Back" + LEcho yellow "===============================================" "===============================================" + LEcho cyan_n "请输入选项: " "Please enter an option: " + read -r option + fi case $option in - 1) + 11) if [ "$status" = 1 ]; then systemctl restart mcsm-web || LEcho error "[x] 控制面板启动失败" "[x] Web panel start failed" elif [ "$status" = 2 ]; then @@ -209,7 +239,7 @@ StartStop() { sleep 3 StartStop ;; - 2) + 12) if [ "$status" = 1 ]; then systemctl stop mcsm-web || LEcho error "[x] 控制面板停止失败" "[x] Web panel stop failed" elif [ "$status" = 2 ]; then @@ -222,7 +252,7 @@ StartStop() { sleep 3 StartStop ;; - 3) + 13) if [ "$status" = 1 ]; then systemctl enable mcsm-web || LEcho error "[x] 控制面板启用失败" "[x] Web panel enable failed" elif [ "$status" = 2 ]; then @@ -235,7 +265,7 @@ StartStop() { sleep 3 StartStop ;; - 4) + 14) if [ "$status" = 1 ]; then systemctl disable mcsm-web || LEcho error "[x] 控制面板禁用失败" "[x] Web panel disable failed" elif [ "$status" = 2 ]; then @@ -248,8 +278,8 @@ StartStop() { sleep 3 StartStop ;; - 5) - GUI + 15) + GUI "$1" ;; *) LEcho error "[x] 无效的选项, 请纠正输入" "[x] Invalid option, please correct the input" @@ -258,3 +288,6 @@ StartStop() { LEcho error "[x] 未知错误, 请尝试使用修复命令修复环境" "[x] Unknown error, please try to use the repair command to repair the environment" } +### Start +Check "$1" +GUI "$1" \ No newline at end of file From 167aad2615de731a1080dc27723d67ee151ed98c Mon Sep 17 00:00:00 2001 From: BlueFunny Date: Thu, 23 Mar 2023 11:13:58 +0800 Subject: [PATCH 055/463] Updadte --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 9067b5d..6741c00 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ bin-release/ # Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` # should NOT be excluded as they contain compiler settings and other important # information for Eclipse / Flash Builder. + +# Remove old cli sh +cli_old.sh From 5c8bc7e63f0091a9e584b72d8c9906eab96a6bda Mon Sep 17 00:00:00 2001 From: BlueFunny Date: Thu, 23 Mar 2023 11:14:27 +0800 Subject: [PATCH 056/463] Move CLI file location (for later installer download) --- cli.sh => tools/cli.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cli.sh => tools/cli.sh (100%) diff --git a/cli.sh b/tools/cli.sh similarity index 100% rename from cli.sh rename to tools/cli.sh From 0fcfecabf4bba53da7ab5b088a7b65fa35c95cc8 Mon Sep 17 00:00:00 2001 From: BlueFunny Date: Thu, 23 Mar 2023 11:18:13 +0800 Subject: [PATCH 057/463] Deprecated --- setup_cn.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index c7d7b58..b677b9e 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -42,9 +42,6 @@ else zh=0 fi -## Debug -debug=0 - ## Other cn=0 @@ -95,11 +92,6 @@ LEcho() { exit 1 ;; - # Debug echo - debug) - [ "$debug" == 1 ] && printf '\033[1;35m%b\033[0m\n' "[DEBUG] $2" - ;; - # No color echo *) [ "$zh" == 1 ] && echo "$2" From f7502385f82cc07303211a090f973a7c7e1a9f99 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Mon, 24 Apr 2023 14:37:07 +0800 Subject: [PATCH 058/463] Remove the ability to detect local node --- setup_cn.sh | 68 +++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index b677b9e..a850760 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -183,20 +183,21 @@ CheckOS() { apt-get install -y curl git wget jq elif [ "$os" == "redhat" ]; then yum install -y epel-release + yum update yum install -y curl git wget jq fi return } ## Detect nodejs version -CheckNode() { - if command -v node > /dev/null; then - if [ "$(node -v | cut -c2- | awk -F. '{print $1}')" -ge 14 ]; then - return 0 - fi - fi - return 1 -} +# CheckNode() { +# if command -v node > /dev/null; then +# if [ "$(node -v | cut -c2- | awk -F. '{print $1}')" -ge 14 ]; then +# return 0 +# fi +# fi +# return 1 +# } ## Install MCSManager Install() { @@ -207,32 +208,33 @@ Install() { mkdir -p $tmpDir # Install nodejs - if ! CheckNode;then - LEcho cyan "[*] 正在安装 Node.js" "[*] Installing Node.js" - # Download nodejs files - nodeFileURL="$nodeBaseURL/$nodeVer/node-$nodeVer-linux-$arch.tar.gz" - nodeHashURL="$nodeBaseURL/$nodeVer/SHASUMS256.txt" - wget -q --no-check-certificate -O $tmpDir/node.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" - wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" - - # Check nodejs files - if [ "$(sha256sum $tmpDir/node.tar.gz | cut -d ' ' -f 1)" != "$(grep "node-$nodeVer-linux-$arch.tar.gz" $tmpDir/node.sha256 | cut -d ' ' -f 1)" ]; then - LEcho error "[x] Node.js 安装包校验失败, 请重试" "[x] Node.js installation package verification failed, please try again" - fi - - # Install nodejs - [ -d $nodePath ] && rm -rf $nodePath - mkdir -p $nodePath - tar -xzf "$tmpDir/node.tar.gz" -C $nodePath --strip-components=1 - - if ! command -v $nodeBin ; then - LEcho error "[x] Node.js 安装失败, 请重试" "[x] Node.js installation failed, please try again" - fi - else - LEcho cyan "[-] 检测到已安装 Node.js, 跳过安装" "[-] Detected installed Node.js, skip installation" - nodeBin="$(which node)" - npmBin="$(which npm)" + # if ! CheckNode;then + LEcho cyan "[*] 正在安装 Node.js" "[*] Installing Node.js" + # Download nodejs files + nodeFileURL="$nodeBaseURL/$nodeVer/node-$nodeVer-linux-$arch.tar.gz" + nodeHashURL="$nodeBaseURL/$nodeVer/SHASUMS256.txt" + wget -q --no-check-certificate -O $tmpDir/node.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" + wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" + + # Check nodejs files + if [ "$(sha256sum $tmpDir/node.tar.gz | cut -d ' ' -f 1)" != "$(grep "node-$nodeVer-linux-$arch.tar.gz" $tmpDir/node.sha256 | cut -d ' ' -f 1)" ]; then + LEcho error "[x] Node.js 安装包校验失败, 请重试" "[x] Node.js installation package verification failed, please try again" + fi + + # Install nodejs + [ -d $nodePath ] && rm -rf $nodePath + mkdir -p $nodePath + tar -xzf "$tmpDir/node.tar.gz" -C $nodePath --strip-components=1 + + if ! command -v $nodeBin ; then + LEcho error "[x] Node.js 安装失败, 请重试" "[x] Node.js installation failed, please try again" fi + # else + # LEcho cyan "[-] 检测到已安装 Node.js, 跳过安装" "[-] Detected installed Node.js, skip installation" + # nodeBin="$(which node)" + # npmBin="$(which npm)" + # fi + LEcho yellow "===============================================" "===============================================" LEcho cyan "Node.js 版本: $($nodeBin --version)" "Node.js version: $($nodeBin --version)" From f5aa6de1372f7168de921963d5c8e388fee1cd0a Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Mon, 24 Apr 2023 14:50:24 +0800 Subject: [PATCH 059/463] Modify mirror source priority --- setup_cn.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index a850760..4abb2b1 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -29,11 +29,11 @@ mode="install" ## URLs # Node.js -nodeBaseURL="https://nodejs.org/dist" +nodeBaseURL="https://npmmirror.com/mirrors/node" # MCSManager -daemonURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" -webURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" +daemonURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" +webURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" ## Language if [ "$(echo "$LANG" | grep "zh_CN")" != "" ]; then @@ -44,6 +44,7 @@ fi ## Other cn=0 +mirror=0 ### Functions ## Localize echo @@ -118,11 +119,13 @@ CheckRoot() { CheckCN() { LEcho cyan "[*] 正在检查服务器地理位置" "[*] Checking server location" server_ip=$(curl -s ifconfig.me) - if [[ "$(curl -s "http://ip-api.com/json/${server_ip}?fields=countryCode" | jq -r '.countryCode')" == "CN" ]]; then - LEcho yellow "[!] 根据 'ip-api.com' 提供的信息, 当前服务器可能在中国, 已自动切换为中国镜像源" "[!] According to the information provided by 'ipapi.co', the current server IP may be in China, and the Chinese mirror source has been automatically switched" - daemonURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" - webURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" - nodeBaseURL="https://npmmirror.com/mirrors/node" + [ "$(curl -s --connect-timeout 10 "http://ip-api.com/json/${server_ip}?fields=countryCode" | jq -r '.countryCode')" != "CN" ] && mirror=0 + [ "$(curl -s --connect-timeout 10 "https://ipapi.co/${server_ip}/country_code/" | grep "CN")" == "" ] && mirror=0 + if [ "$mirror" == "0" ]; then + LEcho yellow "[!] 根据 API 提供的信息, 当前服务器可能在国外, 已自动切换为 GitHub 源" "[!] According to the information provided by the API, the current server may be outside China, and the GitHub source has been automatically switched" + daemonURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" + webURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" + nodeBaseURL="https://nodejs.org/dist" cn=1 fi return From b639d28bbcca03f30fc621833bbcb209bbd95a25 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Mon, 24 Apr 2023 14:59:25 +0800 Subject: [PATCH 060/463] Sync fork --- setup_en.sh | 264 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 264 insertions(+) create mode 100644 setup_en.sh diff --git a/setup_en.sh b/setup_en.sh new file mode 100644 index 0000000..7f7dc35 --- /dev/null +++ b/setup_en.sh @@ -0,0 +1,264 @@ +#!/bin/bash +printf "\033c" + +error="" +node="v14.19.1" +arch=$(uname -m) +mcsmanager_install_path="/opt/mcsmanager" + +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} + +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} + +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} + +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} + +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +Install_Node() { + echo_cyan_n "[+] Install Node environment... " + + rm -irf "$node_install_path" + + cd /opt || exit + + wget -o /dev/null https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz + + tar -zxf node-"$node"-linux-"$arch".tar.gz + + rm -rf node-"$node"-linux-"$arch".tar.gz + + if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] + then + echo_green "Success" + else + echo_red "Failed" + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node Version ===============" + echo + + sleep 3 +} + +Install_MCSManager() { + echo_cyan "[+] Install MCSManager..." + + # delete service + rm -f /etc/systemd/system/mcsm-daemon.service + rm -f /etc/systemd/system/mcsm-web.service + + # reload + systemctl daemon-reload + + # echo "[x] Delete the original MCSManager" + rm -irf ${mcsmanager_install_path} + + # echo "[+] mkdir -p ${mcsmanager_install_path}" + mkdir -p ${mcsmanager_install_path} || exit + + # echo "[→] cd ${mcsmanager_install_path}" + cd ${mcsmanager_install_path} || exit + + echo_cyan "[↓] Git clone MCSManager-Daemon..." + git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Daemon-Production.git daemon + + # echo "[→] cd daemon" + cd daemon || exit + + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com > error + + # echo "[←] cd .." + cd .. + + echo_cyan "[↓] Git clone MCSManager-Web..." + git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Web-Production.git web + + # echo "[→] cd web" + cd web || exit + + echo_cyan "[+] Install MCSManager-Web dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com > error + + echo + echo_yellow "=============== MCSManager ===============" + echo_green " Daemon: ${mcsmanager_install_path}/daemon" + echo_green " Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" + + sleep 3 +} + +Create_Service() { + echo_cyan "[+] Create MCSManager service..." + + echo " +[Unit] +Description=MCSManager Daemon + +[Service] +WorkingDirectory=/opt/mcsmanager/daemon +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +[Install] +WantedBy=multi-user.target +" > /etc/systemd/system/mcsm-daemon.service + + echo " +[Unit] +Description=MCSManager Web + +[Service] +WorkingDirectory=/opt/mcsmanager/web +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +[Install] +WantedBy=multi-user.target +" > /etc/systemd/system/mcsm-web.service + + systemctl daemon-reload + systemctl enable mcsm-daemon.service --now + systemctl enable mcsm-web.service --now + + sleep 3 + + printf "\033c" + echo_yellow "==================================================================" + echo_green "Welcome to MCSManager, you can access it by the following ways:" + echo_yellow "==================================================================" + echo_cyan_n "Daemon Service Address: "; echo_yellow "http://localhost:24444" + echo_cyan_n "Web Service Address: "; echo_yellow "http://localhost:23333" + echo_cyan_n "Username: "; echo_yellow "root" + echo_cyan_n "Password: "; echo_yellow "123456" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow "==================================================================" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_cyan "systemctl disable mcsm-{daemon,web}.service" + echo_cyan "systemctl enable mcsm-{daemon,web}.service" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "More info: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" + + +} + + +# ----------------- Program Start ----------------- + +# delete the shell script itself +rm -f "$0" + +# Check execute user permissions +if [ "$(whoami)" != "root" ]; then + Red_Error "[x] Please execute the MCSManager installation command with root permission!" +fi + +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +| Copyright © 2022 MCSManager All rights reserved. ++---------------------------------------------------------------------- +| Shell Install Script by Nuomiaa & CreeperKong ++---------------------------------------------------------------------- +" + +# Environmental inspection +if [ "$arch" == x86_64 ]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [ $arch == aarch64 ]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [ $arch == arm ]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [ $arch == ppc64le ]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [ $arch == s390x ]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + Red_Error "[x] Sorry, this architecture is not supported yet!" + exit +fi + +# Define the variable Node installation directory +node_install_path="/opt/node-$node-linux-$arch" + +# Check network connection +echo_cyan "[-] Architecture: $arch" + +# MCSManager Installed +if [ -d "$mcsmanager_install_path" ]; then + printf "\033c" + echo_red "---------------------------------------------------- +MCSManager is installed at \"$mcsmanager_install_path\" +Continuing the installation will delete the original MCSManager! +---------------------------------------------------- +Installation will continue in 10 seconds, press Ctrl + Z/C to cancel!" + sleep 10 +fi + +# Install related software +echo_cyan_n "[+] Installing dependent software(git,tar)... " +if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; +elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; +elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; +elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; +fi + +# Determine whether the relevant software is installed successfully +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] + then + echo_green "Success" + else + echo_red "Failed" + echo "$error" + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" + exit +fi + + +# Install the Node environment +Install_Node + +# Install MCSManager +Install_MCSManager + +# Create MCSManager background service +Create_Service + From c93ad48fd97c0f0ef8fb7403b8bbc8734fb68027 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Mon, 24 Apr 2023 15:05:06 +0800 Subject: [PATCH 061/463] Exclude this file for now --- tools/cli.sh | 293 --------------------------------------------------- 1 file changed, 293 deletions(-) delete mode 100644 tools/cli.sh diff --git a/tools/cli.sh b/tools/cli.sh deleted file mode 100644 index 16db14d..0000000 --- a/tools/cli.sh +++ /dev/null @@ -1,293 +0,0 @@ -#!/usr/bin/env bash - -#### MCSManager Command Line Interface -#### Made by BlueFunny - -#### Copyright © 2023 MCSManager All rights reserved. - -### Variables -## Files -mcsmPath="/opt/mcsmanager" -daemonPath="$mcsmPath/daemon" -webPath="$mcsmPath/web" - -## Installed status -daemonInstalled=0 -webInstalled=0 -status=0 - -## Running status -daemonRunning=0 -webRunning=0 - -## Language -if [ "$(echo "$LANG" | grep "zh_CN")" != "" ]; then - zh=1 -else - zh=0 -fi - -### Functions -## Localize echo -# $1: color -# $2: zh -# $3: en -LEcho() { - case $1 in - # Red color echo - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - - # Green color echo - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - - # Cyan color echo - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - - # Cyan color echo (No line break) - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - - # Yellow color echo - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - - # Red error echo - error) - Clean - echo '=================================================' - [ "$zh" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "$zh" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - - # No color echo - *) - [ "$zh" == 1 ] && echo "$2" - [ "$zh" == 0 ] && echo "$3" - ;; - esac - return -} - -Check() { - if [ "$1" != 2 ];then - CheckRoot - CheckInstall - CheckRun - fi - CheckArgs "$1" -} - -## Check the user is root -CheckRoot() { - if [ "$(whoami)" != "root" ]; then - LEcho error "[x] 请使用 root 用户执行此命令" "[x] Please run this command as root" - fi - return -} - -## Check command args -CheckArgs() { - case "${1}" in - 2) - Repair - ;; - 3) - CheckUpdate - ;; - 4) - CleanLog - ;; - 11 | 12 | 13 | 14) - StartStop "$1" - ;; - *) - LEcho error "[x] 无效的参数, 请纠正输入" "[x] Invalid parameter, please correct the input" - ;; - esac - - return -} - -## Check mcsmanager installtion status -CheckInstall() { - if [ -d "$daemonPath" ]; then - daemonInstalled=1 - fi - if [ -d "$webPath" ]; then - webInstalled=1 - fi - if [ $daemonInstalled == 1 ] && [ $webInstalled == 0 ] ;then - status=1 - return - elif [ $daemonInstalled == 0 ] && [ $webInstalled == 1 ];then - status=2 - return - elif [ $daemonInstalled == 1 ] && [ $webInstalled == 1 ];then - status=3 - return - fi - LEcho error "[x] MCSManager 已损坏, 请尝试使用修复命令修复环境" "[x] MCSManager is broken, please try to use the repair command to repair the environment" -} - -## Check mcsmanager running status -CheckRun() { - if [ "$(systemctl is-active mcsm-web)" == "active" ];then - webRunning=1 - fi - if [ "$(systemctl is-active mcsm-daemon)" == "active" ];then - daemonRunning=1 - fi - return -} - -## GUI -GUI() { - LEcho yellow "===============================================" "===============================================" - LEcho cyan "MCSManager 命令行 v 1.0 " "MCSManager Command Line Interface v 1.0 " - LEcho yellow "===============================================" "===============================================" - LEcho cyan_n "(1) 启停管理" "(1) Start/Stop Control" - LEcho cyan "(2) 修复 MCSManager" "(2) Repair MCSManager" - LEcho cyan "(3) 检查 MCSManager 更新" "(3) Check MCSManager update" - LEcho cyan "(4) 清理 MCSManager 日志" "(4) Clean MCSManager log" - LEcho cyan "(5) 退出" "(5) Exit" - LEcho yellow "===============================================" "===============================================" - LEcho cyan_n "请输入选项: " "Please enter an option: " - read -r option - case $option in - 1) - StartStop $1 - ;; - 2) - Repair - ;; - 3) - CheckUpdate - ;; - 4) - CleanLog - ;; - 5) - exit 0 - ;; - *) - LEcho error "[x] 无效的选项, 请纠正输入" "[x] Invalid option, please correct the input" - ;; - esac - LEcho error "[x] 未知错误, 请尝试使用修复命令修复环境" "[x] Unknown error, please try to use the repair command to repair the environment" -} - -## Start/Stop control -StartStop() { - if [ "$1" != "" ];then - option=$1 - else - LEcho yellow "===============================================" "===============================================" - [ $status = 1 ] && LEcho cyan_n "当前 MCSManager 控制面板状态:" "Current MCSManager web panel status:" - [ $webRunning = 0 ] && LEcho red " 已停止" " Stopped" - [ $webRunning = 1 ] && LEcho green " 正在运行中" " Running" - [ $status = 2 ] && LEcho cyan_n "当前 MCSManager 守护程序状态:" "Current MCSManager daemon status:" - [ $daemonRunning = 0 ] && LEcho red " 已停止" " Stopped" - [ $daemonRunning = 1 ] && LEcho green " 正在运行中" " Running" - LEcho yellow "===============================================" "===============================================" - LEcho cyan_n "(11) 启动/重启" "(11) Start / Restart" - [ $status = 1 ] && LEcho cyan "控制面板" "web panel" - [ $status = 2 ] && LEcho cyan "守护程序" "daemon" - [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" - LEcho cyan_n "(12) 停止" "(12) Stop" - [ $status = 1 ] && LEcho cyan "控制面板" "web panel" - [ $status = 2 ] && LEcho cyan "守护程序" "daemon" - [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" - LEcho cyan "(13) 启用" "(13) Enable" - [ $status = 1 ] && LEcho cyan "控制面板" "web panel" - [ $status = 2 ] && LEcho cyan "守护程序" "daemon" - [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" - LEcho cyan "(14) 禁用" "(14) Disable" - [ $status = 1 ] && LEcho cyan "控制面板" "web panel" - [ $status = 2 ] && LEcho cyan "守护程序" "daemon" - [ $status = 3 ] && LEcho cyan "控制面板 & 守护程序" "web panel & daemon" - LEcho cyan "(15) 返回" "(15) Back" - LEcho yellow "===============================================" "===============================================" - LEcho cyan_n "请输入选项: " "Please enter an option: " - read -r option - fi - case $option in - 11) - if [ "$status" = 1 ]; then - systemctl restart mcsm-web || LEcho error "[x] 控制面板启动失败" "[x] Web panel start failed" - elif [ "$status" = 2 ]; then - systemctl restart mcsm-daemon || LEcho error "[x] 守护程序启动失败" "[x] Daemon start failed" - elif [ "$status" = 3 ]; then - systemctl restart mcsm-web || LEcho error "[x] 控制面板 & 守护程序启动失败" "[x] Web panel & daemon start failed" - systemctl start mcsm-daemon || LEcho error "[x] 控制面板 & 守护程序启动失败" "[x] Web panel & daemon start failed" - fi - LEcho green "[√] 启动成功" "[√] Start successfully" - sleep 3 - StartStop - ;; - 12) - if [ "$status" = 1 ]; then - systemctl stop mcsm-web || LEcho error "[x] 控制面板停止失败" "[x] Web panel stop failed" - elif [ "$status" = 2 ]; then - systemctl stop mcsm-daemon || LEcho error "[x] 守护程序停止失败" "[x] Daemon stop failed" - elif [ "$status" = 3 ]; then - systemctl stop mcsm-web || LEcho error "[x] 控制面板 & 守护程序停止失败" "[x] Web panel & daemon stop failed" - systemctl stop mcsm-daemon || LEcho error "[x] 控制面板 & 守护程序停止失败" "[x] Web panel & daemon stop failed" - fi - LEcho green "[√] 停止成功" "[√] Stop successfully" - sleep 3 - StartStop - ;; - 13) - if [ "$status" = 1 ]; then - systemctl enable mcsm-web || LEcho error "[x] 控制面板启用失败" "[x] Web panel enable failed" - elif [ "$status" = 2 ]; then - systemctl enable mcsm-daemon || LEcho error "[x] 守护程序启用失败" "[x] Daemon enable failed" - elif [ "$status" = 3 ]; then - systemctl enable mcsm-web || LEcho error "[x] 控制面板 & 守护程序启用失败" "[x] Web panel & daemon enable failed" - systemctl enable mcsm-daemon || LEcho error "[x] 控制面板 & 守护程序启用失败" "[x] Web panel & daemon enable failed" - fi - LEcho green "[√] 启用成功" "[√] Enable successfully" - sleep 3 - StartStop - ;; - 14) - if [ "$status" = 1 ]; then - systemctl disable mcsm-web || LEcho error "[x] 控制面板禁用失败" "[x] Web panel disable failed" - elif [ "$status" = 2 ]; then - systemctl disable mcsm-daemon || LEcho error "[x] 守护程序禁用失败" "[x] Daemon disable failed" - elif [ "$status" = 3 ]; then - systemctl disable mcsm-web || LEcho error "[x] 控制面板 & 守护程序禁用失败" "[x] Web panel & daemon disable failed" - systemctl disable mcsm-daemon || LEcho error "[x] 控制面板 & 守护程序禁用失败" "[x] Web panel & daemon disable failed" - fi - LEcho green "[√] 禁用成功" "[√] Disable successfully" - sleep 3 - StartStop - ;; - 15) - GUI "$1" - ;; - *) - LEcho error "[x] 无效的选项, 请纠正输入" "[x] Invalid option, please correct the input" - ;; - esac - LEcho error "[x] 未知错误, 请尝试使用修复命令修复环境" "[x] Unknown error, please try to use the repair command to repair the environment" -} - -### Start -Check "$1" -GUI "$1" \ No newline at end of file From 563a6e72e526a224ef2b76cbc9600a3d089306dc Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 15 May 2023 14:13:50 +0800 Subject: [PATCH 062/463] Update setup_cn.sh --- setup_cn.sh | 649 ++++++++++++++++++++++++++-------------------------- 1 file changed, 324 insertions(+), 325 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index 4abb2b1..9c4e4d3 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1,378 +1,377 @@ -#!/usr/bin/env bash +#!/bin/bash -#### MCSManager Installer -#### Made by BlueFunny -#### Originally written by nuomiaa, CreeperKong, unitwk +#### MCSManager Command Line Interface +#### Made by nuomiaa, CreeperKong, unitwk #### Copyright © 2023 MCSManager All rights reserved. -### Variables -## Files -# MCSManager -mcsmPath="/opt/mcsmanager" -daemonPath="$mcsmPath/daemon" -webPath="$mcsmPath/web" +printf "\033c" -# Node.js -nodePath="$mcsmPath/node" -nodeBin="$nodePath/bin/node" -npmBin="$nodeBin $nodePath/bin/npm" +error="" +node="v14.19.1" +arch=$(uname -m) +mcsmanager_install_path="/opt/mcsmanager" +zh=$( + [[ $(locale -a) =~ "zh" ]] && echo 1 + export LANG=zh_CN.UTF-8 || echo 0 +) -# Junk -tmpDir="/tmp/mcsmanager" - -## Node info -nodeVer="v16.13.0" +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} -## Install mode -mode="install" +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} -## URLs -# Node.js -nodeBaseURL="https://npmmirror.com/mirrors/node" +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} -# MCSManager -daemonURL="https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git" -webURL="https://gitee.com/mcsmanager/MCSManager-Web-Production.git" +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} -## Language -if [ "$(echo "$LANG" | grep "zh_CN")" != "" ]; then - zh=1 -else - zh=0 -fi +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} -## Other -cn=0 -mirror=0 - -### Functions -## Localize echo -# $1: color -# $2: zh -# $3: en -LEcho() { - case $1 in - # Red color echo - red) - [ "${zh}" == 1 ] && printf '\033[1;31m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;31m%b\033[0m\n' "$3" - ;; - - # Green color echo - green) - [ "${zh}" == 1 ] && printf '\033[1;32m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;32m%b\033[0m\n' "$3" - ;; - - # Cyan color echo - cyan) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m\n' "$3" - ;; - - # Cyan color echo (No line break) - cyan_n) - [ "${zh}" == 1 ] && printf '\033[1;36m%b\033[0m' "$2" - [ "${zh}" == 0 ] && printf '\033[1;36m%b\033[0m' "$3" - ;; - - # Yellow color echo - yellow) - [ "${zh}" == 1 ] && printf '\033[1;33m%b\033[0m\n' "$2" - [ "${zh}" == 0 ] && printf '\033[1;33m%b\033[0m\n' "$3" - ;; - - # Red error echo - error) - Clean - echo '=================================================' - [ "$zh" == 1 ] && printf '\033[1;31;40m%b\033[0m\n' "$2" - [ "$zh" == 0 ] && printf '\033[1;31;40m%b\033[0m\n' "$3" - echo '=================================================' - exit 1 - ;; - - # No color echo - *) - [ "$zh" == 1 ] && echo "$2" - [ "$zh" == 0 ] && echo "$3" - ;; - esac - return +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" } -# Detect old MCSManager -[ -d $mcsmPath ] && LEcho yellow "[!] 检测到旧版 MCSManager, 切换为更新模式" "[!] Old version of MCSManager detected, switch to update mode" -[ -d $mcsmPath ] && mode="update" -[ ! -d $mcsmPath ] && mkdir -p $mcsmPath +Install_Node() { + if [ "$zh" == 1 ]; then + echo_cyan_n "[+] 安装 Node 环境... " + else + echo_cyan_n "[+] Install Node environment... " + fi + + rm -irf "$node_install_path" + + cd /opt || exit -## Check root -CheckRoot() { - if [[ $EUID -ne 0 ]]; then - LEcho error "[!] 请使用 root 用户运行此脚本" "[!] Please run this script as root" + wget -o /dev/null https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz + + tar -zxf node-"$node"-linux-"$arch".tar.gz + + rm -rf node-"$node"-linux-"$arch".tar.gz + + if [ ! -L /usr/bin/node ] && [ ! -f /usr/bin/node ]; then + ln -s "$node_install_path"/bin/node /usr/bin/node fi - return -} + if [ ! -L /usr/bin/npm ] && [ ! -f /usr/bin/npm ]; then + ln -s "$node_install_path"/bin/npm /usr/bin/npm + fi + + chmod +x "$node_install_path"/bin/node + chmod +x "$node_install_path"/bin/npm -## Detect server geographic location -CheckCN() { - LEcho cyan "[*] 正在检查服务器地理位置" "[*] Checking server location" - server_ip=$(curl -s ifconfig.me) - [ "$(curl -s --connect-timeout 10 "http://ip-api.com/json/${server_ip}?fields=countryCode" | jq -r '.countryCode')" != "CN" ] && mirror=0 - [ "$(curl -s --connect-timeout 10 "https://ipapi.co/${server_ip}/country_code/" | grep "CN")" == "" ] && mirror=0 - if [ "$mirror" == "0" ]; then - LEcho yellow "[!] 根据 API 提供的信息, 当前服务器可能在国外, 已自动切换为 GitHub 源" "[!] According to the information provided by the API, the current server may be outside China, and the GitHub source has been automatically switched" - daemonURL="https://github.com/mcsmanager/MCSManager-Daemon-Production.git" - webURL="https://github.com/mcsmanager/MCSManager-Web-Production.git" - nodeBaseURL="https://nodejs.org/dist" - cn=1 + if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ]; then + if [ "$zh" == 1 ]; then + echo_green "成功" + else + echo_green "Success" + fi + else + if [ "$zh" == 1 ]; then + echo_red "失败" + Red_Error "[x] Node 安装失败!" + else + echo_red "Failed" + Red_Error "[x] Node installation failed!" + fi fi - return -} -## Detect system architecture -CheckArch() { - LEcho cyan "[*] 正在检查系统架构" "[*] Checking system architecture" - arch=$(uname -m) - case $arch in - x86_64) - arch="x64" - ;; - aarch64) - arch="arm64" - ;; - arm) - arch="armv7l" - ;; - ppc64le) - arch="ppc64le" - ;; - s390x) - arch="s390x" - ;; - *) - LEcho error "[x] MCSManager 暂不支持当前系统架构" "[x] MCSManager does not currently support the current system architecture" - ;; - esac - return + echo + echo_yellow "=============== Node Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node Version ===============" + echo + + sleep 3 } -## Detect system version -CheckOS() { - LEcho cyan "[*] 正在检查系统版本" "[*] Checking system version" - if [ -f /etc/os-release ]; then - # shellcheck source=/dev/null - . /etc/os-release - case "$ID" in - debian|ubuntu) - os="debian" - ;; - centos|rhel|fedora) - os="redhat" - ;; - *) - LEcho error "[x] 本脚本仅支持 Ubuntu/Debian/CentOS 系统!" "[x] This script only supports Ubuntu/Debian/CentOS systems!" - ;; - esac +Install_MCSManager() { + if [ "$zh" == 1 ]; then + echo_cyan "[+] 安装 MCSManager..." + else + echo_cyan "[+] Install MCSManager..." + fi + + # 删除服务 + rm -f /etc/systemd/system/mcsm-daemon.service + rm -f /etc/systemd/system/mcsm-web.service + + # 重载 + systemctl daemon-reload + + # echo "[x] Delete the original MCSManager" + rm -irf ${mcsmanager_install_path} + + # echo "[+] mkdir -p ${mcsmanager_install_path}" + mkdir -p ${mcsmanager_install_path} || exit + + # echo "[→] cd ${mcsmanager_install_path}" + cd ${mcsmanager_install_path} || exit + + if [ "$zh" == 1 ]; then + echo_cyan "[↓] Git 克隆 MCSManager-Daemon..." else - LEcho error "[x] 未能正常检测到系统类型, 无法继续安装" "[x] Unable to detect system type, installation cannot continue" + echo_cyan "[↓] Git clone MCSManager-Daemon..." fi - - # Install dependencies - LEcho cyan "[*] 正在安装安装所需的工具" "[*] Installing the tools required for installation" - if [ "$os" == "debian" ]; then - apt-get update - apt-get install -y curl git wget jq - elif [ "$os" == "redhat" ]; then - yum install -y epel-release - yum update - yum install -y curl git wget jq + git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git daemon + + # echo "[→] cd daemon" + cd daemon || exit + + if [ "$zh" == 1 ]; then + echo_cyan "[+] 安装 MCSManager-Daemon 依赖库..." + else + echo_cyan "[+] Install MCSManager-Daemon dependencies..." fi - return -} + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com >error -## Detect nodejs version -# CheckNode() { -# if command -v node > /dev/null; then -# if [ "$(node -v | cut -c2- | awk -F. '{print $1}')" -ge 14 ]; then -# return 0 -# fi -# fi -# return 1 -# } - -## Install MCSManager -Install() { - clear - LEcho cyan "[-] 开始安装 MCSManager" "[-] Start installing MCSManager" - # Init work environment - LEcho cyan "[*] 正在初始化工作环境" "[*] Initializing work environment" - mkdir -p $tmpDir - - # Install nodejs - # if ! CheckNode;then - LEcho cyan "[*] 正在安装 Node.js" "[*] Installing Node.js" - # Download nodejs files - nodeFileURL="$nodeBaseURL/$nodeVer/node-$nodeVer-linux-$arch.tar.gz" - nodeHashURL="$nodeBaseURL/$nodeVer/SHASUMS256.txt" - wget -q --no-check-certificate -O $tmpDir/node.tar.gz "$nodeFileURL" || LEcho error "[x] 下载 Node.js 安装包失败, 请重试" "[x] Download Node.js installation package failed, please try again" - wget -q --no-check-certificate -O $tmpDir/node.sha256 "$nodeHashURL" || LEcho error "[x] 下载 Node.js 安装包校验文件失败, 请重试" "[x] Download Node.js installation package verification file failed, please try again" - - # Check nodejs files - if [ "$(sha256sum $tmpDir/node.tar.gz | cut -d ' ' -f 1)" != "$(grep "node-$nodeVer-linux-$arch.tar.gz" $tmpDir/node.sha256 | cut -d ' ' -f 1)" ]; then - LEcho error "[x] Node.js 安装包校验失败, 请重试" "[x] Node.js installation package verification failed, please try again" + # echo "[←] cd .." + cd .. + + if [ "$zh" == 1 ]; then + echo_cyan "[↓] Git 克隆 MCSManager-Web..." + else + echo_cyan "[↓] Git clone MCSManager-Web..." fi - - # Install nodejs - [ -d $nodePath ] && rm -rf $nodePath - mkdir -p $nodePath - tar -xzf "$tmpDir/node.tar.gz" -C $nodePath --strip-components=1 - - if ! command -v $nodeBin ; then - LEcho error "[x] Node.js 安装失败, 请重试" "[x] Node.js installation failed, please try again" + git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Web-Production.git web + + # echo "[→] cd web" + cd web || exit + + if [ "$zh" == 1 ]; then + echo_cyan "[+] 安装 MCSManager-Web 依赖库..." + else + echo_cyan "[+] Install MCSManager-Web dependencies..." fi - # else - # LEcho cyan "[-] 检测到已安装 Node.js, 跳过安装" "[-] Detected installed Node.js, skip installation" - # nodeBin="$(which node)" - # npmBin="$(which npm)" - # fi - - - LEcho yellow "===============================================" "===============================================" - LEcho cyan "Node.js 版本: $($nodeBin --version)" "Node.js version: $($nodeBin --version)" - LEcho cyan "NPM 版本: $($npmBin -v)" "NPM version: $($npmBin -v)" - LEcho yellow "===============================================" "===============================================" - - # Install MCSManager - if [ $mode == "update" ];then - LEcho cyan "[*] 正在更新 MCSManager 前端管理面板" "[*] Updating MCSManager web panel" - - cd $webPath || LEcho error "[x] 无法进入 MCSManager 前端管理面板目录, 请检查权限" "[x] Unable to enter MCSManager web panel directory, please check permissions" - - # Clone MCSManager web panel - git remote set-url origin $webURL - git fetch origin - git checkout master - git reset --hard origin/master - git pull - - LEcho cyan "[*] 正在更新 MCSManager 守护程序" "[*] Updating MCSManager daemon" - - cd $daemonPath || LEcho error "[x] 无法进入 MCSManager 守护程序目录, 请检查权限" "[x] Unable to enter MCSManager daemon directory, please check permissions" - - # Clone MCSManager daemon - git remote set-url origin $daemonURL - git fetch origin - git checkout master - git reset --hard origin/master - git pull + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com >error + + echo + echo_yellow "=============== MCSManager ===============" + echo_green " Daemon: ${mcsmanager_install_path}/daemon" + echo_green " Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + if [ "$zh" == 1 ]; then + echo_green "[+] MCSManager 安装成功!" else - # Clone MCSManager web panel - LEcho cyan "[*] 正在安装 MCSManager 前端管理面板" "[*] Installing MCSManager web panel" - git clone --single-branch -b master --depth 1 $webURL $webPath - - # Clone MCSManager daemon - LEcho cyan "[*] 正在安装 MCSManager 守护程序" "[*] Installing MCSManager web panel" - git clone --single-branch -b master --depth 1 $daemonURL $daemonPath + echo_green "[+] MCSManager installation success!" fi - # Update dependencies - LEcho cyan "[*] 正在更新依赖" "[*] Updating dependencies" - cd $webPath || LEcho error "[x] 无法进入 MCSManager 前端管理目录, 请检查权限" "[x] Unable to enter MCSManager web panel directory, please check permissions" - [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com - [ $cn == 0 ] && $npmBin install - cd $daemonPath || LEcho error "[x] 无法进入 MCSManager 守护程序目录, 请检查权限" "[x] Unable to enter MCSManager daemon directory, please check permissions" - [ $cn == 1 ] && $npmBin install --registry=https://registry.npmmirror.com - [ $cn == 0 ] && $npmBin install - - # Create systemd service - LEcho cyan "[*] 正在创建 systemd 服务" "[*] Creating systemd service" - - webExecStart="\"$nodeBin\" \"$webPath/app.js\"" - daemonExecStart="\"$nodeBin\" \"$daemonPath/app.js\"" - cat > /etc/systemd/system/mcsm-web.service << EOF + + sleep 3 +} + +Create_Service() { + if [ "$zh" == 1 ]; then + echo_cyan "[+] 创建 MCSManager 服务..." + else + echo_cyan "[+] Create MCSManager service..." + fi + + echo " [Unit] -Description=MCSManager Web Panel Service -After=network.target +Description=MCSManager Daemon [Service] -User=root -WorkingDirectory=$webPath -ExecStart=$webExecStart +WorkingDirectory=/opt/mcsmanager/daemon +ExecStart=${node_install_path}/bin/node app.js ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID Environment=\"PATH=${PATH}\" -Restart=always [Install] WantedBy=multi-user.target -EOF - cat > /etc/systemd/system/mcsm-daemon.service << EOF +" >/etc/systemd/system/mcsm-daemon.service + + echo " [Unit] -Description=MCSManager Daemon Service -After=network.target +Description=MCSManager Web [Service] -User=root -WorkingDirectory=$daemonPath -ExecStart=$daemonExecStart +WorkingDirectory=/opt/mcsmanager/web +ExecStart=${node_install_path}/bin/node app.js ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID Environment=\"PATH=${PATH}\" -Restart=always [Install] WantedBy=multi-user.target -EOF - # Enable systemd service - LEcho cyan "[*] 正在启动 MCSManager 服务" "[*] Starting MCSManager services" +" >/etc/systemd/system/mcsm-web.service + + # 重载 systemctl daemon-reload - if [ $mode == "update" ];then - systemctl restart mcsm-web || LEcho error "[x] 无法启动 MCSManager 前端管理面板服务" "[x] Unable to start MCSManager web panel service" - systemctl restart mcsm-daemon || LEcho error "[x] 无法启动 MCSManager 守护程序服务" "[x] Unable to start MCSManager daemon service" + + # 创建 Daemon 服务 + systemctl enable mcsm-daemon.service --now + + # 创建 Web 服务 + systemctl enable mcsm-web.service --now + + sleep 3 + + printf "\033c" + echo_yellow "==================================================================" + if [ "$zh" == 1 ]; then + echo_green "欢迎使用 MCSManager,您可以通过以下方式访问:" + echo_yellow "==================================================================" + echo_cyan_n "控制面板地址: " + echo_yellow "http://localhost:23333" + echo_red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" + echo_yellow "==================================================================" + echo_cyan "重启 systemctl restart mcsm-{daemon,web}.service" + echo_cyan "禁用 systemctl disable mcsm-{daemon,web}.service" + echo_cyan "启用 systemctl enable mcsm-{daemon,web}.service" + echo_cyan "启动 systemctl start mcsm-{daemon,web}.service" + echo_cyan "停止 systemctl stop mcsm-{daemon,web}.service" + echo_cyan "更多使用说明,请参考:https://docs.mcsmanager.com/" else - systemctl enable mcsm-web --now || LEcho error "[x] 无法启动 MCSManager 前端管理面板服务" "[x] Unable to start MCSManager web panel service" - systemctl enable mcsm-daemon --now || LEcho error "[x] 无法启动 MCSManager 守护程序服务" "[x] Unable to start MCSManager daemon service" + echo_green "Welcome to MCSManager, you can access it by the following ways:" + echo_yellow "==================================================================" + echo_cyan_n "Web Service Address: " + echo_yellow "http://localhost:23333" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow "==================================================================" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_cyan "systemctl disable mcsm-{daemon,web}.service" + echo_cyan "systemctl enable mcsm-{daemon,web}.service" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "More info: https://docs.mcsmanager.com/" fi - - # Output login info - LEcho green "[√] MCSManager 安装完毕" "[√] MCSManager installation completed" - sleep 3 - clear - LEcho yellow "==================================================================" "==================================================================" - LEcho green "欢迎使用 MCSManager, 您可以通过以下方式访问: " "Welcome to MCSManager, you can access it through the following ways:" - LEcho yellow "==================================================================" "==================================================================" - LEcho cyan_n "控制面板默认访问地址: " "Control panel default address: " - LEcho yellow "http://localhost:23333" "http://localhost:23333" - LEcho red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" "If you can't access the panel, please check if the firewall/security group has opened the panel 23333 and 24444 ports. The control panel needs these two ports to work properly." - LEcho yellow "==================================================================" "==================================================================" - LEcho cyan "启动 MCSM: systemctl start mcsm-{daemon,web}.service" "Start MCSM: systemctl start mcsm-{daemon,web}.service" - LEcho cyan "重启 MCSM: systemctl restart mcsm-{daemon,web}.service" "Restart MCSM: systemctl restart mcsm-{daemon,web}.service" - LEcho cyan "停止 MCSM: systemctl stop mcsm-{daemon,web}.service" "Stop MCSM: systemctl stop mcsm-{daemon,web}.service" - LEcho cyan "启用自启动: systemctl enable mcsm-{daemon,web}.service" "Enable: systemctl enable mcsm-{daemon,web}.service" - LEcho cyan "禁用自启动: systemctl disable mcsm-{daemon,web}.service" "Disable: systemctl disable mcsm-{daemon,web}.service" - LEcho cyan "更多使用说明, 请参考: https://docs.mcsmanager.com/" "More usage instructions, please refer to: https://docs.mcsmanager.com/" - LEcho yellow "==================================================================" "==================================================================" - - # Clean up - rm -rf $tmpDir - return -} + echo_yellow "==================================================================" -## Clean up -Clean() { - LEcho cyan "[*] 正在清理残余文件" "[*] Cleaning up" - rm -rf $tmpDir - [ $mode != "update" ] && rm -rf $mcsmPath - return } -### Start +# ----------------- 程序启动 ----------------- + +# 删除 Shell 脚本自身 +rm -f "$0" + +# 检查执行用户权限 +if [ "$(whoami)" != "root" ]; then + if [ "$zh" == 1 ]; then + Red_Error "[x] 请使用 root 权限执行 MCSManager 安装命令!" + else + Red_Error "[x] Please execute the MCSManager installation command with root permission!" + fi +fi + +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +| Copyright © 2022 MCSManager All rights reserved. ++---------------------------------------------------------------------- +| Shell Install Script by Nuomiaa & CreeperKong ++---------------------------------------------------------------------- +" + +# 环境检查 +if [ "$arch" == x86_64 ]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [ $arch == aarch64 ]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [ $arch == arm ]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [ $arch == ppc64le ]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [ $arch == s390x ]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + if [ "$zh" == 1 ]; then + Red_Error "[x] 抱歉,暂不支持您的 体系架构($arch)!" + else + Red_Error "[x] Sorry, this architecture is not supported yet!" + fi + exit +fi + +# 定义变量 Node 安装目录 +node_install_path="/opt/node-$node-linux-$arch" + +# 检查网络连接 +if [ "$zh" == 1 ]; then + echo_cyan "[-] 体系架构:$arch" +else + echo_cyan "[-] Architecture: $arch" +fi + +# MCSManager 已安装 +if [ -d "$mcsmanager_install_path" ]; then + printf "\033c" + if [ "$zh" == 1 ]; then + echo_red "---------------------------------------------------- +检查到已有 MCSManager 安装在 \"$mcsmanager_install_path\" +继续安装会删除原有 MCSManager 面版的所有数据! +---------------------------------------------------- +将在 10 秒后继续安装,取消请按 Ctrl + Z/C 键!" + else + echo_red "---------------------------------------------------- +MCSManager is installed at \"$mcsmanager_install_path\" +Continuing the installation will delete the original MCSManager! +---------------------------------------------------- +Installation will continue in 10 seconds, press Ctrl + Z/C to cancel!" + fi + sleep 10 +fi + +# 安装相关软件 +if [ "$zh" == 1 ]; then + echo_cyan_n "[-] 安装相关软件(git,tar)... " +else + echo_cyan_n "[+] Installing dependent software(git,tar)... " +fi +if [ -x "$(command -v yum)" ]; then + yum install -y git tar >error +elif [ -x "$(command -v apt-get)" ]; then + apt-get install -y git tar >error +elif [ -x "$(command -v pacman)" ]; then + pacman -Syu --noconfirm git tar >error +elif [ -x "$(command -v zypper)" ]; then + zypper --non-interactive install git tar >error +fi + +# 判断相关软件是否安装成功 +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then + if [ "$zh" == 1 ]; then + echo_green "成功" + else + echo_green "Success" + fi +else + if [ "$zh" == 1 ]; then + echo_red "失败" + else + echo_red "Failed" + fi + echo "$error" + if [ "$zh" == 1 ]; then + Red_Error "[x] 相关软件安装失败,请手动安装 git 和 tar 软件包!" + else + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" + fi + exit +fi + +# 安装 Node 环境 +Install_Node + +# 安装 MCSManager +Install_MCSManager -LEcho cyan "[-] 正在检查基础环境, 请稍等" "[-] Checking basic environment, please wait" -CheckRoot -CheckArch -CheckOS -CheckCN -Install -LEcho cyan "[-] 期待与您的下次见面" "[-] Looking forward to seeing you again" \ No newline at end of file +# 创建 MCSManager 后台服务 +Create_Service From 54d90c4e64081812bf286fac2da3cf4d471644db Mon Sep 17 00:00:00 2001 From: unitwk Date: Wed, 24 May 2023 15:11:28 +0800 Subject: [PATCH 063/463] Update Environment=\"PATH=${PATH}\" --- setup_en.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup_en.sh b/setup_en.sh index 7f7dc35..75f229f 100644 --- a/setup_en.sh +++ b/setup_en.sh @@ -127,7 +127,7 @@ WorkingDirectory=/opt/mcsmanager/daemon ExecStart=${node_install_path}/bin/node app.js ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID -Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target @@ -142,7 +142,7 @@ WorkingDirectory=/opt/mcsmanager/web ExecStart=${node_install_path}/bin/node app.js ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID -Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target From 7083da29eb0367d75629d04d390d5ca93a88da1e Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 15:04:13 +0800 Subject: [PATCH 064/463] Feat: add new script --- install.sh | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 238 insertions(+) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..8f08881 --- /dev/null +++ b/install.sh @@ -0,0 +1,238 @@ +#!/bin/bash + +printf "\033c" + +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +| Copyright © 2023 MCSManager. ++---------------------------------------------------------------------- +| Contributors: nuomiaa, CreeperKong, unitwk, FunnyShadow ++---------------------------------------------------------------------- +" + +error="" +node="v14.19.1" +arch=$(uname -m) +mcsmanager_install_path="/opt/mcsmanager" + +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} + +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} + +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} + +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} + +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +Install_Node() { + echo_cyan_n "[+] Install Node.JS environment... " + + rm -irf "$node_install_path" + + cd /opt || exit + + wget -o /dev/null https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz + + tar -zxf node-"$node"-linux-"$arch".tar.gz + + rm -rf node-"$node"-linux-"$arch".tar.gz + + if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] + then + echo_green "Success" + else + echo_red "Failed" + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node Version ===============" + echo + + sleep 3 +} + + +Install_MCSManager() { + echo_cyan "[+] Install MCSManager..." + + # delete service + rm -f /etc/systemd/system/mcsm-daemon.service + rm -f /etc/systemd/system/mcsm-web.service + + # stop service + systemctl stop mcsm-{web,daemon} + mkdir -p ${mcsmanager_install_path} || exit + + # cd /opt/mcsmanager + cd ${mcsmanager_install_path} || exit + + + # donwload MCSManager release + wget -o /dev/null https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/mcsmanager_linux_release.tar.gz + tar -zxf mcsmanager_linux_release.tar.gz -o + + # echo "[→] cd daemon" + cd daemon || exit + + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install > error + + # echo "[←] cd .." + cd .. + + # echo "[→] cd web" + cd web || exit + + echo_cyan "[+] Install MCSManager-Web dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install > error + + echo + echo_yellow "=============== MCSManager ===============" + echo_green " Daemon: ${mcsmanager_install_path}/daemon" + echo_green " Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" + + sleep 3 +} + +Create_Service() { + echo_cyan "[+] Create MCSManager service..." + + echo " +[Unit] +Description=MCSManager Daemon + +[Service] +WorkingDirectory=/opt/mcsmanager/daemon +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" > /etc/systemd/system/mcsm-daemon.service + + echo " +[Unit] +Description=MCSManager Web + +[Service] +WorkingDirectory=/opt/mcsmanager/web +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" > /etc/systemd/system/mcsm-web.service + + systemctl daemon-reload + systemctl enable mcsm-daemon.service --now + systemctl enable mcsm-web.service --now + + sleep 3 + + printf "\n\n" + + echo_yellow "==================================================================" + echo_green "Welcome to MCSManager!" + echo_yellow "==================================================================" + echo_cyan_n "HTTP Service Address: "; echo_yellow "http://localhost:23333" + echo_cyan_n "Daemon Address: "; echo_yellow "ws://localhost:24444" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow "==================================================================" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_cyan "systemctl disable mcsm-{daemon,web}.service" + echo_cyan "systemctl enable mcsm-{daemon,web}.service" + echo_cyan "More info: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" +} + + + +# Environmental inspection +if [ "$arch" == x86_64 ]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [ $arch == aarch64 ]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [ $arch == arm ]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [ $arch == ppc64le ]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [ $arch == s390x ]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + Red_Error "[x] Sorry, this architecture is not supported yet!" + Red_Error "[x] Please try to install manually: https://github.com/MCSManager/MCSManager#linux" + exit +fi + +# Define the variable Node installation directory +node_install_path="/opt/node-$node-linux-$arch" + +# Check network connection +echo_cyan "[-] Architecture: $arch" + +# Install related software +echo_cyan_n "[+] Installing dependent software(git,tar)... " +if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; +elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; +elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; +elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; +fi + +# Determine whether the relevant software is installed successfully +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] + then + echo_green "Success" + else + echo_red "Failed" + echo "$error" + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" + exit +fi + + +# Install the Node environment +Install_Node + +# Install MCSManager +Install_MCSManager + +# Create MCSManager background service +Create_Service + From 23ac575deaa26191f49ef72096736dc51be3441c Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 15:08:23 +0800 Subject: [PATCH 065/463] Fix: print function --- install.sh | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/install.sh b/install.sh index 8f08881..ba65ac6 100644 --- a/install.sh +++ b/install.sh @@ -2,6 +2,27 @@ printf "\033c" +# print func +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} + +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} + +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} + +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +# script info echo_cyan "+---------------------------------------------------------------------- | MCSManager Installer +---------------------------------------------------------------------- @@ -23,25 +44,6 @@ Red_Error() { exit 1 } -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} - -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} - -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} - -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" -} - -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} Install_Node() { echo_cyan_n "[+] Install Node.JS environment... " From 4519749b47932cf25cd512bb8e874da5da4a83fd Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 15:13:18 +0800 Subject: [PATCH 066/463] Feat: add cn new script --- install_cn.sh | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 install_cn.sh diff --git a/install_cn.sh b/install_cn.sh new file mode 100644 index 0000000..4fc5aaa --- /dev/null +++ b/install_cn.sh @@ -0,0 +1,240 @@ +#!/bin/bash + +printf "\033c" + +# print func +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} + +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} + +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} + +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +# script info +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +| Copyright © 2023 MCSManager. ++---------------------------------------------------------------------- +| Contributors: nuomiaa, CreeperKong, unitwk, FunnyShadow ++---------------------------------------------------------------------- +" + +error="" +node="v14.19.1" +arch=$(uname -m) +mcsmanager_install_path="/opt/mcsmanager" + +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + + +Install_Node() { + echo_cyan_n "[+] Install Node.JS environment... " + + rm -irf "$node_install_path" + + cd /opt || exit + + wget -o /dev/null https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz + + tar -zxf node-"$node"-linux-"$arch".tar.gz + + rm -rf node-"$node"-linux-"$arch".tar.gz + + if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] + then + echo_green "Success" + else + echo_red "Failed" + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node Version ===============" + echo + + sleep 3 +} + + +Install_MCSManager() { + echo_cyan "[+] Install MCSManager..." + + # delete service + rm -f /etc/systemd/system/mcsm-daemon.service + rm -f /etc/systemd/system/mcsm-web.service + + # stop service + systemctl stop mcsm-{web,daemon} + mkdir -p ${mcsmanager_install_path} || exit + + # cd /opt/mcsmanager + cd ${mcsmanager_install_path} || exit + + + # donwload MCSManager release + wget -o /dev/null https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/mcsmanager_linux_release.tar.gz + tar -zxf mcsmanager_linux_release.tar.gz -o + + # echo "[→] cd daemon" + cd daemon || exit + + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production> error + + # echo "[←] cd .." + cd .. + + # echo "[→] cd web" + cd web || exit + + echo_cyan "[+] Install MCSManager-Web dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production> error + + echo + echo_yellow "=============== MCSManager ===============" + echo_green " Daemon: ${mcsmanager_install_path}/daemon" + echo_green " Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" + + sleep 3 +} + +Create_Service() { + echo_cyan "[+] Create MCSManager service..." + + echo " +[Unit] +Description=MCSManager Daemon + +[Service] +WorkingDirectory=/opt/mcsmanager/daemon +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" > /etc/systemd/system/mcsm-daemon.service + + echo " +[Unit] +Description=MCSManager Web + +[Service] +WorkingDirectory=/opt/mcsmanager/web +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" > /etc/systemd/system/mcsm-web.service + + systemctl daemon-reload + systemctl enable mcsm-daemon.service --now + systemctl enable mcsm-web.service --now + + sleep 3 + + printf "\n\n" + + echo_yellow "==================================================================" + echo_green "Welcome to MCSManager!" + echo_yellow "==================================================================" + echo_cyan_n "HTTP Service Address: "; echo_yellow "http://localhost:23333" + echo_cyan_n "Daemon Address: "; echo_yellow "ws://localhost:24444" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow "==================================================================" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_cyan "systemctl disable mcsm-{daemon,web}.service" + echo_cyan "systemctl enable mcsm-{daemon,web}.service" + echo_cyan "More info: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" +} + + + +# Environmental inspection +if [ "$arch" == x86_64 ]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [ $arch == aarch64 ]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [ $arch == arm ]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [ $arch == ppc64le ]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [ $arch == s390x ]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + Red_Error "[x] Sorry, this architecture is not supported yet!" + Red_Error "[x] Please try to install manually: https://github.com/MCSManager/MCSManager#linux" + exit +fi + +# Define the variable Node installation directory +node_install_path="/opt/node-$node-linux-$arch" + +# Check network connection +echo_cyan "[-] Architecture: $arch" + +# Install related software +echo_cyan_n "[+] Installing dependent software(git,tar)... " +if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; +elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; +elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; +elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; +fi + +# Determine whether the relevant software is installed successfully +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] + then + echo_green "Success" + else + echo_red "Failed" + echo "$error" + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" + exit +fi + + +# Install the Node environment +Install_Node + +# Install MCSManager +Install_MCSManager + +# Create MCSManager background service +Create_Service + From 15fe53d99dd7ee7c5dfca5c0782d80af1538771f Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 15:31:18 +0800 Subject: [PATCH 067/463] Fix: print text --- install_cn.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/install_cn.sh b/install_cn.sh index 4fc5aaa..0a08c90 100644 --- a/install_cn.sh +++ b/install_cn.sh @@ -95,12 +95,13 @@ Install_MCSManager() { # donwload MCSManager release wget -o /dev/null https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/mcsmanager_linux_release.tar.gz tar -zxf mcsmanager_linux_release.tar.gz -o + rm -rf "${mcsmanager_install_path}/mcsmanager_linux_release.tar.gz" # echo "[→] cd daemon" cd daemon || exit echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production> error + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production > npm_install_log # echo "[←] cd .." cd .. @@ -109,7 +110,7 @@ Install_MCSManager() { cd web || exit echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production> error + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production > npm_install_log echo echo_yellow "=============== MCSManager ===============" @@ -166,16 +167,17 @@ WantedBy=multi-user.target echo_yellow "==================================================================" echo_green "Welcome to MCSManager!" echo_yellow "==================================================================" - echo_cyan_n "HTTP Service Address: "; echo_yellow "http://localhost:23333" - echo_cyan_n "Daemon Address: "; echo_yellow "ws://localhost:24444" + echo_cyan_n "HTTP Web Service: "; echo_yellow "http://localhost:23333" + echo_cyan_n "Daemon Address: "; echo_yellow "ws://localhost:24444" echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." echo_yellow "==================================================================" + echo_cyan "Command Usage:" echo_cyan "systemctl start mcsm-{daemon,web}.service" echo_cyan "systemctl stop mcsm-{daemon,web}.service" echo_cyan "systemctl restart mcsm-{daemon,web}.service" echo_cyan "systemctl disable mcsm-{daemon,web}.service" echo_cyan "systemctl enable mcsm-{daemon,web}.service" - echo_cyan "More info: https://docs.mcsmanager.com/" + echo_green "More info: https://docs.mcsmanager.com/" echo_yellow "==================================================================" } From b15e957febafd54fa582e1e1cee9d65f5d3b2ba7 Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 15:46:27 +0800 Subject: [PATCH 068/463] Fix: print text & systemctl --- install_cn.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/install_cn.sh b/install_cn.sh index 0a08c90..aa3f883 100644 --- a/install_cn.sh +++ b/install_cn.sh @@ -67,10 +67,10 @@ Install_Node() { fi echo - echo_yellow "=============== Node Version ===============" + echo_yellow "=============== Node.JS Version ===============" echo_yellow " node: $("$node_install_path"/bin/node -v)" echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node Version ===============" + echo_yellow "=============== Node.JS Version ===============" echo sleep 3 @@ -80,12 +80,14 @@ Install_Node() { Install_MCSManager() { echo_cyan "[+] Install MCSManager..." - # delete service - rm -f /etc/systemd/system/mcsm-daemon.service - rm -f /etc/systemd/system/mcsm-web.service - # stop service systemctl stop mcsm-{web,daemon} + + # delete service + rm -rf /etc/systemd/system/mcsm-daemon.service + rm -rf /etc/systemd/system/mcsm-web.service + systemctl daemon-reload + mkdir -p ${mcsmanager_install_path} || exit # cd /opt/mcsmanager @@ -104,10 +106,7 @@ Install_MCSManager() { /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production > npm_install_log # echo "[←] cd .." - cd .. - - # echo "[→] cd web" - cd web || exit + cd ../web || exit echo_cyan "[+] Install MCSManager-Web dependencies..." /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production > npm_install_log From 8a88349550299360a5b88b6157226d17c71837f1 Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 17:29:58 +0800 Subject: [PATCH 069/463] Feat: change addr --- install_cn.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_cn.sh b/install_cn.sh index aa3f883..e26e5ec 100644 --- a/install_cn.sh +++ b/install_cn.sh @@ -36,6 +36,7 @@ error="" node="v14.19.1" arch=$(uname -m) mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" Red_Error() { echo '=================================================' @@ -95,7 +96,7 @@ Install_MCSManager() { # donwload MCSManager release - wget -o /dev/null https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/mcsmanager_linux_release.tar.gz + wget ${mcsmanager_donwload_addr} tar -zxf mcsmanager_linux_release.tar.gz -o rm -rf "${mcsmanager_install_path}/mcsmanager_linux_release.tar.gz" From 1f91ad78025ca85f165d5988790f5c473ea15f0b Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 19:21:18 +0800 Subject: [PATCH 070/463] Fix: print text --- install_cn.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install_cn.sh b/install_cn.sh index e26e5ec..7633295 100644 --- a/install_cn.sh +++ b/install_cn.sh @@ -32,11 +32,13 @@ echo_cyan "+-------------------------------------------------------------------- +---------------------------------------------------------------------- " -error="" -node="v14.19.1" -arch=$(uname -m) +# Config mcsmanager_install_path="/opt/mcsmanager" mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" +node="v14.19.1" + +error="" +arch=$(uname -m) Red_Error() { echo '=================================================' @@ -53,7 +55,7 @@ Install_Node() { cd /opt || exit - wget -o /dev/null https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz + wget https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz tar -zxf node-"$node"-linux-"$arch".tar.gz From 6c1f174a68b3320b7a969bf1c65223c685b69fc0 Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 20:03:55 +0800 Subject: [PATCH 071/463] Feat: --- install.sh | 42 +++++++++++++++++++++++------------------- install_cn.sh | 10 +++++----- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/install.sh b/install.sh index ba65ac6..e0364ef 100644 --- a/install.sh +++ b/install.sh @@ -32,10 +32,13 @@ echo_cyan "+-------------------------------------------------------------------- +---------------------------------------------------------------------- " -error="" +# Config +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" node="v14.19.1" + +error="" arch=$(uname -m) -mcsmanager_install_path="/opt/mcsmanager" Red_Error() { echo '=================================================' @@ -67,10 +70,10 @@ Install_Node() { fi echo - echo_yellow "=============== Node Version ===============" + echo_yellow "=============== Node.JS Version ===============" echo_yellow " node: $("$node_install_path"/bin/node -v)" echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node Version ===============" + echo_yellow "=============== Node.JS Version ===============" echo sleep 3 @@ -80,12 +83,14 @@ Install_Node() { Install_MCSManager() { echo_cyan "[+] Install MCSManager..." - # delete service - rm -f /etc/systemd/system/mcsm-daemon.service - rm -f /etc/systemd/system/mcsm-web.service - # stop service systemctl stop mcsm-{web,daemon} + + # delete service + rm -rf /etc/systemd/system/mcsm-daemon.service + rm -rf /etc/systemd/system/mcsm-web.service + systemctl daemon-reload + mkdir -p ${mcsmanager_install_path} || exit # cd /opt/mcsmanager @@ -93,23 +98,21 @@ Install_MCSManager() { # donwload MCSManager release - wget -o /dev/null https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/mcsmanager_linux_release.tar.gz + wget ${mcsmanager_donwload_addr} tar -zxf mcsmanager_linux_release.tar.gz -o + rm -rf "${mcsmanager_install_path}/mcsmanager_linux_release.tar.gz" # echo "[→] cd daemon" cd daemon || exit echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install > error + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log # echo "[←] cd .." - cd .. - - # echo "[→] cd web" - cd web || exit + cd ../web || exit echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install > error + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log echo echo_yellow "=============== MCSManager ===============" @@ -164,18 +167,19 @@ WantedBy=multi-user.target printf "\n\n" echo_yellow "==================================================================" - echo_green "Welcome to MCSManager!" + echo_green "Welcome to use MCSManager!" echo_yellow "==================================================================" - echo_cyan_n "HTTP Service Address: "; echo_yellow "http://localhost:23333" - echo_cyan_n "Daemon Address: "; echo_yellow "ws://localhost:24444" + echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" + echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." echo_yellow "==================================================================" + echo_cyan "Usage:" echo_cyan "systemctl start mcsm-{daemon,web}.service" echo_cyan "systemctl stop mcsm-{daemon,web}.service" echo_cyan "systemctl restart mcsm-{daemon,web}.service" echo_cyan "systemctl disable mcsm-{daemon,web}.service" echo_cyan "systemctl enable mcsm-{daemon,web}.service" - echo_cyan "More info: https://docs.mcsmanager.com/" + echo_green "Official Document: https://docs.mcsmanager.com/" echo_yellow "==================================================================" } diff --git a/install_cn.sh b/install_cn.sh index 7633295..c0edc2e 100644 --- a/install_cn.sh +++ b/install_cn.sh @@ -167,19 +167,19 @@ WantedBy=multi-user.target printf "\n\n" echo_yellow "==================================================================" - echo_green "Welcome to MCSManager!" + echo_green "Welcome to use MCSManager!" echo_yellow "==================================================================" - echo_cyan_n "HTTP Web Service: "; echo_yellow "http://localhost:23333" - echo_cyan_n "Daemon Address: "; echo_yellow "ws://localhost:24444" + echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" + echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." echo_yellow "==================================================================" - echo_cyan "Command Usage:" + echo_cyan "Usage:" echo_cyan "systemctl start mcsm-{daemon,web}.service" echo_cyan "systemctl stop mcsm-{daemon,web}.service" echo_cyan "systemctl restart mcsm-{daemon,web}.service" echo_cyan "systemctl disable mcsm-{daemon,web}.service" echo_cyan "systemctl enable mcsm-{daemon,web}.service" - echo_green "More info: https://docs.mcsmanager.com/" + echo_green "Official Document: https://docs.mcsmanager.com/" echo_yellow "==================================================================" } From 5068744be2354b5927cb8ae5dd4bca618511ba0f Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 20:15:56 +0800 Subject: [PATCH 072/463] =?UTF-8?q?Feat:=20Finish=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 4 ++-- install_cn.sh | 35 ++++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/install.sh b/install.sh index e0364ef..b9b9fcd 100644 --- a/install.sh +++ b/install.sh @@ -28,7 +28,7 @@ echo_cyan "+-------------------------------------------------------------------- +---------------------------------------------------------------------- | Copyright © 2023 MCSManager. +---------------------------------------------------------------------- -| Contributors: nuomiaa, CreeperKong, unitwk, FunnyShadow +| Contributors: Nuomiaa, CreeperKong, Unitwk, FunnyShadow +---------------------------------------------------------------------- " @@ -167,7 +167,7 @@ WantedBy=multi-user.target printf "\n\n" echo_yellow "==================================================================" - echo_green "Welcome to use MCSManager!" + echo_green "Installation is complete! Welcome to the MCSManager panel !!!" echo_yellow "==================================================================" echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" diff --git a/install_cn.sh b/install_cn.sh index c0edc2e..1ade4e9 100644 --- a/install_cn.sh +++ b/install_cn.sh @@ -24,18 +24,25 @@ echo_yellow() { # script info echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer +| MCSManager Installer (Chinese Version) +---------------------------------------------------------------------- | Copyright © 2023 MCSManager. +---------------------------------------------------------------------- -| Contributors: nuomiaa, CreeperKong, unitwk, FunnyShadow +| Contributors: Nuomiaa, CreeperKong, Unitwk, FunnyShadow +---------------------------------------------------------------------- + +We will use servers in the China to speed up your installation! +我们将使用中国地区的服务器来加速您的安装速度! " # Config mcsmanager_install_path="/opt/mcsmanager" mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" node="v14.19.1" +zh=$( + [[ $(locale -a) =~ "zh" ]] && echo 1 + export LANG=zh_CN.UTF-8 || echo 0 +) error="" arch=$(uname -m) @@ -165,9 +172,24 @@ WantedBy=multi-user.target sleep 3 printf "\n\n" - echo_yellow "==================================================================" - echo_green "Welcome to use MCSManager!" + if [ "$zh" == 1 ]; then + echo_green "安装已完成!欢迎使用 MCSManager 面板!" + echo_yellow "==================================================================" + echo_cyan_n "控制面板地址: " + echo_yellow "http://你的公网IP:23333" + echo_red "你必须开放 23333(面板) 和 24444(守护进程用) 端口,控制面板需要这两个端口才能正常工作。" + echo_yellow "==================================================================" + echo_cyan "下面是常用的几个命令:" + echo_cyan "启动面板 systemctl start mcsm-{daemon,web}.service" + echo_cyan "停止面板 systemctl stop mcsm-{daemon,web}.service" + echo_cyan "重启面板 systemctl restart mcsm-{daemon,web}.service" + echo_yellow "==================================================================" + echo_cyan "官方文档(必读):https://docs.mcsmanager.com/" + echo_yellow "==================================================================" + else + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager panel!" echo_yellow "==================================================================" echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" @@ -177,10 +199,9 @@ WantedBy=multi-user.target echo_cyan "systemctl start mcsm-{daemon,web}.service" echo_cyan "systemctl stop mcsm-{daemon,web}.service" echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_cyan "systemctl disable mcsm-{daemon,web}.service" - echo_cyan "systemctl enable mcsm-{daemon,web}.service" echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + echo_yellow "==================================================================" + fi } From 5c00e37f0acb8fc3ac169e2efbb24c2981f98ec0 Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 20:20:12 +0800 Subject: [PATCH 073/463] Optimization: text typography --- install.sh | 5 +++-- install_cn.sh | 13 +++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index b9b9fcd..341fc97 100644 --- a/install.sh +++ b/install.sh @@ -168,17 +168,18 @@ WantedBy=multi-user.target echo_yellow "==================================================================" echo_green "Installation is complete! Welcome to the MCSManager panel !!!" - echo_yellow "==================================================================" + echo_yellow " " echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow "==================================================================" + echo_yellow " " echo_cyan "Usage:" echo_cyan "systemctl start mcsm-{daemon,web}.service" echo_cyan "systemctl stop mcsm-{daemon,web}.service" echo_cyan "systemctl restart mcsm-{daemon,web}.service" echo_cyan "systemctl disable mcsm-{daemon,web}.service" echo_cyan "systemctl enable mcsm-{daemon,web}.service" + echo_yellow " " echo_green "Official Document: https://docs.mcsmanager.com/" echo_yellow "==================================================================" } diff --git a/install_cn.sh b/install_cn.sh index 1ade4e9..99d7fa7 100644 --- a/install_cn.sh +++ b/install_cn.sh @@ -175,30 +175,31 @@ WantedBy=multi-user.target echo_yellow "==================================================================" if [ "$zh" == 1 ]; then echo_green "安装已完成!欢迎使用 MCSManager 面板!" - echo_yellow "==================================================================" + echo_yellow " " echo_cyan_n "控制面板地址: " echo_yellow "http://你的公网IP:23333" - echo_red "你必须开放 23333(面板) 和 24444(守护进程用) 端口,控制面板需要这两个端口才能正常工作。" - echo_yellow "==================================================================" + echo_red "你必须开放 23333(面板)和 24444(守护进程用)端口,控制面板需要这两个端口才能正常工作。" + echo_yellow " " echo_cyan "下面是常用的几个命令:" echo_cyan "启动面板 systemctl start mcsm-{daemon,web}.service" echo_cyan "停止面板 systemctl stop mcsm-{daemon,web}.service" echo_cyan "重启面板 systemctl restart mcsm-{daemon,web}.service" - echo_yellow "==================================================================" + echo_yellow " " echo_cyan "官方文档(必读):https://docs.mcsmanager.com/" echo_yellow "==================================================================" else echo_yellow "==================================================================" echo_green "Installation is complete! Welcome to the MCSManager panel!" - echo_yellow "==================================================================" + echo_yellow " " echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow "==================================================================" + echo_yellow " " echo_cyan "Usage:" echo_cyan "systemctl start mcsm-{daemon,web}.service" echo_cyan "systemctl stop mcsm-{daemon,web}.service" echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_yellow " " echo_green "Official Document: https://docs.mcsmanager.com/" echo_yellow "==================================================================" fi From 270216eefe99a6459b0eccc54fa0a8dabbd32789 Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 20:58:45 +0800 Subject: [PATCH 074/463] Feat: update script --- install.sh | 245 ------------------------- install_cn.sh | 266 --------------------------- setup.sh | 474 ++++++++++++++++++------------------------------ setup_cn.sh | 489 +++++++++++++++++++------------------------------- setup_en.sh | 145 +++++++-------- 5 files changed, 423 insertions(+), 1196 deletions(-) delete mode 100644 install.sh delete mode 100644 install_cn.sh diff --git a/install.sh b/install.sh deleted file mode 100644 index 341fc97..0000000 --- a/install.sh +++ /dev/null @@ -1,245 +0,0 @@ -#!/bin/bash - -printf "\033c" - -# print func -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} - -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} - -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" -} - -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} - -# script info -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2023 MCSManager. -+---------------------------------------------------------------------- -| Contributors: Nuomiaa, CreeperKong, Unitwk, FunnyShadow -+---------------------------------------------------------------------- -" - -# Config -mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" -node="v14.19.1" - -error="" -arch=$(uname -m) - -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 -} - - -Install_Node() { - echo_cyan_n "[+] Install Node.JS environment... " - - rm -irf "$node_install_path" - - cd /opt || exit - - wget -o /dev/null https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz - - tar -zxf node-"$node"-linux-"$arch".tar.gz - - rm -rf node-"$node"-linux-"$arch".tar.gz - - if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] - then - echo_green "Success" - else - echo_red "Failed" - Red_Error "[x] Node installation failed!" - fi - - echo - echo_yellow "=============== Node.JS Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" - echo - - sleep 3 -} - - -Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." - - # stop service - systemctl stop mcsm-{web,daemon} - - # delete service - rm -rf /etc/systemd/system/mcsm-daemon.service - rm -rf /etc/systemd/system/mcsm-web.service - systemctl daemon-reload - - mkdir -p ${mcsmanager_install_path} || exit - - # cd /opt/mcsmanager - cd ${mcsmanager_install_path} || exit - - - # donwload MCSManager release - wget ${mcsmanager_donwload_addr} - tar -zxf mcsmanager_linux_release.tar.gz -o - rm -rf "${mcsmanager_install_path}/mcsmanager_linux_release.tar.gz" - - # echo "[→] cd daemon" - cd daemon || exit - - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log - - # echo "[←] cd .." - cd ../web || exit - - echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log - - echo - echo_yellow "=============== MCSManager ===============" - echo_green " Daemon: ${mcsmanager_install_path}/daemon" - echo_green " Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" - - sleep 3 -} - -Create_Service() { - echo_cyan "[+] Create MCSManager service..." - - echo " -[Unit] -Description=MCSManager Daemon - -[Service] -WorkingDirectory=/opt/mcsmanager/daemon -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-daemon.service - - echo " -[Unit] -Description=MCSManager Web - -[Service] -WorkingDirectory=/opt/mcsmanager/web -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-web.service - - systemctl daemon-reload - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - - sleep 3 - - printf "\n\n" - - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager panel !!!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" - echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_cyan "systemctl disable mcsm-{daemon,web}.service" - echo_cyan "systemctl enable mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" -} - - - -# Environmental inspection -if [ "$arch" == x86_64 ]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [ $arch == aarch64 ]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [ $arch == arm ]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [ $arch == ppc64le ]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [ $arch == s390x ]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - Red_Error "[x] Sorry, this architecture is not supported yet!" - Red_Error "[x] Please try to install manually: https://github.com/MCSManager/MCSManager#linux" - exit -fi - -# Define the variable Node installation directory -node_install_path="/opt/node-$node-linux-$arch" - -# Check network connection -echo_cyan "[-] Architecture: $arch" - -# Install related software -echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; -elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; -elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; -elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; -fi - -# Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] - then - echo_green "Success" - else - echo_red "Failed" - echo "$error" - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - exit -fi - - -# Install the Node environment -Install_Node - -# Install MCSManager -Install_MCSManager - -# Create MCSManager background service -Create_Service - diff --git a/install_cn.sh b/install_cn.sh deleted file mode 100644 index 99d7fa7..0000000 --- a/install_cn.sh +++ /dev/null @@ -1,266 +0,0 @@ -#!/bin/bash - -printf "\033c" - -# print func -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} - -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} - -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" -} - -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} - -# script info -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer (Chinese Version) -+---------------------------------------------------------------------- -| Copyright © 2023 MCSManager. -+---------------------------------------------------------------------- -| Contributors: Nuomiaa, CreeperKong, Unitwk, FunnyShadow -+---------------------------------------------------------------------- - -We will use servers in the China to speed up your installation! -我们将使用中国地区的服务器来加速您的安装速度! -" - -# Config -mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" -node="v14.19.1" -zh=$( - [[ $(locale -a) =~ "zh" ]] && echo 1 - export LANG=zh_CN.UTF-8 || echo 0 -) - -error="" -arch=$(uname -m) - -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 -} - - -Install_Node() { - echo_cyan_n "[+] Install Node.JS environment... " - - rm -irf "$node_install_path" - - cd /opt || exit - - wget https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz - - tar -zxf node-"$node"-linux-"$arch".tar.gz - - rm -rf node-"$node"-linux-"$arch".tar.gz - - if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] - then - echo_green "Success" - else - echo_red "Failed" - Red_Error "[x] Node installation failed!" - fi - - echo - echo_yellow "=============== Node.JS Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" - echo - - sleep 3 -} - - -Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." - - # stop service - systemctl stop mcsm-{web,daemon} - - # delete service - rm -rf /etc/systemd/system/mcsm-daemon.service - rm -rf /etc/systemd/system/mcsm-web.service - systemctl daemon-reload - - mkdir -p ${mcsmanager_install_path} || exit - - # cd /opt/mcsmanager - cd ${mcsmanager_install_path} || exit - - - # donwload MCSManager release - wget ${mcsmanager_donwload_addr} - tar -zxf mcsmanager_linux_release.tar.gz -o - rm -rf "${mcsmanager_install_path}/mcsmanager_linux_release.tar.gz" - - # echo "[→] cd daemon" - cd daemon || exit - - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production > npm_install_log - - # echo "[←] cd .." - cd ../web || exit - - echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production > npm_install_log - - echo - echo_yellow "=============== MCSManager ===============" - echo_green " Daemon: ${mcsmanager_install_path}/daemon" - echo_green " Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" - - sleep 3 -} - -Create_Service() { - echo_cyan "[+] Create MCSManager service..." - - echo " -[Unit] -Description=MCSManager Daemon - -[Service] -WorkingDirectory=/opt/mcsmanager/daemon -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-daemon.service - - echo " -[Unit] -Description=MCSManager Web - -[Service] -WorkingDirectory=/opt/mcsmanager/web -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-web.service - - systemctl daemon-reload - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - - sleep 3 - - printf "\n\n" - echo_yellow "==================================================================" - if [ "$zh" == 1 ]; then - echo_green "安装已完成!欢迎使用 MCSManager 面板!" - echo_yellow " " - echo_cyan_n "控制面板地址: " - echo_yellow "http://你的公网IP:23333" - echo_red "你必须开放 23333(面板)和 24444(守护进程用)端口,控制面板需要这两个端口才能正常工作。" - echo_yellow " " - echo_cyan "下面是常用的几个命令:" - echo_cyan "启动面板 systemctl start mcsm-{daemon,web}.service" - echo_cyan "停止面板 systemctl stop mcsm-{daemon,web}.service" - echo_cyan "重启面板 systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_cyan "官方文档(必读):https://docs.mcsmanager.com/" - echo_yellow "==================================================================" - else - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager panel!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" - echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" - fi -} - - - -# Environmental inspection -if [ "$arch" == x86_64 ]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [ $arch == aarch64 ]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [ $arch == arm ]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [ $arch == ppc64le ]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [ $arch == s390x ]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - Red_Error "[x] Sorry, this architecture is not supported yet!" - Red_Error "[x] Please try to install manually: https://github.com/MCSManager/MCSManager#linux" - exit -fi - -# Define the variable Node installation directory -node_install_path="/opt/node-$node-linux-$arch" - -# Check network connection -echo_cyan "[-] Architecture: $arch" - -# Install related software -echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; -elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; -elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; -elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; -fi - -# Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] - then - echo_green "Success" - else - echo_red "Failed" - echo "$error" - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - exit -fi - - -# Install the Node environment -Install_Node - -# Install MCSManager -Install_MCSManager - -# Create MCSManager background service -Create_Service - diff --git a/setup.sh b/setup.sh index 9c4e4d3..341fc97 100644 --- a/setup.sh +++ b/setup.sh @@ -1,377 +1,245 @@ #!/bin/bash -#### MCSManager Command Line Interface -#### Made by nuomiaa, CreeperKong, unitwk - -#### Copyright © 2023 MCSManager All rights reserved. - printf "\033c" -error="" -node="v14.19.1" -arch=$(uname -m) -mcsmanager_install_path="/opt/mcsmanager" -zh=$( - [[ $(locale -a) =~ "zh" ]] && echo 1 - export LANG=zh_CN.UTF-8 || echo 0 -) - -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 +# print func +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" } - echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" + printf '\033[1;31m%b\033[0m\n' "$@" } echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} - -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" + printf '\033[1;32m%b\033[0m\n' "$@" } echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" + printf '\033[1;36m%b\033[0m' "$@" } echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" + printf '\033[1;33m%b\033[0m\n' "$@" } +# script info +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +| Copyright © 2023 MCSManager. ++---------------------------------------------------------------------- +| Contributors: Nuomiaa, CreeperKong, Unitwk, FunnyShadow ++---------------------------------------------------------------------- +" + +# Config +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" +node="v14.19.1" + +error="" +arch=$(uname -m) + +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + + Install_Node() { - if [ "$zh" == 1 ]; then - echo_cyan_n "[+] 安装 Node 环境... " - else - echo_cyan_n "[+] Install Node environment... " - fi - - rm -irf "$node_install_path" - - cd /opt || exit - - wget -o /dev/null https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz - - tar -zxf node-"$node"-linux-"$arch".tar.gz - - rm -rf node-"$node"-linux-"$arch".tar.gz - - if [ ! -L /usr/bin/node ] && [ ! -f /usr/bin/node ]; then - ln -s "$node_install_path"/bin/node /usr/bin/node - fi - if [ ! -L /usr/bin/npm ] && [ ! -f /usr/bin/npm ]; then - ln -s "$node_install_path"/bin/npm /usr/bin/npm - fi - - chmod +x "$node_install_path"/bin/node - chmod +x "$node_install_path"/bin/npm - - if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ]; then - if [ "$zh" == 1 ]; then - echo_green "成功" - else - echo_green "Success" - fi - else - if [ "$zh" == 1 ]; then - echo_red "失败" - Red_Error "[x] Node 安装失败!" - else - echo_red "Failed" - Red_Error "[x] Node installation failed!" - fi - fi - - echo - echo_yellow "=============== Node Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node Version ===============" - echo - - sleep 3 + echo_cyan_n "[+] Install Node.JS environment... " + + rm -irf "$node_install_path" + + cd /opt || exit + + wget -o /dev/null https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz + + tar -zxf node-"$node"-linux-"$arch".tar.gz + + rm -rf node-"$node"-linux-"$arch".tar.gz + + if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] + then + echo_green "Success" + else + echo_red "Failed" + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node.JS Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node.JS Version ===============" + echo + + sleep 3 } + Install_MCSManager() { - if [ "$zh" == 1 ]; then - echo_cyan "[+] 安装 MCSManager..." - else - echo_cyan "[+] Install MCSManager..." - fi - - # 删除服务 - rm -f /etc/systemd/system/mcsm-daemon.service - rm -f /etc/systemd/system/mcsm-web.service - - # 重载 - systemctl daemon-reload - - # echo "[x] Delete the original MCSManager" - rm -irf ${mcsmanager_install_path} - - # echo "[+] mkdir -p ${mcsmanager_install_path}" - mkdir -p ${mcsmanager_install_path} || exit - - # echo "[→] cd ${mcsmanager_install_path}" - cd ${mcsmanager_install_path} || exit - - if [ "$zh" == 1 ]; then - echo_cyan "[↓] Git 克隆 MCSManager-Daemon..." - else - echo_cyan "[↓] Git clone MCSManager-Daemon..." - fi - git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git daemon - - # echo "[→] cd daemon" - cd daemon || exit - - if [ "$zh" == 1 ]; then - echo_cyan "[+] 安装 MCSManager-Daemon 依赖库..." - else - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - fi - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com >error - - # echo "[←] cd .." - cd .. - - if [ "$zh" == 1 ]; then - echo_cyan "[↓] Git 克隆 MCSManager-Web..." - else - echo_cyan "[↓] Git clone MCSManager-Web..." - fi - git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Web-Production.git web - - # echo "[→] cd web" - cd web || exit - - if [ "$zh" == 1 ]; then - echo_cyan "[+] 安装 MCSManager-Web 依赖库..." - else - echo_cyan "[+] Install MCSManager-Web dependencies..." - fi - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com >error - - echo - echo_yellow "=============== MCSManager ===============" - echo_green " Daemon: ${mcsmanager_install_path}/daemon" - echo_green " Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - if [ "$zh" == 1 ]; then - echo_green "[+] MCSManager 安装成功!" - else - echo_green "[+] MCSManager installation success!" - fi - - sleep 3 + echo_cyan "[+] Install MCSManager..." + + # stop service + systemctl stop mcsm-{web,daemon} + + # delete service + rm -rf /etc/systemd/system/mcsm-daemon.service + rm -rf /etc/systemd/system/mcsm-web.service + systemctl daemon-reload + + mkdir -p ${mcsmanager_install_path} || exit + + # cd /opt/mcsmanager + cd ${mcsmanager_install_path} || exit + + + # donwload MCSManager release + wget ${mcsmanager_donwload_addr} + tar -zxf mcsmanager_linux_release.tar.gz -o + rm -rf "${mcsmanager_install_path}/mcsmanager_linux_release.tar.gz" + + # echo "[→] cd daemon" + cd daemon || exit + + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log + + # echo "[←] cd .." + cd ../web || exit + + echo_cyan "[+] Install MCSManager-Web dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log + + echo + echo_yellow "=============== MCSManager ===============" + echo_green " Daemon: ${mcsmanager_install_path}/daemon" + echo_green " Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" + + sleep 3 } Create_Service() { - if [ "$zh" == 1 ]; then - echo_cyan "[+] 创建 MCSManager 服务..." - else - echo_cyan "[+] Create MCSManager service..." - fi + echo_cyan "[+] Create MCSManager service..." - echo " + echo " [Unit] Description=MCSManager Daemon [Service] WorkingDirectory=/opt/mcsmanager/daemon ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID +ExecReload=/bin/kill -s QUIT $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service +" > /etc/systemd/system/mcsm-daemon.service - echo " + echo " [Unit] Description=MCSManager Web [Service] WorkingDirectory=/opt/mcsmanager/web ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID +ExecReload=/bin/kill -s QUIT $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-web.service - - # 重载 - systemctl daemon-reload - - # 创建 Daemon 服务 - systemctl enable mcsm-daemon.service --now - - # 创建 Web 服务 - systemctl enable mcsm-web.service --now - - sleep 3 - - printf "\033c" - echo_yellow "==================================================================" - if [ "$zh" == 1 ]; then - echo_green "欢迎使用 MCSManager,您可以通过以下方式访问:" - echo_yellow "==================================================================" - echo_cyan_n "控制面板地址: " - echo_yellow "http://localhost:23333" - echo_red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" - echo_yellow "==================================================================" - echo_cyan "重启 systemctl restart mcsm-{daemon,web}.service" - echo_cyan "禁用 systemctl disable mcsm-{daemon,web}.service" - echo_cyan "启用 systemctl enable mcsm-{daemon,web}.service" - echo_cyan "启动 systemctl start mcsm-{daemon,web}.service" - echo_cyan "停止 systemctl stop mcsm-{daemon,web}.service" - echo_cyan "更多使用说明,请参考:https://docs.mcsmanager.com/" - else - echo_green "Welcome to MCSManager, you can access it by the following ways:" - echo_yellow "==================================================================" - echo_cyan_n "Web Service Address: " - echo_yellow "http://localhost:23333" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow "==================================================================" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_cyan "systemctl disable mcsm-{daemon,web}.service" - echo_cyan "systemctl enable mcsm-{daemon,web}.service" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "More info: https://docs.mcsmanager.com/" - fi - echo_yellow "==================================================================" - +" > /etc/systemd/system/mcsm-web.service + + systemctl daemon-reload + systemctl enable mcsm-daemon.service --now + systemctl enable mcsm-web.service --now + + sleep 3 + + printf "\n\n" + + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager panel !!!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" + echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_cyan "systemctl disable mcsm-{daemon,web}.service" + echo_cyan "systemctl enable mcsm-{daemon,web}.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" } -# ----------------- 程序启动 ----------------- -# 删除 Shell 脚本自身 -rm -f "$0" - -# 检查执行用户权限 -if [ "$(whoami)" != "root" ]; then - if [ "$zh" == 1 ]; then - Red_Error "[x] 请使用 root 权限执行 MCSManager 安装命令!" - else - Red_Error "[x] Please execute the MCSManager installation command with root permission!" - fi -fi -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2022 MCSManager All rights reserved. -+---------------------------------------------------------------------- -| Shell Install Script by Nuomiaa & CreeperKong -+---------------------------------------------------------------------- -" - -# 环境检查 +# Environmental inspection if [ "$arch" == x86_64 ]; then - arch=x64 - #echo "[-] x64 architecture detected" + arch=x64 + #echo "[-] x64 architecture detected" elif [ $arch == aarch64 ]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" elif [ $arch == arm ]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" elif [ $arch == ppc64le ]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" + arch=ppc64le + #echo "[-] IBM POWER architecture detected" elif [ $arch == s390x ]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" else - if [ "$zh" == 1 ]; then - Red_Error "[x] 抱歉,暂不支持您的 体系架构($arch)!" - else - Red_Error "[x] Sorry, this architecture is not supported yet!" - fi - exit + Red_Error "[x] Sorry, this architecture is not supported yet!" + Red_Error "[x] Please try to install manually: https://github.com/MCSManager/MCSManager#linux" + exit fi -# 定义变量 Node 安装目录 +# Define the variable Node installation directory node_install_path="/opt/node-$node-linux-$arch" -# 检查网络连接 -if [ "$zh" == 1 ]; then - echo_cyan "[-] 体系架构:$arch" -else - echo_cyan "[-] Architecture: $arch" -fi - -# MCSManager 已安装 -if [ -d "$mcsmanager_install_path" ]; then - printf "\033c" - if [ "$zh" == 1 ]; then - echo_red "---------------------------------------------------- -检查到已有 MCSManager 安装在 \"$mcsmanager_install_path\" -继续安装会删除原有 MCSManager 面版的所有数据! ----------------------------------------------------- -将在 10 秒后继续安装,取消请按 Ctrl + Z/C 键!" - else - echo_red "---------------------------------------------------- -MCSManager is installed at \"$mcsmanager_install_path\" -Continuing the installation will delete the original MCSManager! ----------------------------------------------------- -Installation will continue in 10 seconds, press Ctrl + Z/C to cancel!" - fi - sleep 10 -fi +# Check network connection +echo_cyan "[-] Architecture: $arch" -# 安装相关软件 -if [ "$zh" == 1 ]; then - echo_cyan_n "[-] 安装相关软件(git,tar)... " -else - echo_cyan_n "[+] Installing dependent software(git,tar)... " -fi -if [ -x "$(command -v yum)" ]; then - yum install -y git tar >error -elif [ -x "$(command -v apt-get)" ]; then - apt-get install -y git tar >error -elif [ -x "$(command -v pacman)" ]; then - pacman -Syu --noconfirm git tar >error -elif [ -x "$(command -v zypper)" ]; then - zypper --non-interactive install git tar >error +# Install related software +echo_cyan_n "[+] Installing dependent software(git,tar)... " +if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; +elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; +elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; +elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; fi -# 判断相关软件是否安装成功 -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then - if [ "$zh" == 1 ]; then - echo_green "成功" - else - echo_green "Success" - fi -else - if [ "$zh" == 1 ]; then - echo_red "失败" - else - echo_red "Failed" - fi +# Determine whether the relevant software is installed successfully +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] + then + echo_green "Success" + else + echo_red "Failed" echo "$error" - if [ "$zh" == 1 ]; then - Red_Error "[x] 相关软件安装失败,请手动安装 git 和 tar 软件包!" - else - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - fi + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" exit fi -# 安装 Node 环境 + +# Install the Node environment Install_Node -# 安装 MCSManager +# Install MCSManager Install_MCSManager -# 创建 MCSManager 后台服务 +# Create MCSManager background service Create_Service + diff --git a/setup_cn.sh b/setup_cn.sh index 9c4e4d3..99d7fa7 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1,377 +1,266 @@ #!/bin/bash -#### MCSManager Command Line Interface -#### Made by nuomiaa, CreeperKong, unitwk +printf "\033c" -#### Copyright © 2023 MCSManager All rights reserved. +# print func +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} -printf "\033c" +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} -error="" -node="v14.19.1" -arch=$(uname -m) +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} + +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +# script info +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer (Chinese Version) ++---------------------------------------------------------------------- +| Copyright © 2023 MCSManager. ++---------------------------------------------------------------------- +| Contributors: Nuomiaa, CreeperKong, Unitwk, FunnyShadow ++---------------------------------------------------------------------- + +We will use servers in the China to speed up your installation! +我们将使用中国地区的服务器来加速您的安装速度! +" + +# Config mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" +node="v14.19.1" zh=$( [[ $(locale -a) =~ "zh" ]] && echo 1 export LANG=zh_CN.UTF-8 || echo 0 ) +error="" +arch=$(uname -m) + Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 } -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} +Install_Node() { + echo_cyan_n "[+] Install Node.JS environment... " -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} + rm -irf "$node_install_path" -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" -} + cd /opt || exit -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} + wget https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz -Install_Node() { - if [ "$zh" == 1 ]; then - echo_cyan_n "[+] 安装 Node 环境... " - else - echo_cyan_n "[+] Install Node environment... " - fi - - rm -irf "$node_install_path" - - cd /opt || exit - - wget -o /dev/null https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz - - tar -zxf node-"$node"-linux-"$arch".tar.gz - - rm -rf node-"$node"-linux-"$arch".tar.gz - - if [ ! -L /usr/bin/node ] && [ ! -f /usr/bin/node ]; then - ln -s "$node_install_path"/bin/node /usr/bin/node - fi - if [ ! -L /usr/bin/npm ] && [ ! -f /usr/bin/npm ]; then - ln -s "$node_install_path"/bin/npm /usr/bin/npm - fi - - chmod +x "$node_install_path"/bin/node - chmod +x "$node_install_path"/bin/npm - - if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ]; then - if [ "$zh" == 1 ]; then - echo_green "成功" - else - echo_green "Success" - fi - else - if [ "$zh" == 1 ]; then - echo_red "失败" - Red_Error "[x] Node 安装失败!" - else - echo_red "Failed" - Red_Error "[x] Node installation failed!" - fi - fi - - echo - echo_yellow "=============== Node Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node Version ===============" - echo - - sleep 3 + tar -zxf node-"$node"-linux-"$arch".tar.gz + + rm -rf node-"$node"-linux-"$arch".tar.gz + + if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] + then + echo_green "Success" + else + echo_red "Failed" + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node.JS Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node.JS Version ===============" + echo + + sleep 3 } + Install_MCSManager() { - if [ "$zh" == 1 ]; then - echo_cyan "[+] 安装 MCSManager..." - else - echo_cyan "[+] Install MCSManager..." - fi - - # 删除服务 - rm -f /etc/systemd/system/mcsm-daemon.service - rm -f /etc/systemd/system/mcsm-web.service - - # 重载 - systemctl daemon-reload - - # echo "[x] Delete the original MCSManager" - rm -irf ${mcsmanager_install_path} - - # echo "[+] mkdir -p ${mcsmanager_install_path}" - mkdir -p ${mcsmanager_install_path} || exit - - # echo "[→] cd ${mcsmanager_install_path}" - cd ${mcsmanager_install_path} || exit - - if [ "$zh" == 1 ]; then - echo_cyan "[↓] Git 克隆 MCSManager-Daemon..." - else - echo_cyan "[↓] Git clone MCSManager-Daemon..." - fi - git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Daemon-Production.git daemon - - # echo "[→] cd daemon" - cd daemon || exit - - if [ "$zh" == 1 ]; then - echo_cyan "[+] 安装 MCSManager-Daemon 依赖库..." - else - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - fi - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com >error - - # echo "[←] cd .." - cd .. - - if [ "$zh" == 1 ]; then - echo_cyan "[↓] Git 克隆 MCSManager-Web..." - else - echo_cyan "[↓] Git clone MCSManager-Web..." - fi - git clone --single-branch -b master --depth 1 https://gitee.com/mcsmanager/MCSManager-Web-Production.git web - - # echo "[→] cd web" - cd web || exit - - if [ "$zh" == 1 ]; then - echo_cyan "[+] 安装 MCSManager-Web 依赖库..." - else - echo_cyan "[+] Install MCSManager-Web dependencies..." - fi - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com >error - - echo - echo_yellow "=============== MCSManager ===============" - echo_green " Daemon: ${mcsmanager_install_path}/daemon" - echo_green " Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - if [ "$zh" == 1 ]; then - echo_green "[+] MCSManager 安装成功!" - else - echo_green "[+] MCSManager installation success!" - fi - - sleep 3 + echo_cyan "[+] Install MCSManager..." + + # stop service + systemctl stop mcsm-{web,daemon} + + # delete service + rm -rf /etc/systemd/system/mcsm-daemon.service + rm -rf /etc/systemd/system/mcsm-web.service + systemctl daemon-reload + + mkdir -p ${mcsmanager_install_path} || exit + + # cd /opt/mcsmanager + cd ${mcsmanager_install_path} || exit + + + # donwload MCSManager release + wget ${mcsmanager_donwload_addr} + tar -zxf mcsmanager_linux_release.tar.gz -o + rm -rf "${mcsmanager_install_path}/mcsmanager_linux_release.tar.gz" + + # echo "[→] cd daemon" + cd daemon || exit + + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production > npm_install_log + + # echo "[←] cd .." + cd ../web || exit + + echo_cyan "[+] Install MCSManager-Web dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production > npm_install_log + + echo + echo_yellow "=============== MCSManager ===============" + echo_green " Daemon: ${mcsmanager_install_path}/daemon" + echo_green " Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" + + sleep 3 } Create_Service() { - if [ "$zh" == 1 ]; then - echo_cyan "[+] 创建 MCSManager 服务..." - else - echo_cyan "[+] Create MCSManager service..." - fi + echo_cyan "[+] Create MCSManager service..." - echo " + echo " [Unit] Description=MCSManager Daemon [Service] WorkingDirectory=/opt/mcsmanager/daemon ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID +ExecReload=/bin/kill -s QUIT $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service +" > /etc/systemd/system/mcsm-daemon.service - echo " + echo " [Unit] Description=MCSManager Web [Service] WorkingDirectory=/opt/mcsmanager/web ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID +ExecReload=/bin/kill -s QUIT $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-web.service - - # 重载 - systemctl daemon-reload - - # 创建 Daemon 服务 - systemctl enable mcsm-daemon.service --now - - # 创建 Web 服务 - systemctl enable mcsm-web.service --now - - sleep 3 - - printf "\033c" +" > /etc/systemd/system/mcsm-web.service + + systemctl daemon-reload + systemctl enable mcsm-daemon.service --now + systemctl enable mcsm-web.service --now + + sleep 3 + + printf "\n\n" + echo_yellow "==================================================================" + if [ "$zh" == 1 ]; then + echo_green "安装已完成!欢迎使用 MCSManager 面板!" + echo_yellow " " + echo_cyan_n "控制面板地址: " + echo_yellow "http://你的公网IP:23333" + echo_red "你必须开放 23333(面板)和 24444(守护进程用)端口,控制面板需要这两个端口才能正常工作。" + echo_yellow " " + echo_cyan "下面是常用的几个命令:" + echo_cyan "启动面板 systemctl start mcsm-{daemon,web}.service" + echo_cyan "停止面板 systemctl stop mcsm-{daemon,web}.service" + echo_cyan "重启面板 systemctl restart mcsm-{daemon,web}.service" + echo_yellow " " + echo_cyan "官方文档(必读):https://docs.mcsmanager.com/" echo_yellow "==================================================================" - if [ "$zh" == 1 ]; then - echo_green "欢迎使用 MCSManager,您可以通过以下方式访问:" - echo_yellow "==================================================================" - echo_cyan_n "控制面板地址: " - echo_yellow "http://localhost:23333" - echo_red "若无法访问面板,请检查防火墙/安全组是否有放行面板 23333 和 24444 端口,控制面板需要这两个端口才能正常工作。" - echo_yellow "==================================================================" - echo_cyan "重启 systemctl restart mcsm-{daemon,web}.service" - echo_cyan "禁用 systemctl disable mcsm-{daemon,web}.service" - echo_cyan "启用 systemctl enable mcsm-{daemon,web}.service" - echo_cyan "启动 systemctl start mcsm-{daemon,web}.service" - echo_cyan "停止 systemctl stop mcsm-{daemon,web}.service" - echo_cyan "更多使用说明,请参考:https://docs.mcsmanager.com/" - else - echo_green "Welcome to MCSManager, you can access it by the following ways:" - echo_yellow "==================================================================" - echo_cyan_n "Web Service Address: " - echo_yellow "http://localhost:23333" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow "==================================================================" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_cyan "systemctl disable mcsm-{daemon,web}.service" - echo_cyan "systemctl enable mcsm-{daemon,web}.service" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "More info: https://docs.mcsmanager.com/" - fi + else echo_yellow "==================================================================" - + echo_green "Installation is complete! Welcome to the MCSManager panel!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" + echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" + fi } -# ----------------- 程序启动 ----------------- - -# 删除 Shell 脚本自身 -rm -f "$0" - -# 检查执行用户权限 -if [ "$(whoami)" != "root" ]; then - if [ "$zh" == 1 ]; then - Red_Error "[x] 请使用 root 权限执行 MCSManager 安装命令!" - else - Red_Error "[x] Please execute the MCSManager installation command with root permission!" - fi -fi -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2022 MCSManager All rights reserved. -+---------------------------------------------------------------------- -| Shell Install Script by Nuomiaa & CreeperKong -+---------------------------------------------------------------------- -" -# 环境检查 +# Environmental inspection if [ "$arch" == x86_64 ]; then - arch=x64 - #echo "[-] x64 architecture detected" + arch=x64 + #echo "[-] x64 architecture detected" elif [ $arch == aarch64 ]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" elif [ $arch == arm ]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" elif [ $arch == ppc64le ]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" + arch=ppc64le + #echo "[-] IBM POWER architecture detected" elif [ $arch == s390x ]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" else - if [ "$zh" == 1 ]; then - Red_Error "[x] 抱歉,暂不支持您的 体系架构($arch)!" - else - Red_Error "[x] Sorry, this architecture is not supported yet!" - fi - exit + Red_Error "[x] Sorry, this architecture is not supported yet!" + Red_Error "[x] Please try to install manually: https://github.com/MCSManager/MCSManager#linux" + exit fi -# 定义变量 Node 安装目录 +# Define the variable Node installation directory node_install_path="/opt/node-$node-linux-$arch" -# 检查网络连接 -if [ "$zh" == 1 ]; then - echo_cyan "[-] 体系架构:$arch" -else - echo_cyan "[-] Architecture: $arch" -fi - -# MCSManager 已安装 -if [ -d "$mcsmanager_install_path" ]; then - printf "\033c" - if [ "$zh" == 1 ]; then - echo_red "---------------------------------------------------- -检查到已有 MCSManager 安装在 \"$mcsmanager_install_path\" -继续安装会删除原有 MCSManager 面版的所有数据! ----------------------------------------------------- -将在 10 秒后继续安装,取消请按 Ctrl + Z/C 键!" - else - echo_red "---------------------------------------------------- -MCSManager is installed at \"$mcsmanager_install_path\" -Continuing the installation will delete the original MCSManager! ----------------------------------------------------- -Installation will continue in 10 seconds, press Ctrl + Z/C to cancel!" - fi - sleep 10 -fi +# Check network connection +echo_cyan "[-] Architecture: $arch" -# 安装相关软件 -if [ "$zh" == 1 ]; then - echo_cyan_n "[-] 安装相关软件(git,tar)... " -else - echo_cyan_n "[+] Installing dependent software(git,tar)... " -fi -if [ -x "$(command -v yum)" ]; then - yum install -y git tar >error -elif [ -x "$(command -v apt-get)" ]; then - apt-get install -y git tar >error -elif [ -x "$(command -v pacman)" ]; then - pacman -Syu --noconfirm git tar >error -elif [ -x "$(command -v zypper)" ]; then - zypper --non-interactive install git tar >error +# Install related software +echo_cyan_n "[+] Installing dependent software(git,tar)... " +if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; +elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; +elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; +elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; fi -# 判断相关软件是否安装成功 -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then - if [ "$zh" == 1 ]; then - echo_green "成功" - else - echo_green "Success" - fi -else - if [ "$zh" == 1 ]; then - echo_red "失败" - else - echo_red "Failed" - fi +# Determine whether the relevant software is installed successfully +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] + then + echo_green "Success" + else + echo_red "Failed" echo "$error" - if [ "$zh" == 1 ]; then - Red_Error "[x] 相关软件安装失败,请手动安装 git 和 tar 软件包!" - else - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - fi + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" exit fi -# 安装 Node 环境 + +# Install the Node environment Install_Node -# 安装 MCSManager +# Install MCSManager Install_MCSManager -# 创建 MCSManager 后台服务 +# Create MCSManager background service Create_Service + diff --git a/setup_en.sh b/setup_en.sh index 75f229f..341fc97 100644 --- a/setup_en.sh +++ b/setup_en.sh @@ -1,18 +1,11 @@ #!/bin/bash -printf "\033c" -error="" -node="v14.19.1" -arch=$(uname -m) -mcsmanager_install_path="/opt/mcsmanager" +printf "\033c" -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 +# print func +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" } - echo_red() { printf '\033[1;31m%b\033[0m\n' "$@" } @@ -21,10 +14,6 @@ echo_green() { printf '\033[1;32m%b\033[0m\n' "$@" } -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} - echo_cyan_n() { printf '\033[1;36m%b\033[0m' "$@" } @@ -33,8 +22,34 @@ echo_yellow() { printf '\033[1;33m%b\033[0m\n' "$@" } +# script info +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +| Copyright © 2023 MCSManager. ++---------------------------------------------------------------------- +| Contributors: Nuomiaa, CreeperKong, Unitwk, FunnyShadow ++---------------------------------------------------------------------- +" + +# Config +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" +node="v14.19.1" + +error="" +arch=$(uname -m) + +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + + Install_Node() { - echo_cyan_n "[+] Install Node environment... " + echo_cyan_n "[+] Install Node.JS environment... " rm -irf "$node_install_path" @@ -55,54 +70,49 @@ Install_Node() { fi echo - echo_yellow "=============== Node Version ===============" + echo_yellow "=============== Node.JS Version ===============" echo_yellow " node: $("$node_install_path"/bin/node -v)" echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node Version ===============" + echo_yellow "=============== Node.JS Version ===============" echo sleep 3 } + Install_MCSManager() { echo_cyan "[+] Install MCSManager..." - # delete service - rm -f /etc/systemd/system/mcsm-daemon.service - rm -f /etc/systemd/system/mcsm-web.service + # stop service + systemctl stop mcsm-{web,daemon} - # reload + # delete service + rm -rf /etc/systemd/system/mcsm-daemon.service + rm -rf /etc/systemd/system/mcsm-web.service systemctl daemon-reload - - # echo "[x] Delete the original MCSManager" - rm -irf ${mcsmanager_install_path} - # echo "[+] mkdir -p ${mcsmanager_install_path}" mkdir -p ${mcsmanager_install_path} || exit - # echo "[→] cd ${mcsmanager_install_path}" + # cd /opt/mcsmanager cd ${mcsmanager_install_path} || exit - echo_cyan "[↓] Git clone MCSManager-Daemon..." - git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Daemon-Production.git daemon + # donwload MCSManager release + wget ${mcsmanager_donwload_addr} + tar -zxf mcsmanager_linux_release.tar.gz -o + rm -rf "${mcsmanager_install_path}/mcsmanager_linux_release.tar.gz" + # echo "[→] cd daemon" cd daemon || exit echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com > error + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log # echo "[←] cd .." - cd .. - - echo_cyan "[↓] Git clone MCSManager-Web..." - git clone --single-branch -b master --depth 1 https://github.com/MCSManager/MCSManager-Web-Production.git web - - # echo "[→] cd web" - cd web || exit + cd ../web || exit echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com > error + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log echo echo_yellow "=============== MCSManager ===============" @@ -125,7 +135,7 @@ Description=MCSManager Daemon [Service] WorkingDirectory=/opt/mcsmanager/daemon ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID +ExecReload=/bin/kill -s QUIT $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID Environment=\"PATH=${PATH}\" @@ -140,7 +150,7 @@ Description=MCSManager Web [Service] WorkingDirectory=/opt/mcsmanager/web ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s HUP $MAINPID +ExecReload=/bin/kill -s QUIT $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID Environment=\"PATH=${PATH}\" @@ -154,46 +164,27 @@ WantedBy=multi-user.target sleep 3 - printf "\033c" + printf "\n\n" + echo_yellow "==================================================================" - echo_green "Welcome to MCSManager, you can access it by the following ways:" - echo_yellow "==================================================================" - echo_cyan_n "Daemon Service Address: "; echo_yellow "http://localhost:24444" - echo_cyan_n "Web Service Address: "; echo_yellow "http://localhost:23333" - echo_cyan_n "Username: "; echo_yellow "root" - echo_cyan_n "Password: "; echo_yellow "123456" + echo_green "Installation is complete! Welcome to the MCSManager panel !!!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" + echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow "==================================================================" + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" echo_cyan "systemctl restart mcsm-{daemon,web}.service" echo_cyan "systemctl disable mcsm-{daemon,web}.service" echo_cyan "systemctl enable mcsm-{daemon,web}.service" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "More info: https://docs.mcsmanager.com/" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" echo_yellow "==================================================================" - - } -# ----------------- Program Start ----------------- - -# delete the shell script itself -rm -f "$0" - -# Check execute user permissions -if [ "$(whoami)" != "root" ]; then - Red_Error "[x] Please execute the MCSManager installation command with root permission!" -fi - -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2022 MCSManager All rights reserved. -+---------------------------------------------------------------------- -| Shell Install Script by Nuomiaa & CreeperKong -+---------------------------------------------------------------------- -" # Environmental inspection if [ "$arch" == x86_64 ]; then @@ -213,6 +204,7 @@ elif [ $arch == s390x ]; then #echo "[-] IBM LinuxONE architecture detected" else Red_Error "[x] Sorry, this architecture is not supported yet!" + Red_Error "[x] Please try to install manually: https://github.com/MCSManager/MCSManager#linux" exit fi @@ -222,17 +214,6 @@ node_install_path="/opt/node-$node-linux-$arch" # Check network connection echo_cyan "[-] Architecture: $arch" -# MCSManager Installed -if [ -d "$mcsmanager_install_path" ]; then - printf "\033c" - echo_red "---------------------------------------------------- -MCSManager is installed at \"$mcsmanager_install_path\" -Continuing the installation will delete the original MCSManager! ----------------------------------------------------- -Installation will continue in 10 seconds, press Ctrl + Z/C to cancel!" - sleep 10 -fi - # Install related software echo_cyan_n "[+] Installing dependent software(git,tar)... " if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; From 3df05f28e510daeb99d838f34043ae09e21420b8 Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 21:07:21 +0800 Subject: [PATCH 075/463] Sync code --- setup_cn.sh | 26 +++++++++++++------------- setup_en.sh | 26 ++++++++++++++------------ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index 99d7fa7..ebfdf72 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1,5 +1,17 @@ #!/bin/bash +# Config +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" +node="v14.19.1" +zh=$( + [[ $(locale -a) =~ "zh" ]] && echo 1 + export LANG=zh_CN.UTF-8 || echo 0 +) + +error="" +arch=$(uname -m) + printf "\033c" # print func @@ -24,7 +36,7 @@ echo_yellow() { # script info echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer (Chinese Version) +| MCSManager Installer +---------------------------------------------------------------------- | Copyright © 2023 MCSManager. +---------------------------------------------------------------------- @@ -35,18 +47,6 @@ We will use servers in the China to speed up your installation! 我们将使用中国地区的服务器来加速您的安装速度! " -# Config -mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" -node="v14.19.1" -zh=$( - [[ $(locale -a) =~ "zh" ]] && echo 1 - export LANG=zh_CN.UTF-8 || echo 0 -) - -error="" -arch=$(uname -m) - Red_Error() { echo '=================================================' printf '\033[1;31;40m%b\033[0m\n' "$@" diff --git a/setup_en.sh b/setup_en.sh index 341fc97..d691c47 100644 --- a/setup_en.sh +++ b/setup_en.sh @@ -1,5 +1,17 @@ #!/bin/bash +# Config +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" +node="v14.19.1" +zh=$( + [[ $(locale -a) =~ "zh" ]] && echo 1 + export LANG=zh_CN.UTF-8 || echo 0 +) + +error="" +arch=$(uname -m) + printf "\033c" # print func @@ -32,14 +44,6 @@ echo_cyan "+-------------------------------------------------------------------- +---------------------------------------------------------------------- " -# Config -mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" -node="v14.19.1" - -error="" -arch=$(uname -m) - Red_Error() { echo '=================================================' printf '\033[1;31;40m%b\033[0m\n' "$@" @@ -55,7 +59,7 @@ Install_Node() { cd /opt || exit - wget -o /dev/null https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz + wget https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz tar -zxf node-"$node"-linux-"$arch".tar.gz @@ -177,11 +181,9 @@ WantedBy=multi-user.target echo_cyan "systemctl start mcsm-{daemon,web}.service" echo_cyan "systemctl stop mcsm-{daemon,web}.service" echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_cyan "systemctl disable mcsm-{daemon,web}.service" - echo_cyan "systemctl enable mcsm-{daemon,web}.service" echo_yellow " " echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + echo_yellow "==================================================================" } From dfad89277a782f51f9e2656040ed9cb4e30e2791 Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 21:07:33 +0800 Subject: [PATCH 076/463] Sync code --- setup.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/setup.sh b/setup.sh index 341fc97..d691c47 100644 --- a/setup.sh +++ b/setup.sh @@ -1,5 +1,17 @@ #!/bin/bash +# Config +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" +node="v14.19.1" +zh=$( + [[ $(locale -a) =~ "zh" ]] && echo 1 + export LANG=zh_CN.UTF-8 || echo 0 +) + +error="" +arch=$(uname -m) + printf "\033c" # print func @@ -32,14 +44,6 @@ echo_cyan "+-------------------------------------------------------------------- +---------------------------------------------------------------------- " -# Config -mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" -node="v14.19.1" - -error="" -arch=$(uname -m) - Red_Error() { echo '=================================================' printf '\033[1;31;40m%b\033[0m\n' "$@" @@ -55,7 +59,7 @@ Install_Node() { cd /opt || exit - wget -o /dev/null https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz + wget https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz tar -zxf node-"$node"-linux-"$arch".tar.gz @@ -177,11 +181,9 @@ WantedBy=multi-user.target echo_cyan "systemctl start mcsm-{daemon,web}.service" echo_cyan "systemctl stop mcsm-{daemon,web}.service" echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_cyan "systemctl disable mcsm-{daemon,web}.service" - echo_cyan "systemctl enable mcsm-{daemon,web}.service" echo_yellow " " echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + echo_yellow "==================================================================" } From dcae1969344f3d60cc4582d501bef20978a60f07 Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 21:25:02 +0800 Subject: [PATCH 077/463] Feat: gitee -> github --- setup.sh | 2 +- setup_en.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index d691c47..b3b3675 100644 --- a/setup.sh +++ b/setup.sh @@ -2,7 +2,7 @@ # Config mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" +mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" node="v14.19.1" zh=$( [[ $(locale -a) =~ "zh" ]] && echo 1 diff --git a/setup_en.sh b/setup_en.sh index d691c47..b3b3675 100644 --- a/setup_en.sh +++ b/setup_en.sh @@ -2,7 +2,7 @@ # Config mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" +mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" node="v14.19.1" zh=$( [[ $(locale -a) =~ "zh" ]] && echo 1 From 07bcfade8407b22a34e317d6d3fa121beabdedae Mon Sep 17 00:00:00 2001 From: unitwk Date: Mon, 5 Jun 2023 21:48:39 +0800 Subject: [PATCH 078/463] Feat: add better download addr --- setup.sh | 8 +++----- setup_cn.sh | 4 +++- setup_en.sh | 8 +++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/setup.sh b/setup.sh index b3b3675..cfe8539 100644 --- a/setup.sh +++ b/setup.sh @@ -2,12 +2,8 @@ # Config mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" +mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" node="v14.19.1" -zh=$( - [[ $(locale -a) =~ "zh" ]] && echo 1 - export LANG=zh_CN.UTF-8 || echo 0 -) error="" arch=$(uname -m) @@ -59,6 +55,8 @@ Install_Node() { cd /opt || exit + rm -rf node-"$node"-linux-"$arch".tar.gz + wget https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz tar -zxf node-"$node"-linux-"$arch".tar.gz diff --git a/setup_cn.sh b/setup_cn.sh index ebfdf72..1ad0582 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -2,7 +2,7 @@ # Config mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" +mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/release/mcsmanager_linux_release.tar.gz" node="v14.19.1" zh=$( [[ $(locale -a) =~ "zh" ]] && echo 1 @@ -62,6 +62,8 @@ Install_Node() { cd /opt || exit + rm -rf node-"$node"-linux-"$arch".tar.gz + wget https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz tar -zxf node-"$node"-linux-"$arch".tar.gz diff --git a/setup_en.sh b/setup_en.sh index b3b3675..cfe8539 100644 --- a/setup_en.sh +++ b/setup_en.sh @@ -2,12 +2,8 @@ # Config mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" +mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" node="v14.19.1" -zh=$( - [[ $(locale -a) =~ "zh" ]] && echo 1 - export LANG=zh_CN.UTF-8 || echo 0 -) error="" arch=$(uname -m) @@ -59,6 +55,8 @@ Install_Node() { cd /opt || exit + rm -rf node-"$node"-linux-"$arch".tar.gz + wget https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz tar -zxf node-"$node"-linux-"$arch".tar.gz From 57dd9ce811fc5de9cdf24dc4ab90ef06652efa9c Mon Sep 17 00:00:00 2001 From: jgc9527 Date: Wed, 28 Jun 2023 13:07:33 +0800 Subject: [PATCH 079/463] =?UTF-8?q?=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20?= =?UTF-8?q?=20=20setup=5Fcn.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- error | 13 +++++++++++++ setup_cn.sh | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 error mode change 100644 => 100755 setup_cn.sh diff --git a/error b/error new file mode 100644 index 0000000..a063f80 --- /dev/null +++ b/error @@ -0,0 +1,13 @@ +正在读取软件包列表... +正在分析软件包的依赖关系树... +正在读取状态信息... +git 已经是最新版 (1:2.30.2-1+deb11u2)。 +tar 已经是最新版 (1.34+dfsg-1)。 +下列软件包是自动安装的并且现在不需要了: + bsdmainutils geoip-database libbind9-161 libdns1104 libdns1110 libgeoip1 + libicu63 libisc1100 libisc1105 libisccc161 libisccfg163 liblwres161 + libmpdec2 libperl5.28 libpython2-stdlib libpython3.7-minimal + libpython3.7-stdlib linux-image-4.19.0-6-amd64 ncal python2 python2-minimal + python3.7-minimal +使用'apt autoremove'来卸载它(它们)。 +升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 8 个软件包未被升级。 diff --git a/setup_cn.sh b/setup_cn.sh old mode 100644 new mode 100755 index 1ad0582..eaf60ef --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1,5 +1,11 @@ #!/bin/bash - +# 检查当前用户是否为 root 用户 +if [ $(id -u) -ne 0 ]; then + echo -e "\033[31m需要 root 权限执行此脚本,请使用 sudo 或者切换到 root 用户。\033[0m" + exit 1 +fi +# 如果当前用户是 root 用户,则执行脚本的主体部分 +echo -e "\033[33m当前用户是 root 用户,开始执行 MCSManager 安装脚本。\033[0m" # Config mcsmanager_install_path="/opt/mcsmanager" mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/release/mcsmanager_linux_release.tar.gz" From bfa8b3df875f3a349aacdf260dd67f29a0631c2a Mon Sep 17 00:00:00 2001 From: jgc9527 Date: Wed, 28 Jun 2023 13:10:51 +0800 Subject: [PATCH 080/463] =?UTF-8?q?=09=E5=88=A0=E9=99=A4=EF=BC=9A=20=20=20?= =?UTF-8?q?=20=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- error | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 error diff --git a/error b/error deleted file mode 100644 index a063f80..0000000 --- a/error +++ /dev/null @@ -1,13 +0,0 @@ -正在读取软件包列表... -正在分析软件包的依赖关系树... -正在读取状态信息... -git 已经是最新版 (1:2.30.2-1+deb11u2)。 -tar 已经是最新版 (1.34+dfsg-1)。 -下列软件包是自动安装的并且现在不需要了: - bsdmainutils geoip-database libbind9-161 libdns1104 libdns1110 libgeoip1 - libicu63 libisc1100 libisc1105 libisccc161 libisccfg163 liblwres161 - libmpdec2 libperl5.28 libpython2-stdlib libpython3.7-minimal - libpython3.7-stdlib linux-image-4.19.0-6-amd64 ncal python2 python2-minimal - python3.7-minimal -使用'apt autoremove'来卸载它(它们)。 -升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 8 个软件包未被升级。 From 33af138b1fb8efe8dd64c3917f695ac655cf01c5 Mon Sep 17 00:00:00 2001 From: Lily Chou Date: Tue, 4 Jul 2023 16:13:54 +0800 Subject: [PATCH 081/463] fix: zypper needs sudo to run --- setup.sh | 2 +- setup_cn.sh | 2 +- setup_en.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index cfe8539..e0d382c 100644 --- a/setup.sh +++ b/setup.sh @@ -219,7 +219,7 @@ echo_cyan_n "[+] Installing dependent software(git,tar)... " if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; -elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; +elif [ -x "$(command -v zypper)" ]; then sudo zypper --non-interactive install git tar > error; fi # Determine whether the relevant software is installed successfully diff --git a/setup_cn.sh b/setup_cn.sh index eaf60ef..861c41f 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -248,7 +248,7 @@ echo_cyan_n "[+] Installing dependent software(git,tar)... " if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; -elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; +elif [ -x "$(command -v zypper)" ]; then sudo zypper --non-interactive install git tar > error; fi # Determine whether the relevant software is installed successfully diff --git a/setup_en.sh b/setup_en.sh index cfe8539..e0d382c 100644 --- a/setup_en.sh +++ b/setup_en.sh @@ -219,7 +219,7 @@ echo_cyan_n "[+] Installing dependent software(git,tar)... " if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; -elif [ -x "$(command -v zypper)" ]; then zypper --non-interactive install git tar > error; +elif [ -x "$(command -v zypper)" ]; then sudo zypper --non-interactive install git tar > error; fi # Determine whether the relevant software is installed successfully From 5a08432506b52541367672dcfd480dd6723b72b2 Mon Sep 17 00:00:00 2001 From: huangsijun17 Date: Mon, 16 Oct 2023 13:19:09 +0800 Subject: [PATCH 082/463] Modify the judgment statement to comply with standards and be compatible with zsh. --- setup.sh | 20 ++++++++++---------- setup_cn.sh | 24 ++++++++++++------------ setup_en.sh | 20 ++++++++++---------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/setup.sh b/setup.sh index e0d382c..f5e7ef2 100644 --- a/setup.sh +++ b/setup.sh @@ -63,7 +63,7 @@ Install_Node() { rm -rf node-"$node"-linux-"$arch".tar.gz - if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]] then echo_green "Success" else @@ -187,19 +187,19 @@ WantedBy=multi-user.target # Environmental inspection -if [ "$arch" == x86_64 ]; then +if [[ "$arch" == x86_64 ]]; then arch=x64 #echo "[-] x64 architecture detected" -elif [ $arch == aarch64 ]; then +elif [[ $arch == aarch64 ]]; then arch=arm64 #echo "[-] 64-bit ARM architecture detected" -elif [ $arch == arm ]; then +elif [[ $arch == arm ]]; then arch=armv7l #echo "[-] 32-bit ARM architecture detected" -elif [ $arch == ppc64le ]; then +elif [[ $arch == ppc64le ]]; then arch=ppc64le #echo "[-] IBM POWER architecture detected" -elif [ $arch == s390x ]; then +elif [[ $arch == s390x ]]; then arch=s390x #echo "[-] IBM LinuxONE architecture detected" else @@ -216,10 +216,10 @@ echo_cyan "[-] Architecture: $arch" # Install related software echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; -elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; -elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; -elif [ -x "$(command -v zypper)" ]; then sudo zypper --non-interactive install git tar > error; +if [[ -x "$(command -v yum)" ]]; then yum install -y git tar > error; +elif [[ -x "$(command -v apt-get)" ]]; then apt-get install -y git tar > error; +elif [[ -x "$(command -v pacman)" ]]; then pacman -Syu --noconfirm git tar > error; +elif [[ -x "$(command -v zypper)" ]]; then sudo zypper --non-interactive install git tar > error; fi # Determine whether the relevant software is installed successfully diff --git a/setup_cn.sh b/setup_cn.sh index 861c41f..24518f6 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1,6 +1,6 @@ #!/bin/bash # 检查当前用户是否为 root 用户 -if [ $(id -u) -ne 0 ]; then +if [[ $(id -u) -ne 0 ]]; then echo -e "\033[31m需要 root 权限执行此脚本,请使用 sudo 或者切换到 root 用户。\033[0m" exit 1 fi @@ -76,7 +76,7 @@ Install_Node() { rm -rf node-"$node"-linux-"$arch".tar.gz - if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]] then echo_green "Success" else @@ -181,7 +181,7 @@ WantedBy=multi-user.target printf "\n\n" echo_yellow "==================================================================" - if [ "$zh" == 1 ]; then + if [[ "$zh" == 1 ]]; then echo_green "安装已完成!欢迎使用 MCSManager 面板!" echo_yellow " " echo_cyan_n "控制面板地址: " @@ -216,19 +216,19 @@ WantedBy=multi-user.target # Environmental inspection -if [ "$arch" == x86_64 ]; then +if [[ "$arch" == x86_64 ]]; then arch=x64 #echo "[-] x64 architecture detected" -elif [ $arch == aarch64 ]; then +elif [[ $arch == aarch64 ]]; then arch=arm64 #echo "[-] 64-bit ARM architecture detected" -elif [ $arch == arm ]; then +elif [[ $arch == arm ]]; then arch=armv7l #echo "[-] 32-bit ARM architecture detected" -elif [ $arch == ppc64le ]; then +elif [[ $arch == ppc64le ]]; then arch=ppc64le #echo "[-] IBM POWER architecture detected" -elif [ $arch == s390x ]; then +elif [[ $arch == s390x ]]; then arch=s390x #echo "[-] IBM LinuxONE architecture detected" else @@ -245,10 +245,10 @@ echo_cyan "[-] Architecture: $arch" # Install related software echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; -elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; -elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; -elif [ -x "$(command -v zypper)" ]; then sudo zypper --non-interactive install git tar > error; +if [[ -x "$(command -v yum)" ]]; then yum install -y git tar > error; +elif [[ -x "$(command -v apt-get)" ]]; then apt-get install -y git tar > error; +elif [[ -x "$(command -v pacman)" ]]; then pacman -Syu --noconfirm git tar > error; +elif [[ -x "$(command -v zypper)" ]]; then sudo zypper --non-interactive install git tar > error; fi # Determine whether the relevant software is installed successfully diff --git a/setup_en.sh b/setup_en.sh index e0d382c..f5e7ef2 100644 --- a/setup_en.sh +++ b/setup_en.sh @@ -63,7 +63,7 @@ Install_Node() { rm -rf node-"$node"-linux-"$arch".tar.gz - if [ -f "$node_install_path"/bin/node ] && [ "$("$node_install_path"/bin/node -v)" == "$node" ] + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]] then echo_green "Success" else @@ -187,19 +187,19 @@ WantedBy=multi-user.target # Environmental inspection -if [ "$arch" == x86_64 ]; then +if [[ "$arch" == x86_64 ]]; then arch=x64 #echo "[-] x64 architecture detected" -elif [ $arch == aarch64 ]; then +elif [[ $arch == aarch64 ]]; then arch=arm64 #echo "[-] 64-bit ARM architecture detected" -elif [ $arch == arm ]; then +elif [[ $arch == arm ]]; then arch=armv7l #echo "[-] 32-bit ARM architecture detected" -elif [ $arch == ppc64le ]; then +elif [[ $arch == ppc64le ]]; then arch=ppc64le #echo "[-] IBM POWER architecture detected" -elif [ $arch == s390x ]; then +elif [[ $arch == s390x ]]; then arch=s390x #echo "[-] IBM LinuxONE architecture detected" else @@ -216,10 +216,10 @@ echo_cyan "[-] Architecture: $arch" # Install related software echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [ -x "$(command -v yum)" ]; then yum install -y git tar > error; -elif [ -x "$(command -v apt-get)" ]; then apt-get install -y git tar > error; -elif [ -x "$(command -v pacman)" ]; then pacman -Syu --noconfirm git tar > error; -elif [ -x "$(command -v zypper)" ]; then sudo zypper --non-interactive install git tar > error; +if [[ -x "$(command -v yum)" ]]; then yum install -y git tar > error; +elif [[ -x "$(command -v apt-get)" ]]; then apt-get install -y git tar > error; +elif [[ -x "$(command -v pacman)" ]]; then pacman -Syu --noconfirm git tar > error; +elif [[ -x "$(command -v zypper)" ]]; then sudo zypper --non-interactive install git tar > error; fi # Determine whether the relevant software is installed successfully From 6c9f0c37f927b262aba5cc66e0d218444184e54f Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 17:57:30 +0800 Subject: [PATCH 083/463] Updating the Docker Installation Method --- docker/README.md | 76 -------------- docker/README_cn.md | 77 -------------- docker/build/Dockerfile | 29 ++++++ docker/build/build.py | 83 +++++++++++++++ docker/build/entrypoint.sh | 23 +++++ docker/docs/README.md | 180 +++++++++++++++++++++++++++++++++ docker/docs/README_cn.md | 178 ++++++++++++++++++++++++++++++++ docker/examples/cn/daemon.yaml | 22 ++-- docker/examples/cn/full.yaml | 42 ++++---- docker/examples/cn/web.yaml | 22 ++-- 10 files changed, 540 insertions(+), 192 deletions(-) delete mode 100644 docker/README.md delete mode 100644 docker/README_cn.md create mode 100644 docker/build/Dockerfile create mode 100755 docker/build/build.py create mode 100644 docker/build/entrypoint.sh create mode 100644 docker/docs/README.md create mode 100644 docker/docs/README_cn.md diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 8e0ccc3..0000000 --- a/docker/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# Install MCSManager with Docker - -## Prerequisites - -You need to prepare the following before installation: - -- `docker` version `17.12.0+` has been installed -- `docker-compose` has been installed - -## Start installation - -First, use the following command to create the basic directory of `docker-compose` - -```bash -mkdir -p mcsmanager -cd mcsmanager -``` - -Then, create an empty file named `docker-compose.yaml` - -```bash -touch docker-compose.yaml -``` - -If you are a new user, please copy the configuration file below, modify the part marked with comments, and paste it into `docker-compose.yaml` - -If you cannot copy or paste this file, you can also click [here](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/full.yaml) to get the sample file - -```yaml -version: "2.4" - -services: - web: - image: bluefunny/mcsm-web:latest - volumes: - # This is the MCSManager control panel log storage directory - # The default is [/var/logs/mcsmanager/web] - - /var/logs/mcsmanager/web:/logs - - # This is the MCSManager control panel log storage directory - # The default is the data/web folder under the current directory - - ./data/web:/data - network_mode: host - command: /start - - daemon: - image: bluefunny/mcsm-daemon:latest - volumes: - # This is the MCSManager control panel log storage directory - # The default is [/var/logs/mcsmanager/daemon] - - /var/logs/mcsmanager/daemon:/logs - - # This is the MCSManager control panel log storage directory - # The default is the data/daemon folder under the current directory - - ./data/daemon:/data - network_mode: host - command: /start -``` - -If you are an old user and only plan to install a certain component of MCSManager (such as only installing the MCSManager daemon), please refer to the following two sample files and modify the part marked with comments - -- [MCSManager web](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/web.yaml) -- [MCSManager daemon](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/daemon.yaml) - -After all the above operations are completed, please run the following command to start MCSManager - -```bash -docker-compose -f docker-compose.yaml up -d -``` - -If everything runs normally, you can soon access `http://127.0.0.1:23333` to view the panel you just built! - -If you modify (or update) the `docker-compose.yaml` file later, please move it back to the directory and run the following command to make the modification take effect - -```bash -docker-compose up -d diff --git a/docker/README_cn.md b/docker/README_cn.md deleted file mode 100644 index e78511a..0000000 --- a/docker/README_cn.md +++ /dev/null @@ -1,77 +0,0 @@ -# 通过 Docker 安装 MCSManager - -## 预先准备 - -你需要提前做好以下几点准备 - -- 已经安装了 `17.12.0+` 版本的 `docker` -- 已经安装了 `docker-compose` - -## 开始安装 - -首先, 请先使用以下命令创建 `docker-compose` 基本目录 - -```bash -mkdir -p mcsmanager -cd mcsmanager -``` - -然后, 创建一个名为 `docker-compose.yaml` 的空文件 - -```bash -touch docker-compose.yaml -``` - -如果你是一个新用户, 请复制下面的配置文件, 修改其中注释标出的部分, 粘贴到 `docker-compose.yaml` 中即可 - -如果你无法复制或粘贴此文件, 你也可以[点击此处](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/full.yaml)获取示例文件 - -```yaml -version: "2.4" - -services: - web: - image: bluefunny/mcsm-web:latest - volumes: - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为 [/var/logs/mcsmanager/web] - - /var/logs/mcsmanager/web:/logs - - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为当前目录下的 data/web 文件夹 - - ./data/web:/data - network_mode: host - command: /start - - daemon: - image: bluefunny/mcsm-daemon:latest - volumes: - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为 [/var/logs/mcsmanager/daemon] - - /var/logs/mcsmanager/daemon:/logs - - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为当前目录下的 data/daemon 文件夹 - - ./data/daemon:/data - network_mode: host - command: /start -``` - -如果你是一个老用户, 并且只准备安装 MCSManager 的某个组件 (如仅安装 MCSManager 守护程序), 请查看下面这两个示例文件, 并修改其中注释标出的部分 - -- [MCSManager 控制面板](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/web.yaml) -- [MCSManager 守护程序](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/daemon.yaml) - -当上述操作全部完成后, 请运行以下命令以启动 MCSManager - -```bash -docker-compose -f docker-compose.yaml up -d -``` - -如果一切都运行正常, 那么不久后你就可以访问 `http://127.0.0.1:23333` 来查看你刚刚搭建好的面板了 ! - -如果你后期修改(或更新)了 `docker-compose.yaml` 文件, 请重新移动到该目录, 并运行以下命令以使修改生效 - -```bash -docker-compose up -d -``` diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile new file mode 100644 index 0000000..d2488e8 --- /dev/null +++ b/docker/build/Dockerfile @@ -0,0 +1,29 @@ +ARG TYPE +ARG VERSION +FROM debian:stable-slim AS base + +RUN sed -i.bak 's/deb.debian.org/mirrors.cernet.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ + && sed -i.bak 's|security.debian.org/debian-security|mirrors.cernet.edu.cn/debian-security|g' /etc/apt/sources.list.d/debian.sources \ + && apt-get update -y \ + && apt-get install -y curl ca-certificates openssl git tar sqlite3 fontconfig tzdata iproute2 gettext-base wget \ + && apt-get clean + +RUN cd /tmp \ + && wget https://nodejs.org/dist/latest-v20.x/node-v20.11.1-linux-x64.tar.gz -O node.tar.gz \ + && wget https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz -O mcsmanager.tar.gz \ + && tar -xzf node.tar.gz -C /opt/node --strip-components=1 \ + && tar -xzf mcsmanager.tar.gz -C /tmp/mcsmanager \ + && mv -f /tmp/mcsmanager/${TYPE} /opt/${TYPE} \ + && rm -rf /tmp/mcsmanager \ + && rm -rf node.tar.gz \ + && rm -rf mcsmanager.tar.gz + +RUN cd /opt/${TYPE} \ + && /opt/node/bin/npm install --production + +USER mcsmanager +ENV USER=mcsmanager HOME=/home/mcsmanager + +WORKDIR /opt/${TYPE} +COPY ./entrypoint.sh / +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/docker/build/build.py b/docker/build/build.py new file mode 100755 index 0000000..6a4eb62 --- /dev/null +++ b/docker/build/build.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +import argparse +import os +import subprocess +import sys +from typing import Iterator, NamedTuple + +class Context(NamedTuple): + type: str + version: str + tag: str + + +def iterate_all() -> Iterator[Context]: + for type in ['daemon', 'web']: + for version in [9]: + tag = f'bluefunny/mcsmanager:{type}-{version}' + yield Context(type, str(version) , tag) + + +def cmd_build(args: argparse.Namespace): + for ctx in iterate_all(): + print(f'======== MCSManager | Type: {ctx.type}, Version: {ctx.version}, Tag: {ctx.tag!r} ========') + + cmd = [ + 'docker', 'build', os.getcwd(), + '-t', ctx.tag, + '--build-arg', f'TYPE={ctx.type}', + '--build-arg', f'VERSION={ctx.version}', + ] + + if args.http_proxy is not None: + cmd.extend([ + '--build-arg', f'http_proxy={args.http_proxy}', + '--build-arg', f'https_proxy={args.http_proxy}', + ]) + subprocess.check_call(cmd) + + if args.push: + subprocess.check_call(['docker', 'push', ctx.tag]) + + +def cmd_push(args: argparse.Namespace): + for ctx in iterate_all(): + subprocess.check_call(['docker', 'push', ctx.tag]) + + +def cmd_delete(args: argparse.Namespace): + for ctx in iterate_all(): + subprocess.check_call(['docker', 'image', 'rm', ctx.tag]) + + +def main(): + parser = argparse.ArgumentParser() + subparsers = parser.add_subparsers(title='Command', help='Available commands', dest='command', required=True) + + parser_build = subparsers.add_parser('build', help='Build all images') + parser_build.add_argument('-p', '--push', action='store_true', help='Push after build') + parser_build.add_argument('--http-proxy', help='Set the url of http proxy to be used in build') + + subparsers.add_parser('push', help='Push all images') + subparsers.add_parser('delete', help='Delete all images') + + args = parser.parse_args() + + if args.command == 'build': + cmd_build(args) + elif args.command == 'push': + cmd_push(args) + elif args.command == 'delete': + cmd_delete(args) + else: + print('Unknown command {!r}'.format(args.command)) + sys.exit(1) + + +if __name__ == '__main__': + try: + main() + except subprocess.CalledProcessError as e: + print(type(e).__name__, e.returncode, file=sys.stderr) + except KeyboardInterrupt: + pass diff --git a/docker/build/entrypoint.sh b/docker/build/entrypoint.sh new file mode 100644 index 0000000..916481a --- /dev/null +++ b/docker/build/entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +echo "[-] Checking the operating environment..." + +if [ ! -f /opt/node/bin/node ]; then + echo "[x] The nodejs runtime environment could not be found, you may be using an incomplete version" + exit 1 +fi + +if [ -d /opt/daemon ]; then + type=daemon +elif [ -d /opt/web ]; then + type=web +else + echo "[x] The MCSManager file directory could not be found, you may be using an incomplete version" + exit 1 +fi + +echo "[-] The operating environment is normal, starting the MCSManager..." + +cd /opt/$type +eval "/opt/node/bin/node /opt/$type/app.js" \ No newline at end of file diff --git a/docker/docs/README.md b/docker/docs/README.md new file mode 100644 index 0000000..ee700a5 --- /dev/null +++ b/docker/docs/README.md @@ -0,0 +1,180 @@ +# Installing MCSManager via Docker + +[English](README.md) | [简体中文](./README_cn.md) + +## Prerequisites + +You need to have the following prerequisites ready beforehand: + +- You are using a `Linux` system. +- `docker-ce` package is already installed. + +> Due to the unconventional implementation of Docker Desktop on Windows, we neither support nor recommend installing MCSManager via Docker on Windows systems. + +## Getting Started + +Firstly, please switch to the root user. + +```bash +sudo su +``` + +Then, create some basic directories that will be used later. + +```bash +mkdir -p /opt/mcsmanager # MCSManager container directory +mkdir -p /opt/mcsmanager/data # MCSManager data directory +cd /opt/mcsmanager +``` + +Next, create an empty file named `docker-compose.yaml`. + +```bash +touch docker-compose.yaml +``` + +If you need to install both MCSManager Web and MCSManager Daemon simultaneously, please copy the configuration below and paste it into `docker-compose.yaml`. + +```yaml +version: "3" + +services: + web: + image: bluefunny/mcsm-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Web logs directory + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web data directory + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 + network_mode: host + command: /entrypoint.sh + + daemon: + image: bluefunny/mcsm-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Daemon logs directory + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon data directory + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 + network_mode: host +``` + +> If you are unable to copy or paste this file, you can also [click here](../examples/en/full.yaml) to get the example file. + +If you only need to install MCSManager Web, please copy the configuration below and paste it into `docker-compose.yaml`. + +```yaml +version: "3" + +services: + web: + image: bluefunny/mcsm-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Web logs directory + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web data directory + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 + network_mode: host +``` + +> If you are unable to copy or paste this file, you can also [click here](../examples/en/web.yaml) to get the example file. + +If you want to install only MCSManager Daemon, please copy the configuration below and paste it into `docker-compose.yaml`. + +```yaml +version: "3" + +services: + daemon: + image: bluefunny/mcsm-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Daemon logs directory + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon data directory + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 + network_mode: host +``` + +> If you are unable to copy or paste this file, you can also [click here](../examples/en/daemon.yaml) to get the example file. + +Once all the above operations are completed, modify the configuration file as needed, then run the following command to start MCSManager. + +```bash +docker compose -f docker-compose.yaml up -d +``` + +Now, you just need to wait for the command to complete the installation. + +If everything runs smoothly, shortly after, you can access `http://127.0.0.1:23333` to view the panel you just set up! + +> If running on a server, replace `127.0.0.1` with your public IP. + +> If you installed only the standalone MCSManager Daemon program, replace `23333` with `24444`. + +## Uninstallation + +If you no longer need MCSManager later on, you can navigate to the folder where you placed `docker-compose.yml` and then enter the following command to uninstall. + +```bash +docker compose down +rm -rf data +``` + +--- + +Congratulations! You have completed all the tasks, and now you can start using MCSManager! + +However, if you find the original MCSManager Web or MCSManager Daemon images insufficient, you can also compile them yourself. + +Below is a simple compilation tutorial. + +--- + +## Self-Compilation + +> Please note that you need to install `docker-ce` and `python` packages beforehand, and you need to have some Docker usage experience. + +If you need to compile yourself, you can use the files in the `build` folder in this directory for compilation. + +- `Dockerfile-daemon` is the image construction file for MCSManager Daemon. +- `Dockerfile-web` is the image construction file for MCSManager Web. +- `entrypoint.sh` is the default entry script executed in the image, which will run when the image starts. +- `build.py` is a Python script used to build images. Use `python build.py -h` to get detailed help. + +You can use the following commands to build the images. + +```bash +python build.py build +python build.py build --push # If you need to push the images to Docker Hub, note: this requires you to pre-configure Docker Registry yourself. +``` + +If you prefer not to use the `build.py` script, you can also use the following commands to build the images. + +```bash +docker build . -f -t # For example: docker build . -f Dockerfile -t bluefunny/mcsm-daemon:9 --build-arg TYPE=daemon --build-arg VERSION=9 +docker push # If you need to push the images to Docker Hub, note: this requires you to pre-configure Docker Registry yourself. +``` + +After the build is complete, you just need to replace the `image` section in the configuration files mentioned above with the name of the image you built yourself. + +### This article was translated by ChatGPT, there may be some errors, if you find these errors, please submit an Issue to let us know \ No newline at end of file diff --git a/docker/docs/README_cn.md b/docker/docs/README_cn.md new file mode 100644 index 0000000..cc67067 --- /dev/null +++ b/docker/docs/README_cn.md @@ -0,0 +1,178 @@ +# 通过 Docker 安装 MCSManager + +[English](README.md) | [简体中文](./README_cn.md) + +## 预先准备 + +你需要提前做好以下两点准备 + +- 你使用的是 `Linux` 系统 +- 已经安装了 `docker-ce` 软件包 + +> 由于 Windows 上的 Docker Desktop 实现方式并非常规, 因此, 我们不支持也不建议您在 Windows 系统上以 Docker 的方式安装 MCSManager + +## 开始安装 + +首先, 请先切换为 root 用户 + +```bash +sudo su +``` + +然后使用以下命令创建一些待会儿会用到的基本目录 + +```bash +mkdir -p /opt/mcsmanager # MCSManager 容器文件目录 +mkdir -p /opt/mcsmanager/data # MCSManager 数据文件目录 +cd /opt/mcsmanager +``` + +然后, 创建一个名为 `docker-compose.yaml` 的空文件 + +```bash +touch docker-compose.yaml +``` + +如果你需要同时安装 MCSManager Web 与 MCSManager Daemon, 请复制下面的配置文件, 并将其粘贴到 `docker-compose.yaml` 中 + +```yaml +version: "3" + +services: + web: + image: bluefunny/mcsm-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Web 日志存储目录 + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web 数据存储目录 + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 + network_mode: host + command: /entrypoint.sh + + daemon: + image: bluefunny/mcsm-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Daemon 日志存储目录 + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon 数据存储目录 + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 + network_mode: host +``` + +> 如果你无法复制或粘贴此文件, 你也可以[点击此处](../examples/cn/full.yaml)获取示例文件 + +如果你只需要安装 MCSManager Web, 请复制下面的配置文件, 并将其粘贴到 `docker-compose.yaml` 中 + +```yaml +version: "3" + +services: + web: + image: bluefunny/mcsm-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Web 日志存储目录 + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web 数据存储目录 + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 + network_mode: host +``` + +> 如果你无法复制或粘贴此文件, 你也可以[点击此处](../examples/cn/web.yaml)获取示例文件 + +如果你要同时安装 MCSManager Daemon, 请复制下面的配置文件, 并将其粘贴到 `docker-compose.yaml` 中 + +```yaml +version: "3" + +services: + daemon: + image: bluefunny/mcsm-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Daemon 日志存储目录 + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon 数据存储目录 + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 + network_mode: host +``` + +> 如果你无法复制或粘贴此文件, 你也可以[点击此处](../examples/cn/daemon.yaml)获取示例文件 + +当上述操作全部完成后, 请按需修改配置文件, 之后运行以下命令启动 MCSManager + +```bash +docker compose -f docker-compose.yaml up -d +``` + +此时, 你只需要等待命令运行完毕即可完成安装 + +如果一切运行正常, 那么不久后你就可以访问 `http://127.0.0.1:23333` 来查看你刚刚搭建好的面板了 ! + +> 如果是在服务器上运行, 则请将 `127.0.0.1` 替换为你的公网 IP + +> 如果你安装的是单独的的 MCSManager Daemon 程序, 则请将 `23333` 替换为 `24444` + +## 卸载 + +如果后期你不需要 MCSManager 了, 你可以进入你用于放置 `docker-compose.yml` 的文件夹, 然后输入以下命令以卸载 + +```bash +docker compose down +rm -rf data +``` + +--- + +至此, 你已完成了全部的任务, 现在你可以开始使用 MCSManager 了 ! + +不过如果你认为原本的 MCSManager Web 或 MCSManager Daemon 的镜像不够好, 你也可以自行编译 + +下面为一个简单的编译教程 + +--- + +## 自行编译 + +> 请注意, 你需要提前安装好 `docker-ce` 与 `python` 软件包, 并且你需要有一定的 Docker 使用经验 + +如果你需要自行编译, 你可以使用此目录中的 `build` 文件夹中的文件进行编译 + +- `Dockerfile-daemon` 为 MCSManager Daemon 的镜像构建文件 +- `Dockerfile-web` 为 MCSManager Web 的镜像构建文件 +- `entrypoint.sh` 为镜像默认执行的入口脚本, 在镜像启动时会运行此脚本 +- `build.py` 为用于构建镜像的 Python 脚本, 使用 `python build.py -h` 以获取详细帮助 + +你可以使用以下命令构建镜像 + +```bash +python build.py build +python build.py build --push # 如果你需要将镜像推送到 Docker Hub, 注意: 这需要你自己预先配置好 Docker Registry +``` + +如果你不想使用 `build.py` 脚本, 你也可以使用以下命令构建镜像 + +```bash +docker build . -f <构建文件> -t <标签> # 例如: docker build . -f Dockerfile -t bluefunny/mcsm-daemon:9 --build-arg TYPE=daemon --build-arg VERSION=9 +docker push <标签> # 如果你需要将镜像推送到 Docker Hub, 注意: 这需要你自己预先配置好 Docker Registry +``` + +在构建完成后, 你只需要将上文中配置文件中的 `image` 部分替换为你自行构建的镜像名称即可 diff --git a/docker/examples/cn/daemon.yaml b/docker/examples/cn/daemon.yaml index 903bce3..1e45a80 100644 --- a/docker/examples/cn/daemon.yaml +++ b/docker/examples/cn/daemon.yaml @@ -1,15 +1,17 @@ -version: "2.4" +version: "3" services: daemon: - image: bluefunny/mcsm-daemon:latest + image: bluefunny/mcsmanager-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai volumes: - # 此处为 MCSManager 守护程序日志存储目录 - # 默认为 [/var/logs/mcsmanager/daemon] - - /var/logs/mcsmanager/daemon:/logs - - # 此处为 MCSManager 守护程序日志存储目录 - # 默认为当前目录下的 data/daemon 文件夹 - - ./data/daemon:/data + # MCSManager Daemon 日志存储目录 + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon 数据存储目录 + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 network_mode: host - command: /start + command: /entrypoint.sh \ No newline at end of file diff --git a/docker/examples/cn/full.yaml b/docker/examples/cn/full.yaml index 15ad729..bd4dd69 100644 --- a/docker/examples/cn/full.yaml +++ b/docker/examples/cn/full.yaml @@ -1,28 +1,32 @@ -version: "2.4" +version: "3" services: web: - image: bluefunny/mcsm-web:latest + image: bluefunny/mcsmanager-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai volumes: - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为 [/var/logs/mcsmanager/web] - - /var/logs/mcsmanager/web:/logs - - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为当前目录下的 data/web 文件夹 - - ./data/web:/data + # MCSManager Web 日志存储目录 + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web 数据存储目录 + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 network_mode: host - command: /start + command: /entrypoint.sh daemon: - image: bluefunny/mcsm-daemon:latest + image: bluefunny/mcsmanager-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai volumes: - # 此处为 MCSManager 守护程序日志存储目录 - # 默认为 [/var/logs/mcsmanager/daemon] - - /var/logs/mcsmanager/daemon:/logs - - # 此处为 MCSManager 守护程序日志存储目录 - # 默认为当前目录下的 data/daemon 文件夹 - - ./data/daemon:/data + # MCSManager Daemon 日志存储目录 + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon 数据存储目录 + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 network_mode: host - command: /start + command: /entrypoint.sh \ No newline at end of file diff --git a/docker/examples/cn/web.yaml b/docker/examples/cn/web.yaml index 6f612b3..40ce1e7 100644 --- a/docker/examples/cn/web.yaml +++ b/docker/examples/cn/web.yaml @@ -1,15 +1,17 @@ -version: "2.4" +version: "3" services: web: - image: bluefunny/mcsm-web:latest + image: bluefunny/mcsmanager-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai volumes: - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为 [/var/logs/mcsmanager/web] - - /var/logs/mcsmanager/web:/logs - - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为当前目录下的 data/web 文件夹 - - ./data/web:/data + # MCSManager Web 日志存储目录 + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web 数据存储目录 + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 network_mode: host - command: /start + command: /entrypoint.sh \ No newline at end of file From dd328335ab4eb7ea7f678911f073847dd92b8feb Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 17:57:30 +0800 Subject: [PATCH 084/463] Updating the Docker Installation Method --- docker/README.md | 76 -------------- docker/README_cn.md | 77 -------------- docker/build/Dockerfile | 29 ++++++ docker/build/build.py | 83 +++++++++++++++ docker/build/entrypoint.sh | 23 +++++ docker/docs/README.md | 180 +++++++++++++++++++++++++++++++++ docker/docs/README_cn.md | 178 ++++++++++++++++++++++++++++++++ docker/examples/cn/daemon.yaml | 22 ++-- docker/examples/cn/full.yaml | 42 ++++---- docker/examples/cn/web.yaml | 22 ++-- docker/examples/en/daemon.yaml | 22 ++-- docker/examples/en/full.yaml | 42 ++++---- docker/examples/en/web.yaml | 22 ++-- 13 files changed, 587 insertions(+), 231 deletions(-) delete mode 100644 docker/README.md delete mode 100644 docker/README_cn.md create mode 100644 docker/build/Dockerfile create mode 100755 docker/build/build.py create mode 100644 docker/build/entrypoint.sh create mode 100644 docker/docs/README.md create mode 100644 docker/docs/README_cn.md diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 8e0ccc3..0000000 --- a/docker/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# Install MCSManager with Docker - -## Prerequisites - -You need to prepare the following before installation: - -- `docker` version `17.12.0+` has been installed -- `docker-compose` has been installed - -## Start installation - -First, use the following command to create the basic directory of `docker-compose` - -```bash -mkdir -p mcsmanager -cd mcsmanager -``` - -Then, create an empty file named `docker-compose.yaml` - -```bash -touch docker-compose.yaml -``` - -If you are a new user, please copy the configuration file below, modify the part marked with comments, and paste it into `docker-compose.yaml` - -If you cannot copy or paste this file, you can also click [here](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/full.yaml) to get the sample file - -```yaml -version: "2.4" - -services: - web: - image: bluefunny/mcsm-web:latest - volumes: - # This is the MCSManager control panel log storage directory - # The default is [/var/logs/mcsmanager/web] - - /var/logs/mcsmanager/web:/logs - - # This is the MCSManager control panel log storage directory - # The default is the data/web folder under the current directory - - ./data/web:/data - network_mode: host - command: /start - - daemon: - image: bluefunny/mcsm-daemon:latest - volumes: - # This is the MCSManager control panel log storage directory - # The default is [/var/logs/mcsmanager/daemon] - - /var/logs/mcsmanager/daemon:/logs - - # This is the MCSManager control panel log storage directory - # The default is the data/daemon folder under the current directory - - ./data/daemon:/data - network_mode: host - command: /start -``` - -If you are an old user and only plan to install a certain component of MCSManager (such as only installing the MCSManager daemon), please refer to the following two sample files and modify the part marked with comments - -- [MCSManager web](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/web.yaml) -- [MCSManager daemon](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/daemon.yaml) - -After all the above operations are completed, please run the following command to start MCSManager - -```bash -docker-compose -f docker-compose.yaml up -d -``` - -If everything runs normally, you can soon access `http://127.0.0.1:23333` to view the panel you just built! - -If you modify (or update) the `docker-compose.yaml` file later, please move it back to the directory and run the following command to make the modification take effect - -```bash -docker-compose up -d diff --git a/docker/README_cn.md b/docker/README_cn.md deleted file mode 100644 index e78511a..0000000 --- a/docker/README_cn.md +++ /dev/null @@ -1,77 +0,0 @@ -# 通过 Docker 安装 MCSManager - -## 预先准备 - -你需要提前做好以下几点准备 - -- 已经安装了 `17.12.0+` 版本的 `docker` -- 已经安装了 `docker-compose` - -## 开始安装 - -首先, 请先使用以下命令创建 `docker-compose` 基本目录 - -```bash -mkdir -p mcsmanager -cd mcsmanager -``` - -然后, 创建一个名为 `docker-compose.yaml` 的空文件 - -```bash -touch docker-compose.yaml -``` - -如果你是一个新用户, 请复制下面的配置文件, 修改其中注释标出的部分, 粘贴到 `docker-compose.yaml` 中即可 - -如果你无法复制或粘贴此文件, 你也可以[点击此处](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/full.yaml)获取示例文件 - -```yaml -version: "2.4" - -services: - web: - image: bluefunny/mcsm-web:latest - volumes: - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为 [/var/logs/mcsmanager/web] - - /var/logs/mcsmanager/web:/logs - - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为当前目录下的 data/web 文件夹 - - ./data/web:/data - network_mode: host - command: /start - - daemon: - image: bluefunny/mcsm-daemon:latest - volumes: - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为 [/var/logs/mcsmanager/daemon] - - /var/logs/mcsmanager/daemon:/logs - - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为当前目录下的 data/daemon 文件夹 - - ./data/daemon:/data - network_mode: host - command: /start -``` - -如果你是一个老用户, 并且只准备安装 MCSManager 的某个组件 (如仅安装 MCSManager 守护程序), 请查看下面这两个示例文件, 并修改其中注释标出的部分 - -- [MCSManager 控制面板](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/web.yaml) -- [MCSManager 守护程序](https://github.com/MCSManager/Script/blob/master/docker/examples/cn/daemon.yaml) - -当上述操作全部完成后, 请运行以下命令以启动 MCSManager - -```bash -docker-compose -f docker-compose.yaml up -d -``` - -如果一切都运行正常, 那么不久后你就可以访问 `http://127.0.0.1:23333` 来查看你刚刚搭建好的面板了 ! - -如果你后期修改(或更新)了 `docker-compose.yaml` 文件, 请重新移动到该目录, 并运行以下命令以使修改生效 - -```bash -docker-compose up -d -``` diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile new file mode 100644 index 0000000..d2488e8 --- /dev/null +++ b/docker/build/Dockerfile @@ -0,0 +1,29 @@ +ARG TYPE +ARG VERSION +FROM debian:stable-slim AS base + +RUN sed -i.bak 's/deb.debian.org/mirrors.cernet.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ + && sed -i.bak 's|security.debian.org/debian-security|mirrors.cernet.edu.cn/debian-security|g' /etc/apt/sources.list.d/debian.sources \ + && apt-get update -y \ + && apt-get install -y curl ca-certificates openssl git tar sqlite3 fontconfig tzdata iproute2 gettext-base wget \ + && apt-get clean + +RUN cd /tmp \ + && wget https://nodejs.org/dist/latest-v20.x/node-v20.11.1-linux-x64.tar.gz -O node.tar.gz \ + && wget https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz -O mcsmanager.tar.gz \ + && tar -xzf node.tar.gz -C /opt/node --strip-components=1 \ + && tar -xzf mcsmanager.tar.gz -C /tmp/mcsmanager \ + && mv -f /tmp/mcsmanager/${TYPE} /opt/${TYPE} \ + && rm -rf /tmp/mcsmanager \ + && rm -rf node.tar.gz \ + && rm -rf mcsmanager.tar.gz + +RUN cd /opt/${TYPE} \ + && /opt/node/bin/npm install --production + +USER mcsmanager +ENV USER=mcsmanager HOME=/home/mcsmanager + +WORKDIR /opt/${TYPE} +COPY ./entrypoint.sh / +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/docker/build/build.py b/docker/build/build.py new file mode 100755 index 0000000..6a4eb62 --- /dev/null +++ b/docker/build/build.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +import argparse +import os +import subprocess +import sys +from typing import Iterator, NamedTuple + +class Context(NamedTuple): + type: str + version: str + tag: str + + +def iterate_all() -> Iterator[Context]: + for type in ['daemon', 'web']: + for version in [9]: + tag = f'bluefunny/mcsmanager:{type}-{version}' + yield Context(type, str(version) , tag) + + +def cmd_build(args: argparse.Namespace): + for ctx in iterate_all(): + print(f'======== MCSManager | Type: {ctx.type}, Version: {ctx.version}, Tag: {ctx.tag!r} ========') + + cmd = [ + 'docker', 'build', os.getcwd(), + '-t', ctx.tag, + '--build-arg', f'TYPE={ctx.type}', + '--build-arg', f'VERSION={ctx.version}', + ] + + if args.http_proxy is not None: + cmd.extend([ + '--build-arg', f'http_proxy={args.http_proxy}', + '--build-arg', f'https_proxy={args.http_proxy}', + ]) + subprocess.check_call(cmd) + + if args.push: + subprocess.check_call(['docker', 'push', ctx.tag]) + + +def cmd_push(args: argparse.Namespace): + for ctx in iterate_all(): + subprocess.check_call(['docker', 'push', ctx.tag]) + + +def cmd_delete(args: argparse.Namespace): + for ctx in iterate_all(): + subprocess.check_call(['docker', 'image', 'rm', ctx.tag]) + + +def main(): + parser = argparse.ArgumentParser() + subparsers = parser.add_subparsers(title='Command', help='Available commands', dest='command', required=True) + + parser_build = subparsers.add_parser('build', help='Build all images') + parser_build.add_argument('-p', '--push', action='store_true', help='Push after build') + parser_build.add_argument('--http-proxy', help='Set the url of http proxy to be used in build') + + subparsers.add_parser('push', help='Push all images') + subparsers.add_parser('delete', help='Delete all images') + + args = parser.parse_args() + + if args.command == 'build': + cmd_build(args) + elif args.command == 'push': + cmd_push(args) + elif args.command == 'delete': + cmd_delete(args) + else: + print('Unknown command {!r}'.format(args.command)) + sys.exit(1) + + +if __name__ == '__main__': + try: + main() + except subprocess.CalledProcessError as e: + print(type(e).__name__, e.returncode, file=sys.stderr) + except KeyboardInterrupt: + pass diff --git a/docker/build/entrypoint.sh b/docker/build/entrypoint.sh new file mode 100644 index 0000000..916481a --- /dev/null +++ b/docker/build/entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +echo "[-] Checking the operating environment..." + +if [ ! -f /opt/node/bin/node ]; then + echo "[x] The nodejs runtime environment could not be found, you may be using an incomplete version" + exit 1 +fi + +if [ -d /opt/daemon ]; then + type=daemon +elif [ -d /opt/web ]; then + type=web +else + echo "[x] The MCSManager file directory could not be found, you may be using an incomplete version" + exit 1 +fi + +echo "[-] The operating environment is normal, starting the MCSManager..." + +cd /opt/$type +eval "/opt/node/bin/node /opt/$type/app.js" \ No newline at end of file diff --git a/docker/docs/README.md b/docker/docs/README.md new file mode 100644 index 0000000..ee700a5 --- /dev/null +++ b/docker/docs/README.md @@ -0,0 +1,180 @@ +# Installing MCSManager via Docker + +[English](README.md) | [简体中文](./README_cn.md) + +## Prerequisites + +You need to have the following prerequisites ready beforehand: + +- You are using a `Linux` system. +- `docker-ce` package is already installed. + +> Due to the unconventional implementation of Docker Desktop on Windows, we neither support nor recommend installing MCSManager via Docker on Windows systems. + +## Getting Started + +Firstly, please switch to the root user. + +```bash +sudo su +``` + +Then, create some basic directories that will be used later. + +```bash +mkdir -p /opt/mcsmanager # MCSManager container directory +mkdir -p /opt/mcsmanager/data # MCSManager data directory +cd /opt/mcsmanager +``` + +Next, create an empty file named `docker-compose.yaml`. + +```bash +touch docker-compose.yaml +``` + +If you need to install both MCSManager Web and MCSManager Daemon simultaneously, please copy the configuration below and paste it into `docker-compose.yaml`. + +```yaml +version: "3" + +services: + web: + image: bluefunny/mcsm-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Web logs directory + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web data directory + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 + network_mode: host + command: /entrypoint.sh + + daemon: + image: bluefunny/mcsm-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Daemon logs directory + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon data directory + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 + network_mode: host +``` + +> If you are unable to copy or paste this file, you can also [click here](../examples/en/full.yaml) to get the example file. + +If you only need to install MCSManager Web, please copy the configuration below and paste it into `docker-compose.yaml`. + +```yaml +version: "3" + +services: + web: + image: bluefunny/mcsm-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Web logs directory + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web data directory + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 + network_mode: host +``` + +> If you are unable to copy or paste this file, you can also [click here](../examples/en/web.yaml) to get the example file. + +If you want to install only MCSManager Daemon, please copy the configuration below and paste it into `docker-compose.yaml`. + +```yaml +version: "3" + +services: + daemon: + image: bluefunny/mcsm-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Daemon logs directory + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon data directory + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 + network_mode: host +``` + +> If you are unable to copy or paste this file, you can also [click here](../examples/en/daemon.yaml) to get the example file. + +Once all the above operations are completed, modify the configuration file as needed, then run the following command to start MCSManager. + +```bash +docker compose -f docker-compose.yaml up -d +``` + +Now, you just need to wait for the command to complete the installation. + +If everything runs smoothly, shortly after, you can access `http://127.0.0.1:23333` to view the panel you just set up! + +> If running on a server, replace `127.0.0.1` with your public IP. + +> If you installed only the standalone MCSManager Daemon program, replace `23333` with `24444`. + +## Uninstallation + +If you no longer need MCSManager later on, you can navigate to the folder where you placed `docker-compose.yml` and then enter the following command to uninstall. + +```bash +docker compose down +rm -rf data +``` + +--- + +Congratulations! You have completed all the tasks, and now you can start using MCSManager! + +However, if you find the original MCSManager Web or MCSManager Daemon images insufficient, you can also compile them yourself. + +Below is a simple compilation tutorial. + +--- + +## Self-Compilation + +> Please note that you need to install `docker-ce` and `python` packages beforehand, and you need to have some Docker usage experience. + +If you need to compile yourself, you can use the files in the `build` folder in this directory for compilation. + +- `Dockerfile-daemon` is the image construction file for MCSManager Daemon. +- `Dockerfile-web` is the image construction file for MCSManager Web. +- `entrypoint.sh` is the default entry script executed in the image, which will run when the image starts. +- `build.py` is a Python script used to build images. Use `python build.py -h` to get detailed help. + +You can use the following commands to build the images. + +```bash +python build.py build +python build.py build --push # If you need to push the images to Docker Hub, note: this requires you to pre-configure Docker Registry yourself. +``` + +If you prefer not to use the `build.py` script, you can also use the following commands to build the images. + +```bash +docker build . -f -t # For example: docker build . -f Dockerfile -t bluefunny/mcsm-daemon:9 --build-arg TYPE=daemon --build-arg VERSION=9 +docker push # If you need to push the images to Docker Hub, note: this requires you to pre-configure Docker Registry yourself. +``` + +After the build is complete, you just need to replace the `image` section in the configuration files mentioned above with the name of the image you built yourself. + +### This article was translated by ChatGPT, there may be some errors, if you find these errors, please submit an Issue to let us know \ No newline at end of file diff --git a/docker/docs/README_cn.md b/docker/docs/README_cn.md new file mode 100644 index 0000000..cc67067 --- /dev/null +++ b/docker/docs/README_cn.md @@ -0,0 +1,178 @@ +# 通过 Docker 安装 MCSManager + +[English](README.md) | [简体中文](./README_cn.md) + +## 预先准备 + +你需要提前做好以下两点准备 + +- 你使用的是 `Linux` 系统 +- 已经安装了 `docker-ce` 软件包 + +> 由于 Windows 上的 Docker Desktop 实现方式并非常规, 因此, 我们不支持也不建议您在 Windows 系统上以 Docker 的方式安装 MCSManager + +## 开始安装 + +首先, 请先切换为 root 用户 + +```bash +sudo su +``` + +然后使用以下命令创建一些待会儿会用到的基本目录 + +```bash +mkdir -p /opt/mcsmanager # MCSManager 容器文件目录 +mkdir -p /opt/mcsmanager/data # MCSManager 数据文件目录 +cd /opt/mcsmanager +``` + +然后, 创建一个名为 `docker-compose.yaml` 的空文件 + +```bash +touch docker-compose.yaml +``` + +如果你需要同时安装 MCSManager Web 与 MCSManager Daemon, 请复制下面的配置文件, 并将其粘贴到 `docker-compose.yaml` 中 + +```yaml +version: "3" + +services: + web: + image: bluefunny/mcsm-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Web 日志存储目录 + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web 数据存储目录 + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 + network_mode: host + command: /entrypoint.sh + + daemon: + image: bluefunny/mcsm-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Daemon 日志存储目录 + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon 数据存储目录 + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 + network_mode: host +``` + +> 如果你无法复制或粘贴此文件, 你也可以[点击此处](../examples/cn/full.yaml)获取示例文件 + +如果你只需要安装 MCSManager Web, 请复制下面的配置文件, 并将其粘贴到 `docker-compose.yaml` 中 + +```yaml +version: "3" + +services: + web: + image: bluefunny/mcsm-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Web 日志存储目录 + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web 数据存储目录 + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 + network_mode: host +``` + +> 如果你无法复制或粘贴此文件, 你也可以[点击此处](../examples/cn/web.yaml)获取示例文件 + +如果你要同时安装 MCSManager Daemon, 请复制下面的配置文件, 并将其粘贴到 `docker-compose.yaml` 中 + +```yaml +version: "3" + +services: + daemon: + image: bluefunny/mcsm-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai + volumes: + # MCSManager Daemon 日志存储目录 + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon 数据存储目录 + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 + network_mode: host +``` + +> 如果你无法复制或粘贴此文件, 你也可以[点击此处](../examples/cn/daemon.yaml)获取示例文件 + +当上述操作全部完成后, 请按需修改配置文件, 之后运行以下命令启动 MCSManager + +```bash +docker compose -f docker-compose.yaml up -d +``` + +此时, 你只需要等待命令运行完毕即可完成安装 + +如果一切运行正常, 那么不久后你就可以访问 `http://127.0.0.1:23333` 来查看你刚刚搭建好的面板了 ! + +> 如果是在服务器上运行, 则请将 `127.0.0.1` 替换为你的公网 IP + +> 如果你安装的是单独的的 MCSManager Daemon 程序, 则请将 `23333` 替换为 `24444` + +## 卸载 + +如果后期你不需要 MCSManager 了, 你可以进入你用于放置 `docker-compose.yml` 的文件夹, 然后输入以下命令以卸载 + +```bash +docker compose down +rm -rf data +``` + +--- + +至此, 你已完成了全部的任务, 现在你可以开始使用 MCSManager 了 ! + +不过如果你认为原本的 MCSManager Web 或 MCSManager Daemon 的镜像不够好, 你也可以自行编译 + +下面为一个简单的编译教程 + +--- + +## 自行编译 + +> 请注意, 你需要提前安装好 `docker-ce` 与 `python` 软件包, 并且你需要有一定的 Docker 使用经验 + +如果你需要自行编译, 你可以使用此目录中的 `build` 文件夹中的文件进行编译 + +- `Dockerfile-daemon` 为 MCSManager Daemon 的镜像构建文件 +- `Dockerfile-web` 为 MCSManager Web 的镜像构建文件 +- `entrypoint.sh` 为镜像默认执行的入口脚本, 在镜像启动时会运行此脚本 +- `build.py` 为用于构建镜像的 Python 脚本, 使用 `python build.py -h` 以获取详细帮助 + +你可以使用以下命令构建镜像 + +```bash +python build.py build +python build.py build --push # 如果你需要将镜像推送到 Docker Hub, 注意: 这需要你自己预先配置好 Docker Registry +``` + +如果你不想使用 `build.py` 脚本, 你也可以使用以下命令构建镜像 + +```bash +docker build . -f <构建文件> -t <标签> # 例如: docker build . -f Dockerfile -t bluefunny/mcsm-daemon:9 --build-arg TYPE=daemon --build-arg VERSION=9 +docker push <标签> # 如果你需要将镜像推送到 Docker Hub, 注意: 这需要你自己预先配置好 Docker Registry +``` + +在构建完成后, 你只需要将上文中配置文件中的 `image` 部分替换为你自行构建的镜像名称即可 diff --git a/docker/examples/cn/daemon.yaml b/docker/examples/cn/daemon.yaml index 903bce3..1e45a80 100644 --- a/docker/examples/cn/daemon.yaml +++ b/docker/examples/cn/daemon.yaml @@ -1,15 +1,17 @@ -version: "2.4" +version: "3" services: daemon: - image: bluefunny/mcsm-daemon:latest + image: bluefunny/mcsmanager-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai volumes: - # 此处为 MCSManager 守护程序日志存储目录 - # 默认为 [/var/logs/mcsmanager/daemon] - - /var/logs/mcsmanager/daemon:/logs - - # 此处为 MCSManager 守护程序日志存储目录 - # 默认为当前目录下的 data/daemon 文件夹 - - ./data/daemon:/data + # MCSManager Daemon 日志存储目录 + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon 数据存储目录 + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 network_mode: host - command: /start + command: /entrypoint.sh \ No newline at end of file diff --git a/docker/examples/cn/full.yaml b/docker/examples/cn/full.yaml index 15ad729..bd4dd69 100644 --- a/docker/examples/cn/full.yaml +++ b/docker/examples/cn/full.yaml @@ -1,28 +1,32 @@ -version: "2.4" +version: "3" services: web: - image: bluefunny/mcsm-web:latest + image: bluefunny/mcsmanager-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai volumes: - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为 [/var/logs/mcsmanager/web] - - /var/logs/mcsmanager/web:/logs - - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为当前目录下的 data/web 文件夹 - - ./data/web:/data + # MCSManager Web 日志存储目录 + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web 数据存储目录 + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 network_mode: host - command: /start + command: /entrypoint.sh daemon: - image: bluefunny/mcsm-daemon:latest + image: bluefunny/mcsmanager-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai volumes: - # 此处为 MCSManager 守护程序日志存储目录 - # 默认为 [/var/logs/mcsmanager/daemon] - - /var/logs/mcsmanager/daemon:/logs - - # 此处为 MCSManager 守护程序日志存储目录 - # 默认为当前目录下的 data/daemon 文件夹 - - ./data/daemon:/data + # MCSManager Daemon 日志存储目录 + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon 数据存储目录 + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 network_mode: host - command: /start + command: /entrypoint.sh \ No newline at end of file diff --git a/docker/examples/cn/web.yaml b/docker/examples/cn/web.yaml index 6f612b3..40ce1e7 100644 --- a/docker/examples/cn/web.yaml +++ b/docker/examples/cn/web.yaml @@ -1,15 +1,17 @@ -version: "2.4" +version: "3" services: web: - image: bluefunny/mcsm-web:latest + image: bluefunny/mcsmanager-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai volumes: - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为 [/var/logs/mcsmanager/web] - - /var/logs/mcsmanager/web:/logs - - # 此处为 MCSManager 控制面板日志存储目录 - # 默认为当前目录下的 data/web 文件夹 - - ./data/web:/data + # MCSManager Web 日志存储目录 + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web 数据存储目录 + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 network_mode: host - command: /start + command: /entrypoint.sh \ No newline at end of file diff --git a/docker/examples/en/daemon.yaml b/docker/examples/en/daemon.yaml index 4ae4580..8799621 100644 --- a/docker/examples/en/daemon.yaml +++ b/docker/examples/en/daemon.yaml @@ -1,15 +1,17 @@ -version: "2.4" +version: "3" services: daemon: - image: bluefunny/mcsm-daemon:latest + image: bluefunny/mcsmanager-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai volumes: - # This is the MCSManager web panel log storage directory - # Default is [/var/logs/mcsmanager/daemon] - - /var/logs/mcsmanager/daemon:/logs - - # This is the MCSManager daemon data storage directory - # Default is the data/daemon folder in the current directory - - ./data/daemon:/data + # MCSManager Daemon log storage directory + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon data storage directory + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 network_mode: host - command: /start + command: /entrypoint.sh \ No newline at end of file diff --git a/docker/examples/en/full.yaml b/docker/examples/en/full.yaml index f8d00ce..55af55d 100644 --- a/docker/examples/en/full.yaml +++ b/docker/examples/en/full.yaml @@ -1,28 +1,32 @@ -version: "2.4" +version: "3" services: web: - image: bluefunny/mcsm-web:latest + image: bluefunny/mcsmanager-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai volumes: - # This is the MCSManager web panel log storage directory - # The default is [/var/logs/mcsmanager/web] - - /var/logs/mcsmanager/web:/logs - - # This is the MCSManager web panel data storage directory - # The default is the data/web folder in the current directory - - ./data/web:/data + # MCSManager Web log storage directory + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web data storage directory + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 network_mode: host - command: /start + command: /entrypoint.sh daemon: - image: bluefunny/mcsm-daemon:latest + image: bluefunny/mcsmanager-daemon:latest + name: mcsmanager-daemon + environment: + - TZ=Asia/Shanghai volumes: - # This is the MCSManager daemon log storage directory - # The default is [/var/logs/mcsmanager/daemon] - - /var/logs/mcsmanager/daemon:/logs - - # This is the MCSManager daemon data storage directory - # The default is the data/daemon folder in the current directory - - ./data/daemon:/data + # MCSManager Daemon log storage directory + - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + # MCSManager Daemon data storage directory + - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + # port: + # - 24444:24444 network_mode: host - command: /start + command: /entrypoint.sh \ No newline at end of file diff --git a/docker/examples/en/web.yaml b/docker/examples/en/web.yaml index cb5ae2b..c4c6d5f 100644 --- a/docker/examples/en/web.yaml +++ b/docker/examples/en/web.yaml @@ -1,15 +1,17 @@ -version: "2.4" +version: "3" services: web: - image: bluefunny/mcsm-web:latest + image: bluefunny/mcsmanager-web:latest + name: mcsmanager-web + environment: + - TZ=Asia/Shanghai volumes: - # This is the MCSManager daemon log storage directory - # The default is [/var/logs/mcsmanager/web] - - /var/logs/mcsmanager/web:/logs - - # This is the MCSManager daemon data storage directory - # The default is the data/web folder in the current directory - - ./data/web:/data + # MCSManager Web log storage directory + - /opt/mcsmanager/data/logs/web:/opt/web/logs + # MCSManager Web data storage directory + - /opt/mcsmanager/data/data/web:/opt/web/data + # port: + # - 23333:23333 network_mode: host - command: /start + command: /entrypoint.sh \ No newline at end of file From f6057349cf0b8326dc9b00b2271cfecb1923b996 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 18:34:06 +0800 Subject: [PATCH 085/463] Fix a little problem --- docker/build/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile index d2488e8..0cecd8e 100644 --- a/docker/build/Dockerfile +++ b/docker/build/Dockerfile @@ -11,6 +11,7 @@ RUN sed -i.bak 's/deb.debian.org/mirrors.cernet.edu.cn/g' /etc/apt/sources.list. RUN cd /tmp \ && wget https://nodejs.org/dist/latest-v20.x/node-v20.11.1-linux-x64.tar.gz -O node.tar.gz \ && wget https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz -O mcsmanager.tar.gz \ + && mkdir -p /opt/node \ && tar -xzf node.tar.gz -C /opt/node --strip-components=1 \ && tar -xzf mcsmanager.tar.gz -C /tmp/mcsmanager \ && mv -f /tmp/mcsmanager/${TYPE} /opt/${TYPE} \ From d7569818edc5fdc2e7da5a2e680814661837df47 Mon Sep 17 00:00:00 2001 From: BlueFunny <53890138+FunnyShadow@users.noreply.github.com> Date: Wed, 21 Feb 2024 18:53:27 +0800 Subject: [PATCH 086/463] Update Dockerfile --- docker/build/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile index 0cecd8e..6bf97a9 100644 --- a/docker/build/Dockerfile +++ b/docker/build/Dockerfile @@ -12,6 +12,7 @@ RUN cd /tmp \ && wget https://nodejs.org/dist/latest-v20.x/node-v20.11.1-linux-x64.tar.gz -O node.tar.gz \ && wget https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz -O mcsmanager.tar.gz \ && mkdir -p /opt/node \ + && mkdir -p /tmp/mcsmanager \ && tar -xzf node.tar.gz -C /opt/node --strip-components=1 \ && tar -xzf mcsmanager.tar.gz -C /tmp/mcsmanager \ && mv -f /tmp/mcsmanager/${TYPE} /opt/${TYPE} \ From d835336a6d09cc3cc597777e99841840766fbd0f Mon Sep 17 00:00:00 2001 From: BlueFunny <53890138+FunnyShadow@users.noreply.github.com> Date: Wed, 21 Feb 2024 18:56:17 +0800 Subject: [PATCH 087/463] Update Dockerfile --- docker/build/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile index 6bf97a9..204d6e7 100644 --- a/docker/build/Dockerfile +++ b/docker/build/Dockerfile @@ -21,7 +21,7 @@ RUN cd /tmp \ && rm -rf mcsmanager.tar.gz RUN cd /opt/${TYPE} \ - && /opt/node/bin/npm install --production + && /opt/node/bin/node /opt/node/bin/npm install --production USER mcsmanager ENV USER=mcsmanager HOME=/home/mcsmanager From dccd108b262a4d5834aca33274cf2bec4b9e621b Mon Sep 17 00:00:00 2001 From: BlueFunny <53890138+FunnyShadow@users.noreply.github.com> Date: Wed, 21 Feb 2024 19:00:59 +0800 Subject: [PATCH 088/463] Update Dockerfile --- docker/build/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile index 204d6e7..6fda7aa 100644 --- a/docker/build/Dockerfile +++ b/docker/build/Dockerfile @@ -1,5 +1,5 @@ -ARG TYPE -ARG VERSION +ARG TYPE=daemon +ARG VERSION=9 FROM debian:stable-slim AS base RUN sed -i.bak 's/deb.debian.org/mirrors.cernet.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ From 413e8f2190c3779dafeb5487f03c075f7d97f5cd Mon Sep 17 00:00:00 2001 From: BlueFunny <53890138+FunnyShadow@users.noreply.github.com> Date: Wed, 21 Feb 2024 19:01:59 +0800 Subject: [PATCH 089/463] Update Dockerfile --- docker/build/Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile index 6fda7aa..085c2ba 100644 --- a/docker/build/Dockerfile +++ b/docker/build/Dockerfile @@ -1,5 +1,3 @@ -ARG TYPE=daemon -ARG VERSION=9 FROM debian:stable-slim AS base RUN sed -i.bak 's/deb.debian.org/mirrors.cernet.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ @@ -15,17 +13,17 @@ RUN cd /tmp \ && mkdir -p /tmp/mcsmanager \ && tar -xzf node.tar.gz -C /opt/node --strip-components=1 \ && tar -xzf mcsmanager.tar.gz -C /tmp/mcsmanager \ - && mv -f /tmp/mcsmanager/${TYPE} /opt/${TYPE} \ + && mv -f /tmp/mcsmanager/${TYPE} /opt/daemon \ && rm -rf /tmp/mcsmanager \ && rm -rf node.tar.gz \ && rm -rf mcsmanager.tar.gz -RUN cd /opt/${TYPE} \ +RUN cd /opt/daemon \ && /opt/node/bin/node /opt/node/bin/npm install --production USER mcsmanager ENV USER=mcsmanager HOME=/home/mcsmanager -WORKDIR /opt/${TYPE} +WORKDIR /opt/daemon COPY ./entrypoint.sh / CMD ["/bin/bash", "/entrypoint.sh"] From c5af1fb6105604245e833b9cc61286871341b4e4 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 19:08:20 +0800 Subject: [PATCH 090/463] Splitting the Daemon and Web build files into two --- .../build/{Dockerfile => Dockerfile-daemon} | 2 +- docker/build/Dockerfile-web | 29 +++++++++++++++++++ docker/build/build.py | 3 +- 3 files changed, 31 insertions(+), 3 deletions(-) rename docker/build/{Dockerfile => Dockerfile-daemon} (95%) create mode 100644 docker/build/Dockerfile-web diff --git a/docker/build/Dockerfile b/docker/build/Dockerfile-daemon similarity index 95% rename from docker/build/Dockerfile rename to docker/build/Dockerfile-daemon index 085c2ba..8d67aa3 100644 --- a/docker/build/Dockerfile +++ b/docker/build/Dockerfile-daemon @@ -13,7 +13,7 @@ RUN cd /tmp \ && mkdir -p /tmp/mcsmanager \ && tar -xzf node.tar.gz -C /opt/node --strip-components=1 \ && tar -xzf mcsmanager.tar.gz -C /tmp/mcsmanager \ - && mv -f /tmp/mcsmanager/${TYPE} /opt/daemon \ + && mv -f /tmp/mcsmanager/daemon /opt/daemon \ && rm -rf /tmp/mcsmanager \ && rm -rf node.tar.gz \ && rm -rf mcsmanager.tar.gz diff --git a/docker/build/Dockerfile-web b/docker/build/Dockerfile-web new file mode 100644 index 0000000..f3209e3 --- /dev/null +++ b/docker/build/Dockerfile-web @@ -0,0 +1,29 @@ +FROM debian:stable-slim AS base + +RUN sed -i.bak 's/deb.debian.org/mirrors.cernet.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ + && sed -i.bak 's|security.debian.org/debian-security|mirrors.cernet.edu.cn/debian-security|g' /etc/apt/sources.list.d/debian.sources \ + && apt-get update -y \ + && apt-get install -y curl ca-certificates openssl git tar sqlite3 fontconfig tzdata iproute2 gettext-base wget \ + && apt-get clean + +RUN cd /tmp \ + && wget https://nodejs.org/dist/latest-v20.x/node-v20.11.1-linux-x64.tar.gz -O node.tar.gz \ + && wget https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz -O mcsmanager.tar.gz \ + && mkdir -p /opt/node \ + && mkdir -p /tmp/mcsmanager \ + && tar -xzf node.tar.gz -C /opt/node --strip-components=1 \ + && tar -xzf mcsmanager.tar.gz -C /tmp/mcsmanager \ + && mv -f /tmp/mcsmanager/web /opt/daemon \ + && rm -rf /tmp/mcsmanager \ + && rm -rf node.tar.gz \ + && rm -rf mcsmanager.tar.gz + +RUN cd /opt/web \ + && /opt/node/bin/node /opt/node/bin/npm install --production + +USER mcsmanager +ENV USER=mcsmanager HOME=/home/mcsmanager + +WORKDIR /opt/web +COPY ./entrypoint.sh / +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/docker/build/build.py b/docker/build/build.py index 6a4eb62..1e67960 100755 --- a/docker/build/build.py +++ b/docker/build/build.py @@ -24,9 +24,8 @@ def cmd_build(args: argparse.Namespace): cmd = [ 'docker', 'build', os.getcwd(), + '-f', f'Dockerfile-{ctx.type}', '-t', ctx.tag, - '--build-arg', f'TYPE={ctx.type}', - '--build-arg', f'VERSION={ctx.version}', ] if args.http_proxy is not None: From 6300e8bdad6b442dfdc5e227efb0527a83de8dea Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 19:13:01 +0800 Subject: [PATCH 091/463] Updating the tutorial file --- docker/docs/README.md | 10 +++++----- docker/docs/README_cn.md | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docker/docs/README.md b/docker/docs/README.md index e7c5c40..3f7b173 100644 --- a/docker/docs/README.md +++ b/docker/docs/README.md @@ -40,7 +40,7 @@ version: "3" services: web: - image: bluefunny/mcsm-web:latest + image: bluefunny/mcsmanager-web:latest name: mcsmanager-web environment: - TZ=Asia/Shanghai @@ -55,7 +55,7 @@ services: command: /entrypoint.sh daemon: - image: bluefunny/mcsm-daemon:latest + image: bluefunny/mcsmanager-daemon:latest name: mcsmanager-daemon environment: - TZ=Asia/Shanghai @@ -78,7 +78,7 @@ version: "3" services: web: - image: bluefunny/mcsm-web:latest + image: bluefunny/mcsmanager-web:latest name: mcsmanager-web environment: - TZ=Asia/Shanghai @@ -101,7 +101,7 @@ version: "3" services: daemon: - image: bluefunny/mcsm-daemon:latest + image: bluefunny/mcsmanager-daemon:latest name: mcsmanager-daemon environment: - TZ=Asia/Shanghai @@ -171,7 +171,7 @@ python build.py build --push # If you need to push the images to Docker Hub, not If you prefer not to use the `build.py` script, you can also use the following commands to build the images. ```bash -docker build . -f -t # For example: docker build . -f Dockerfile -t bluefunny/mcsm-daemon:9 --build-arg TYPE=daemon --build-arg VERSION=9 +docker build . -f -t # For example: docker build . -f Dockerfile -t bluefunny/mcsmanager-daemon:9 --build-arg TYPE=daemon --build-arg VERSION=9 docker push # If you need to push the images to Docker Hub, note: this requires you to pre-configure Docker Registry yourself. ``` diff --git a/docker/docs/README_cn.md b/docker/docs/README_cn.md index 7ffa2ca..4045329 100644 --- a/docker/docs/README_cn.md +++ b/docker/docs/README_cn.md @@ -40,7 +40,7 @@ version: "3" services: web: - image: bluefunny/mcsm-web:latest + image: bluefunny/mcsmanager-web:latest name: mcsmanager-web environment: - TZ=Asia/Shanghai @@ -55,7 +55,7 @@ services: command: /entrypoint.sh daemon: - image: bluefunny/mcsm-daemon:latest + image: bluefunny/mcsmanager-daemon:latest name: mcsmanager-daemon environment: - TZ=Asia/Shanghai @@ -78,7 +78,7 @@ version: "3" services: web: - image: bluefunny/mcsm-web:latest + image: bluefunny/mcsmanager-web:latest name: mcsmanager-web environment: - TZ=Asia/Shanghai @@ -101,7 +101,7 @@ version: "3" services: daemon: - image: bluefunny/mcsm-daemon:latest + image: bluefunny/mcsmanager-daemon:latest name: mcsmanager-daemon environment: - TZ=Asia/Shanghai @@ -171,7 +171,7 @@ python build.py build --push # 如果你需要将镜像推送到 Docker Hub, 注 如果你不想使用 `build.py` 脚本, 你也可以使用以下命令构建镜像 ```bash -docker build . -f <构建文件> -t <标签> # 例如: docker build . -f Dockerfile -t bluefunny/mcsm-daemon:9 --build-arg TYPE=daemon --build-arg VERSION=9 +docker build . -f <构建文件> -t <标签> # 例如: docker build . -f Dockerfile -t bluefunny/mcsmanager-daemon:9 --build-arg TYPE=daemon --build-arg VERSION=9 docker push <标签> # 如果你需要将镜像推送到 Docker Hub, 注意: 这需要你自己预先配置好 Docker Registry ``` From 1d9182d4152b2295e3a8a8cb0f5662befe3fb282 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 19:15:14 +0800 Subject: [PATCH 092/463] Fixing a really stupid problem --- docker/build/Dockerfile-web | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/build/Dockerfile-web b/docker/build/Dockerfile-web index f3209e3..5636ea1 100644 --- a/docker/build/Dockerfile-web +++ b/docker/build/Dockerfile-web @@ -13,7 +13,7 @@ RUN cd /tmp \ && mkdir -p /tmp/mcsmanager \ && tar -xzf node.tar.gz -C /opt/node --strip-components=1 \ && tar -xzf mcsmanager.tar.gz -C /tmp/mcsmanager \ - && mv -f /tmp/mcsmanager/web /opt/daemon \ + && mv -f /tmp/mcsmanager/web /opt/web \ && rm -rf /tmp/mcsmanager \ && rm -rf node.tar.gz \ && rm -rf mcsmanager.tar.gz From 8354b6451b9d77df1fba36e0f212626068607630 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 19:22:51 +0800 Subject: [PATCH 093/463] Replace field name (misremembered...) --- docker/examples/cn/daemon.yaml | 2 +- docker/examples/cn/full.yaml | 4 ++-- docker/examples/cn/web.yaml | 2 +- docker/examples/en/daemon.yaml | 2 +- docker/examples/en/full.yaml | 4 ++-- docker/examples/en/web.yaml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/examples/cn/daemon.yaml b/docker/examples/cn/daemon.yaml index 1e45a80..5d61edc 100644 --- a/docker/examples/cn/daemon.yaml +++ b/docker/examples/cn/daemon.yaml @@ -3,7 +3,7 @@ version: "3" services: daemon: image: bluefunny/mcsmanager-daemon:latest - name: mcsmanager-daemon + container_name: mcsmanager-daemon environment: - TZ=Asia/Shanghai volumes: diff --git a/docker/examples/cn/full.yaml b/docker/examples/cn/full.yaml index bd4dd69..4928ef9 100644 --- a/docker/examples/cn/full.yaml +++ b/docker/examples/cn/full.yaml @@ -3,7 +3,7 @@ version: "3" services: web: image: bluefunny/mcsmanager-web:latest - name: mcsmanager-web + container_name: mcsmanager-web environment: - TZ=Asia/Shanghai volumes: @@ -18,7 +18,7 @@ services: daemon: image: bluefunny/mcsmanager-daemon:latest - name: mcsmanager-daemon + container_name: mcsmanager-daemon environment: - TZ=Asia/Shanghai volumes: diff --git a/docker/examples/cn/web.yaml b/docker/examples/cn/web.yaml index 40ce1e7..0d70fe0 100644 --- a/docker/examples/cn/web.yaml +++ b/docker/examples/cn/web.yaml @@ -3,7 +3,7 @@ version: "3" services: web: image: bluefunny/mcsmanager-web:latest - name: mcsmanager-web + container_name: mcsmanager-web environment: - TZ=Asia/Shanghai volumes: diff --git a/docker/examples/en/daemon.yaml b/docker/examples/en/daemon.yaml index 8799621..1260089 100644 --- a/docker/examples/en/daemon.yaml +++ b/docker/examples/en/daemon.yaml @@ -3,7 +3,7 @@ version: "3" services: daemon: image: bluefunny/mcsmanager-daemon:latest - name: mcsmanager-daemon + container_name: mcsmanager-daemon environment: - TZ=Asia/Shanghai volumes: diff --git a/docker/examples/en/full.yaml b/docker/examples/en/full.yaml index 55af55d..06dd5eb 100644 --- a/docker/examples/en/full.yaml +++ b/docker/examples/en/full.yaml @@ -3,7 +3,7 @@ version: "3" services: web: image: bluefunny/mcsmanager-web:latest - name: mcsmanager-web + container_name: mcsmanager-web environment: - TZ=Asia/Shanghai volumes: @@ -18,7 +18,7 @@ services: daemon: image: bluefunny/mcsmanager-daemon:latest - name: mcsmanager-daemon + container_name: mcsmanager-daemon environment: - TZ=Asia/Shanghai volumes: diff --git a/docker/examples/en/web.yaml b/docker/examples/en/web.yaml index c4c6d5f..bbd9f70 100644 --- a/docker/examples/en/web.yaml +++ b/docker/examples/en/web.yaml @@ -3,7 +3,7 @@ version: "3" services: web: image: bluefunny/mcsmanager-web:latest - name: mcsmanager-web + container_name: mcsmanager-web environment: - TZ=Asia/Shanghai volumes: From 01fcb2bfcb2970ee05d6207b53e8d985da8ad46a Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 19:23:44 +0800 Subject: [PATCH 094/463] Change the default path to the current directory --- docker/examples/cn/daemon.yaml | 4 ++-- docker/examples/cn/full.yaml | 8 ++++---- docker/examples/cn/web.yaml | 4 ++-- docker/examples/en/daemon.yaml | 4 ++-- docker/examples/en/full.yaml | 8 ++++---- docker/examples/en/web.yaml | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docker/examples/cn/daemon.yaml b/docker/examples/cn/daemon.yaml index 5d61edc..acf3af2 100644 --- a/docker/examples/cn/daemon.yaml +++ b/docker/examples/cn/daemon.yaml @@ -8,9 +8,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Daemon 日志存储目录 - - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + - ./data/logs/daemon:/opt/daemon/logs # MCSManager Daemon 数据存储目录 - - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + - ./data/data/daemon:/opt/daemon/data # port: # - 24444:24444 network_mode: host diff --git a/docker/examples/cn/full.yaml b/docker/examples/cn/full.yaml index 4928ef9..154b75e 100644 --- a/docker/examples/cn/full.yaml +++ b/docker/examples/cn/full.yaml @@ -8,9 +8,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Web 日志存储目录 - - /opt/mcsmanager/data/logs/web:/opt/web/logs + - ./data/logs/web:/opt/web/logs # MCSManager Web 数据存储目录 - - /opt/mcsmanager/data/data/web:/opt/web/data + - ./data/data/web:/opt/web/data # port: # - 23333:23333 network_mode: host @@ -23,9 +23,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Daemon 日志存储目录 - - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + - ./data/logs/daemon:/opt/daemon/logs # MCSManager Daemon 数据存储目录 - - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + - ./data/data/daemon:/opt/daemon/data # port: # - 24444:24444 network_mode: host diff --git a/docker/examples/cn/web.yaml b/docker/examples/cn/web.yaml index 0d70fe0..6cce805 100644 --- a/docker/examples/cn/web.yaml +++ b/docker/examples/cn/web.yaml @@ -8,9 +8,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Web 日志存储目录 - - /opt/mcsmanager/data/logs/web:/opt/web/logs + - ./data/logs/web:/opt/web/logs # MCSManager Web 数据存储目录 - - /opt/mcsmanager/data/data/web:/opt/web/data + - ./data/data/web:/opt/web/data # port: # - 23333:23333 network_mode: host diff --git a/docker/examples/en/daemon.yaml b/docker/examples/en/daemon.yaml index 1260089..47c51e4 100644 --- a/docker/examples/en/daemon.yaml +++ b/docker/examples/en/daemon.yaml @@ -8,9 +8,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Daemon log storage directory - - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + - ./data/logs/daemon:/opt/daemon/logs # MCSManager Daemon data storage directory - - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + - ./data/data/daemon:/opt/daemon/data # port: # - 24444:24444 network_mode: host diff --git a/docker/examples/en/full.yaml b/docker/examples/en/full.yaml index 06dd5eb..fe39576 100644 --- a/docker/examples/en/full.yaml +++ b/docker/examples/en/full.yaml @@ -8,9 +8,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Web log storage directory - - /opt/mcsmanager/data/logs/web:/opt/web/logs + - ./data/logs/web:/opt/web/logs # MCSManager Web data storage directory - - /opt/mcsmanager/data/data/web:/opt/web/data + - ./data/data/web:/opt/web/data # port: # - 23333:23333 network_mode: host @@ -23,9 +23,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Daemon log storage directory - - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + - ./data/logs/daemon:/opt/daemon/logs # MCSManager Daemon data storage directory - - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + - ./data/data/daemon:/opt/daemon/data # port: # - 24444:24444 network_mode: host diff --git a/docker/examples/en/web.yaml b/docker/examples/en/web.yaml index bbd9f70..8d9caf4 100644 --- a/docker/examples/en/web.yaml +++ b/docker/examples/en/web.yaml @@ -8,9 +8,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Web log storage directory - - /opt/mcsmanager/data/logs/web:/opt/web/logs + - ./data/logs/web:/opt/web/logs # MCSManager Web data storage directory - - /opt/mcsmanager/data/data/web:/opt/web/data + - ./data/data/web:/opt/web/data # port: # - 23333:23333 network_mode: host From bc6cdb83bf13b0660b79278e2a759e4be18ffe3d Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 19:25:16 +0800 Subject: [PATCH 095/463] Update directory paths and permissions in Docker configuration --- docker/docs/README.md | 21 +++++++++++---------- docker/docs/README_cn.md | 21 +++++++++++---------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/docker/docs/README.md b/docker/docs/README.md index 3f7b173..8e89b67 100644 --- a/docker/docs/README.md +++ b/docker/docs/README.md @@ -22,8 +22,9 @@ sudo su Then, create some basic directories that will be used later. ```bash -mkdir -p /opt/mcsmanager # MCSManager container directory -mkdir -p /opt/mcsmanager/data # MCSManager data directory +mkdir -p /opt/mcsmanager # MCSManager container directory +mkdir -p /opt/mcsmanager/data # MCSManager data directory +chown -R 1000:1000 /opt/mcsmanager # Modify directory permissions cd /opt/mcsmanager ``` @@ -46,9 +47,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Web logs directory - - /opt/mcsmanager/data/logs/web:/opt/web/logs + - ./data/logs/web:/opt/web/logs # MCSManager Web data directory - - /opt/mcsmanager/data/data/web:/opt/web/data + - ./data/data/web:/opt/web/data # port: # - 23333:23333 network_mode: host @@ -61,9 +62,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Daemon logs directory - - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + - ./data/logs/daemon:/opt/daemon/logs # MCSManager Daemon data directory - - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + - ./data/data/daemon:/opt/daemon/data # port: # - 24444:24444 network_mode: host @@ -84,9 +85,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Web logs directory - - /opt/mcsmanager/data/logs/web:/opt/web/logs + - ./data/logs/web:/opt/web/logs # MCSManager Web data directory - - /opt/mcsmanager/data/data/web:/opt/web/data + - ./data/data/web:/opt/web/data # port: # - 23333:23333 network_mode: host @@ -107,9 +108,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Daemon logs directory - - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + - ./data/logs/daemon:/opt/daemon/logs # MCSManager Daemon data directory - - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + - ./data/data/daemon:/opt/daemon/data # port: # - 24444:24444 network_mode: host diff --git a/docker/docs/README_cn.md b/docker/docs/README_cn.md index 4045329..ba89b01 100644 --- a/docker/docs/README_cn.md +++ b/docker/docs/README_cn.md @@ -22,8 +22,9 @@ sudo su 然后使用以下命令创建一些待会儿会用到的基本目录 ```bash -mkdir -p /opt/mcsmanager # MCSManager 容器文件目录 -mkdir -p /opt/mcsmanager/data # MCSManager 数据文件目录 +mkdir -p /opt/mcsmanager # MCSManager 容器文件目录 +mkdir -p /opt/mcsmanager/data # MCSManager 数据文件目录 +chown -R 1000:1000 /opt/mcsmanager # 修改目录权限 cd /opt/mcsmanager ``` @@ -46,9 +47,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Web 日志存储目录 - - /opt/mcsmanager/data/logs/web:/opt/web/logs + - ./data/logs/web:/opt/web/logs # MCSManager Web 数据存储目录 - - /opt/mcsmanager/data/data/web:/opt/web/data + - ./data/data/web:/opt/web/data # port: # - 23333:23333 network_mode: host @@ -61,9 +62,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Daemon 日志存储目录 - - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + - ./data/logs/daemon:/opt/daemon/logs # MCSManager Daemon 数据存储目录 - - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + - ./data/data/daemon:/opt/daemon/data # port: # - 24444:24444 network_mode: host @@ -84,9 +85,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Web 日志存储目录 - - /opt/mcsmanager/data/logs/web:/opt/web/logs + - ./data/logs/web:/opt/web/logs # MCSManager Web 数据存储目录 - - /opt/mcsmanager/data/data/web:/opt/web/data + - ./data/data/web:/opt/web/data # port: # - 23333:23333 network_mode: host @@ -107,9 +108,9 @@ services: - TZ=Asia/Shanghai volumes: # MCSManager Daemon 日志存储目录 - - /opt/mcsmanager/data/logs/daemon:/opt/daemon/logs + - ./data/logs/daemon:/opt/daemon/logs # MCSManager Daemon 数据存储目录 - - /opt/mcsmanager/data/data/daemon:/opt/daemon/data + - ./data/data/daemon:/opt/daemon/data # port: # - 24444:24444 network_mode: host From 877c0b13ed8667cb33ef047eebdd87f23f12181a Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 19:29:22 +0800 Subject: [PATCH 096/463] Fix a naming error --- docker/docs/README.md | 8 ++++---- docker/docs/README_cn.md | 8 ++++---- docker/examples/cn/daemon.yaml | 2 +- docker/examples/cn/full.yaml | 4 ++-- docker/examples/cn/web.yaml | 2 +- docker/examples/en/daemon.yaml | 2 +- docker/examples/en/full.yaml | 4 ++-- docker/examples/en/web.yaml | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docker/docs/README.md b/docker/docs/README.md index 8e89b67..2389403 100644 --- a/docker/docs/README.md +++ b/docker/docs/README.md @@ -41,7 +41,7 @@ version: "3" services: web: - image: bluefunny/mcsmanager-web:latest + image: bluefunny/mcsmanager:web-9 name: mcsmanager-web environment: - TZ=Asia/Shanghai @@ -56,7 +56,7 @@ services: command: /entrypoint.sh daemon: - image: bluefunny/mcsmanager-daemon:latest + image: bluefunny/mcsmanager:daemon-9 name: mcsmanager-daemon environment: - TZ=Asia/Shanghai @@ -79,7 +79,7 @@ version: "3" services: web: - image: bluefunny/mcsmanager-web:latest + image: bluefunny/mcsmanager:web-9 name: mcsmanager-web environment: - TZ=Asia/Shanghai @@ -102,7 +102,7 @@ version: "3" services: daemon: - image: bluefunny/mcsmanager-daemon:latest + image: bluefunny/mcsmanager:daemon-9 name: mcsmanager-daemon environment: - TZ=Asia/Shanghai diff --git a/docker/docs/README_cn.md b/docker/docs/README_cn.md index ba89b01..79b4826 100644 --- a/docker/docs/README_cn.md +++ b/docker/docs/README_cn.md @@ -41,7 +41,7 @@ version: "3" services: web: - image: bluefunny/mcsmanager-web:latest + image: bluefunny/mcsmanager:web-9 name: mcsmanager-web environment: - TZ=Asia/Shanghai @@ -56,7 +56,7 @@ services: command: /entrypoint.sh daemon: - image: bluefunny/mcsmanager-daemon:latest + image: bluefunny/mcsmanager:daemon-9 name: mcsmanager-daemon environment: - TZ=Asia/Shanghai @@ -79,7 +79,7 @@ version: "3" services: web: - image: bluefunny/mcsmanager-web:latest + image: bluefunny/mcsmanager:web-9 name: mcsmanager-web environment: - TZ=Asia/Shanghai @@ -102,7 +102,7 @@ version: "3" services: daemon: - image: bluefunny/mcsmanager-daemon:latest + image: bluefunny/mcsmanager:daemon-9 name: mcsmanager-daemon environment: - TZ=Asia/Shanghai diff --git a/docker/examples/cn/daemon.yaml b/docker/examples/cn/daemon.yaml index acf3af2..0b1654a 100644 --- a/docker/examples/cn/daemon.yaml +++ b/docker/examples/cn/daemon.yaml @@ -2,7 +2,7 @@ version: "3" services: daemon: - image: bluefunny/mcsmanager-daemon:latest + image: bluefunny/mcsmanager:daemon-9 container_name: mcsmanager-daemon environment: - TZ=Asia/Shanghai diff --git a/docker/examples/cn/full.yaml b/docker/examples/cn/full.yaml index 154b75e..1701aba 100644 --- a/docker/examples/cn/full.yaml +++ b/docker/examples/cn/full.yaml @@ -2,7 +2,7 @@ version: "3" services: web: - image: bluefunny/mcsmanager-web:latest + image: bluefunny/mcsmanager:web-9 container_name: mcsmanager-web environment: - TZ=Asia/Shanghai @@ -17,7 +17,7 @@ services: command: /entrypoint.sh daemon: - image: bluefunny/mcsmanager-daemon:latest + image: bluefunny/mcsmanager:daemon-9 container_name: mcsmanager-daemon environment: - TZ=Asia/Shanghai diff --git a/docker/examples/cn/web.yaml b/docker/examples/cn/web.yaml index 6cce805..c45653a 100644 --- a/docker/examples/cn/web.yaml +++ b/docker/examples/cn/web.yaml @@ -2,7 +2,7 @@ version: "3" services: web: - image: bluefunny/mcsmanager-web:latest + image: bluefunny/mcsmanager:web-9 container_name: mcsmanager-web environment: - TZ=Asia/Shanghai diff --git a/docker/examples/en/daemon.yaml b/docker/examples/en/daemon.yaml index 47c51e4..10958d1 100644 --- a/docker/examples/en/daemon.yaml +++ b/docker/examples/en/daemon.yaml @@ -2,7 +2,7 @@ version: "3" services: daemon: - image: bluefunny/mcsmanager-daemon:latest + image: bluefunny/mcsmanager:daemon-9 container_name: mcsmanager-daemon environment: - TZ=Asia/Shanghai diff --git a/docker/examples/en/full.yaml b/docker/examples/en/full.yaml index fe39576..99ae52b 100644 --- a/docker/examples/en/full.yaml +++ b/docker/examples/en/full.yaml @@ -2,7 +2,7 @@ version: "3" services: web: - image: bluefunny/mcsmanager-web:latest + image: bluefunny/mcsmanager:web-9 container_name: mcsmanager-web environment: - TZ=Asia/Shanghai @@ -17,7 +17,7 @@ services: command: /entrypoint.sh daemon: - image: bluefunny/mcsmanager-daemon:latest + image: bluefunny/mcsmanager:daemon-9 container_name: mcsmanager-daemon environment: - TZ=Asia/Shanghai diff --git a/docker/examples/en/web.yaml b/docker/examples/en/web.yaml index 8d9caf4..cbe3047 100644 --- a/docker/examples/en/web.yaml +++ b/docker/examples/en/web.yaml @@ -2,7 +2,7 @@ version: "3" services: web: - image: bluefunny/mcsmanager-web:latest + image: bluefunny/mcsmanager:web-9 container_name: mcsmanager-web environment: - TZ=Asia/Shanghai From 1839d8d06af2d566a4f6ace72991ada50d51b350 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 19:32:49 +0800 Subject: [PATCH 097/463] Fix a user permissions issue --- docker/build/Dockerfile-daemon | 4 ++-- docker/build/Dockerfile-web | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/build/Dockerfile-daemon b/docker/build/Dockerfile-daemon index 8d67aa3..6ab9703 100644 --- a/docker/build/Dockerfile-daemon +++ b/docker/build/Dockerfile-daemon @@ -21,8 +21,8 @@ RUN cd /tmp \ RUN cd /opt/daemon \ && /opt/node/bin/node /opt/node/bin/npm install --production -USER mcsmanager -ENV USER=mcsmanager HOME=/home/mcsmanager +USER container +ENV USER=container HOME=/home/container WORKDIR /opt/daemon COPY ./entrypoint.sh / diff --git a/docker/build/Dockerfile-web b/docker/build/Dockerfile-web index 5636ea1..db3e814 100644 --- a/docker/build/Dockerfile-web +++ b/docker/build/Dockerfile-web @@ -21,8 +21,8 @@ RUN cd /tmp \ RUN cd /opt/web \ && /opt/node/bin/node /opt/node/bin/npm install --production -USER mcsmanager -ENV USER=mcsmanager HOME=/home/mcsmanager +USER container +ENV USER=container HOME=/home/container WORKDIR /opt/web COPY ./entrypoint.sh / From ecb4ab8d6a6302103a538d77d53c0379931fec61 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 19:40:13 +0800 Subject: [PATCH 098/463] fix --- docker/build/Dockerfile-daemon | 3 --- docker/build/Dockerfile-web | 3 --- docker/docs/README.md | 2 +- docker/docs/README_cn.md | 2 +- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/docker/build/Dockerfile-daemon b/docker/build/Dockerfile-daemon index 6ab9703..f135f19 100644 --- a/docker/build/Dockerfile-daemon +++ b/docker/build/Dockerfile-daemon @@ -21,9 +21,6 @@ RUN cd /tmp \ RUN cd /opt/daemon \ && /opt/node/bin/node /opt/node/bin/npm install --production -USER container -ENV USER=container HOME=/home/container - WORKDIR /opt/daemon COPY ./entrypoint.sh / CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/docker/build/Dockerfile-web b/docker/build/Dockerfile-web index db3e814..9b0c87f 100644 --- a/docker/build/Dockerfile-web +++ b/docker/build/Dockerfile-web @@ -21,9 +21,6 @@ RUN cd /tmp \ RUN cd /opt/web \ && /opt/node/bin/node /opt/node/bin/npm install --production -USER container -ENV USER=container HOME=/home/container - WORKDIR /opt/web COPY ./entrypoint.sh / CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/docker/docs/README.md b/docker/docs/README.md index 2389403..848a02f 100644 --- a/docker/docs/README.md +++ b/docker/docs/README.md @@ -137,7 +137,7 @@ If everything runs smoothly, shortly after, you can access `http://127.0.0.1:233 If you no longer need MCSManager later on, you can navigate to the folder where you placed `docker-compose.yml` and then enter the following command to uninstall. ```bash -docker compose down +docker compose -f docker-compose.yaml down rm -rf data ``` diff --git a/docker/docs/README_cn.md b/docker/docs/README_cn.md index 79b4826..04a377d 100644 --- a/docker/docs/README_cn.md +++ b/docker/docs/README_cn.md @@ -137,7 +137,7 @@ docker compose -f docker-compose.yaml up -d 如果后期你不需要 MCSManager 了, 你可以进入你用于放置 `docker-compose.yml` 的文件夹, 然后输入以下命令以卸载 ```bash -docker compose down +docker compose -f docker-compose.yaml down rm -rf data ``` From 9a0c37bb2d67bc2c52160a324cd35a6691d06916 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 19:40:13 +0800 Subject: [PATCH 099/463] Add executable permission to entrypoint.sh --- docker/build/Dockerfile-daemon | 4 +--- docker/build/Dockerfile-web | 4 +--- docker/docs/README.md | 2 +- docker/docs/README_cn.md | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/docker/build/Dockerfile-daemon b/docker/build/Dockerfile-daemon index 6ab9703..4361d12 100644 --- a/docker/build/Dockerfile-daemon +++ b/docker/build/Dockerfile-daemon @@ -21,9 +21,7 @@ RUN cd /tmp \ RUN cd /opt/daemon \ && /opt/node/bin/node /opt/node/bin/npm install --production -USER container -ENV USER=container HOME=/home/container - WORKDIR /opt/daemon COPY ./entrypoint.sh / +RUN chmod +x /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/docker/build/Dockerfile-web b/docker/build/Dockerfile-web index db3e814..e89fc78 100644 --- a/docker/build/Dockerfile-web +++ b/docker/build/Dockerfile-web @@ -21,9 +21,7 @@ RUN cd /tmp \ RUN cd /opt/web \ && /opt/node/bin/node /opt/node/bin/npm install --production -USER container -ENV USER=container HOME=/home/container - WORKDIR /opt/web COPY ./entrypoint.sh / +RUN chmod +x /entrypoint.sh CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/docker/docs/README.md b/docker/docs/README.md index 2389403..848a02f 100644 --- a/docker/docs/README.md +++ b/docker/docs/README.md @@ -137,7 +137,7 @@ If everything runs smoothly, shortly after, you can access `http://127.0.0.1:233 If you no longer need MCSManager later on, you can navigate to the folder where you placed `docker-compose.yml` and then enter the following command to uninstall. ```bash -docker compose down +docker compose -f docker-compose.yaml down rm -rf data ``` diff --git a/docker/docs/README_cn.md b/docker/docs/README_cn.md index 79b4826..04a377d 100644 --- a/docker/docs/README_cn.md +++ b/docker/docs/README_cn.md @@ -137,7 +137,7 @@ docker compose -f docker-compose.yaml up -d 如果后期你不需要 MCSManager 了, 你可以进入你用于放置 `docker-compose.yml` 的文件夹, 然后输入以下命令以卸载 ```bash -docker compose down +docker compose -f docker-compose.yaml down rm -rf data ``` From 0beffa8f21be0565db4c68feb348b9ae89531b67 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 19:43:52 +0800 Subject: [PATCH 100/463] Update network_mode in Docker Compose files --- docker/examples/cn/daemon.yaml | 3 +-- docker/examples/cn/full.yaml | 4 +--- docker/examples/cn/web.yaml | 3 +-- docker/examples/en/daemon.yaml | 3 +-- docker/examples/en/full.yaml | 4 +--- docker/examples/en/web.yaml | 3 +-- 6 files changed, 6 insertions(+), 14 deletions(-) diff --git a/docker/examples/cn/daemon.yaml b/docker/examples/cn/daemon.yaml index 0b1654a..408edc9 100644 --- a/docker/examples/cn/daemon.yaml +++ b/docker/examples/cn/daemon.yaml @@ -13,5 +13,4 @@ services: - ./data/data/daemon:/opt/daemon/data # port: # - 24444:24444 - network_mode: host - command: /entrypoint.sh \ No newline at end of file + network_mode: host \ No newline at end of file diff --git a/docker/examples/cn/full.yaml b/docker/examples/cn/full.yaml index 1701aba..705be75 100644 --- a/docker/examples/cn/full.yaml +++ b/docker/examples/cn/full.yaml @@ -14,7 +14,6 @@ services: # port: # - 23333:23333 network_mode: host - command: /entrypoint.sh daemon: image: bluefunny/mcsmanager:daemon-9 @@ -28,5 +27,4 @@ services: - ./data/data/daemon:/opt/daemon/data # port: # - 24444:24444 - network_mode: host - command: /entrypoint.sh \ No newline at end of file + network_mode: host \ No newline at end of file diff --git a/docker/examples/cn/web.yaml b/docker/examples/cn/web.yaml index c45653a..62eeffe 100644 --- a/docker/examples/cn/web.yaml +++ b/docker/examples/cn/web.yaml @@ -13,5 +13,4 @@ services: - ./data/data/web:/opt/web/data # port: # - 23333:23333 - network_mode: host - command: /entrypoint.sh \ No newline at end of file + network_mode: host \ No newline at end of file diff --git a/docker/examples/en/daemon.yaml b/docker/examples/en/daemon.yaml index 10958d1..326e043 100644 --- a/docker/examples/en/daemon.yaml +++ b/docker/examples/en/daemon.yaml @@ -13,5 +13,4 @@ services: - ./data/data/daemon:/opt/daemon/data # port: # - 24444:24444 - network_mode: host - command: /entrypoint.sh \ No newline at end of file + network_mode: host \ No newline at end of file diff --git a/docker/examples/en/full.yaml b/docker/examples/en/full.yaml index 99ae52b..1c535cd 100644 --- a/docker/examples/en/full.yaml +++ b/docker/examples/en/full.yaml @@ -14,7 +14,6 @@ services: # port: # - 23333:23333 network_mode: host - command: /entrypoint.sh daemon: image: bluefunny/mcsmanager:daemon-9 @@ -28,5 +27,4 @@ services: - ./data/data/daemon:/opt/daemon/data # port: # - 24444:24444 - network_mode: host - command: /entrypoint.sh \ No newline at end of file + network_mode: host \ No newline at end of file diff --git a/docker/examples/en/web.yaml b/docker/examples/en/web.yaml index cbe3047..7640f91 100644 --- a/docker/examples/en/web.yaml +++ b/docker/examples/en/web.yaml @@ -13,5 +13,4 @@ services: - ./data/data/web:/opt/web/data # port: # - 23333:23333 - network_mode: host - command: /entrypoint.sh \ No newline at end of file + network_mode: host \ No newline at end of file From 73e1c84703f9d61f0d88d2be55aee2b2ae0a7e97 Mon Sep 17 00:00:00 2001 From: FunnyShadow Date: Wed, 21 Feb 2024 19:51:05 +0800 Subject: [PATCH 101/463] Update field names (within the document) --- docker/docs/README.md | 8 ++++---- docker/docs/README_cn.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/docs/README.md b/docker/docs/README.md index 848a02f..4bf6e47 100644 --- a/docker/docs/README.md +++ b/docker/docs/README.md @@ -42,7 +42,7 @@ version: "3" services: web: image: bluefunny/mcsmanager:web-9 - name: mcsmanager-web + container_name: mcsmanager-web environment: - TZ=Asia/Shanghai volumes: @@ -57,7 +57,7 @@ services: daemon: image: bluefunny/mcsmanager:daemon-9 - name: mcsmanager-daemon + container_name: mcsmanager-daemon environment: - TZ=Asia/Shanghai volumes: @@ -80,7 +80,7 @@ version: "3" services: web: image: bluefunny/mcsmanager:web-9 - name: mcsmanager-web + container_name: mcsmanager-web environment: - TZ=Asia/Shanghai volumes: @@ -103,7 +103,7 @@ version: "3" services: daemon: image: bluefunny/mcsmanager:daemon-9 - name: mcsmanager-daemon + container_name: mcsmanager-daemon environment: - TZ=Asia/Shanghai volumes: diff --git a/docker/docs/README_cn.md b/docker/docs/README_cn.md index 04a377d..e6d2a9b 100644 --- a/docker/docs/README_cn.md +++ b/docker/docs/README_cn.md @@ -42,7 +42,7 @@ version: "3" services: web: image: bluefunny/mcsmanager:web-9 - name: mcsmanager-web + container_name: mcsmanager-web environment: - TZ=Asia/Shanghai volumes: @@ -57,7 +57,7 @@ services: daemon: image: bluefunny/mcsmanager:daemon-9 - name: mcsmanager-daemon + container_name: mcsmanager-daemon environment: - TZ=Asia/Shanghai volumes: @@ -80,7 +80,7 @@ version: "3" services: web: image: bluefunny/mcsmanager:web-9 - name: mcsmanager-web + container_name: mcsmanager-web environment: - TZ=Asia/Shanghai volumes: @@ -103,7 +103,7 @@ version: "3" services: daemon: image: bluefunny/mcsmanager:daemon-9 - name: mcsmanager-daemon + container_name: mcsmanager-daemon environment: - TZ=Asia/Shanghai volumes: From c2eb58c9b70bb336729641d7a76c35c1bbd17f7a Mon Sep 17 00:00:00 2001 From: unitwk Date: Thu, 7 Mar 2024 17:04:08 +0800 Subject: [PATCH 102/463] Update setup_cn.sh --- setup_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index 24518f6..fe93d45 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -8,7 +8,7 @@ fi echo -e "\033[33m当前用户是 root 用户,开始执行 MCSManager 安装脚本。\033[0m" # Config mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/release/mcsmanager_linux_release.tar.gz" +mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" node="v14.19.1" zh=$( [[ $(locale -a) =~ "zh" ]] && echo 1 From 5dd620cd5b0afbd1ff1b5ec9e235349d93630026 Mon Sep 17 00:00:00 2001 From: unitwk Date: Tue, 19 Mar 2024 11:16:51 +0800 Subject: [PATCH 103/463] Feat: test install script --- install.sh | 240 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..103d9a1 --- /dev/null +++ b/install.sh @@ -0,0 +1,240 @@ +#!/bin/bash + +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/mcsmanager_v10_linux_beta.tar.gz" +package_name="mcsmanager-v10.tar.gz" +node="v20.11.1" + +error="" +arch=$(uname -m) + +printf "\033c" + +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} + +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} + +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} + +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +# script info +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +" + +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + + +Install_Node() { + echo_cyan_n "[+] Install Node.JS environment... " + + rm -irf "$node_install_path" + + cd /opt || exit + + rm -rf node-"$node"-linux-"$arch".tar.gz + + wget https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz + + tar -zxf node-"$node"-linux-"$arch".tar.gz + + rm -rf node-"$node"-linux-"$arch".tar.gz + + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]] + then + echo_green "Success" + else + echo_red "Failed" + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node.JS Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node.JS Version ===============" + echo + + sleep 3 +} + + +Install_MCSManager() { + echo_cyan "[+] Install MCSManager..." + + # stop service + systemctl stop mcsm-{web,daemon} + + # delete service + rm -rf /etc/systemd/system/mcsm-daemon.service + rm -rf /etc/systemd/system/mcsm-web.service + systemctl daemon-reload + + mkdir -p ${mcsmanager_install_path} || exit + + # cd /opt/mcsmanager + cd ${mcsmanager_install_path} || exit + + + # donwload MCSManager release + wget ${mcsmanager_donwload_addr} + tar -zxf ${package_name} -o + rm -rf "${mcsmanager_install_path}/${package_name}" + + # echo "[→] cd daemon" + cd daemon || exit + + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log + + # echo "[←] cd .." + cd ../web || exit + + echo_cyan "[+] Install MCSManager-Web dependencies..." + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log + + echo + echo_yellow "=============== MCSManager ===============" + echo_green " Daemon: ${mcsmanager_install_path}/daemon" + echo_green " Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" + + sleep 3 +} + +Create_Service() { + echo_cyan "[+] Create MCSManager service..." + + echo " +[Unit] +Description=MCSManager Daemon + +[Service] +WorkingDirectory=/opt/mcsmanager/daemon +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" > /etc/systemd/system/mcsm-daemon.service + + echo " +[Unit] +Description=MCSManager Web + +[Service] +WorkingDirectory=/opt/mcsmanager/web +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" > /etc/systemd/system/mcsm-web.service + + systemctl daemon-reload + systemctl enable mcsm-daemon.service --now + systemctl enable mcsm-web.service --now + + sleep 3 + + printf "\n\n\n\n" + + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333 (Browser)" + echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" +} + + + +# Environmental inspection +if [[ "$arch" == x86_64 ]]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [[ $arch == aarch64 ]]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [[ $arch == arm ]]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [[ $arch == ppc64le ]]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [[ $arch == s390x ]]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + Red_Error "[x] Sorry, this architecture is not supported yet!" + Red_Error "[x] Please try to install manually: https://github.com/MCSManager/MCSManager#linux" + exit +fi + +# Define the variable Node installation directory +node_install_path="/opt/node-$node-linux-$arch" + +# Check network connection +echo_cyan "[-] Architecture: $arch" + +# Install related software +echo_cyan_n "[+] Installing dependent software(git,tar)... " +if [[ -x "$(command -v yum)" ]]; then yum install -y git tar > error; +elif [[ -x "$(command -v apt-get)" ]]; then apt-get install -y git tar > error; +elif [[ -x "$(command -v pacman)" ]]; then pacman -Syu --noconfirm git tar > error; +elif [[ -x "$(command -v zypper)" ]]; then sudo zypper --non-interactive install git tar > error; +fi + +# Determine whether the relevant software is installed successfully +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] + then + echo_green "Success" + else + echo_red "Failed" + echo "$error" + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" + exit +fi + + +# Install the Node environment +Install_Node + +# Install MCSManager +Install_MCSManager + +# Create MCSManager background service +Create_Service + From ce8e3cc71a925e263e0aa0a5084c89ba84aadabb Mon Sep 17 00:00:00 2001 From: unitwk Date: Tue, 19 Mar 2024 11:30:01 +0800 Subject: [PATCH 104/463] Feat: test install script --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 103d9a1..8842434 100644 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ mcsmanager_install_path="/opt/mcsmanager" mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/mcsmanager_v10_linux_beta.tar.gz" package_name="mcsmanager-v10.tar.gz" -node="v20.11.1" +node="v16.20.2" error="" arch=$(uname -m) From 8cbfd154a2e68c1fd8f3f98400c66f780a98335c Mon Sep 17 00:00:00 2001 From: unitwk Date: Tue, 19 Mar 2024 11:31:52 +0800 Subject: [PATCH 105/463] Feat: test install script --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 8842434..fa55877 100644 --- a/install.sh +++ b/install.sh @@ -1,7 +1,7 @@ #!/bin/bash mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/mcsmanager_v10_linux_beta.tar.gz" +mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/mcsmanager-v10.tar.gz" package_name="mcsmanager-v10.tar.gz" node="v16.20.2" From 5fdbf38a29e2c00cd464cbbed8739f9792c9d147 Mon Sep 17 00:00:00 2001 From: unitwk Date: Tue, 19 Mar 2024 15:50:34 +0800 Subject: [PATCH 106/463] Feat: test install script --- install.sh | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/install.sh b/install.sh index fa55877..d9c7466 100644 --- a/install.sh +++ b/install.sh @@ -44,7 +44,7 @@ Red_Error() { Install_Node() { - echo_cyan_n "[+] Install Node.JS environment... " + echo_cyan_n "[+] Install Node.JS environment...\n" rm -irf "$node_install_path" @@ -96,7 +96,7 @@ Install_MCSManager() { # donwload MCSManager release wget ${mcsmanager_donwload_addr} - tar -zxf ${package_name} -o + tar -zxf ${package_name} -o || exit rm -rf "${mcsmanager_install_path}/${package_name}" # echo "[→] cd daemon" @@ -124,10 +124,11 @@ Install_MCSManager() { Create_Service() { echo_cyan "[+] Create MCSManager service..." + echo_cyan "[!] Try to register to the "systemctl", This comomand require \"root\" permission." - echo " -[Unit] -Description=MCSManager Daemon + sudo su + echo "[Unit] +Description=MCSManager-Daemon [Service] WorkingDirectory=/opt/mcsmanager/daemon @@ -140,9 +141,8 @@ Environment=\"PATH=${PATH}\" WantedBy=multi-user.target " > /etc/systemd/system/mcsm-daemon.service - echo " -[Unit] -Description=MCSManager Web + echo "[Unit] +Description=MCSManager-Web [Service] WorkingDirectory=/opt/mcsmanager/web @@ -155,11 +155,21 @@ Environment=\"PATH=${PATH}\" WantedBy=multi-user.target " > /etc/systemd/system/mcsm-web.service - systemctl daemon-reload - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - sleep 3 + if [ -e "/etc/systemd/system/mcsm-web.service" ]; then + systemctl daemon-reload + systemctl enable mcsm-daemon.service --now + systemctl enable mcsm-web.service --now + exit + echo_green "Registered!" + else + echo_red "Failed to register the system service. Please use the "ROOT" account to re-run the script and ensure that the "sudo" command is available." + exit + exit + fi + + + sleep 2 printf "\n\n\n\n" From 96ad890521cabc261934adf519ae9a24319d7fc5 Mon Sep 17 00:00:00 2001 From: unitwk Date: Tue, 19 Mar 2024 16:06:00 +0800 Subject: [PATCH 107/463] Feat: test install script --- install.sh | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/install.sh b/install.sh index d9c7466..da70346 100644 --- a/install.sh +++ b/install.sh @@ -46,7 +46,7 @@ Red_Error() { Install_Node() { echo_cyan_n "[+] Install Node.JS environment...\n" - rm -irf "$node_install_path" + sudo rm -irf "$node_install_path" cd /opt || exit @@ -81,12 +81,13 @@ Install_MCSManager() { echo_cyan "[+] Install MCSManager..." # stop service - systemctl stop mcsm-{web,daemon} + sudo systemctl stop mcsm-{web,daemon} + sudo systemctl disable mcsm-{web,daemon} # delete service - rm -rf /etc/systemd/system/mcsm-daemon.service - rm -rf /etc/systemd/system/mcsm-web.service - systemctl daemon-reload + sudo rm -rf /etc/systemd/system/mcsm-daemon.service + sudo rm -rf /etc/systemd/system/mcsm-web.service + sudo systemctl daemon-reload mkdir -p ${mcsmanager_install_path} || exit @@ -126,8 +127,8 @@ Create_Service() { echo_cyan "[+] Create MCSManager service..." echo_cyan "[!] Try to register to the "systemctl", This comomand require \"root\" permission." - sudo su - echo "[Unit] + + sudo echo "[Unit] Description=MCSManager-Daemon [Service] @@ -141,7 +142,7 @@ Environment=\"PATH=${PATH}\" WantedBy=multi-user.target " > /etc/systemd/system/mcsm-daemon.service - echo "[Unit] + sudo echo "[Unit] Description=MCSManager-Web [Service] @@ -157,15 +158,12 @@ WantedBy=multi-user.target if [ -e "/etc/systemd/system/mcsm-web.service" ]; then - systemctl daemon-reload - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now - exit + sudo systemctl daemon-reload + sudo systemctl enable mcsm-daemon.service --now + sudo systemctl enable mcsm-web.service --now echo_green "Registered!" else echo_red "Failed to register the system service. Please use the "ROOT" account to re-run the script and ensure that the "sudo" command is available." - exit - exit fi From 49aefcfa4266fed2a9329634e03f01786c47ddf8 Mon Sep 17 00:00:00 2001 From: unitwk Date: Tue, 19 Mar 2024 16:26:05 +0800 Subject: [PATCH 108/463] Feat: test install script --- install.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index da70346..105275b 100644 --- a/install.sh +++ b/install.sh @@ -127,7 +127,6 @@ Create_Service() { echo_cyan "[+] Create MCSManager service..." echo_cyan "[!] Try to register to the "systemctl", This comomand require \"root\" permission." - sudo echo "[Unit] Description=MCSManager-Daemon @@ -156,17 +155,18 @@ Environment=\"PATH=${PATH}\" WantedBy=multi-user.target " > /etc/systemd/system/mcsm-web.service - if [ -e "/etc/systemd/system/mcsm-web.service" ]; then sudo systemctl daemon-reload sudo systemctl enable mcsm-daemon.service --now sudo systemctl enable mcsm-web.service --now echo_green "Registered!" else - echo_red "Failed to register the system service. Please use the "ROOT" account to re-run the script and ensure that the "sudo" command is available." + printf "\n\n" + echo_red "The MCSManager was successfully installed to \"/opt/mcsmanager\"." + echo_red "But register to the \"systemctl\" failed!\nPlease use the \"root\" account to re-run the script!" + exit fi - sleep 2 printf "\n\n\n\n" @@ -219,9 +219,9 @@ echo_cyan "[-] Architecture: $arch" # Install related software echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [[ -x "$(command -v yum)" ]]; then yum install -y git tar > error; -elif [[ -x "$(command -v apt-get)" ]]; then apt-get install -y git tar > error; -elif [[ -x "$(command -v pacman)" ]]; then pacman -Syu --noconfirm git tar > error; +if [[ -x "$(command -v yum)" ]]; then sudo yum install -y git tar > error; +elif [[ -x "$(command -v apt-get)" ]]; then sudo apt-get install -y git tar > error; +elif [[ -x "$(command -v pacman)" ]]; then sudo pacman -Syu --noconfirm git tar > error; elif [[ -x "$(command -v zypper)" ]]; then sudo zypper --non-interactive install git tar > error; fi From c1030c814b922d4b7fbd97d80d67a3aaf9bbfd2d Mon Sep 17 00:00:00 2001 From: Umou Date: Sun, 31 Mar 2024 09:44:51 +0800 Subject: [PATCH 109/463] Update install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 105275b..5355807 100644 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ mcsmanager_install_path="/opt/mcsmanager" mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/mcsmanager-v10.tar.gz" -package_name="mcsmanager-v10.tar.gz" +package_name="MCSManager-v10-linux.tar.gz" node="v16.20.2" error="" From 94862d849f0054e5285adc9a576ac39b0d7718a4 Mon Sep 17 00:00:00 2001 From: Umou Date: Sun, 31 Mar 2024 09:45:07 +0800 Subject: [PATCH 110/463] Update install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5355807..46d38a5 100644 --- a/install.sh +++ b/install.sh @@ -1,7 +1,7 @@ #!/bin/bash mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/mcsmanager-v10.tar.gz" +mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/MCSManager-v10-linux.tar.gz" package_name="MCSManager-v10-linux.tar.gz" node="v16.20.2" From be51fd905a256e6219ac69c430c99b4250505872 Mon Sep 17 00:00:00 2001 From: Umou Date: Mon, 1 Apr 2024 22:50:53 +0800 Subject: [PATCH 111/463] Update README.md --- README.md | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 4b77c7f..8e861f7 100644 --- a/README.md +++ b/README.md @@ -2,28 +2,14 @@
-[Official Website](http://mcsmanager.com/) | [中文文档](https://github.com/MCSManager/Script/blob/master/README_cn.md) | [Gitee](https://gitee.com/mcsmanager/script) +[Official Website](http://mcsmanager.com/)
## What is this? -The files here are all platform-wide install, delete, update scripts, etc. for MCSManager 9. +The files here are all platform-wide install, delete, update scripts, etc. for MCSManager. The default installation script on the official website is the `setup.sh` file of gitee repository, it contains multiple languages. You can also use the following one-click command to perform a quick installation - -## Installation method - -### One-click installation command - -```bash -wget https://raw.githubusercontent.com/MCSManager/Script/master/setup.sh -O setup.sh && bash setup.sh -``` - -### Docker (Beta) - -Please check this [tutorial](https://github.com/MCSManager/Script/blob/master/docker/README.md) - -
From c3e0d074705b96c2d5275247212a71ff8cf74d01 Mon Sep 17 00:00:00 2001 From: Umou Date: Mon, 1 Apr 2024 22:53:28 +0800 Subject: [PATCH 112/463] Update install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 46d38a5..0a4de74 100644 --- a/install.sh +++ b/install.sh @@ -1,7 +1,7 @@ #!/bin/bash mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/MCSManager-v10-linux.tar.gz" +mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" package_name="MCSManager-v10-linux.tar.gz" node="v16.20.2" From c163a027cad9b7b33c85ab241f048fa8a1601888 Mon Sep 17 00:00:00 2001 From: Umou Date: Tue, 2 Apr 2024 15:10:59 +0800 Subject: [PATCH 113/463] Update install.sh --- install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 0a4de74..9613e3f 100644 --- a/install.sh +++ b/install.sh @@ -119,7 +119,9 @@ Install_MCSManager() { echo_yellow "=============== MCSManager ===============" echo echo_green "[+] MCSManager installation success!" - + + sudo chmod -R 755 /opt/mcsmanager/ + sleep 3 } From 8aedc984e02e5ce6a3e5541ab08e3fe5a5bba31b Mon Sep 17 00:00:00 2001 From: Umou Date: Wed, 3 Apr 2024 14:09:48 +0800 Subject: [PATCH 114/463] Update install.sh --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 9613e3f..42a35b7 100644 --- a/install.sh +++ b/install.sh @@ -104,13 +104,13 @@ Install_MCSManager() { cd daemon || exit echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit > npm_install_log # echo "[←] cd .." cd ../web || exit echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit > npm_install_log echo echo_yellow "=============== MCSManager ===============" From d42d5004f2857cfe0f4266a27bbe02c9f23e9156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=90=A8?= Date: Wed, 3 Apr 2024 15:36:32 +0800 Subject: [PATCH 115/463] Feat: upgrade to v10 --- install.sh | 250 ---------------------------------------------- package-lock.json | 6 ++ setup.sh | 136 ++++++++++++------------- setup_cn.sh | 179 ++++++++++++++------------------- setup_en.sh | 136 ++++++++++++------------- 5 files changed, 221 insertions(+), 486 deletions(-) delete mode 100644 install.sh create mode 100644 package-lock.json diff --git a/install.sh b/install.sh deleted file mode 100644 index 42a35b7..0000000 --- a/install.sh +++ /dev/null @@ -1,250 +0,0 @@ -#!/bin/bash - -mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" -package_name="MCSManager-v10-linux.tar.gz" -node="v16.20.2" - -error="" -arch=$(uname -m) - -printf "\033c" - -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} - -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} - -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" -} - -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} - -# script info -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -" - -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 -} - - -Install_Node() { - echo_cyan_n "[+] Install Node.JS environment...\n" - - sudo rm -irf "$node_install_path" - - cd /opt || exit - - rm -rf node-"$node"-linux-"$arch".tar.gz - - wget https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz - - tar -zxf node-"$node"-linux-"$arch".tar.gz - - rm -rf node-"$node"-linux-"$arch".tar.gz - - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]] - then - echo_green "Success" - else - echo_red "Failed" - Red_Error "[x] Node installation failed!" - fi - - echo - echo_yellow "=============== Node.JS Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" - echo - - sleep 3 -} - - -Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." - - # stop service - sudo systemctl stop mcsm-{web,daemon} - sudo systemctl disable mcsm-{web,daemon} - - # delete service - sudo rm -rf /etc/systemd/system/mcsm-daemon.service - sudo rm -rf /etc/systemd/system/mcsm-web.service - sudo systemctl daemon-reload - - mkdir -p ${mcsmanager_install_path} || exit - - # cd /opt/mcsmanager - cd ${mcsmanager_install_path} || exit - - - # donwload MCSManager release - wget ${mcsmanager_donwload_addr} - tar -zxf ${package_name} -o || exit - rm -rf "${mcsmanager_install_path}/${package_name}" - - # echo "[→] cd daemon" - cd daemon || exit - - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit > npm_install_log - - # echo "[←] cd .." - cd ../web || exit - - echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit > npm_install_log - - echo - echo_yellow "=============== MCSManager ===============" - echo_green " Daemon: ${mcsmanager_install_path}/daemon" - echo_green " Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" - - sudo chmod -R 755 /opt/mcsmanager/ - - sleep 3 -} - -Create_Service() { - echo_cyan "[+] Create MCSManager service..." - echo_cyan "[!] Try to register to the "systemctl", This comomand require \"root\" permission." - - sudo echo "[Unit] -Description=MCSManager-Daemon - -[Service] -WorkingDirectory=/opt/mcsmanager/daemon -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-daemon.service - - sudo echo "[Unit] -Description=MCSManager-Web - -[Service] -WorkingDirectory=/opt/mcsmanager/web -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-web.service - - if [ -e "/etc/systemd/system/mcsm-web.service" ]; then - sudo systemctl daemon-reload - sudo systemctl enable mcsm-daemon.service --now - sudo systemctl enable mcsm-web.service --now - echo_green "Registered!" - else - printf "\n\n" - echo_red "The MCSManager was successfully installed to \"/opt/mcsmanager\"." - echo_red "But register to the \"systemctl\" failed!\nPlease use the \"root\" account to re-run the script!" - exit - fi - - sleep 2 - - printf "\n\n\n\n" - - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333 (Browser)" - echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" -} - - - -# Environmental inspection -if [[ "$arch" == x86_64 ]]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [[ $arch == aarch64 ]]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [[ $arch == arm ]]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [[ $arch == ppc64le ]]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [[ $arch == s390x ]]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - Red_Error "[x] Sorry, this architecture is not supported yet!" - Red_Error "[x] Please try to install manually: https://github.com/MCSManager/MCSManager#linux" - exit -fi - -# Define the variable Node installation directory -node_install_path="/opt/node-$node-linux-$arch" - -# Check network connection -echo_cyan "[-] Architecture: $arch" - -# Install related software -echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [[ -x "$(command -v yum)" ]]; then sudo yum install -y git tar > error; -elif [[ -x "$(command -v apt-get)" ]]; then sudo apt-get install -y git tar > error; -elif [[ -x "$(command -v pacman)" ]]; then sudo pacman -Syu --noconfirm git tar > error; -elif [[ -x "$(command -v zypper)" ]]; then sudo zypper --non-interactive install git tar > error; -fi - -# Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] - then - echo_green "Success" - else - echo_red "Failed" - echo "$error" - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - exit -fi - - -# Install the Node environment -Install_Node - -# Install MCSManager -Install_MCSManager - -# Create MCSManager background service -Create_Service - diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6f84430 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "Script", + "lockfileVersion": 2, + "requires": true, + "packages": {} +} diff --git a/setup.sh b/setup.sh index f5e7ef2..4e5220a 100644 --- a/setup.sh +++ b/setup.sh @@ -1,16 +1,15 @@ #!/bin/bash -# Config mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" -node="v14.19.1" +mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +package_name="MCSManager-v10-linux.tar.gz" +node="v16.20.2" error="" arch=$(uname -m) printf "\033c" -# print func echo_cyan() { printf '\033[1;36m%b\033[0m\n' "$@" } @@ -34,10 +33,6 @@ echo_yellow() { echo_cyan "+---------------------------------------------------------------------- | MCSManager Installer +---------------------------------------------------------------------- -| Copyright © 2023 MCSManager. -+---------------------------------------------------------------------- -| Contributors: Nuomiaa, CreeperKong, Unitwk, FunnyShadow -+---------------------------------------------------------------------- " Red_Error() { @@ -47,15 +42,14 @@ Red_Error() { exit 1 } - Install_Node() { - echo_cyan_n "[+] Install Node.JS environment... " + echo_cyan_n "[+] Install Node.JS environment...\n" - rm -irf "$node_install_path" + sudo rm -irf "$node_install_path" cd /opt || exit - rm -rf node-"$node"-linux-"$arch".tar.gz + rm -rf node-"$node"-linux-"$arch".tar.gz wget https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz @@ -63,8 +57,7 @@ Install_Node() { rm -rf node-"$node"-linux-"$arch".tar.gz - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]] - then + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then echo_green "Success" else echo_red "Failed" @@ -81,40 +74,39 @@ Install_Node() { sleep 3 } - Install_MCSManager() { echo_cyan "[+] Install MCSManager..." # stop service - systemctl stop mcsm-{web,daemon} + sudo systemctl stop mcsm-{web,daemon} + sudo systemctl disable mcsm-{web,daemon} # delete service - rm -rf /etc/systemd/system/mcsm-daemon.service - rm -rf /etc/systemd/system/mcsm-web.service - systemctl daemon-reload + sudo rm -rf /etc/systemd/system/mcsm-daemon.service + sudo rm -rf /etc/systemd/system/mcsm-web.service + sudo systemctl daemon-reload mkdir -p ${mcsmanager_install_path} || exit # cd /opt/mcsmanager cd ${mcsmanager_install_path} || exit - # donwload MCSManager release wget ${mcsmanager_donwload_addr} - tar -zxf mcsmanager_linux_release.tar.gz -o - rm -rf "${mcsmanager_install_path}/mcsmanager_linux_release.tar.gz" - + tar -zxf ${package_name} -o || exit + rm -rf "${mcsmanager_install_path}/${package_name}" + # echo "[→] cd daemon" cd daemon || exit echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log # echo "[←] cd .." cd ../web || exit echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log echo echo_yellow "=============== MCSManager ===============" @@ -124,15 +116,17 @@ Install_MCSManager() { echo echo_green "[+] MCSManager installation success!" + sudo chmod -R 755 /opt/mcsmanager/ + sleep 3 } Create_Service() { echo_cyan "[+] Create MCSManager service..." + echo_cyan "[!] Try to register to the "systemctl", This comomand require \"root\" permission." - echo " -[Unit] -Description=MCSManager Daemon + sudo echo "[Unit] +Description=MCSManager-Daemon [Service] WorkingDirectory=/opt/mcsmanager/daemon @@ -143,11 +137,10 @@ Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-daemon.service +" >/etc/systemd/system/mcsm-daemon.service - echo " -[Unit] -Description=MCSManager Web + sudo echo "[Unit] +Description=MCSManager-Web [Service] WorkingDirectory=/opt/mcsmanager/web @@ -158,34 +151,42 @@ Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-web.service +" >/etc/systemd/system/mcsm-web.service - systemctl daemon-reload - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now + if [ -e "/etc/systemd/system/mcsm-web.service" ]; then + sudo systemctl daemon-reload + sudo systemctl enable mcsm-daemon.service --now + sudo systemctl enable mcsm-web.service --now + echo_green "Registered!" + else + printf "\n\n" + echo_red "The MCSManager was successfully installed to \"/opt/mcsmanager\"." + echo_red "But register to the \"systemctl\" failed!\nPlease use the \"root\" account to re-run the script!" + exit + fi - sleep 3 + sleep 2 - printf "\n\n" + printf "\n\n\n\n" echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager panel !!!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" - echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" + echo_cyan_n "Daemon Address: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" } - - # Environmental inspection if [[ "$arch" == x86_64 ]]; then arch=x64 @@ -216,24 +217,26 @@ echo_cyan "[-] Architecture: $arch" # Install related software echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [[ -x "$(command -v yum)" ]]; then yum install -y git tar > error; -elif [[ -x "$(command -v apt-get)" ]]; then apt-get install -y git tar > error; -elif [[ -x "$(command -v pacman)" ]]; then pacman -Syu --noconfirm git tar > error; -elif [[ -x "$(command -v zypper)" ]]; then sudo zypper --non-interactive install git tar > error; +if [[ -x "$(command -v yum)" ]]; then + sudo yum install -y git tar >error +elif [[ -x "$(command -v apt-get)" ]]; then + sudo apt-get install -y git tar >error +elif [[ -x "$(command -v pacman)" ]]; then + sudo pacman -Syu --noconfirm git tar >error +elif [[ -x "$(command -v zypper)" ]]; then + sudo zypper --non-interactive install git tar >error fi # Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] - then - echo_green "Success" - else - echo_red "Failed" - echo "$error" - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - exit +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then + echo_green "Success" +else + echo_red "Failed" + echo "$error" + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" + exit fi - # Install the Node environment Install_Node @@ -242,4 +245,3 @@ Install_MCSManager # Create MCSManager background service Create_Service - diff --git a/setup_cn.sh b/setup_cn.sh index fe93d45..613fa13 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1,26 +1,15 @@ #!/bin/bash -# 检查当前用户是否为 root 用户 -if [[ $(id -u) -ne 0 ]]; then - echo -e "\033[31m需要 root 权限执行此脚本,请使用 sudo 或者切换到 root 用户。\033[0m" - exit 1 -fi -# 如果当前用户是 root 用户,则执行脚本的主体部分 -echo -e "\033[33m当前用户是 root 用户,开始执行 MCSManager 安装脚本。\033[0m" -# Config + mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://gitee.com/mcsmanager/MCSManager/releases/download/v9.9.0/mcsmanager_linux_release.tar.gz" -node="v14.19.1" -zh=$( - [[ $(locale -a) =~ "zh" ]] && echo 1 - export LANG=zh_CN.UTF-8 || echo 0 -) +mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +package_name="MCSManager-v10-linux.tar.gz" +node="v16.20.2" error="" arch=$(uname -m) printf "\033c" -# print func echo_cyan() { printf '\033[1;36m%b\033[0m\n' "$@" } @@ -40,17 +29,12 @@ echo_yellow() { printf '\033[1;33m%b\033[0m\n' "$@" } -# script info echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -| Copyright © 2023 MCSManager. -+---------------------------------------------------------------------- -| Contributors: Nuomiaa, CreeperKong, Unitwk, FunnyShadow +| MCSManager 安装脚本 +---------------------------------------------------------------------- -We will use servers in the China to speed up your installation! -我们将使用中国地区的服务器来加速您的安装速度! +MCSManager 安装脚本不会破坏您系统上原有的任何服务以及环境变量,安装脚本所有的一切均为无污染的安全行为! +我们只会在 /opt 目录下创建两个文件夹,一个用于存放 NodeJS 运行时,一个用于存放 MCSManager 代码文件,并且尝试添加 MCSM 到系统服务! " Red_Error() { @@ -60,24 +44,22 @@ Red_Error() { exit 1 } - Install_Node() { - echo_cyan_n "[+] Install Node.JS environment... " + echo_cyan_n "[+] 正在安装 NodeJS 运行时环境...\n" - rm -irf "$node_install_path" + sudo rm -irf "$node_install_path" cd /opt || exit - rm -rf node-"$node"-linux-"$arch".tar.gz + rm -rf node-"$node"-linux-"$arch".tar.gz - wget https://npmmirror.com/mirrors/node/"$node"/node-"$node"-linux-"$arch".tar.gz + wget https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz tar -zxf node-"$node"-linux-"$arch".tar.gz rm -rf node-"$node"-linux-"$arch".tar.gz - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]] - then + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then echo_green "Success" else echo_red "Failed" @@ -94,40 +76,39 @@ Install_Node() { sleep 3 } - Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." + echo_cyan "[+] 正在安装面板..." # stop service - systemctl stop mcsm-{web,daemon} + sudo systemctl stop mcsm-{web,daemon} + sudo systemctl disable mcsm-{web,daemon} # delete service - rm -rf /etc/systemd/system/mcsm-daemon.service - rm -rf /etc/systemd/system/mcsm-web.service - systemctl daemon-reload + sudo rm -rf /etc/systemd/system/mcsm-daemon.service + sudo rm -rf /etc/systemd/system/mcsm-web.service + sudo systemctl daemon-reload mkdir -p ${mcsmanager_install_path} || exit # cd /opt/mcsmanager cd ${mcsmanager_install_path} || exit - # donwload MCSManager release wget ${mcsmanager_donwload_addr} - tar -zxf mcsmanager_linux_release.tar.gz -o - rm -rf "${mcsmanager_install_path}/mcsmanager_linux_release.tar.gz" - + tar -zxf ${package_name} -o || exit + rm -rf "${mcsmanager_install_path}/${package_name}" + # echo "[→] cd daemon" cd daemon || exit echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production > npm_install_log + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log # echo "[←] cd .." cd ../web || exit echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production > npm_install_log + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log echo echo_yellow "=============== MCSManager ===============" @@ -137,15 +118,17 @@ Install_MCSManager() { echo echo_green "[+] MCSManager installation success!" + sudo chmod -R 755 /opt/mcsmanager/ + sleep 3 } Create_Service() { - echo_cyan "[+] Create MCSManager service..." + echo_cyan "[+] 注册系统服务中..." + echo_cyan "[!] Try to register to the "systemctl", This comomand require \"root\" permission." - echo " -[Unit] -Description=MCSManager Daemon + sudo echo "[Unit] +Description=MCSManager-Daemon [Service] WorkingDirectory=/opt/mcsmanager/daemon @@ -156,11 +139,10 @@ Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-daemon.service +" >/etc/systemd/system/mcsm-daemon.service - echo " -[Unit] -Description=MCSManager Web + sudo echo "[Unit] +Description=MCSManager-Web [Service] WorkingDirectory=/opt/mcsmanager/web @@ -171,49 +153,41 @@ Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-web.service - - systemctl daemon-reload - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now +" >/etc/systemd/system/mcsm-web.service - sleep 3 - - printf "\n\n" - echo_yellow "==================================================================" - if [[ "$zh" == 1 ]]; then - echo_green "安装已完成!欢迎使用 MCSManager 面板!" - echo_yellow " " - echo_cyan_n "控制面板地址: " - echo_yellow "http://你的公网IP:23333" - echo_red "你必须开放 23333(面板)和 24444(守护进程用)端口,控制面板需要这两个端口才能正常工作。" - echo_yellow " " - echo_cyan "下面是常用的几个命令:" - echo_cyan "启动面板 systemctl start mcsm-{daemon,web}.service" - echo_cyan "停止面板 systemctl stop mcsm-{daemon,web}.service" - echo_cyan "重启面板 systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_cyan "官方文档(必读):https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + if [ -e "/etc/systemd/system/mcsm-web.service" ]; then + sudo systemctl daemon-reload + sudo systemctl enable mcsm-daemon.service --now + sudo systemctl enable mcsm-web.service --now + echo_green "Registered!" else - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager panel!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" - echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + printf "\n\n" + echo_red "面板已成功安装到目录: \"/opt/mcsmanager\"." + echo_red "但是由于权限不足,无法注册到系统服务中,你可以手动启动面板(参考 Github Readme.md)或重新使用 root 权限安装!" + exit fi -} + sleep 2 + printf "\n\n\n\n" + + echo_yellow "==================================================================" + echo_green "MCSManager 面板已安装完成!接下来您只需在浏览器访问即可愉快的使用它!" + echo_yellow " " + echo_cyan_n "请使用浏览器访问此地址: " + echo_yellow "http://<公网IP>:23333" + echo_cyan_n "守护进程地址(集群用): " + echo_yellow "ws://<公网IP>:24444" + echo_red "注意:您必须开放 23333 和 24444 两个端口才能保证服务正常访问!" + echo_yellow " " + echo_cyan "面板常用命令:" + echo_cyan "systemctl start mcsm-{daemon,web}.service # 开启面板" + echo_cyan "systemctl stop mcsm-{daemon,web}.service # 关闭面板" + echo_cyan "systemctl restart mcsm-{daemon,web}.service # 重启面板" + echo_yellow " " + echo_green "官方文档: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" +} # Environmental inspection if [[ "$arch" == x86_64 ]]; then @@ -245,24 +219,26 @@ echo_cyan "[-] Architecture: $arch" # Install related software echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [[ -x "$(command -v yum)" ]]; then yum install -y git tar > error; -elif [[ -x "$(command -v apt-get)" ]]; then apt-get install -y git tar > error; -elif [[ -x "$(command -v pacman)" ]]; then pacman -Syu --noconfirm git tar > error; -elif [[ -x "$(command -v zypper)" ]]; then sudo zypper --non-interactive install git tar > error; +if [[ -x "$(command -v yum)" ]]; then + sudo yum install -y git tar >error +elif [[ -x "$(command -v apt-get)" ]]; then + sudo apt-get install -y git tar >error +elif [[ -x "$(command -v pacman)" ]]; then + sudo pacman -Syu --noconfirm git tar >error +elif [[ -x "$(command -v zypper)" ]]; then + sudo zypper --non-interactive install git tar >error fi # Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] - then - echo_green "Success" - else - echo_red "Failed" - echo "$error" - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - exit +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then + echo_green "Success" +else + echo_red "Failed" + echo "$error" + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" + exit fi - # Install the Node environment Install_Node @@ -271,4 +247,3 @@ Install_MCSManager # Create MCSManager background service Create_Service - diff --git a/setup_en.sh b/setup_en.sh index f5e7ef2..4e5220a 100644 --- a/setup_en.sh +++ b/setup_en.sh @@ -1,16 +1,15 @@ #!/bin/bash -# Config mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" -node="v14.19.1" +mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +package_name="MCSManager-v10-linux.tar.gz" +node="v16.20.2" error="" arch=$(uname -m) printf "\033c" -# print func echo_cyan() { printf '\033[1;36m%b\033[0m\n' "$@" } @@ -34,10 +33,6 @@ echo_yellow() { echo_cyan "+---------------------------------------------------------------------- | MCSManager Installer +---------------------------------------------------------------------- -| Copyright © 2023 MCSManager. -+---------------------------------------------------------------------- -| Contributors: Nuomiaa, CreeperKong, Unitwk, FunnyShadow -+---------------------------------------------------------------------- " Red_Error() { @@ -47,15 +42,14 @@ Red_Error() { exit 1 } - Install_Node() { - echo_cyan_n "[+] Install Node.JS environment... " + echo_cyan_n "[+] Install Node.JS environment...\n" - rm -irf "$node_install_path" + sudo rm -irf "$node_install_path" cd /opt || exit - rm -rf node-"$node"-linux-"$arch".tar.gz + rm -rf node-"$node"-linux-"$arch".tar.gz wget https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz @@ -63,8 +57,7 @@ Install_Node() { rm -rf node-"$node"-linux-"$arch".tar.gz - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]] - then + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then echo_green "Success" else echo_red "Failed" @@ -81,40 +74,39 @@ Install_Node() { sleep 3 } - Install_MCSManager() { echo_cyan "[+] Install MCSManager..." # stop service - systemctl stop mcsm-{web,daemon} + sudo systemctl stop mcsm-{web,daemon} + sudo systemctl disable mcsm-{web,daemon} # delete service - rm -rf /etc/systemd/system/mcsm-daemon.service - rm -rf /etc/systemd/system/mcsm-web.service - systemctl daemon-reload + sudo rm -rf /etc/systemd/system/mcsm-daemon.service + sudo rm -rf /etc/systemd/system/mcsm-web.service + sudo systemctl daemon-reload mkdir -p ${mcsmanager_install_path} || exit # cd /opt/mcsmanager cd ${mcsmanager_install_path} || exit - # donwload MCSManager release wget ${mcsmanager_donwload_addr} - tar -zxf mcsmanager_linux_release.tar.gz -o - rm -rf "${mcsmanager_install_path}/mcsmanager_linux_release.tar.gz" - + tar -zxf ${package_name} -o || exit + rm -rf "${mcsmanager_install_path}/${package_name}" + # echo "[→] cd daemon" cd daemon || exit echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log # echo "[←] cd .." cd ../web || exit echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production > npm_install_log + /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log echo echo_yellow "=============== MCSManager ===============" @@ -124,15 +116,17 @@ Install_MCSManager() { echo echo_green "[+] MCSManager installation success!" + sudo chmod -R 755 /opt/mcsmanager/ + sleep 3 } Create_Service() { echo_cyan "[+] Create MCSManager service..." + echo_cyan "[!] Try to register to the "systemctl", This comomand require \"root\" permission." - echo " -[Unit] -Description=MCSManager Daemon + sudo echo "[Unit] +Description=MCSManager-Daemon [Service] WorkingDirectory=/opt/mcsmanager/daemon @@ -143,11 +137,10 @@ Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-daemon.service +" >/etc/systemd/system/mcsm-daemon.service - echo " -[Unit] -Description=MCSManager Web + sudo echo "[Unit] +Description=MCSManager-Web [Service] WorkingDirectory=/opt/mcsmanager/web @@ -158,34 +151,42 @@ Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-web.service +" >/etc/systemd/system/mcsm-web.service - systemctl daemon-reload - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now + if [ -e "/etc/systemd/system/mcsm-web.service" ]; then + sudo systemctl daemon-reload + sudo systemctl enable mcsm-daemon.service --now + sudo systemctl enable mcsm-web.service --now + echo_green "Registered!" + else + printf "\n\n" + echo_red "The MCSManager was successfully installed to \"/opt/mcsmanager\"." + echo_red "But register to the \"systemctl\" failed!\nPlease use the \"root\" account to re-run the script!" + exit + fi - sleep 3 + sleep 2 - printf "\n\n" + printf "\n\n\n\n" echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager panel !!!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: "; echo_yellow "http://:23333" - echo_cyan_n "Daemon Address: "; echo_yellow "ws://:24444" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" + echo_cyan_n "Daemon Address: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" } - - # Environmental inspection if [[ "$arch" == x86_64 ]]; then arch=x64 @@ -216,24 +217,26 @@ echo_cyan "[-] Architecture: $arch" # Install related software echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [[ -x "$(command -v yum)" ]]; then yum install -y git tar > error; -elif [[ -x "$(command -v apt-get)" ]]; then apt-get install -y git tar > error; -elif [[ -x "$(command -v pacman)" ]]; then pacman -Syu --noconfirm git tar > error; -elif [[ -x "$(command -v zypper)" ]]; then sudo zypper --non-interactive install git tar > error; +if [[ -x "$(command -v yum)" ]]; then + sudo yum install -y git tar >error +elif [[ -x "$(command -v apt-get)" ]]; then + sudo apt-get install -y git tar >error +elif [[ -x "$(command -v pacman)" ]]; then + sudo pacman -Syu --noconfirm git tar >error +elif [[ -x "$(command -v zypper)" ]]; then + sudo zypper --non-interactive install git tar >error fi # Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]] - then - echo_green "Success" - else - echo_red "Failed" - echo "$error" - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - exit +if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then + echo_green "Success" +else + echo_red "Failed" + echo "$error" + Red_Error "[x] Related software installation failed, please install git and tar packages manually!" + exit fi - # Install the Node environment Install_Node @@ -242,4 +245,3 @@ Install_MCSManager # Create MCSManager background service Create_Service - From 71592112ac3fb88198e67b62362d2390ad921390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=90=A8?= Date: Wed, 3 Apr 2024 15:36:48 +0800 Subject: [PATCH 116/463] Feat: upgrade to v10 --- setup_en.sh | 247 ---------------------------------------------------- 1 file changed, 247 deletions(-) delete mode 100644 setup_en.sh diff --git a/setup_en.sh b/setup_en.sh deleted file mode 100644 index 4e5220a..0000000 --- a/setup_en.sh +++ /dev/null @@ -1,247 +0,0 @@ -#!/bin/bash - -mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" -package_name="MCSManager-v10-linux.tar.gz" -node="v16.20.2" - -error="" -arch=$(uname -m) - -printf "\033c" - -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} - -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} - -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" -} - -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} - -# script info -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -" - -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 -} - -Install_Node() { - echo_cyan_n "[+] Install Node.JS environment...\n" - - sudo rm -irf "$node_install_path" - - cd /opt || exit - - rm -rf node-"$node"-linux-"$arch".tar.gz - - wget https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz - - tar -zxf node-"$node"-linux-"$arch".tar.gz - - rm -rf node-"$node"-linux-"$arch".tar.gz - - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Success" - else - echo_red "Failed" - Red_Error "[x] Node installation failed!" - fi - - echo - echo_yellow "=============== Node.JS Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" - echo - - sleep 3 -} - -Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." - - # stop service - sudo systemctl stop mcsm-{web,daemon} - sudo systemctl disable mcsm-{web,daemon} - - # delete service - sudo rm -rf /etc/systemd/system/mcsm-daemon.service - sudo rm -rf /etc/systemd/system/mcsm-web.service - sudo systemctl daemon-reload - - mkdir -p ${mcsmanager_install_path} || exit - - # cd /opt/mcsmanager - cd ${mcsmanager_install_path} || exit - - # donwload MCSManager release - wget ${mcsmanager_donwload_addr} - tar -zxf ${package_name} -o || exit - rm -rf "${mcsmanager_install_path}/${package_name}" - - # echo "[→] cd daemon" - cd daemon || exit - - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log - - # echo "[←] cd .." - cd ../web || exit - - echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log - - echo - echo_yellow "=============== MCSManager ===============" - echo_green " Daemon: ${mcsmanager_install_path}/daemon" - echo_green " Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" - - sudo chmod -R 755 /opt/mcsmanager/ - - sleep 3 -} - -Create_Service() { - echo_cyan "[+] Create MCSManager service..." - echo_cyan "[!] Try to register to the "systemctl", This comomand require \"root\" permission." - - sudo echo "[Unit] -Description=MCSManager-Daemon - -[Service] -WorkingDirectory=/opt/mcsmanager/daemon -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service - - sudo echo "[Unit] -Description=MCSManager-Web - -[Service] -WorkingDirectory=/opt/mcsmanager/web -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-web.service - - if [ -e "/etc/systemd/system/mcsm-web.service" ]; then - sudo systemctl daemon-reload - sudo systemctl enable mcsm-daemon.service --now - sudo systemctl enable mcsm-web.service --now - echo_green "Registered!" - else - printf "\n\n" - echo_red "The MCSManager was successfully installed to \"/opt/mcsmanager\"." - echo_red "But register to the \"systemctl\" failed!\nPlease use the \"root\" account to re-run the script!" - exit - fi - - sleep 2 - - printf "\n\n\n\n" - - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: " - echo_yellow "http://:23333 (Browser)" - echo_cyan_n "Daemon Address: " - echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" -} - -# Environmental inspection -if [[ "$arch" == x86_64 ]]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [[ $arch == aarch64 ]]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [[ $arch == arm ]]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [[ $arch == ppc64le ]]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [[ $arch == s390x ]]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - Red_Error "[x] Sorry, this architecture is not supported yet!" - Red_Error "[x] Please try to install manually: https://github.com/MCSManager/MCSManager#linux" - exit -fi - -# Define the variable Node installation directory -node_install_path="/opt/node-$node-linux-$arch" - -# Check network connection -echo_cyan "[-] Architecture: $arch" - -# Install related software -echo_cyan_n "[+] Installing dependent software(git,tar)... " -if [[ -x "$(command -v yum)" ]]; then - sudo yum install -y git tar >error -elif [[ -x "$(command -v apt-get)" ]]; then - sudo apt-get install -y git tar >error -elif [[ -x "$(command -v pacman)" ]]; then - sudo pacman -Syu --noconfirm git tar >error -elif [[ -x "$(command -v zypper)" ]]; then - sudo zypper --non-interactive install git tar >error -fi - -# Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then - echo_green "Success" -else - echo_red "Failed" - echo "$error" - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - exit -fi - -# Install the Node environment -Install_Node - -# Install MCSManager -Install_MCSManager - -# Create MCSManager background service -Create_Service From cc9f80d8f2d86620cf81599e118ed3dac798576b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=90=A8?= Date: Wed, 3 Apr 2024 15:37:11 +0800 Subject: [PATCH 117/463] Feat: upgrade to v10 --- README_cn.md | 35 ------- docker/build/Dockerfile-daemon | 27 ----- docker/build/Dockerfile-web | 27 ----- docker/build/build.py | 82 --------------- docker/build/entrypoint.sh | 23 ---- docker/docs/README.md | 185 --------------------------------- docker/docs/README_cn.md | 183 -------------------------------- docker/examples/cn/daemon.yaml | 16 --- docker/examples/cn/full.yaml | 30 ------ docker/examples/cn/web.yaml | 16 --- docker/examples/en/daemon.yaml | 16 --- docker/examples/en/full.yaml | 30 ------ docker/examples/en/web.yaml | 16 --- package-lock.json | 6 -- 14 files changed, 692 deletions(-) delete mode 100644 README_cn.md delete mode 100644 docker/build/Dockerfile-daemon delete mode 100644 docker/build/Dockerfile-web delete mode 100755 docker/build/build.py delete mode 100644 docker/build/entrypoint.sh delete mode 100644 docker/docs/README.md delete mode 100644 docker/docs/README_cn.md delete mode 100644 docker/examples/cn/daemon.yaml delete mode 100644 docker/examples/cn/full.yaml delete mode 100644 docker/examples/cn/web.yaml delete mode 100644 docker/examples/en/daemon.yaml delete mode 100644 docker/examples/en/full.yaml delete mode 100644 docker/examples/en/web.yaml delete mode 100644 package-lock.json diff --git a/README_cn.md b/README_cn.md deleted file mode 100644 index 824d0ca..0000000 --- a/README_cn.md +++ /dev/null @@ -1,35 +0,0 @@ -MCSManager.png - -
- -[MCSManager 9 官方网站](http://mcsmanager.com/) | [English](https://github.com/MCSManager/Script/blob/master/README.md) | [Gitee 仓库](https://gitee.com/mcsmanager/script) - -
- -## 这是什么? - -这里是 Ubuntu / Debian / CentOS 等 Linux 系系统的 MCSManager 9 安装, 卸载, 升级脚本等的集中存储库 - -官网上默认的安装脚本为 Gitee 仓库中的 `setup.sh` , 它包含多种语言支持 - -你也可以使用下列一键命令安装 MCSManager 9 - -## 安装方法 - -### 一键命令安装 - -```bash -wget https://raw.githubusercontent.com/MCSManager/Script/master/setup.sh -O setup.sh && bash setup.sh -``` - -_当然, 一般国内用户因为众所周知的原因都连不上 Github, 下方为 Gitee 国内镜像源链接_ - -```bash -wget https://gitee.com/mcsmanager/script/raw/master/setup.sh -O setup.sh && bash setup.sh -``` - -### Docker (Beta) - -请查看此[教程](https://github.com/MCSManager/Script/blob/master/docker/README_cn.md) - -
diff --git a/docker/build/Dockerfile-daemon b/docker/build/Dockerfile-daemon deleted file mode 100644 index 4361d12..0000000 --- a/docker/build/Dockerfile-daemon +++ /dev/null @@ -1,27 +0,0 @@ -FROM debian:stable-slim AS base - -RUN sed -i.bak 's/deb.debian.org/mirrors.cernet.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ - && sed -i.bak 's|security.debian.org/debian-security|mirrors.cernet.edu.cn/debian-security|g' /etc/apt/sources.list.d/debian.sources \ - && apt-get update -y \ - && apt-get install -y curl ca-certificates openssl git tar sqlite3 fontconfig tzdata iproute2 gettext-base wget \ - && apt-get clean - -RUN cd /tmp \ - && wget https://nodejs.org/dist/latest-v20.x/node-v20.11.1-linux-x64.tar.gz -O node.tar.gz \ - && wget https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz -O mcsmanager.tar.gz \ - && mkdir -p /opt/node \ - && mkdir -p /tmp/mcsmanager \ - && tar -xzf node.tar.gz -C /opt/node --strip-components=1 \ - && tar -xzf mcsmanager.tar.gz -C /tmp/mcsmanager \ - && mv -f /tmp/mcsmanager/daemon /opt/daemon \ - && rm -rf /tmp/mcsmanager \ - && rm -rf node.tar.gz \ - && rm -rf mcsmanager.tar.gz - -RUN cd /opt/daemon \ - && /opt/node/bin/node /opt/node/bin/npm install --production - -WORKDIR /opt/daemon -COPY ./entrypoint.sh / -RUN chmod +x /entrypoint.sh -CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/docker/build/Dockerfile-web b/docker/build/Dockerfile-web deleted file mode 100644 index e89fc78..0000000 --- a/docker/build/Dockerfile-web +++ /dev/null @@ -1,27 +0,0 @@ -FROM debian:stable-slim AS base - -RUN sed -i.bak 's/deb.debian.org/mirrors.cernet.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ - && sed -i.bak 's|security.debian.org/debian-security|mirrors.cernet.edu.cn/debian-security|g' /etc/apt/sources.list.d/debian.sources \ - && apt-get update -y \ - && apt-get install -y curl ca-certificates openssl git tar sqlite3 fontconfig tzdata iproute2 gettext-base wget \ - && apt-get clean - -RUN cd /tmp \ - && wget https://nodejs.org/dist/latest-v20.x/node-v20.11.1-linux-x64.tar.gz -O node.tar.gz \ - && wget https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz -O mcsmanager.tar.gz \ - && mkdir -p /opt/node \ - && mkdir -p /tmp/mcsmanager \ - && tar -xzf node.tar.gz -C /opt/node --strip-components=1 \ - && tar -xzf mcsmanager.tar.gz -C /tmp/mcsmanager \ - && mv -f /tmp/mcsmanager/web /opt/web \ - && rm -rf /tmp/mcsmanager \ - && rm -rf node.tar.gz \ - && rm -rf mcsmanager.tar.gz - -RUN cd /opt/web \ - && /opt/node/bin/node /opt/node/bin/npm install --production - -WORKDIR /opt/web -COPY ./entrypoint.sh / -RUN chmod +x /entrypoint.sh -CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/docker/build/build.py b/docker/build/build.py deleted file mode 100755 index 1e67960..0000000 --- a/docker/build/build.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python3 -import argparse -import os -import subprocess -import sys -from typing import Iterator, NamedTuple - -class Context(NamedTuple): - type: str - version: str - tag: str - - -def iterate_all() -> Iterator[Context]: - for type in ['daemon', 'web']: - for version in [9]: - tag = f'bluefunny/mcsmanager:{type}-{version}' - yield Context(type, str(version) , tag) - - -def cmd_build(args: argparse.Namespace): - for ctx in iterate_all(): - print(f'======== MCSManager | Type: {ctx.type}, Version: {ctx.version}, Tag: {ctx.tag!r} ========') - - cmd = [ - 'docker', 'build', os.getcwd(), - '-f', f'Dockerfile-{ctx.type}', - '-t', ctx.tag, - ] - - if args.http_proxy is not None: - cmd.extend([ - '--build-arg', f'http_proxy={args.http_proxy}', - '--build-arg', f'https_proxy={args.http_proxy}', - ]) - subprocess.check_call(cmd) - - if args.push: - subprocess.check_call(['docker', 'push', ctx.tag]) - - -def cmd_push(args: argparse.Namespace): - for ctx in iterate_all(): - subprocess.check_call(['docker', 'push', ctx.tag]) - - -def cmd_delete(args: argparse.Namespace): - for ctx in iterate_all(): - subprocess.check_call(['docker', 'image', 'rm', ctx.tag]) - - -def main(): - parser = argparse.ArgumentParser() - subparsers = parser.add_subparsers(title='Command', help='Available commands', dest='command', required=True) - - parser_build = subparsers.add_parser('build', help='Build all images') - parser_build.add_argument('-p', '--push', action='store_true', help='Push after build') - parser_build.add_argument('--http-proxy', help='Set the url of http proxy to be used in build') - - subparsers.add_parser('push', help='Push all images') - subparsers.add_parser('delete', help='Delete all images') - - args = parser.parse_args() - - if args.command == 'build': - cmd_build(args) - elif args.command == 'push': - cmd_push(args) - elif args.command == 'delete': - cmd_delete(args) - else: - print('Unknown command {!r}'.format(args.command)) - sys.exit(1) - - -if __name__ == '__main__': - try: - main() - except subprocess.CalledProcessError as e: - print(type(e).__name__, e.returncode, file=sys.stderr) - except KeyboardInterrupt: - pass diff --git a/docker/build/entrypoint.sh b/docker/build/entrypoint.sh deleted file mode 100644 index 916481a..0000000 --- a/docker/build/entrypoint.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -set -e - -echo "[-] Checking the operating environment..." - -if [ ! -f /opt/node/bin/node ]; then - echo "[x] The nodejs runtime environment could not be found, you may be using an incomplete version" - exit 1 -fi - -if [ -d /opt/daemon ]; then - type=daemon -elif [ -d /opt/web ]; then - type=web -else - echo "[x] The MCSManager file directory could not be found, you may be using an incomplete version" - exit 1 -fi - -echo "[-] The operating environment is normal, starting the MCSManager..." - -cd /opt/$type -eval "/opt/node/bin/node /opt/$type/app.js" \ No newline at end of file diff --git a/docker/docs/README.md b/docker/docs/README.md deleted file mode 100644 index 4bf6e47..0000000 --- a/docker/docs/README.md +++ /dev/null @@ -1,185 +0,0 @@ -# Installing MCSManager via Docker - -[English](README.md) | [简体中文](./README_cn.md) - -## Prerequisites - -You need to have the following prerequisites ready beforehand: - -- You are using a `Linux` system. -- `docker-ce` package is already installed. - -> Due to the unconventional implementation of Docker Desktop on Windows, we neither support nor recommend installing MCSManager via Docker on Windows systems. - -## Getting Started - -Firstly, please switch to the root user. - -```bash -sudo su -``` - -Then, create some basic directories that will be used later. - -```bash -mkdir -p /opt/mcsmanager # MCSManager container directory -mkdir -p /opt/mcsmanager/data # MCSManager data directory -chown -R 1000:1000 /opt/mcsmanager # Modify directory permissions -cd /opt/mcsmanager -``` - -Next, create an empty file named `docker-compose.yaml`. - -```bash -touch docker-compose.yaml -``` - -If you need to install both MCSManager Web and MCSManager Daemon simultaneously, please copy the configuration below and paste it into `docker-compose.yaml`. - -```yaml -version: "3" - -services: - web: - image: bluefunny/mcsmanager:web-9 - container_name: mcsmanager-web - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Web logs directory - - ./data/logs/web:/opt/web/logs - # MCSManager Web data directory - - ./data/data/web:/opt/web/data - # port: - # - 23333:23333 - network_mode: host - command: /entrypoint.sh - - daemon: - image: bluefunny/mcsmanager:daemon-9 - container_name: mcsmanager-daemon - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Daemon logs directory - - ./data/logs/daemon:/opt/daemon/logs - # MCSManager Daemon data directory - - ./data/data/daemon:/opt/daemon/data - # port: - # - 24444:24444 - network_mode: host -``` - -> If you are unable to copy or paste this file, you can also [click here](../examples/en/full.yaml) to get the example file. - -If you only need to install MCSManager Web, please copy the configuration below and paste it into `docker-compose.yaml`. - -```yaml -version: "3" - -services: - web: - image: bluefunny/mcsmanager:web-9 - container_name: mcsmanager-web - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Web logs directory - - ./data/logs/web:/opt/web/logs - # MCSManager Web data directory - - ./data/data/web:/opt/web/data - # port: - # - 23333:23333 - network_mode: host -``` - -> If you are unable to copy or paste this file, you can also [click here](../examples/en/web.yaml) to get the example file. - -If you want to install only MCSManager Daemon, please copy the configuration below and paste it into `docker-compose.yaml`. - -```yaml -version: "3" - -services: - daemon: - image: bluefunny/mcsmanager:daemon-9 - container_name: mcsmanager-daemon - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Daemon logs directory - - ./data/logs/daemon:/opt/daemon/logs - # MCSManager Daemon data directory - - ./data/data/daemon:/opt/daemon/data - # port: - # - 24444:24444 - network_mode: host -``` - -> If you are unable to copy or paste this file, you can also [click here](../examples/en/daemon.yaml) to get the example file. - -Once all the above operations are completed, modify the configuration file as needed, then run the following command to start MCSManager. - -```bash -docker compose -f docker-compose.yaml up -d -``` - -Now, you just need to wait for the command to complete the installation. - -If everything runs smoothly, shortly after, you can access `http://127.0.0.1:23333` to view the panel you just set up! - -> If running on a server, replace `127.0.0.1` with your public IP. - -> If you installed only the standalone MCSManager Daemon program, replace `23333` with `24444`. - -## Uninstallation - -If you no longer need MCSManager later on, you can navigate to the folder where you placed `docker-compose.yml` and then enter the following command to uninstall. - -```bash -docker compose -f docker-compose.yaml down -rm -rf data -``` - ---- - -Congratulations! You have completed all the tasks, and now you can start using MCSManager! - -However, if you find the original MCSManager Web or MCSManager Daemon images insufficient, you can also compile them yourself. - -Below is a simple compilation tutorial. - ---- - -## Self-Compilation - -> Please note that you need to install `docker-ce` and `python` packages beforehand, and you need to have some Docker usage experience. - -If you need to compile yourself, you can use the files in the `build` folder in this directory for compilation. - -- `Dockerfile-daemon` is the image construction file for MCSManager Daemon. -- `Dockerfile-web` is the image construction file for MCSManager Web. -- `entrypoint.sh` is the default entry script executed in the image, which will run when the image starts. -- `build.py` is a Python script used to build images. Use `python build.py -h` to get detailed help. - -You can use the following commands to build the images. - -```bash -python build.py build -python build.py build --push # If you need to push the images to Docker Hub, note: this requires you to pre-configure Docker Registry yourself. -``` - -If you prefer not to use the `build.py` script, you can also use the following commands to build the images. - -```bash -docker build . -f -t # For example: docker build . -f Dockerfile -t bluefunny/mcsmanager-daemon:9 --build-arg TYPE=daemon --build-arg VERSION=9 -docker push # If you need to push the images to Docker Hub, note: this requires you to pre-configure Docker Registry yourself. -``` - -After the build is complete, you just need to replace the `image` section in the configuration files mentioned above with the name of the image you built yourself. - -## Acknowledgements - -The script was adapted from the personal repository of Fallen_breath: https://github.com/Fallen-Breath/pterodactyl-eggs - -### This article was translated by ChatGPT, there may be some errors, if you find these errors, please submit an Issue to let us know \ No newline at end of file diff --git a/docker/docs/README_cn.md b/docker/docs/README_cn.md deleted file mode 100644 index e6d2a9b..0000000 --- a/docker/docs/README_cn.md +++ /dev/null @@ -1,183 +0,0 @@ -# 通过 Docker 安装 MCSManager - -[English](README.md) | [简体中文](./README_cn.md) - -## 预先准备 - -你需要提前做好以下两点准备 - -- 你使用的是 `Linux` 系统 -- 已经安装了 `docker-ce` 软件包 - -> 由于 Windows 上的 Docker Desktop 实现方式并非常规, 因此, 我们不支持也不建议您在 Windows 系统上以 Docker 的方式安装 MCSManager - -## 开始安装 - -首先, 请先切换为 root 用户 - -```bash -sudo su -``` - -然后使用以下命令创建一些待会儿会用到的基本目录 - -```bash -mkdir -p /opt/mcsmanager # MCSManager 容器文件目录 -mkdir -p /opt/mcsmanager/data # MCSManager 数据文件目录 -chown -R 1000:1000 /opt/mcsmanager # 修改目录权限 -cd /opt/mcsmanager -``` - -然后, 创建一个名为 `docker-compose.yaml` 的空文件 - -```bash -touch docker-compose.yaml -``` - -如果你需要同时安装 MCSManager Web 与 MCSManager Daemon, 请复制下面的配置文件, 并将其粘贴到 `docker-compose.yaml` 中 - -```yaml -version: "3" - -services: - web: - image: bluefunny/mcsmanager:web-9 - container_name: mcsmanager-web - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Web 日志存储目录 - - ./data/logs/web:/opt/web/logs - # MCSManager Web 数据存储目录 - - ./data/data/web:/opt/web/data - # port: - # - 23333:23333 - network_mode: host - command: /entrypoint.sh - - daemon: - image: bluefunny/mcsmanager:daemon-9 - container_name: mcsmanager-daemon - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Daemon 日志存储目录 - - ./data/logs/daemon:/opt/daemon/logs - # MCSManager Daemon 数据存储目录 - - ./data/data/daemon:/opt/daemon/data - # port: - # - 24444:24444 - network_mode: host -``` - -> 如果你无法复制或粘贴此文件, 你也可以[点击此处](../examples/cn/full.yaml)获取示例文件 - -如果你只需要安装 MCSManager Web, 请复制下面的配置文件, 并将其粘贴到 `docker-compose.yaml` 中 - -```yaml -version: "3" - -services: - web: - image: bluefunny/mcsmanager:web-9 - container_name: mcsmanager-web - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Web 日志存储目录 - - ./data/logs/web:/opt/web/logs - # MCSManager Web 数据存储目录 - - ./data/data/web:/opt/web/data - # port: - # - 23333:23333 - network_mode: host -``` - -> 如果你无法复制或粘贴此文件, 你也可以[点击此处](../examples/cn/web.yaml)获取示例文件 - -如果你要同时安装 MCSManager Daemon, 请复制下面的配置文件, 并将其粘贴到 `docker-compose.yaml` 中 - -```yaml -version: "3" - -services: - daemon: - image: bluefunny/mcsmanager:daemon-9 - container_name: mcsmanager-daemon - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Daemon 日志存储目录 - - ./data/logs/daemon:/opt/daemon/logs - # MCSManager Daemon 数据存储目录 - - ./data/data/daemon:/opt/daemon/data - # port: - # - 24444:24444 - network_mode: host -``` - -> 如果你无法复制或粘贴此文件, 你也可以[点击此处](../examples/cn/daemon.yaml)获取示例文件 - -当上述操作全部完成后, 请按需修改配置文件, 之后运行以下命令启动 MCSManager - -```bash -docker compose -f docker-compose.yaml up -d -``` - -此时, 你只需要等待命令运行完毕即可完成安装 - -如果一切运行正常, 那么不久后你就可以访问 `http://127.0.0.1:23333` 来查看你刚刚搭建好的面板了 ! - -> 如果是在服务器上运行, 则请将 `127.0.0.1` 替换为你的公网 IP - -> 如果你安装的是单独的的 MCSManager Daemon 程序, 则请将 `23333` 替换为 `24444` - -## 卸载 - -如果后期你不需要 MCSManager 了, 你可以进入你用于放置 `docker-compose.yml` 的文件夹, 然后输入以下命令以卸载 - -```bash -docker compose -f docker-compose.yaml down -rm -rf data -``` - ---- - -至此, 你已完成了全部的任务, 现在你可以开始使用 MCSManager 了 ! - -不过如果你认为原本的 MCSManager Web 或 MCSManager Daemon 的镜像不够好, 你也可以自行编译 - -下面为一个简单的编译教程 - ---- - -## 自行编译 - -> 请注意, 你需要提前安装好 `docker-ce` 与 `python` 软件包, 并且你需要有一定的 Docker 使用经验 - -如果你需要自行编译, 你可以使用此目录中的 `build` 文件夹中的文件进行编译 - -- `Dockerfile-daemon` 为 MCSManager Daemon 的镜像构建文件 -- `Dockerfile-web` 为 MCSManager Web 的镜像构建文件 -- `entrypoint.sh` 为镜像默认执行的入口脚本, 在镜像启动时会运行此脚本 -- `build.py` 为用于构建镜像的 Python 脚本, 使用 `python build.py -h` 以获取详细帮助 - -你可以使用以下命令构建镜像 - -```bash -python build.py build -python build.py build --push # 如果你需要将镜像推送到 Docker Hub, 注意: 这需要你自己预先配置好 Docker Registry -``` - -如果你不想使用 `build.py` 脚本, 你也可以使用以下命令构建镜像 - -```bash -docker build . -f <构建文件> -t <标签> # 例如: docker build . -f Dockerfile -t bluefunny/mcsmanager-daemon:9 --build-arg TYPE=daemon --build-arg VERSION=9 -docker push <标签> # 如果你需要将镜像推送到 Docker Hub, 注意: 这需要你自己预先配置好 Docker Registry -``` - -在构建完成后, 你只需要将上文中配置文件中的 `image` 部分替换为你自行构建的镜像名称即可 - -## 致谢 - -构建脚本来源于 Fallen_breath 的个人仓库: https://github.com/Fallen-Breath/pterodactyl-eggs \ No newline at end of file diff --git a/docker/examples/cn/daemon.yaml b/docker/examples/cn/daemon.yaml deleted file mode 100644 index 408edc9..0000000 --- a/docker/examples/cn/daemon.yaml +++ /dev/null @@ -1,16 +0,0 @@ -version: "3" - -services: - daemon: - image: bluefunny/mcsmanager:daemon-9 - container_name: mcsmanager-daemon - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Daemon 日志存储目录 - - ./data/logs/daemon:/opt/daemon/logs - # MCSManager Daemon 数据存储目录 - - ./data/data/daemon:/opt/daemon/data - # port: - # - 24444:24444 - network_mode: host \ No newline at end of file diff --git a/docker/examples/cn/full.yaml b/docker/examples/cn/full.yaml deleted file mode 100644 index 705be75..0000000 --- a/docker/examples/cn/full.yaml +++ /dev/null @@ -1,30 +0,0 @@ -version: "3" - -services: - web: - image: bluefunny/mcsmanager:web-9 - container_name: mcsmanager-web - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Web 日志存储目录 - - ./data/logs/web:/opt/web/logs - # MCSManager Web 数据存储目录 - - ./data/data/web:/opt/web/data - # port: - # - 23333:23333 - network_mode: host - - daemon: - image: bluefunny/mcsmanager:daemon-9 - container_name: mcsmanager-daemon - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Daemon 日志存储目录 - - ./data/logs/daemon:/opt/daemon/logs - # MCSManager Daemon 数据存储目录 - - ./data/data/daemon:/opt/daemon/data - # port: - # - 24444:24444 - network_mode: host \ No newline at end of file diff --git a/docker/examples/cn/web.yaml b/docker/examples/cn/web.yaml deleted file mode 100644 index 62eeffe..0000000 --- a/docker/examples/cn/web.yaml +++ /dev/null @@ -1,16 +0,0 @@ -version: "3" - -services: - web: - image: bluefunny/mcsmanager:web-9 - container_name: mcsmanager-web - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Web 日志存储目录 - - ./data/logs/web:/opt/web/logs - # MCSManager Web 数据存储目录 - - ./data/data/web:/opt/web/data - # port: - # - 23333:23333 - network_mode: host \ No newline at end of file diff --git a/docker/examples/en/daemon.yaml b/docker/examples/en/daemon.yaml deleted file mode 100644 index 326e043..0000000 --- a/docker/examples/en/daemon.yaml +++ /dev/null @@ -1,16 +0,0 @@ -version: "3" - -services: - daemon: - image: bluefunny/mcsmanager:daemon-9 - container_name: mcsmanager-daemon - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Daemon log storage directory - - ./data/logs/daemon:/opt/daemon/logs - # MCSManager Daemon data storage directory - - ./data/data/daemon:/opt/daemon/data - # port: - # - 24444:24444 - network_mode: host \ No newline at end of file diff --git a/docker/examples/en/full.yaml b/docker/examples/en/full.yaml deleted file mode 100644 index 1c535cd..0000000 --- a/docker/examples/en/full.yaml +++ /dev/null @@ -1,30 +0,0 @@ -version: "3" - -services: - web: - image: bluefunny/mcsmanager:web-9 - container_name: mcsmanager-web - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Web log storage directory - - ./data/logs/web:/opt/web/logs - # MCSManager Web data storage directory - - ./data/data/web:/opt/web/data - # port: - # - 23333:23333 - network_mode: host - - daemon: - image: bluefunny/mcsmanager:daemon-9 - container_name: mcsmanager-daemon - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Daemon log storage directory - - ./data/logs/daemon:/opt/daemon/logs - # MCSManager Daemon data storage directory - - ./data/data/daemon:/opt/daemon/data - # port: - # - 24444:24444 - network_mode: host \ No newline at end of file diff --git a/docker/examples/en/web.yaml b/docker/examples/en/web.yaml deleted file mode 100644 index 7640f91..0000000 --- a/docker/examples/en/web.yaml +++ /dev/null @@ -1,16 +0,0 @@ -version: "3" - -services: - web: - image: bluefunny/mcsmanager:web-9 - container_name: mcsmanager-web - environment: - - TZ=Asia/Shanghai - volumes: - # MCSManager Web log storage directory - - ./data/logs/web:/opt/web/logs - # MCSManager Web data storage directory - - ./data/data/web:/opt/web/data - # port: - # - 23333:23333 - network_mode: host \ No newline at end of file diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 6f84430..0000000 --- a/package-lock.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Script", - "lockfileVersion": 2, - "requires": true, - "packages": {} -} From ea9fea4731316d10b1d18756c9caa4004c0f677f Mon Sep 17 00:00:00 2001 From: unitwk Date: Sat, 13 Apr 2024 12:16:16 +0800 Subject: [PATCH 118/463] Feat: add build script --- index.html | 12 ++++++++++++ package-lock.json | 6 ++++++ package.json | 8 ++++++++ 3 files changed, 26 insertions(+) create mode 100644 index.html create mode 100644 package-lock.json create mode 100644 package.json diff --git a/index.html b/index.html new file mode 100644 index 0000000..320d457 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 404 Not Found + + + 404 Not Found + + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6946f74 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "MCSManager-Script", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..d7e12cf --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "name": "mcsmanager-script", + "version": "1.0.0", + "scripts": { + "build": "echo 1" + }, + "license": "MIT" +} From d4b486260720c139c15fcf8cb6bf89981d27d4ab Mon Sep 17 00:00:00 2001 From: swwind Date: Fri, 26 Apr 2024 13:30:00 +0800 Subject: [PATCH 119/463] exit when not sudo --- setup.sh | 129 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 65 insertions(+), 64 deletions(-) diff --git a/setup.sh b/setup.sh index 4e5220a..d9cdb4e 100644 --- a/setup.sh +++ b/setup.sh @@ -2,12 +2,16 @@ mcsmanager_install_path="/opt/mcsmanager" mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +mcsmanager_user="mcsm" package_name="MCSManager-v10-linux.tar.gz" node="v16.20.2" - -error="" arch=$(uname -m) +if [ "$(id -u)" -ne 0]; then + echo "This script must be run as root. Please use \"sudo bash\" instead." + exit 1 +fi + printf "\033c" echo_cyan() { @@ -45,17 +49,17 @@ Red_Error() { Install_Node() { echo_cyan_n "[+] Install Node.JS environment...\n" - sudo rm -irf "$node_install_path" + rm -irf "$node_install_path" - cd /opt || exit + cd /opt || Red_Error "[x] Failed to enter /opt" - rm -rf node-"$node"-linux-"$arch".tar.gz + rm -rf "node-$node-linux-$arch.tar.gz" - wget https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz + wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" - tar -zxf node-"$node"-linux-"$arch".tar.gz + tar -zxf "node-$node-linux-$arch.tar.gz" - rm -rf node-"$node"-linux-"$arch".tar.gz + rm -rf "node-$node-linux-$arch.tar.gz" if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then echo_green "Success" @@ -67,7 +71,7 @@ Install_Node() { echo echo_yellow "=============== Node.JS Version ===============" echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" echo_yellow "=============== Node.JS Version ===============" echo @@ -78,35 +82,34 @@ Install_MCSManager() { echo_cyan "[+] Install MCSManager..." # stop service - sudo systemctl stop mcsm-{web,daemon} - sudo systemctl disable mcsm-{web,daemon} + systemctl stop mcsm-{web,daemon} + systemctl disable mcsm-{web,daemon} # delete service - sudo rm -rf /etc/systemd/system/mcsm-daemon.service - sudo rm -rf /etc/systemd/system/mcsm-web.service - sudo systemctl daemon-reload + rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + systemctl daemon-reload - mkdir -p ${mcsmanager_install_path} || exit + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" # cd /opt/mcsmanager - cd ${mcsmanager_install_path} || exit + cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" # donwload MCSManager release - wget ${mcsmanager_donwload_addr} - tar -zxf ${package_name} -o || exit + wget "${mcsmanager_donwload_addr}" || Red_Error "[x] Failed to download MCSManager" + tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" # echo "[→] cd daemon" - cd daemon || exit + cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log # echo "[←] cd .." - cd ../web || exit + cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log echo echo_yellow "=============== MCSManager ===============" @@ -116,74 +119,75 @@ Install_MCSManager() { echo echo_green "[+] MCSManager installation success!" - sudo chmod -R 755 /opt/mcsmanager/ + chmod -R 755 "$mcsmanager_install_path" sleep 3 } Create_Service() { echo_cyan "[+] Create MCSManager service..." - echo_cyan "[!] Try to register to the "systemctl", This comomand require \"root\" permission." - sudo echo "[Unit] + if id "$mcsmanager_user" &>/dev/null; then + userdel "$mcsmanager_user" + fi + + useradd -r -M -s "$(which nologin)" "$mcsmanager_user" + chown $mcsmanager_user:$mcsmanager_user -R "$mcsmanager_install_path" + + echo "[Unit] Description=MCSManager-Daemon [Service] -WorkingDirectory=/opt/mcsmanager/daemon +User=${mcsmanager_user} +WorkingDirectory=${mcsmanager_install_path}/daemon ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service +" > /etc/systemd/system/mcsm-daemon.service - sudo echo "[Unit] + echo "[Unit] Description=MCSManager-Web [Service] -WorkingDirectory=/opt/mcsmanager/web +User=${mcsmanager_user} +WorkingDirectory=${mcsmanager_install_path}/web ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-web.service +" > /etc/systemd/system/mcsm-web.service - if [ -e "/etc/systemd/system/mcsm-web.service" ]; then - sudo systemctl daemon-reload - sudo systemctl enable mcsm-daemon.service --now - sudo systemctl enable mcsm-web.service --now - echo_green "Registered!" - else - printf "\n\n" - echo_red "The MCSManager was successfully installed to \"/opt/mcsmanager\"." - echo_red "But register to the \"systemctl\" failed!\nPlease use the \"root\" account to re-run the script!" - exit - fi + systemctl daemon-reload + systemctl enable mcsm-daemon.service --now + systemctl enable mcsm-web.service --now + echo_green "Registered!" sleep 2 printf "\n\n\n\n" echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_green "Installation is complete! Welcome to the MCSManager!!!" echo_yellow " " echo_cyan_n "HTTP Web Service: " echo_yellow "http://:23333 (Browser)" echo_cyan_n "Daemon Address: " echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" + echo_green "Official Document: https://docs.mcsmanager.com/" echo_yellow "==================================================================" } @@ -204,9 +208,7 @@ elif [[ $arch == s390x ]]; then arch=s390x #echo "[-] IBM LinuxONE architecture detected" else - Red_Error "[x] Sorry, this architecture is not supported yet!" - Red_Error "[x] Please try to install manually: https://github.com/MCSManager/MCSManager#linux" - exit + Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" fi # Define the variable Node installation directory @@ -216,25 +218,24 @@ node_install_path="/opt/node-$node-linux-$arch" echo_cyan "[-] Architecture: $arch" # Install related software -echo_cyan_n "[+] Installing dependent software(git,tar)... " +echo_cyan_n "[+] Installing dependent software (git, tar)... " if [[ -x "$(command -v yum)" ]]; then - sudo yum install -y git tar >error + yum install -y git tar elif [[ -x "$(command -v apt-get)" ]]; then - sudo apt-get install -y git tar >error + apt-get install -y git tar elif [[ -x "$(command -v pacman)" ]]; then - sudo pacman -Syu --noconfirm git tar >error + pacman -S --noconfirm git tar elif [[ -x "$(command -v zypper)" ]]; then - sudo zypper --non-interactive install git tar >error + zypper --non-interactive install git tar +else + echo_red "[x] Don't know your package manager! You may need to install git and tar manually!" fi # Determine whether the relevant software is installed successfully if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then echo_green "Success" else - echo_red "Failed" - echo "$error" - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - exit + Red_Error "[x] Failed to find git and tar, please install them manually!" fi # Install the Node environment From 387790334b74a5588d1cf07e751952f238a334e6 Mon Sep 17 00:00:00 2001 From: swwind Date: Fri, 26 Apr 2024 13:36:15 +0800 Subject: [PATCH 120/463] remove useless code --- setup.sh | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/setup.sh b/setup.sh index d9cdb4e..2cb01ca 100644 --- a/setup.sh +++ b/setup.sh @@ -55,16 +55,15 @@ Install_Node() { rm -rf "node-$node-linux-$arch.tar.gz" - wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" + wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - tar -zxf "node-$node-linux-$arch.tar.gz" + tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" rm -rf "node-$node-linux-$arch.tar.gz" if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then echo_green "Success" else - echo_red "Failed" Red_Error "[x] Node installation failed!" fi @@ -82,8 +81,7 @@ Install_MCSManager() { echo_cyan "[+] Install MCSManager..." # stop service - systemctl stop mcsm-{web,daemon} - systemctl disable mcsm-{web,daemon} + systemctl disable --now mcsm-{web,daemon} # delete service rm -rf /etc/systemd/system/mcsm-{daemon,web}.service @@ -103,18 +101,18 @@ Install_MCSManager() { cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" echo_cyan "[+] Install MCSManager-Daemon dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null # echo "[←] cd .." cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" echo_cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null echo echo_yellow "=============== MCSManager ===============" - echo_green " Daemon: ${mcsmanager_install_path}/daemon" - echo_green " Web: ${mcsmanager_install_path}/web" + echo_green "Daemon: ${mcsmanager_install_path}/daemon" + echo_green "Web: ${mcsmanager_install_path}/web" echo_yellow "=============== MCSManager ===============" echo echo_green "[+] MCSManager installation success!" @@ -165,8 +163,7 @@ WantedBy=multi-user.target " > /etc/systemd/system/mcsm-web.service systemctl daemon-reload - systemctl enable mcsm-daemon.service --now - systemctl enable mcsm-web.service --now + systemctl enable --now mcsm-{daemon,web}.service echo_green "Registered!" sleep 2 @@ -228,7 +225,7 @@ elif [[ -x "$(command -v pacman)" ]]; then elif [[ -x "$(command -v zypper)" ]]; then zypper --non-interactive install git tar else - echo_red "[x] Don't know your package manager! You may need to install git and tar manually!" + echo_red "[!] Cannot find your package manager! You may need to install git and tar manually!" fi # Determine whether the relevant software is installed successfully From 035075aad1e4238f04d2dd07f05e28ae81c25a48 Mon Sep 17 00:00:00 2001 From: swwind Date: Fri, 26 Apr 2024 13:50:30 +0800 Subject: [PATCH 121/463] Update setup.sh --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 2cb01ca..8b1f2b5 100644 --- a/setup.sh +++ b/setup.sh @@ -101,13 +101,13 @@ Install_MCSManager() { cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" echo_cyan "[+] Install MCSManager-Daemon dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" # echo "[←] cd .." cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" echo_cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" echo echo_yellow "=============== MCSManager ===============" From 7ab22079afd4a291961cf38d49cbf043f9a9d511 Mon Sep 17 00:00:00 2001 From: swwind Date: Fri, 26 Apr 2024 14:13:21 +0800 Subject: [PATCH 122/463] add wget to deps list --- setup.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/setup.sh b/setup.sh index 8b1f2b5..343a975 100644 --- a/setup.sh +++ b/setup.sh @@ -215,24 +215,24 @@ node_install_path="/opt/node-$node-linux-$arch" echo_cyan "[-] Architecture: $arch" # Install related software -echo_cyan_n "[+] Installing dependent software (git, tar)... " +echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " if [[ -x "$(command -v yum)" ]]; then - yum install -y git tar + yum install -y git tar wget elif [[ -x "$(command -v apt-get)" ]]; then - apt-get install -y git tar + apt-get install -y git tar wget elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm git tar + pacman -S --noconfirm git tar wget elif [[ -x "$(command -v zypper)" ]]; then - zypper --non-interactive install git tar + zypper --non-interactive install git tar wget else - echo_red "[!] Cannot find your package manager! You may need to install git and tar manually!" + echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" fi # Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then +if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then echo_green "Success" else - Red_Error "[x] Failed to find git and tar, please install them manually!" + Red_Error "[x] Failed to find git, tar and wget, please install them manually!" fi # Install the Node environment From 4863cce4ab8eaa95f92c092529256a6a3f9542ea Mon Sep 17 00:00:00 2001 From: swwind Date: Fri, 26 Apr 2024 14:21:13 +0800 Subject: [PATCH 123/463] fix: use command -v instead of which --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 343a975..117e338 100644 --- a/setup.sh +++ b/setup.sh @@ -129,7 +129,7 @@ Create_Service() { userdel "$mcsmanager_user" fi - useradd -r -M -s "$(which nologin)" "$mcsmanager_user" + useradd -r -M -s "$(command -v nologin)" "$mcsmanager_user" chown $mcsmanager_user:$mcsmanager_user -R "$mcsmanager_install_path" echo "[Unit] From b24df0267e1c75bbe00716319f0b46ee4f7fc758 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Fri, 26 Apr 2024 14:34:34 +0800 Subject: [PATCH 124/463] Sync: setup-cn.sh from setup.sh --- setup.sh | 26 +++++----- setup_cn.sh | 143 +++++++++++++++++++++++++--------------------------- 2 files changed, 83 insertions(+), 86 deletions(-) diff --git a/setup.sh b/setup.sh index 8b1f2b5..23dd32e 100644 --- a/setup.sh +++ b/setup.sh @@ -4,7 +4,7 @@ mcsmanager_install_path="/opt/mcsmanager" mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" mcsmanager_user="mcsm" package_name="MCSManager-v10-linux.tar.gz" -node="v16.20.2" +node="v20.12.2" arch=$(uname -m) if [ "$(id -u)" -ne 0]; then @@ -111,8 +111,8 @@ Install_MCSManager() { echo echo_yellow "=============== MCSManager ===============" - echo_green "Daemon: ${mcsmanager_install_path}/daemon" - echo_green "Web: ${mcsmanager_install_path}/web" + echo_green "Daemon: ${mcsmanager_install_path}/daemon" + echo_green "Web: ${mcsmanager_install_path}/web" echo_yellow "=============== MCSManager ===============" echo echo_green "[+] MCSManager installation success!" @@ -128,7 +128,7 @@ Create_Service() { if id "$mcsmanager_user" &>/dev/null; then userdel "$mcsmanager_user" fi - + useradd -r -M -s "$(which nologin)" "$mcsmanager_user" chown $mcsmanager_user:$mcsmanager_user -R "$mcsmanager_install_path" @@ -145,7 +145,7 @@ Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-daemon.service +" >/etc/systemd/system/mcsm-daemon.service echo "[Unit] Description=MCSManager-Web @@ -160,7 +160,7 @@ Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target -" > /etc/systemd/system/mcsm-web.service +" >/etc/systemd/system/mcsm-web.service systemctl daemon-reload systemctl enable --now mcsm-{daemon,web}.service @@ -171,20 +171,20 @@ WantedBy=multi-user.target printf "\n\n\n\n" echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_green "Installation is complete! Welcome to the MCSManager!!!" echo_yellow " " echo_cyan_n "HTTP Web Service: " echo_yellow "http://:23333 (Browser)" echo_cyan_n "Daemon Address: " echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" + echo_green "Official Document: https://docs.mcsmanager.com/" echo_yellow "==================================================================" } diff --git a/setup_cn.sh b/setup_cn.sh index 613fa13..97c116d 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -2,12 +2,18 @@ mcsmanager_install_path="/opt/mcsmanager" mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +mcsmanager_user="mcsm" package_name="MCSManager-v10-linux.tar.gz" node="v16.20.2" error="" arch=$(uname -m) +if [ "$(id -u)" -ne 0]; then + echo "This script must be run as root. Please use \"sudo bash\" instead." + exit 1 +fi + printf "\033c" echo_cyan() { @@ -32,9 +38,6 @@ echo_yellow() { echo_cyan "+---------------------------------------------------------------------- | MCSManager 安装脚本 +---------------------------------------------------------------------- - -MCSManager 安装脚本不会破坏您系统上原有的任何服务以及环境变量,安装脚本所有的一切均为无污染的安全行为! -我们只会在 /opt 目录下创建两个文件夹,一个用于存放 NodeJS 运行时,一个用于存放 MCSManager 代码文件,并且尝试添加 MCSM 到系统服务! " Red_Error() { @@ -45,31 +48,30 @@ Red_Error() { } Install_Node() { - echo_cyan_n "[+] 正在安装 NodeJS 运行时环境...\n" + echo_cyan_n "[+] Install Node.JS environment...\n" - sudo rm -irf "$node_install_path" + rm -irf "$node_install_path" - cd /opt || exit + cd /opt || Red_Error "[x] Failed to enter /opt" - rm -rf node-"$node"-linux-"$arch".tar.gz + rm -rf "node-$node-linux-$arch.tar.gz" - wget https://nodejs.org/dist/"$node"/node-"$node"-linux-"$arch".tar.gz + wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - tar -zxf node-"$node"-linux-"$arch".tar.gz + tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" - rm -rf node-"$node"-linux-"$arch".tar.gz + rm -rf "node-$node-linux-$arch.tar.gz" if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then echo_green "Success" else - echo_red "Failed" Red_Error "[x] Node installation failed!" fi echo echo_yellow "=============== Node.JS Version ===============" echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(/usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" echo_yellow "=============== Node.JS Version ===============" echo @@ -77,115 +79,113 @@ Install_Node() { } Install_MCSManager() { - echo_cyan "[+] 正在安装面板..." + echo_cyan "[+] Install MCSManager..." # stop service - sudo systemctl stop mcsm-{web,daemon} - sudo systemctl disable mcsm-{web,daemon} + systemctl disable --now mcsm-{web,daemon} # delete service - sudo rm -rf /etc/systemd/system/mcsm-daemon.service - sudo rm -rf /etc/systemd/system/mcsm-web.service - sudo systemctl daemon-reload + rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + systemctl daemon-reload - mkdir -p ${mcsmanager_install_path} || exit + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" # cd /opt/mcsmanager - cd ${mcsmanager_install_path} || exit + cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" # donwload MCSManager release - wget ${mcsmanager_donwload_addr} - tar -zxf ${package_name} -o || exit + wget "${mcsmanager_donwload_addr}" || Red_Error "[x] Failed to download MCSManager" + tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" # echo "[→] cd daemon" - cd daemon || exit + cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" echo_cyan "[+] Install MCSManager-Daemon dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" # echo "[←] cd .." - cd ../web || exit + cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" echo_cyan "[+] Install MCSManager-Web dependencies..." - /usr/bin/env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit >npm_install_log + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" echo echo_yellow "=============== MCSManager ===============" - echo_green " Daemon: ${mcsmanager_install_path}/daemon" - echo_green " Web: ${mcsmanager_install_path}/web" + echo_green "Daemon: ${mcsmanager_install_path}/daemon" + echo_green "Web: ${mcsmanager_install_path}/web" echo_yellow "=============== MCSManager ===============" echo echo_green "[+] MCSManager installation success!" - sudo chmod -R 755 /opt/mcsmanager/ + chmod -R 755 "$mcsmanager_install_path" sleep 3 } Create_Service() { - echo_cyan "[+] 注册系统服务中..." - echo_cyan "[!] Try to register to the "systemctl", This comomand require \"root\" permission." + echo_cyan "[+] Create MCSManager service..." + + if id "$mcsmanager_user" &>/dev/null; then + userdel "$mcsmanager_user" + fi + + useradd -r -M -s "$(which nologin)" "$mcsmanager_user" + chown $mcsmanager_user:$mcsmanager_user -R "$mcsmanager_install_path" - sudo echo "[Unit] + echo "[Unit] Description=MCSManager-Daemon [Service] -WorkingDirectory=/opt/mcsmanager/daemon +User=${mcsmanager_user} +WorkingDirectory=${mcsmanager_install_path}/daemon ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target " >/etc/systemd/system/mcsm-daemon.service - sudo echo "[Unit] + echo "[Unit] Description=MCSManager-Web [Service] -WorkingDirectory=/opt/mcsmanager/web +User=${mcsmanager_user} +WorkingDirectory=${mcsmanager_install_path}/web ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT $MAINPID -ExecStop=/bin/kill -s QUIT $MAINPID +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target " >/etc/systemd/system/mcsm-web.service - if [ -e "/etc/systemd/system/mcsm-web.service" ]; then - sudo systemctl daemon-reload - sudo systemctl enable mcsm-daemon.service --now - sudo systemctl enable mcsm-web.service --now - echo_green "Registered!" - else - printf "\n\n" - echo_red "面板已成功安装到目录: \"/opt/mcsmanager\"." - echo_red "但是由于权限不足,无法注册到系统服务中,你可以手动启动面板(参考 Github Readme.md)或重新使用 root 权限安装!" - exit - fi + systemctl daemon-reload + systemctl enable --now mcsm-{daemon,web}.service + echo_green "Registered!" sleep 2 printf "\n\n\n\n" echo_yellow "==================================================================" - echo_green "MCSManager 面板已安装完成!接下来您只需在浏览器访问即可愉快的使用它!" + echo_green "Installation is complete! Welcome to the MCSManager!!!" echo_yellow " " - echo_cyan_n "请使用浏览器访问此地址: " - echo_yellow "http://<公网IP>:23333" - echo_cyan_n "守护进程地址(集群用): " - echo_yellow "ws://<公网IP>:24444" - echo_red "注意:您必须开放 23333 和 24444 两个端口才能保证服务正常访问!" + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" + echo_cyan_n "Daemon Address: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." echo_yellow " " - echo_cyan "面板常用命令:" - echo_cyan "systemctl start mcsm-{daemon,web}.service # 开启面板" - echo_cyan "systemctl stop mcsm-{daemon,web}.service # 关闭面板" - echo_cyan "systemctl restart mcsm-{daemon,web}.service # 重启面板" + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" echo_yellow " " - echo_green "官方文档: https://docs.mcsmanager.com/" + echo_green "Official Document: https://docs.mcsmanager.com/" echo_yellow "==================================================================" } @@ -206,9 +206,7 @@ elif [[ $arch == s390x ]]; then arch=s390x #echo "[-] IBM LinuxONE architecture detected" else - Red_Error "[x] Sorry, this architecture is not supported yet!" - Red_Error "[x] Please try to install manually: https://github.com/MCSManager/MCSManager#linux" - exit + Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" fi # Define the variable Node installation directory @@ -218,25 +216,24 @@ node_install_path="/opt/node-$node-linux-$arch" echo_cyan "[-] Architecture: $arch" # Install related software -echo_cyan_n "[+] Installing dependent software(git,tar)... " +echo_cyan_n "[+] Installing dependent software (git, tar)... " if [[ -x "$(command -v yum)" ]]; then - sudo yum install -y git tar >error + yum install -y git tar elif [[ -x "$(command -v apt-get)" ]]; then - sudo apt-get install -y git tar >error + apt-get install -y git tar elif [[ -x "$(command -v pacman)" ]]; then - sudo pacman -Syu --noconfirm git tar >error + pacman -S --noconfirm git tar elif [[ -x "$(command -v zypper)" ]]; then - sudo zypper --non-interactive install git tar >error + zypper --non-interactive install git tar +else + echo_red "[!] Cannot find your package manager! You may need to install git and tar manually!" fi # Determine whether the relevant software is installed successfully if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then echo_green "Success" else - echo_red "Failed" - echo "$error" - Red_Error "[x] Related software installation failed, please install git and tar packages manually!" - exit + Red_Error "[x] Failed to find git and tar, please install them manually!" fi # Install the Node environment From fbd7d86d9cdf165e0895af83a5fd99e1b613f089 Mon Sep 17 00:00:00 2001 From: swwind Date: Fri, 26 Apr 2024 14:39:46 +0800 Subject: [PATCH 125/463] fix: change home directory to install path --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 117e338..b8486ee 100644 --- a/setup.sh +++ b/setup.sh @@ -129,7 +129,7 @@ Create_Service() { userdel "$mcsmanager_user" fi - useradd -r -M -s "$(command -v nologin)" "$mcsmanager_user" + useradd -r -M -s "$(command -v nologin)" -d "$mcsmanager_install_path" "$mcsmanager_user" chown $mcsmanager_user:$mcsmanager_user -R "$mcsmanager_install_path" echo "[Unit] From f1f1392a7d9b3157b20b1bb0be2dc7f372d98443 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Fri, 26 Apr 2024 15:02:47 +0800 Subject: [PATCH 126/463] Sync: setup.sh --- setup_cn.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index 97c116d..1d6242c 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -5,8 +5,6 @@ mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManag mcsmanager_user="mcsm" package_name="MCSManager-v10-linux.tar.gz" node="v16.20.2" - -error="" arch=$(uname -m) if [ "$(id -u)" -ne 0]; then @@ -35,6 +33,7 @@ echo_yellow() { printf '\033[1;33m%b\033[0m\n' "$@" } +# script info echo_cyan "+---------------------------------------------------------------------- | MCSManager 安装脚本 +---------------------------------------------------------------------- @@ -130,7 +129,8 @@ Create_Service() { userdel "$mcsmanager_user" fi - useradd -r -M -s "$(which nologin)" "$mcsmanager_user" + useradd -r -M -s "$(command -v nologin)" -d "$mcsmanager_install_path" "$mcsmanager_user" + chown $mcsmanager_user:$mcsmanager_user -R "$mcsmanager_install_path" echo "[Unit] @@ -216,24 +216,24 @@ node_install_path="/opt/node-$node-linux-$arch" echo_cyan "[-] Architecture: $arch" # Install related software -echo_cyan_n "[+] Installing dependent software (git, tar)... " +echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " if [[ -x "$(command -v yum)" ]]; then - yum install -y git tar + yum install -y git tar wget elif [[ -x "$(command -v apt-get)" ]]; then - apt-get install -y git tar + apt-get install -y git tar wget elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm git tar + pacman -S --noconfirm git tar wget elif [[ -x "$(command -v zypper)" ]]; then - zypper --non-interactive install git tar + zypper --non-interactive install git tar wget else - echo_red "[!] Cannot find your package manager! You may need to install git and tar manually!" + echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" fi # Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" ]]; then +if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then echo_green "Success" else - Red_Error "[x] Failed to find git and tar, please install them manually!" + Red_Error "[x] Failed to find git, tar and wget, please install them manually!" fi # Install the Node environment From 9f63b3a9c01431119722a374a1791b9e851d9195 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Fri, 26 Apr 2024 15:46:43 +0800 Subject: [PATCH 127/463] Fix: Docker group --- setup.sh | 4 +++- setup_cn.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 0e14e79..852d74a 100644 --- a/setup.sh +++ b/setup.sh @@ -130,9 +130,11 @@ Create_Service() { fi useradd -r -M -s "$(command -v nologin)" -d "$mcsmanager_install_path" "$mcsmanager_user" - chown $mcsmanager_user:$mcsmanager_user -R "$mcsmanager_install_path" + groupadd docker + usermod -aG docker mcsm + echo "[Unit] Description=MCSManager-Daemon diff --git a/setup_cn.sh b/setup_cn.sh index 1d6242c..f28c8f9 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -130,9 +130,11 @@ Create_Service() { fi useradd -r -M -s "$(command -v nologin)" -d "$mcsmanager_install_path" "$mcsmanager_user" - chown $mcsmanager_user:$mcsmanager_user -R "$mcsmanager_install_path" + groupadd docker + usermod -aG docker mcsm + echo "[Unit] Description=MCSManager-Daemon From ba03e7c46938132e0bd66600c51c9fd1a92dc7da Mon Sep 17 00:00:00 2001 From: Unitwk Date: Fri, 26 Apr 2024 16:07:33 +0800 Subject: [PATCH 128/463] Feat: del mcsm user --- setup.sh | 227 +++++++++++++++++++++++++--------------------------- setup_cn.sh | 13 --- 2 files changed, 107 insertions(+), 133 deletions(-) diff --git a/setup.sh b/setup.sh index 852d74a..0f6eeff 100644 --- a/setup.sh +++ b/setup.sh @@ -2,35 +2,34 @@ mcsmanager_install_path="/opt/mcsmanager" mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" -mcsmanager_user="mcsm" package_name="MCSManager-v10-linux.tar.gz" node="v20.12.2" arch=$(uname -m) if [ "$(id -u)" -ne 0]; then - echo "This script must be run as root. Please use \"sudo bash\" instead." - exit 1 + echo "This script must be run as root. Please use \"sudo bash\" instead." + exit 1 fi printf "\033c" echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" + printf '\033[1;36m%b\033[0m\n' "$@" } echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" + printf '\033[1;31m%b\033[0m\n' "$@" } echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" + printf '\033[1;32m%b\033[0m\n' "$@" } echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" + printf '\033[1;36m%b\033[0m' "$@" } echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" + printf '\033[1;33m%b\033[0m\n' "$@" } # script info @@ -40,106 +39,95 @@ echo_cyan "+-------------------------------------------------------------------- " Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 } Install_Node() { - echo_cyan_n "[+] Install Node.JS environment...\n" + echo_cyan_n "[+] Install Node.JS environment...\n" - rm -irf "$node_install_path" + rm -irf "$node_install_path" - cd /opt || Red_Error "[x] Failed to enter /opt" + cd /opt || Red_Error "[x] Failed to enter /opt" - rm -rf "node-$node-linux-$arch.tar.gz" + rm -rf "node-$node-linux-$arch.tar.gz" - wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" + tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" - rm -rf "node-$node-linux-$arch.tar.gz" + rm -rf "node-$node-linux-$arch.tar.gz" - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Success" - else - Red_Error "[x] Node installation failed!" - fi - - echo - echo_yellow "=============== Node.JS Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" - echo - - sleep 3 + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Success" + else + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node.JS Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node.JS Version ===============" + echo + + sleep 3 } Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." + echo_cyan "[+] Install MCSManager..." - # stop service - systemctl disable --now mcsm-{web,daemon} + # stop service + systemctl disable --now mcsm-{web,daemon} - # delete service - rm -rf /etc/systemd/system/mcsm-{daemon,web}.service - systemctl daemon-reload + # delete service + rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + systemctl daemon-reload - mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" - # cd /opt/mcsmanager - cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" + # cd /opt/mcsmanager + cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" - # donwload MCSManager release - wget "${mcsmanager_donwload_addr}" || Red_Error "[x] Failed to download MCSManager" - tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" - rm -rf "${mcsmanager_install_path}/${package_name}" + # donwload MCSManager release + wget "${mcsmanager_donwload_addr}" || Red_Error "[x] Failed to download MCSManager" + tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" + rm -rf "${mcsmanager_install_path}/${package_name}" - # echo "[→] cd daemon" - cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" + # echo "[→] cd daemon" + cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" - # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" + # echo "[←] cd .." + cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - echo_cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" + echo_cyan "[+] Install MCSManager-Web dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" - echo - echo_yellow "=============== MCSManager ===============" - echo_green "Daemon: ${mcsmanager_install_path}/daemon" - echo_green "Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" + echo + echo_yellow "=============== MCSManager ===============" + echo_green "Daemon: ${mcsmanager_install_path}/daemon" + echo_green "Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" - chmod -R 755 "$mcsmanager_install_path" + chmod -R 755 "$mcsmanager_install_path" - sleep 3 + sleep 3 } Create_Service() { - echo_cyan "[+] Create MCSManager service..." - - if id "$mcsmanager_user" &>/dev/null; then - userdel "$mcsmanager_user" - fi + echo_cyan "[+] Create MCSManager service..." - useradd -r -M -s "$(command -v nologin)" -d "$mcsmanager_install_path" "$mcsmanager_user" - chown $mcsmanager_user:$mcsmanager_user -R "$mcsmanager_install_path" - - groupadd docker - usermod -aG docker mcsm - - echo "[Unit] + echo "[Unit] Description=MCSManager-Daemon [Service] -User=${mcsmanager_user} WorkingDirectory=${mcsmanager_install_path}/daemon ExecStart=${node_install_path}/bin/node app.js ExecReload=/bin/kill -s QUIT \$MAINPID @@ -150,11 +138,10 @@ Environment=\"PATH=${PATH}\" WantedBy=multi-user.target " >/etc/systemd/system/mcsm-daemon.service - echo "[Unit] + echo "[Unit] Description=MCSManager-Web [Service] -User=${mcsmanager_user} WorkingDirectory=${mcsmanager_install_path}/web ExecStart=${node_install_path}/bin/node app.js ExecReload=/bin/kill -s QUIT \$MAINPID @@ -165,50 +152,50 @@ Environment=\"PATH=${PATH}\" WantedBy=multi-user.target " >/etc/systemd/system/mcsm-web.service - systemctl daemon-reload - systemctl enable --now mcsm-{daemon,web}.service - echo_green "Registered!" - - sleep 2 - - printf "\n\n\n\n" - - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: " - echo_yellow "http://:23333 (Browser)" - echo_cyan_n "Daemon Address: " - echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + systemctl daemon-reload + systemctl enable --now mcsm-{daemon,web}.service + echo_green "Registered!" + + sleep 2 + + printf "\n\n\n\n" + + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" + echo_cyan_n "Daemon Address: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" } # Environmental inspection if [[ "$arch" == x86_64 ]]; then - arch=x64 - #echo "[-] x64 architecture detected" + arch=x64 + #echo "[-] x64 architecture detected" elif [[ $arch == aarch64 ]]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" elif [[ $arch == arm ]]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" elif [[ $arch == ppc64le ]]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" + arch=ppc64le + #echo "[-] IBM POWER architecture detected" elif [[ $arch == s390x ]]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" else - Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" + Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" fi # Define the variable Node installation directory @@ -220,22 +207,22 @@ echo_cyan "[-] Architecture: $arch" # Install related software echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " if [[ -x "$(command -v yum)" ]]; then - yum install -y git tar wget + yum install -y git tar wget elif [[ -x "$(command -v apt-get)" ]]; then - apt-get install -y git tar wget + apt-get install -y git tar wget elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm git tar wget + pacman -S --noconfirm git tar wget elif [[ -x "$(command -v zypper)" ]]; then - zypper --non-interactive install git tar wget + zypper --non-interactive install git tar wget else - echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" + echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" fi # Determine whether the relevant software is installed successfully if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "Success" + echo_green "Success" else - Red_Error "[x] Failed to find git, tar and wget, please install them manually!" + Red_Error "[x] Failed to find git, tar and wget, please install them manually!" fi # Install the Node environment diff --git a/setup_cn.sh b/setup_cn.sh index f28c8f9..a518aa6 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -2,7 +2,6 @@ mcsmanager_install_path="/opt/mcsmanager" mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" -mcsmanager_user="mcsm" package_name="MCSManager-v10-linux.tar.gz" node="v16.20.2" arch=$(uname -m) @@ -125,21 +124,10 @@ Install_MCSManager() { Create_Service() { echo_cyan "[+] Create MCSManager service..." - if id "$mcsmanager_user" &>/dev/null; then - userdel "$mcsmanager_user" - fi - - useradd -r -M -s "$(command -v nologin)" -d "$mcsmanager_install_path" "$mcsmanager_user" - chown $mcsmanager_user:$mcsmanager_user -R "$mcsmanager_install_path" - - groupadd docker - usermod -aG docker mcsm - echo "[Unit] Description=MCSManager-Daemon [Service] -User=${mcsmanager_user} WorkingDirectory=${mcsmanager_install_path}/daemon ExecStart=${node_install_path}/bin/node app.js ExecReload=/bin/kill -s QUIT \$MAINPID @@ -154,7 +142,6 @@ WantedBy=multi-user.target Description=MCSManager-Web [Service] -User=${mcsmanager_user} WorkingDirectory=${mcsmanager_install_path}/web ExecStart=${node_install_path}/bin/node app.js ExecReload=/bin/kill -s QUIT \$MAINPID From 1c1aa38206a1f1198d4bd3d8b8cc47bf9babc19e Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 30 Apr 2024 14:34:08 +0800 Subject: [PATCH 129/463] Feat: add Templates.json for Quick Install --- templates.json | 154 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 templates.json diff --git a/templates.json b/templates.json new file mode 100644 index 0000000..7a0fe9f --- /dev/null +++ b/templates.json @@ -0,0 +1,154 @@ +{ + "remark": "This file is only used for quick deployment.", + "languages": [ + { + "label": "English", + "value": "en_us" + }, + { + "label": "简体中文", + "value": "zh_cn" + } + ], + "packages": [ + { + "language": "en_us", + "description": "[Paper] Recommendation for friends with multiple players, Fast setup.", + "title": "Minecraft 1.20.4 Java", + "runtime": "Java 17+", + "hardware": "RAM 8G", + "size": "140MB", + "remark": "Paper Software", + "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.20.4.zip", + "author": "mcsmanager.com" + }, + { + "language": "en_us", + "description": "[Paper] Recommendation for friends with multiple players", + "title": "Minecraft 1.19.2 Java", + "runtime": "Java 17+", + "hardware": "RAM 8G", + "size": "140MB", + "remark": "Paper Software", + "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.19.2.zip", + "author": "mcsmanager.com" + }, + { + "language": "en_us", + "description": "[Paper] Recommendation for friends with multiple players", + "title": "Minecraft 1.18.2 Java", + "runtime": "Java 17+", + "hardware": "RAM 8G", + "size": "140MB", + "remark": "Paper Software", + "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.18.2.zip", + "author": "mcsmanager.com" + }, + + { + "language": "zh_cn", + "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", + "title": "Minecraft 1.20.4", + "runtime": "Java 17+", + "size": "140MB", + "remark": "支持插件,最低 8GB 内存要求", + "targetLink": "https://url.alww.top/mcsm/paper1.20.4", + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xmx2048M -jar server.jar -nogui", + "stopCommand": "stop", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "zh_cn", + "description": "[原版生存] 朋友联机推荐,1.19.2 版本,快速开服,享受原汁原味的极致生存与探索。", + "title": "Minecraft 1.19.2 Java 原版", + "runtime": "Java 17+", + "hardware": "RAM 8G", + "size": "140MB", + "remark": "支持插件,最低 8GB 内存要求", + "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.19.2.zip", + "author": "mcsmanager.com" + }, + { + "language": "zh_cn", + "description": "[整合包] 小型服务器推荐,包含基础插件、箱子锁、操作回滚、领地和商店等插件。", + "title": "Minecraft 1.19.2 Java 版整合包", + "runtime": "Java 17+", + "hardware": "RAM 8G", + "size": "210MB", + "remark": "支持插件,最低 8GB 内存要求", + "targetLink": "https://url.alww.top/mcsm/paper1.19.2", + "author": "alongw.cn" + }, + { + "language": "zh_cn", + "description": "[Arclight] 小型服务器推荐,1.19.2 版本,可安装mod,互通基岩版,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", + "title": "Minecraft 1.19.2", + "runtime": "Java 17+", + "hardware": "RAM 8G", + "size": "100MB", + "remark": "支持插件,支持mod(Forge),最低 6GB 内存要求", + "targetLink": "https://url.alww.top/mcsm/arclight1.19.2", + "author": "alongw.cn" + }, + { + "language": "zh_cn", + "description": "[整合包/Java&基岩版互通] 小型服务器推荐,互通基岩版,包含基础插件、箱子锁、操作回滚、领地和商店等插件。", + "title": "Minecraft 1.19.2 基岩互通版", + "runtime": "Java 17+", + "hardware": "RAM 8G", + "size": "230MB", + "remark": "支持插件,最低 6GB 内存要求", + "targetLink": "https://url.alww.top/mcsm/paper-geyser1.19.2", + "author": "alongw.cn" + }, + { + "language": "zh_cn", + "description": "[原版生存] 朋友联机推荐,让你和你的小伙伴一起享受原汁原味的极致生存。", + "title": "Minecraft 1.19.1 Java 原版", + "runtime": "Java 17+", + "hardware": "RAM 8G", + "size": "140MB", + "remark": "支持插件,最低 4GB 内存要求", + "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.19.1.zip", + "author": "mcsmanager.com" + }, + { + "language": "zh_cn", + "description": "[原版生存] 适合朋友联机,“荒野更新”(The Wild)旨在为玩家带来现有生物群系的改进和优化。", + "title": "Minecraft 1.19 Java 原版", + "runtime": "Java 17+", + "hardware": "RAM 8G", + "size": "140MB", + "remark": "支持插件,最低 4GB 内存要求", + "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.19.zip", + "author": "mcsmanager.com" + }, + { + "language": "zh_cn", + "description": "[原版生存] 适合朋友联机推荐,继承上版本的功能并进行了一系列的优化,主流联机版本,插件与MOD较为丰富。", + "title": "Minecraft 1.18.2 Java 原版", + "runtime": "Java 17+", + "hardware": "RAM 8G", + "size": "140MB", + "remark": "支持插件,最低 4GB 内存要求", + "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.18.2.zip", + "author": "mcsmanager.com" + }, + { + "language": "zh_cn", + "description": "[原版生存] 适合朋友联机,快速开服,服务器搭建,回味老版本的地穴探索。", + "title": "Minecraft 17.1 Java 原版", + "runtime": "Java 17+", + "hardware": "RAM 8G", + "size": "160MB", + "remark": "支持插件,最低 4GB 内存要求", + "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.17.1.zip", + "author": "mcsmanager.com" + } + ] +} From eef70ca1141ad85a01b03b9d00b8f49ea08ad633 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sat, 4 May 2024 23:53:19 +0800 Subject: [PATCH 130/463] add global arguments --- install_update.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 install_update.sh diff --git a/install_update.sh b/install_update.sh new file mode 100644 index 0000000..f31ecc0 --- /dev/null +++ b/install_update.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +#Global arguments +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +package_name="MCSManager-v10-linux.tar.gz" +node="v20.12.2" +arch=$(uname -m) + +# Default systemd user is 'mcsm' +USER="mcsm" +COMMAND="all" + From b8f03d759732e4552df697b3f208a39e4173d950 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sat, 4 May 2024 23:53:56 +0800 Subject: [PATCH 131/463] add some helper functions --- install_update.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/install_update.sh b/install_update.sh index f31ecc0..bbe7b51 100644 --- a/install_update.sh +++ b/install_update.sh @@ -11,3 +11,44 @@ arch=$(uname -m) USER="mcsm" COMMAND="all" +# Helper Functions +usage() { + echo "Usage: $0 [-u user] [-c command]" + echo " -u Specify the user (mcsm or root), default is 'mcsm'" + echo " -c Specify the command (web, daemon, or all), default is 'all'" + exit 1 +} +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} + +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} + +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} + +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +# Check root permission +check_sudo() { + if [ "$EUID" -ne 0 ]; then + echo "This script must be run as root. Please use \"sudo or root user\" instead." + exit 1 + fi +} +check_sudo + From 330b0d526b6259d3d0d4e2bb067d7f780d9fc146 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sat, 4 May 2024 23:54:16 +0800 Subject: [PATCH 132/463] add argument parsing --- install_update.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/install_update.sh b/install_update.sh index bbe7b51..bec5291 100644 --- a/install_update.sh +++ b/install_update.sh @@ -52,3 +52,32 @@ check_sudo() { } check_sudo +# Parse provided arguments +while getopts "u:c:" opt; do + case ${opt} in + u ) + if [[ "${OPTARG}" == "mcsm" || "${OPTARG}" == "root" ]]; then + user="${OPTARG}" + else + echo "Invalid user specified." + usage + fi + ;; + c ) + if [[ "${OPTARG}" == "web" || "${OPTARG}" == "daemon" || "${OPTARG}" == "all" ]]; then + command="${OPTARG}" + else + echo "Invalid command specified." + usage + fi + ;; + \? ) + usage + ;; + : ) + echo "Option -$OPTARG requires an argument." + usage + ;; + esac +done + From 8a6f4018e1ba3ddee820e1b8c4a5114edd83e51c Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sat, 4 May 2024 23:54:37 +0800 Subject: [PATCH 133/463] add placeholder for different users --- install_update.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/install_update.sh b/install_update.sh index bec5291..6bf7e34 100644 --- a/install_update.sh +++ b/install_update.sh @@ -81,3 +81,15 @@ while getopts "u:c:" opt; do esac done +# Logic for different users +case ${USER} in + root) + ;; + mcsm) + ;; + *) + echo "Unknown user: ${USER}. Using default user mcsm..." + ;; +esac + + From 952422167a400652e0387b22f233f4ae9ae81148 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sat, 4 May 2024 23:54:55 +0800 Subject: [PATCH 134/463] add logic to check if MCSM is installed --- install_update.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/install_update.sh b/install_update.sh index 6bf7e34..9e79729 100644 --- a/install_update.sh +++ b/install_update.sh @@ -93,3 +93,16 @@ case ${USER} in esac +# Check if the mcsmanager_install_path exists +if [ -d "$mcsmanager_install_path" ]; then + echo "The directory '$mcsmanager_install_path' exists." + # Logic branch when the directory exists + # For example, list the contents + echo "Listing contents of $mcsmanager_install_path:" + ls -l "$directory" +else + echo "The directory '$mcsmanager_install_path' does not exist." + # Logic branch when the directory does not exist + # For example, create the directory + echo "Creating $mcsmanager_install_path..." +fi \ No newline at end of file From bc84a77778d8ef947806e98b2b0eb672d3cbe673 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sun, 5 May 2024 22:23:55 +0800 Subject: [PATCH 135/463] add the original node.js installation function --- install_update.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/install_update.sh b/install_update.sh index 9e79729..043f2f6 100644 --- a/install_update.sh +++ b/install_update.sh @@ -1,9 +1,17 @@ #!/bin/bash #Global arguments +#MCSM install dir mcsmanager_install_path="/opt/mcsmanager" +#MCSM backup dir +mcsm_backup_dir="/opt/" +#Created backup absolute path +backup_path="" +#Download URL mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +#File name package_name="MCSManager-v10-linux.tar.gz" +#Node.js version to install node="v20.12.2" arch=$(uname -m) @@ -43,6 +51,37 @@ echo_yellow() { printf '\033[1;33m%b\033[0m\n' "$@" } +Install_node() { + echo_cyan_n "[+] Install Node.js environment...\n" + + rm -irf "$node_install_path" + + cd /opt || Red_Error "[x] Failed to enter /opt" + + rm -rf "node-$node-linux-$arch.tar.gz" + + wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + + tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" + + rm -rf "node-$node-linux-$arch.tar.gz" + + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Success" + else + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node.JS Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node.JS Version ===============" + echo + + sleep 3 +} + # Check root permission check_sudo() { if [ "$EUID" -ne 0 ]; then From 11c3054886ef43f531eabeab70014b4537881c5e Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sun, 5 May 2024 22:26:12 +0800 Subject: [PATCH 136/463] add function to create backup --- install_update.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/install_update.sh b/install_update.sh index 043f2f6..3b7b770 100644 --- a/install_update.sh +++ b/install_update.sh @@ -82,6 +82,44 @@ Install_node() { sleep 3 } +backup_mcs_manager() { + # Ensure both directories are provided + if [ -z "$mcsmanager_install_path" ] || [ -z "$mcsm_backup_dir" ]; then + echo "Error: Backup or source path not set." + return 1 # Return with error + fi + + # Check if the source directory exists + if [ ! -d "$mcsmanager_install_path" ]; then + echo "Error: Source directory does not exist." + return 1 # Return with error + fi + + # Create backup directory (/opt) if it doesn't exist + if [ ! -d "$mcsm_backup_dir" ]; then + echo "Creating backup directory." + mkdir -p "$mcsm_backup_dir" + fi + + # Format the date for the backup filename + local current_date=$(date +%Y_%m_%d) + + # Define the backup path + backup_path="${mcsm_backup_dir}/mcsm_backup_${current_date}.tar.gz" + + # Create the backup + echo "Creating backup..." + tar -czf "$backup_path" -C "$mcsmanager_install_path" . + + # Check if the backup was successful + if [ $? -eq 0 ]; then + echo "Backup created successfully at $backup_path" + else + echo "Error creating backup." + return 1 # Return with error + fi +} + # Check root permission check_sudo() { if [ "$EUID" -ne 0 ]; then From 530b17761c081461cfcc3091850539241cd5189f Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sun, 5 May 2024 22:26:42 +0800 Subject: [PATCH 137/463] rename backup function --- install_update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_update.sh b/install_update.sh index 3b7b770..14cc182 100644 --- a/install_update.sh +++ b/install_update.sh @@ -82,7 +82,7 @@ Install_node() { sleep 3 } -backup_mcs_manager() { +Backup_MCSM() { # Ensure both directories are provided if [ -z "$mcsmanager_install_path" ] || [ -z "$mcsm_backup_dir" ]; then echo "Error: Backup or source path not set." From b130f3d55671fa4b3c518907040c054137a00c72 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sun, 5 May 2024 22:32:43 +0800 Subject: [PATCH 138/463] add dependencies installation --- install_update.sh | 63 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 20 deletions(-) diff --git a/install_update.sh b/install_update.sh index 14cc182..d606d00 100644 --- a/install_update.sh +++ b/install_update.sh @@ -1,19 +1,24 @@ #!/bin/bash #Global arguments -#MCSM install dir +# System architecture +arch=$(uname -m) +# MCSM install dir mcsmanager_install_path="/opt/mcsmanager" -#MCSM backup dir +# MCSM backup dir mcsm_backup_dir="/opt/" -#Created backup absolute path +# Created backup absolute path backup_path="" -#Download URL +# Download URL mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" -#File name +# File name package_name="MCSManager-v10-linux.tar.gz" -#Node.js version to install +# Node.js version to install node="v20.12.2" -arch=$(uname -m) +# Node.js install dir +node_install_path="/opt/node-$node-linux-$arch" + + # Default systemd user is 'mcsm' USER="mcsm" @@ -51,6 +56,30 @@ echo_yellow() { printf '\033[1;33m%b\033[0m\n' "$@" } +# Check root permission +check_sudo() { + if [ "$EUID" -ne 0 ]; then + echo "This script must be run as root. Please use \"sudo or root user\" instead." + exit 1 + fi +} + +Install_dependencies() { + # Install related software + echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " + if [[ -x "$(command -v yum)" ]]; then + yum install -y git tar wget + elif [[ -x "$(command -v apt-get)" ]]; then + apt-get install -y git tar wget + elif [[ -x "$(command -v pacman)" ]]; then + pacman -S --noconfirm git tar wget + elif [[ -x "$(command -v zypper)" ]]; then + zypper --non-interactive install git tar wget + else + echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" + fi +} + Install_node() { echo_cyan_n "[+] Install Node.js environment...\n" @@ -119,15 +148,10 @@ Backup_MCSM() { return 1 # Return with error fi } - -# Check root permission -check_sudo() { - if [ "$EUID" -ne 0 ]; then - echo "This script must be run as root. Please use \"sudo or root user\" instead." - exit 1 - fi -} +########### Main Logic ################ check_sudo +# Install Dependencies +Install_dependencies # Parse provided arguments while getopts "u:c:" opt; do @@ -172,11 +196,10 @@ esac # Check if the mcsmanager_install_path exists if [ -d "$mcsmanager_install_path" ]; then - echo "The directory '$mcsmanager_install_path' exists." - # Logic branch when the directory exists - # For example, list the contents - echo "Listing contents of $mcsmanager_install_path:" - ls -l "$directory" + # Backup first + Backup_MCSM + # Install Node.js, this is to ensure the version is up to date. + else echo "The directory '$mcsmanager_install_path' does not exist." # Logic branch when the directory does not exist From 7070e2dd5deaefc2c6b483bf789f768389063933 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sun, 5 May 2024 22:33:47 +0800 Subject: [PATCH 139/463] add original functions to check dependencies --- install_update.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install_update.sh b/install_update.sh index d606d00..fdd92a5 100644 --- a/install_update.sh +++ b/install_update.sh @@ -78,6 +78,14 @@ Install_dependencies() { else echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" fi + + # Determine whether the relevant software is installed successfully + if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then + echo_green "Success" + else + Red_Error "[x] Failed to find git, tar and wget, please install them manually!" + fi + } Install_node() { From 16e55ed38b8f8cec8556456edf1e5833a4bab07c Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sun, 5 May 2024 22:46:43 +0800 Subject: [PATCH 140/463] put current_date as a global variable --- install_update.sh | 77 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 71 insertions(+), 6 deletions(-) diff --git a/install_update.sh b/install_update.sh index fdd92a5..bb25489 100644 --- a/install_update.sh +++ b/install_update.sh @@ -17,8 +17,12 @@ package_name="MCSManager-v10-linux.tar.gz" node="v20.12.2" # Node.js install dir node_install_path="/opt/node-$node-linux-$arch" - - +# MCSM Web dir name +mcsm_web="web" +# MCSM daemon dir name +mcsm_daemon="daemon" +# The date variable to be shared across functions +local current_date=$(date +%Y_%m_%d) # Default systemd user is 'mcsm' USER="mcsm" @@ -110,7 +114,7 @@ Install_node() { fi echo - echo_yellow "=============== Node.JS Version ===============" + echo_yellow "=============== Node.js Version ===============" echo_yellow " node: $("$node_install_path"/bin/node -v)" echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" echo_yellow "=============== Node.JS Version ===============" @@ -138,9 +142,6 @@ Backup_MCSM() { mkdir -p "$mcsm_backup_dir" fi - # Format the date for the backup filename - local current_date=$(date +%Y_%m_%d) - # Define the backup path backup_path="${mcsm_backup_dir}/mcsm_backup_${current_date}.tar.gz" @@ -156,6 +157,68 @@ Backup_MCSM() { return 1 # Return with error fi } + +# MCSM Web Update & Installation +Install_Web() { + web_path="$mcsmanager_install_path/$mcsm_web" + web_data="$mcsmanager_install_path/web_data" + if [ -d "$web_path" ]; then + echo_cyan "[+] Updating MCSManager Web..." + # The backup should be created already, moving the DATA dir to /opt/mcsmanager/web_data should be fast and safe. + # Use web_data, do not use data as in rare circumstance user may run both update at the same time. + # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) + + else + echo "The directory '$mcsmanager_install_path' does not exist." + # Logic branch when the directory does not exist + # For example, create the directory + echo "Creating $mcsmanager_install_path..." + fi + echo_cyan "[+] Install MCSManager Web..." + + # stop service + systemctl disable --now mcsm-{web} + + # delete service + rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + systemctl daemon-reload + + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" + + # cd /opt/mcsmanager + cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" + + # donwload MCSManager release + wget "${mcsmanager_donwload_addr}" || Red_Error "[x] Failed to download MCSManager" + tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" + rm -rf "${mcsmanager_install_path}/${package_name}" + + # echo "[→] cd daemon" + cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" + + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" + + # echo "[←] cd .." + cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" + + echo_cyan "[+] Install MCSManager-Web dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" + + echo + echo_yellow "=============== MCSManager ===============" + echo_green "Daemon: ${mcsmanager_install_path}/daemon" + echo_green "Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" + + chmod -R 755 "$mcsmanager_install_path" + + sleep 3 +} + + ########### Main Logic ################ check_sudo # Install Dependencies @@ -207,6 +270,8 @@ if [ -d "$mcsmanager_install_path" ]; then # Backup first Backup_MCSM # Install Node.js, this is to ensure the version is up to date. + Install_node + # else echo "The directory '$mcsmanager_install_path' does not exist." From ff1ab79b3476b7f418acc923cd1571e9221393b2 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sun, 5 May 2024 22:56:10 +0800 Subject: [PATCH 141/463] create separate function for program initialize --- install_update.sh | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/install_update.sh b/install_update.sh index bb25489..6565e8f 100644 --- a/install_update.sh +++ b/install_update.sh @@ -23,7 +23,8 @@ mcsm_web="web" mcsm_daemon="daemon" # The date variable to be shared across functions local current_date=$(date +%Y_%m_%d) - +# MCSM local temp dir for downloaded source +mcsm_down_temp="/opt/mcsmanager_${current_date}" # Default systemd user is 'mcsm' USER="mcsm" COMMAND="all" @@ -122,6 +123,17 @@ Install_node() { sleep 3 } +# Initialization +Initialize() { + # Check sudo + check_sudo + + # Check dependencies + Install_dependencies + + # Check and download MCSM source + +} Backup_MCSM() { # Ensure both directories are provided @@ -157,22 +169,29 @@ Backup_MCSM() { return 1 # Return with error fi } +# MCSM Web Base Installation +Install_MCSM_Web_Base() { + + +} + # MCSM Web Update & Installation -Install_Web() { - web_path="$mcsmanager_install_path/$mcsm_web" - web_data="$mcsmanager_install_path/web_data" +Install_Web_wrapper() { + web_path="${mcsmanager_install_path}/${mcsm_web}" + web_data="${web_path}/data" + web_data_tmp="${mcsmanager_install_path}/web_data_${current_date}" if [ -d "$web_path" ]; then echo_cyan "[+] Updating MCSManager Web..." # The backup should be created already, moving the DATA dir to /opt/mcsmanager/web_data should be fast and safe. # Use web_data, do not use data as in rare circumstance user may run both update at the same time. # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) + mv "$web_data" "$web_data_tmp" + # Remove the old web dir + rm -rf "$web_path" else echo "The directory '$mcsmanager_install_path' does not exist." - # Logic branch when the directory does not exist - # For example, create the directory - echo "Creating $mcsmanager_install_path..." fi echo_cyan "[+] Install MCSManager Web..." @@ -220,10 +239,7 @@ Install_Web() { ########### Main Logic ################ -check_sudo -# Install Dependencies -Install_dependencies - +Initialize # Parse provided arguments while getopts "u:c:" opt; do case ${opt} in From cdb216052dea3f1d2cf12644eea5233f634d9299 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sun, 5 May 2024 23:15:20 +0800 Subject: [PATCH 142/463] create separate install base --- install_update.sh | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/install_update.sh b/install_update.sh index 6565e8f..54fcc47 100644 --- a/install_update.sh +++ b/install_update.sh @@ -3,12 +3,12 @@ #Global arguments # System architecture arch=$(uname -m) +# Install base dir +install_base="/opt" # MCSM install dir -mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_install_path="${install_base}/mcsmanager" # MCSM backup dir -mcsm_backup_dir="/opt/" -# Created backup absolute path -backup_path="" +mcsm_backup_dir="${install_base}" # Download URL mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" # File name @@ -16,7 +16,7 @@ package_name="MCSManager-v10-linux.tar.gz" # Node.js version to install node="v20.12.2" # Node.js install dir -node_install_path="/opt/node-$node-linux-$arch" +node_install_path="${install_base}/node-$node-linux-$arch" # MCSM Web dir name mcsm_web="web" # MCSM daemon dir name @@ -28,6 +28,8 @@ mcsm_down_temp="/opt/mcsmanager_${current_date}" # Default systemd user is 'mcsm' USER="mcsm" COMMAND="all" +# Created backup absolute path +backup_path="" # Helper Functions usage() { @@ -123,11 +125,27 @@ Install_node() { sleep 3 } +# Check and download MCSM source +Check_and_download_source() { + if [ -d "$mcsm_down_temp" ]; then + echo_cyan "[+] Downloading MCSManager..." + # Remove the downloaded source if existed, the source dir name contains current date, so its unlikely to coincide with other name(s) + rm -rf "$mcsm_down_temp" + mkdir -p "$mcsm_down_temp" || Red_Error "[x] Failed to create ${mcsm_down_temp}" + + else + mkdir -p "$mcsm_down_temp" || Red_Error "[x] Failed to create ${mcsm_down_temp}" + fi + +} # Initialization Initialize() { # Check sudo check_sudo - + + # Check if install base (/opt) exist + mkdir -p "$install_base" + # Check dependencies Install_dependencies From b07692f9061628f3a4f27d06fbc770c437ad2c5f Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sun, 5 May 2024 23:36:56 +0800 Subject: [PATCH 143/463] add function to check and download MCSM source --- install_update.sh | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/install_update.sh b/install_update.sh index 54fcc47..e13eee0 100644 --- a/install_update.sh +++ b/install_update.sh @@ -127,17 +127,27 @@ Install_node() { } # Check and download MCSM source Check_and_download_source() { - if [ -d "$mcsm_down_temp" ]; then - echo_cyan "[+] Downloading MCSManager..." - # Remove the downloaded source if existed, the source dir name contains current date, so its unlikely to coincide with other name(s) - rm -rf "$mcsm_down_temp" - mkdir -p "$mcsm_down_temp" || Red_Error "[x] Failed to create ${mcsm_down_temp}" - - else - mkdir -p "$mcsm_down_temp" || Red_Error "[x] Failed to create ${mcsm_down_temp}" - fi + # Empty the temp dir if existed + rm -rf "$mcsm_down_temp" + mkdir -p "$mcsm_down_temp" + + # Download the archive directly into the temporary directory + wget -O "${mcsm_down_temp}/mcsmanager.tar.gz" "$mcsmanager_download_addr" + if [ $? -ne 0 ]; then + echo "Download failed." + return 1 # Exit if download fails + fi + + # Extract the archive without changing directories + tar -xzf "${mcsm_down_temp}/mcsmanager.tar.gz" -C "$mcsm_down_temp" --strip-components=1 + if [ $? -ne 0 ]; then + echo "Extraction failed." + return 1 # Exit if extraction fails + fi + + # Clean up the downloaded tar.gz file + rm "${mcsm_down_temp}/mcsmanager.tar.gz" -} # Initialization Initialize() { # Check sudo @@ -150,7 +160,7 @@ Initialize() { Install_dependencies # Check and download MCSM source - + Check_and_download_source } Backup_MCSM() { @@ -188,6 +198,7 @@ Backup_MCSM() { fi } # MCSM Web Base Installation +# Assume a fresh install (i.e. no file(s) from previous installation) Install_MCSM_Web_Base() { From d92adc59a14cf72c7a7ba04546732d76e3a45c5c Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sun, 5 May 2024 23:39:18 +0800 Subject: [PATCH 144/463] update initialization section --- install_update.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install_update.sh b/install_update.sh index e13eee0..03e3824 100644 --- a/install_update.sh +++ b/install_update.sh @@ -156,6 +156,9 @@ Initialize() { # Check if install base (/opt) exist mkdir -p "$install_base" + # Create mcsmanager path if not already + mkdir -p "$mcsmanager_install_path" + # Check dependencies Install_dependencies @@ -198,9 +201,9 @@ Backup_MCSM() { fi } # MCSM Web Base Installation -# Assume a fresh install (i.e. no file(s) from previous installation) +# Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source Install_MCSM_Web_Base() { - + # Creat } From d0e43edba44d3fb09900a9f6abfde38ddd1c8d69 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Sun, 5 May 2024 23:58:31 +0800 Subject: [PATCH 145/463] add web base install --- install_update.sh | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/install_update.sh b/install_update.sh index 03e3824..1256cb5 100644 --- a/install_update.sh +++ b/install_update.sh @@ -11,8 +11,6 @@ mcsmanager_install_path="${install_base}/mcsmanager" mcsm_backup_dir="${install_base}" # Download URL mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" -# File name -package_name="MCSManager-v10-linux.tar.gz" # Node.js version to install node="v20.12.2" # Node.js install dir @@ -203,13 +201,23 @@ Backup_MCSM() { # MCSM Web Base Installation # Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source Install_MCSM_Web_Base() { - # Creat - + # Move downloaded path + mv "${mcsm_down_temp}/${mcsm_web}" "$web_path" + # Move back the data directory + rm -rf "$web_data" + mv "${web_data_tmp}" "${web_data}" + # Dependencies install + cd "${web_path}" || Red_Error "[x] Failed to enter ${web_path}" + # Install dependencies + echo_cyan "[+] Install MCSManager-Web dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${web_path}" + # Return to general dir + cd "$mcsmanager_install_path" } # MCSM Web Update & Installation -Install_Web_wrapper() { +Install_Web_Wrapper() { web_path="${mcsmanager_install_path}/${mcsm_web}" web_data="${web_path}/data" web_data_tmp="${mcsmanager_install_path}/web_data_${current_date}" @@ -227,13 +235,18 @@ Install_Web_wrapper() { fi echo_cyan "[+] Install MCSManager Web..." - # stop service - systemctl disable --now mcsm-{web} + # stop and disable service + systemctl disable --now mcsm-web # delete service - rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + rm -rf /etc/systemd/system/mcsm-web.service systemctl daemon-reload - + + # Install MCSM Web + Install_MCSM_Web_Base + + + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" # cd /opt/mcsmanager From 092021ce45c9ceef2789b6aad062495bf8ffc2c7 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 00:08:05 +0800 Subject: [PATCH 146/463] add mcsm user creation to initialize --- install_update.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/install_update.sh b/install_update.sh index 1256cb5..924b03c 100644 --- a/install_update.sh +++ b/install_update.sh @@ -23,6 +23,10 @@ mcsm_daemon="daemon" local current_date=$(date +%Y_%m_%d) # MCSM local temp dir for downloaded source mcsm_down_temp="/opt/mcsmanager_${current_date}" +# Service file for MCSCM Web +service_file_web="/etc/systemd/system/mcsm-web.service" +# Service file for MCSM daemon +service_file_daemon="/etc/systemd/system/mcsm-daemon.service" # Default systemd user is 'mcsm' USER="mcsm" COMMAND="all" @@ -162,6 +166,17 @@ Initialize() { # Check and download MCSM source Check_and_download_source + + # Create mcsm user if needed + if [[ "$USER" == *"mcsm"* ]]; then + # Create the user 'mcsm' if it doesn't already exist + if ! id "mcsm" &>/dev/null; then + useradd mcsm + echo "User 'mcsm' created." + else + echo "User 'mcsm' already exists." + fi + fi } Backup_MCSM() { @@ -214,7 +229,24 @@ Install_MCSM_Web_Base() { # Return to general dir cd "$mcsmanager_install_path" } +# MCSM Web Service Installation +Install_Web_Systemd() { + echo_cyan "[+] Creating MCSManager Web service..." + echo "[Unit] + Description=MCSManager-Web + + [Service] + WorkingDirectory=${web_path} + ExecStart=${node_install_path}/bin/node app.js + ExecReload=/bin/kill -s QUIT \$MAINPID + ExecStop=/bin/kill -s QUIT \$MAINPID + Environment=\"PATH=${PATH}\" + + [Install] + WantedBy=multi-user.target + " >/etc/systemd/system/mcsm-web.service +} # MCSM Web Update & Installation Install_Web_Wrapper() { From 552fc8c9ce04de565bc7d37280951723e5709c61 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 00:25:31 +0800 Subject: [PATCH 147/463] add mcsm web installation --- install_update.sh | 60 ++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/install_update.sh b/install_update.sh index 924b03c..c962b76 100644 --- a/install_update.sh +++ b/install_update.sh @@ -228,11 +228,18 @@ Install_MCSM_Web_Base() { env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${web_path}" # Return to general dir cd "$mcsmanager_install_path" + # Configure ownership if needed + if [[ "$USER" == *"mcsm"* ]]; then + # Change file permission to mcsm user + chown -R mcsm:mcsm "$web_path" + fi + chmod -R 755 "$web_path" } # MCSM Web Service Installation Install_Web_Systemd() { echo_cyan "[+] Creating MCSManager Web service..." - echo "[Unit] + # Create the default service file + echo "[Unit] Description=MCSManager-Web [Service] @@ -245,7 +252,19 @@ Install_Web_Systemd() { [Install] WantedBy=multi-user.target " >/etc/systemd/system/mcsm-web.service - + # Add user section if using mcsm user + if [[ "$USER" == *"mcsm"* ]]; then + # Check if the 'User=mcsm' line already exists in the service file + if grep -q "^User=mcsm$" "$service_file"; then + echo "The service file is configured already." + else + # Add 'User=mcsm' to the service file + sed -i '/^\[Service\]$/a User=mcsm' "$service_file" + fi + fi + # Reload Systemd Service + systemctl daemon-reload + } # MCSM Web Update & Installation @@ -277,41 +296,8 @@ Install_Web_Wrapper() { # Install MCSM Web Install_MCSM_Web_Base - - - mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" - - # cd /opt/mcsmanager - cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" - - # donwload MCSManager release - wget "${mcsmanager_donwload_addr}" || Red_Error "[x] Failed to download MCSManager" - tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" - rm -rf "${mcsmanager_install_path}/${package_name}" - - # echo "[→] cd daemon" - cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" - - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" - - # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - - echo_cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" - - echo - echo_yellow "=============== MCSManager ===============" - echo_green "Daemon: ${mcsmanager_install_path}/daemon" - echo_green "Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" - - chmod -R 755 "$mcsmanager_install_path" - - sleep 3 + # Install MCSM Web Service + Install_Web_Systemd } From 6de15c8eb18fc92b763b775ba71bc263d5fd18e5 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 00:27:27 +0800 Subject: [PATCH 148/463] add mcsm daemon base install --- install_update.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/install_update.sh b/install_update.sh index c962b76..6dbc123 100644 --- a/install_update.sh +++ b/install_update.sh @@ -300,7 +300,28 @@ Install_Web_Wrapper() { Install_Web_Systemd } - +# MCSM Daemon Base Installation +# Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source +Install_MCSM_Daemon_Base() { + # Move downloaded path + mv "${mcsm_down_temp}/${mcsm_daemon}" "$daemon_path" + # Move back the data directory + rm -rf "$daemon_data" + mv "${web_daemon_tmp}" "${daemon_data}" + # Dependencies install + cd "${daemon_path}" || Red_Error "[x] Failed to enter ${daemon_path}" + # Install dependencies + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${daemon_path}" + # Return to general dir + cd "$mcsmanager_install_path" + # Configure ownership if needed + if [[ "$USER" == *"mcsm"* ]]; then + # Change file permission to mcsm user + chown -R mcsm:mcsm "$daemon_path" + fi + chmod -R 755 "$daemon_path" +} ########### Main Logic ################ Initialize # Parse provided arguments From acd7f5ca6730b8c7d5d258c7b27af456f7e857a4 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 00:37:45 +0800 Subject: [PATCH 149/463] add mcsm daemon systemd service --- install_update.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/install_update.sh b/install_update.sh index 6dbc123..3fda8e0 100644 --- a/install_update.sh +++ b/install_update.sh @@ -322,6 +322,40 @@ Install_MCSM_Daemon_Base() { fi chmod -R 755 "$daemon_path" } + +# MCSM Daemon Service Installation +Install_Daemon_Systemd() { + echo_cyan "[+] Creating MCSManager Daemon service..." + # Create the default service file + echo "[Unit] + Description=MCSManager-Daemon + + [Service] + WorkingDirectory=${daemon_path} + ExecStart=${node_install_path}/bin/node app.js + ExecReload=/bin/kill -s QUIT \$MAINPID + ExecStop=/bin/kill -s QUIT \$MAINPID + Environment=\"PATH=${PATH}\" + + [Install] + WantedBy=multi-user.target + " >/etc/systemd/system/mcsm-daemon.service + # Add user section if using mcsm user + if [[ "$USER" == *"mcsm"* ]]; then + # Check if the 'User=mcsm' line already exists in the service file + if grep -q "^User=mcsm$" "$service_file"; then + echo "The service file is configured already." + else + # Add 'User=mcsm' to the service file + sed -i '/^\[Service\]$/a User=mcsm' "$service_file" + fi + fi + # Reload Systemd Service + systemctl daemon-reload + +} + + ########### Main Logic ################ Initialize # Parse provided arguments From 9433bf24bbb334e1e54d553ba34fd8cd6fa1354c Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 00:38:54 +0800 Subject: [PATCH 150/463] consolidate systemd commands --- install_update.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install_update.sh b/install_update.sh index 3fda8e0..6d8213e 100644 --- a/install_update.sh +++ b/install_update.sh @@ -238,6 +238,13 @@ Install_MCSM_Web_Base() { # MCSM Web Service Installation Install_Web_Systemd() { echo_cyan "[+] Creating MCSManager Web service..." + # stop and disable existing service + systemctl disable --now mcsm-web + + # delete existing service + rm -rf /etc/systemd/system/mcsm-web.service + systemctl daemon-reload + # Create the default service file echo "[Unit] Description=MCSManager-Web @@ -285,13 +292,6 @@ Install_Web_Wrapper() { echo "The directory '$mcsmanager_install_path' does not exist." fi echo_cyan "[+] Install MCSManager Web..." - - # stop and disable service - systemctl disable --now mcsm-web - - # delete service - rm -rf /etc/systemd/system/mcsm-web.service - systemctl daemon-reload # Install MCSM Web Install_MCSM_Web_Base From 197ef9b12e9e209fae235a3248cbc75a509c5afe Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 00:52:44 +0800 Subject: [PATCH 151/463] add argument parsing to separate function --- install_update.sh | 98 +++++++++++++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 38 deletions(-) diff --git a/install_update.sh b/install_update.sh index 6d8213e..4b51331 100644 --- a/install_update.sh +++ b/install_update.sh @@ -354,49 +354,71 @@ Install_Daemon_Systemd() { systemctl daemon-reload } +# MCSM Web Update & Installation +Install_Daemon_Wrapper() { + web_path="${mcsmanager_install_path}/${mcsm_daemon}" + web_data="${web_daemon}/data" + web_data_tmp="${mcsmanager_install_path}/daemon_data_${current_date}" + if [ -d "$daemon_path" ]; then + echo_cyan "[+] Updating MCSManager Daemon..." + # The backup should be created already, moving the DATA dir to /opt/mcsmanager/daemon_data should be fast and safe. + # Use daemon_data, do not use data as in rare circumstance user may run both update at the same time. + # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) + mv "$daemon_data" "$daemon_data_tmp" + # Remove the old daemon dir + rm -rf "$daemon_path" + + else + echo "The directory '$mcsmanager_install_path' does not exist." + fi + echo_cyan "[+] Install MCSManager daemon..." + + # Install MCSM Web + Install_MCSM_Daemon_Base + + # Install MCSM Web Service + Install_Daemon_Systemd +} +# Arguments parsing +Parse_Arguments() { + +} + +# Wrapper for installation +Install_Update() { + while getopts "u:c:" opt; do + case ${opt} in + u ) + if [[ "${OPTARG}" == "mcsm" || "${OPTARG}" == "root" ]]; then + user="${OPTARG}" + else + echo "Invalid user specified." + usage + fi + ;; + c ) + if [[ "${OPTARG}" == "web" || "${OPTARG}" == "daemon" || "${OPTARG}" == "all" ]]; then + command="${OPTARG}" + else + echo "Invalid command specified." + usage + fi + ;; + \? ) + usage + ;; + : ) + echo "Option -$OPTARG requires an argument." + usage + ;; + esac + done +} ########### Main Logic ################ Initialize # Parse provided arguments -while getopts "u:c:" opt; do - case ${opt} in - u ) - if [[ "${OPTARG}" == "mcsm" || "${OPTARG}" == "root" ]]; then - user="${OPTARG}" - else - echo "Invalid user specified." - usage - fi - ;; - c ) - if [[ "${OPTARG}" == "web" || "${OPTARG}" == "daemon" || "${OPTARG}" == "all" ]]; then - command="${OPTARG}" - else - echo "Invalid command specified." - usage - fi - ;; - \? ) - usage - ;; - : ) - echo "Option -$OPTARG requires an argument." - usage - ;; - esac -done - -# Logic for different users -case ${USER} in - root) - ;; - mcsm) - ;; - *) - echo "Unknown user: ${USER}. Using default user mcsm..." - ;; -esac # Check if the mcsmanager_install_path exists From 87cf66b242938d12e66239ecb3b5c24f9445a844 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 00:53:09 +0800 Subject: [PATCH 152/463] fix argument parsing position --- install_update.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/install_update.sh b/install_update.sh index 4b51331..8adcf07 100644 --- a/install_update.sh +++ b/install_update.sh @@ -381,13 +381,6 @@ Install_Daemon_Wrapper() { } # Arguments parsing Parse_Arguments() { - - - -} - -# Wrapper for installation -Install_Update() { while getopts "u:c:" opt; do case ${opt} in u ) @@ -416,6 +409,10 @@ Install_Update() { esac done } + +# Wrapper for installation +Install_Update() { +} ########### Main Logic ################ Initialize # Parse provided arguments From 57d02555f87fe4704b90a03f2d6554d5dbf23f9e Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 00:59:03 +0800 Subject: [PATCH 153/463] rearrange some commands --- install_update.sh | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/install_update.sh b/install_update.sh index 8adcf07..c7b67a4 100644 --- a/install_update.sh +++ b/install_update.sh @@ -412,6 +412,33 @@ Parse_Arguments() { # Wrapper for installation Install_Update() { + case "$COMMAND" in + all) + Install_Web_Wrapper + Install_Daemon_Wrapper + ;; + + web) + Install_Web_Wrapper + ;; + + daemon) + Install_Daemon_Wrapper + ;; + + *) + echo "Unknown command: $COMMAND, this should not happen in general :( Please report this bug." + # Exit with an error if COMMAND is unrecognized + exit 1 + ;; +esac +} +# Finalize installation +Finalize() { + + + + } ########### Main Logic ################ Initialize @@ -424,11 +451,14 @@ if [ -d "$mcsmanager_install_path" ]; then Backup_MCSM # Install Node.js, this is to ensure the version is up to date. Install_node - # else - echo "The directory '$mcsmanager_install_path' does not exist." - # Logic branch when the directory does not exist - # For example, create the directory - echo "Creating $mcsmanager_install_path..." -fi \ No newline at end of file + # Install Node.js, this is to ensure the version is up to date. + Install_node +fi + +# Install Services based on command +Install_Update + +# Print Information +echo "Installation Complete!" \ No newline at end of file From 112ecda518cb652c9d08f05a8c25c6c45de96400 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 00:59:37 +0800 Subject: [PATCH 154/463] enable and start service as install --- install_update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_update.sh b/install_update.sh index c7b67a4..77b00ba 100644 --- a/install_update.sh +++ b/install_update.sh @@ -271,7 +271,7 @@ Install_Web_Systemd() { fi # Reload Systemd Service systemctl daemon-reload - + systemctl enable --now mcsm-web } # MCSM Web Update & Installation @@ -352,7 +352,7 @@ Install_Daemon_Systemd() { fi # Reload Systemd Service systemctl daemon-reload - + systemctl enable --now mcsm-daemon } # MCSM Web Update & Installation Install_Daemon_Wrapper() { From 4ae4d8465013836c82191b3762bc1136d9209486 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 01:04:39 +0800 Subject: [PATCH 155/463] print different information based on install cmd --- install_update.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/install_update.sh b/install_update.sh index 77b00ba..992d617 100644 --- a/install_update.sh +++ b/install_update.sh @@ -435,7 +435,68 @@ esac } # Finalize installation Finalize() { - + printf "\n\n\n\n" + case "$COMMAND" in + all) + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" + echo_cyan_n "Daemon Address: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" + ;; + + web) + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" + echo_red "You must expose port 23333 to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-web.service" + echo_cyan "systemctl stop mcsm-web.service" + echo_cyan "systemctl restart mcsm-web.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" + ;; + + daemon) + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_yellow " " + echo_cyan_n "Daemon Address: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose port 24444 to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-daemon.service" + echo_cyan "systemctl stop mcsm-daemon.service" + echo_cyan "systemctl restart mcsm-daemon.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" + ;; + + *) + echo "Unknown command: $COMMAND, this should not happen in general :( Please report this bug." + # Exit with an error if COMMAND is unrecognized + exit 1 + ;; + + From bbc062eb870e701ace94b371d8d73a34ac38e406 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 01:08:00 +0800 Subject: [PATCH 156/463] complete main logic --- install_update.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/install_update.sh b/install_update.sh index 992d617..0c87f6a 100644 --- a/install_update.sh +++ b/install_update.sh @@ -495,11 +495,11 @@ Finalize() { # Exit with an error if COMMAND is unrecognized exit 1 ;; - - - - - + # Check if backup_path is not empty + if [[ -n "$backup_path" ]]; then + echo "Your MCSM has been updated and/or installed. A complete backup was created at: $backup_path" + echo "You can manually delete the backup using command: rm ${backup_path}" + fi } ########### Main Logic ################ Initialize @@ -521,5 +521,7 @@ fi # Install Services based on command Install_Update -# Print Information +# Print helping Information +Finalize + echo "Installation Complete!" \ No newline at end of file From a8dc6dba70f39b136c109646f41e9608671d00de Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 01:08:45 +0800 Subject: [PATCH 157/463] add main function --- install_update.sh | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/install_update.sh b/install_update.sh index 0c87f6a..e225551 100644 --- a/install_update.sh +++ b/install_update.sh @@ -502,26 +502,30 @@ Finalize() { fi } ########### Main Logic ################ -Initialize -# Parse provided arguments +main() { + Initialize + # Parse provided arguments -# Check if the mcsmanager_install_path exists -if [ -d "$mcsmanager_install_path" ]; then - # Backup first - Backup_MCSM - # Install Node.js, this is to ensure the version is up to date. - Install_node - -else - # Install Node.js, this is to ensure the version is up to date. - Install_node -fi + # Check if the mcsmanager_install_path exists + if [ -d "$mcsmanager_install_path" ]; then + # Backup first + Backup_MCSM + # Install Node.js, this is to ensure the version is up to date. + Install_node + + else + # Install Node.js, this is to ensure the version is up to date. + Install_node + fi + + # Install Services based on command + Install_Update -# Install Services based on command -Install_Update + # Print helping Information + Finalize -# Print helping Information -Finalize + echo "Installation Complete!" +} -echo "Installation Complete!" \ No newline at end of file +main \ No newline at end of file From f795bde90048609a26839978a4a028e11abd1987 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 01:12:04 +0800 Subject: [PATCH 158/463] add architecture detection --- install_update.sh | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/install_update.sh b/install_update.sh index e225551..caa7ee8 100644 --- a/install_update.sh +++ b/install_update.sh @@ -1,13 +1,13 @@ #!/bin/bash -#Global arguments +#Global varialbles # System architecture arch=$(uname -m) # Install base dir install_base="/opt" # MCSM install dir mcsmanager_install_path="${install_base}/mcsmanager" -# MCSM backup dir +# MCSM backup dir during upgrade mcsm_backup_dir="${install_base}" # Download URL mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" @@ -150,11 +150,35 @@ Check_and_download_source() { # Clean up the downloaded tar.gz file rm "${mcsm_down_temp}/mcsmanager.tar.gz" +# Detect architecture +Detect_Architecture() { + if [[ "$arch" == x86_64 ]]; then + arch=x64 + #echo "[-] x64 architecture detected" + elif [[ $arch == aarch64 ]]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" + elif [[ $arch == arm ]]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" + elif [[ $arch == ppc64le ]]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" + elif [[ $arch == s390x ]]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" + else + Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" + fi +} # Initialization Initialize() { # Check sudo check_sudo + # Update architecture + Detect_Architecture + # Check if install base (/opt) exist mkdir -p "$install_base" From dfb2ec53ebfd4592c51255b17bae215f722dd07c Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 01:23:19 +0800 Subject: [PATCH 159/463] remove local from variable --- install_update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_update.sh b/install_update.sh index caa7ee8..7000efa 100644 --- a/install_update.sh +++ b/install_update.sh @@ -20,7 +20,7 @@ mcsm_web="web" # MCSM daemon dir name mcsm_daemon="daemon" # The date variable to be shared across functions -local current_date=$(date +%Y_%m_%d) +current_date=$(date +%Y_%m_%d) # MCSM local temp dir for downloaded source mcsm_down_temp="/opt/mcsmanager_${current_date}" # Service file for MCSCM Web From 6fae21f6416ee085df1805da454add403a81c74a Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 01:28:04 +0800 Subject: [PATCH 160/463] fix unclosed cases --- install_update.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_update.sh b/install_update.sh index 7000efa..e32f754 100644 --- a/install_update.sh +++ b/install_update.sh @@ -455,7 +455,7 @@ Install_Update() { # Exit with an error if COMMAND is unrecognized exit 1 ;; -esac + esac } # Finalize installation Finalize() { @@ -519,6 +519,7 @@ Finalize() { # Exit with an error if COMMAND is unrecognized exit 1 ;; + esac # Check if backup_path is not empty if [[ -n "$backup_path" ]]; then echo "Your MCSM has been updated and/or installed. A complete backup was created at: $backup_path" From d0cabc18c211de54d94e77628a035ea30e294f9e Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 01:30:03 +0800 Subject: [PATCH 161/463] fix unclosed function --- install_update.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/install_update.sh b/install_update.sh index e32f754..11098c6 100644 --- a/install_update.sh +++ b/install_update.sh @@ -149,7 +149,7 @@ Check_and_download_source() { # Clean up the downloaded tar.gz file rm "${mcsm_down_temp}/mcsmanager.tar.gz" - +} # Detect architecture Detect_Architecture() { if [[ "$arch" == x86_64 ]]; then @@ -529,9 +529,6 @@ Finalize() { ########### Main Logic ################ main() { Initialize - # Parse provided arguments - - # Check if the mcsmanager_install_path exists if [ -d "$mcsmanager_install_path" ]; then # Backup first From 4f81d40876419c70cc0b491c9453e5f84b8b0ac8 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 01:41:03 +0800 Subject: [PATCH 162/463] use red error instaed of return 1 --- install_update.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/install_update.sh b/install_update.sh index 11098c6..91dcb6b 100644 --- a/install_update.sh +++ b/install_update.sh @@ -115,6 +115,9 @@ Install_node() { if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then echo_green "Success" else + echo "${node_install_path}/bin/node" + $("$node_install_path"/bin/node -v) + Red_Error "[x] Node installation failed!" fi @@ -136,15 +139,13 @@ Check_and_download_source() { # Download the archive directly into the temporary directory wget -O "${mcsm_down_temp}/mcsmanager.tar.gz" "$mcsmanager_download_addr" if [ $? -ne 0 ]; then - echo "Download failed." - return 1 # Exit if download fails + Red_Error "MCSManager Download failed." fi # Extract the archive without changing directories tar -xzf "${mcsm_down_temp}/mcsmanager.tar.gz" -C "$mcsm_down_temp" --strip-components=1 if [ $? -ne 0 ]; then - echo "Extraction failed." - return 1 # Exit if extraction fails + Red_Error "Extraction failed." fi # Clean up the downloaded tar.gz file @@ -152,8 +153,10 @@ Check_and_download_source() { } # Detect architecture Detect_Architecture() { - if [[ "$arch" == x86_64 ]]; then + echo "Detected" + if [[ $arch == x86_64 ]]; then arch=x64 + echo "Detected x64" #echo "[-] x64 architecture detected" elif [[ $arch == aarch64 ]]; then arch=arm64 @@ -206,14 +209,12 @@ Initialize() { Backup_MCSM() { # Ensure both directories are provided if [ -z "$mcsmanager_install_path" ] || [ -z "$mcsm_backup_dir" ]; then - echo "Error: Backup or source path not set." - return 1 # Return with error + Red_Error "Error: Backup or source path not set." fi # Check if the source directory exists if [ ! -d "$mcsmanager_install_path" ]; then - echo "Error: Source directory does not exist." - return 1 # Return with error + Red_Error "Error: Source directory does not exist." fi # Create backup directory (/opt) if it doesn't exist @@ -233,8 +234,7 @@ Backup_MCSM() { if [ $? -eq 0 ]; then echo "Backup created successfully at $backup_path" else - echo "Error creating backup." - return 1 # Return with error + Red_Error "Error creating backup." fi } # MCSM Web Base Installation From 61b9e055095bd9c4c58a49847e9f8278f7624e5e Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 01:47:02 +0800 Subject: [PATCH 163/463] fix typo for original variable name --- install_update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_update.sh b/install_update.sh index 91dcb6b..908d170 100644 --- a/install_update.sh +++ b/install_update.sh @@ -10,7 +10,7 @@ mcsmanager_install_path="${install_base}/mcsmanager" # MCSM backup dir during upgrade mcsm_backup_dir="${install_base}" # Download URL -mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +mcsmanager_download_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" # Node.js version to install node="v20.12.2" # Node.js install dir From 88ff6f43d7949e82f5c4ec4199685609190335a4 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 02:00:59 +0800 Subject: [PATCH 164/463] automatically get package name from URL & bug fix --- install_update.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/install_update.sh b/install_update.sh index 908d170..514d6fb 100644 --- a/install_update.sh +++ b/install_update.sh @@ -32,6 +32,8 @@ USER="mcsm" COMMAND="all" # Created backup absolute path backup_path="" +# Downloaded package name +package_name="${mcsmanager_download_addr##*/}" # Helper Functions usage() { @@ -143,7 +145,7 @@ Check_and_download_source() { fi # Extract the archive without changing directories - tar -xzf "${mcsm_down_temp}/mcsmanager.tar.gz" -C "$mcsm_down_temp" --strip-components=1 + tar -xzf "${mcsm_down_temp}/${package_name}" -C "$mcsm_down_temp" --strip-components=1 if [ $? -ne 0 ]; then Red_Error "Extraction failed." fi @@ -154,25 +156,27 @@ Check_and_download_source() { # Detect architecture Detect_Architecture() { echo "Detected" + echo "$arch" if [[ $arch == x86_64 ]]; then - arch=x64 + arch="x64" echo "Detected x64" #echo "[-] x64 architecture detected" elif [[ $arch == aarch64 ]]; then - arch=arm64 + arch="arm64" #echo "[-] 64-bit ARM architecture detected" elif [[ $arch == arm ]]; then - arch=armv7l + arch="armv7l" #echo "[-] 32-bit ARM architecture detected" elif [[ $arch == ppc64le ]]; then - arch=ppc64le + arch="ppc64le" #echo "[-] IBM POWER architecture detected" elif [[ $arch == s390x ]]; then - arch=s390x + arch="s390x" #echo "[-] IBM LinuxONE architecture detected" else Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" fi + echo "$arch" } # Initialization Initialize() { From 6e059d9db9fef8e1db19ecbb7d5d1a3cf6543093 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 02:03:00 +0800 Subject: [PATCH 165/463] fix extraction dir --- install_update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_update.sh b/install_update.sh index 514d6fb..82fbe9a 100644 --- a/install_update.sh +++ b/install_update.sh @@ -145,13 +145,13 @@ Check_and_download_source() { fi # Extract the archive without changing directories - tar -xzf "${mcsm_down_temp}/${package_name}" -C "$mcsm_down_temp" --strip-components=1 + tar -xzf "${mcsm_down_temp}/${package_name}" -C "$mcsm_down_temp" if [ $? -ne 0 ]; then Red_Error "Extraction failed." fi # Clean up the downloaded tar.gz file - rm "${mcsm_down_temp}/mcsmanager.tar.gz" + rm "${mcsm_down_temp}/${package_name}" } # Detect architecture Detect_Architecture() { From d8bb978d5fdc514286e61975daf311e845a3a059 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 02:06:34 +0800 Subject: [PATCH 166/463] include the helper files --- install_update.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install_update.sh b/install_update.sh index 82fbe9a..fafa095 100644 --- a/install_update.sh +++ b/install_update.sh @@ -246,6 +246,8 @@ Backup_MCSM() { Install_MCSM_Web_Base() { # Move downloaded path mv "${mcsm_down_temp}/${mcsm_web}" "$web_path" + # Move helper file(s) + mv "${mcsm_down_temp}/start-web.sh" "${mcsmanager_install_path}/start-web.sh" # Move back the data directory rm -rf "$web_data" mv "${web_data_tmp}" "${web_data}" @@ -333,6 +335,9 @@ Install_Web_Wrapper() { Install_MCSM_Daemon_Base() { # Move downloaded path mv "${mcsm_down_temp}/${mcsm_daemon}" "$daemon_path" + # Move helper file(s) + mv "${mcsm_down_temp}/start-daemon.sh" "${mcsmanager_install_path}/start-daemon.sh" + # Move back the data directory rm -rf "$daemon_data" mv "${web_daemon_tmp}" "${daemon_data}" @@ -529,6 +534,12 @@ Finalize() { echo "Your MCSM has been updated and/or installed. A complete backup was created at: $backup_path" echo "You can manually delete the backup using command: rm ${backup_path}" fi + # Move quickstart.md + mv "${mcsm_down_temp}/quick-start.md" "${mcsmanager_install_path}/quick-start.md" + # Remove the temp folder + rm -rf "${mcsm_down_temp}" + + } ########### Main Logic ################ main() { From 5d7d4d3404fff22c028a2139c020dd980df0c6f0 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 02:17:29 +0800 Subject: [PATCH 167/463] bypassing Node.js install if already --- install_update.sh | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/install_update.sh b/install_update.sh index fafa095..9d2e706 100644 --- a/install_update.sh +++ b/install_update.sh @@ -13,8 +13,6 @@ mcsm_backup_dir="${install_base}" mcsmanager_download_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" # Node.js version to install node="v20.12.2" -# Node.js install dir -node_install_path="${install_base}/node-$node-linux-$arch" # MCSM Web dir name mcsm_web="web" # MCSM daemon dir name @@ -34,6 +32,8 @@ COMMAND="all" backup_path="" # Downloaded package name package_name="${mcsmanager_download_addr##*/}" +# Node.js install dir +node_install_path="" # Helper Functions usage() { @@ -100,28 +100,30 @@ Install_dependencies() { } Install_node() { - echo_cyan_n "[+] Install Node.js environment...\n" + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Desired Node.js is already installed at the target dir, bypassing installation..." + else + echo_cyan_n "[+] Install Node.js environment...\n" - rm -irf "$node_install_path" + rm -irf "$node_install_path" - cd /opt || Red_Error "[x] Failed to enter /opt" + cd /opt || Red_Error "[x] Failed to enter /opt" - rm -rf "node-$node-linux-$arch.tar.gz" + rm -rf "node-$node-linux-$arch.tar.gz" - wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" + tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" - rm -rf "node-$node-linux-$arch.tar.gz" + rm -rf "node-$node-linux-$arch.tar.gz" - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Success" - else - echo "${node_install_path}/bin/node" - $("$node_install_path"/bin/node -v) - - Red_Error "[x] Node installation failed!" + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Success" + else + Red_Error "[x] Node installation failed!" + fi fi + echo echo_yellow "=============== Node.js Version ===============" @@ -129,7 +131,7 @@ Install_node() { echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" echo_yellow "=============== Node.JS Version ===============" echo - + exit 0 sleep 3 } # Check and download MCSM source @@ -139,7 +141,7 @@ Check_and_download_source() { mkdir -p "$mcsm_down_temp" # Download the archive directly into the temporary directory - wget -O "${mcsm_down_temp}/mcsmanager.tar.gz" "$mcsmanager_download_addr" + wget -O "${mcsm_down_temp}/${package_name}" "$mcsmanager_download_addr" if [ $? -ne 0 ]; then Red_Error "MCSManager Download failed." fi @@ -155,11 +157,8 @@ Check_and_download_source() { } # Detect architecture Detect_Architecture() { - echo "Detected" - echo "$arch" if [[ $arch == x86_64 ]]; then arch="x64" - echo "Detected x64" #echo "[-] x64 architecture detected" elif [[ $arch == aarch64 ]]; then arch="arm64" @@ -176,7 +175,8 @@ Detect_Architecture() { else Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" fi - echo "$arch" + + node_install_path="${install_base}/node-$node-linux-$arch" } # Initialization Initialize() { @@ -196,7 +196,7 @@ Initialize() { Install_dependencies # Check and download MCSM source - Check_and_download_source + #Check_and_download_source # Create mcsm user if needed if [[ "$USER" == *"mcsm"* ]]; then From e75bf36340b09659a37824ecd4390ccd10f0364a Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 02:21:33 +0800 Subject: [PATCH 168/463] create backup containing the mcsmanager dir --- install_update.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install_update.sh b/install_update.sh index 9d2e706..897d628 100644 --- a/install_update.sh +++ b/install_update.sh @@ -131,7 +131,6 @@ Install_node() { echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" echo_yellow "=============== Node.JS Version ===============" echo - exit 0 sleep 3 } # Check and download MCSM source @@ -232,7 +231,9 @@ Backup_MCSM() { # Create the backup echo "Creating backup..." - tar -czf "$backup_path" -C "$mcsmanager_install_path" . + #tar -czf "$backup_path" -C "$mcsmanager_install_path" . + tar -czf "$backup_path" -C "$(dirname "$mcsmanager_install_path")" "$(basename "$mcsmanager_install_path")" + # Check if the backup was successful if [ $? -eq 0 ]; then @@ -240,6 +241,7 @@ Backup_MCSM() { else Red_Error "Error creating backup." fi + exit 1 } # MCSM Web Base Installation # Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source From 125a869ebe511989a329351c441ab317aef88b72 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 02:27:50 +0800 Subject: [PATCH 169/463] updating some messages --- install_update.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/install_update.sh b/install_update.sh index 897d628..a5d8142 100644 --- a/install_update.sh +++ b/install_update.sh @@ -195,13 +195,13 @@ Initialize() { Install_dependencies # Check and download MCSM source - #Check_and_download_source + Check_and_download_source # Create mcsm user if needed if [[ "$USER" == *"mcsm"* ]]; then # Create the user 'mcsm' if it doesn't already exist if ! id "mcsm" &>/dev/null; then - useradd mcsm + /usr/sbin/useradd mcsm echo "User 'mcsm' created." else echo "User 'mcsm' already exists." @@ -241,7 +241,6 @@ Backup_MCSM() { else Red_Error "Error creating backup." fi - exit 1 } # MCSM Web Base Installation # Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source @@ -321,9 +320,9 @@ Install_Web_Wrapper() { rm -rf "$web_path" else - echo "The directory '$mcsmanager_install_path' does not exist." + echo_cyan "[+] Install MCSManager Web..." fi - echo_cyan "[+] Install MCSManager Web..." + # Install MCSM Web Install_MCSM_Web_Base From fd4c550df204976f09749118d5b2db137433b331 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 02:31:00 +0800 Subject: [PATCH 170/463] use variables for service files --- install_update.sh | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/install_update.sh b/install_update.sh index a5d8142..aa0554a 100644 --- a/install_update.sh +++ b/install_update.sh @@ -273,23 +273,24 @@ Install_Web_Systemd() { systemctl disable --now mcsm-web # delete existing service - rm -rf /etc/systemd/system/mcsm-web.service + rm -rf "$service_file_web" systemctl daemon-reload # Create the default service file echo "[Unit] - Description=MCSManager-Web - - [Service] - WorkingDirectory=${web_path} - ExecStart=${node_install_path}/bin/node app.js - ExecReload=/bin/kill -s QUIT \$MAINPID - ExecStop=/bin/kill -s QUIT \$MAINPID - Environment=\"PATH=${PATH}\" - - [Install] - WantedBy=multi-user.target - " >/etc/systemd/system/mcsm-web.service +Description=MCSManager-Web + +[Service] +WorkingDirectory=${web_path} +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" >"$service_file_web" + # Add user section if using mcsm user if [[ "$USER" == *"mcsm"* ]]; then # Check if the 'User=mcsm' line already exists in the service file @@ -297,7 +298,7 @@ Install_Web_Systemd() { echo "The service file is configured already." else # Add 'User=mcsm' to the service file - sed -i '/^\[Service\]$/a User=mcsm' "$service_file" + sed -i '/^\[Service\]$/a User=mcsm' "$service_file_web" fi fi # Reload Systemd Service @@ -373,15 +374,16 @@ Install_Daemon_Systemd() { [Install] WantedBy=multi-user.target - " >/etc/systemd/system/mcsm-daemon.service + " >"$service_file_daemon" + # Add user section if using mcsm user if [[ "$USER" == *"mcsm"* ]]; then # Check if the 'User=mcsm' line already exists in the service file - if grep -q "^User=mcsm$" "$service_file"; then + if grep -q "^User=mcsm$" "$service_file_daemon"; then echo "The service file is configured already." else # Add 'User=mcsm' to the service file - sed -i '/^\[Service\]$/a User=mcsm' "$service_file" + sed -i '/^\[Service\]$/a User=mcsm' "$service_file_daemon" fi fi # Reload Systemd Service From c1a6334f4bd542f74c22fb91582fc6a24e1fc17c Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 02:31:46 +0800 Subject: [PATCH 171/463] remove daemon service before adding --- install_update.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install_update.sh b/install_update.sh index aa0554a..ed0747a 100644 --- a/install_update.sh +++ b/install_update.sh @@ -361,6 +361,13 @@ Install_MCSM_Daemon_Base() { # MCSM Daemon Service Installation Install_Daemon_Systemd() { echo_cyan "[+] Creating MCSManager Daemon service..." + # stop and disable existing service + systemctl disable --now mcsm-daemon + + # delete existing service + rm -rf "$service_file_daemon" + systemctl daemon-reload + # Create the default service file echo "[Unit] Description=MCSManager-Daemon From 9d1c2d5f80d129ca58fd3d52f869ce3b49111d43 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 02:39:42 +0800 Subject: [PATCH 172/463] fix daemon install --- install_update.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/install_update.sh b/install_update.sh index ed0747a..7493c61 100644 --- a/install_update.sh +++ b/install_update.sh @@ -294,7 +294,7 @@ WantedBy=multi-user.target # Add user section if using mcsm user if [[ "$USER" == *"mcsm"* ]]; then # Check if the 'User=mcsm' line already exists in the service file - if grep -q "^User=mcsm$" "$service_file"; then + if grep -q "^User=mcsm$" "$service_file_web"; then echo "The service file is configured already." else # Add 'User=mcsm' to the service file @@ -399,9 +399,9 @@ Install_Daemon_Systemd() { } # MCSM Web Update & Installation Install_Daemon_Wrapper() { - web_path="${mcsmanager_install_path}/${mcsm_daemon}" - web_data="${web_daemon}/data" - web_data_tmp="${mcsmanager_install_path}/daemon_data_${current_date}" + daemon_path="${mcsmanager_install_path}/${mcsm_daemon}" + daemon_data="${web_daemon}/data" + daemon_data_tmp="${mcsmanager_install_path}/daemon_data_${current_date}" if [ -d "$daemon_path" ]; then echo_cyan "[+] Updating MCSManager Daemon..." # The backup should be created already, moving the DATA dir to /opt/mcsmanager/daemon_data should be fast and safe. @@ -412,10 +412,9 @@ Install_Daemon_Wrapper() { rm -rf "$daemon_path" else - echo "The directory '$mcsmanager_install_path' does not exist." + echo_cyan "[+] Install MCSManager daemon..." fi - echo_cyan "[+] Install MCSManager daemon..." - + # Install MCSM Web Install_MCSM_Daemon_Base From 13cad79dded61ad6df66f278a709d88fbff5b622 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 02:52:11 +0800 Subject: [PATCH 173/463] fix daemon install --- install_update.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/install_update.sh b/install_update.sh index 7493c61..daff578 100644 --- a/install_update.sh +++ b/install_update.sh @@ -342,7 +342,7 @@ Install_MCSM_Daemon_Base() { # Move back the data directory rm -rf "$daemon_data" - mv "${web_daemon_tmp}" "${daemon_data}" + mv "${daemon_data_tmp}" "${daemon_data}" # Dependencies install cd "${daemon_path}" || Red_Error "[x] Failed to enter ${daemon_path}" # Install dependencies @@ -370,18 +370,18 @@ Install_Daemon_Systemd() { # Create the default service file echo "[Unit] - Description=MCSManager-Daemon - - [Service] - WorkingDirectory=${daemon_path} - ExecStart=${node_install_path}/bin/node app.js - ExecReload=/bin/kill -s QUIT \$MAINPID - ExecStop=/bin/kill -s QUIT \$MAINPID - Environment=\"PATH=${PATH}\" - - [Install] - WantedBy=multi-user.target - " >"$service_file_daemon" +Description=MCSManager-Daemon + +[Service] +WorkingDirectory=${daemon_path} +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" >"$service_file_daemon" # Add user section if using mcsm user if [[ "$USER" == *"mcsm"* ]]; then @@ -400,13 +400,13 @@ Install_Daemon_Systemd() { # MCSM Web Update & Installation Install_Daemon_Wrapper() { daemon_path="${mcsmanager_install_path}/${mcsm_daemon}" - daemon_data="${web_daemon}/data" + daemon_data="${daemon_path}/data" daemon_data_tmp="${mcsmanager_install_path}/daemon_data_${current_date}" if [ -d "$daemon_path" ]; then echo_cyan "[+] Updating MCSManager Daemon..." # The backup should be created already, moving the DATA dir to /opt/mcsmanager/daemon_data should be fast and safe. # Use daemon_data, do not use data as in rare circumstance user may run both update at the same time. - # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) + # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) mv "$daemon_data" "$daemon_data_tmp" # Remove the old daemon dir rm -rf "$daemon_path" From d76090511978029011f66fa70ff06931b089065d Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 03:02:40 +0800 Subject: [PATCH 174/463] optimize some display --- install_update.sh | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/install_update.sh b/install_update.sh index daff578..46903f1 100644 --- a/install_update.sh +++ b/install_update.sh @@ -26,8 +26,8 @@ service_file_web="/etc/systemd/system/mcsm-web.service" # Service file for MCSM daemon service_file_daemon="/etc/systemd/system/mcsm-daemon.service" # Default systemd user is 'mcsm' -USER="mcsm" -COMMAND="all" +USER="" +COMMAND="" # Created backup absolute path backup_path="" # Downloaded package name @@ -197,6 +197,12 @@ Initialize() { # Check and download MCSM source Check_and_download_source + # Parse input arguments + Parse_Arguments + + echo "$USER" + echo "$COMMAND" + exit 1 # Create mcsm user if needed if [[ "$USER" == *"mcsm"* ]]; then # Create the user 'mcsm' if it doesn't already exist @@ -427,7 +433,7 @@ Parse_Arguments() { case ${opt} in u ) if [[ "${OPTARG}" == "mcsm" || "${OPTARG}" == "root" ]]; then - user="${OPTARG}" + USER="${OPTARG}" else echo "Invalid user specified." usage @@ -435,7 +441,7 @@ Parse_Arguments() { ;; c ) if [[ "${OPTARG}" == "web" || "${OPTARG}" == "daemon" || "${OPTARG}" == "all" ]]; then - command="${OPTARG}" + COMMAND="${OPTARG}" else echo "Invalid command specified." usage @@ -477,11 +483,13 @@ Install_Update() { } # Finalize installation Finalize() { + #Clear screen + #clear printf "\n\n\n\n" case "$COMMAND" in all) echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_green "Installation is complete! Welcome to the MCSManager V10!!!" echo_yellow " " echo_cyan_n "HTTP Web Service: " echo_yellow "http://:23333 (Browser)" @@ -500,7 +508,7 @@ Finalize() { web) echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_green "Installation is complete! Welcome to the MCSManager V10!!!" echo_yellow " " echo_cyan_n "HTTP Web Service: " echo_yellow "http://:23333 (Browser)" @@ -517,7 +525,7 @@ Finalize() { daemon) echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_green "Installation is complete! Welcome to the MCSManager V10!!!" echo_yellow " " echo_cyan_n "Daemon Address: " echo_yellow "ws://:24444 (Cluster)" @@ -540,8 +548,11 @@ Finalize() { esac # Check if backup_path is not empty if [[ -n "$backup_path" ]]; then - echo "Your MCSM has been updated and/or installed. A complete backup was created at: $backup_path" - echo "You can manually delete the backup using command: rm ${backup_path}" + echo_green "Your MCSM has been updated from a previous installation. " + echo_green "A complete backup was created at:" + echo_yellow "$backup_path" + echo_green "You can manually delete the backup using command: " + echo_red "rm ${backup_path}" fi # Move quickstart.md mv "${mcsm_down_temp}/quick-start.md" "${mcsmanager_install_path}/quick-start.md" From e0533886f07dcc74df2f3d877fd641f0a8512050 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 03:10:28 +0800 Subject: [PATCH 175/463] fix user selection and components selection --- install_update.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install_update.sh b/install_update.sh index 46903f1..086a44c 100644 --- a/install_update.sh +++ b/install_update.sh @@ -26,8 +26,8 @@ service_file_web="/etc/systemd/system/mcsm-web.service" # Service file for MCSM daemon service_file_daemon="/etc/systemd/system/mcsm-daemon.service" # Default systemd user is 'mcsm' -USER="" -COMMAND="" +USER="mcsm" +COMMAND="all" # Created backup absolute path backup_path="" # Downloaded package name @@ -198,11 +198,11 @@ Initialize() { Check_and_download_source # Parse input arguments - Parse_Arguments + Parse_Arguments "$@" echo "$USER" echo "$COMMAND" - exit 1 + # Create mcsm user if needed if [[ "$USER" == *"mcsm"* ]]; then # Create the user 'mcsm' if it doesn't already exist @@ -563,7 +563,7 @@ Finalize() { } ########### Main Logic ################ main() { - Initialize + Initialize "$@" # Check if the mcsmanager_install_path exists if [ -d "$mcsmanager_install_path" ]; then # Backup first @@ -585,4 +585,4 @@ main() { echo "Installation Complete!" } -main \ No newline at end of file +main "$@" \ No newline at end of file From 053dd193fd3ff0968fb30c8dbf6501bcf589184b Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 03:11:31 +0800 Subject: [PATCH 176/463] remove debugging info --- install_update.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/install_update.sh b/install_update.sh index 086a44c..8102736 100644 --- a/install_update.sh +++ b/install_update.sh @@ -199,9 +199,6 @@ Initialize() { # Parse input arguments Parse_Arguments "$@" - - echo "$USER" - echo "$COMMAND" # Create mcsm user if needed if [[ "$USER" == *"mcsm"* ]]; then From 065cd8be4efaf58b8fcbb7b167b987bf9f5b0f38 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 03:22:53 +0800 Subject: [PATCH 177/463] suppress mv cmd when not updating --- install_update.sh | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/install_update.sh b/install_update.sh index 8102736..540b418 100644 --- a/install_update.sh +++ b/install_update.sh @@ -188,9 +188,6 @@ Initialize() { # Check if install base (/opt) exist mkdir -p "$install_base" - # Create mcsmanager path if not already - mkdir -p "$mcsmanager_install_path" - # Check dependencies Install_dependencies @@ -249,12 +246,14 @@ Backup_MCSM() { # Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source Install_MCSM_Web_Base() { # Move downloaded path - mv "${mcsm_down_temp}/${mcsm_web}" "$web_path" + mv "${mcsm_down_temp}/${mcsm_web}" "$web_path" || # Move helper file(s) mv "${mcsm_down_temp}/start-web.sh" "${mcsmanager_install_path}/start-web.sh" - # Move back the data directory - rm -rf "$web_data" - mv "${web_data_tmp}" "${web_data}" + # Move back the data directory only if existed + if [ -d "$web_data_tmp" ]; then + rm -rf "$web_data" + mv "${web_data_tmp}" "${web_data}" + fi # Dependencies install cd "${web_path}" || Red_Error "[x] Failed to enter ${web_path}" # Install dependencies @@ -339,13 +338,15 @@ Install_Web_Wrapper() { # Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source Install_MCSM_Daemon_Base() { # Move downloaded path - mv "${mcsm_down_temp}/${mcsm_daemon}" "$daemon_path" - # Move helper file(s) + mv "${mcsm_down_temp}/${mcsm_daemon}" "$daemon_path" || + # Move helper file(s) mv "${mcsm_down_temp}/start-daemon.sh" "${mcsmanager_install_path}/start-daemon.sh" - # Move back the data directory - rm -rf "$daemon_data" - mv "${daemon_data_tmp}" "${daemon_data}" + # Move back the data directory only if existed + if [ -d "$daemon_data_tmp" ]; then + rm -rf "$daemon_data" + mv "${daemon_data_tmp}" "${daemon_data}" + fi # Dependencies install cd "${daemon_path}" || Red_Error "[x] Failed to enter ${daemon_path}" # Install dependencies @@ -560,6 +561,7 @@ Finalize() { } ########### Main Logic ################ main() { + # Do not create mcsmanager path yet as it will break the logic detecting existing installation Initialize "$@" # Check if the mcsmanager_install_path exists if [ -d "$mcsmanager_install_path" ]; then @@ -569,6 +571,8 @@ main() { Install_node else + # Create mcsmanager path if not already + mkdir -p "$mcsmanager_install_path" # Install Node.js, this is to ensure the version is up to date. Install_node fi From 55c511b9c82353c47d980194128eda246b2a17a4 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 03:36:25 +0800 Subject: [PATCH 178/463] optimize display --- install_update.sh | 12 ++++++------ setup.sh | 8 ++++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/install_update.sh b/install_update.sh index 540b418..20997cd 100644 --- a/install_update.sh +++ b/install_update.sh @@ -140,7 +140,7 @@ Check_and_download_source() { mkdir -p "$mcsm_down_temp" # Download the archive directly into the temporary directory - wget -O "${mcsm_down_temp}/${package_name}" "$mcsmanager_download_addr" + wget -O "${mcsm_down_temp}/${package_name}" "$mcsmanager_download_addr" || Red_Error "[x] Failed to download MCSManager releases..." if [ $? -ne 0 ]; then Red_Error "MCSManager Download failed." fi @@ -202,9 +202,9 @@ Initialize() { # Create the user 'mcsm' if it doesn't already exist if ! id "mcsm" &>/dev/null; then /usr/sbin/useradd mcsm - echo "User 'mcsm' created." + echo_green "User 'mcsm' created." else - echo "User 'mcsm' already exists." + echo_yellow "User 'mcsm' already exists." fi fi } @@ -222,7 +222,7 @@ Backup_MCSM() { # Create backup directory (/opt) if it doesn't exist if [ ! -d "$mcsm_backup_dir" ]; then - echo "Creating backup directory." + echo_yellow "Creating backup directory." mkdir -p "$mcsm_backup_dir" fi @@ -230,14 +230,14 @@ Backup_MCSM() { backup_path="${mcsm_backup_dir}/mcsm_backup_${current_date}.tar.gz" # Create the backup - echo "Creating backup..." + echo_yellow "Creating backup..." #tar -czf "$backup_path" -C "$mcsmanager_install_path" . tar -czf "$backup_path" -C "$(dirname "$mcsmanager_install_path")" "$(basename "$mcsmanager_install_path")" # Check if the backup was successful if [ $? -eq 0 ]; then - echo "Backup created successfully at $backup_path" + echo_green "Successfully created backup at $backup_path" else Red_Error "Error creating backup." fi diff --git a/setup.sh b/setup.sh index 0f6eeff..308c3a3 100644 --- a/setup.sh +++ b/setup.sh @@ -19,7 +19,7 @@ echo_cyan() { echo_red() { printf '\033[1;31m%b\033[0m\n' "$@" } - +vv echo_green() { printf '\033[1;32m%b\033[0m\n' "$@" } @@ -167,7 +167,11 @@ WantedBy=multi-user.target echo_yellow "http://:23333 (Browser)" echo_cyan_n "Daemon Address: " echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_red "You must expose ports " + echo_yellow "23333" + echo_red " and " + echo_yellow "24444" + echo_red " to use the service properly on the Internet." echo_yellow " " echo_cyan "Usage:" echo_cyan "systemctl start mcsm-{daemon,web}.service" From f4cb8c155facacfaedac8484e6d8f0450ab9565c Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 03:37:00 +0800 Subject: [PATCH 179/463] reduce sleep time --- install_update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_update.sh b/install_update.sh index 20997cd..b8c5e11 100644 --- a/install_update.sh +++ b/install_update.sh @@ -131,7 +131,7 @@ Install_node() { echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" echo_yellow "=============== Node.JS Version ===============" echo - sleep 3 + sleep 1 } # Check and download MCSM source Check_and_download_source() { From 13e9eff69637750f2c8ed00597a620d1aaf54150 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 03:43:46 +0800 Subject: [PATCH 180/463] add ASCII art --- install_update.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/install_update.sh b/install_update.sh index b8c5e11..ad347f5 100644 --- a/install_update.sh +++ b/install_update.sh @@ -482,8 +482,15 @@ Install_Update() { # Finalize installation Finalize() { #Clear screen - #clear - printf "\n\n\n\n" + clear + #printf "\n\n\n\n" + echo "______ _______________________ ___" + echo "___ |/ /_ ____/_ ___/__ |/ /_____ _____________ _______ _____________" + echo "__ /|_/ /_ / _____ \__ /|_/ /_ __ \`/_ __ \ __ \`/_ __ \`/ _ \_ ___/" + echo "_ / / / / /___ ____/ /_ / / / / /_/ /_ / / / /_/ /_ /_/ // __/ /" + echo "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" + echo " /____/" + case "$COMMAND" in all) echo_yellow "==================================================================" From 9c113d06542747b649fed0fef90997410d86175f Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 03:44:34 +0800 Subject: [PATCH 181/463] add initial CN implementation --- install_update_cn.sh | 596 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 596 insertions(+) create mode 100644 install_update_cn.sh diff --git a/install_update_cn.sh b/install_update_cn.sh new file mode 100644 index 0000000..ad347f5 --- /dev/null +++ b/install_update_cn.sh @@ -0,0 +1,596 @@ +#!/bin/bash + +#Global varialbles +# System architecture +arch=$(uname -m) +# Install base dir +install_base="/opt" +# MCSM install dir +mcsmanager_install_path="${install_base}/mcsmanager" +# MCSM backup dir during upgrade +mcsm_backup_dir="${install_base}" +# Download URL +mcsmanager_download_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +# Node.js version to install +node="v20.12.2" +# MCSM Web dir name +mcsm_web="web" +# MCSM daemon dir name +mcsm_daemon="daemon" +# The date variable to be shared across functions +current_date=$(date +%Y_%m_%d) +# MCSM local temp dir for downloaded source +mcsm_down_temp="/opt/mcsmanager_${current_date}" +# Service file for MCSCM Web +service_file_web="/etc/systemd/system/mcsm-web.service" +# Service file for MCSM daemon +service_file_daemon="/etc/systemd/system/mcsm-daemon.service" +# Default systemd user is 'mcsm' +USER="mcsm" +COMMAND="all" +# Created backup absolute path +backup_path="" +# Downloaded package name +package_name="${mcsmanager_download_addr##*/}" +# Node.js install dir +node_install_path="" + +# Helper Functions +usage() { + echo "Usage: $0 [-u user] [-c command]" + echo " -u Specify the user (mcsm or root), default is 'mcsm'" + echo " -c Specify the command (web, daemon, or all), default is 'all'" + exit 1 +} +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} + +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} + +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} + +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +# Check root permission +check_sudo() { + if [ "$EUID" -ne 0 ]; then + echo "This script must be run as root. Please use \"sudo or root user\" instead." + exit 1 + fi +} + +Install_dependencies() { + # Install related software + echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " + if [[ -x "$(command -v yum)" ]]; then + yum install -y git tar wget + elif [[ -x "$(command -v apt-get)" ]]; then + apt-get install -y git tar wget + elif [[ -x "$(command -v pacman)" ]]; then + pacman -S --noconfirm git tar wget + elif [[ -x "$(command -v zypper)" ]]; then + zypper --non-interactive install git tar wget + else + echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" + fi + + # Determine whether the relevant software is installed successfully + if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then + echo_green "Success" + else + Red_Error "[x] Failed to find git, tar and wget, please install them manually!" + fi + +} + +Install_node() { + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Desired Node.js is already installed at the target dir, bypassing installation..." + else + echo_cyan_n "[+] Install Node.js environment...\n" + + rm -irf "$node_install_path" + + cd /opt || Red_Error "[x] Failed to enter /opt" + + rm -rf "node-$node-linux-$arch.tar.gz" + + wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + + tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" + + rm -rf "node-$node-linux-$arch.tar.gz" + + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Success" + else + Red_Error "[x] Node installation failed!" + fi + fi + + + echo + echo_yellow "=============== Node.js Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node.JS Version ===============" + echo + sleep 1 +} +# Check and download MCSM source +Check_and_download_source() { + # Empty the temp dir if existed + rm -rf "$mcsm_down_temp" + mkdir -p "$mcsm_down_temp" + + # Download the archive directly into the temporary directory + wget -O "${mcsm_down_temp}/${package_name}" "$mcsmanager_download_addr" || Red_Error "[x] Failed to download MCSManager releases..." + if [ $? -ne 0 ]; then + Red_Error "MCSManager Download failed." + fi + + # Extract the archive without changing directories + tar -xzf "${mcsm_down_temp}/${package_name}" -C "$mcsm_down_temp" + if [ $? -ne 0 ]; then + Red_Error "Extraction failed." + fi + + # Clean up the downloaded tar.gz file + rm "${mcsm_down_temp}/${package_name}" +} +# Detect architecture +Detect_Architecture() { + if [[ $arch == x86_64 ]]; then + arch="x64" + #echo "[-] x64 architecture detected" + elif [[ $arch == aarch64 ]]; then + arch="arm64" + #echo "[-] 64-bit ARM architecture detected" + elif [[ $arch == arm ]]; then + arch="armv7l" + #echo "[-] 32-bit ARM architecture detected" + elif [[ $arch == ppc64le ]]; then + arch="ppc64le" + #echo "[-] IBM POWER architecture detected" + elif [[ $arch == s390x ]]; then + arch="s390x" + #echo "[-] IBM LinuxONE architecture detected" + else + Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" + fi + + node_install_path="${install_base}/node-$node-linux-$arch" +} +# Initialization +Initialize() { + # Check sudo + check_sudo + + # Update architecture + Detect_Architecture + + # Check if install base (/opt) exist + mkdir -p "$install_base" + + # Check dependencies + Install_dependencies + + # Check and download MCSM source + Check_and_download_source + + # Parse input arguments + Parse_Arguments "$@" + + # Create mcsm user if needed + if [[ "$USER" == *"mcsm"* ]]; then + # Create the user 'mcsm' if it doesn't already exist + if ! id "mcsm" &>/dev/null; then + /usr/sbin/useradd mcsm + echo_green "User 'mcsm' created." + else + echo_yellow "User 'mcsm' already exists." + fi + fi +} + +Backup_MCSM() { + # Ensure both directories are provided + if [ -z "$mcsmanager_install_path" ] || [ -z "$mcsm_backup_dir" ]; then + Red_Error "Error: Backup or source path not set." + fi + + # Check if the source directory exists + if [ ! -d "$mcsmanager_install_path" ]; then + Red_Error "Error: Source directory does not exist." + fi + + # Create backup directory (/opt) if it doesn't exist + if [ ! -d "$mcsm_backup_dir" ]; then + echo_yellow "Creating backup directory." + mkdir -p "$mcsm_backup_dir" + fi + + # Define the backup path + backup_path="${mcsm_backup_dir}/mcsm_backup_${current_date}.tar.gz" + + # Create the backup + echo_yellow "Creating backup..." + #tar -czf "$backup_path" -C "$mcsmanager_install_path" . + tar -czf "$backup_path" -C "$(dirname "$mcsmanager_install_path")" "$(basename "$mcsmanager_install_path")" + + + # Check if the backup was successful + if [ $? -eq 0 ]; then + echo_green "Successfully created backup at $backup_path" + else + Red_Error "Error creating backup." + fi +} +# MCSM Web Base Installation +# Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source +Install_MCSM_Web_Base() { + # Move downloaded path + mv "${mcsm_down_temp}/${mcsm_web}" "$web_path" || + # Move helper file(s) + mv "${mcsm_down_temp}/start-web.sh" "${mcsmanager_install_path}/start-web.sh" + # Move back the data directory only if existed + if [ -d "$web_data_tmp" ]; then + rm -rf "$web_data" + mv "${web_data_tmp}" "${web_data}" + fi + # Dependencies install + cd "${web_path}" || Red_Error "[x] Failed to enter ${web_path}" + # Install dependencies + echo_cyan "[+] Install MCSManager-Web dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${web_path}" + # Return to general dir + cd "$mcsmanager_install_path" + # Configure ownership if needed + if [[ "$USER" == *"mcsm"* ]]; then + # Change file permission to mcsm user + chown -R mcsm:mcsm "$web_path" + fi + chmod -R 755 "$web_path" +} +# MCSM Web Service Installation +Install_Web_Systemd() { + echo_cyan "[+] Creating MCSManager Web service..." + # stop and disable existing service + systemctl disable --now mcsm-web + + # delete existing service + rm -rf "$service_file_web" + systemctl daemon-reload + + # Create the default service file + echo "[Unit] +Description=MCSManager-Web + +[Service] +WorkingDirectory=${web_path} +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" >"$service_file_web" + + # Add user section if using mcsm user + if [[ "$USER" == *"mcsm"* ]]; then + # Check if the 'User=mcsm' line already exists in the service file + if grep -q "^User=mcsm$" "$service_file_web"; then + echo "The service file is configured already." + else + # Add 'User=mcsm' to the service file + sed -i '/^\[Service\]$/a User=mcsm' "$service_file_web" + fi + fi + # Reload Systemd Service + systemctl daemon-reload + systemctl enable --now mcsm-web +} + +# MCSM Web Update & Installation +Install_Web_Wrapper() { + web_path="${mcsmanager_install_path}/${mcsm_web}" + web_data="${web_path}/data" + web_data_tmp="${mcsmanager_install_path}/web_data_${current_date}" + if [ -d "$web_path" ]; then + echo_cyan "[+] Updating MCSManager Web..." + # The backup should be created already, moving the DATA dir to /opt/mcsmanager/web_data should be fast and safe. + # Use web_data, do not use data as in rare circumstance user may run both update at the same time. + # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) + mv "$web_data" "$web_data_tmp" + # Remove the old web dir + rm -rf "$web_path" + + else + echo_cyan "[+] Install MCSManager Web..." + fi + + + # Install MCSM Web + Install_MCSM_Web_Base + + # Install MCSM Web Service + Install_Web_Systemd +} + +# MCSM Daemon Base Installation +# Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source +Install_MCSM_Daemon_Base() { + # Move downloaded path + mv "${mcsm_down_temp}/${mcsm_daemon}" "$daemon_path" || + # Move helper file(s) + mv "${mcsm_down_temp}/start-daemon.sh" "${mcsmanager_install_path}/start-daemon.sh" + + # Move back the data directory only if existed + if [ -d "$daemon_data_tmp" ]; then + rm -rf "$daemon_data" + mv "${daemon_data_tmp}" "${daemon_data}" + fi + # Dependencies install + cd "${daemon_path}" || Red_Error "[x] Failed to enter ${daemon_path}" + # Install dependencies + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${daemon_path}" + # Return to general dir + cd "$mcsmanager_install_path" + # Configure ownership if needed + if [[ "$USER" == *"mcsm"* ]]; then + # Change file permission to mcsm user + chown -R mcsm:mcsm "$daemon_path" + fi + chmod -R 755 "$daemon_path" +} + +# MCSM Daemon Service Installation +Install_Daemon_Systemd() { + echo_cyan "[+] Creating MCSManager Daemon service..." + # stop and disable existing service + systemctl disable --now mcsm-daemon + + # delete existing service + rm -rf "$service_file_daemon" + systemctl daemon-reload + + # Create the default service file + echo "[Unit] +Description=MCSManager-Daemon + +[Service] +WorkingDirectory=${daemon_path} +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" >"$service_file_daemon" + + # Add user section if using mcsm user + if [[ "$USER" == *"mcsm"* ]]; then + # Check if the 'User=mcsm' line already exists in the service file + if grep -q "^User=mcsm$" "$service_file_daemon"; then + echo "The service file is configured already." + else + # Add 'User=mcsm' to the service file + sed -i '/^\[Service\]$/a User=mcsm' "$service_file_daemon" + fi + fi + # Reload Systemd Service + systemctl daemon-reload + systemctl enable --now mcsm-daemon +} +# MCSM Web Update & Installation +Install_Daemon_Wrapper() { + daemon_path="${mcsmanager_install_path}/${mcsm_daemon}" + daemon_data="${daemon_path}/data" + daemon_data_tmp="${mcsmanager_install_path}/daemon_data_${current_date}" + if [ -d "$daemon_path" ]; then + echo_cyan "[+] Updating MCSManager Daemon..." + # The backup should be created already, moving the DATA dir to /opt/mcsmanager/daemon_data should be fast and safe. + # Use daemon_data, do not use data as in rare circumstance user may run both update at the same time. + # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) + mv "$daemon_data" "$daemon_data_tmp" + # Remove the old daemon dir + rm -rf "$daemon_path" + + else + echo_cyan "[+] Install MCSManager daemon..." + fi + + # Install MCSM Web + Install_MCSM_Daemon_Base + + # Install MCSM Web Service + Install_Daemon_Systemd +} +# Arguments parsing +Parse_Arguments() { + while getopts "u:c:" opt; do + case ${opt} in + u ) + if [[ "${OPTARG}" == "mcsm" || "${OPTARG}" == "root" ]]; then + USER="${OPTARG}" + else + echo "Invalid user specified." + usage + fi + ;; + c ) + if [[ "${OPTARG}" == "web" || "${OPTARG}" == "daemon" || "${OPTARG}" == "all" ]]; then + COMMAND="${OPTARG}" + else + echo "Invalid command specified." + usage + fi + ;; + \? ) + usage + ;; + : ) + echo "Option -$OPTARG requires an argument." + usage + ;; + esac + done +} + +# Wrapper for installation +Install_Update() { + case "$COMMAND" in + all) + Install_Web_Wrapper + Install_Daemon_Wrapper + ;; + + web) + Install_Web_Wrapper + ;; + + daemon) + Install_Daemon_Wrapper + ;; + + *) + echo "Unknown command: $COMMAND, this should not happen in general :( Please report this bug." + # Exit with an error if COMMAND is unrecognized + exit 1 + ;; + esac +} +# Finalize installation +Finalize() { + #Clear screen + clear + #printf "\n\n\n\n" + echo "______ _______________________ ___" + echo "___ |/ /_ ____/_ ___/__ |/ /_____ _____________ _______ _____________" + echo "__ /|_/ /_ / _____ \__ /|_/ /_ __ \`/_ __ \ __ \`/_ __ \`/ _ \_ ___/" + echo "_ / / / / /___ ____/ /_ / / / / /_/ /_ / / / /_/ /_ /_/ // __/ /" + echo "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" + echo " /____/" + + case "$COMMAND" in + all) + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager V10!!!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" + echo_cyan_n "Daemon Address: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" + ;; + + web) + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager V10!!!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" + echo_red "You must expose port 23333 to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-web.service" + echo_cyan "systemctl stop mcsm-web.service" + echo_cyan "systemctl restart mcsm-web.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" + ;; + + daemon) + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager V10!!!" + echo_yellow " " + echo_cyan_n "Daemon Address: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose port 24444 to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-daemon.service" + echo_cyan "systemctl stop mcsm-daemon.service" + echo_cyan "systemctl restart mcsm-daemon.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" + ;; + + *) + echo "Unknown command: $COMMAND, this should not happen in general :( Please report this bug." + # Exit with an error if COMMAND is unrecognized + exit 1 + ;; + esac + # Check if backup_path is not empty + if [[ -n "$backup_path" ]]; then + echo_green "Your MCSM has been updated from a previous installation. " + echo_green "A complete backup was created at:" + echo_yellow "$backup_path" + echo_green "You can manually delete the backup using command: " + echo_red "rm ${backup_path}" + fi + # Move quickstart.md + mv "${mcsm_down_temp}/quick-start.md" "${mcsmanager_install_path}/quick-start.md" + # Remove the temp folder + rm -rf "${mcsm_down_temp}" + + +} +########### Main Logic ################ +main() { + # Do not create mcsmanager path yet as it will break the logic detecting existing installation + Initialize "$@" + # Check if the mcsmanager_install_path exists + if [ -d "$mcsmanager_install_path" ]; then + # Backup first + Backup_MCSM + # Install Node.js, this is to ensure the version is up to date. + Install_node + + else + # Create mcsmanager path if not already + mkdir -p "$mcsmanager_install_path" + # Install Node.js, this is to ensure the version is up to date. + Install_node + fi + + # Install Services based on command + Install_Update + + # Print helping Information + Finalize + + echo "Installation Complete!" +} + +main "$@" \ No newline at end of file From c754062b681f016f6e5642c94c7a006276a3517f Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 03:50:00 +0800 Subject: [PATCH 182/463] optimizing text styles --- install_update.sh | 7 ++++++- install_update_cn.sh | 12 ++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/install_update.sh b/install_update.sh index ad347f5..3a3e94c 100644 --- a/install_update.sh +++ b/install_update.sh @@ -77,7 +77,7 @@ check_sudo() { Install_dependencies() { # Install related software - echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " + echo_cyan "[+] Installing dependent software (git, tar, wget)... " if [[ -x "$(command -v yum)" ]]; then yum install -y git tar wget elif [[ -x "$(command -v apt-get)" ]]; then @@ -179,6 +179,11 @@ Detect_Architecture() { } # Initialization Initialize() { + echo_cyan "+---------------------------------------------------------------------- +| MCSManager V10 Installation & Upgrading Script ++---------------------------------------------------------------------- + " + # Check sudo check_sudo diff --git a/install_update_cn.sh b/install_update_cn.sh index ad347f5..28d3236 100644 --- a/install_update_cn.sh +++ b/install_update_cn.sh @@ -12,7 +12,7 @@ mcsm_backup_dir="${install_base}" # Download URL mcsmanager_download_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" # Node.js version to install -node="v20.12.2" +node="v16.20.2" # MCSM Web dir name mcsm_web="web" # MCSM daemon dir name @@ -77,7 +77,7 @@ check_sudo() { Install_dependencies() { # Install related software - echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " + echo_cyan "[+] Installing dependent software (git, tar, wget)... " if [[ -x "$(command -v yum)" ]]; then yum install -y git tar wget elif [[ -x "$(command -v apt-get)" ]]; then @@ -179,6 +179,10 @@ Detect_Architecture() { } # Initialization Initialize() { + echo_cyan "+---------------------------------------------------------------------- +| MCSManager V10安装升级脚本 ++---------------------------------------------------------------------- + " # Check sudo check_sudo @@ -482,7 +486,7 @@ Install_Update() { # Finalize installation Finalize() { #Clear screen - clear + #clear #printf "\n\n\n\n" echo "______ _______________________ ___" echo "___ |/ /_ ____/_ ___/__ |/ /_____ _____________ _______ _____________" @@ -494,7 +498,7 @@ Finalize() { case "$COMMAND" in all) echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager V10!!!" + echo_green "安装已完成! 欢迎使用 MCSManager V10!!!" echo_yellow " " echo_cyan_n "HTTP Web Service: " echo_yellow "http://:23333 (Browser)" From 008b50239d0d0761e2e2d3c79fefe2f4131e5158 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 03:54:00 +0800 Subject: [PATCH 183/463] add cn translation --- install_update_cn.sh | 64 ++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/install_update_cn.sh b/install_update_cn.sh index 28d3236..794a501 100644 --- a/install_update_cn.sh +++ b/install_update_cn.sh @@ -500,52 +500,52 @@ Finalize() { echo_yellow "==================================================================" echo_green "安装已完成! 欢迎使用 MCSManager V10!!!" echo_yellow " " - echo_cyan_n "HTTP Web Service: " - echo_yellow "http://:23333 (Browser)" - echo_cyan_n "Daemon Address: " - echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_cyan_n "网页 服务: " + echo_yellow "http://<您的 IP>:23333 (Browser)" + echo_cyan_n "节点 地址: " + echo_yellow "ws://<您的 IP>:24444 (Cluster)" + echo_red "您必须开放 23333 与 24444 端口才可以正常从公网访问" echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_cyan "使用方法:" + echo_cyan "启动: systemctl start mcsm-{daemon,web}.service" + echo_cyan "关闭: systemctl stop mcsm-{daemon,web}.service" + echo_cyan "重启: systemctl restart mcsm-{daemon,web}.service" echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" + echo_green "官方文档: https://docs.mcsmanager.com/" echo_yellow "==================================================================" ;; web) echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager V10!!!" + echo_green "安装已完成! 欢迎使用 MCSManager V10!!!" echo_yellow " " - echo_cyan_n "HTTP Web Service: " - echo_yellow "http://:23333 (Browser)" - echo_red "You must expose port 23333 to use the service properly on the Internet." + echo_cyan_n "网页 服务: " + echo_yellow "http://<您的 IP>:23333 (Browser)" + echo_red "您必须开放 23333 端口才可以正常从公网访问" echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-web.service" - echo_cyan "systemctl stop mcsm-web.service" - echo_cyan "systemctl restart mcsm-web.service" + echo_cyan "使用方法:" + echo_cyan "启动: systemctl start mcsm-{daemon,web}.service" + echo_cyan "关闭: systemctl stop mcsm-{daemon,web}.service" + echo_cyan "重启: systemctl restart mcsm-{daemon,web}.service" echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" + echo_green "官方文档: https://docs.mcsmanager.com/" echo_yellow "==================================================================" ;; daemon) echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager V10!!!" + echo_green "安装已完成! 欢迎使用 MCSManager V10!!!" echo_yellow " " - echo_cyan_n "Daemon Address: " - echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose port 24444 to use the service properly on the Internet." + echo_cyan_n "节点 地址: " + echo_yellow "ws://<您的 IP>:24444 (Cluster)" + echo_red "您必须开放 24444 端口才可以正常从公网访问" echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-daemon.service" - echo_cyan "systemctl stop mcsm-daemon.service" - echo_cyan "systemctl restart mcsm-daemon.service" + echo_cyan "使用方法:" + echo_cyan "启动: systemctl start mcsm-{daemon,web}.service" + echo_cyan "关闭: systemctl stop mcsm-{daemon,web}.service" + echo_cyan "重启: systemctl restart mcsm-{daemon,web}.service" echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" + echo_green "官方文档: https://docs.mcsmanager.com/" echo_yellow "==================================================================" ;; @@ -557,10 +557,10 @@ Finalize() { esac # Check if backup_path is not empty if [[ -n "$backup_path" ]]; then - echo_green "Your MCSM has been updated from a previous installation. " - echo_green "A complete backup was created at:" + echo_green "您的MCSManager是从上一个版本升级而来. " + echo_green "我们已经为您创建了一个备份, 位于:" echo_yellow "$backup_path" - echo_green "You can manually delete the backup using command: " + echo_green "如果需要, 您可以使用下列命令手动删除备份: " echo_red "rm ${backup_path}" fi # Move quickstart.md @@ -594,7 +594,7 @@ main() { # Print helping Information Finalize - echo "Installation Complete!" + echo "安装或升级已完成!" } main "$@" \ No newline at end of file From f5bc278b0fc265d68df2ead8957b0e882383e478 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 03:54:33 +0800 Subject: [PATCH 184/463] optimize text style --- install_update.sh | 2 +- install_update_cn.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install_update.sh b/install_update.sh index 3a3e94c..a92cd09 100644 --- a/install_update.sh +++ b/install_update.sh @@ -595,7 +595,7 @@ main() { # Print helping Information Finalize - echo "Installation Complete!" + echo_green "Installation/Upgrading Complete!" } main "$@" \ No newline at end of file diff --git a/install_update_cn.sh b/install_update_cn.sh index 794a501..ff1add3 100644 --- a/install_update_cn.sh +++ b/install_update_cn.sh @@ -594,7 +594,7 @@ main() { # Print helping Information Finalize - echo "安装或升级已完成!" + echo_green "安装或升级已完成!" } main "$@" \ No newline at end of file From 856ac0afa2726b7bff265cd209ab5460531b10ac Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 04:01:25 +0800 Subject: [PATCH 185/463] cn localization --- install_update_cn.sh | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/install_update_cn.sh b/install_update_cn.sh index ff1add3..66ee6e5 100644 --- a/install_update_cn.sh +++ b/install_update_cn.sh @@ -38,8 +38,8 @@ node_install_path="" # Helper Functions usage() { echo "Usage: $0 [-u user] [-c command]" - echo " -u Specify the user (mcsm or root), default is 'mcsm'" - echo " -c Specify the command (web, daemon, or all), default is 'all'" + echo " -u 指定用户安装 (mcsm 或 root), 默认是 'mcsm'" + echo " -c 安装指定组件 (web, daemon, 或 all), 默认是 'all'" exit 1 } Red_Error() { @@ -92,7 +92,7 @@ Install_dependencies() { # Determine whether the relevant software is installed successfully if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "Success" + echo_green "成功!" else Red_Error "[x] Failed to find git, tar and wget, please install them manually!" fi @@ -101,9 +101,9 @@ Install_dependencies() { Install_node() { if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Desired Node.js is already installed at the target dir, bypassing installation..." + echo_green "检测到已安装的Node.js版本, 已为您跳过安装." else - echo_cyan_n "[+] Install Node.js environment...\n" + echo_cyan_n "[+] 安装 Node.js 环境中...\n" rm -irf "$node_install_path" @@ -206,9 +206,9 @@ Initialize() { # Create the user 'mcsm' if it doesn't already exist if ! id "mcsm" &>/dev/null; then /usr/sbin/useradd mcsm - echo_green "User 'mcsm' created." + echo_green "用户 'mcsm' 已创建." else - echo_yellow "User 'mcsm' already exists." + echo_yellow "用户 'mcsm' 已经存在." fi fi } @@ -216,17 +216,17 @@ Initialize() { Backup_MCSM() { # Ensure both directories are provided if [ -z "$mcsmanager_install_path" ] || [ -z "$mcsm_backup_dir" ]; then - Red_Error "Error: Backup or source path not set." + Red_Error "错误: 备份或源路径为空." fi # Check if the source directory exists if [ ! -d "$mcsmanager_install_path" ]; then - Red_Error "Error: Source directory does not exist." + Red_Error "错误: 源目录不存在." fi # Create backup directory (/opt) if it doesn't exist if [ ! -d "$mcsm_backup_dir" ]; then - echo_yellow "Creating backup directory." + echo_yellow "正在创建备份目录..." mkdir -p "$mcsm_backup_dir" fi @@ -234,16 +234,16 @@ Backup_MCSM() { backup_path="${mcsm_backup_dir}/mcsm_backup_${current_date}.tar.gz" # Create the backup - echo_yellow "Creating backup..." + echo_yellow "正在创建备份..." #tar -czf "$backup_path" -C "$mcsmanager_install_path" . tar -czf "$backup_path" -C "$(dirname "$mcsmanager_install_path")" "$(basename "$mcsmanager_install_path")" # Check if the backup was successful if [ $? -eq 0 ]; then - echo_green "Successfully created backup at $backup_path" + echo_green "成功创建了备份,位于: $backup_path" else - Red_Error "Error creating backup." + Red_Error "创建备份时出错" fi } # MCSM Web Base Installation @@ -261,8 +261,8 @@ Install_MCSM_Web_Base() { # Dependencies install cd "${web_path}" || Red_Error "[x] Failed to enter ${web_path}" # Install dependencies - echo_cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${web_path}" + echo_cyan "[+] 安装 MCSManager 网页 依赖中..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] 在 ${web_path} 安装依赖时出错." # Return to general dir cd "$mcsmanager_install_path" # Configure ownership if needed @@ -274,7 +274,7 @@ Install_MCSM_Web_Base() { } # MCSM Web Service Installation Install_Web_Systemd() { - echo_cyan "[+] Creating MCSManager Web service..." + echo_cyan "[+] 创建 MCSManager 网页服务中..." # stop and disable existing service systemctl disable --now mcsm-web @@ -318,7 +318,7 @@ Install_Web_Wrapper() { web_data="${web_path}/data" web_data_tmp="${mcsmanager_install_path}/web_data_${current_date}" if [ -d "$web_path" ]; then - echo_cyan "[+] Updating MCSManager Web..." + echo_cyan "[+] 升级 MCSManager 网页端中..." # The backup should be created already, moving the DATA dir to /opt/mcsmanager/web_data should be fast and safe. # Use web_data, do not use data as in rare circumstance user may run both update at the same time. # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) @@ -327,7 +327,7 @@ Install_Web_Wrapper() { rm -rf "$web_path" else - echo_cyan "[+] Install MCSManager Web..." + echo_cyan "[+] 安装 MCSManager 网页端中..." fi @@ -354,7 +354,7 @@ Install_MCSM_Daemon_Base() { # Dependencies install cd "${daemon_path}" || Red_Error "[x] Failed to enter ${daemon_path}" # Install dependencies - echo_cyan "[+] Install MCSManager-Daemon dependencies..." + echo_cyan "[+] 安装 MCSManager 节点依赖中..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${daemon_path}" # Return to general dir cd "$mcsmanager_install_path" @@ -368,7 +368,7 @@ Install_MCSM_Daemon_Base() { # MCSM Daemon Service Installation Install_Daemon_Systemd() { - echo_cyan "[+] Creating MCSManager Daemon service..." + echo_cyan "[+] 创建 MCSManager 节点服务中..." # stop and disable existing service systemctl disable --now mcsm-daemon @@ -411,7 +411,7 @@ Install_Daemon_Wrapper() { daemon_data="${daemon_path}/data" daemon_data_tmp="${mcsmanager_install_path}/daemon_data_${current_date}" if [ -d "$daemon_path" ]; then - echo_cyan "[+] Updating MCSManager Daemon..." + echo_cyan "[+] 升级 MCSManager 节点中..." # The backup should be created already, moving the DATA dir to /opt/mcsmanager/daemon_data should be fast and safe. # Use daemon_data, do not use data as in rare circumstance user may run both update at the same time. # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) @@ -420,7 +420,7 @@ Install_Daemon_Wrapper() { rm -rf "$daemon_path" else - echo_cyan "[+] Install MCSManager daemon..." + echo_cyan "[+] 安装 MCSManager 节点中..." fi # Install MCSM Web From 36a3f3704b63c08496ba1d92d9ceec7f8a27531e Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 04:02:37 +0800 Subject: [PATCH 186/463] optimize cn text --- install_update_cn.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_update_cn.sh b/install_update_cn.sh index 66ee6e5..73bee7d 100644 --- a/install_update_cn.sh +++ b/install_update_cn.sh @@ -77,7 +77,7 @@ check_sudo() { Install_dependencies() { # Install related software - echo_cyan "[+] Installing dependent software (git, tar, wget)... " + echo_cyan "[+] 正在安装以来软件 (git, tar, wget)... " if [[ -x "$(command -v yum)" ]]; then yum install -y git tar wget elif [[ -x "$(command -v apt-get)" ]]; then @@ -557,7 +557,7 @@ Finalize() { esac # Check if backup_path is not empty if [[ -n "$backup_path" ]]; then - echo_green "您的MCSManager是从上一个版本升级而来. " + echo_green "您的MCSManager是由一个已存在的版本升级而来. " echo_green "我们已经为您创建了一个备份, 位于:" echo_yellow "$backup_path" echo_green "如果需要, 您可以使用下列命令手动删除备份: " From ff9a71e6a23324c34098312960b7c0f449726677 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 04:04:21 +0800 Subject: [PATCH 187/463] optimize cn text --- install_update_cn.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install_update_cn.sh b/install_update_cn.sh index 73bee7d..60e64b6 100644 --- a/install_update_cn.sh +++ b/install_update_cn.sh @@ -77,7 +77,7 @@ check_sudo() { Install_dependencies() { # Install related software - echo_cyan "[+] 正在安装以来软件 (git, tar, wget)... " + echo_cyan "[+] 正在安装依赖软件 (git, tar, wget)... " if [[ -x "$(command -v yum)" ]]; then yum install -y git tar wget elif [[ -x "$(command -v apt-get)" ]]; then @@ -126,10 +126,10 @@ Install_node() { echo - echo_yellow "=============== Node.js Version ===============" + echo_yellow "=============== Node.js 版本 ===============" echo_yellow " node: $("$node_install_path"/bin/node -v)" echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" + echo_yellow "=============== Node.js 版本 ===============" echo sleep 1 } From c3ac0771da79f92d2bd9e7742e0c4a6d6cd4bc3f Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 04:04:39 +0800 Subject: [PATCH 188/463] optimized text --- install_update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_update.sh b/install_update.sh index a92cd09..5ef103e 100644 --- a/install_update.sh +++ b/install_update.sh @@ -129,7 +129,7 @@ Install_node() { echo_yellow "=============== Node.js Version ===============" echo_yellow " node: $("$node_install_path"/bin/node -v)" echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" + echo_yellow "=============== Node.js Version ===============" echo sleep 1 } From b96deae51c0c44b76bfb01a46d51a06b70172e67 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 04:06:18 +0800 Subject: [PATCH 189/463] wipe screen once installed --- install_update_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_update_cn.sh b/install_update_cn.sh index 60e64b6..2b5c4db 100644 --- a/install_update_cn.sh +++ b/install_update_cn.sh @@ -486,7 +486,7 @@ Install_Update() { # Finalize installation Finalize() { #Clear screen - #clear + clear #printf "\n\n\n\n" echo "______ _______________________ ___" echo "___ |/ /_ ____/_ ___/__ |/ /_____ _____________ _______ _____________" From d4f7c77fa27ae7515d2fb818a6084f05bd07c0b5 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 04:19:12 +0800 Subject: [PATCH 190/463] use github link for latest release --- install_update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_update.sh b/install_update.sh index 5ef103e..4bec48a 100644 --- a/install_update.sh +++ b/install_update.sh @@ -10,7 +10,7 @@ mcsmanager_install_path="${install_base}/mcsmanager" # MCSM backup dir during upgrade mcsm_backup_dir="${install_base}" # Download URL -mcsmanager_download_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz " # Node.js version to install node="v20.12.2" # MCSM Web dir name From 3ff580dda564cdd7b798649bbb02b3165dc7092e Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 13:10:14 +0800 Subject: [PATCH 191/463] remove typo --- setup.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.sh b/setup.sh index 308c3a3..1291155 100644 --- a/setup.sh +++ b/setup.sh @@ -19,7 +19,6 @@ echo_cyan() { echo_red() { printf '\033[1;31m%b\033[0m\n' "$@" } -vv echo_green() { printf '\033[1;32m%b\033[0m\n' "$@" } From 87eae296650a25d58d8370d99c2b10a103bc9171 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Mon, 6 May 2024 13:12:24 +0800 Subject: [PATCH 192/463] disable backup --- install_update.sh | 4 ++-- install_update_cn.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install_update.sh b/install_update.sh index 4bec48a..f4f11eb 100644 --- a/install_update.sh +++ b/install_update.sh @@ -577,8 +577,8 @@ main() { Initialize "$@" # Check if the mcsmanager_install_path exists if [ -d "$mcsmanager_install_path" ]; then - # Backup first - Backup_MCSM + # Backup first, due to potential large file being archived, backup is disabled. + # Backup_MCSM # Install Node.js, this is to ensure the version is up to date. Install_node diff --git a/install_update_cn.sh b/install_update_cn.sh index 2b5c4db..a292ece 100644 --- a/install_update_cn.sh +++ b/install_update_cn.sh @@ -576,8 +576,8 @@ main() { Initialize "$@" # Check if the mcsmanager_install_path exists if [ -d "$mcsmanager_install_path" ]; then - # Backup first - Backup_MCSM + # Backup first, due to potential large file being archived, backup is disabled. + # Backup_MCSM # Install Node.js, this is to ensure the version is up to date. Install_node From fbfa9fecd94af7a001df0dc8d5cf9669f05fc25d Mon Sep 17 00:00:00 2001 From: Unitwk Date: Mon, 6 May 2024 14:15:22 +0800 Subject: [PATCH 193/463] Fix: https://github.com/MCSManager/Script/pull/28 --- setup.sh | 6 +++--- setup_cn.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index 0f6eeff..87714b5 100644 --- a/setup.sh +++ b/setup.sh @@ -1,7 +1,7 @@ #!/bin/bash mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +mcsmanager_download_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" package_name="MCSManager-v10-linux.tar.gz" node="v20.12.2" arch=$(uname -m) @@ -91,8 +91,8 @@ Install_MCSManager() { # cd /opt/mcsmanager cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" - # donwload MCSManager release - wget "${mcsmanager_donwload_addr}" || Red_Error "[x] Failed to download MCSManager" + # download MCSManager release + wget "${mcsmanager_download_addr}" || Red_Error "[x] Failed to download MCSManager" tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" diff --git a/setup_cn.sh b/setup_cn.sh index a518aa6..8af40ec 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1,7 +1,7 @@ #!/bin/bash mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_donwload_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +mcsmanager_download_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" package_name="MCSManager-v10-linux.tar.gz" node="v16.20.2" arch=$(uname -m) @@ -91,8 +91,8 @@ Install_MCSManager() { # cd /opt/mcsmanager cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" - # donwload MCSManager release - wget "${mcsmanager_donwload_addr}" || Red_Error "[x] Failed to download MCSManager" + # download MCSManager release + wget "${mcsmanager_download_addr}" || Red_Error "[x] Failed to download MCSManager" tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" From 8738b986b8d406b1882e3316e78cc3d0e1ce7849 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 7 May 2024 11:45:17 +0800 Subject: [PATCH 194/463] Feat: add forge --- templates.json | 120 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 108 insertions(+), 12 deletions(-) diff --git a/templates.json b/templates.json index 7a0fe9f..6c67663 100644 --- a/templates.json +++ b/templates.json @@ -11,6 +11,25 @@ } ], "packages": [ + { + "language": "en_us", + "description": "[Forge] Forge-1.19.2-43.3.13-installer.jar", + "title": "Forge 1.19.2-43.3.13", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.3.13/forge-1.19.2-43.3.13-installer.jar", + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.19.2-43.3.13-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "[Paper] Recommendation for friends with multiple players, Fast setup.", @@ -20,7 +39,14 @@ "size": "140MB", "remark": "Paper Software", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.20.4.zip", - "author": "mcsmanager.com" + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "ie": "utf-8", + "oe": "utf-8" + } }, { "language": "en_us", @@ -31,7 +57,14 @@ "size": "140MB", "remark": "Paper Software", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.19.2.zip", - "author": "mcsmanager.com" + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "ie": "utf-8", + "oe": "utf-8" + } }, { "language": "en_us", @@ -42,7 +75,14 @@ "size": "140MB", "remark": "Paper Software", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.18.2.zip", - "author": "mcsmanager.com" + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "ie": "utf-8", + "oe": "utf-8" + } }, { @@ -56,7 +96,7 @@ "author": "alongw.cn", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -Xmx2048M -jar server.jar -nogui", + "startCommand": "java -jar server.jar -nogui", "stopCommand": "stop", "ie": "utf-8", "oe": "utf-8" @@ -71,7 +111,14 @@ "size": "140MB", "remark": "支持插件,最低 8GB 内存要求", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.19.2.zip", - "author": "mcsmanager.com" + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "ie": "utf-8", + "oe": "utf-8" + } }, { "language": "zh_cn", @@ -82,7 +129,14 @@ "size": "210MB", "remark": "支持插件,最低 8GB 内存要求", "targetLink": "https://url.alww.top/mcsm/paper1.19.2", - "author": "alongw.cn" + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "ie": "utf-8", + "oe": "utf-8" + } }, { "language": "zh_cn", @@ -93,7 +147,14 @@ "size": "100MB", "remark": "支持插件,支持mod(Forge),最低 6GB 内存要求", "targetLink": "https://url.alww.top/mcsm/arclight1.19.2", - "author": "alongw.cn" + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "ie": "utf-8", + "oe": "utf-8" + } }, { "language": "zh_cn", @@ -104,7 +165,14 @@ "size": "230MB", "remark": "支持插件,最低 6GB 内存要求", "targetLink": "https://url.alww.top/mcsm/paper-geyser1.19.2", - "author": "alongw.cn" + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "ie": "utf-8", + "oe": "utf-8" + } }, { "language": "zh_cn", @@ -115,7 +183,14 @@ "size": "140MB", "remark": "支持插件,最低 4GB 内存要求", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.19.1.zip", - "author": "mcsmanager.com" + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "ie": "utf-8", + "oe": "utf-8" + } }, { "language": "zh_cn", @@ -126,7 +201,14 @@ "size": "140MB", "remark": "支持插件,最低 4GB 内存要求", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.19.zip", - "author": "mcsmanager.com" + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "ie": "utf-8", + "oe": "utf-8" + } }, { "language": "zh_cn", @@ -137,7 +219,14 @@ "size": "140MB", "remark": "支持插件,最低 4GB 内存要求", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.18.2.zip", - "author": "mcsmanager.com" + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "ie": "utf-8", + "oe": "utf-8" + } }, { "language": "zh_cn", @@ -148,7 +237,14 @@ "size": "160MB", "remark": "支持插件,最低 4GB 内存要求", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.17.1.zip", - "author": "mcsmanager.com" + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "ie": "utf-8", + "oe": "utf-8" + } } ] } From d9063109f0a8f77be23c7e7742791837e2abb9a0 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 7 May 2024 14:26:02 +0800 Subject: [PATCH 195/463] Feat: add forge pack --- templates.json | 82 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 69 insertions(+), 13 deletions(-) diff --git a/templates.json b/templates.json index 6c67663..55354e4 100644 --- a/templates.json +++ b/templates.json @@ -11,10 +11,29 @@ } ], "packages": [ + { + "language": "en_us", + "description": "[Forge] forge-1.20.6-50.0.8-installer.jar", + "title": "Forge 1.20.6 (Support Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.0.8/forge-1.20.6-50.0.8-installer.jar", + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.20.6-50.0.8-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "[Forge] Forge-1.19.2-43.3.13-installer.jar", - "title": "Forge 1.19.2-43.3.13", + "title": "Forge 1.19.2 (Support Mods)", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", @@ -35,7 +54,7 @@ "description": "[Paper] Recommendation for friends with multiple players, Fast setup.", "title": "Minecraft 1.20.4 Java", "runtime": "Java 17+", - "hardware": "RAM 8G", + "hardware": "RAM 8G+", "size": "140MB", "remark": "Paper Software", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.20.4.zip", @@ -53,7 +72,7 @@ "description": "[Paper] Recommendation for friends with multiple players", "title": "Minecraft 1.19.2 Java", "runtime": "Java 17+", - "hardware": "RAM 8G", + "hardware": "RAM 8G+", "size": "140MB", "remark": "Paper Software", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.19.2.zip", @@ -71,7 +90,7 @@ "description": "[Paper] Recommendation for friends with multiple players", "title": "Minecraft 1.18.2 Java", "runtime": "Java 17+", - "hardware": "RAM 8G", + "hardware": "RAM 8G+", "size": "140MB", "remark": "Paper Software", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.18.2.zip", @@ -84,7 +103,44 @@ "oe": "utf-8" } }, - + { + "language": "zh_cn", + "description": "[Forge] forge-1.20.6-50.0.8-installer.jar,来自官方网站源。", + "title": "Forge 1.20.6 Java 版 (支持模组)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.0.8/forge-1.20.6-50.0.8-installer.jar", + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.20.6-50.0.8-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "zh_cn", + "description": "[Forge] Forge-1.19.2-43.3.13,支持安装 MOD。", + "title": "Forge 1.19.2 Java 版 (支持模组)", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.3.13/forge-1.19.2-43.3.13-installer.jar", + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.19.2-43.3.13-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "zh_cn", "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", @@ -107,7 +163,7 @@ "description": "[原版生存] 朋友联机推荐,1.19.2 版本,快速开服,享受原汁原味的极致生存与探索。", "title": "Minecraft 1.19.2 Java 原版", "runtime": "Java 17+", - "hardware": "RAM 8G", + "hardware": "RAM 8G+", "size": "140MB", "remark": "支持插件,最低 8GB 内存要求", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.19.2.zip", @@ -125,7 +181,7 @@ "description": "[整合包] 小型服务器推荐,包含基础插件、箱子锁、操作回滚、领地和商店等插件。", "title": "Minecraft 1.19.2 Java 版整合包", "runtime": "Java 17+", - "hardware": "RAM 8G", + "hardware": "RAM 8G+", "size": "210MB", "remark": "支持插件,最低 8GB 内存要求", "targetLink": "https://url.alww.top/mcsm/paper1.19.2", @@ -143,7 +199,7 @@ "description": "[Arclight] 小型服务器推荐,1.19.2 版本,可安装mod,互通基岩版,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", "title": "Minecraft 1.19.2", "runtime": "Java 17+", - "hardware": "RAM 8G", + "hardware": "RAM 8G+", "size": "100MB", "remark": "支持插件,支持mod(Forge),最低 6GB 内存要求", "targetLink": "https://url.alww.top/mcsm/arclight1.19.2", @@ -161,7 +217,7 @@ "description": "[整合包/Java&基岩版互通] 小型服务器推荐,互通基岩版,包含基础插件、箱子锁、操作回滚、领地和商店等插件。", "title": "Minecraft 1.19.2 基岩互通版", "runtime": "Java 17+", - "hardware": "RAM 8G", + "hardware": "RAM 8G+", "size": "230MB", "remark": "支持插件,最低 6GB 内存要求", "targetLink": "https://url.alww.top/mcsm/paper-geyser1.19.2", @@ -179,7 +235,7 @@ "description": "[原版生存] 朋友联机推荐,让你和你的小伙伴一起享受原汁原味的极致生存。", "title": "Minecraft 1.19.1 Java 原版", "runtime": "Java 17+", - "hardware": "RAM 8G", + "hardware": "RAM 8G+", "size": "140MB", "remark": "支持插件,最低 4GB 内存要求", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.19.1.zip", @@ -197,7 +253,7 @@ "description": "[原版生存] 适合朋友联机,“荒野更新”(The Wild)旨在为玩家带来现有生物群系的改进和优化。", "title": "Minecraft 1.19 Java 原版", "runtime": "Java 17+", - "hardware": "RAM 8G", + "hardware": "RAM 8G+", "size": "140MB", "remark": "支持插件,最低 4GB 内存要求", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.19.zip", @@ -215,7 +271,7 @@ "description": "[原版生存] 适合朋友联机推荐,继承上版本的功能并进行了一系列的优化,主流联机版本,插件与MOD较为丰富。", "title": "Minecraft 1.18.2 Java 原版", "runtime": "Java 17+", - "hardware": "RAM 8G", + "hardware": "RAM 8G+", "size": "140MB", "remark": "支持插件,最低 4GB 内存要求", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.18.2.zip", @@ -233,7 +289,7 @@ "description": "[原版生存] 适合朋友联机,快速开服,服务器搭建,回味老版本的地穴探索。", "title": "Minecraft 17.1 Java 原版", "runtime": "Java 17+", - "hardware": "RAM 8G", + "hardware": "RAM 8G+", "size": "160MB", "remark": "支持插件,最低 4GB 内存要求", "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.17.1.zip", From 9783e858592af55cc9f02e6e1d9f379f97cbd002 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 7 May 2024 14:51:05 +0800 Subject: [PATCH 196/463] Feat: add forge pack --- templates.json | 91 ++++++++------------------------------------------ 1 file changed, 14 insertions(+), 77 deletions(-) diff --git a/templates.json b/templates.json index 55354e4..bfacc70 100644 --- a/templates.json +++ b/templates.json @@ -13,14 +13,14 @@ "packages": [ { "language": "en_us", - "description": "[Forge] forge-1.20.6-50.0.8-installer.jar", + "description": "Forge-1.20.6-50.0.8-installer.jar", "title": "Forge 1.20.6 (Support Mods)", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.0.8/forge-1.20.6-50.0.8-installer.jar", - "author": "mcsmanager.com", + "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -32,14 +32,14 @@ }, { "language": "en_us", - "description": "[Forge] Forge-1.19.2-43.3.13-installer.jar", + "description": "Forge-1.19.2-43.3.13-installer.jar", "title": "Forge 1.19.2 (Support Mods)", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.3.13/forge-1.19.2-43.3.13-installer.jar", - "author": "mcsmanager.com", + "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -63,6 +63,7 @@ "type": "minecraft/java", "startCommand": "java -jar server.jar -nogui", "stopCommand": "stop", + "updateCommand": "", "ie": "utf-8", "oe": "utf-8" } @@ -81,6 +82,7 @@ "type": "minecraft/java", "startCommand": "java -jar server.jar -nogui", "stopCommand": "stop", + "updateCommand": "", "ie": "utf-8", "oe": "utf-8" } @@ -99,6 +101,7 @@ "type": "minecraft/java", "startCommand": "java -jar server.jar -nogui", "stopCommand": "stop", + "updateCommand": "", "ie": "utf-8", "oe": "utf-8" } @@ -112,7 +115,7 @@ "size": "7MB", "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.0.8/forge-1.20.6-50.0.8-installer.jar", - "author": "mcsmanager.com", + "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -131,7 +134,7 @@ "size": "7MB", "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.3.13/forge-1.19.2-43.3.13-installer.jar", - "author": "mcsmanager.com", + "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -141,23 +144,6 @@ "oe": "utf-8" } }, - { - "language": "zh_cn", - "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", - "title": "Minecraft 1.20.4", - "runtime": "Java 17+", - "size": "140MB", - "remark": "支持插件,最低 8GB 内存要求", - "targetLink": "https://url.alww.top/mcsm/paper1.20.4", - "author": "alongw.cn", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", - "ie": "utf-8", - "oe": "utf-8" - } - }, { "language": "zh_cn", "description": "[原版生存] 朋友联机推荐,1.19.2 版本,快速开服,享受原汁原味的极致生存与探索。", @@ -172,60 +158,7 @@ "type": "minecraft/java", "startCommand": "java -jar server.jar -nogui", "stopCommand": "stop", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "description": "[整合包] 小型服务器推荐,包含基础插件、箱子锁、操作回滚、领地和商店等插件。", - "title": "Minecraft 1.19.2 Java 版整合包", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "210MB", - "remark": "支持插件,最低 8GB 内存要求", - "targetLink": "https://url.alww.top/mcsm/paper1.19.2", - "author": "alongw.cn", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "description": "[Arclight] 小型服务器推荐,1.19.2 版本,可安装mod,互通基岩版,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", - "title": "Minecraft 1.19.2", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "100MB", - "remark": "支持插件,支持mod(Forge),最低 6GB 内存要求", - "targetLink": "https://url.alww.top/mcsm/arclight1.19.2", - "author": "alongw.cn", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "description": "[整合包/Java&基岩版互通] 小型服务器推荐,互通基岩版,包含基础插件、箱子锁、操作回滚、领地和商店等插件。", - "title": "Minecraft 1.19.2 基岩互通版", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "230MB", - "remark": "支持插件,最低 6GB 内存要求", - "targetLink": "https://url.alww.top/mcsm/paper-geyser1.19.2", - "author": "alongw.cn", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", + "updateCommand": "", "ie": "utf-8", "oe": "utf-8" } @@ -244,6 +177,7 @@ "type": "minecraft/java", "startCommand": "java -jar server.jar -nogui", "stopCommand": "stop", + "updateCommand": "", "ie": "utf-8", "oe": "utf-8" } @@ -262,6 +196,7 @@ "type": "minecraft/java", "startCommand": "java -jar server.jar -nogui", "stopCommand": "stop", + "updateCommand": "", "ie": "utf-8", "oe": "utf-8" } @@ -280,6 +215,7 @@ "type": "minecraft/java", "startCommand": "java -jar server.jar -nogui", "stopCommand": "stop", + "updateCommand": "", "ie": "utf-8", "oe": "utf-8" } @@ -298,6 +234,7 @@ "type": "minecraft/java", "startCommand": "java -jar server.jar -nogui", "stopCommand": "stop", + "updateCommand": "", "ie": "utf-8", "oe": "utf-8" } From deecea070efc388377e234ccf30ff8b7c2f8c132 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 7 May 2024 14:59:53 +0800 Subject: [PATCH 197/463] Feat: pack --- templates.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/templates.json b/templates.json index bfacc70..5b74fa9 100644 --- a/templates.json +++ b/templates.json @@ -106,6 +106,25 @@ "oe": "utf-8" } }, + { + "language": "zh_cn", + "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", + "title": "Minecraft 1.20.4", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "140MB", + "remark": "支持插件,最低 8GB 内存要求", + "targetLink": "https://url.alww.top/mcsm/paper1.20.4.zip", + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "zh_cn", "description": "[Forge] forge-1.20.6-50.0.8-installer.jar,来自官方网站源。", From e761f8d3fe5fe6928d7c61915319d9d7400c1b20 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 7 May 2024 15:04:25 +0800 Subject: [PATCH 198/463] Feat: pack --- templates.json | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/templates.json b/templates.json index 5b74fa9..5529dae 100644 --- a/templates.json +++ b/templates.json @@ -11,6 +11,25 @@ } ], "packages": [ + { + "language": "en_us", + "description": "[Paper] Recommendation for friends with multiple players, Fast setup.", + "title": "Minecraft 1.20.4 Java", + "runtime": "Java 17+", + "hardware": "RAM 6G+", + "size": "140MB", + "remark": "Paper Software", + "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.20.4.zip", + "author": "mcsmanager.com", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "Forge-1.20.6-50.0.8-installer.jar", @@ -49,25 +68,6 @@ "oe": "utf-8" } }, - { - "language": "en_us", - "description": "[Paper] Recommendation for friends with multiple players, Fast setup.", - "title": "Minecraft 1.20.4 Java", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "140MB", - "remark": "Paper Software", - "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.20.4.zip", - "author": "mcsmanager.com", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, { "language": "en_us", "description": "[Paper] Recommendation for friends with multiple players", @@ -109,9 +109,9 @@ { "language": "zh_cn", "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", - "title": "Minecraft 1.20.4", + "title": "Minecraft 1.20.4 (低配机器推荐)", "runtime": "Java 17+", - "hardware": "RAM 8G+", + "hardware": "RAM 6G+", "size": "140MB", "remark": "支持插件,最低 8GB 内存要求", "targetLink": "https://url.alww.top/mcsm/paper1.20.4.zip", @@ -127,7 +127,7 @@ }, { "language": "zh_cn", - "description": "[Forge] forge-1.20.6-50.0.8-installer.jar,来自官方网站源。", + "description": "[Forge] forge-1.20.6-50.0.8-installer.jar,来自官方网站源,需要高配机器支撑。", "title": "Forge 1.20.6 Java 版 (支持模组)", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -146,7 +146,7 @@ }, { "language": "zh_cn", - "description": "[Forge] Forge-1.19.2-43.3.13,支持安装 MOD。", + "description": "[Forge] Forge-1.19.2-43.3.13,支持安装 MOD,需要高配机器支撑。", "title": "Forge 1.19.2 Java 版 (支持模组)", "runtime": "Java 17+", "hardware": "RAM 8G+", From 67aa076d532adf3b88aa6c0e67f7a0668192f3a3 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Thu, 9 May 2024 22:13:46 +0800 Subject: [PATCH 199/463] update function signature --- install_update.sh | 190 +++++++++++++++++++++---------------------- install_update_cn.sh | 181 ++++++++++++++++++++--------------------- 2 files changed, 185 insertions(+), 186 deletions(-) diff --git a/install_update.sh b/install_update.sh index f4f11eb..5ffff6f 100644 --- a/install_update.sh +++ b/install_update.sh @@ -36,7 +36,7 @@ package_name="${mcsmanager_download_addr##*/}" node_install_path="" # Helper Functions -usage() { +Usage() { echo "Usage: $0 [-u user] [-c command]" echo " -u Specify the user (mcsm or root), default is 'mcsm'" echo " -c Specify the command (web, daemon, or all), default is 'all'" @@ -48,36 +48,36 @@ Red_Error() { echo '=================================================' exit 1 } -echo_cyan() { +Echo_Cyan() { printf '\033[1;36m%b\033[0m\n' "$@" } -echo_red() { +Echo_Red() { printf '\033[1;31m%b\033[0m\n' "$@" } -echo_green() { +Echo_Green() { printf '\033[1;32m%b\033[0m\n' "$@" } -echo_cyan_n() { +Echo_Cyan_N() { printf '\033[1;36m%b\033[0m' "$@" } -echo_yellow() { +Echo_Yellow() { printf '\033[1;33m%b\033[0m\n' "$@" } # Check root permission -check_sudo() { +Check_Sudo() { if [ "$EUID" -ne 0 ]; then echo "This script must be run as root. Please use \"sudo or root user\" instead." exit 1 fi } -Install_dependencies() { +Install_Dependencies() { # Install related software - echo_cyan "[+] Installing dependent software (git, tar, wget)... " + Echo_Cyan "[+] Installing dependent software (git, tar, wget)... " if [[ -x "$(command -v yum)" ]]; then yum install -y git tar wget elif [[ -x "$(command -v apt-get)" ]]; then @@ -87,23 +87,23 @@ Install_dependencies() { elif [[ -x "$(command -v zypper)" ]]; then zypper --non-interactive install git tar wget else - echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" + Echo_Red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" fi # Determine whether the relevant software is installed successfully if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "Success" + Echo_Green "Success" else Red_Error "[x] Failed to find git, tar and wget, please install them manually!" fi } -Install_node() { +Install_Node() { if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Desired Node.js is already installed at the target dir, bypassing installation..." + Echo_Green "Desired Node.js is already installed at the target dir, bypassing installation..." else - echo_cyan_n "[+] Install Node.js environment...\n" + Echo_Cyan_N "[+] Install Node.js environment...\n" rm -irf "$node_install_path" @@ -118,7 +118,7 @@ Install_node() { rm -rf "node-$node-linux-$arch.tar.gz" if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Success" + Echo_Green "Success" else Red_Error "[x] Node installation failed!" fi @@ -126,15 +126,15 @@ Install_node() { echo - echo_yellow "=============== Node.js Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.js Version ===============" + Echo_Yellow "=============== Node.js Version ===============" + Echo_Yellow " node: $("$node_install_path"/bin/node -v)" + Echo_Yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + Echo_Yellow "=============== Node.js Version ===============" echo sleep 1 } # Check and download MCSM source -Check_and_download_source() { +Check_And_Download_Source() { # Empty the temp dir if existed rm -rf "$mcsm_down_temp" mkdir -p "$mcsm_down_temp" @@ -179,13 +179,13 @@ Detect_Architecture() { } # Initialization Initialize() { - echo_cyan "+---------------------------------------------------------------------- + Echo_Cyan "+---------------------------------------------------------------------- | MCSManager V10 Installation & Upgrading Script +---------------------------------------------------------------------- " # Check sudo - check_sudo + Check_Sudo # Update architecture Detect_Architecture @@ -194,10 +194,10 @@ Initialize() { mkdir -p "$install_base" # Check dependencies - Install_dependencies + Install_Dependencies # Check and download MCSM source - Check_and_download_source + Check_And_Download_Source # Parse input arguments Parse_Arguments "$@" @@ -207,9 +207,9 @@ Initialize() { # Create the user 'mcsm' if it doesn't already exist if ! id "mcsm" &>/dev/null; then /usr/sbin/useradd mcsm - echo_green "User 'mcsm' created." + Echo_Green "User 'mcsm' created." else - echo_yellow "User 'mcsm' already exists." + Echo_Yellow "User 'mcsm' already exists." fi fi } @@ -227,7 +227,7 @@ Backup_MCSM() { # Create backup directory (/opt) if it doesn't exist if [ ! -d "$mcsm_backup_dir" ]; then - echo_yellow "Creating backup directory." + Echo_Yellow "Creating backup directory." mkdir -p "$mcsm_backup_dir" fi @@ -235,14 +235,14 @@ Backup_MCSM() { backup_path="${mcsm_backup_dir}/mcsm_backup_${current_date}.tar.gz" # Create the backup - echo_yellow "Creating backup..." + Echo_Yellow "Creating backup..." #tar -czf "$backup_path" -C "$mcsmanager_install_path" . tar -czf "$backup_path" -C "$(dirname "$mcsmanager_install_path")" "$(basename "$mcsmanager_install_path")" # Check if the backup was successful if [ $? -eq 0 ]; then - echo_green "Successfully created backup at $backup_path" + Echo_Green "Successfully created backup at $backup_path" else Red_Error "Error creating backup." fi @@ -262,7 +262,7 @@ Install_MCSM_Web_Base() { # Dependencies install cd "${web_path}" || Red_Error "[x] Failed to enter ${web_path}" # Install dependencies - echo_cyan "[+] Install MCSManager-Web dependencies..." + Echo_Cyan "[+] Install MCSManager-Web dependencies..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${web_path}" # Return to general dir cd "$mcsmanager_install_path" @@ -275,7 +275,7 @@ Install_MCSM_Web_Base() { } # MCSM Web Service Installation Install_Web_Systemd() { - echo_cyan "[+] Creating MCSManager Web service..." + Echo_Cyan "[+] Creating MCSManager Web service..." # stop and disable existing service systemctl disable --now mcsm-web @@ -319,7 +319,7 @@ Install_Web_Wrapper() { web_data="${web_path}/data" web_data_tmp="${mcsmanager_install_path}/web_data_${current_date}" if [ -d "$web_path" ]; then - echo_cyan "[+] Updating MCSManager Web..." + Echo_Cyan "[+] Updating MCSManager Web..." # The backup should be created already, moving the DATA dir to /opt/mcsmanager/web_data should be fast and safe. # Use web_data, do not use data as in rare circumstance user may run both update at the same time. # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) @@ -328,7 +328,7 @@ Install_Web_Wrapper() { rm -rf "$web_path" else - echo_cyan "[+] Install MCSManager Web..." + Echo_Cyan "[+] Install MCSManager Web..." fi @@ -355,7 +355,7 @@ Install_MCSM_Daemon_Base() { # Dependencies install cd "${daemon_path}" || Red_Error "[x] Failed to enter ${daemon_path}" # Install dependencies - echo_cyan "[+] Install MCSManager-Daemon dependencies..." + Echo_Cyan "[+] Install MCSManager-Daemon dependencies..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${daemon_path}" # Return to general dir cd "$mcsmanager_install_path" @@ -369,7 +369,7 @@ Install_MCSM_Daemon_Base() { # MCSM Daemon Service Installation Install_Daemon_Systemd() { - echo_cyan "[+] Creating MCSManager Daemon service..." + Echo_Cyan "[+] Creating MCSManager Daemon service..." # stop and disable existing service systemctl disable --now mcsm-daemon @@ -412,7 +412,7 @@ Install_Daemon_Wrapper() { daemon_data="${daemon_path}/data" daemon_data_tmp="${mcsmanager_install_path}/daemon_data_${current_date}" if [ -d "$daemon_path" ]; then - echo_cyan "[+] Updating MCSManager Daemon..." + Echo_Cyan "[+] Updating MCSManager Daemon..." # The backup should be created already, moving the DATA dir to /opt/mcsmanager/daemon_data should be fast and safe. # Use daemon_data, do not use data as in rare circumstance user may run both update at the same time. # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) @@ -421,7 +421,7 @@ Install_Daemon_Wrapper() { rm -rf "$daemon_path" else - echo_cyan "[+] Install MCSManager daemon..." + Echo_Cyan "[+] Install MCSManager daemon..." fi # Install MCSM Web @@ -439,7 +439,7 @@ Parse_Arguments() { USER="${OPTARG}" else echo "Invalid user specified." - usage + Usage fi ;; c ) @@ -447,15 +447,15 @@ Parse_Arguments() { COMMAND="${OPTARG}" else echo "Invalid command specified." - usage + Usage fi ;; \? ) - usage + Usage ;; : ) echo "Option -$OPTARG requires an argument." - usage + Usage ;; esac done @@ -498,56 +498,56 @@ Finalize() { case "$COMMAND" in all) - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager V10!!!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: " - echo_yellow "http://:23333 (Browser)" - echo_cyan_n "Daemon Address: " - echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + Echo_Yellow "==================================================================" + Echo_Green "Installation is complete! Welcome to the MCSManager V10!!!" + Echo_Yellow " " + Echo_Cyan_N "HTTP Web Service: " + Echo_Yellow "http://:23333 (Browser)" + Echo_Cyan_N "Daemon Address: " + Echo_Yellow "ws://:24444 (Cluster)" + Echo_Red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + Echo_Yellow " " + Echo_Cyan "Usage:" + Echo_Cyan "systemctl start mcsm-{daemon,web}.service" + Echo_Cyan "systemctl stop mcsm-{daemon,web}.service" + Echo_Cyan "systemctl restart mcsm-{daemon,web}.service" + Echo_Yellow " " + Echo_Green "Official Document: https://docs.mcsmanager.com/" + Echo_Yellow "==================================================================" ;; web) - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager V10!!!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: " - echo_yellow "http://:23333 (Browser)" - echo_red "You must expose port 23333 to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-web.service" - echo_cyan "systemctl stop mcsm-web.service" - echo_cyan "systemctl restart mcsm-web.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + Echo_Yellow "==================================================================" + Echo_Green "Installation is complete! Welcome to the MCSManager V10!!!" + Echo_Yellow " " + Echo_Cyan_N "HTTP Web Service: " + Echo_Yellow "http://:23333 (Browser)" + Echo_Red "You must expose port 23333 to use the service properly on the Internet." + Echo_Yellow " " + Echo_Cyan "Usage:" + Echo_Cyan "systemctl start mcsm-web.service" + Echo_Cyan "systemctl stop mcsm-web.service" + Echo_Cyan "systemctl restart mcsm-web.service" + Echo_Yellow " " + Echo_Green "Official Document: https://docs.mcsmanager.com/" + Echo_Yellow "==================================================================" ;; daemon) - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager V10!!!" - echo_yellow " " - echo_cyan_n "Daemon Address: " - echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose port 24444 to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-daemon.service" - echo_cyan "systemctl stop mcsm-daemon.service" - echo_cyan "systemctl restart mcsm-daemon.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + Echo_Yellow "==================================================================" + Echo_Green "Installation is complete! Welcome to the MCSManager V10!!!" + Echo_Yellow " " + Echo_Cyan_N "Daemon Address: " + Echo_Yellow "ws://:24444 (Cluster)" + Echo_Red "You must expose port 24444 to use the service properly on the Internet." + Echo_Yellow " " + Echo_Cyan "Usage:" + Echo_Cyan "systemctl start mcsm-daemon.service" + Echo_Cyan "systemctl stop mcsm-daemon.service" + Echo_Cyan "systemctl restart mcsm-daemon.service" + Echo_Yellow " " + Echo_Green "Official Document: https://docs.mcsmanager.com/" + Echo_Yellow "==================================================================" ;; *) @@ -558,11 +558,11 @@ Finalize() { esac # Check if backup_path is not empty if [[ -n "$backup_path" ]]; then - echo_green "Your MCSM has been updated from a previous installation. " - echo_green "A complete backup was created at:" - echo_yellow "$backup_path" - echo_green "You can manually delete the backup using command: " - echo_red "rm ${backup_path}" + Echo_Green "Your MCSM has been updated from a previous installation. " + Echo_Green "A complete backup was created at:" + Echo_Yellow "$backup_path" + Echo_Green "You can manually delete the backup using command: " + Echo_Red "rm ${backup_path}" fi # Move quickstart.md mv "${mcsm_down_temp}/quick-start.md" "${mcsmanager_install_path}/quick-start.md" @@ -572,7 +572,7 @@ Finalize() { } ########### Main Logic ################ -main() { +Main() { # Do not create mcsmanager path yet as it will break the logic detecting existing installation Initialize "$@" # Check if the mcsmanager_install_path exists @@ -580,13 +580,13 @@ main() { # Backup first, due to potential large file being archived, backup is disabled. # Backup_MCSM # Install Node.js, this is to ensure the version is up to date. - Install_node + Install_Node else # Create mcsmanager path if not already mkdir -p "$mcsmanager_install_path" # Install Node.js, this is to ensure the version is up to date. - Install_node + Install_Node fi # Install Services based on command @@ -595,7 +595,7 @@ main() { # Print helping Information Finalize - echo_green "Installation/Upgrading Complete!" + Echo_Green "Installation/Upgrading Complete!" } -main "$@" \ No newline at end of file +Main "$@" \ No newline at end of file diff --git a/install_update_cn.sh b/install_update_cn.sh index a292ece..9d52abf 100644 --- a/install_update_cn.sh +++ b/install_update_cn.sh @@ -48,36 +48,35 @@ Red_Error() { echo '=================================================' exit 1 } -echo_cyan() { +Echo_Cyan() { printf '\033[1;36m%b\033[0m\n' "$@" } -echo_red() { +Echo_Red() { printf '\033[1;31m%b\033[0m\n' "$@" } -echo_green() { +Echo_Green() { printf '\033[1;32m%b\033[0m\n' "$@" } -echo_cyan_n() { +Echo_Cyan_N() { printf '\033[1;36m%b\033[0m' "$@" } -echo_yellow() { +Echo_Yellow() { printf '\033[1;33m%b\033[0m\n' "$@" } - # Check root permission -check_sudo() { +Check_Sudo() { if [ "$EUID" -ne 0 ]; then echo "This script must be run as root. Please use \"sudo or root user\" instead." exit 1 fi } -Install_dependencies() { +Install_Dependencies() { # Install related software - echo_cyan "[+] 正在安装依赖软件 (git, tar, wget)... " + Echo_Cyan "[+] 正在安装依赖软件 (git, tar, wget)... " if [[ -x "$(command -v yum)" ]]; then yum install -y git tar wget elif [[ -x "$(command -v apt-get)" ]]; then @@ -87,23 +86,23 @@ Install_dependencies() { elif [[ -x "$(command -v zypper)" ]]; then zypper --non-interactive install git tar wget else - echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" + Echo_Red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" fi # Determine whether the relevant software is installed successfully if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "成功!" + Echo_Green "成功!" else Red_Error "[x] Failed to find git, tar and wget, please install them manually!" fi } -Install_node() { +Install_Node() { if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "检测到已安装的Node.js版本, 已为您跳过安装." + Echo_Green "检测到已安装的Node.js版本, 已为您跳过安装." else - echo_cyan_n "[+] 安装 Node.js 环境中...\n" + Echo_Cyan_N "[+] 安装 Node.js 环境中...\n" rm -irf "$node_install_path" @@ -118,7 +117,7 @@ Install_node() { rm -rf "node-$node-linux-$arch.tar.gz" if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Success" + Echo_Green "Success" else Red_Error "[x] Node installation failed!" fi @@ -126,15 +125,15 @@ Install_node() { echo - echo_yellow "=============== Node.js 版本 ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.js 版本 ===============" + Echo_Yellow "=============== Node.js 版本 ===============" + Echo_Yellow " node: $("$node_install_path"/bin/node -v)" + Echo_Yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + Echo_Yellow "=============== Node.js 版本 ===============" echo sleep 1 } # Check and download MCSM source -Check_and_download_source() { +Check_And_Download_Source() { # Empty the temp dir if existed rm -rf "$mcsm_down_temp" mkdir -p "$mcsm_down_temp" @@ -179,12 +178,12 @@ Detect_Architecture() { } # Initialization Initialize() { - echo_cyan "+---------------------------------------------------------------------- + Echo_Cyan "+---------------------------------------------------------------------- | MCSManager V10安装升级脚本 +---------------------------------------------------------------------- " # Check sudo - check_sudo + Check_Sudo # Update architecture Detect_Architecture @@ -193,10 +192,10 @@ Initialize() { mkdir -p "$install_base" # Check dependencies - Install_dependencies + Install_Dependencies # Check and download MCSM source - Check_and_download_source + Check_And_Download_Source # Parse input arguments Parse_Arguments "$@" @@ -206,9 +205,9 @@ Initialize() { # Create the user 'mcsm' if it doesn't already exist if ! id "mcsm" &>/dev/null; then /usr/sbin/useradd mcsm - echo_green "用户 'mcsm' 已创建." + Echo_Green "用户 'mcsm' 已创建." else - echo_yellow "用户 'mcsm' 已经存在." + Echo_Yellow "用户 'mcsm' 已经存在." fi fi } @@ -226,7 +225,7 @@ Backup_MCSM() { # Create backup directory (/opt) if it doesn't exist if [ ! -d "$mcsm_backup_dir" ]; then - echo_yellow "正在创建备份目录..." + Echo_Yellow "正在创建备份目录..." mkdir -p "$mcsm_backup_dir" fi @@ -234,14 +233,14 @@ Backup_MCSM() { backup_path="${mcsm_backup_dir}/mcsm_backup_${current_date}.tar.gz" # Create the backup - echo_yellow "正在创建备份..." + Echo_Yellow "正在创建备份..." #tar -czf "$backup_path" -C "$mcsmanager_install_path" . tar -czf "$backup_path" -C "$(dirname "$mcsmanager_install_path")" "$(basename "$mcsmanager_install_path")" # Check if the backup was successful if [ $? -eq 0 ]; then - echo_green "成功创建了备份,位于: $backup_path" + Echo_Green "成功创建了备份,位于: $backup_path" else Red_Error "创建备份时出错" fi @@ -261,7 +260,7 @@ Install_MCSM_Web_Base() { # Dependencies install cd "${web_path}" || Red_Error "[x] Failed to enter ${web_path}" # Install dependencies - echo_cyan "[+] 安装 MCSManager 网页 依赖中..." + Echo_Cyan "[+] 安装 MCSManager 网页 依赖中..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] 在 ${web_path} 安装依赖时出错." # Return to general dir cd "$mcsmanager_install_path" @@ -274,7 +273,7 @@ Install_MCSM_Web_Base() { } # MCSM Web Service Installation Install_Web_Systemd() { - echo_cyan "[+] 创建 MCSManager 网页服务中..." + Echo_Cyan "[+] 创建 MCSManager 网页服务中..." # stop and disable existing service systemctl disable --now mcsm-web @@ -318,7 +317,7 @@ Install_Web_Wrapper() { web_data="${web_path}/data" web_data_tmp="${mcsmanager_install_path}/web_data_${current_date}" if [ -d "$web_path" ]; then - echo_cyan "[+] 升级 MCSManager 网页端中..." + Echo_Cyan "[+] 升级 MCSManager 网页端中..." # The backup should be created already, moving the DATA dir to /opt/mcsmanager/web_data should be fast and safe. # Use web_data, do not use data as in rare circumstance user may run both update at the same time. # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) @@ -327,7 +326,7 @@ Install_Web_Wrapper() { rm -rf "$web_path" else - echo_cyan "[+] 安装 MCSManager 网页端中..." + Echo_Cyan "[+] 安装 MCSManager 网页端中..." fi @@ -354,7 +353,7 @@ Install_MCSM_Daemon_Base() { # Dependencies install cd "${daemon_path}" || Red_Error "[x] Failed to enter ${daemon_path}" # Install dependencies - echo_cyan "[+] 安装 MCSManager 节点依赖中..." + Echo_Cyan "[+] 安装 MCSManager 节点依赖中..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${daemon_path}" # Return to general dir cd "$mcsmanager_install_path" @@ -368,7 +367,7 @@ Install_MCSM_Daemon_Base() { # MCSM Daemon Service Installation Install_Daemon_Systemd() { - echo_cyan "[+] 创建 MCSManager 节点服务中..." + Echo_Cyan "[+] 创建 MCSManager 节点服务中..." # stop and disable existing service systemctl disable --now mcsm-daemon @@ -411,7 +410,7 @@ Install_Daemon_Wrapper() { daemon_data="${daemon_path}/data" daemon_data_tmp="${mcsmanager_install_path}/daemon_data_${current_date}" if [ -d "$daemon_path" ]; then - echo_cyan "[+] 升级 MCSManager 节点中..." + Echo_Cyan "[+] 升级 MCSManager 节点中..." # The backup should be created already, moving the DATA dir to /opt/mcsmanager/daemon_data should be fast and safe. # Use daemon_data, do not use data as in rare circumstance user may run both update at the same time. # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) @@ -420,7 +419,7 @@ Install_Daemon_Wrapper() { rm -rf "$daemon_path" else - echo_cyan "[+] 安装 MCSManager 节点中..." + Echo_Cyan "[+] 安装 MCSManager 节点中..." fi # Install MCSM Web @@ -497,56 +496,56 @@ Finalize() { case "$COMMAND" in all) - echo_yellow "==================================================================" - echo_green "安装已完成! 欢迎使用 MCSManager V10!!!" - echo_yellow " " - echo_cyan_n "网页 服务: " - echo_yellow "http://<您的 IP>:23333 (Browser)" - echo_cyan_n "节点 地址: " - echo_yellow "ws://<您的 IP>:24444 (Cluster)" - echo_red "您必须开放 23333 与 24444 端口才可以正常从公网访问" - echo_yellow " " - echo_cyan "使用方法:" - echo_cyan "启动: systemctl start mcsm-{daemon,web}.service" - echo_cyan "关闭: systemctl stop mcsm-{daemon,web}.service" - echo_cyan "重启: systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "官方文档: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + Echo_Yellow "==================================================================" + Echo_Green "安装已完成! 欢迎使用 MCSManager V10!!!" + Echo_Yellow " " + Echo_Cyan_N "网页 服务: " + Echo_Yellow "http://<您的 IP>:23333 (Browser)" + Echo_Cyan_N "节点 地址: " + Echo_Yellow "ws://<您的 IP>:24444 (Cluster)" + Echo_Red "您必须开放 23333 与 24444 端口才可以正常从公网访问" + Echo_Yellow " " + Echo_Cyan "使用方法:" + Echo_Cyan "启动: systemctl start mcsm-{daemon,web}.service" + Echo_Cyan "关闭: systemctl stop mcsm-{daemon,web}.service" + Echo_Cyan "重启: systemctl restart mcsm-{daemon,web}.service" + Echo_Yellow " " + Echo_Green "官方文档: https://docs.mcsmanager.com/" + Echo_Yellow "==================================================================" ;; web) - echo_yellow "==================================================================" - echo_green "安装已完成! 欢迎使用 MCSManager V10!!!" - echo_yellow " " - echo_cyan_n "网页 服务: " - echo_yellow "http://<您的 IP>:23333 (Browser)" - echo_red "您必须开放 23333 端口才可以正常从公网访问" - echo_yellow " " - echo_cyan "使用方法:" - echo_cyan "启动: systemctl start mcsm-{daemon,web}.service" - echo_cyan "关闭: systemctl stop mcsm-{daemon,web}.service" - echo_cyan "重启: systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "官方文档: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + Echo_Yellow "==================================================================" + Echo_Green "安装已完成! 欢迎使用 MCSManager V10!!!" + Echo_Yellow " " + Echo_Cyan_N "网页 服务: " + Echo_Yellow "http://<您的 IP>:23333 (Browser)" + Echo_Red "您必须开放 23333 端口才可以正常从公网访问" + Echo_Yellow " " + Echo_Cyan "使用方法:" + Echo_Cyan "启动: systemctl start mcsm-{daemon,web}.service" + Echo_Cyan "关闭: systemctl stop mcsm-{daemon,web}.service" + Echo_Cyan "重启: systemctl restart mcsm-{daemon,web}.service" + Echo_Yellow " " + Echo_Green "官方文档: https://docs.mcsmanager.com/" + Echo_Yellow "==================================================================" ;; daemon) - echo_yellow "==================================================================" - echo_green "安装已完成! 欢迎使用 MCSManager V10!!!" - echo_yellow " " - echo_cyan_n "节点 地址: " - echo_yellow "ws://<您的 IP>:24444 (Cluster)" - echo_red "您必须开放 24444 端口才可以正常从公网访问" - echo_yellow " " - echo_cyan "使用方法:" - echo_cyan "启动: systemctl start mcsm-{daemon,web}.service" - echo_cyan "关闭: systemctl stop mcsm-{daemon,web}.service" - echo_cyan "重启: systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "官方文档: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + Echo_Yellow "==================================================================" + Echo_Green "安装已完成! 欢迎使用 MCSManager V10!!!" + Echo_Yellow " " + Echo_Cyan_N "节点 地址: " + Echo_Yellow "ws://<您的 IP>:24444 (Cluster)" + Echo_Red "您必须开放 24444 端口才可以正常从公网访问" + Echo_Yellow " " + Echo_Cyan "使用方法:" + Echo_Cyan "启动: systemctl start mcsm-{daemon,web}.service" + Echo_Cyan "关闭: systemctl stop mcsm-{daemon,web}.service" + Echo_Cyan "重启: systemctl restart mcsm-{daemon,web}.service" + Echo_Yellow " " + Echo_Green "官方文档: https://docs.mcsmanager.com/" + Echo_Yellow "==================================================================" ;; *) @@ -557,11 +556,11 @@ Finalize() { esac # Check if backup_path is not empty if [[ -n "$backup_path" ]]; then - echo_green "您的MCSManager是由一个已存在的版本升级而来. " - echo_green "我们已经为您创建了一个备份, 位于:" - echo_yellow "$backup_path" - echo_green "如果需要, 您可以使用下列命令手动删除备份: " - echo_red "rm ${backup_path}" + Echo_Green "您的MCSManager是由一个已存在的版本升级而来. " + Echo_Green "我们已经为您创建了一个备份, 位于:" + Echo_Yellow "$backup_path" + Echo_Green "如果需要, 您可以使用下列命令手动删除备份: " + Echo_Red "rm ${backup_path}" fi # Move quickstart.md mv "${mcsm_down_temp}/quick-start.md" "${mcsmanager_install_path}/quick-start.md" @@ -571,7 +570,7 @@ Finalize() { } ########### Main Logic ################ -main() { +Main() { # Do not create mcsmanager path yet as it will break the logic detecting existing installation Initialize "$@" # Check if the mcsmanager_install_path exists @@ -579,13 +578,13 @@ main() { # Backup first, due to potential large file being archived, backup is disabled. # Backup_MCSM # Install Node.js, this is to ensure the version is up to date. - Install_node + Install_Node else # Create mcsmanager path if not already mkdir -p "$mcsmanager_install_path" # Install Node.js, this is to ensure the version is up to date. - Install_node + Install_Node fi # Install Services based on command @@ -594,7 +593,7 @@ main() { # Print helping Information Finalize - echo_green "安装或升级已完成!" + Echo_Green "安装或升级已完成!" } -main "$@" \ No newline at end of file +Main "$@" \ No newline at end of file From 31e8c0cb343ecde83d9cbbe9720931bb8efc76a2 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Thu, 9 May 2024 22:18:00 +0800 Subject: [PATCH 200/463] update cn text - minor fixes --- install_update_cn.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_update_cn.sh b/install_update_cn.sh index 9d52abf..8a95698 100644 --- a/install_update_cn.sh +++ b/install_update_cn.sh @@ -179,7 +179,7 @@ Detect_Architecture() { # Initialization Initialize() { Echo_Cyan "+---------------------------------------------------------------------- -| MCSManager V10安装升级脚本 +| MCSManager V10 安装升级脚本 +---------------------------------------------------------------------- " # Check sudo @@ -260,7 +260,7 @@ Install_MCSM_Web_Base() { # Dependencies install cd "${web_path}" || Red_Error "[x] Failed to enter ${web_path}" # Install dependencies - Echo_Cyan "[+] 安装 MCSManager 网页 依赖中..." + Echo_Cyan "[+] 安装 MCSManager 网页依赖中..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] 在 ${web_path} 安装依赖时出错." # Return to general dir cd "$mcsmanager_install_path" From e728511bf271954138b9139f76e627b6f9bfbe9e Mon Sep 17 00:00:00 2001 From: Unitwk Date: Mon, 13 May 2024 11:33:13 +0800 Subject: [PATCH 201/463] Feat: change download addr --- setup.sh | 4 ++-- setup_cn.sh | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 87714b5..b5f3d14 100644 --- a/setup.sh +++ b/setup.sh @@ -1,8 +1,8 @@ #!/bin/bash mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" -package_name="MCSManager-v10-linux.tar.gz" +mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/download/v10.2.1/mcsmanager_linux_release.tar.gz" +package_name="mcsmanager_linux_release.tar.gz" node="v20.12.2" arch=$(uname -m) diff --git a/setup_cn.sh b/setup_cn.sh index 8af40ec..a8d6909 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1,8 +1,9 @@ #!/bin/bash +# 中国大陆需要安装脚本额外配置镜像地址以及低版本的 NodeJS 环境 mcsmanager_install_path="/opt/mcsmanager" mcsmanager_download_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" -package_name="MCSManager-v10-linux.tar.gz" +package_name="mcsmanager_linux_release.tar.gz" node="v16.20.2" arch=$(uname -m) From 4d5afab43a732c7a49f4d345b57b254e1058ab6a Mon Sep 17 00:00:00 2001 From: Unitwk Date: Mon, 13 May 2024 11:41:58 +0800 Subject: [PATCH 202/463] Fix: package_name --- setup_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index a8d6909..2eb4b2c 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -3,7 +3,7 @@ # 中国大陆需要安装脚本额外配置镜像地址以及低版本的 NodeJS 环境 mcsmanager_install_path="/opt/mcsmanager" mcsmanager_download_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" -package_name="mcsmanager_linux_release.tar.gz" +package_name="MCSManager-v10-linux.tar.gz" node="v16.20.2" arch=$(uname -m) From eef9072bb6296afa9010b5602779d4281b1cd9c7 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Mon, 13 May 2024 11:52:34 +0800 Subject: [PATCH 203/463] Feat: add forge pack --- templates.json | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/templates.json b/templates.json index 5529dae..7e98abd 100644 --- a/templates.json +++ b/templates.json @@ -13,7 +13,7 @@ "packages": [ { "language": "en_us", - "description": "[Paper] Recommendation for friends with multiple players, Fast setup.", + "description": "[Paper] Low hardware configuration machine use, Fast setup.", "title": "Minecraft 1.20.4 Java", "runtime": "Java 17+", "hardware": "RAM 6G+", @@ -49,6 +49,25 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "description": "Forge-1.20.1-47.2.32-installer.jar", + "title": "Forge 1.20.1 (Support Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.2.32/forge-1.20.1-47.2.32-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.20.1-47.2.32-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "Forge-1.19.2-43.3.13-installer.jar", @@ -125,6 +144,25 @@ "oe": "utf-8" } }, + { + "language": "zh_cn", + "description": "[Forge] forge-1.20.1-47.2.32-installer.jar,来自官方网站源,需要高配机器支撑,支持插件和模组。", + "title": "Forge 1.20.1 Java 版 (支持模组)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.2.32/forge-1.20.1-47.2.32-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.20.1-47.2.32-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "zh_cn", "description": "[Forge] forge-1.20.6-50.0.8-installer.jar,来自官方网站源,需要高配机器支撑。", From 2a89f337c13979ce14ab8e29514334c74e999491 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 4 Jun 2024 17:32:40 +0800 Subject: [PATCH 204/463] Fix: start cmd for windows --- templates.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates.json b/templates.json index 7e98abd..46fe552 100644 --- a/templates.json +++ b/templates.json @@ -42,7 +42,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", + "startCommand": "java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar forge-1.20.6-50.0.8-installer.jar --installServer", "ie": "utf-8", @@ -61,7 +61,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", + "startCommand": "java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar forge-1.20.1-47.2.32-installer.jar --installServer", "ie": "utf-8", @@ -80,7 +80,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", + "startCommand": "java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar forge-1.19.2-43.3.13-installer.jar --installServer", "ie": "utf-8", @@ -156,7 +156,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", + "startCommand": "java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar forge-1.20.1-47.2.32-installer.jar --installServer", "ie": "utf-8", @@ -175,7 +175,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", + "startCommand": "java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar forge-1.20.6-50.0.8-installer.jar --installServer", "ie": "utf-8", @@ -194,7 +194,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", + "startCommand": "java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar forge-1.19.2-43.3.13-installer.jar --installServer", "ie": "utf-8", From c5a741e4b1a91baf44279e6a6168426a77f158ce Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 4 Jun 2024 19:28:14 +0800 Subject: [PATCH 205/463] Fix: start cmd --- templates.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates.json b/templates.json index 46fe552..7e98abd 100644 --- a/templates.json +++ b/templates.json @@ -42,7 +42,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui", + "startCommand": "sh ./run.sh", "stopCommand": "stop", "updateCommand": "java -jar forge-1.20.6-50.0.8-installer.jar --installServer", "ie": "utf-8", @@ -61,7 +61,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui", + "startCommand": "sh ./run.sh", "stopCommand": "stop", "updateCommand": "java -jar forge-1.20.1-47.2.32-installer.jar --installServer", "ie": "utf-8", @@ -80,7 +80,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui", + "startCommand": "sh ./run.sh", "stopCommand": "stop", "updateCommand": "java -jar forge-1.19.2-43.3.13-installer.jar --installServer", "ie": "utf-8", @@ -156,7 +156,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui", + "startCommand": "sh ./run.sh", "stopCommand": "stop", "updateCommand": "java -jar forge-1.20.1-47.2.32-installer.jar --installServer", "ie": "utf-8", @@ -175,7 +175,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui", + "startCommand": "sh ./run.sh", "stopCommand": "stop", "updateCommand": "java -jar forge-1.20.6-50.0.8-installer.jar --installServer", "ie": "utf-8", @@ -194,7 +194,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "java -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui", + "startCommand": "sh ./run.sh", "stopCommand": "stop", "updateCommand": "java -jar forge-1.19.2-43.3.13-installer.jar --installServer", "ie": "utf-8", From 26db620de0324e04e5d743eb74af9c139fb93edb Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 4 Jun 2024 19:35:14 +0800 Subject: [PATCH 206/463] feat: windows tip --- templates.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates.json b/templates.json index 7e98abd..2763b7f 100644 --- a/templates.json +++ b/templates.json @@ -32,7 +32,7 @@ }, { "language": "en_us", - "description": "Forge-1.20.6-50.0.8-installer.jar", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", "title": "Forge 1.20.6 (Support Mods)", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -51,7 +51,7 @@ }, { "language": "en_us", - "description": "Forge-1.20.1-47.2.32-installer.jar", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", "title": "Forge 1.20.1 (Support Mods)", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -70,7 +70,7 @@ }, { "language": "en_us", - "description": "Forge-1.19.2-43.3.13-installer.jar", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", "title": "Forge 1.19.2 (Support Mods)", "runtime": "Java 17+", "hardware": "RAM 8G+", @@ -146,7 +146,7 @@ }, { "language": "zh_cn", - "description": "[Forge] forge-1.20.1-47.2.32-installer.jar,来自官方网站源,需要高配机器支撑,支持插件和模组。", + "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "title": "Forge 1.20.1 Java 版 (支持模组)", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -165,7 +165,7 @@ }, { "language": "zh_cn", - "description": "[Forge] forge-1.20.6-50.0.8-installer.jar,来自官方网站源,需要高配机器支撑。", + "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "title": "Forge 1.20.6 Java 版 (支持模组)", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -184,7 +184,7 @@ }, { "language": "zh_cn", - "description": "[Forge] Forge-1.19.2-43.3.13,支持安装 MOD,需要高配机器支撑。", + "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "title": "Forge 1.19.2 Java 版 (支持模组)", "runtime": "Java 17+", "hardware": "RAM 8G+", From 309c1e5195607a975e0929d0cea9890d4a1da99c Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Tue, 4 Jun 2024 21:28:36 +0800 Subject: [PATCH 207/463] explicitly set ownership to root with -u root --- install_update.sh | 6 ++++++ install_update_cn.sh | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/install_update.sh b/install_update.sh index 5ffff6f..f9782a9 100644 --- a/install_update.sh +++ b/install_update.sh @@ -270,6 +270,9 @@ Install_MCSM_Web_Base() { if [[ "$USER" == *"mcsm"* ]]; then # Change file permission to mcsm user chown -R mcsm:mcsm "$web_path" + else + # Change file permission to root user + chown -R root:root "$web_path" fi chmod -R 755 "$web_path" } @@ -363,6 +366,9 @@ Install_MCSM_Daemon_Base() { if [[ "$USER" == *"mcsm"* ]]; then # Change file permission to mcsm user chown -R mcsm:mcsm "$daemon_path" + else + # Change file permission to root user + chown -R root:root "$daemon_path" fi chmod -R 755 "$daemon_path" } diff --git a/install_update_cn.sh b/install_update_cn.sh index 8a95698..81cdc46 100644 --- a/install_update_cn.sh +++ b/install_update_cn.sh @@ -268,6 +268,9 @@ Install_MCSM_Web_Base() { if [[ "$USER" == *"mcsm"* ]]; then # Change file permission to mcsm user chown -R mcsm:mcsm "$web_path" + else + # Change file permission to root user + chown -R root:root "$web_path" fi chmod -R 755 "$web_path" } @@ -361,6 +364,9 @@ Install_MCSM_Daemon_Base() { if [[ "$USER" == *"mcsm"* ]]; then # Change file permission to mcsm user chown -R mcsm:mcsm "$daemon_path" + else + # Change file permission to root user + chown -R root:root "$daemon_path" fi chmod -R 755 "$daemon_path" } From 826227d001e6c573b0e1a711af0d2e5fa7b7af88 Mon Sep 17 00:00:00 2001 From: unknown <78304455+KevinLu2000@users.noreply.github.com> Date: Tue, 4 Jun 2024 21:33:44 +0800 Subject: [PATCH 208/463] we no longer move quick-start.md --- install_update.sh | 2 +- install_update_cn.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install_update.sh b/install_update.sh index f9782a9..c7986f7 100644 --- a/install_update.sh +++ b/install_update.sh @@ -571,7 +571,7 @@ Finalize() { Echo_Red "rm ${backup_path}" fi # Move quickstart.md - mv "${mcsm_down_temp}/quick-start.md" "${mcsmanager_install_path}/quick-start.md" + # mv "${mcsm_down_temp}/quick-start.md" "${mcsmanager_install_path}/quick-start.md" # Remove the temp folder rm -rf "${mcsm_down_temp}" diff --git a/install_update_cn.sh b/install_update_cn.sh index 81cdc46..3da4b81 100644 --- a/install_update_cn.sh +++ b/install_update_cn.sh @@ -569,7 +569,7 @@ Finalize() { Echo_Red "rm ${backup_path}" fi # Move quickstart.md - mv "${mcsm_down_temp}/quick-start.md" "${mcsmanager_install_path}/quick-start.md" + # mv "${mcsm_down_temp}/quick-start.md" "${mcsmanager_install_path}/quick-start.md" # Remove the temp folder rm -rf "${mcsm_down_temp}" From 8d9c710d3f030ebb7ffffd339a1ba9a1333620a3 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 6 Aug 2024 10:51:08 +0800 Subject: [PATCH 209/463] Fix: registry.npmmirror.com NodeJS --- setup_cn.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index 2eb4b2c..8f70160 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -55,7 +55,11 @@ Install_Node() { rm -rf "node-$node-linux-$arch.tar.gz" - wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + # From https://nodejs.org/ + # wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + + # From https://registry.npmmirror.com/ + wget "https://registry.npmmirror.com/-/binary/node/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" From 46760103c15a31b403997add2c525e8ca5654ea1 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Mon, 12 Aug 2024 17:14:30 +0800 Subject: [PATCH 210/463] Update setup_cn.sh --- setup_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index 8f70160..184639c 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -2,7 +2,7 @@ # 中国大陆需要安装脚本额外配置镜像地址以及低版本的 NodeJS 环境 mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" +mcsmanager_download_addr="https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/mcsmanager_linux_release.tar.gz" package_name="MCSManager-v10-linux.tar.gz" node="v16.20.2" arch=$(uname -m) From 09c74ead242e9998e79c609c5fcc6211825adc5f Mon Sep 17 00:00:00 2001 From: Unitwk Date: Mon, 12 Aug 2024 19:18:15 +0800 Subject: [PATCH 211/463] Fix: packname --- setup_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index 184639c..047cf1d 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -3,7 +3,7 @@ # 中国大陆需要安装脚本额外配置镜像地址以及低版本的 NodeJS 环境 mcsmanager_install_path="/opt/mcsmanager" mcsmanager_download_addr="https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/mcsmanager_linux_release.tar.gz" -package_name="MCSManager-v10-linux.tar.gz" +package_name="mcsmanager_linux_release.tar.gz" node="v16.20.2" arch=$(uname -m) From b2a67fa4949b9e3bdcc9fd061156ad96ad492826 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Mon, 12 Aug 2024 19:21:36 +0800 Subject: [PATCH 212/463] Fix: download addr --- setup_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index 047cf1d..8605e12 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -2,7 +2,7 @@ # 中国大陆需要安装脚本额外配置镜像地址以及低版本的 NodeJS 环境 mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/mcsmanager_linux_release.tar.gz" +mcsmanager_download_addr="https://cloud.alongw.cn/f/ZMqsl/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" node="v16.20.2" arch=$(uname -m) From 343da18c4cf943a7537d787563a08a7ac42582da Mon Sep 17 00:00:00 2001 From: Unitwk Date: Wed, 14 Aug 2024 16:16:06 +0800 Subject: [PATCH 213/463] Fix: : rm http://oss.duzuii.com/ --- templates.json | 152 ------------------------------------------------- 1 file changed, 152 deletions(-) diff --git a/templates.json b/templates.json index 2763b7f..5d480b1 100644 --- a/templates.json +++ b/templates.json @@ -11,25 +11,6 @@ } ], "packages": [ - { - "language": "en_us", - "description": "[Paper] Low hardware configuration machine use, Fast setup.", - "title": "Minecraft 1.20.4 Java", - "runtime": "Java 17+", - "hardware": "RAM 6G+", - "size": "140MB", - "remark": "Paper Software", - "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.20.4.zip", - "author": "mcsmanager.com", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", @@ -87,44 +68,6 @@ "oe": "utf-8" } }, - { - "language": "en_us", - "description": "[Paper] Recommendation for friends with multiple players", - "title": "Minecraft 1.19.2 Java", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "140MB", - "remark": "Paper Software", - "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.19.2.zip", - "author": "mcsmanager.com", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "description": "[Paper] Recommendation for friends with multiple players", - "title": "Minecraft 1.18.2 Java", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "140MB", - "remark": "Paper Software", - "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/Global-Paper-1.18.2.zip", - "author": "mcsmanager.com", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, { "language": "zh_cn", "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", @@ -200,101 +143,6 @@ "ie": "utf-8", "oe": "utf-8" } - }, - { - "language": "zh_cn", - "description": "[原版生存] 朋友联机推荐,1.19.2 版本,快速开服,享受原汁原味的极致生存与探索。", - "title": "Minecraft 1.19.2 Java 原版", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "140MB", - "remark": "支持插件,最低 8GB 内存要求", - "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.19.2.zip", - "author": "mcsmanager.com", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "description": "[原版生存] 朋友联机推荐,让你和你的小伙伴一起享受原汁原味的极致生存。", - "title": "Minecraft 1.19.1 Java 原版", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "140MB", - "remark": "支持插件,最低 4GB 内存要求", - "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.19.1.zip", - "author": "mcsmanager.com", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "description": "[原版生存] 适合朋友联机,“荒野更新”(The Wild)旨在为玩家带来现有生物群系的改进和优化。", - "title": "Minecraft 1.19 Java 原版", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "140MB", - "remark": "支持插件,最低 4GB 内存要求", - "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.19.zip", - "author": "mcsmanager.com", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "description": "[原版生存] 适合朋友联机推荐,继承上版本的功能并进行了一系列的优化,主流联机版本,插件与MOD较为丰富。", - "title": "Minecraft 1.18.2 Java 原版", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "140MB", - "remark": "支持插件,最低 4GB 内存要求", - "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.18.2.zip", - "author": "mcsmanager.com", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "description": "[原版生存] 适合朋友联机,快速开服,服务器搭建,回味老版本的地穴探索。", - "title": "Minecraft 17.1 Java 原版", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "160MB", - "remark": "支持插件,最低 4GB 内存要求", - "targetLink": "http://oss.duzuii.com/d/MCSManager/Minecraft-Server-Software/paper-1.17.1.zip", - "author": "mcsmanager.com", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } } ] } From 6deea374a24f3212aafd8dccaf7b6e48da87145b Mon Sep 17 00:00:00 2001 From: Unitwk Date: Thu, 15 Aug 2024 10:29:56 +0800 Subject: [PATCH 214/463] Feat: add pack --- templates.json | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/templates.json b/templates.json index 5d480b1..7916d1f 100644 --- a/templates.json +++ b/templates.json @@ -11,6 +11,44 @@ } ], "packages": [ + { + "language": "en_us", + "description": "[Paper] Minecraft 1.20.2 Paper", + "title": "Minecraft 1.20.2", + "runtime": "Java 22", + "hardware": "RAM 4G+", + "size": "150MB", + "remark": "Includes some basic plugins", + "targetLink": "https://cloud.alongw.cn/f/5XlSW/Paper-1.21.1.zip", + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.20.1 Paper", + "title": "Minecraft 1.20.1", + "runtime": "Java 22", + "hardware": "RAM 4G+", + "size": "200MB", + "remark": "Includes some basic plugins", + "targetLink": "https://cloud.alongw.cn/f/jwjsl/Paper-1.20.1-EN.zip", + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", @@ -68,6 +106,26 @@ "oe": "utf-8" } }, + + { + "language": "zh_cn", + "description": "[Paper] Minecraft 1.21.1 快速开服", + "title": "Minecraft 1.20.1", + "runtime": "Java 22", + "hardware": "RAM 4G+", + "size": "250MB", + "remark": "包含基础插件,萌新快速开服!低配机器专属!", + "targetLink": "https://cloud.alongw.cn/f/DzvHK/Paper-1.21.1-ZH.zip", + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar -nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "zh_cn", "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", From b3222e26a96f806497375c930d1c67aa1b642cc5 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Sun, 29 Sep 2024 11:10:04 +0800 Subject: [PATCH 215/463] feat: update download addr --- setup.sh | 12 ++++++------ setup_cn.sh | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/setup.sh b/setup.sh index 025fd03..81fc5b5 100644 --- a/setup.sh +++ b/setup.sh @@ -1,7 +1,7 @@ #!/bin/bash mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/download/v10.2.1/mcsmanager_linux_release.tar.gz" +mcsmanager_download_addr="https://awwa.cc/mcsm/linux" package_name="mcsmanager_linux_release.tar.gz" node="v20.12.2" arch=$(uname -m) @@ -91,7 +91,7 @@ Install_MCSManager() { cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" # download MCSManager release - wget "${mcsmanager_download_addr}" || Red_Error "[x] Failed to download MCSManager" + wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" @@ -167,10 +167,10 @@ WantedBy=multi-user.target echo_cyan_n "Daemon Address: " echo_yellow "ws://:24444 (Cluster)" echo_red "You must expose ports " - echo_yellow "23333" - echo_red " and " - echo_yellow "24444" - echo_red " to use the service properly on the Internet." + echo_yellow "23333" + echo_red " and " + echo_yellow "24444" + echo_red " to use the service properly on the Internet." echo_yellow " " echo_cyan "Usage:" echo_cyan "systemctl start mcsm-{daemon,web}.service" diff --git a/setup_cn.sh b/setup_cn.sh index 8605e12..125fbd4 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -2,7 +2,7 @@ # 中国大陆需要安装脚本额外配置镜像地址以及低版本的 NodeJS 环境 mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://cloud.alongw.cn/f/ZMqsl/mcsmanager_linux_release.tar.gz" +mcsmanager_download_addr="https://awwa.cc/mcsm/linux" package_name="mcsmanager_linux_release.tar.gz" node="v16.20.2" arch=$(uname -m) @@ -35,7 +35,7 @@ echo_yellow() { # script info echo_cyan "+---------------------------------------------------------------------- -| MCSManager 安装脚本 +| MCSManager 安装脚本 (MCSManager Installer) +---------------------------------------------------------------------- " @@ -97,7 +97,7 @@ Install_MCSManager() { cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" # download MCSManager release - wget "${mcsmanager_download_addr}" || Red_Error "[x] Failed to download MCSManager" + wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" @@ -166,20 +166,20 @@ WantedBy=multi-user.target printf "\n\n\n\n" echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_green "安装完成,欢迎使用 MCSManager !" echo_yellow " " - echo_cyan_n "HTTP Web Service: " + echo_cyan_n "主控网页访问地址: " echo_yellow "http://:23333 (Browser)" - echo_cyan_n "Daemon Address: " + echo_cyan_n "被控守护进程地址: " echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports 23333 and 24444 to use the service properly on the Internet." + echo_red "默认情况下,你必须开放 23333 和 24444 端口才能确保面板工作正常!" echo_yellow " " - echo_cyan "Usage:" + echo_cyan "面板开关指令:" echo_cyan "systemctl start mcsm-{daemon,web}.service" echo_cyan "systemctl stop mcsm-{daemon,web}.service" echo_cyan "systemctl restart mcsm-{daemon,web}.service" echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" + echo_green "官方文档: https://docs.mcsmanager.com/" echo_yellow "==================================================================" } From 519412c11e48b2fe6ca540fe339edab98f7ea4f7 Mon Sep 17 00:00:00 2001 From: naruko-hstk <34113239+naruko-hstk@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:17:20 +0800 Subject: [PATCH 216/463] Add Fabric Loader 1.14~1.21(All is latest version) --- templates.json | 152 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) diff --git a/templates.json b/templates.json index 7916d1f..ffa09b7 100644 --- a/templates.json +++ b/templates.json @@ -106,6 +106,158 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.14.4 Fabric", + "title": "Minecraft 1.14.4 with Fabric Loader", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar -nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.14.4 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.15.2 Fabric", + "title": "Minecraft 1.15.2 with Fabric Loader", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar -nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.15.2 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.16.5 Fabric", + "title": "Minecraft 1.16.5 with Fabric Loader", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar -nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.16.5 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.17.1 Fabric", + "title": "Minecraft 1.17.1 with Fabric Loader", + "runtime": "Java 16+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar -nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.17.1 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.18.2 Fabric", + "title": "Minecraft 1.18.2 with Fabric Loader", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar -nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.18.2 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.19.4 Fabric", + "title": "Minecraft 1.19.4 with Fabric Loader", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar -nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.19.4 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.20.6 Fabric", + "title": "Minecraft 1.20.6 with Fabric Loader", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar -nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.20.6 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.21.3 Fabric", + "title": "Minecraft 1.21.3 with Fabric Loader", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar -nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.21.3 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "zh_cn", From 14720f0b4c35b956f24ae7b0b5f1be2edf8c2daa Mon Sep 17 00:00:00 2001 From: naruko-hstk <34113239+naruko-hstk@users.noreply.github.com> Date: Wed, 30 Oct 2024 23:37:13 +0800 Subject: [PATCH 217/463] Fix command bug --- templates.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates.json b/templates.json index ffa09b7..1498510 100644 --- a/templates.json +++ b/templates.json @@ -120,7 +120,7 @@ "type": "minecraft/java/fabric", "startCommand": "java -jar fabric-server-launch.jar -nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.14.4 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.14.4 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -139,7 +139,7 @@ "type": "minecraft/java/fabric", "startCommand": "java -jar fabric-server-launch.jar -nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.15.2 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.15.2 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -158,7 +158,7 @@ "type": "minecraft/java/fabric", "startCommand": "java -jar fabric-server-launch.jar -nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.16.5 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.16.5 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -177,7 +177,7 @@ "type": "minecraft/java/fabric", "startCommand": "java -jar fabric-server-launch.jar -nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.17.1 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.17.1 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -196,7 +196,7 @@ "type": "minecraft/java/fabric", "startCommand": "java -jar fabric-server-launch.jar -nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.18.2 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.18.2 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -215,7 +215,7 @@ "type": "minecraft/java/fabric", "startCommand": "java -jar fabric-server-launch.jar -nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.19.4 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.19.4 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -234,7 +234,7 @@ "type": "minecraft/java/fabric", "startCommand": "java -jar fabric-server-launch.jar -nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.20.6 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.20.6 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -253,7 +253,7 @@ "type": "minecraft/java/fabric", "startCommand": "java -jar fabric-server-launch.jar -nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar -mcversion 1.21.3 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.3 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } From a5d82fa0d3680eabd2e0b0c1dbed9df1e90207b5 Mon Sep 17 00:00:00 2001 From: YuMao Date: Fri, 8 Nov 2024 22:48:13 +0800 Subject: [PATCH 218/463] Update setup.sh --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 81fc5b5..ce65bae 100644 --- a/setup.sh +++ b/setup.sh @@ -1,7 +1,7 @@ #!/bin/bash mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://awwa.cc/mcsm/linux" +mcsmanager_download_addr="https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" node="v20.12.2" arch=$(uname -m) From ca50950ebd803f3fbef0707166545697cb9ddaf5 Mon Sep 17 00:00:00 2001 From: YuMao Date: Fri, 8 Nov 2024 22:48:25 +0800 Subject: [PATCH 219/463] Update setup_cn.sh --- setup_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index 125fbd4..ad6c155 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -2,7 +2,7 @@ # 中国大陆需要安装脚本额外配置镜像地址以及低版本的 NodeJS 环境 mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://awwa.cc/mcsm/linux" +mcsmanager_download_addr="https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" node="v16.20.2" arch=$(uname -m) From 79a13e463728c9e8ac5c48fb678d2eabf290b072 Mon Sep 17 00:00:00 2001 From: YuMao Date: Fri, 13 Dec 2024 16:24:30 +0800 Subject: [PATCH 220/463] Update templates.json --- templates.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates.json b/templates.json index 1498510..2603802 100644 --- a/templates.json +++ b/templates.json @@ -13,7 +13,7 @@ "packages": [ { "language": "en_us", - "description": "[Paper] Minecraft 1.20.2 Paper", + "description": "[Paper] Minecraft 1.21.1 Paper", "title": "Minecraft 1.20.2", "runtime": "Java 22", "hardware": "RAM 4G+", From b26f1aeb9b35a0912a5b8a674e9f6ea0df457664 Mon Sep 17 00:00:00 2001 From: YuMao Date: Fri, 13 Dec 2024 16:27:00 +0800 Subject: [PATCH 221/463] Update templates.json --- templates.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates.json b/templates.json index 2603802..e2745bb 100644 --- a/templates.json +++ b/templates.json @@ -14,7 +14,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.21.1 Paper", - "title": "Minecraft 1.20.2", + "title": "Minecraft 1.21.1", "runtime": "Java 22", "hardware": "RAM 4G+", "size": "150MB", From ea92539cc8c7ff97566290a24507889f94c7595b Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Wed, 25 Dec 2024 12:42:01 +0100 Subject: [PATCH 222/463] Update Server templates in templates.json (only en_us) --- templates.json | 815 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 749 insertions(+), 66 deletions(-) diff --git a/templates.json b/templates.json index 1498510..8d9241e 100644 --- a/templates.json +++ b/templates.json @@ -11,40 +11,515 @@ } ], "packages": [ + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.3 Purpur", + "title": "Minecraft 1.21.3", + "runtime": "Java 22", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://api.purpurmc.org/v2/purpur/1.21.3/2358/download", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.21.3-2358.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.1 Purpur", + "title": "Minecraft 1.21.1", + "runtime": "Java 22", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://api.purpurmc.org/v2/purpur/1.21.1/2329/download", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.21.1-2329.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.20.6 Purpur", + "title": "Minecraft 1.20.6", + "runtime": "Java 22", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://api.purpurmc.org/v2/purpur/1.20.6/2233/download", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.20.6-2233.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.20.4 Purpur", + "title": "Minecraft 1.20.4", + "runtime": "Java 22", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://api.purpurmc.org/v2/purpur/1.20.4/2176/download", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.20.4-2176.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.20.1 Purpur", + "title": "Minecraft 1.20.1", + "runtime": "Java 22", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://api.purpurmc.org/v2/purpur/1.20.1/2062/download", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.20.1-2062.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.19.2 Purpur", + "title": "Minecraft 1.19.2", + "runtime": "Java 22", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://api.purpurmc.org/v2/purpur/1.19.2/1858/download", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.19.2-1858.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.18.2 Purpur", + "title": "Minecraft 1.18.2", + "runtime": "Java 22", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://api.purpurmc.org/v2/purpur/1.18.2/1632/download", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.18.2-1632.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.17.1 Purpur", + "title": "Minecraft 1.17.1", + "runtime": "Java 17", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://api.purpurmc.org/v2/purpur/1.17.1/1428/download", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.17.1-1428.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.16.5 Purpur", + "title": "Minecraft 1.16.5", + "runtime": "Java 17", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://api.purpurmc.org/v2/purpur/1.16.5/1171/download", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.16.5-1171.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.21.3 Paper", + "title": "Minecraft 1.21.3", + "runtime": "Java 22", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.3/builds/82/downloads/paper-1.21.3-82.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.21.3-82.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.21.1 Paper", + "title": "Minecraft 1.21.1", + "runtime": "Java 22", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/132/downloads/paper-1.21.1-132.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.21.1-132.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.20.6 Paper", + "title": "Minecraft 1.20.6", + "runtime": "Java 21", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.6/builds/151/downloads/paper-1.20.6-151.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.20.6-151.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.20.4 Paper", + "title": "Minecraft 1.20.4", + "runtime": "Java 21", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/499/downloads/paper-1.20.4-499.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.20.4-499.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "[Paper] Minecraft 1.20.2 Paper", "title": "Minecraft 1.20.2", - "runtime": "Java 22", + "runtime": "Java 21", "hardware": "RAM 4G+", "size": "150MB", "remark": "Includes some basic plugins", - "targetLink": "https://cloud.alongw.cn/f/5XlSW/Paper-1.21.1.zip", - "author": "alongw.cn", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.2/builds/318/downloads/paper-1.20.2-318.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.20.2-318.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.20.1 Paper", + "title": "Minecraft 1.20.1", + "runtime": "Java 21", + "hardware": "RAM 4G+", + "size": "200MB", + "remark": "Includes some basic plugins", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.1/builds/196/downloads/paper-1.20.1-196.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.20.1-196.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.19.4 Paper", + "title": "Minecraft 1.19.4", + "runtime": "Java 21", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.19.4/builds/550/downloads/paper-1.19.4-550.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.19.4-550.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.19.2 Paper", + "title": "Minecraft 1.19.2", + "runtime": "Java 21", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.19.2/builds/307/downloads/paper-1.19.2-307.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.19.2-307.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.18.2 Paper", + "title": "Minecraft 1.18.2", + "runtime": "Java 21", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.18.2/builds/388/downloads/paper-1.18.2-388.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.18.2-388.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.17.1 Paper", + "title": "Minecraft 1.17.1", + "runtime": "Java 21", + "hardware": "RAM 4G+", + "size": "60MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.17.1/builds/411/downloads/paper-1.17.1-411.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.17.1-411.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.16.5 Paper", + "title": "Minecraft 1.16.5", + "runtime": "Java 21", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.16.5/builds/794/downloads/paper-1.16.5-794.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.16.5-794.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.12.2 Paper", + "title": "Minecraft 1.12.2", + "runtime": "Java 21", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.12.2/builds/1620/downloads/paper-1.12.2-1620.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.12.2-1620.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.8.8 Paper", + "title": "Minecraft 1.8.8", + "runtime": "Java 21", + "hardware": "RAM 4G+", + "size": "20MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.8.8/builds/445/downloads/paper-1.8.8-445.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar paper-1.8.8-445.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "title": "Forge 1.21.4 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.0.12/forge-1.21.4-54.0.12-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.4-54.0.12-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "title": "Forge 1.21.3 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.3-53.0.33/forge-1.21.3-53.0.33-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.3-53.0.33-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "title": "Forge 1.21.1 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.0.37/forge-1.21.1-52.0.37-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.1-52.0.37-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "title": "Forge 1.20.6 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.1.31/forge-1.20.6-50.1.31-installer.jar", + "author": "minecraftforge.net", "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "", + "updateCommand": "java -jar forge-1.20.6-50.1.31-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Paper] Minecraft 1.20.1 Paper", - "title": "Minecraft 1.20.1", - "runtime": "Java 22", - "hardware": "RAM 4G+", - "size": "200MB", - "remark": "Includes some basic plugins", - "targetLink": "https://cloud.alongw.cn/f/jwjsl/Paper-1.20.1-EN.zip", - "author": "alongw.cn", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "title": "Forge 1.20.4 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.4-49.1.21/forge-1.20.4-49.1.21-installer.jar", + "author": "minecraftforge.net", "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "", + "updateCommand": "java -jar forge-1.20.4-49.1.21-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -52,18 +527,18 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", - "title": "Forge 1.20.6 (Support Mods)", + "title": "Forge 1.20.1 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.0.8/forge-1.20.6-50.0.8-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.3.22/forge-1.20.1-47.3.22-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.6-50.0.8-installer.jar --installServer", + "updateCommand": "java -jar forge-1.20.1-47.3.22-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -71,18 +546,18 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", - "title": "Forge 1.20.1 (Support Mods)", - "runtime": "Java 21+", + "title": "Forge 1.19.4 (Supports Mods)", + "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.2.32/forge-1.20.1-47.2.32-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.4-45.3.15/forge-1.19.4-45.3.15-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.1-47.2.32-installer.jar --installServer", + "updateCommand": "java -jar forge-1.19.4-45.3.15-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -90,27 +565,141 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", - "title": "Forge 1.19.2 (Support Mods)", + "title": "Forge 1.19.2 (Supports Mods)", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.3.13/forge-1.19.2-43.3.13-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.4.12/forge-1.19.2-43.4.12-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.19.2-43.3.13-installer.jar --installServer", + "updateCommand": "java -jar forge-1.19.2-43.4.12-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.14.4 Fabric", - "title": "Minecraft 1.14.4 with Fabric Loader", - "runtime": "Java 8+", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "title": "Forge 1.18.2 (Supports Mods)", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.2.31/forge-1.18.2-40.2.31-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.18.2-40.2.31-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "title": "Forge 1.17.1 (Supports Mods)", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.17.1-37.1.1/forge-1.17.1-37.1.1-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.17.1-37.1.1-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "title": "Forge 1.16.5 (Supports Mods)", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.16.5-36.2.42/forge-1.16.5-36.2.42-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.16.5-36.2.42-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "title": "Forge 1.12.2 (Supports Mods)", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.12.2-14.23.5.2860/forge-1.12.2-14.23.5.2860-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.12.2-14.23.5.2860-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "title": "Forge 1.8.9 (Supports Mods)", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.8.9-11.15.1.2318-1.8.9/forge-1.8.9-11.15.1.2318-1.8.9-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.8.9-11.15.1.2318-1.8.9-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "title": "Forge 1.7.10 (Supports Mods)", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/forge-1.7.10-10.13.4.1614-1.7.10-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.7.10-10.13.4.1614-1.7.10-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.21.4 Fabric", + "title": "Minecraft 1.21.4 with Fabric Loader", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", @@ -118,18 +707,18 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar -nogui", + "startCommand": "java -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.14.4 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.15.2 Fabric", - "title": "Minecraft 1.15.2 with Fabric Loader", - "runtime": "Java 8+", + "description": "[Fabric] Minecraft 1.21.3 Fabric", + "title": "Minecraft 1.21.3 with Fabric Loader", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", @@ -137,18 +726,18 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar -nogui", + "startCommand": "java -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.15.2 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.3 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.16.5 Fabric", - "title": "Minecraft 1.16.5 with Fabric Loader", - "runtime": "Java 8+", + "description": "[Fabric] Minecraft 1.21.1 Fabric", + "title": "Minecraft 1.21.1 with Fabric Loader", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", @@ -156,18 +745,18 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar -nogui", + "startCommand": "java -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.16.5 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.1 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.17.1 Fabric", - "title": "Minecraft 1.17.1 with Fabric Loader", - "runtime": "Java 16+", + "description": "[Fabric] Minecraft 1.20.6 Fabric", + "title": "Minecraft 1.20.6 with Fabric Loader", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", @@ -175,18 +764,18 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar -nogui", + "startCommand": "java -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.17.1 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.20.6 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.18.2 Fabric", - "title": "Minecraft 1.18.2 with Fabric Loader", - "runtime": "Java 17+", + "description": "[Fabric] Minecraft 1.20.4 Fabric", + "title": "Minecraft 1.20.4 with Fabric Loader", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", @@ -194,9 +783,28 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar -nogui", + "startCommand": "java -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.18.2 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.20.4 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.20.1 Fabric", + "title": "Minecraft 1.20.1 with Fabric Loader", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.20.1 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -213,7 +821,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar -nogui", + "startCommand": "java -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.19.4 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -222,9 +830,9 @@ }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.20.6 Fabric", - "title": "Minecraft 1.20.6 with Fabric Loader", - "runtime": "Java 21+", + "description": "[Fabric] Minecraft 1.19.2 Fabric", + "title": "Minecraft 1.19.2 with Fabric Loader", + "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", @@ -232,18 +840,18 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar -nogui", + "startCommand": "java -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.20.6 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.19.2 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.21.3 Fabric", - "title": "Minecraft 1.21.3 with Fabric Loader", - "runtime": "Java 21+", + "description": "[Fabric] Minecraft 1.18.2 Fabric", + "title": "Minecraft 1.18.2 with Fabric Loader", + "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", @@ -251,14 +859,89 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar -nogui", + "startCommand": "java -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.3 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.18.2 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.17.1 Fabric", + "title": "Minecraft 1.17.1 with Fabric Loader", + "runtime": "Java 16+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.17.1 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.16.5 Fabric", + "title": "Minecraft 1.16.5 with Fabric Loader", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.16.5 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.15.2 Fabric", + "title": "Minecraft 1.15.2 with Fabric Loader", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.15.2 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Fabric] Minecraft 1.14.4 Fabric", + "title": "Minecraft 1.14.4 with Fabric Loader", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.14.4 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, - { "language": "zh_cn", "description": "[Paper] Minecraft 1.21.1 快速开服", @@ -271,7 +954,7 @@ "author": "alongw.cn", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", + "startCommand": "java -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -290,7 +973,7 @@ "author": "alongw.cn", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar -nogui", + "startCommand": "java -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From e06eb0703652c241075143c0a59c142dbd8094f6 Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Wed, 25 Dec 2024 12:54:12 +0100 Subject: [PATCH 223/463] fix: Give Purpur and Paper Instances thier tags automatically after creating it --- templates.json | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/templates.json b/templates.json index 8d9241e..5749d48 100644 --- a/templates.json +++ b/templates.json @@ -22,7 +22,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.21.3/2358/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.21.3-2358.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -41,7 +41,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.21.1/2329/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.21.1-2329.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -60,7 +60,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.20.6/2233/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.20.6-2233.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -79,7 +79,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.20.4/2176/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.20.4-2176.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -98,7 +98,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.20.1/2062/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.20.1-2062.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -117,7 +117,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.19.2/1858/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.19.2-1858.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -136,7 +136,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.18.2/1632/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.18.2-1632.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -155,7 +155,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.17.1/1428/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.17.1-1428.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -174,7 +174,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.16.5/1171/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.16.5-1171.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -193,7 +193,7 @@ "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.3/builds/82/downloads/paper-1.21.3-82.jar", "author": "papermc.io", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/paper", "startCommand": "java -jar paper-1.21.3-82.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -212,7 +212,7 @@ "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/132/downloads/paper-1.21.1-132.jar", "author": "papermc.io", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/paper", "startCommand": "java -jar paper-1.21.1-132.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -231,7 +231,7 @@ "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.6/builds/151/downloads/paper-1.20.6-151.jar", "author": "papermc.io", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/paper", "startCommand": "java -jar paper-1.20.6-151.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -250,7 +250,7 @@ "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/499/downloads/paper-1.20.4-499.jar", "author": "papermc.io", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/paper", "startCommand": "java -jar paper-1.20.4-499.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -269,7 +269,7 @@ "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.2/builds/318/downloads/paper-1.20.2-318.jar", "author": "papermc.io", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/paper", "startCommand": "java -jar paper-1.20.2-318.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -288,7 +288,7 @@ "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.1/builds/196/downloads/paper-1.20.1-196.jar", "author": "papermc.io", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/paper", "startCommand": "java -jar paper-1.20.1-196.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -307,7 +307,7 @@ "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.19.4/builds/550/downloads/paper-1.19.4-550.jar", "author": "papermc.io", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/paper", "startCommand": "java -jar paper-1.19.4-550.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -326,7 +326,7 @@ "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.19.2/builds/307/downloads/paper-1.19.2-307.jar", "author": "papermc.io", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/paper", "startCommand": "java -jar paper-1.19.2-307.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -364,7 +364,7 @@ "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.17.1/builds/411/downloads/paper-1.17.1-411.jar", "author": "papermc.io", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/paper", "startCommand": "java -jar paper-1.17.1-411.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -383,7 +383,7 @@ "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.16.5/builds/794/downloads/paper-1.16.5-794.jar", "author": "papermc.io", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/paper", "startCommand": "java -jar paper-1.16.5-794.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -402,7 +402,7 @@ "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.12.2/builds/1620/downloads/paper-1.12.2-1620.jar", "author": "papermc.io", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/paper", "startCommand": "java -jar paper-1.12.2-1620.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -421,7 +421,7 @@ "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.8.8/builds/445/downloads/paper-1.8.8-445.jar", "author": "papermc.io", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/paper", "startCommand": "java -jar paper-1.8.8-445.jar nogui", "stopCommand": "stop", "updateCommand": "", From 3068a1f699c68bf98b3ccc9f22ddf7e329eeca4f Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Wed, 25 Dec 2024 13:14:34 +0100 Subject: [PATCH 224/463] fix: Remove Purpur tag because the latest version doesn't support it yet --- templates.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/templates.json b/templates.json index cdc028f..8f31593 100644 --- a/templates.json +++ b/templates.json @@ -22,7 +22,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.21.3/2358/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java/purpur", + "type": "minecraft/java", "startCommand": "java -jar purpur-1.21.3-2358.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -41,7 +41,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.21.1/2329/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java/purpur", + "type": "minecraft/java", "startCommand": "java -jar purpur-1.21.1-2329.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -60,7 +60,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.20.6/2233/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java/purpur", + "type": "minecraft/java", "startCommand": "java -jar purpur-1.20.6-2233.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -79,7 +79,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.20.4/2176/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java/purpur", + "type": "minecraft/java", "startCommand": "java -jar purpur-1.20.4-2176.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -98,7 +98,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.20.1/2062/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java/purpur", + "type": "minecraft/java", "startCommand": "java -jar purpur-1.20.1-2062.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -117,7 +117,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.19.2/1858/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java/purpur", + "type": "minecraft/java", "startCommand": "java -jar purpur-1.19.2-1858.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -136,7 +136,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.18.2/1632/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java/purpur", + "type": "minecraft/java", "startCommand": "java -jar purpur-1.18.2-1632.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -155,7 +155,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.17.1/1428/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java/purpur", + "type": "minecraft/java", "startCommand": "java -jar purpur-1.17.1-1428.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -174,7 +174,7 @@ "targetLink": "https://api.purpurmc.org/v2/purpur/1.16.5/1171/download", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java/purpur", + "type": "minecraft/java", "startCommand": "java -jar purpur-1.16.5-1171.jar nogui", "stopCommand": "stop", "updateCommand": "", From 80a5d31f2e4736fb83ce4c72dbccfaa235251872 Mon Sep 17 00:00:00 2001 From: YuMao Date: Thu, 26 Dec 2024 16:03:54 +0800 Subject: [PATCH 225/463] Update setup_cn.sh --- setup_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index ad6c155..4532f2d 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -2,7 +2,7 @@ # 中国大陆需要安装脚本额外配置镜像地址以及低版本的 NodeJS 环境 mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/mcsmanager_linux_release.tar.gz" +mcsmanager_download_addr="http://47.99.81.8/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" node="v16.20.2" arch=$(uname -m) From 08b51cead0866b729bf0f412894af0c5a2275eae Mon Sep 17 00:00:00 2001 From: YuMao Date: Thu, 26 Dec 2024 16:04:13 +0800 Subject: [PATCH 226/463] Update setup.sh --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index ce65bae..df2211b 100644 --- a/setup.sh +++ b/setup.sh @@ -1,7 +1,7 @@ #!/bin/bash mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/mcsmanager_linux_release.tar.gz" +mcsmanager_download_addr="http://47.99.81.8/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" node="v20.12.2" arch=$(uname -m) From 8f95b7662dd0c9537b6b43ee71d0df9fc41ccb7c Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Mon, 30 Dec 2024 11:56:30 +0100 Subject: [PATCH 227/463] fix: Paper 1.20.2 had code of 1.21.1 in templates.json --- templates.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/templates.json b/templates.json index 8f31593..f7036f9 100644 --- a/templates.json +++ b/templates.json @@ -263,11 +263,6 @@ "description": "[Paper] Minecraft 1.20.2 Paper", "title": "Minecraft 1.20.2", "runtime": "Java 21", - - "description": "[Paper] Minecraft 1.21.1 Paper", - "title": "Minecraft 1.21.1", - "runtime": "Java 22", - "hardware": "RAM 4G+", "size": "150MB", "remark": "Includes some basic plugins", From aa6c64f81b8dad3e7ec315043399f0e44ee9c320 Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Mon, 30 Dec 2024 12:07:11 +0100 Subject: [PATCH 228/463] feat: Add Vanilla Minecraft Versions (only en_US) --- templates.json | 209 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 209 insertions(+) diff --git a/templates.json b/templates.json index f7036f9..7488ecc 100644 --- a/templates.json +++ b/templates.json @@ -942,6 +942,215 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.21.4", + "title": "Minecraft 1.21.4", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar", + "author": "Mojang", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.21.1", + "title": "Minecraft 1.21.1", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "50MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/59353fb40c36d304f2035d51e7d6e6baa98dc05c/server.jar", + "author": "Mojang", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.20.6", + "title": "Minecraft 1.20.6", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "50MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/145ff0858209bcfc164859ba735d4199aafa1eea/server.jar", + "author": "Mojang", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.20.4", + "title": "Minecraft 1.20.4", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "50MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/8dd1a28015f51b1803213892b50b7b4fc76e594d/server.jar", + "author": "Mojang", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.20.1", + "title": "Minecraft 1.20.1", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "50MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/84194a2f286ef7c14ed7ce0090dba59902951553/server.jar", + "author": "Mojang", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.19.4", + "title": "Minecraft 1.19.4", + "runtime": "Java 19+", + "hardware": "RAM 2G+", + "size": "50MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/8f3112a1049751cc472ec13e397eade5336ca7ae/server.jar", + "author": "Mojang", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.18.2", + "title": "Minecraft 1.18.2", + "runtime": "Java 19+", + "hardware": "RAM 2G+", + "size": "45MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/c8f83c5655308435b3dcf03c06d9fe8740a77469/server.jar", + "author": "Mojang", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.17.1", + "title": "Minecraft 1.17.1", + "runtime": "Java 19+", + "hardware": "RAM 2G+", + "size": "45MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/a16d67e5807f57fc4e550299cf20226194497dc2/server.jar", + "author": "Mojang", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.16.5", + "title": "Minecraft 1.16.5", + "runtime": "Java 19+", + "hardware": "RAM 2G+", + "size": "45MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/1b557e7b033b583cd9f66746b7a9ab1ec1673ced/server.jar", + "author": "Mojang", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.12.2", + "title": "Minecraft 1.12.2", + "runtime": "Java 11+", + "hardware": "RAM 2G+", + "size": "30MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/886945bfb2b978778c3a0288fd7fab09d315b25f/server.jar", + "author": "Mojang", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.8.9", + "title": "Minecraft 1.8.9", + "runtime": "Java 8+", + "hardware": "RAM 2G+", + "size": "10MB", + "remark": "Minecraft Java", + "targetLink": "https://launcher.mojang.com/v1/objects/b58b2ceb36e01bcd8dbf49c8fb66c55a9f0676cd/server.jar", + "author": "Mojang", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "zh_cn", "description": "[Paper] Minecraft 1.21.1 快速开服", From 5b19d5e4b34a1875145dce4d2feb6051c3b28c5d Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Mon, 30 Dec 2024 12:16:44 +0100 Subject: [PATCH 229/463] fix: Correct required Java versions for each MC version --- templates.json | 78 +++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/templates.json b/templates.json index 7488ecc..f02c372 100644 --- a/templates.json +++ b/templates.json @@ -15,7 +15,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.21.3 Purpur", "title": "Minecraft 1.21.3", - "runtime": "Java 22", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", @@ -34,7 +34,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.21.1 Purpur", "title": "Minecraft 1.21.1", - "runtime": "Java 22", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", @@ -53,7 +53,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.20.6 Purpur", "title": "Minecraft 1.20.6", - "runtime": "Java 22", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", @@ -72,7 +72,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.20.4 Purpur", "title": "Minecraft 1.20.4", - "runtime": "Java 22", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", @@ -91,7 +91,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.20.1 Purpur", "title": "Minecraft 1.20.1", - "runtime": "Java 22", + "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", @@ -110,7 +110,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.19.2 Purpur", "title": "Minecraft 1.19.2", - "runtime": "Java 22", + "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", @@ -129,7 +129,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.18.2 Purpur", "title": "Minecraft 1.18.2", - "runtime": "Java 22", + "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", @@ -148,7 +148,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.17.1 Purpur", "title": "Minecraft 1.17.1", - "runtime": "Java 17", + "runtime": "Java 16+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", @@ -167,7 +167,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.16.5 Purpur", "title": "Minecraft 1.16.5", - "runtime": "Java 17", + "runtime": "Java 8+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", @@ -186,7 +186,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.21.3 Paper", "title": "Minecraft 1.21.3", - "runtime": "Java 22", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", @@ -205,7 +205,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.21.1 Paper", "title": "Minecraft 1.21.1", - "runtime": "Java 22", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", @@ -224,7 +224,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.20.6 Paper", "title": "Minecraft 1.20.6", - "runtime": "Java 21", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", @@ -243,7 +243,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.20.4 Paper", "title": "Minecraft 1.20.4", - "runtime": "Java 21", + "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", @@ -262,7 +262,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.20.2 Paper", "title": "Minecraft 1.20.2", - "runtime": "Java 21", + "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "150MB", "remark": "Includes some basic plugins", @@ -281,7 +281,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.20.1 Paper", "title": "Minecraft 1.20.1", - "runtime": "Java 21", + "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "200MB", "remark": "Includes some basic plugins", @@ -300,7 +300,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.19.4 Paper", "title": "Minecraft 1.19.4", - "runtime": "Java 21", + "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", @@ -319,7 +319,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.19.2 Paper", "title": "Minecraft 1.19.2", - "runtime": "Java 21", + "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", @@ -338,7 +338,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.18.2 Paper", "title": "Minecraft 1.18.2", - "runtime": "Java 21", + "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", @@ -357,7 +357,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.17.1 Paper", "title": "Minecraft 1.17.1", - "runtime": "Java 21", + "runtime": "Java 16+", "hardware": "RAM 4G+", "size": "60MB", "remark": "Only Paper included", @@ -376,7 +376,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.16.5 Paper", "title": "Minecraft 1.16.5", - "runtime": "Java 21", + "runtime": "Java 8+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", @@ -395,7 +395,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.12.2 Paper", "title": "Minecraft 1.12.2", - "runtime": "Java 21", + "runtime": "Java 8+", "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", @@ -414,7 +414,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.8.8 Paper", "title": "Minecraft 1.8.8", - "runtime": "Java 21", + "runtime": "Java 7+", "hardware": "RAM 4G+", "size": "20MB", "remark": "Only Paper included", @@ -528,7 +528,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", "title": "Forge 1.20.1 (Supports Mods)", - "runtime": "Java 21+", + "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", @@ -604,7 +604,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", "title": "Forge 1.17.1 (Supports Mods)", - "runtime": "Java 17+", + "runtime": "Java 16+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", @@ -623,7 +623,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", "title": "Forge 1.16.5 (Supports Mods)", - "runtime": "Java 17+", + "runtime": "Java 8+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", @@ -642,7 +642,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", "title": "Forge 1.12.2 (Supports Mods)", - "runtime": "Java 17+", + "runtime": "Java 8+", "hardware": "RAM 8G+", "size": "5MB", "remark": "Minecraft Forge", @@ -661,7 +661,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", "title": "Forge 1.8.9 (Supports Mods)", - "runtime": "Java 17+", + "runtime": "Java 7+", "hardware": "RAM 8G+", "size": "5MB", "remark": "Minecraft Forge", @@ -680,7 +680,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", "title": "Forge 1.7.10 (Supports Mods)", - "runtime": "Java 17+", + "runtime": "Java 7+", "hardware": "RAM 8G+", "size": "5MB", "remark": "Minecraft Forge", @@ -794,7 +794,7 @@ "language": "en_us", "description": "[Fabric] Minecraft 1.20.1 Fabric", "title": "Minecraft 1.20.1 with Fabric Loader", - "runtime": "Java 21+", + "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", @@ -1022,7 +1022,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.20.1", "title": "Minecraft 1.20.1", - "runtime": "Java 21+", + "runtime": "Java 17+", "hardware": "RAM 2G+", "size": "50MB", "remark": "Minecraft Java", @@ -1041,7 +1041,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.19.4", "title": "Minecraft 1.19.4", - "runtime": "Java 19+", + "runtime": "Java 17+", "hardware": "RAM 2G+", "size": "50MB", "remark": "Minecraft Java", @@ -1060,7 +1060,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.18.2", "title": "Minecraft 1.18.2", - "runtime": "Java 19+", + "runtime": "Java 17+", "hardware": "RAM 2G+", "size": "45MB", "remark": "Minecraft Java", @@ -1079,7 +1079,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.17.1", "title": "Minecraft 1.17.1", - "runtime": "Java 19+", + "runtime": "Java 16+", "hardware": "RAM 2G+", "size": "45MB", "remark": "Minecraft Java", @@ -1098,7 +1098,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.16.5", "title": "Minecraft 1.16.5", - "runtime": "Java 19+", + "runtime": "Java 8+", "hardware": "RAM 2G+", "size": "45MB", "remark": "Minecraft Java", @@ -1117,7 +1117,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.12.2", "title": "Minecraft 1.12.2", - "runtime": "Java 11+", + "runtime": "Java 8+", "hardware": "RAM 2G+", "size": "30MB", "remark": "Minecraft Java", @@ -1136,7 +1136,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.8.9", "title": "Minecraft 1.8.9", - "runtime": "Java 8+", + "runtime": "Java 7+", "hardware": "RAM 2G+", "size": "10MB", "remark": "Minecraft Java", @@ -1155,7 +1155,7 @@ "language": "zh_cn", "description": "[Paper] Minecraft 1.21.1 快速开服", "title": "Minecraft 1.20.1", - "runtime": "Java 22", + "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "250MB", "remark": "包含基础插件,萌新快速开服!低配机器专属!", @@ -1174,7 +1174,7 @@ "language": "zh_cn", "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", "title": "Minecraft 1.20.4 (低配机器推荐)", - "runtime": "Java 17+", + "runtime": "Java 21+", "hardware": "RAM 6G+", "size": "140MB", "remark": "支持插件,最低 8GB 内存要求", @@ -1193,7 +1193,7 @@ "language": "zh_cn", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "title": "Forge 1.20.1 Java 版 (支持模组)", - "runtime": "Java 21+", + "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", From b12d5ab9b8ec3d5c737affceddcbc7b48dc493ad Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Mon, 13 Jan 2025 19:50:13 +0100 Subject: [PATCH 230/463] feat: Add PaperMC Build 1.21.4-107 as a Server template --- templates.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/templates.json b/templates.json index f02c372..f3f3d82 100644 --- a/templates.json +++ b/templates.json @@ -182,6 +182,25 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.21.4 Paper", + "title": "Minecraft 1.21.4", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/107/downloads/paper-1.21.4-107.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -jar paper-1.21.4-107.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "[Paper] Minecraft 1.21.3 Paper", From 8376dbfb1084190499de545a00f220308064caf9 Mon Sep 17 00:00:00 2001 From: Antony Date: Tue, 14 Jan 2025 07:58:52 +0100 Subject: [PATCH 231/463] feat: Update Paper Build to 1.21.4-109 --- templates.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates.json b/templates.json index f3f3d82..983b65d 100644 --- a/templates.json +++ b/templates.json @@ -190,11 +190,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/107/downloads/paper-1.21.4-107.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/109/downloads/paper-1.21.4-109.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.21.4-107.jar nogui", + "startCommand": "java -jar paper-1.21.4-109.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From 57f5d21a45310e64860f044abce59769d7a7a553 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 14 Jan 2025 16:44:02 +0800 Subject: [PATCH 232/463] fix: del purpur packs --- templates.json | 173 +------------------------------------------------ 1 file changed, 1 insertion(+), 172 deletions(-) diff --git a/templates.json b/templates.json index f3f3d82..4893e66 100644 --- a/templates.json +++ b/templates.json @@ -11,177 +11,6 @@ } ], "packages": [ - { - "language": "en_us", - "description": "[Purpur] Minecraft 1.21.3 Purpur", - "title": "Minecraft 1.21.3", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://api.purpurmc.org/v2/purpur/1.21.3/2358/download", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar purpur-1.21.3-2358.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "description": "[Purpur] Minecraft 1.21.1 Purpur", - "title": "Minecraft 1.21.1", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://api.purpurmc.org/v2/purpur/1.21.1/2329/download", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar purpur-1.21.1-2329.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "description": "[Purpur] Minecraft 1.20.6 Purpur", - "title": "Minecraft 1.20.6", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://api.purpurmc.org/v2/purpur/1.20.6/2233/download", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar purpur-1.20.6-2233.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "description": "[Purpur] Minecraft 1.20.4 Purpur", - "title": "Minecraft 1.20.4", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://api.purpurmc.org/v2/purpur/1.20.4/2176/download", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar purpur-1.20.4-2176.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "description": "[Purpur] Minecraft 1.20.1 Purpur", - "title": "Minecraft 1.20.1", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://api.purpurmc.org/v2/purpur/1.20.1/2062/download", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar purpur-1.20.1-2062.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "description": "[Purpur] Minecraft 1.19.2 Purpur", - "title": "Minecraft 1.19.2", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://api.purpurmc.org/v2/purpur/1.19.2/1858/download", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar purpur-1.19.2-1858.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "description": "[Purpur] Minecraft 1.18.2 Purpur", - "title": "Minecraft 1.18.2", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://api.purpurmc.org/v2/purpur/1.18.2/1632/download", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar purpur-1.18.2-1632.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "description": "[Purpur] Minecraft 1.17.1 Purpur", - "title": "Minecraft 1.17.1", - "runtime": "Java 16+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://api.purpurmc.org/v2/purpur/1.17.1/1428/download", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar purpur-1.17.1-1428.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "description": "[Purpur] Minecraft 1.16.5 Purpur", - "title": "Minecraft 1.16.5", - "runtime": "Java 8+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://api.purpurmc.org/v2/purpur/1.16.5/1171/download", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -jar purpur-1.16.5-1171.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, { "language": "en_us", "description": "[Paper] Minecraft 1.21.4 Paper", @@ -427,7 +256,7 @@ "updateCommand": "", "ie": "utf-8", "oe": "utf-8" - } + } }, { "language": "en_us", From 89e073e50c8a17216b963afea23f39a5ce9606b2 Mon Sep 17 00:00:00 2001 From: Antony Date: Tue, 14 Jan 2025 11:41:50 +0000 Subject: [PATCH 233/463] fix: Hopefully fix Purpur Server Versions --- templates.json | 171 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) diff --git a/templates.json b/templates.json index 9fd08b6..6fa5b4c 100644 --- a/templates.json +++ b/templates.json @@ -11,6 +11,177 @@ } ], "packages": [ + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.3 Purpur", + "title": "Minecraft 1.21.3", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.21.3-2358.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.21.3-2358.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.1 Purpur", + "title": "Minecraft 1.21.1", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.21.1-2329.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.21.1-2329.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.20.6 Purpur", + "title": "Minecraft 1.20.6", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.20.6-2233.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.20.6-2233.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.20.4 Purpur", + "title": "Minecraft 1.20.4", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.20.4-2176.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.20.4-2176.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.20.1 Purpur", + "title": "Minecraft 1.20.1", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.20.1-2062.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.20.1-2062.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.19.2 Purpur", + "title": "Minecraft 1.19.2", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.19.2-1858.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.19.2-1858.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.18.2 Purpur", + "title": "Minecraft 1.18.2", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.18.2-1632.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.18.2-1632.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.17.1 Purpur", + "title": "Minecraft 1.17.1", + "runtime": "Java 16+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.17.1-1428.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.17.1-1428.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.16.5 Purpur", + "title": "Minecraft 1.16.5", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.16.5-1171.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.16.5-1171.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "[Paper] Minecraft 1.21.4 Paper", From 8de943a90e3f6775509680c52614b09bd22a59ff Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Tue, 14 Jan 2025 15:32:18 +0100 Subject: [PATCH 234/463] fix: Update download links for Purpur to download from Releases --- templates.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/templates.json b/templates.json index 6fa5b4c..b4b55cb 100644 --- a/templates.json +++ b/templates.json @@ -19,7 +19,7 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.21.3-2358.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.3-2358.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java", @@ -38,7 +38,7 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.21.1-2329.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.1-2329.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java", @@ -57,7 +57,7 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.20.6-2233.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.6-2233.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java", @@ -76,7 +76,7 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.20.4-2176.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.4-2176.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java", @@ -95,7 +95,7 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.20.1-2062.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.1-2062.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java", @@ -114,7 +114,7 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.19.2-1858.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.19.2-1858.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java", @@ -133,7 +133,7 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.18.2-1632.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.18.2-1632.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java", @@ -152,7 +152,7 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.17.1-1428.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.17.1-1428.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java", @@ -171,7 +171,7 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/raw/refs/heads/master/purpur/purpur-1.16.5-1171.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.16.5-1171.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java", From d33a268aabdfebc378c5d98ecf8b61700ffa1b22 Mon Sep 17 00:00:00 2001 From: Antony Date: Thu, 16 Jan 2025 09:28:15 +0000 Subject: [PATCH 235/463] feat: Update Paper 1.21.4 Build to 114 --- templates.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates.json b/templates.json index b4b55cb..5a8534b 100644 --- a/templates.json +++ b/templates.json @@ -190,11 +190,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/109/downloads/paper-1.21.4-109.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/114/downloads/paper-1.21.4-114.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.21.4-109.jar nogui", + "startCommand": "java -jar paper-1.21.4-114.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From 7c63ad939d8024dbffa0816b61a84be667e65962 Mon Sep 17 00:00:00 2001 From: LuckCrafter <63189107+LuckCrafter@users.noreply.github.com> Date: Wed, 22 Jan 2025 20:25:15 +0100 Subject: [PATCH 236/463] fix: pacman, download only if needed --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index df2211b..02c7223 100644 --- a/setup.sh +++ b/setup.sh @@ -214,7 +214,7 @@ if [[ -x "$(command -v yum)" ]]; then elif [[ -x "$(command -v apt-get)" ]]; then apt-get install -y git tar wget elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm git tar wget + pacman -S --noconfirm --needed git tar wget elif [[ -x "$(command -v zypper)" ]]; then zypper --non-interactive install git tar wget else From 58f55d95ec4d2c9454e5ef2de9bb988206136965 Mon Sep 17 00:00:00 2001 From: Antony Date: Thu, 23 Jan 2025 07:38:08 +0100 Subject: [PATCH 237/463] Update Paper 1.21.4 Build to 121 --- templates.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates.json b/templates.json index 5a8534b..6be769c 100644 --- a/templates.json +++ b/templates.json @@ -190,11 +190,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/114/downloads/paper-1.21.4-114.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/121/downloads/paper-1.21.4-121.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.21.4-114.jar nogui", + "startCommand": "java -jar paper-1.21.4-121.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From 63edb89031b7b7e82b2498a38fc3227d718a6668 Mon Sep 17 00:00:00 2001 From: Antony Date: Sun, 26 Jan 2025 10:33:18 +0000 Subject: [PATCH 238/463] Update PaperMC 1.21.4 build to 126 --- templates.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates.json b/templates.json index 6be769c..61c26be 100644 --- a/templates.json +++ b/templates.json @@ -190,11 +190,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/121/downloads/paper-1.21.4-121.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/126/downloads/paper-1.21.4-126.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.21.4-121.jar nogui", + "startCommand": "java -jar paper-1.21.4-126.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From 3cea46de3685a97ae30907f6a0c073a04b31e1a4 Mon Sep 17 00:00:00 2001 From: Antony Date: Tue, 28 Jan 2025 10:38:58 +0000 Subject: [PATCH 239/463] Update 1.21.4 PaperMC Build to 130 --- templates.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates.json b/templates.json index 61c26be..309eb18 100644 --- a/templates.json +++ b/templates.json @@ -190,11 +190,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/126/downloads/paper-1.21.4-126.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/130/downloads/paper-1.21.4-130.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.21.4-126.jar nogui", + "startCommand": "java -jar paper-1.21.4-130.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From 7c02590058bd94648c8c388fbafc2c394f74474e Mon Sep 17 00:00:00 2001 From: Antony Date: Sat, 1 Feb 2025 10:15:28 +0000 Subject: [PATCH 240/463] Update PaperMC 1.21.4 Build to 136 --- templates.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates.json b/templates.json index 309eb18..f377747 100644 --- a/templates.json +++ b/templates.json @@ -190,11 +190,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/130/downloads/paper-1.21.4-130.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/136/downloads/paper-1.21.4-136.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.21.4-130.jar nogui", + "startCommand": "java -jar paper-1.21.4-136.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From d55f47f17f31de248a2453cd9b7eb6057ed9e4ab Mon Sep 17 00:00:00 2001 From: Antony Date: Wed, 5 Feb 2025 11:15:32 +0000 Subject: [PATCH 241/463] Update PaperMC 1.21.4 Builds to 138 --- templates.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates.json b/templates.json index f377747..f177d8b 100644 --- a/templates.json +++ b/templates.json @@ -190,11 +190,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/136/downloads/paper-1.21.4-136.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/138/downloads/paper-1.21.4-138.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.21.4-136.jar nogui", + "startCommand": "java -jar paper-1.21.4-138.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From 2d14480ab419df1f92c19972dcc2741ff4c30056 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Fri, 7 Feb 2025 10:11:44 +0100 Subject: [PATCH 242/463] Add first Stable Build of PurpurMC 1.21.4 --- templates.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/templates.json b/templates.json index f177d8b..983887b 100644 --- a/templates.json +++ b/templates.json @@ -11,6 +11,25 @@ } ], "packages": [ + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.4 Purpur", + "title": "Minecraft 1.21.4", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2389.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -jar purpur-1.21.4-2389.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "[Purpur] Minecraft 1.21.3 Purpur", From 6013d22cc4f5656e75bc98d7a2965ca28f67e37f Mon Sep 17 00:00:00 2001 From: Antony Date: Sun, 16 Feb 2025 15:32:51 +0100 Subject: [PATCH 243/463] Update PaperMC 1.21.4 Build Previous Version will stay in the releases until the PR is accepted --- templates.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates.json b/templates.json index 983887b..10d67b3 100644 --- a/templates.json +++ b/templates.json @@ -19,11 +19,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2389.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2394.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar purpur-1.21.4-2389.jar nogui", + "startCommand": "java -jar purpur-1.21.4-2394.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From 300a78ba0dc69108db0f3c88d754a4298db8cf2c Mon Sep 17 00:00:00 2001 From: Antony Date: Thu, 20 Feb 2025 09:04:12 +0100 Subject: [PATCH 244/463] Update PurpurMC 1.21.4 Build --- templates.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates.json b/templates.json index 10d67b3..83b1431 100644 --- a/templates.json +++ b/templates.json @@ -19,11 +19,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2394.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2398.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar purpur-1.21.4-2394.jar nogui", + "startCommand": "java -jar purpur-1.21.4-2398.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From 07c7e45bf66f2d97a4fae4de9b1f2eabbeb4ea06 Mon Sep 17 00:00:00 2001 From: Antony Date: Thu, 20 Feb 2025 09:06:22 +0100 Subject: [PATCH 245/463] Update PaperMC 1.21.4 Builds --- templates.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates.json b/templates.json index 83b1431..e1c2575 100644 --- a/templates.json +++ b/templates.json @@ -209,11 +209,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/138/downloads/paper-1.21.4-138.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/173/downloads/paper-1.21.4-173.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.21.4-138.jar nogui", + "startCommand": "java -jar paper-1.21.4-173.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From 7504839f25d3264a7fce66aea030bfc6bcba094b Mon Sep 17 00:00:00 2001 From: Antony Date: Thu, 20 Feb 2025 08:57:53 +0000 Subject: [PATCH 246/463] Update Forge Builds & Fix a Typo in the Forge Tips --- templates.json | 76 +++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/templates.json b/templates.json index e1c2575..f567240 100644 --- a/templates.json +++ b/templates.json @@ -469,178 +469,178 @@ }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.4 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.0.12/forge-1.21.4-54.0.12-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.1/forge-1.21.4-54.1.1-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.4-54.0.12-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.4-54.1.1-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.3 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.3-53.0.33/forge-1.21.3-53.0.33-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.3-53.0.53/forge-1.21.3-53.0.53-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.3-53.0.33-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.3-53.0.53-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.1 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.0.37/forge-1.21.1-52.0.37-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.0.53/forge-1.21.1-52.0.53-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.1-52.0.37-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.1-52.0.53-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.20.6 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.1.31/forge-1.20.6-50.1.31-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.1.48/forge-1.20.6-50.1.48-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.6-50.1.31-installer.jar --installServer", + "updateCommand": "java -jar forge-1.20.6-50.1.48-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.20.4 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.4-49.1.21/forge-1.20.4-49.1.21-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.4-49.1.36/forge-1.20.4-49.1.36-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.4-49.1.21-installer.jar --installServer", + "updateCommand": "java -jar forge-1.20.4-49.1.36-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.20.1 (Supports Mods)", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.3.22/forge-1.20.1-47.3.22-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.3.33/forge-1.20.1-47.3.33-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.1-47.3.22-installer.jar --installServer", + "updateCommand": "java -jar forge-1.20.1-47.3.33-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.19.4 (Supports Mods)", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.4-45.3.15/forge-1.19.4-45.3.15-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.4-45.3.24/forge-1.19.4-45.3.24-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.19.4-45.3.15-installer.jar --installServer", + "updateCommand": "java -jar forge-1.19.4-45.3.24-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.19.2 (Supports Mods)", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.4.12/forge-1.19.2-43.4.12-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.4.20/forge-1.19.2-43.4.20-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.19.2-43.4.12-installer.jar --installServer", + "updateCommand": "java -jar forge-1.19.2-43.4.20-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.18.2 (Supports Mods)", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.2.31/forge-1.18.2-40.2.31-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.3.6/forge-1.18.2-40.3.6-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.18.2-40.2.31-installer.jar --installServer", + "updateCommand": "java -jar forge-1.18.2-40.3.6-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.17.1 (Supports Mods)", "runtime": "Java 16+", "hardware": "RAM 8G+", @@ -659,7 +659,7 @@ }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.16.5 (Supports Mods)", "runtime": "Java 8+", "hardware": "RAM 8G+", @@ -678,7 +678,7 @@ }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.12.2 (Supports Mods)", "runtime": "Java 8+", "hardware": "RAM 8G+", @@ -697,7 +697,7 @@ }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.8.9 (Supports Mods)", "runtime": "Java 7+", "hardware": "RAM 8G+", @@ -716,7 +716,7 @@ }, { "language": "en_us", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"start.bat\" after installation.", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.7.10 (Supports Mods)", "runtime": "Java 7+", "hardware": "RAM 8G+", @@ -1235,13 +1235,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.2.32/forge-1.20.1-47.2.32-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.3.33/forge-1.20.1-47.3.33-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.1-47.2.32-installer.jar --installServer", + "updateCommand": "java -jar forge-1.20.1-47.3.33-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -1254,13 +1254,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.0.8/forge-1.20.6-50.0.8-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.1.48/forge-1.20.6-50.1.48-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.6-50.0.8-installer.jar --installServer", + "updateCommand": "java -jar forge-1.20.6-50.1.48-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -1273,13 +1273,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.3.13/forge-1.19.2-43.3.13-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.4.20/forge-1.19.2-43.4.20-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.19.2-43.3.13-installer.jar --installServer", + "updateCommand": "java -jar forge-1.19.2-43.4.20-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } From f5bfb2cf5a7f7298d6b85d1343d445ae102f463e Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 25 Feb 2025 14:26:48 +0800 Subject: [PATCH 247/463] feat: update install sh --- LICENSE | 2 +- README.md | 2 +- install_update.sh | 607 ------------------------------------------- install_update_cn.sh | 605 ------------------------------------------ package-lock.json | 6 - package.json | 8 - setup.sh | 227 ++++++++-------- setup_cn.sh | 10 +- 8 files changed, 117 insertions(+), 1350 deletions(-) delete mode 100644 install_update.sh delete mode 100644 install_update_cn.sh delete mode 100644 package-lock.json delete mode 100644 package.json diff --git a/LICENSE b/LICENSE index bfd24f9..83ffde2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Suwings +Copyright (c) 2025 MCSManager Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 8e861f7..e71e2f7 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,6 @@ The files here are all platform-wide install, delete, update scripts, etc. for MCSManager. -The default installation script on the official website is the `setup.sh` file of gitee repository, it contains multiple languages. +The default installation script on the official website is the `setup.sh` file of Github repository, it contains multiple languages. You can also use the following one-click command to perform a quick installation diff --git a/install_update.sh b/install_update.sh deleted file mode 100644 index c7986f7..0000000 --- a/install_update.sh +++ /dev/null @@ -1,607 +0,0 @@ -#!/bin/bash - -#Global varialbles -# System architecture -arch=$(uname -m) -# Install base dir -install_base="/opt" -# MCSM install dir -mcsmanager_install_path="${install_base}/mcsmanager" -# MCSM backup dir during upgrade -mcsm_backup_dir="${install_base}" -# Download URL -mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz " -# Node.js version to install -node="v20.12.2" -# MCSM Web dir name -mcsm_web="web" -# MCSM daemon dir name -mcsm_daemon="daemon" -# The date variable to be shared across functions -current_date=$(date +%Y_%m_%d) -# MCSM local temp dir for downloaded source -mcsm_down_temp="/opt/mcsmanager_${current_date}" -# Service file for MCSCM Web -service_file_web="/etc/systemd/system/mcsm-web.service" -# Service file for MCSM daemon -service_file_daemon="/etc/systemd/system/mcsm-daemon.service" -# Default systemd user is 'mcsm' -USER="mcsm" -COMMAND="all" -# Created backup absolute path -backup_path="" -# Downloaded package name -package_name="${mcsmanager_download_addr##*/}" -# Node.js install dir -node_install_path="" - -# Helper Functions -Usage() { - echo "Usage: $0 [-u user] [-c command]" - echo " -u Specify the user (mcsm or root), default is 'mcsm'" - echo " -c Specify the command (web, daemon, or all), default is 'all'" - exit 1 -} -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 -} -Echo_Cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} -Echo_Red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} - -Echo_Green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} - -Echo_Cyan_N() { - printf '\033[1;36m%b\033[0m' "$@" -} - -Echo_Yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} - -# Check root permission -Check_Sudo() { - if [ "$EUID" -ne 0 ]; then - echo "This script must be run as root. Please use \"sudo or root user\" instead." - exit 1 - fi -} - -Install_Dependencies() { - # Install related software - Echo_Cyan "[+] Installing dependent software (git, tar, wget)... " - if [[ -x "$(command -v yum)" ]]; then - yum install -y git tar wget - elif [[ -x "$(command -v apt-get)" ]]; then - apt-get install -y git tar wget - elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm git tar wget - elif [[ -x "$(command -v zypper)" ]]; then - zypper --non-interactive install git tar wget - else - Echo_Red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" - fi - - # Determine whether the relevant software is installed successfully - if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - Echo_Green "Success" - else - Red_Error "[x] Failed to find git, tar and wget, please install them manually!" - fi - -} - -Install_Node() { - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - Echo_Green "Desired Node.js is already installed at the target dir, bypassing installation..." - else - Echo_Cyan_N "[+] Install Node.js environment...\n" - - rm -irf "$node_install_path" - - cd /opt || Red_Error "[x] Failed to enter /opt" - - rm -rf "node-$node-linux-$arch.tar.gz" - - wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - - tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" - - rm -rf "node-$node-linux-$arch.tar.gz" - - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - Echo_Green "Success" - else - Red_Error "[x] Node installation failed!" - fi - fi - - - echo - Echo_Yellow "=============== Node.js Version ===============" - Echo_Yellow " node: $("$node_install_path"/bin/node -v)" - Echo_Yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - Echo_Yellow "=============== Node.js Version ===============" - echo - sleep 1 -} -# Check and download MCSM source -Check_And_Download_Source() { - # Empty the temp dir if existed - rm -rf "$mcsm_down_temp" - mkdir -p "$mcsm_down_temp" - - # Download the archive directly into the temporary directory - wget -O "${mcsm_down_temp}/${package_name}" "$mcsmanager_download_addr" || Red_Error "[x] Failed to download MCSManager releases..." - if [ $? -ne 0 ]; then - Red_Error "MCSManager Download failed." - fi - - # Extract the archive without changing directories - tar -xzf "${mcsm_down_temp}/${package_name}" -C "$mcsm_down_temp" - if [ $? -ne 0 ]; then - Red_Error "Extraction failed." - fi - - # Clean up the downloaded tar.gz file - rm "${mcsm_down_temp}/${package_name}" -} -# Detect architecture -Detect_Architecture() { - if [[ $arch == x86_64 ]]; then - arch="x64" - #echo "[-] x64 architecture detected" - elif [[ $arch == aarch64 ]]; then - arch="arm64" - #echo "[-] 64-bit ARM architecture detected" - elif [[ $arch == arm ]]; then - arch="armv7l" - #echo "[-] 32-bit ARM architecture detected" - elif [[ $arch == ppc64le ]]; then - arch="ppc64le" - #echo "[-] IBM POWER architecture detected" - elif [[ $arch == s390x ]]; then - arch="s390x" - #echo "[-] IBM LinuxONE architecture detected" - else - Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" - fi - - node_install_path="${install_base}/node-$node-linux-$arch" -} -# Initialization -Initialize() { - Echo_Cyan "+---------------------------------------------------------------------- -| MCSManager V10 Installation & Upgrading Script -+---------------------------------------------------------------------- - " - - # Check sudo - Check_Sudo - - # Update architecture - Detect_Architecture - - # Check if install base (/opt) exist - mkdir -p "$install_base" - - # Check dependencies - Install_Dependencies - - # Check and download MCSM source - Check_And_Download_Source - - # Parse input arguments - Parse_Arguments "$@" - - # Create mcsm user if needed - if [[ "$USER" == *"mcsm"* ]]; then - # Create the user 'mcsm' if it doesn't already exist - if ! id "mcsm" &>/dev/null; then - /usr/sbin/useradd mcsm - Echo_Green "User 'mcsm' created." - else - Echo_Yellow "User 'mcsm' already exists." - fi - fi -} - -Backup_MCSM() { - # Ensure both directories are provided - if [ -z "$mcsmanager_install_path" ] || [ -z "$mcsm_backup_dir" ]; then - Red_Error "Error: Backup or source path not set." - fi - - # Check if the source directory exists - if [ ! -d "$mcsmanager_install_path" ]; then - Red_Error "Error: Source directory does not exist." - fi - - # Create backup directory (/opt) if it doesn't exist - if [ ! -d "$mcsm_backup_dir" ]; then - Echo_Yellow "Creating backup directory." - mkdir -p "$mcsm_backup_dir" - fi - - # Define the backup path - backup_path="${mcsm_backup_dir}/mcsm_backup_${current_date}.tar.gz" - - # Create the backup - Echo_Yellow "Creating backup..." - #tar -czf "$backup_path" -C "$mcsmanager_install_path" . - tar -czf "$backup_path" -C "$(dirname "$mcsmanager_install_path")" "$(basename "$mcsmanager_install_path")" - - - # Check if the backup was successful - if [ $? -eq 0 ]; then - Echo_Green "Successfully created backup at $backup_path" - else - Red_Error "Error creating backup." - fi -} -# MCSM Web Base Installation -# Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source -Install_MCSM_Web_Base() { - # Move downloaded path - mv "${mcsm_down_temp}/${mcsm_web}" "$web_path" || - # Move helper file(s) - mv "${mcsm_down_temp}/start-web.sh" "${mcsmanager_install_path}/start-web.sh" - # Move back the data directory only if existed - if [ -d "$web_data_tmp" ]; then - rm -rf "$web_data" - mv "${web_data_tmp}" "${web_data}" - fi - # Dependencies install - cd "${web_path}" || Red_Error "[x] Failed to enter ${web_path}" - # Install dependencies - Echo_Cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${web_path}" - # Return to general dir - cd "$mcsmanager_install_path" - # Configure ownership if needed - if [[ "$USER" == *"mcsm"* ]]; then - # Change file permission to mcsm user - chown -R mcsm:mcsm "$web_path" - else - # Change file permission to root user - chown -R root:root "$web_path" - fi - chmod -R 755 "$web_path" -} -# MCSM Web Service Installation -Install_Web_Systemd() { - Echo_Cyan "[+] Creating MCSManager Web service..." - # stop and disable existing service - systemctl disable --now mcsm-web - - # delete existing service - rm -rf "$service_file_web" - systemctl daemon-reload - - # Create the default service file - echo "[Unit] -Description=MCSManager-Web - -[Service] -WorkingDirectory=${web_path} -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >"$service_file_web" - - # Add user section if using mcsm user - if [[ "$USER" == *"mcsm"* ]]; then - # Check if the 'User=mcsm' line already exists in the service file - if grep -q "^User=mcsm$" "$service_file_web"; then - echo "The service file is configured already." - else - # Add 'User=mcsm' to the service file - sed -i '/^\[Service\]$/a User=mcsm' "$service_file_web" - fi - fi - # Reload Systemd Service - systemctl daemon-reload - systemctl enable --now mcsm-web -} - -# MCSM Web Update & Installation -Install_Web_Wrapper() { - web_path="${mcsmanager_install_path}/${mcsm_web}" - web_data="${web_path}/data" - web_data_tmp="${mcsmanager_install_path}/web_data_${current_date}" - if [ -d "$web_path" ]; then - Echo_Cyan "[+] Updating MCSManager Web..." - # The backup should be created already, moving the DATA dir to /opt/mcsmanager/web_data should be fast and safe. - # Use web_data, do not use data as in rare circumstance user may run both update at the same time. - # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) - mv "$web_data" "$web_data_tmp" - # Remove the old web dir - rm -rf "$web_path" - - else - Echo_Cyan "[+] Install MCSManager Web..." - fi - - - # Install MCSM Web - Install_MCSM_Web_Base - - # Install MCSM Web Service - Install_Web_Systemd -} - -# MCSM Daemon Base Installation -# Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source -Install_MCSM_Daemon_Base() { - # Move downloaded path - mv "${mcsm_down_temp}/${mcsm_daemon}" "$daemon_path" || - # Move helper file(s) - mv "${mcsm_down_temp}/start-daemon.sh" "${mcsmanager_install_path}/start-daemon.sh" - - # Move back the data directory only if existed - if [ -d "$daemon_data_tmp" ]; then - rm -rf "$daemon_data" - mv "${daemon_data_tmp}" "${daemon_data}" - fi - # Dependencies install - cd "${daemon_path}" || Red_Error "[x] Failed to enter ${daemon_path}" - # Install dependencies - Echo_Cyan "[+] Install MCSManager-Daemon dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${daemon_path}" - # Return to general dir - cd "$mcsmanager_install_path" - # Configure ownership if needed - if [[ "$USER" == *"mcsm"* ]]; then - # Change file permission to mcsm user - chown -R mcsm:mcsm "$daemon_path" - else - # Change file permission to root user - chown -R root:root "$daemon_path" - fi - chmod -R 755 "$daemon_path" -} - -# MCSM Daemon Service Installation -Install_Daemon_Systemd() { - Echo_Cyan "[+] Creating MCSManager Daemon service..." - # stop and disable existing service - systemctl disable --now mcsm-daemon - - # delete existing service - rm -rf "$service_file_daemon" - systemctl daemon-reload - - # Create the default service file - echo "[Unit] -Description=MCSManager-Daemon - -[Service] -WorkingDirectory=${daemon_path} -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >"$service_file_daemon" - - # Add user section if using mcsm user - if [[ "$USER" == *"mcsm"* ]]; then - # Check if the 'User=mcsm' line already exists in the service file - if grep -q "^User=mcsm$" "$service_file_daemon"; then - echo "The service file is configured already." - else - # Add 'User=mcsm' to the service file - sed -i '/^\[Service\]$/a User=mcsm' "$service_file_daemon" - fi - fi - # Reload Systemd Service - systemctl daemon-reload - systemctl enable --now mcsm-daemon -} -# MCSM Web Update & Installation -Install_Daemon_Wrapper() { - daemon_path="${mcsmanager_install_path}/${mcsm_daemon}" - daemon_data="${daemon_path}/data" - daemon_data_tmp="${mcsmanager_install_path}/daemon_data_${current_date}" - if [ -d "$daemon_path" ]; then - Echo_Cyan "[+] Updating MCSManager Daemon..." - # The backup should be created already, moving the DATA dir to /opt/mcsmanager/daemon_data should be fast and safe. - # Use daemon_data, do not use data as in rare circumstance user may run both update at the same time. - # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) - mv "$daemon_data" "$daemon_data_tmp" - # Remove the old daemon dir - rm -rf "$daemon_path" - - else - Echo_Cyan "[+] Install MCSManager daemon..." - fi - - # Install MCSM Web - Install_MCSM_Daemon_Base - - # Install MCSM Web Service - Install_Daemon_Systemd -} -# Arguments parsing -Parse_Arguments() { - while getopts "u:c:" opt; do - case ${opt} in - u ) - if [[ "${OPTARG}" == "mcsm" || "${OPTARG}" == "root" ]]; then - USER="${OPTARG}" - else - echo "Invalid user specified." - Usage - fi - ;; - c ) - if [[ "${OPTARG}" == "web" || "${OPTARG}" == "daemon" || "${OPTARG}" == "all" ]]; then - COMMAND="${OPTARG}" - else - echo "Invalid command specified." - Usage - fi - ;; - \? ) - Usage - ;; - : ) - echo "Option -$OPTARG requires an argument." - Usage - ;; - esac - done -} - -# Wrapper for installation -Install_Update() { - case "$COMMAND" in - all) - Install_Web_Wrapper - Install_Daemon_Wrapper - ;; - - web) - Install_Web_Wrapper - ;; - - daemon) - Install_Daemon_Wrapper - ;; - - *) - echo "Unknown command: $COMMAND, this should not happen in general :( Please report this bug." - # Exit with an error if COMMAND is unrecognized - exit 1 - ;; - esac -} -# Finalize installation -Finalize() { - #Clear screen - clear - #printf "\n\n\n\n" - echo "______ _______________________ ___" - echo "___ |/ /_ ____/_ ___/__ |/ /_____ _____________ _______ _____________" - echo "__ /|_/ /_ / _____ \__ /|_/ /_ __ \`/_ __ \ __ \`/_ __ \`/ _ \_ ___/" - echo "_ / / / / /___ ____/ /_ / / / / /_/ /_ / / / /_/ /_ /_/ // __/ /" - echo "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" - echo " /____/" - - case "$COMMAND" in - all) - Echo_Yellow "==================================================================" - Echo_Green "Installation is complete! Welcome to the MCSManager V10!!!" - Echo_Yellow " " - Echo_Cyan_N "HTTP Web Service: " - Echo_Yellow "http://:23333 (Browser)" - Echo_Cyan_N "Daemon Address: " - Echo_Yellow "ws://:24444 (Cluster)" - Echo_Red "You must expose ports 23333 and 24444 to use the service properly on the Internet." - Echo_Yellow " " - Echo_Cyan "Usage:" - Echo_Cyan "systemctl start mcsm-{daemon,web}.service" - Echo_Cyan "systemctl stop mcsm-{daemon,web}.service" - Echo_Cyan "systemctl restart mcsm-{daemon,web}.service" - Echo_Yellow " " - Echo_Green "Official Document: https://docs.mcsmanager.com/" - Echo_Yellow "==================================================================" - ;; - - web) - Echo_Yellow "==================================================================" - Echo_Green "Installation is complete! Welcome to the MCSManager V10!!!" - Echo_Yellow " " - Echo_Cyan_N "HTTP Web Service: " - Echo_Yellow "http://:23333 (Browser)" - Echo_Red "You must expose port 23333 to use the service properly on the Internet." - Echo_Yellow " " - Echo_Cyan "Usage:" - Echo_Cyan "systemctl start mcsm-web.service" - Echo_Cyan "systemctl stop mcsm-web.service" - Echo_Cyan "systemctl restart mcsm-web.service" - Echo_Yellow " " - Echo_Green "Official Document: https://docs.mcsmanager.com/" - Echo_Yellow "==================================================================" - ;; - - daemon) - Echo_Yellow "==================================================================" - Echo_Green "Installation is complete! Welcome to the MCSManager V10!!!" - Echo_Yellow " " - Echo_Cyan_N "Daemon Address: " - Echo_Yellow "ws://:24444 (Cluster)" - Echo_Red "You must expose port 24444 to use the service properly on the Internet." - Echo_Yellow " " - Echo_Cyan "Usage:" - Echo_Cyan "systemctl start mcsm-daemon.service" - Echo_Cyan "systemctl stop mcsm-daemon.service" - Echo_Cyan "systemctl restart mcsm-daemon.service" - Echo_Yellow " " - Echo_Green "Official Document: https://docs.mcsmanager.com/" - Echo_Yellow "==================================================================" - ;; - - *) - echo "Unknown command: $COMMAND, this should not happen in general :( Please report this bug." - # Exit with an error if COMMAND is unrecognized - exit 1 - ;; - esac - # Check if backup_path is not empty - if [[ -n "$backup_path" ]]; then - Echo_Green "Your MCSM has been updated from a previous installation. " - Echo_Green "A complete backup was created at:" - Echo_Yellow "$backup_path" - Echo_Green "You can manually delete the backup using command: " - Echo_Red "rm ${backup_path}" - fi - # Move quickstart.md - # mv "${mcsm_down_temp}/quick-start.md" "${mcsmanager_install_path}/quick-start.md" - # Remove the temp folder - rm -rf "${mcsm_down_temp}" - - -} -########### Main Logic ################ -Main() { - # Do not create mcsmanager path yet as it will break the logic detecting existing installation - Initialize "$@" - # Check if the mcsmanager_install_path exists - if [ -d "$mcsmanager_install_path" ]; then - # Backup first, due to potential large file being archived, backup is disabled. - # Backup_MCSM - # Install Node.js, this is to ensure the version is up to date. - Install_Node - - else - # Create mcsmanager path if not already - mkdir -p "$mcsmanager_install_path" - # Install Node.js, this is to ensure the version is up to date. - Install_Node - fi - - # Install Services based on command - Install_Update - - # Print helping Information - Finalize - - Echo_Green "Installation/Upgrading Complete!" -} - -Main "$@" \ No newline at end of file diff --git a/install_update_cn.sh b/install_update_cn.sh deleted file mode 100644 index 3da4b81..0000000 --- a/install_update_cn.sh +++ /dev/null @@ -1,605 +0,0 @@ -#!/bin/bash - -#Global varialbles -# System architecture -arch=$(uname -m) -# Install base dir -install_base="/opt" -# MCSM install dir -mcsmanager_install_path="${install_base}/mcsmanager" -# MCSM backup dir during upgrade -mcsm_backup_dir="${install_base}" -# Download URL -mcsmanager_download_addr="http://oss.duzuii.com/d/MCSManager/MCSManager/MCSManager-v10-linux.tar.gz" -# Node.js version to install -node="v16.20.2" -# MCSM Web dir name -mcsm_web="web" -# MCSM daemon dir name -mcsm_daemon="daemon" -# The date variable to be shared across functions -current_date=$(date +%Y_%m_%d) -# MCSM local temp dir for downloaded source -mcsm_down_temp="/opt/mcsmanager_${current_date}" -# Service file for MCSCM Web -service_file_web="/etc/systemd/system/mcsm-web.service" -# Service file for MCSM daemon -service_file_daemon="/etc/systemd/system/mcsm-daemon.service" -# Default systemd user is 'mcsm' -USER="mcsm" -COMMAND="all" -# Created backup absolute path -backup_path="" -# Downloaded package name -package_name="${mcsmanager_download_addr##*/}" -# Node.js install dir -node_install_path="" - -# Helper Functions -usage() { - echo "Usage: $0 [-u user] [-c command]" - echo " -u 指定用户安装 (mcsm 或 root), 默认是 'mcsm'" - echo " -c 安装指定组件 (web, daemon, 或 all), 默认是 'all'" - exit 1 -} -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 -} -Echo_Cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} -Echo_Red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} - -Echo_Green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} - -Echo_Cyan_N() { - printf '\033[1;36m%b\033[0m' "$@" -} - -Echo_Yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} -# Check root permission -Check_Sudo() { - if [ "$EUID" -ne 0 ]; then - echo "This script must be run as root. Please use \"sudo or root user\" instead." - exit 1 - fi -} - -Install_Dependencies() { - # Install related software - Echo_Cyan "[+] 正在安装依赖软件 (git, tar, wget)... " - if [[ -x "$(command -v yum)" ]]; then - yum install -y git tar wget - elif [[ -x "$(command -v apt-get)" ]]; then - apt-get install -y git tar wget - elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm git tar wget - elif [[ -x "$(command -v zypper)" ]]; then - zypper --non-interactive install git tar wget - else - Echo_Red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" - fi - - # Determine whether the relevant software is installed successfully - if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - Echo_Green "成功!" - else - Red_Error "[x] Failed to find git, tar and wget, please install them manually!" - fi - -} - -Install_Node() { - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - Echo_Green "检测到已安装的Node.js版本, 已为您跳过安装." - else - Echo_Cyan_N "[+] 安装 Node.js 环境中...\n" - - rm -irf "$node_install_path" - - cd /opt || Red_Error "[x] Failed to enter /opt" - - rm -rf "node-$node-linux-$arch.tar.gz" - - wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - - tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" - - rm -rf "node-$node-linux-$arch.tar.gz" - - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - Echo_Green "Success" - else - Red_Error "[x] Node installation failed!" - fi - fi - - - echo - Echo_Yellow "=============== Node.js 版本 ===============" - Echo_Yellow " node: $("$node_install_path"/bin/node -v)" - Echo_Yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - Echo_Yellow "=============== Node.js 版本 ===============" - echo - sleep 1 -} -# Check and download MCSM source -Check_And_Download_Source() { - # Empty the temp dir if existed - rm -rf "$mcsm_down_temp" - mkdir -p "$mcsm_down_temp" - - # Download the archive directly into the temporary directory - wget -O "${mcsm_down_temp}/${package_name}" "$mcsmanager_download_addr" || Red_Error "[x] Failed to download MCSManager releases..." - if [ $? -ne 0 ]; then - Red_Error "MCSManager Download failed." - fi - - # Extract the archive without changing directories - tar -xzf "${mcsm_down_temp}/${package_name}" -C "$mcsm_down_temp" - if [ $? -ne 0 ]; then - Red_Error "Extraction failed." - fi - - # Clean up the downloaded tar.gz file - rm "${mcsm_down_temp}/${package_name}" -} -# Detect architecture -Detect_Architecture() { - if [[ $arch == x86_64 ]]; then - arch="x64" - #echo "[-] x64 architecture detected" - elif [[ $arch == aarch64 ]]; then - arch="arm64" - #echo "[-] 64-bit ARM architecture detected" - elif [[ $arch == arm ]]; then - arch="armv7l" - #echo "[-] 32-bit ARM architecture detected" - elif [[ $arch == ppc64le ]]; then - arch="ppc64le" - #echo "[-] IBM POWER architecture detected" - elif [[ $arch == s390x ]]; then - arch="s390x" - #echo "[-] IBM LinuxONE architecture detected" - else - Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" - fi - - node_install_path="${install_base}/node-$node-linux-$arch" -} -# Initialization -Initialize() { - Echo_Cyan "+---------------------------------------------------------------------- -| MCSManager V10 安装升级脚本 -+---------------------------------------------------------------------- - " - # Check sudo - Check_Sudo - - # Update architecture - Detect_Architecture - - # Check if install base (/opt) exist - mkdir -p "$install_base" - - # Check dependencies - Install_Dependencies - - # Check and download MCSM source - Check_And_Download_Source - - # Parse input arguments - Parse_Arguments "$@" - - # Create mcsm user if needed - if [[ "$USER" == *"mcsm"* ]]; then - # Create the user 'mcsm' if it doesn't already exist - if ! id "mcsm" &>/dev/null; then - /usr/sbin/useradd mcsm - Echo_Green "用户 'mcsm' 已创建." - else - Echo_Yellow "用户 'mcsm' 已经存在." - fi - fi -} - -Backup_MCSM() { - # Ensure both directories are provided - if [ -z "$mcsmanager_install_path" ] || [ -z "$mcsm_backup_dir" ]; then - Red_Error "错误: 备份或源路径为空." - fi - - # Check if the source directory exists - if [ ! -d "$mcsmanager_install_path" ]; then - Red_Error "错误: 源目录不存在." - fi - - # Create backup directory (/opt) if it doesn't exist - if [ ! -d "$mcsm_backup_dir" ]; then - Echo_Yellow "正在创建备份目录..." - mkdir -p "$mcsm_backup_dir" - fi - - # Define the backup path - backup_path="${mcsm_backup_dir}/mcsm_backup_${current_date}.tar.gz" - - # Create the backup - Echo_Yellow "正在创建备份..." - #tar -czf "$backup_path" -C "$mcsmanager_install_path" . - tar -czf "$backup_path" -C "$(dirname "$mcsmanager_install_path")" "$(basename "$mcsmanager_install_path")" - - - # Check if the backup was successful - if [ $? -eq 0 ]; then - Echo_Green "成功创建了备份,位于: $backup_path" - else - Red_Error "创建备份时出错" - fi -} -# MCSM Web Base Installation -# Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source -Install_MCSM_Web_Base() { - # Move downloaded path - mv "${mcsm_down_temp}/${mcsm_web}" "$web_path" || - # Move helper file(s) - mv "${mcsm_down_temp}/start-web.sh" "${mcsmanager_install_path}/start-web.sh" - # Move back the data directory only if existed - if [ -d "$web_data_tmp" ]; then - rm -rf "$web_data" - mv "${web_data_tmp}" "${web_data}" - fi - # Dependencies install - cd "${web_path}" || Red_Error "[x] Failed to enter ${web_path}" - # Install dependencies - Echo_Cyan "[+] 安装 MCSManager 网页依赖中..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] 在 ${web_path} 安装依赖时出错." - # Return to general dir - cd "$mcsmanager_install_path" - # Configure ownership if needed - if [[ "$USER" == *"mcsm"* ]]; then - # Change file permission to mcsm user - chown -R mcsm:mcsm "$web_path" - else - # Change file permission to root user - chown -R root:root "$web_path" - fi - chmod -R 755 "$web_path" -} -# MCSM Web Service Installation -Install_Web_Systemd() { - Echo_Cyan "[+] 创建 MCSManager 网页服务中..." - # stop and disable existing service - systemctl disable --now mcsm-web - - # delete existing service - rm -rf "$service_file_web" - systemctl daemon-reload - - # Create the default service file - echo "[Unit] -Description=MCSManager-Web - -[Service] -WorkingDirectory=${web_path} -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >"$service_file_web" - - # Add user section if using mcsm user - if [[ "$USER" == *"mcsm"* ]]; then - # Check if the 'User=mcsm' line already exists in the service file - if grep -q "^User=mcsm$" "$service_file_web"; then - echo "The service file is configured already." - else - # Add 'User=mcsm' to the service file - sed -i '/^\[Service\]$/a User=mcsm' "$service_file_web" - fi - fi - # Reload Systemd Service - systemctl daemon-reload - systemctl enable --now mcsm-web -} - -# MCSM Web Update & Installation -Install_Web_Wrapper() { - web_path="${mcsmanager_install_path}/${mcsm_web}" - web_data="${web_path}/data" - web_data_tmp="${mcsmanager_install_path}/web_data_${current_date}" - if [ -d "$web_path" ]; then - Echo_Cyan "[+] 升级 MCSManager 网页端中..." - # The backup should be created already, moving the DATA dir to /opt/mcsmanager/web_data should be fast and safe. - # Use web_data, do not use data as in rare circumstance user may run both update at the same time. - # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) - mv "$web_data" "$web_data_tmp" - # Remove the old web dir - rm -rf "$web_path" - - else - Echo_Cyan "[+] 安装 MCSManager 网页端中..." - fi - - - # Install MCSM Web - Install_MCSM_Web_Base - - # Install MCSM Web Service - Install_Web_Systemd -} - -# MCSM Daemon Base Installation -# Assuming a fresh install (i.e. no file(s) from previous installation) and downloaded source -Install_MCSM_Daemon_Base() { - # Move downloaded path - mv "${mcsm_down_temp}/${mcsm_daemon}" "$daemon_path" || - # Move helper file(s) - mv "${mcsm_down_temp}/start-daemon.sh" "${mcsmanager_install_path}/start-daemon.sh" - - # Move back the data directory only if existed - if [ -d "$daemon_data_tmp" ]; then - rm -rf "$daemon_data" - mv "${daemon_data_tmp}" "${daemon_data}" - fi - # Dependencies install - cd "${daemon_path}" || Red_Error "[x] Failed to enter ${daemon_path}" - # Install dependencies - Echo_Cyan "[+] 安装 MCSManager 节点依赖中..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${daemon_path}" - # Return to general dir - cd "$mcsmanager_install_path" - # Configure ownership if needed - if [[ "$USER" == *"mcsm"* ]]; then - # Change file permission to mcsm user - chown -R mcsm:mcsm "$daemon_path" - else - # Change file permission to root user - chown -R root:root "$daemon_path" - fi - chmod -R 755 "$daemon_path" -} - -# MCSM Daemon Service Installation -Install_Daemon_Systemd() { - Echo_Cyan "[+] 创建 MCSManager 节点服务中..." - # stop and disable existing service - systemctl disable --now mcsm-daemon - - # delete existing service - rm -rf "$service_file_daemon" - systemctl daemon-reload - - # Create the default service file - echo "[Unit] -Description=MCSManager-Daemon - -[Service] -WorkingDirectory=${daemon_path} -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >"$service_file_daemon" - - # Add user section if using mcsm user - if [[ "$USER" == *"mcsm"* ]]; then - # Check if the 'User=mcsm' line already exists in the service file - if grep -q "^User=mcsm$" "$service_file_daemon"; then - echo "The service file is configured already." - else - # Add 'User=mcsm' to the service file - sed -i '/^\[Service\]$/a User=mcsm' "$service_file_daemon" - fi - fi - # Reload Systemd Service - systemctl daemon-reload - systemctl enable --now mcsm-daemon -} -# MCSM Web Update & Installation -Install_Daemon_Wrapper() { - daemon_path="${mcsmanager_install_path}/${mcsm_daemon}" - daemon_data="${daemon_path}/data" - daemon_data_tmp="${mcsmanager_install_path}/daemon_data_${current_date}" - if [ -d "$daemon_path" ]; then - Echo_Cyan "[+] 升级 MCSManager 节点中..." - # The backup should be created already, moving the DATA dir to /opt/mcsmanager/daemon_data should be fast and safe. - # Use daemon_data, do not use data as in rare circumstance user may run both update at the same time. - # Use mv command, this won't create issue in case of an incomplete previous installation (e.g. empty mcsm dir) - mv "$daemon_data" "$daemon_data_tmp" - # Remove the old daemon dir - rm -rf "$daemon_path" - - else - Echo_Cyan "[+] 安装 MCSManager 节点中..." - fi - - # Install MCSM Web - Install_MCSM_Daemon_Base - - # Install MCSM Web Service - Install_Daemon_Systemd -} -# Arguments parsing -Parse_Arguments() { - while getopts "u:c:" opt; do - case ${opt} in - u ) - if [[ "${OPTARG}" == "mcsm" || "${OPTARG}" == "root" ]]; then - USER="${OPTARG}" - else - echo "Invalid user specified." - usage - fi - ;; - c ) - if [[ "${OPTARG}" == "web" || "${OPTARG}" == "daemon" || "${OPTARG}" == "all" ]]; then - COMMAND="${OPTARG}" - else - echo "Invalid command specified." - usage - fi - ;; - \? ) - usage - ;; - : ) - echo "Option -$OPTARG requires an argument." - usage - ;; - esac - done -} - -# Wrapper for installation -Install_Update() { - case "$COMMAND" in - all) - Install_Web_Wrapper - Install_Daemon_Wrapper - ;; - - web) - Install_Web_Wrapper - ;; - - daemon) - Install_Daemon_Wrapper - ;; - - *) - echo "Unknown command: $COMMAND, this should not happen in general :( Please report this bug." - # Exit with an error if COMMAND is unrecognized - exit 1 - ;; - esac -} -# Finalize installation -Finalize() { - #Clear screen - clear - #printf "\n\n\n\n" - echo "______ _______________________ ___" - echo "___ |/ /_ ____/_ ___/__ |/ /_____ _____________ _______ _____________" - echo "__ /|_/ /_ / _____ \__ /|_/ /_ __ \`/_ __ \ __ \`/_ __ \`/ _ \_ ___/" - echo "_ / / / / /___ ____/ /_ / / / / /_/ /_ / / / /_/ /_ /_/ // __/ /" - echo "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" - echo " /____/" - - case "$COMMAND" in - all) - Echo_Yellow "==================================================================" - Echo_Green "安装已完成! 欢迎使用 MCSManager V10!!!" - Echo_Yellow " " - Echo_Cyan_N "网页 服务: " - Echo_Yellow "http://<您的 IP>:23333 (Browser)" - Echo_Cyan_N "节点 地址: " - Echo_Yellow "ws://<您的 IP>:24444 (Cluster)" - Echo_Red "您必须开放 23333 与 24444 端口才可以正常从公网访问" - Echo_Yellow " " - Echo_Cyan "使用方法:" - Echo_Cyan "启动: systemctl start mcsm-{daemon,web}.service" - Echo_Cyan "关闭: systemctl stop mcsm-{daemon,web}.service" - Echo_Cyan "重启: systemctl restart mcsm-{daemon,web}.service" - Echo_Yellow " " - Echo_Green "官方文档: https://docs.mcsmanager.com/" - Echo_Yellow "==================================================================" - ;; - - web) - Echo_Yellow "==================================================================" - Echo_Green "安装已完成! 欢迎使用 MCSManager V10!!!" - Echo_Yellow " " - Echo_Cyan_N "网页 服务: " - Echo_Yellow "http://<您的 IP>:23333 (Browser)" - Echo_Red "您必须开放 23333 端口才可以正常从公网访问" - Echo_Yellow " " - Echo_Cyan "使用方法:" - Echo_Cyan "启动: systemctl start mcsm-{daemon,web}.service" - Echo_Cyan "关闭: systemctl stop mcsm-{daemon,web}.service" - Echo_Cyan "重启: systemctl restart mcsm-{daemon,web}.service" - Echo_Yellow " " - Echo_Green "官方文档: https://docs.mcsmanager.com/" - Echo_Yellow "==================================================================" - ;; - - daemon) - Echo_Yellow "==================================================================" - Echo_Green "安装已完成! 欢迎使用 MCSManager V10!!!" - Echo_Yellow " " - Echo_Cyan_N "节点 地址: " - Echo_Yellow "ws://<您的 IP>:24444 (Cluster)" - Echo_Red "您必须开放 24444 端口才可以正常从公网访问" - Echo_Yellow " " - Echo_Cyan "使用方法:" - Echo_Cyan "启动: systemctl start mcsm-{daemon,web}.service" - Echo_Cyan "关闭: systemctl stop mcsm-{daemon,web}.service" - Echo_Cyan "重启: systemctl restart mcsm-{daemon,web}.service" - Echo_Yellow " " - Echo_Green "官方文档: https://docs.mcsmanager.com/" - Echo_Yellow "==================================================================" - ;; - - *) - echo "Unknown command: $COMMAND, this should not happen in general :( Please report this bug." - # Exit with an error if COMMAND is unrecognized - exit 1 - ;; - esac - # Check if backup_path is not empty - if [[ -n "$backup_path" ]]; then - Echo_Green "您的MCSManager是由一个已存在的版本升级而来. " - Echo_Green "我们已经为您创建了一个备份, 位于:" - Echo_Yellow "$backup_path" - Echo_Green "如果需要, 您可以使用下列命令手动删除备份: " - Echo_Red "rm ${backup_path}" - fi - # Move quickstart.md - # mv "${mcsm_down_temp}/quick-start.md" "${mcsmanager_install_path}/quick-start.md" - # Remove the temp folder - rm -rf "${mcsm_down_temp}" - - -} -########### Main Logic ################ -Main() { - # Do not create mcsmanager path yet as it will break the logic detecting existing installation - Initialize "$@" - # Check if the mcsmanager_install_path exists - if [ -d "$mcsmanager_install_path" ]; then - # Backup first, due to potential large file being archived, backup is disabled. - # Backup_MCSM - # Install Node.js, this is to ensure the version is up to date. - Install_Node - - else - # Create mcsmanager path if not already - mkdir -p "$mcsmanager_install_path" - # Install Node.js, this is to ensure the version is up to date. - Install_Node - fi - - # Install Services based on command - Install_Update - - # Print helping Information - Finalize - - Echo_Green "安装或升级已完成!" -} - -Main "$@" \ No newline at end of file diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 6946f74..0000000 --- a/package-lock.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "MCSManager-Script", - "lockfileVersion": 3, - "requires": true, - "packages": {} -} diff --git a/package.json b/package.json deleted file mode 100644 index d7e12cf..0000000 --- a/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "mcsmanager-script", - "version": "1.0.0", - "scripts": { - "build": "echo 1" - }, - "license": "MIT" -} diff --git a/setup.sh b/setup.sh index 02c7223..e005b7b 100644 --- a/setup.sh +++ b/setup.sh @@ -1,34 +1,33 @@ #!/bin/bash +# Official installation script. mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="http://47.99.81.8/mcsmanager_linux_release.tar.gz" +mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/download/v10.5.0/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" node="v20.12.2" arch=$(uname -m) if [ "$(id -u)" -ne 0]; then - echo "This script must be run as root. Please use \"sudo bash\" instead." - exit 1 + echo "This script must be run as root. Please use \"sudo bash\" instead." + exit 1 fi printf "\033c" echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" + printf '\033[1;36m%b\033[0m\n' "$@" } echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" + printf '\033[1;31m%b\033[0m\n' "$@" } echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" + printf '\033[1;32m%b\033[0m\n' "$@" } - echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" + printf '\033[1;36m%b\033[0m' "$@" } - echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" + printf '\033[1;33m%b\033[0m\n' "$@" } # script info @@ -38,92 +37,92 @@ echo_cyan "+-------------------------------------------------------------------- " Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 } Install_Node() { - echo_cyan_n "[+] Install Node.JS environment...\n" - - rm -irf "$node_install_path" + echo_cyan_n "[+] Install Node.JS environment...\n" - cd /opt || Red_Error "[x] Failed to enter /opt" + rm -irf "$node_install_path" - rm -rf "node-$node-linux-$arch.tar.gz" + cd /opt || Red_Error "[x] Failed to enter /opt" - wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + rm -rf "node-$node-linux-$arch.tar.gz" - tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" + wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - rm -rf "node-$node-linux-$arch.tar.gz" + tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Success" - else - Red_Error "[x] Node installation failed!" - fi + rm -rf "node-$node-linux-$arch.tar.gz" - echo - echo_yellow "=============== Node.JS Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" - echo - - sleep 3 + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Success" + else + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node.JS Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node.JS Version ===============" + echo + + sleep 3 } Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." + echo_cyan "[+] Install MCSManager..." - # stop service - systemctl disable --now mcsm-{web,daemon} + # stop service + systemctl disable --now mcsm-{web,daemon} - # delete service - rm -rf /etc/systemd/system/mcsm-{daemon,web}.service - systemctl daemon-reload + # delete service + rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + systemctl daemon-reload - mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" - # cd /opt/mcsmanager - cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" + # cd /opt/mcsmanager + cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" - # download MCSManager release - wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" - tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" - rm -rf "${mcsmanager_install_path}/${package_name}" + # download MCSManager release + wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" + tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" + rm -rf "${mcsmanager_install_path}/${package_name}" - # echo "[→] cd daemon" - cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" + # echo "[→] cd daemon" + cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" - # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" + # echo "[←] cd .." + cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - echo_cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" + echo_cyan "[+] Install MCSManager-Web dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" - echo - echo_yellow "=============== MCSManager ===============" - echo_green "Daemon: ${mcsmanager_install_path}/daemon" - echo_green "Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" + echo + echo_yellow "=============== MCSManager ===============" + echo_green "Daemon: ${mcsmanager_install_path}/daemon" + echo_green "Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" - chmod -R 755 "$mcsmanager_install_path" + chmod -R 755 "$mcsmanager_install_path" - sleep 3 + sleep 3 } Create_Service() { - echo_cyan "[+] Create MCSManager service..." + echo_cyan "[+] Create MCSManager service..." - echo "[Unit] + echo "[Unit] Description=MCSManager-Daemon [Service] @@ -137,7 +136,7 @@ Environment=\"PATH=${PATH}\" WantedBy=multi-user.target " >/etc/systemd/system/mcsm-daemon.service - echo "[Unit] + echo "[Unit] Description=MCSManager-Web [Service] @@ -151,54 +150,54 @@ Environment=\"PATH=${PATH}\" WantedBy=multi-user.target " >/etc/systemd/system/mcsm-web.service - systemctl daemon-reload - systemctl enable --now mcsm-{daemon,web}.service - echo_green "Registered!" - - sleep 2 - - printf "\n\n\n\n" - - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: " - echo_yellow "http://:23333 (Browser)" - echo_cyan_n "Daemon Address: " - echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports " - echo_yellow "23333" - echo_red " and " - echo_yellow "24444" - echo_red " to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + systemctl daemon-reload + systemctl enable --now mcsm-{daemon,web}.service + echo_green "Registered!" + + sleep 2 + + printf "\n\n\n\n" + + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" + echo_cyan_n "Daemon Address: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose ports " + echo_yellow "23333" + echo_red " and " + echo_yellow "24444" + echo_red " to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" } # Environmental inspection if [[ "$arch" == x86_64 ]]; then - arch=x64 - #echo "[-] x64 architecture detected" + arch=x64 + #echo "[-] x64 architecture detected" elif [[ $arch == aarch64 ]]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" elif [[ $arch == arm ]]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" elif [[ $arch == ppc64le ]]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" + arch=ppc64le + #echo "[-] IBM POWER architecture detected" elif [[ $arch == s390x ]]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" else - Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" + Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" fi # Define the variable Node installation directory @@ -210,22 +209,22 @@ echo_cyan "[-] Architecture: $arch" # Install related software echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " if [[ -x "$(command -v yum)" ]]; then - yum install -y git tar wget + yum install -y git tar wget elif [[ -x "$(command -v apt-get)" ]]; then - apt-get install -y git tar wget + apt-get install -y git tar wget elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm --needed git tar wget + pacman -S --noconfirm --needed git tar wget elif [[ -x "$(command -v zypper)" ]]; then - zypper --non-interactive install git tar wget + zypper --non-interactive install git tar wget else - echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" + echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" fi # Determine whether the relevant software is installed successfully if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "Success" + echo_green "Success" else - Red_Error "[x] Failed to find git, tar and wget, please install them manually!" + Red_Error "[x] Failed to find git, tar and wget, please install them manually!" fi # Install the Node environment diff --git a/setup_cn.sh b/setup_cn.sh index 4532f2d..f43004c 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1,8 +1,8 @@ #!/bin/bash +# This script file is specifically designed for the Chinese region, and servers in the Chinese region are used to accelerate file downloads. -# 中国大陆需要安装脚本额外配置镜像地址以及低版本的 NodeJS 环境 mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="http://47.99.81.8/mcsmanager_linux_release.tar.gz" +mcsmanager_download_addr="https://cdn.imlazy.ink:233/files/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" node="v16.20.2" arch=$(uname -m) @@ -20,15 +20,12 @@ echo_cyan() { echo_red() { printf '\033[1;31m%b\033[0m\n' "$@" } - echo_green() { printf '\033[1;32m%b\033[0m\n' "$@" } - echo_cyan_n() { printf '\033[1;36m%b\033[0m' "$@" } - echo_yellow() { printf '\033[1;33m%b\033[0m\n' "$@" } @@ -55,10 +52,7 @@ Install_Node() { rm -rf "node-$node-linux-$arch.tar.gz" - # From https://nodejs.org/ # wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - - # From https://registry.npmmirror.com/ wget "https://registry.npmmirror.com/-/binary/node/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" From 040ce2f8726b960889102d9a26e4c370d4ed5a9c Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 25 Feb 2025 14:38:00 +0800 Subject: [PATCH 248/463] fix: pacman -S --noconfirm --needed git tar wget --- setup_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index f43004c..7b5a441 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -210,7 +210,7 @@ if [[ -x "$(command -v yum)" ]]; then elif [[ -x "$(command -v apt-get)" ]]; then apt-get install -y git tar wget elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm git tar wget + pacman -S --noconfirm --needed git tar wget elif [[ -x "$(command -v zypper)" ]]; then zypper --non-interactive install git tar wget else From 482f875c5940d964f567f2767080a2a5c7110ed7 Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 25 Feb 2025 16:30:59 +0800 Subject: [PATCH 249/463] fix: mv dir --- setup_cn.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup_cn.sh b/setup_cn.sh index 7b5a441..af68fab 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -95,6 +95,14 @@ Install_MCSManager() { tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" + if [ -d "/opt/mcsmanager/mcsmanager" ]; then + # 文件夹存在,执行移动操作 + mv /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ + mv /opt/mcsmanager/mcsmanager/.* /opt/mcsmanager/ 2>/dev/null + # 删除空的 mcsmanager 文件夹 + rf -rf /opt/mcsmanager/mcsmanager + fi + # echo "[→] cd daemon" cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" From 84bbd272d6c21762de326272a364555422759e3c Mon Sep 17 00:00:00 2001 From: Unitwk Date: Tue, 25 Feb 2025 16:38:02 +0800 Subject: [PATCH 250/463] fix: mv dir --- setup.sh | 7 +++++++ setup_cn.sh | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index e005b7b..5eb900d 100644 --- a/setup.sh +++ b/setup.sh @@ -94,6 +94,13 @@ Install_MCSManager() { tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" + # compatible with tar.gz packages of different formats + if [ -d "/opt/mcsmanager/mcsmanager" ]; then + mv /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ + mv /opt/mcsmanager/mcsmanager/.* /opt/mcsmanager/ 2>/dev/null + rm -rf /opt/mcsmanager/mcsmanager + fi + # echo "[→] cd daemon" cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" diff --git a/setup_cn.sh b/setup_cn.sh index af68fab..3d4819c 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -95,12 +95,11 @@ Install_MCSManager() { tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" + # compatible with tar.gz packages of different formats if [ -d "/opt/mcsmanager/mcsmanager" ]; then - # 文件夹存在,执行移动操作 mv /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ mv /opt/mcsmanager/mcsmanager/.* /opt/mcsmanager/ 2>/dev/null - # 删除空的 mcsmanager 文件夹 - rf -rf /opt/mcsmanager/mcsmanager + rm -rf /opt/mcsmanager/mcsmanager fi # echo "[→] cd daemon" From e13ad017aac7a2ed24ec92b060e0382448c3ebf1 Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Tue, 25 Feb 2025 14:47:04 +0100 Subject: [PATCH 251/463] Update Purpur Tags --- templates.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/templates.json b/templates.json index f567240..6794aa7 100644 --- a/templates.json +++ b/templates.json @@ -22,7 +22,7 @@ "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2398.jar", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.21.4-2398.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -41,7 +41,7 @@ "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.3-2358.jar", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.21.3-2358.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -60,7 +60,7 @@ "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.1-2329.jar", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.21.1-2329.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -79,7 +79,7 @@ "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.6-2233.jar", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.20.6-2233.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -98,7 +98,7 @@ "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.4-2176.jar", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.20.4-2176.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -117,7 +117,7 @@ "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.1-2062.jar", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.20.1-2062.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -136,7 +136,7 @@ "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.19.2-1858.jar", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.19.2-1858.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -155,7 +155,7 @@ "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.18.2-1632.jar", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.18.2-1632.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -174,7 +174,7 @@ "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.17.1-1428.jar", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.17.1-1428.jar nogui", "stopCommand": "stop", "updateCommand": "", @@ -193,7 +193,7 @@ "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.16.5-1171.jar", "author": "purpurmc.org", "setupInfo": { - "type": "minecraft/java", + "type": "minecraft/java/purpur", "startCommand": "java -jar purpur-1.16.5-1171.jar nogui", "stopCommand": "stop", "updateCommand": "", From a1684cbfb9415d3cebafa7f9e1e993eee26f6b73 Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Tue, 25 Feb 2025 14:53:22 +0100 Subject: [PATCH 252/463] Update default Start Command to match the recommended RAM value --- templates.json | 100 ++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/templates.json b/templates.json index 6794aa7..2c6c75d 100644 --- a/templates.json +++ b/templates.json @@ -23,7 +23,7 @@ "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -jar purpur-1.21.4-2398.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2398.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -42,7 +42,7 @@ "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -jar purpur-1.21.3-2358.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.3-2358.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -61,7 +61,7 @@ "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -jar purpur-1.21.1-2329.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.1-2329.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -80,7 +80,7 @@ "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -jar purpur-1.20.6-2233.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.20.6-2233.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -99,7 +99,7 @@ "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -jar purpur-1.20.4-2176.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.20.4-2176.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -118,7 +118,7 @@ "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -jar purpur-1.20.1-2062.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.20.1-2062.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -137,7 +137,7 @@ "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -jar purpur-1.19.2-1858.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.19.2-1858.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -156,7 +156,7 @@ "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -jar purpur-1.18.2-1632.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.18.2-1632.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -175,7 +175,7 @@ "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -jar purpur-1.17.1-1428.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.17.1-1428.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -194,7 +194,7 @@ "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -jar purpur-1.16.5-1171.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.16.5-1171.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -213,7 +213,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.21.4-173.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-173.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -232,7 +232,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.21.3-82.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.3-82.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -251,7 +251,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.21.1-132.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.1-132.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -270,7 +270,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.20.6-151.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.6-151.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -289,7 +289,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.20.4-499.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.4-499.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -308,7 +308,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.20.2-318.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.2-318.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -327,7 +327,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.20.1-196.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.1-196.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -346,7 +346,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.19.4-550.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.19.4-550.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -365,7 +365,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.19.2-307.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.19.2-307.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -384,7 +384,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar paper-1.18.2-388.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.18.2-388.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -403,7 +403,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.17.1-411.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.17.1-411.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -422,7 +422,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.16.5-794.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.16.5-794.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -441,7 +441,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.12.2-1620.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.12.2-1620.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -460,7 +460,7 @@ "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -jar paper-1.8.8-445.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.8.8-445.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -745,7 +745,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -764,7 +764,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.3 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -783,7 +783,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.1 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -802,7 +802,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.20.6 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -821,7 +821,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.20.4 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -840,7 +840,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.20.1 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -859,7 +859,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.19.4 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -878,7 +878,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.19.2 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -897,7 +897,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.18.2 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -916,7 +916,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.17.1 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -935,7 +935,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.16.5 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -954,7 +954,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.15.2 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -973,7 +973,7 @@ "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", - "startCommand": "java -jar fabric-server-launch.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.14.4 -downloadMinecraft -noprofile", "ie": "utf-8", @@ -992,7 +992,7 @@ "author": "Mojang", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1011,7 +1011,7 @@ "author": "Mojang", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1030,7 +1030,7 @@ "author": "Mojang", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1049,7 +1049,7 @@ "author": "Mojang", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1068,7 +1068,7 @@ "author": "Mojang", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1087,7 +1087,7 @@ "author": "Mojang", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1106,7 +1106,7 @@ "author": "Mojang", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1125,7 +1125,7 @@ "author": "Mojang", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1144,7 +1144,7 @@ "author": "Mojang", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1163,7 +1163,7 @@ "author": "Mojang", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1182,7 +1182,7 @@ "author": "Mojang", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1201,7 +1201,7 @@ "author": "alongw.cn", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1220,7 +1220,7 @@ "author": "alongw.cn", "setupInfo": { "type": "minecraft/java", - "startCommand": "java -jar server.jar nogui", + "startCommand": "java -Xms6144M -Xmx6144M -jar server.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From 4947d81906fd8f6a5ec77c466754a7b9366a832d Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Tue, 25 Feb 2025 14:56:52 +0100 Subject: [PATCH 253/463] Update PaperMC 1.21.4 and PurpurMC 1.21.4 Builds --- templates.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates.json b/templates.json index 2c6c75d..0737380 100644 --- a/templates.json +++ b/templates.json @@ -19,11 +19,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2398.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2399.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2398.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2399.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -209,11 +209,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/173/downloads/paper-1.21.4-173.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/178/downloads/paper-1.21.4-178.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-173.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-178.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From 466d608e75dcff7184d2e981b19287021721d3ea Mon Sep 17 00:00:00 2001 From: Unitwk Date: Wed, 26 Feb 2025 19:59:28 +0800 Subject: [PATCH 254/463] fix: update mv error --- setup.sh | 3 +-- setup_cn.sh | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index 5eb900d..51228b2 100644 --- a/setup.sh +++ b/setup.sh @@ -96,8 +96,7 @@ Install_MCSManager() { # compatible with tar.gz packages of different formats if [ -d "/opt/mcsmanager/mcsmanager" ]; then - mv /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ - mv /opt/mcsmanager/mcsmanager/.* /opt/mcsmanager/ 2>/dev/null + cp -rf /opt/mcsmanager/mcsmanager/*.* /opt/mcsmanager/ rm -rf /opt/mcsmanager/mcsmanager fi diff --git a/setup_cn.sh b/setup_cn.sh index 3d4819c..f5223da 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -97,8 +97,7 @@ Install_MCSManager() { # compatible with tar.gz packages of different formats if [ -d "/opt/mcsmanager/mcsmanager" ]; then - mv /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ - mv /opt/mcsmanager/mcsmanager/.* /opt/mcsmanager/ 2>/dev/null + cp -rf /opt/mcsmanager/mcsmanager/*.* /opt/mcsmanager/ rm -rf /opt/mcsmanager/mcsmanager fi From 46b75fa8ccec552870dff0c92c2837af7832b7bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E9=BE=99?= <64565408+alongw@users.noreply.github.com> Date: Thu, 27 Feb 2025 14:49:02 +0000 Subject: [PATCH 255/463] fix: copy file --- setup.sh | 2 +- setup_cn.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 51228b2..d275f9e 100644 --- a/setup.sh +++ b/setup.sh @@ -96,7 +96,7 @@ Install_MCSManager() { # compatible with tar.gz packages of different formats if [ -d "/opt/mcsmanager/mcsmanager" ]; then - cp -rf /opt/mcsmanager/mcsmanager/*.* /opt/mcsmanager/ + cp -rf /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ rm -rf /opt/mcsmanager/mcsmanager fi diff --git a/setup_cn.sh b/setup_cn.sh index f5223da..d9a7083 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -97,7 +97,7 @@ Install_MCSManager() { # compatible with tar.gz packages of different formats if [ -d "/opt/mcsmanager/mcsmanager" ]; then - cp -rf /opt/mcsmanager/mcsmanager/*.* /opt/mcsmanager/ + cp -rf /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ rm -rf /opt/mcsmanager/mcsmanager fi From 0445c2146ecc42c94f1d59928055d2088ecb9c0d Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Sat, 1 Mar 2025 16:53:20 +0100 Subject: [PATCH 256/463] feat: Add NeoForge Versions (Type: minecraft/java) --- templates.json | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/templates.json b/templates.json index 0737380..256e01e 100644 --- a/templates.json +++ b/templates.json @@ -467,6 +467,82 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "NeoForge 1.21.4 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.101-beta/neoforge-21.4.101-beta-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.4.101-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "NeoForge 1.20.6 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.6.125/neoforge-20.6.125-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-20.6.125-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "NeoForge 1.20.4 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.4.239/neoforge-20.4.239-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-20.4.239-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "NeoForge 1.20.2 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.2.88/neoforge-20.2.88-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-20.2.88-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", From b34cec54e4f43cf414c9bce2c03a891090f9e09d Mon Sep 17 00:00:00 2001 From: Antony Date: Mon, 17 Mar 2025 10:27:24 +0100 Subject: [PATCH 257/463] Update Purpur and Paper 1.21.4 Builds --- templates.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates.json b/templates.json index 256e01e..2f70dea 100644 --- a/templates.json +++ b/templates.json @@ -19,11 +19,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2399.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2408.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2399.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2408.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -209,11 +209,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/178/downloads/paper-1.21.4-178.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/178/downloads/paper-1.21.4-211.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-178.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-211.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From 704c67e42c520eafd01fe1c9facd320a59206ddd Mon Sep 17 00:00:00 2001 From: Antony Date: Mon, 17 Mar 2025 11:05:31 +0100 Subject: [PATCH 258/463] Update Forge Versions --- templates.json | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/templates.json b/templates.json index 2f70dea..eb34c4c 100644 --- a/templates.json +++ b/templates.json @@ -551,13 +551,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.1/forge-1.21.4-54.1.1-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.3/forge-1.21.4-54.1.3-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.4-54.1.1-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.4-54.1.3-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -570,13 +570,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.3-53.0.53/forge-1.21.3-53.0.53-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.3-53.1.0/forge-1.21.3-53.1.0-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.3-53.0.53-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.3-53.1.0-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -589,13 +589,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.0.53/forge-1.21.1-52.0.53-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.0/forge-1.21.1-52.0.53-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.1-52.0.53-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.1-52.1.0-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -608,13 +608,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.1.48/forge-1.20.6-50.1.48-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.2.0/forge-1.20.6-50.2.0-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.6-50.1.48-installer.jar --installServer", + "updateCommand": "java -jar forge-1.20.6-50.2.0-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -627,13 +627,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.4-49.1.36/forge-1.20.4-49.1.36-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.4-49.2.0/forge-1.20.4-49.2.0-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.4-49.1.36-installer.jar --installServer", + "updateCommand": "java -jar forge-1.20.4-49.2.0-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -646,13 +646,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.3.33/forge-1.20.1-47.3.33-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.4.0/forge-1.20.1-47.4.0-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.1-47.3.33-installer.jar --installServer", + "updateCommand": "java -jar forge-1.20.1-47.4.0-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -665,13 +665,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.4-45.3.24/forge-1.19.4-45.3.24-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.4-45.4.0/forge-1.19.4-45.4.0-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.19.4-45.3.24-installer.jar --installServer", + "updateCommand": "java -jar forge-1.19.4-45.4.0-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -684,13 +684,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.4.20/forge-1.19.2-43.4.20-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.5.0/forge-1.19.2-43.5.0-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.19.2-43.4.20-installer.jar --installServer", + "updateCommand": "java -jar forge-1.19.2-43.5.0-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -703,13 +703,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.3.6/forge-1.18.2-40.3.6-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.3.9/forge-1.18.2-40.3.9-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.18.2-40.3.6-installer.jar --installServer", + "updateCommand": "java -jar forge-1.18.2-40.3.9-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } From 336470ff75928c8539efccd104d0e347a827dda1 Mon Sep 17 00:00:00 2001 From: Antony Blem Date: Mon, 5 May 2025 16:33:06 +0200 Subject: [PATCH 259/463] fix: Update setup.sh to always use the latest MCSM Release --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index d275f9e..f7abe1f 100644 --- a/setup.sh +++ b/setup.sh @@ -2,7 +2,7 @@ # Official installation script. mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/download/v10.5.0/mcsmanager_linux_release.tar.gz" +mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" node="v20.12.2" arch=$(uname -m) From 2ad499248c321100973afda15004ff2881898109 Mon Sep 17 00:00:00 2001 From: SkyKing_PX Date: Mon, 5 May 2025 14:55:12 +0000 Subject: [PATCH 260/463] Update templates.json --- templates.json | 197 +++++++++++++++++++++++++++++++------------------ 1 file changed, 127 insertions(+), 70 deletions(-) diff --git a/templates.json b/templates.json index eb34c4c..a02e914 100644 --- a/templates.json +++ b/templates.json @@ -19,11 +19,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2408.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2416.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2408.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2416.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -209,11 +209,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/178/downloads/paper-1.21.4-211.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/227/downloads/paper-1.21.4-227.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-211.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-227.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -467,6 +467,25 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "NeoForge 1.21.5 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.5.63-beta/neoforge-21.5.63-beta-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.5.63-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", @@ -475,13 +494,32 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.101-beta/neoforge-21.4.101-beta-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.135/neoforge-21.4.135-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.4.135-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "NeoForge 1.21.1 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.169/neoforge-21.1.169-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.4.101-beta-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.1.169-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -494,13 +532,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.6.125/neoforge-20.6.125-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.6.135/neoforge-20.6.135-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-20.6.125-installer.jar --installServer", + "updateCommand": "java -jar neoforge-20.6.135-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -513,13 +551,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.4.239/neoforge-20.4.239-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.4.248/neoforge-20.4.248-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-20.4.239-installer.jar --installServer", + "updateCommand": "java -jar neoforge-20.4.248-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -532,13 +570,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.2.88/neoforge-20.2.88-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.2.93/neoforge-20.2.93-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-20.2.88-installer.jar --installServer", + "updateCommand": "java -jar neoforge-20.2.93-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -546,18 +584,18 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.21.4 (Supports Mods)", + "title": "Forge 1.21.5 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.3/forge-1.21.4-54.1.3-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.5-55.0.9/forge-1.21.5-55.0.9-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.4-54.1.3-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.5-55.0.9-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -565,18 +603,18 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.21.3 (Supports Mods)", + "title": "Forge 1.21.4 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.3-53.1.0/forge-1.21.3-53.1.0-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.3/forge-1.21.4-54.1.3-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.3-53.1.0-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.4-54.1.3-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -811,247 +849,266 @@ }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.21.4 Fabric", - "title": "Minecraft 1.21.4 with Fabric Loader", + "description": "Minecraft 1.21.5 with Fabric Loader", + "title": "Fabric 1.21.5 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.5 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.21.3 Fabric", - "title": "Minecraft 1.21.3 with Fabric Loader", + "description": "Minecraft 1.21.4 with Fabric Loader", + "title": "Fabric 1.21.4 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.3 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.21.1 Fabric", - "title": "Minecraft 1.21.1 with Fabric Loader", + "description": "Minecraft 1.21.1 with Fabric Loader", + "title": "Fabric 1.21.1 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.1 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.1 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.20.6 Fabric", - "title": "Minecraft 1.20.6 with Fabric Loader", + "description": "Minecraft 1.20.6 with Fabric Loader", + "title": "Fabric 1.20.6 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.20.6 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.20.6 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.20.4 Fabric", - "title": "Minecraft 1.20.4 with Fabric Loader", + "description": "Minecraft 1.20.4 with Fabric Loader", + "title": "Fabric 1.20.4 (Supports Mods)", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.20.4 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.20.4 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.20.1 Fabric", - "title": "Minecraft 1.20.1 with Fabric Loader", + "description": "Minecraft 1.20.1 with Fabric Loader", + "title": "Fabric 1.20.1 (Supports Mods)", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.20.1 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.20.1 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.19.4 Fabric", - "title": "Minecraft 1.19.4 with Fabric Loader", + "description": "Minecraft 1.19.4 with Fabric Loader", + "title": "Fabric 1.19.4 (Supports Mods)", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.19.4 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.19.4 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.19.2 Fabric", - "title": "Minecraft 1.19.2 with Fabric Loader", + "description": "Minecraft 1.19.2 with Fabric Loader", + "title": "Fabric 1.19.2 (Supports Mods)", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.19.2 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.19.2 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.18.2 Fabric", - "title": "Minecraft 1.18.2 with Fabric Loader", + "description": "Minecraft 1.18.2 with Fabric Loader", + "title": "Fabric 1.18.2 (Supports Mods)", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.18.2 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.18.2 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.17.1 Fabric", - "title": "Minecraft 1.17.1 with Fabric Loader", + "description": "Minecraft 1.17.1 with Fabric Loader", + "title": "Fabric 1.17.1 (Supports Mods)", "runtime": "Java 16+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.17.1 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.17.1 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.16.5 Fabric", - "title": "Minecraft 1.16.5 with Fabric Loader", + "description": "Minecraft 1.16.5 with Fabric Loader", + "title": "Fabric 1.16.5 (Supports Mods)", "runtime": "Java 8+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.16.5 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.16.5 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.15.2 Fabric", - "title": "Minecraft 1.15.2 with Fabric Loader", + "description": "Minecraft 1.15.2 with Fabric Loader", + "title": "Fabric 1.15.2 (Supports Mods)", "runtime": "Java 8+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.15.2 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.15.2 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } }, { "language": "en_us", - "description": "[Fabric] Minecraft 1.14.4 Fabric", - "title": "Minecraft 1.14.4 with Fabric Loader", + "description": "Minecraft 1.14.4 with Fabric Loader", + "title": "Fabric 1.14.4 (Supports Mods)", "runtime": "Java 8+", "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.1/fabric-installer-1.0.1.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.14.4 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.14.4 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.21.5", + "title": "Minecraft 1.21.5", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/e6ec2f64e6080b9b5d9b471b291c33cc7f509733/server.jar", + "author": "Mojang", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", "ie": "utf-8", "oe": "utf-8" } From 2739fe955810a922a69ffa7074f44c4698b3321d Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 7 May 2025 23:35:45 -0400 Subject: [PATCH 261/463] added initial skeleton --- .gitignore | 46 ++++----- setup.sh | 273 ++++++++--------------------------------------------- 2 files changed, 65 insertions(+), 254 deletions(-) diff --git a/.gitignore b/.gitignore index 6741c00..dc3c282 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,25 @@ -# Build and Release Folders -bin-debug/ -bin-release/ -[Oo]bj/ -[Bb]in/ - -# Other files and folders -.settings/ - -# Executables -*.swf -*.air -*.ipa -*.apk - -# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` -# should NOT be excluded as they contain compiler settings and other important -# information for Eclipse / Flash Builder. - -# Remove old cli sh -cli_old.sh +# Build and Release Folders +bin-debug/ +bin-release/ +[Oo]bj/ +[Bb]in/ + +# Other files and folders +.settings/ + +# Executables +*.swf +*.air +*.ipa +*.apk + +# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` +# should NOT be excluded as they contain compiler settings and other important +# information for Eclipse / Flash Builder. + +# Remove old cli sh +cli_old.sh + +# +setup_old.sh +design.txt \ No newline at end of file diff --git a/setup.sh b/setup.sh index f7abe1f..ee82e12 100644 --- a/setup.sh +++ b/setup.sh @@ -1,243 +1,50 @@ #!/bin/bash -# Official installation script. - -mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" +# Official MCSManager installation script. +# This script installs or updates the MCSManager Web and/or Daemon to the latest version. +# ------------------------------------------------------------------------------ +# Supported Linux distributions: +# This script supports the following mainstream Linux distributions: +# - Ubuntu: 18.04, 20.04, 22.04, 24.04 +# - Debian: 10, 11, 12, 13 +# - CentOS: 7, 8 Stream, 9 Stream, 10 Stream +# - RHEL: 7, 8, 9, 10 +# - Arch Linux: Support planned (TBD) +# ------------------------------------------------------------------------------ + +# Target installation directory (can be overridden with --install-dir) +install_dir="/opt/mcsmanager/" + +# Primary download URL bas. Full package URL = download_base_url + package_name +download_base_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" + +# Fallback download URL (can also be a local directory or mirror) +download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" + +# Name of the release package to download/detect package_name="mcsmanager_linux_release.tar.gz" -node="v20.12.2" -arch=$(uname -m) - -if [ "$(id -u)" -ne 0]; then - echo "This script must be run as root. Please use \"sudo bash\" instead." - exit 1 -fi - -printf "\033c" - -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" -} -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} - -# script info -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -" - -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 -} - -Install_Node() { - echo_cyan_n "[+] Install Node.JS environment...\n" - - rm -irf "$node_install_path" - - cd /opt || Red_Error "[x] Failed to enter /opt" - - rm -rf "node-$node-linux-$arch.tar.gz" - - wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - - tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" - - rm -rf "node-$node-linux-$arch.tar.gz" - - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Success" - else - Red_Error "[x] Node installation failed!" - fi - - echo - echo_yellow "=============== Node.JS Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" - echo - - sleep 3 -} - -Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." - - # stop service - systemctl disable --now mcsm-{web,daemon} - - # delete service - rm -rf /etc/systemd/system/mcsm-{daemon,web}.service - systemctl daemon-reload - - mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" - - # cd /opt/mcsmanager - cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" - - # download MCSManager release - wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" - tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" - rm -rf "${mcsmanager_install_path}/${package_name}" - - # compatible with tar.gz packages of different formats - if [ -d "/opt/mcsmanager/mcsmanager" ]; then - cp -rf /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ - rm -rf /opt/mcsmanager/mcsmanager - fi - - # echo "[→] cd daemon" - cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" - - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" - - # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - - echo_cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" - - echo - echo_yellow "=============== MCSManager ===============" - echo_green "Daemon: ${mcsmanager_install_path}/daemon" - echo_green "Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" - - chmod -R 755 "$mcsmanager_install_path" - - sleep 3 -} - -Create_Service() { - echo_cyan "[+] Create MCSManager service..." - - echo "[Unit] -Description=MCSManager-Daemon - -[Service] -WorkingDirectory=${mcsmanager_install_path}/daemon -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service - - echo "[Unit] -Description=MCSManager-Web - -[Service] -WorkingDirectory=${mcsmanager_install_path}/web -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-web.service - - systemctl daemon-reload - systemctl enable --now mcsm-{daemon,web}.service - echo_green "Registered!" - - sleep 2 - - printf "\n\n\n\n" - - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: " - echo_yellow "http://:23333 (Browser)" - echo_cyan_n "Daemon Address: " - echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports " - echo_yellow "23333" - echo_red " and " - echo_yellow "24444" - echo_red " to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" -} -# Environmental inspection -if [[ "$arch" == x86_64 ]]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [[ $arch == aarch64 ]]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [[ $arch == arm ]]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [[ $arch == ppc64le ]]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [[ $arch == s390x ]]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" -fi +# Node.js version to be installed +node_version="v20.12.2" -# Define the variable Node installation directory -node_install_path="/opt/node-$node-linux-$arch" +# Node.js installation path (defaults to the MCSManager installation path. Can be overridden with --node-install-dir) +node_install_dir="$install_dir" -# Check network connection -echo_cyan "[-] Architecture: $arch" +# --------------- Global Variables ---------------# +# DO NOT MODIFY # -# Install related software -echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " -if [[ -x "$(command -v yum)" ]]; then - yum install -y git tar wget -elif [[ -x "$(command -v apt-get)" ]]; then - apt-get install -y git tar wget -elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm --needed git tar wget -elif [[ -x "$(command -v zypper)" ]]; then - zypper --non-interactive install git tar wget -else - echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" -fi +# System architecture (detected automatically) +arch="" -# Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "Success" -else - Red_Error "[x] Failed to find git, tar and wget, please install them manually!" -fi +# Component installation options. +# For fresh installs, both daemon and web components are installed by default. +# For updates, behavior depends on detected existing components. +# Can be overridden with --install daemon/web/all +install_daemon=true +install_web=true -# Install the Node environment -Install_Node +# Install MCSM as (default: root). +# To install as a general user (e.g., "mcsm"), use the --user option: --user mcsm +# To ensure compatibility, only user mcsm is supported. +install_user="root" -# Install MCSManager -Install_MCSManager -# Create MCSManager background service -Create_Service From e2d8f9ed6606cf1632ca7c88da24c31ff34414e4 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 7 May 2025 23:48:42 -0400 Subject: [PATCH 262/463] added install source override --- setup.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/setup.sh b/setup.sh index ee82e12..6bf1d6a 100644 --- a/setup.sh +++ b/setup.sh @@ -47,4 +47,26 @@ install_web=true # To ensure compatibility, only user mcsm is supported. install_user="root" +# Optional: Override the default installation source file. +# If --install-source is specified, the installer will use the provided +# "mcsmanager_linux_release.tar.gz" file instead of downloading it. +# Only support local absolute path. +install_source_path="" +### Helper Functions +# Function to ensure the script is run as root +check_root() { + # Using Bash's built-in EUID variable + if [ -n "$EUID" ]; then + if [ "$EUID" -ne 0 ]; then + echo "Error: This script must be run as root. Please use sudo or switch to the root user." + exit 1 + fi + else + # Fallback to using id -u if EUID is unavailable (e.g., non-Bash shell or misconfigured environment) + if [ "$(id -u)" -ne 0 ]; then + echo "Error: This script must be run as root. Please use sudo or switch to the root user." + exit 1 + fi + fi +} \ No newline at end of file From faf16dcedada980c7a72f5decf2b8e709b2478f4 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 7 May 2025 23:54:44 -0400 Subject: [PATCH 263/463] added arg parser & simple main --- setup.sh | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 6bf1d6a..05965b2 100644 --- a/setup.sh +++ b/setup.sh @@ -69,4 +69,113 @@ check_root() { exit 1 fi fi -} \ No newline at end of file +} + +# Parse cmd arguments. +parse_args() { + while [[ $# -gt 0 ]]; do + case "$1" in + --install-dir) + if [[ -n "$2" ]]; then + install_dir="$2" + shift 2 + else + echo "Error: --install-dir requires a path argument." + exit 1 + fi + ;; + --node-install-dir) + if [[ -n "$2" ]]; then + node_install_dir="$2" + shift 2 + else + echo "Error: --node-install-dir requires a path argument." + exit 1 + fi + ;; + --install) + if [[ -n "$2" ]]; then + case "$2" in + daemon) + install_daemon=true + install_web=false + ;; + web) + install_daemon=false + install_web=true + ;; + all) + install_daemon=true + install_web=true + ;; + *) + echo "Error: Invalid value for --install. Expected 'daemon', 'web', or 'all'." + echo "Usage: --install daemon|web|all" + exit 1 + ;; + esac + shift 2 + else + echo "Error: --install requires an argument (daemon, web, or all)." + exit 1 + fi + ;; + --user) + if [[ -n "$2" ]]; then + case "$2" in + root) + install_user="root" + ;; + mcsm) + install_user="mcsm" + ;; + *) + echo "Error: Invalid user '$2'. Only 'root' and 'mcsm' are supported." + echo "Usage: --user root|mcsm" + exit 1 + ;; + esac + shift 2 + else + echo "Error: --user requires a value (root or mcsm)." + exit 1 + fi + ;; + --install-source) + if [[ -n "$2" ]]; then + install_source_path="$2" + shift 2 + else + echo "Error: --install-source requires a file path." + exit 1 + fi + ;; + *) + echo "Error: Unknown argument: $1" + exit 1 + ;; + esac + done +} + + + + + + + + + + + + + + + + +main() { + check_root + parse_args "$@" + +} +main "$@" \ No newline at end of file From e0c37a7e66d7b6ebba75dab734f898792e7eb742 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 8 May 2025 00:04:46 -0400 Subject: [PATCH 264/463] added safe execution wrapper --- setup.sh | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 05965b2..9b546d4 100644 --- a/setup.sh +++ b/setup.sh @@ -54,6 +54,18 @@ install_user="root" install_source_path="" ### Helper Functions + +# Execution wrapper, avoid unexpected crashes. +safe_run() { + local step_func="$1" + local error_message="$2" + + if ! "$step_func"; then + echo "Error: $error_message" + exit 1 + fi +} + # Function to ensure the script is run as root check_root() { # Using Bash's built-in EUID variable @@ -158,6 +170,64 @@ parse_args() { done } +# Get Distribution & Architecture Info +detect_os_info() { + # Default values + distro="Unknown" + version="Unknown" + arch="" + + # Detect arch + arch=$(uname -m) + + # Primary detection using /etc/os-release + if [ -f /etc/os-release ]; then + . /etc/os-release + distro_id="${ID,,}" + distro_version="${VERSION_ID,,}" + + case "$distro_id" in + ubuntu) + distro="Ubuntu" + version="$distro_version" + ;; + debian) + distro="Debian" + if grep -q "testing" /etc/debian_version 2>/dev/null; then + version="testing" + else + version="$(cat /etc/debian_version)" + fi + ;; + centos) + distro="CentOS" + version="$distro_version" + ;; + rhel*) + distro="RHEL" + version="$distro_version" + ;; + arch) + distro="Arch" + version="rolling" + ;; + esac + + # Fallbacks for older/partial systems + elif [ -f /etc/lsb-release ]; then + . /etc/lsb-release + distro="${DISTRIB_ID:-Ubuntu}" + version="${DISTRIB_RELEASE:-Unknown}" + elif [ -f /etc/issue ]; then + if grep -qi "ubuntu" /etc/issue; then + distro="Ubuntu" + version="$(grep -oP '[0-9]{2}\.[0-9]{2}' /etc/issue | head -1)" + fi + fi + + echo "Detected OS: $distro $version" + echo "Detected Architecture: $arch" +} @@ -174,8 +244,9 @@ parse_args() { main() { - check_root - parse_args "$@" + safe_run check_root "Script must be run as root." + safe_run parse_args "Failed to parse command-line arguments." + safe_run detect_os_info "Failed to detect operating system information." } main "$@" \ No newline at end of file From 7c7936487510d6d120b1159c33807fa5b987644b Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 8 May 2025 00:06:17 -0400 Subject: [PATCH 265/463] allowed arg pass through to sub functions --- setup.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/setup.sh b/setup.sh index 9b546d4..551bc9c 100644 --- a/setup.sh +++ b/setup.sh @@ -57,11 +57,12 @@ install_source_path="" # Execution wrapper, avoid unexpected crashes. safe_run() { - local step_func="$1" - local error_message="$2" + local func="$1" + local err_msg="$2" + shift 2 - if ! "$step_func"; then - echo "Error: $error_message" + if ! "$func" "$@"; then + echo "Error: $err_msg" exit 1 fi } @@ -244,9 +245,8 @@ detect_os_info() { main() { - safe_run check_root "Script must be run as root." - safe_run parse_args "Failed to parse command-line arguments." - safe_run detect_os_info "Failed to detect operating system information." - + safe_run check_root "Script must be run as root" + safe_run parse_args "Failed to parse arguments" "$@" + safe_run detect_os_info "Failed to detect OS" } main "$@" \ No newline at end of file From 49b4c9075a60062f808b8125f3916defd4243849 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 8 May 2025 00:06:49 -0400 Subject: [PATCH 266/463] added trap --- setup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.sh b/setup.sh index 551bc9c..86f29fd 100644 --- a/setup.sh +++ b/setup.sh @@ -245,6 +245,8 @@ detect_os_info() { main() { + trap 'echo "Unexpected error occurred."; exit 99' ERR + safe_run check_root "Script must be run as root" safe_run parse_args "Failed to parse arguments" "$@" safe_run detect_os_info "Failed to detect OS" From 762ef6cd41134eb4494704ce9227629c2ab98edc Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 8 May 2025 00:18:23 -0400 Subject: [PATCH 267/463] added OS check barrier --- setup.sh | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 86f29fd..32c5a46 100644 --- a/setup.sh +++ b/setup.sh @@ -32,8 +32,6 @@ node_install_dir="$install_dir" # --------------- Global Variables ---------------# # DO NOT MODIFY # -# System architecture (detected automatically) -arch="" # Component installation options. # For fresh installs, both daemon and web components are installed by default. @@ -53,6 +51,20 @@ install_user="root" # Only support local absolute path. install_source_path="" +# System architecture (detected automatically) +arch="" +version="" +distro="" + +# Supported OS versions (map-style structure) +# Format: supported_os["distro_name"]="version1 version2 version3 ..." +declare -A supported_os +supported_os["Ubuntu"]="18.04 20.04 22.04 24.04" +supported_os["Debian"]="10 11 12 13" +supported_os["CentOS"]="7 8 8-stream 9-stream 10-stream" +supported_os["RHEL"]="7 8 9 10" +supported_os["Arch"]="rolling" + ### Helper Functions # Execution wrapper, avoid unexpected crashes. @@ -225,11 +237,32 @@ detect_os_info() { version="$(grep -oP '[0-9]{2}\.[0-9]{2}' /etc/issue | head -1)" fi fi - + + version_major="${version%%.*}" + version="$version_major" echo "Detected OS: $distro $version" echo "Detected Architecture: $arch" + } +# Check if current OS is supported +check_supported_os() { + local supported_versions="${supported_os[$distro]}" + + if [[ -z "$supported_versions" ]]; then + echo "Error: Distribution '$distro' is not supported by this installer." + return 1 + fi + + if [[ "$supported_versions" != *"$version"* ]]; then + echo "Error: Version '$version' of '$distro' is not supported." + echo "Supported versions are: $supported_versions" + return 1 + fi + + echo "OS compatibility check passed." + return 0 +} @@ -250,5 +283,6 @@ main() { safe_run check_root "Script must be run as root" safe_run parse_args "Failed to parse arguments" "$@" safe_run detect_os_info "Failed to detect OS" + safe_run check_supported_os "Unsupported OS or version" } main "$@" \ No newline at end of file From 97bd3bcfa717da4f6bc07b37aef416aa3babb8e3 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 8 May 2025 00:20:00 -0400 Subject: [PATCH 268/463] collapsed ubuntu version for OS check --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 32c5a46..b80fba0 100644 --- a/setup.sh +++ b/setup.sh @@ -59,7 +59,7 @@ distro="" # Supported OS versions (map-style structure) # Format: supported_os["distro_name"]="version1 version2 version3 ..." declare -A supported_os -supported_os["Ubuntu"]="18.04 20.04 22.04 24.04" +supported_os["Ubuntu"]="18 20 22 24" supported_os["Debian"]="10 11 12 13" supported_os["CentOS"]="7 8 8-stream 9-stream 10-stream" supported_os["RHEL"]="7 8 9 10" From 9d9381970a0ad4ffe75e09fdc3d7959278cd24e9 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 8 May 2025 00:30:05 -0400 Subject: [PATCH 269/463] simplified os detection logic --- setup.sh | 58 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/setup.sh b/setup.sh index b80fba0..c81525d 100644 --- a/setup.sh +++ b/setup.sh @@ -185,66 +185,68 @@ parse_args() { # Get Distribution & Architecture Info detect_os_info() { - # Default values distro="Unknown" version="Unknown" - arch="" - - # Detect arch arch=$(uname -m) - # Primary detection using /etc/os-release + # Try primary source if [ -f /etc/os-release ]; then . /etc/os-release distro_id="${ID,,}" - distro_version="${VERSION_ID,,}" + version_id="${VERSION_ID,,}" case "$distro_id" in ubuntu) distro="Ubuntu" - version="$distro_version" + version="$version_id" ;; debian) distro="Debian" - if grep -q "testing" /etc/debian_version 2>/dev/null; then - version="testing" - else - version="$(cat /etc/debian_version)" - fi + version="$version_id" ;; centos) distro="CentOS" - version="$distro_version" + version="$version_id" ;; rhel*) distro="RHEL" - version="$distro_version" + version="$version_id" ;; arch) distro="Arch" version="rolling" ;; + *) + distro="${ID:-Unknown}" + version="$version_id" + ;; esac + fi - # Fallbacks for older/partial systems - elif [ -f /etc/lsb-release ]; then - . /etc/lsb-release - distro="${DISTRIB_ID:-Ubuntu}" - version="${DISTRIB_RELEASE:-Unknown}" - elif [ -f /etc/issue ]; then - if grep -qi "ubuntu" /etc/issue; then - distro="Ubuntu" - version="$(grep -oP '[0-9]{2}\.[0-9]{2}' /etc/issue | head -1)" + # Fallbacks for missing or invalid version + if [[ -z "$version" || "$version" == "unknown" || "$version" == "" ]]; then + if [ -f /etc/issue ]; then + version_guess=$(grep -oP '[0-9]+(\.[0-9]+)*' /etc/issue | head -1) + if [[ -n "$version_guess" ]]; then + version="$version_guess" + fi fi fi - - version_major="${version%%.*}" - version="$version_major" - echo "Detected OS: $distro $version" + + # Normalize version: keep only major version + version_full="$version" + if [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then + version="${version%%.*}" + else + echo "Warning: Could not detect a clean numeric version. Defaulting to unknown." + version="unknown" + fi + + echo "Detected OS: $distro $version_full" echo "Detected Architecture: $arch" - } + # Check if current OS is supported check_supported_os() { local supported_versions="${supported_os[$distro]}" From b2b3e8b2d32f7c486c796bcc9f350a50e401db73 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 8 May 2025 00:34:56 -0400 Subject: [PATCH 270/463] added required cmd check --- setup.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/setup.sh b/setup.sh index c81525d..6908546 100644 --- a/setup.sh +++ b/setup.sh @@ -65,6 +65,15 @@ supported_os["CentOS"]="7 8 8-stream 9-stream 10-stream" supported_os["RHEL"]="7 8 9 10" supported_os["Arch"]="rolling" +# Required system commands for installation +# These will be checked before logic process +required_commands=( + chmod + chown + wget + tar +) + ### Helper Functions # Execution wrapper, avoid unexpected crashes. @@ -266,7 +275,25 @@ check_supported_os() { return 0 } +# Check if all required commands are available +check_required_commands() { + local missing=0 + for cmd in "${required_commands[@]}"; do + if ! command -v "$cmd" >/dev/null 2>&1; then + echo "Error: Required command '$cmd' is not available in PATH." + missing=1 + fi + done + + if [ "$missing" -ne 0 ]; then + echo "One or more required commands are missing. Please install them and try again." + return 1 + fi + + echo "All required commands are available." + return 0 +} @@ -286,5 +313,6 @@ main() { safe_run parse_args "Failed to parse arguments" "$@" safe_run detect_os_info "Failed to detect OS" safe_run check_supported_os "Unsupported OS or version" + safe_run check_required_commands "Missing required system commands" } main "$@" \ No newline at end of file From 23b38268b77cb1b693ec449375fc8c999e7e724b Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 8 May 2025 00:49:50 -0400 Subject: [PATCH 271/463] added terminal color & style capability check --- setup.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/setup.sh b/setup.sh index 6908546..7742b0b 100644 --- a/setup.sh +++ b/setup.sh @@ -74,8 +74,30 @@ required_commands=( tar ) +# Terminal color & style related +# Default to false, auto check later +SUPPORTS_COLOR=false +SUPPORTS_STYLE=false +# ANSI escape codes for text formatting +RESET="\033[0m" +BOLD="\033[1m" +UNDERLINE="\033[4m" +ITALIC="\033[3m" # Not supported on all terminals + +# Foreground colors +FG_RED="\033[1;31m" +FG_GREEN="\033[1;32m" +FG_YELLOW="\033[1;33m" +FG_BLUE="\033[1;34m" +FG_MAGENTA="\033[1;35m" +FG_CYAN="\033[1;36m" +FG_WHITE="\033[1;37m" ### Helper Functions +## Color Functions + + +## Utility Functions # Execution wrapper, avoid unexpected crashes. safe_run() { local func="$1" @@ -105,6 +127,32 @@ check_root() { fi } +# Function to check whether current terminal support color & style +detect_terminal_capabilities() { + SUPPORTS_COLOR=false + SUPPORTS_STYLE=false + + if [ -t 1 ] && command -v tput >/dev/null 2>&1; then + if [ "$(tput colors)" -ge 8 ]; then + SUPPORTS_COLOR=true + fi + if tput bold >/dev/null 2>&1 && tput smul >/dev/null 2>&1; then + SUPPORTS_STYLE=true + fi + fi + + if [ "$SUPPORTS_COLOR" = true ]; then + echo "[OK] Terminal supports colored output." + else + echo "Note: Terminal does not support colored output. Continuing without formatting." + fi + + if [ "$SUPPORTS_STYLE" = true ]; then + echo "[OK] Terminal supports bold and underline formatting." + else + echo "Note: Terminal does not support advanced text styles." + fi +} # Parse cmd arguments. parse_args() { while [[ $# -gt 0 ]]; do @@ -314,5 +362,6 @@ main() { safe_run detect_os_info "Failed to detect OS" safe_run check_supported_os "Unsupported OS or version" safe_run check_required_commands "Missing required system commands" + safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" } main "$@" \ No newline at end of file From 4805f359ce7a5808bf4e17d98959eda37577f091 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 8 May 2025 00:50:54 -0400 Subject: [PATCH 272/463] reformatted color style codes --- setup.sh | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/setup.sh b/setup.sh index 7742b0b..b9dee70 100644 --- a/setup.sh +++ b/setup.sh @@ -78,20 +78,29 @@ required_commands=( # Default to false, auto check later SUPPORTS_COLOR=false SUPPORTS_STYLE=false -# ANSI escape codes for text formatting +# Declare ANSI reset RESET="\033[0m" -BOLD="\033[1m" -UNDERLINE="\033[4m" -ITALIC="\033[3m" # Not supported on all terminals # Foreground colors -FG_RED="\033[1;31m" -FG_GREEN="\033[1;32m" -FG_YELLOW="\033[1;33m" -FG_BLUE="\033[1;34m" -FG_MAGENTA="\033[1;35m" -FG_CYAN="\033[1;36m" -FG_WHITE="\033[1;37m" +declare -A FG_COLORS=( + [black]="\033[0;30m" + [red]="\033[0;31m" + [green]="\033[0;32m" + [yellow]="\033[0;33m" + [blue]="\033[0;34m" + [magenta]="\033[0;35m" + [cyan]="\033[0;36m" + [white]="\033[0;37m" +) + +# Font styles +declare -A STYLES=( + [bold]="\033[1m" + [underline]="\033[4m" + [italic]="\033[3m" # Often ignored on many terminals +) + + ### Helper Functions ## Color Functions From 3fe55c2bb94845f8ee22e83c1cb5e64b0f0c1e67 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 8 May 2025 00:54:45 -0400 Subject: [PATCH 273/463] added color printing function --- setup.sh | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index b9dee70..40df2b0 100644 --- a/setup.sh +++ b/setup.sh @@ -102,11 +102,6 @@ declare -A STYLES=( ### Helper Functions - -## Color Functions - - -## Utility Functions # Execution wrapper, avoid unexpected crashes. safe_run() { local func="$1" @@ -352,6 +347,40 @@ check_required_commands() { return 0 } +# Print with specified color and style, fallback to RESET if not supported. +cprint() { + local color="" + local style="" + local text="" + + # Iterate through all args except last + while [[ $# -gt 1 ]]; do + case "$1" in + black|red|green|yellow|blue|magenta|cyan|white) + color="$1" + ;; + bold|underline|italic) + style="$1" + ;; + *) + echo "Unknown style or color: $1" >&2 + ;; + esac + shift + done + + text="$1" + + local prefix="" + if [ "$SUPPORTS_COLOR" = true ] && [[ -n "${FG_COLORS[$color]}" ]]; then + prefix+="${FG_COLORS[$color]}" + fi + if [ "$SUPPORTS_STYLE" = true ] && [[ -n "${STYLES[$style]}" ]]; then + prefix+="${STYLES[$style]}" + fi + + printf "%b%s%b\n" "$prefix" "$text" "$RESET" +} @@ -372,5 +401,6 @@ main() { safe_run check_supported_os "Unsupported OS or version" safe_run check_required_commands "Missing required system commands" safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" + } main "$@" \ No newline at end of file From 4f3475238538d372a2ec48a9e7d23f55c81ebf22 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 8 May 2025 01:00:03 -0400 Subject: [PATCH 274/463] fixed cprint arg detection logic --- setup.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index 40df2b0..623d468 100644 --- a/setup.sh +++ b/setup.sh @@ -348,12 +348,21 @@ check_required_commands() { } # Print with specified color and style, fallback to RESET if not supported. +# Note: Only one style support at a time. +# Example usage: +# cprint green bold "Installation completed successfully." +# cprint yellow "" "Warning: Disk space is low." +# cprint red underline "Failed to detect required command: wget" +# cprint yellow "Warning: Disk space is low." +# cprint underline "Failed to detect required command: wget" +# cprint bold green "Installation completed successfully." + cprint() { local color="" local style="" local text="" - - # Iterate through all args except last + + # Parse all arguments except the last one as options while [[ $# -gt 1 ]]; do case "$1" in black|red|green|yellow|blue|magenta|cyan|white) @@ -363,7 +372,6 @@ cprint() { style="$1" ;; *) - echo "Unknown style or color: $1" >&2 ;; esac shift @@ -372,10 +380,10 @@ cprint() { text="$1" local prefix="" - if [ "$SUPPORTS_COLOR" = true ] && [[ -n "${FG_COLORS[$color]}" ]]; then + if [[ -n "$color" && "$SUPPORTS_COLOR" = true && -n "${FG_COLORS[$color]}" ]]; then prefix+="${FG_COLORS[$color]}" fi - if [ "$SUPPORTS_STYLE" = true ] && [[ -n "${STYLES[$style]}" ]]; then + if [[ -n "$style" && "$SUPPORTS_STYLE" = true && -n "${STYLES[$style]}" ]]; then prefix+="${STYLES[$style]}" fi @@ -401,6 +409,7 @@ main() { safe_run check_supported_os "Unsupported OS or version" safe_run check_required_commands "Missing required system commands" safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" - + + } main "$@" \ No newline at end of file From 3e7e2f7f79f53e482bd4d1d643be2a31464c615d Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 8 May 2025 01:09:26 -0400 Subject: [PATCH 275/463] added support for clear and strikethrough line --- setup.sh | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/setup.sh b/setup.sh index 623d468..dbd241f 100644 --- a/setup.sh +++ b/setup.sh @@ -97,7 +97,9 @@ declare -A FG_COLORS=( declare -A STYLES=( [bold]="\033[1m" [underline]="\033[4m" - [italic]="\033[3m" # Often ignored on many terminals + [italic]="\033[3m" # Often ignored + [clear_line]="\r\033[2K" + [strikethrough]="\033[9m" ) @@ -348,30 +350,28 @@ check_required_commands() { } # Print with specified color and style, fallback to RESET if not supported. -# Note: Only one style support at a time. +# Supported colors*: black|red|green|yellow|blue|magenta|cyan|white +# Supported styles*: bold|underline|italic|clear_line|strikethrough +# *Note: some style may not necessarily work on all terminals. # Example usage: # cprint green bold "Installation completed successfully." -# cprint yellow "" "Warning: Disk space is low." # cprint red underline "Failed to detect required command: wget" # cprint yellow "Warning: Disk space is low." # cprint underline "Failed to detect required command: wget" -# cprint bold green "Installation completed successfully." +# cprint bold green underline"Installation completed successfully." cprint() { local color="" - local style="" local text="" - - # Parse all arguments except the last one as options + local styles="" + while [[ $# -gt 1 ]]; do case "$1" in black|red|green|yellow|blue|magenta|cyan|white) color="$1" ;; - bold|underline|italic) - style="$1" - ;; - *) + bold|underline|italic|clear_line|strikethrough) + styles+="${STYLES[$1]}" ;; esac shift @@ -380,11 +380,11 @@ cprint() { text="$1" local prefix="" - if [[ -n "$color" && "$SUPPORTS_COLOR" = true && -n "${FG_COLORS[$color]}" ]]; then + if [[ -n "$color" && "$SUPPORTS_COLOR" = true ]]; then prefix+="${FG_COLORS[$color]}" fi - if [[ -n "$style" && "$SUPPORTS_STYLE" = true && -n "${STYLES[$style]}" ]]; then - prefix+="${STYLES[$style]}" + if [ "$SUPPORTS_STYLE" = true ] || [[ "$styles" == *"${STYLES[clear_line]}"* ]]; then + prefix="$styles$prefix" fi printf "%b%s%b\n" "$prefix" "$text" "$RESET" @@ -399,7 +399,6 @@ cprint() { - main() { trap 'echo "Unexpected error occurred."; exit 99' ERR @@ -410,6 +409,5 @@ main() { safe_run check_required_commands "Missing required system commands" safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" - } main "$@" \ No newline at end of file From 6514e9eb03430c7a166ef78f67e5bb29a0d99929 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Fri, 9 May 2025 00:37:58 -0400 Subject: [PATCH 276/463] added Node.js pre & post check functions --- setup.sh | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index dbd241f..d2ddd8e 100644 --- a/setup.sh +++ b/setup.sh @@ -12,7 +12,7 @@ # ------------------------------------------------------------------------------ # Target installation directory (can be overridden with --install-dir) -install_dir="/opt/mcsmanager/" +install_dir="/opt/mcsmanager" # Primary download URL bas. Full package URL = download_base_url + package_name download_base_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" @@ -24,6 +24,7 @@ download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/ package_name="mcsmanager_linux_release.tar.gz" # Node.js version to be installed +# Keep the leading "v" node_version="v20.12.2" # Node.js installation path (defaults to the MCSManager installation path. Can be overridden with --node-install-dir) @@ -74,6 +75,18 @@ required_commands=( tar ) +# Node.js related sections +# Enable strict version checking (exact match) +# enabled -> strict requriement for defined node version +# false -> newer version allowed +# Older version is NEVER allowed +strict_node_version_check=false + +# Will be set based on actual node status +install_node=true +# Remove leading "v" from defined version +required_node_ver="${node_version#v}" + # Terminal color & style related # Default to false, auto check later SUPPORTS_COLOR=false @@ -390,9 +403,98 @@ cprint() { printf "%b%s%b\n" "$prefix" "$text" "$RESET" } +# Check if Node.js at PATH is valid. +# This function check Node.js version + NPM (if Node.js valid) +verify_node_at_path() { + local node_path="$1" + local bin_node="$node_path/bin/node" + local bin_npm="$node_path/bin/npm" + + # Node binary missing + if [ ! -x "$bin_node" ]; then + return 1 + fi + + local installed_ver + installed_ver="$("$bin_node" -v 2>/dev/null | sed 's/^v//')" + + # Node exists but version not returned + if [[ -z "$installed_ver" ]]; then + return 1 + fi + + # Version mismatch, even if newer + if [ "$strict_node_version_check" = true ]; then + if [[ "$installed_ver" != "$required_node_ver" ]]; then + return 3 + fi + else + # Version mismatch, too old. + local cmp + cmp=$(printf "%s\n%s\n" "$required_node_ver" "$installed_ver" | sort -V | head -1) + if [[ "$cmp" != "$required_node_ver" ]]; then + return 2 + fi + fi + + # node cmd valid, but npm is missing or broken. + if [ ! -x "$bin_npm" ] || ! "$bin_npm" --version >/dev/null 2>&1; then + return 4 + fi + + return 0 +} +# Node.js pre-check. check if we need to install Node.js before installer run. +# Use postcheck_node_after_install() to check after install. +check_node_installed() { + local node_path="${node_install_dir}/node-${node_version}-linux-${arch}" + + verify_node_at_path "$node_path" + local result=$? + + case $result in + 0) + cprint green bold "Node.js and npm found at $node_path (version $required_node_ver or compatible)" + install_node=false + ;; + 1) + cprint yellow bold "Node.js binary not found or unusable at $node_path" + install_node=true + ;; + 2) + cprint red bold "Node.js version at $node_path is too old. Required: >= $required_node_ver" + install_node=true + ;; + 3) + cprint red bold "Node.js version mismatch. Required: $required_node_ver, found something else." + install_node=true + ;; + 4) + cprint red bold "Node.js is present but npm is missing or broken." + install_node=true + ;; + *) + cprint red bold "Unexpected error in node verification." + install_node=true + ;; + esac +} +# Node.js post-check. check if Node.js is valid after install. + +postcheck_node_after_install() { + local node_path="${node_install_dir}/node-${node_version}-linux-${arch}" + verify_node_at_path "$node_path" + if [[ $? -ne 0 ]]; then + cprint red bold "Node.js installation failed or is invalid at $node_path" + return 1 + else + cprint green bold "Node.js is installed and functioning at $node_path" + return 0 + fi +} @@ -408,6 +510,7 @@ main() { safe_run check_supported_os "Unsupported OS or version" safe_run check_required_commands "Missing required system commands" safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" + safe_run check_node_installed "Failed to detect Node.js or npm at expected path. Node.js will be installed." } main "$@" \ No newline at end of file From 53b2741b57627d464ed36764c482c6a165c9485b Mon Sep 17 00:00:00 2001 From: KevinLu Date: Fri, 9 May 2025 01:06:10 -0400 Subject: [PATCH 277/463] added Node.js installation function --- setup.sh | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index d2ddd8e..ca6590c 100644 --- a/setup.sh +++ b/setup.sh @@ -27,6 +27,14 @@ package_name="mcsmanager_linux_release.tar.gz" # Keep the leading "v" node_version="v20.12.2" +# Node download base URL - primary +node_download_url_base="https://nodejs.org/dist/" + +# Node download URL - fallback. +# This is the URL points directly to the file, not the base. This can also be a local absolute path. +# Only supports https:// or http:// for web locations. +node_download_fallback="" + # Node.js installation path (defaults to the MCSManager installation path. Can be overridden with --node-install-dir) node_install_dir="$install_dir" @@ -496,7 +504,78 @@ postcheck_node_after_install() { fi } +# Install Node.js and check +install_node() { + local archive_name="node-${node_version}-linux-${arch}.tar.gz" + local target_dir="${node_install_dir}/node-${node_version}-linux-${arch}" + local archive_path="${node_install_dir}/${archive_name}" + local download_url="${node_download_url_base}${node_version}/${archive_name}" + local fallback="$node_download_fallback" + cprint cyan bold "Installing Node.js $node_version..." + + # Ensure install dir exists + mkdir -p "$node_install_dir" || { + cprint red bold "Failed to create node install directory: $node_install_dir" + return 1 + } + + # Try primary download + cprint cyan "Downloading Node.js from: $download_url" + if ! wget --progress=bar:force -O "$archive_path" "$download_url"; then + cprint yellow "Primary download failed. Attempting fallback..." + + if [[ -n "$fallback" ]]; then + if [[ "$fallback" =~ ^https?:// ]]; then + cprint cyan "Downloading from fallback URL: $fallback" + if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then + cprint red bold "Fallback download for Node.js failed from: $fallback" + return 1 + fi + elif [ -f "$fallback" ]; then + cprint cyan "Copying from local fallback: $fallback" + cp "$fallback" "$archive_path" || { + cprint red bold "Failed to copy fallback archive from $fallback" + return 1 + } + else + cprint red bold "Invalid fallback path: $fallback" + return 1 + fi + else + cprint red bold "Primary download source failed, and no fallback source configured. Cannot proceed." + return 1 + fi + fi + + # Extract archive + cprint cyan "Extracting Node.js archive..." + if ! tar -xzf "$archive_path" -C "$node_install_dir"; then + cprint red bold "Failed to extract Node.js archive." + return 1 + fi + + # Set execute permissions for all users + chmod -R a+rx "$target_dir" || { + cprint red bold "Failed to set execute permissions on Node.js files." + return 1 + } + + # Re-verify installation + verify_node_at_path "$target_dir" + local result=$? + if [[ $result -ne 0 ]]; then + cprint red bold "Node.js installation failed verification." + return 1 + fi + + # Clean up + cprint cyan "Cleaning up archive..." + rm -f "$archive_path" + + cprint green bold "Node.js $node_version installed successfully at $target_dir" + return 0 +} @@ -511,6 +590,8 @@ main() { safe_run check_required_commands "Missing required system commands" safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" safe_run check_node_installed "Failed to detect Node.js or npm at expected path. Node.js will be installed." - + if [ "$install_node" = true ]; then + safe_run install_node "Node.js installation failed" + fi } main "$@" \ No newline at end of file From bc5e00216074aaeaa1fa9e72c5550870009bdb89 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Fri, 9 May 2025 01:13:40 -0400 Subject: [PATCH 278/463] fixed Node.js download URL & arch issue --- setup.sh | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/setup.sh b/setup.sh index ca6590c..db2cba0 100644 --- a/setup.sh +++ b/setup.sh @@ -490,7 +490,6 @@ check_node_installed() { } # Node.js post-check. check if Node.js is valid after install. - postcheck_node_after_install() { local node_path="${node_install_dir}/node-${node_version}-linux-${arch}" @@ -506,21 +505,38 @@ postcheck_node_after_install() { # Install Node.js and check install_node() { - local archive_name="node-${node_version}-linux-${arch}.tar.gz" - local target_dir="${node_install_dir}/node-${node_version}-linux-${arch}" + # Map global arch to Node.js naming conventions (local only) + local node_arch="" + case "$arch" in + x86_64) + node_arch="x64" + ;; + aarch64) + node_arch="arm64" + ;; + armv7l) + node_arch="armv7l" + ;; + *) + cprint red bold "Unsupported architecture for Node.js: $arch" + return 1 + ;; + esac + + local archive_name="node-${node_version}-linux-${node_arch}.tar.xz" + local target_dir="${node_install_dir}/node-${node_version}-linux-${node_arch}" local archive_path="${node_install_dir}/${archive_name}" local download_url="${node_download_url_base}${node_version}/${archive_name}" local fallback="$node_download_fallback" - cprint cyan bold "Installing Node.js $node_version..." + cprint cyan bold "Installing Node.js $node_version for arch: $node_arch" - # Ensure install dir exists mkdir -p "$node_install_dir" || { cprint red bold "Failed to create node install directory: $node_install_dir" return 1 } - # Try primary download + # Download cprint cyan "Downloading Node.js from: $download_url" if ! wget --progress=bar:force -O "$archive_path" "$download_url"; then cprint yellow "Primary download failed. Attempting fallback..." @@ -529,13 +545,13 @@ install_node() { if [[ "$fallback" =~ ^https?:// ]]; then cprint cyan "Downloading from fallback URL: $fallback" if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then - cprint red bold "Fallback download for Node.js failed from: $fallback" + cprint red bold "Fallback download failed from: $fallback" return 1 fi elif [ -f "$fallback" ]; then cprint cyan "Copying from local fallback: $fallback" cp "$fallback" "$archive_path" || { - cprint red bold "Failed to copy fallback archive from $fallback" + cprint red bold "Failed to copy fallback Node.js archive from $fallback" return 1 } else @@ -543,25 +559,23 @@ install_node() { return 1 fi else - cprint red bold "Primary download source failed, and no fallback source configured. Cannot proceed." + cprint red bold "No fallback source configured. Cannot proceed." return 1 fi fi # Extract archive cprint cyan "Extracting Node.js archive..." - if ! tar -xzf "$archive_path" -C "$node_install_dir"; then + if ! tar -xf "$archive_path" -C "$node_install_dir"; then cprint red bold "Failed to extract Node.js archive." return 1 fi - # Set execute permissions for all users chmod -R a+rx "$target_dir" || { cprint red bold "Failed to set execute permissions on Node.js files." return 1 } - # Re-verify installation verify_node_at_path "$target_dir" local result=$? if [[ $result -ne 0 ]]; then @@ -569,7 +583,6 @@ install_node() { return 1 fi - # Clean up cprint cyan "Cleaning up archive..." rm -f "$archive_path" @@ -580,6 +593,7 @@ install_node() { + main() { trap 'echo "Unexpected error occurred."; exit 99' ERR From 35e71c910efd2eb0e3c25befc331bf6edce1404a Mon Sep 17 00:00:00 2001 From: KevinLu Date: Fri, 9 May 2025 01:19:39 -0400 Subject: [PATCH 279/463] stored node & npm binary path to global variable --- setup.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup.sh b/setup.sh index db2cba0..dbd7eda 100644 --- a/setup.sh +++ b/setup.sh @@ -95,6 +95,10 @@ install_node=true # Remove leading "v" from defined version required_node_ver="${node_version#v}" +# Holds absolute path for node & npm +node_bin_path="" +npm_bin_path="" + # Terminal color & style related # Default to false, auto check later SUPPORTS_COLOR=false @@ -587,6 +591,12 @@ install_node() { rm -f "$archive_path" cprint green bold "Node.js $node_version installed successfully at $target_dir" + # Save resolved binary paths to global variables + node_bin_path="${target_dir}/bin/node" + npm_bin_path="${target_dir}/bin/npm" + + cprint green "Node.js binary: $node_bin_path" + cprint green "npm binary: $npm_bin_path" return 0 } From 5efd7ea26237f0371b36b3ee1a823f2bd247f5b2 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Fri, 9 May 2025 01:27:54 -0400 Subject: [PATCH 280/463] fixed Node.js detection logic & minor logic optimizations --- setup.sh | 55 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/setup.sh b/setup.sh index dbd7eda..fa14013 100644 --- a/setup.sh +++ b/setup.sh @@ -98,6 +98,10 @@ required_node_ver="${node_version#v}" # Holds absolute path for node & npm node_bin_path="" npm_bin_path="" +# Hold Node.js arch name, e.g. x86_64 -> x64 +node_arch="" +# Hold Node.js intallation path, e.g. ${node_install_dir}/node-${node_version}-linux-${arch} +node_path="" # Terminal color & style related # Default to false, auto check later @@ -415,6 +419,32 @@ cprint() { printf "%b%s%b\n" "$prefix" "$text" "$RESET" } +# Map OS arch with actual Node.js Arch name +# This function should be placed after var arch has been assigned a valid value. +resolve_node_arch() { + case "$arch" in + x86_64) + node_arch="x64" + ;; + aarch64) + node_arch="arm64" + ;; + armv7l) + node_arch="armv7l" + ;; + *) + cprint red bold "Unsupported architecture for Node.js: $arch" + return 1 + ;; + esac + + # Assign node_path based on resolved arch and current version/install dir + node_path="${node_install_dir}/node-${node_version}-linux-${node_arch}" + + cprint cyan "Resolved Node.js architecture: $node_arch" + cprint cyan "Computed Node.js install path: $node_path" +} + # Check if Node.js at PATH is valid. # This function check Node.js version + NPM (if Node.js valid) verify_node_at_path() { @@ -460,8 +490,6 @@ verify_node_at_path() { # Node.js pre-check. check if we need to install Node.js before installer run. # Use postcheck_node_after_install() to check after install. check_node_installed() { - local node_path="${node_install_dir}/node-${node_version}-linux-${arch}" - verify_node_at_path "$node_path" local result=$? @@ -495,8 +523,6 @@ check_node_installed() { # Node.js post-check. check if Node.js is valid after install. postcheck_node_after_install() { - local node_path="${node_install_dir}/node-${node_version}-linux-${arch}" - verify_node_at_path "$node_path" if [[ $? -ne 0 ]]; then cprint red bold "Node.js installation failed or is invalid at $node_path" @@ -509,24 +535,6 @@ postcheck_node_after_install() { # Install Node.js and check install_node() { - # Map global arch to Node.js naming conventions (local only) - local node_arch="" - case "$arch" in - x86_64) - node_arch="x64" - ;; - aarch64) - node_arch="arm64" - ;; - armv7l) - node_arch="armv7l" - ;; - *) - cprint red bold "Unsupported architecture for Node.js: $arch" - return 1 - ;; - esac - local archive_name="node-${node_version}-linux-${node_arch}.tar.xz" local target_dir="${node_install_dir}/node-${node_version}-linux-${node_arch}" local archive_path="${node_install_dir}/${archive_name}" @@ -611,6 +619,9 @@ main() { safe_run parse_args "Failed to parse arguments" "$@" safe_run detect_os_info "Failed to detect OS" safe_run check_supported_os "Unsupported OS or version" + # To be moved to a master pre check function. + safe_run resolve_node_arch "Failed to resolve Node.js architecture" + safe_run check_required_commands "Missing required system commands" safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" safe_run check_node_installed "Failed to detect Node.js or npm at expected path. Node.js will be installed." From 03fe0b035681814ccd108a7104fc46b6b3a68f39 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Sat, 10 May 2025 01:13:59 -0400 Subject: [PATCH 281/463] added function to check if a component is installed --- setup.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup.sh b/setup.sh index fa14013..2da8a6c 100644 --- a/setup.sh +++ b/setup.sh @@ -188,6 +188,22 @@ detect_terminal_capabilities() { echo "Note: Terminal does not support advanced text styles." fi } + +# Check whether daemon or web is installed +is_component_installed() { + local component_name="$1" + local component_path="${install_dir}/${component_name}" + + if [[ -d "$component_path" ]]; then + cprint green "Component '$component_name' is already installed at $component_path" + return 0 + else + cprint yellow "Component '$component_name' is not installed" + return 1 + fi +} + + # Parse cmd arguments. parse_args() { while [[ $# -gt 0 ]]; do From 33a4730ecbd1de5e552196a22510ea17d9abf582 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Sat, 10 May 2025 01:21:22 -0400 Subject: [PATCH 282/463] updated arg parse to install/update component based on their status & user input --- setup.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 2da8a6c..703eaee 100644 --- a/setup.sh +++ b/setup.sh @@ -249,8 +249,30 @@ parse_args() { esac shift 2 else - echo "Error: --install requires an argument (daemon, web, or all)." - exit 1 + # No argument passed with --install, detect based on installed components + daemon_installed=false + web_installed=false + + if is_component_installed "daemon"; then + daemon_installed=true + fi + if is_component_installed "web"; then + web_installed=true + fi + + if [[ "$daemon_installed" == true && "$web_installed" == false ]]; then + install_daemon=true + install_web=false + elif [[ "$daemon_installed" == false && "$web_installed" == true ]]; then + install_daemon=false + install_web=true + else + # None or both installed perform fresh install or update both + install_daemon=true + install_web=true + fi + + shift 1 fi ;; --user) From 0badf114ab3b124627f265ca473de07fe19a82ec Mon Sep 17 00:00:00 2001 From: KevinLu Date: Sat, 10 May 2025 01:35:31 -0400 Subject: [PATCH 283/463] added global variable for installed status --- setup.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/setup.sh b/setup.sh index 703eaee..96bb4fc 100644 --- a/setup.sh +++ b/setup.sh @@ -53,6 +53,12 @@ install_web=true # To install as a general user (e.g., "mcsm"), use the --user option: --user mcsm # To ensure compatibility, only user mcsm is supported. install_user="root" +# Installed user, for permission check +web_installed=false +daemon_installed=false +web_installed_user="" +daemon_installed_user="" + # Optional: Override the default installation source file. # If --install-source is specified, the installer will use the provided @@ -196,14 +202,32 @@ is_component_installed() { if [[ -d "$component_path" ]]; then cprint green "Component '$component_name' is already installed at $component_path" + + # Set corresponding global variable + if [[ "$component_name" == "daemon" ]]; then + daemon_installed=true + elif [[ "$component_name" == "web" ]]; then + web_installed=true + fi + return 0 else cprint yellow "Component '$component_name' is not installed" + + # Set corresponding global variable + if [[ "$component_name" == "daemon" ]]; then + daemon_installed=false + elif [[ "$component_name" == "web" ]]; then + web_installed=false + fi + return 1 fi } + + # Parse cmd arguments. parse_args() { while [[ $# -gt 0 ]]; do From 3487a857c771b6036d9cf7e6286a08549261f096 Mon Sep 17 00:00:00 2001 From: KUMAKAIHA Date: Sun, 11 May 2025 18:55:34 +0800 Subject: [PATCH 284/463] add setup_macOS.sh for macOS setup --- setup_macOS.sh | 226 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 setup_macOS.sh diff --git a/setup_macOS.sh b/setup_macOS.sh new file mode 100644 index 0000000..f4fbdc4 --- /dev/null +++ b/setup_macOS.sh @@ -0,0 +1,226 @@ +#!/bin/bash + +# 获取脚本所在的目录作为安装目录 +# 使用 dirname "$0" 获取脚本路径,然后 cd 到该目录并打印当前路径 (pwd -P 处理符号链接) +# 使用 || exit 表示如果 cd 失败就退出 +INSTALL_DIR="$(cd "$(dirname "$0")" || exit; pwd -P)" +MCSM_DIR="$INSTALL_DIR/mcsmanager" # MCSManager 文件解压后的目录 + +echo "==================================================" +echo " MCSManager 安装脚本 (macOS)" +echo "==================================================" +echo "安装目录: $INSTALL_DIR" +echo "注意:需要 Homebrew 和 Node.js 已安装。" +echo "==================================================" + +# --- 检查必要命令 --- +echo "检查必要命令 (brew, node, npm, curl, tar, pm2)..." +if ! command -v brew &> /dev/null; then + echo "错误: Homebrew 未找到。请先安装 Homebrew。" + exit 1 +fi +if ! command -v node &> /dev/null; then + echo "错误: Node.js 未找到。请使用 'brew install node' 安装。" + exit 1 +fi +if ! command -v npm &> /dev/null; then + echo "错误: npm 未找到。请确保 Node.js 安装正确。" + exit 1 +fi +if ! command -v curl &> /dev/null; then + echo "错误: curl 未找到。" + exit 1 +fi +if ! command -v tar &> /dev/null; then + echo "错误: tar 未找到。" + exit 1 +fi + +# 检查 PM2 是否全局安装,如果没有则提示用户或尝试安装 +if ! command -v pm2 &> /dev/null; then + echo "PM2 未找到。尝试全局安装 PM2..." + npm install -g pm2 + if ! command -v pm2 &> /dev/null; then + echo "错误: PM2 安装失败。请手动运行 'npm install -g pm2'。" + exit 1 + fi + echo "PM2 安装成功。" +else + echo "PM2 已安装。" +fi +echo "必要命令检查通过。" + +# --- 提供安装选项 --- +echo "请选择安装模式:" +echo "1) 安装 Web 面板 + 节点 (Daemon) (推荐)" +echo "2) 只安装节点 (Daemon)" +read -p "请输入选项 (1 或 2): " choice + +# 验证用户输入 +if [[ "$choice" != "1" && "$choice" != "2" ]]; then + echo "无效的输入。请重新运行脚本并选择 1 或 2。" + exit 1 +fi + +# --- 创建安装目录 (脚本所在目录已存在,但需要确保是可写) --- +echo "使用安装目录: $INSTALL_DIR" +if [ ! -w "$INSTALL_DIR" ]; then + echo "错误: 脚本所在目录 $INSTALL_DIR 不可写。请检查权限。" + exit 1 +fi +echo "目录权限检查通过。" + +# --- 下载 MCSManager Release --- +# 使用 Linux 版本,因为 Node.js 部分是跨平台的,且 release 包同时包含 web 和 daemon +MCSM_TAR_URL="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" +MCSM_TAR_FILE="$INSTALL_DIR/mcsmanager_linux_release.tar.gz" + +echo "下载 MCSManager Release ($MCSM_TAR_URL) 到 $MCSM_TAR_FILE" +# 使用 curl 下载,-L 跟随重定向,-o 指定输出文件,-f 在 HTTP 错误时退出 +curl -L -f "$MCSM_TAR_URL" -o "$MCSM_TAR_FILE" +if [ $? -ne 0 ]; then + echo "错误: 下载失败。请检查网络连接或 URL。" + exit 1 +fi +echo "下载成功。" + +# --- 解压 MCSManager Release --- +echo "解压 $MCSM_TAR_FILE 到 $INSTALL_DIR" +# -C 指定解压目录 +tar -zxf "$MCSM_TAR_FILE" -C "$INSTALL_DIR" +if [ $? -ne 0 ]; then + echo "错误: 解压失败。" + # 尝试删除可能不完整的目录 + rm -rf "$MCSM_DIR" + exit 1 +fi + +# 检查解压是否成功创建了 mcsmanager 目录 +if [ ! -d "$MCSM_DIR" ]; then + echo "错误: 解压失败。未找到目录 $MCSM_DIR。" + exit 1 +fi +echo "解压成功。" + +# 清理下载的压缩包 +echo "移除下载的压缩包: $MCSM_TAR_FILE" +rm "$MCSM_TAR_FILE" + +# --- 进入 MCSManager 目录并安装依赖 --- +echo "切换到目录: $MCSM_DIR" +cd "$MCSM_DIR" +if [ $? -ne 0 ]; then + echo "错误: 无法切换到目录 $MCSM_DIR。" + exit 1 +fi + +echo "运行 ./install.sh 安装依赖..." +# 使用 bash 确保脚本正确执行 +bash ./install.sh +if [ $? -ne 0 ]; then + echo "错误: ./install.sh 运行失败。请检查输出信息。" + exit 1 +fi +echo "依赖安装步骤完成。" + +# --- 使用 PM2 启动 MCSManager 进程并配置自启动 --- +echo "使用 PM2 启动 MCSManager 进程..." + +# 停止并删除旧的 PM2 进程(如果存在) +echo "停止并删除旧的 PM2 进程 (如果存在)..." +pm2 stop MCSManager-Daemon &> /dev/null +pm2 delete MCSManager-Daemon &> /dev/null +pm2 stop MCSManager-Web &> /dev/null +pm2 delete MCSManager-Web &> /dev/null +sleep 1 # 等待片刻确保进程停止 + +# 启动 Daemon +echo "启动 MCSManager Daemon..." +pm2 start ./start-daemon.sh --name "MCSManager-Daemon" --output "$INSTALL_DIR/daemon_output.log" --error "$INSTALL_DIR/daemon_error.log" +sleep 3 # 等待片刻让 PM2 启动进程 +if ! pm2 status | grep -q "MCSManager-Daemon"; then + echo "错误: PM2 未能成功启动 MCSManager-Daemon。" + pm2 logs MCSManager-Daemon + exit 1 +fi +echo "MCSManager Daemon 已通过 PM2 启动。" +echo "查看 Daemon 状态: pm2 status MCSManager-Daemon" +echo "查看 Daemon 日志: pm2 logs MCSManager-Daemon" +echo "Daemon 默认监听端口: 24444" + + +# 如果选择安装 Web 面板 +if [ "$choice" == "1" ]; then + echo "" + echo "启动 MCSManager Web 面板..." + pm2 start ./start-web.sh --name "MCSManager-Web" --output "$INSTALL_DIR/web_output.log" --error "$INSTALL_DIR/web_error.log" + sleep 3 # 等待片刻让 PM2 启动进程 + if ! pm2 status | grep -q "MCSManager-Web"; then + echo "错误: PM2 未能成功启动 MCSManager-Web。" + pm2 logs MCSManager-Web + # 注意:这里不退出,因为 Daemon 可能已经启动成功 + echo "请手动检查 MCSManager-Web 的问题。" + else + echo "MCSManager Web 面板已通过 PM2 启动。" + echo "查看 Web 状态: pm2 status MCSManager-Web" + echo "查看 Web 日志: pm2 logs MCSManager-Web" + echo "Web 默认监听端口: 23333" + fi +fi + +echo "" +echo "配置 PM2 自启动 (使用 launchd)..." +# 这个命令会生成一个 launchd 配置文件,并通常会输出一条需要用户手动运行的命令 +# 运行一次即可,它配置的是 PM2 daemon 本身,而不是 MCSM 进程 +pm2 startup launchd + +echo "" +echo "==================================================" +if [ "$choice" == "1" ]; then + echo " MCSManager Web 面板 + 节点 安装完成!" +else + echo " MCSManager 节点 (Daemon) 安装完成!" +fi +echo "==================================================" +echo "安装目录: $INSTALL_DIR" +echo "" + +echo "--- PM2 控制命令参考 ---" +echo "查看所有 MCSManager 进程状态:" +echo " pm2 status" +echo "" +echo "--- Daemon (节点) ---" +echo "进程名: MCSManager-Daemon" +echo "日志文件: $INSTALL_DIR/daemon_output.log, $INSTALL_DIR/daemon_error.log" +echo "启动 Daemon: pm2 start MCSManager-Daemon" +echo "停止 Daemon: pm2 stop MCSManager-Daemon" +echo "重启 Daemon: pm2 restart MCSManager-Daemon" +echo "删除 Daemon (从 PM2 列表移除): pm2 delete MCSManager-Daemon" +echo "查看 Daemon 日志: pm2 logs MCSManager-Daemon" +echo "查看 Daemon 实时日志: pm2 logs MCSManager-Daemon --follow" +echo "" + +if [ "$choice" == "1" ]; then + echo "--- Web 面板 ---" + echo "进程名: MCSManager-Web" + echo "日志文件: $INSTALL_DIR/web_output.log, $INSTALL_DIR/web_error.log" + echo "启动 Web: pm2 start MCSManager-Web" + echo "停止 Web: pm2 stop MCSManager-Web" + echo "重启 Web: pm2 restart MCSManager-Web" + echo "删除 Web (从 PM2 列表移除): pm2 delete MCSManager-Web" + echo "查看 Web 日志: pm2 logs MCSManager-Web" + echo "查看 Web 实时日志: pm2 logs MCSManager-Web --follow" + echo "" + echo "默认访问地址: http://localhost:23333" +fi + +echo "--- 重要:完成自启动设置 ---" +echo "请查找上面 'pm2 startup launchd' 命令的输出,它会显示一条需要您手动执行的命令,通常以 'sudo env PATH=...' 开头。" +echo "请复制并粘贴该命令到终端中运行,以确保 PM2 Daemon 本身在系统重启后自动启动,从而管理 MCSManager 进程。" +echo "示例 (请运行实际输出的命令):" +echo " sudo env PATH=\$PATH:/usr/local/bin /Users/youruser/.nvm/versions/node/vX.Y.Z/bin/pm2 startup launchd -u youruser --hp /Users/youruser" +echo "" +echo "==================================================" + +exit 0 + From 7769af52fc84c16a0cb62a959aa12165be283d1e Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 14 May 2025 01:25:03 -0400 Subject: [PATCH 285/463] check component running permission --- setup.sh | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 96bb4fc..5b07204 100644 --- a/setup.sh +++ b/setup.sh @@ -59,13 +59,18 @@ daemon_installed=false web_installed_user="" daemon_installed_user="" - +# Service file locations +# the final dir = systemd_file + {web/daemon} + ".service" +systemd_file="/etc/systemd/system/mcsm-" # Optional: Override the default installation source file. # If --install-source is specified, the installer will use the provided # "mcsmanager_linux_release.tar.gz" file instead of downloading it. # Only support local absolute path. install_source_path="" +# temp path for extracted file(s) +install_tmp_dir="" + # System architecture (detected automatically) arch="" version="" @@ -225,6 +230,42 @@ is_component_installed() { fi } +check_component_permission() { + local component="$1" + local service_file="${systemd_file}${component}.service" + + if [[ ! -f "$service_file" ]]; then + cprint yellow "Service file not found: $service_file" + return 0 # nothing changed + fi + + # Extract the User= line if it exists + local user_line + user_line=$(grep -E '^User=' "$service_file" 2>/dev/null | head -1) + + local user + if [[ -z "$user_line" ]]; then + user="root" # default if no User= is defined + else + user="${user_line#User=}" + fi + + # Validate user + if [[ "$user" != "root" && "$user" != "mcsm" ]]; then + cprint red bold "Unsupported user '$user' in $service_file. Expected 'root' or 'mcsm'." + exit 1 + fi + + # Assign to appropriate global + if [[ "$component" == "web" ]]; then + web_installed_user="$user" + elif [[ "$component" == "daemon" ]]; then + daemon_installed_user="$user" + fi + + cprint cyan "Detected $component installed as user: $user" + return 0 +} @@ -255,15 +296,19 @@ parse_args() { case "$2" in daemon) install_daemon=true + check_component_permission "daemon" install_web=false ;; web) install_daemon=false install_web=true + check_component_permission "web" ;; all) install_daemon=true + check_component_permission "daemon" install_web=true + check_component_permission "web" ;; *) echo "Error: Invalid value for --install. Expected 'daemon', 'web', or 'all'." @@ -279,9 +324,11 @@ parse_args() { if is_component_installed "daemon"; then daemon_installed=true + check_component_permission "daemon" fi if is_component_installed "web"; then web_installed=true + check_component_permission "web" fi if [[ "$daemon_installed" == true && "$web_installed" == false ]]; then From a9cf3e01e1e045a7964e5e0a9d36920ddd106d4c Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 14 May 2025 01:39:03 -0400 Subject: [PATCH 286/463] added function to validate permission before file operations --- setup.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/setup.sh b/setup.sh index 5b07204..54036b7 100644 --- a/setup.sh +++ b/setup.sh @@ -92,6 +92,7 @@ required_commands=( chown wget tar + stat ) # Node.js related sections @@ -528,6 +529,53 @@ cprint() { printf "%b%s%b\n" "$prefix" "$text" "$RESET" } +# Permission check before proceed with installation +permission_barrier() { + if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then + cprint cyan "No components currently installed — skipping permission check." + return 0 + fi + + for component in web daemon; do + local is_installed_var="${component}_installed" + local installed_user_var="${component}_installed_user" + + if [[ "${!is_installed_var}" == true ]]; then + local installed_user="${!installed_user_var}" + + # Step 1: User match check + if [[ "$installed_user" != "$install_user" ]]; then + cprint red bold "Permission mismatch for '$component':" + cprint red "Installed as user: $installed_user" + cprint red "Current install target user: $install_user" + cprint red "Unable to proceed due to ownership conflict." + exit 1 + fi + fi + done + + # Step 2: Directory ownership check + local dir_owner + dir_owner=$(stat -c '%U' "$install_dir" 2>/dev/null) + + if [[ -z "$dir_owner" ]]; then + cprint red bold "✖ Unable to determine owner of install_dir: $install_dir" + exit 1 + fi + + if [[ "$dir_owner" != "$install_user" ]]; then + cprint red bold "✖ Install directory ownership mismatch:" + cprint red " Directory: $install_dir" + cprint red " Owned by: $dir_owner" + cprint red " Expected: $install_user" + exit 1 + fi + + cprint green bold "✔ Permissions and ownership validated. Proceeding." + return 0 +} + + # Map OS arch with actual Node.js Arch name # This function should be placed after var arch has been assigned a valid value. resolve_node_arch() { @@ -737,5 +785,7 @@ main() { if [ "$install_node" = true ]; then safe_run install_node "Node.js installation failed" fi + + safe_run permission_barrier "Permission validation failed — aborting install" } main "$@" \ No newline at end of file From 3d2f42f8476184b10e30e512fd9a8a168f639faa Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 14 May 2025 01:52:58 -0400 Subject: [PATCH 287/463] added function to download MCSManager package --- setup.sh | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/setup.sh b/setup.sh index 54036b7..018226b 100644 --- a/setup.sh +++ b/setup.sh @@ -38,6 +38,9 @@ node_download_fallback="" # Node.js installation path (defaults to the MCSManager installation path. Can be overridden with --node-install-dir) node_install_dir="$install_dir" +# Temp dir for file extraction +tmp_dir="/tmp" + # --------------- Global Variables ---------------# # DO NOT MODIFY # @@ -765,8 +768,82 @@ install_node() { return 0 } +# Function to download MCSM package. fetch from primary URL first, then fallback URL. +# This function only put extracted file(s) into install_dir, it does not perform the actual update. +download_mcsm() { + local archive_name="$package_name" + local archive_path="${tmp_dir}/${archive_name}" + local primary_url="${download_base_url}${archive_name}" + local fallback="$download_fallback_url" + + cprint cyan bold "➡ Downloading MCSManager package..." + + # Step 1: Try downloading from primary URL + if ! wget --progress=bar:force -O "$archive_path" "$primary_url"; then + cprint yellow "Primary download failed. Attempting fallback source..." + + if [[ -z "$fallback" ]]; then + cprint red bold "No fallback URL or path specified." + return 1 + fi + + if [[ "$fallback" =~ ^https?:// ]]; then + if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then + cprint red bold "Fallback download failed from $fallback" + return 1 + fi + elif [[ -f "$fallback" ]]; then + cp "$fallback" "$archive_path" || { + cprint red bold "Failed to copy fallback archive from $fallback" + return 1 + } + else + cprint red bold "Fallback path is invalid: $fallback" + return 1 + fi + fi + # Step 2: Generate extract directory + local suffix + suffix=$(tr -dc 'a-z0-9' Date: Wed, 14 May 2025 02:03:53 -0400 Subject: [PATCH 288/463] updated permission barrier to count for customized systemd file --- setup.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index 018226b..f1fb22b 100644 --- a/setup.sh +++ b/setup.sh @@ -546,12 +546,20 @@ permission_barrier() { if [[ "${!is_installed_var}" == true ]]; then local installed_user="${!installed_user_var}" + # Step 0: Ensure installed user is detected + if [[ -z "$installed_user" ]]; then + cprint red bold "Detected that '$component' is installed but could not determine the user from its systemd service file." + cprint red " This may indicate a custom or unsupported service file setup." + cprint red " Refusing to proceed to avoid potential conflicts." + exit 1 + fi + # Step 1: User match check if [[ "$installed_user" != "$install_user" ]]; then cprint red bold "Permission mismatch for '$component':" - cprint red "Installed as user: $installed_user" - cprint red "Current install target user: $install_user" - cprint red "Unable to proceed due to ownership conflict." + cprint red " Installed as user: $installed_user" + cprint red " Current install target user: $install_user" + cprint red " Unable to proceed due to ownership conflict." exit 1 fi fi @@ -562,23 +570,24 @@ permission_barrier() { dir_owner=$(stat -c '%U' "$install_dir" 2>/dev/null) if [[ -z "$dir_owner" ]]; then - cprint red bold "✖ Unable to determine owner of install_dir: $install_dir" + cprint red bold "Unable to determine owner of install_dir: $install_dir" exit 1 fi if [[ "$dir_owner" != "$install_user" ]]; then - cprint red bold "✖ Install directory ownership mismatch:" + cprint red bold "Install directory ownership mismatch:" cprint red " Directory: $install_dir" cprint red " Owned by: $dir_owner" cprint red " Expected: $install_user" exit 1 fi - cprint green bold "✔ Permissions and ownership validated. Proceeding." + cprint green bold "Permissions and ownership validated. Proceeding." return 0 } + # Map OS arch with actual Node.js Arch name # This function should be placed after var arch has been assigned a valid value. resolve_node_arch() { From 931c511d969afea0929cef5f6ed1f67004962b80 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 14 May 2025 02:30:35 -0400 Subject: [PATCH 289/463] added function to prepre file & permissions before actual install --- setup.sh | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/setup.sh b/setup.sh index f1fb22b..96a6cd1 100644 --- a/setup.sh +++ b/setup.sh @@ -74,6 +74,11 @@ install_source_path="" # temp path for extracted file(s) install_tmp_dir="" +# dir name for data dir backup +# e.g. /opt/mcsmanager/daemon/data -> /opt/mcsmanager/data_bak_data +# only valid for when during an update +backup_prefix="data_bak_" + # System architecture (detected automatically) arch="" version="" @@ -854,6 +859,68 @@ download_mcsm() { return 0 } +# Prepare file & permissions before install. +mcsm_install_prepare() { + if [[ ! -d "$install_tmp_dir" ]]; then + cprint red bold "install_tmp_dir does not exist: $install_tmp_dir" + exit 1 + fi + + cprint cyan "Changing ownership of $install_tmp_dir to user '$install_user'..." + chown -R "$install_user":"$install_user" "$install_tmp_dir" || { + cprint red bold "Failed to change ownership of $install_tmp_dir" + exit 1 + } + + # Normalize install_dir to ensure it ends with a slash + [[ "${install_dir}" != */ ]] && install_dir="${install_dir}/" + + if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then + cprint cyan "No existing components detected — skipping data backup/cleanup." + return 0 + fi + + for component in web daemon; do + local is_installed_var="${component}_installed" + if [[ "${!is_installed_var}" == true ]]; then + local component_path="${install_dir}${component}" + local data_dir="${component_path}/data" + local backup_path="${install_dir}${backup_prefix}${component}" + + if [[ ! -d "$component_path" ]]; then + cprint yellow "Expected installed component directory not found: $component_path" + continue + fi + + if [[ -d "$data_dir" ]]; then + if [[ -e "$backup_path" ]]; then + cprint red bold "Backup destination already exists: $backup_path" + cprint red " Please resolve this conflict manually before continuing." + exit 1 + fi + + cprint cyan "Backing up data directory for $component..." + mv "$data_dir" "$backup_path" || { + cprint red bold "Failed to move $data_dir to $backup_path" + exit 1 + } + cprint green "Moved $data_dir → $backup_path" + else + cprint yellow "No data directory found for $component — skipping backup." + fi + + cprint cyan "Removing old component directory: $component_path" + rm -rf "$component_path" || { + cprint red bold "Failed to remove old component directory: $component_path" + exit 1 + } + fi + done + + cprint green bold "Existing components prepared successfully." + return 0 +} + main() { trap 'echo "Unexpected error occurred."; exit 99' ERR From 85281f3992c06431a161434ffd8e1d0da4f2c396 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 14 May 2025 02:46:44 -0400 Subject: [PATCH 290/463] added function to prepare standalone user --- setup.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/setup.sh b/setup.sh index 96a6cd1..45c262e 100644 --- a/setup.sh +++ b/setup.sh @@ -101,6 +101,8 @@ required_commands=( wget tar stat + useradd + usermod ) # Node.js related sections @@ -859,8 +861,55 @@ download_mcsm() { return 0 } +# Prepare user if needed +prepare_user() { + if [[ "$install_user" == "root" ]]; then + cprint cyan "✔ install_user is 'root' — skipping user creation." + return 0 + fi + + # Check if user already exists + if id "$install_user" &>/dev/null; then + cprint green "User '$install_user' already exists." + else + cprint cyan "Creating system user: $install_user (nologin, no password)..." + if ! useradd --system --home "$install_dir" --shell /usr/sbin/nologin "$install_user"; then + cprint red bold "Failed to create user: $install_user" + exit 1 + fi + cprint green "User '$install_user' created." + fi + + # Docker integration + if command -v docker &>/dev/null; then + cprint cyan "Docker is installed — checking group assignment..." + + if getent group docker &>/dev/null; then + if id -nG "$install_user" | grep -qw docker; then + cprint green "User '$install_user' is already in the 'docker' group." + else + cprint cyan "Adding user '$install_user' to 'docker' group..." + if usermod -aG docker "$install_user"; then + cprint green "Docker group access granted to '$install_user'." + else + cprint red "Failed to add '$install_user' to 'docker' group. Docker may not be usable by this user." + fi + fi + else + cprint red "Docker installed but 'docker' group not found. Skipping group assignment." + fi + else + cprint yellow "Docker not installed — skipping Docker group configuration." + fi + + return 0 +} + # Prepare file & permissions before install. mcsm_install_prepare() { + # Prepare the user first + prepare_user + if [[ ! -d "$install_tmp_dir" ]]; then cprint red bold "install_tmp_dir does not exist: $install_tmp_dir" exit 1 From 297c5c220bd67cf92434f452bd534bdf0550701a Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 14 May 2025 03:07:06 -0400 Subject: [PATCH 291/463] added function to install a single component & simple wrapper --- setup.sh | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/setup.sh b/setup.sh index 45c262e..c683537 100644 --- a/setup.sh +++ b/setup.sh @@ -970,6 +970,82 @@ mcsm_install_prepare() { return 0 } +# Install or update a component +install_component() { + local component="$1" + local target_path="${install_dir}${component}" + local backup_data_path="${install_dir}${backup_prefix}${component}" + local source_path="${install_tmp_dir}/mcsmanager/${component}" + + cprint cyan bold "➡ Installing component: $component" + + # Step 1: Move new component to install_dir + if [[ ! -d "$source_path" ]]; then + cprint red bold "Source directory not found: $source_path" + exit 1 + fi + + if [[ -e "$target_path" ]]; then + cprint red bold "Target path already exists: $target_path" + cprint red " This should not happen — possible permission error or unclean install." + exit 1 + fi + + mv "$source_path" "$target_path" || { + cprint red bold "Failed to move $source_path → $target_path" + exit 1 + } + + cprint green "Moved $component to $target_path" + + # Step 2: Restore backed-up data directory if present + if [[ -d "$backup_data_path" ]]; then + local target_data_path="${target_path}/data" + + cprint cyan "Restoring backed-up data directory for $component..." + + rm -rf "$target_data_path" # Ensure no conflict + mv "$backup_data_path" "$target_data_path" || { + cprint red bold "Failed to restore data directory to $target_data_path" + exit 1 + } + + cprint green "Data directory restored: $target_data_path" + else + cprint yellow "No backed-up data directory found for $component — fresh install assumed." + fi + + # Step 3: Install NPM dependencies + if [[ ! -x "$npm_bin_path" ]]; then + cprint red bold "npm binary not found or not executable: $npm_bin_path" + exit 1 + fi + + cprint cyan "Installing dependencies for $component using npm..." + pushd "$target_path" >/dev/null || { + cprint red bold "Failed to change directory to $target_path" + exit 1 + } + + if ! "$npm_bin_path" install --no-audit --no-fund --loglevel=warn; then + cprint red bold "NPM dependency installation failed for $component" + popd >/dev/null + exit 1 + fi + + popd >/dev/null + cprint green bold "Component '$component' installed successfully." +} + +install_mcsm() { + if [[ "$install_web" == true ]]; then + install_component "web" + fi + + if [[ "$install_daemon" == true ]]; then + install_component "daemon" + fi +} main() { trap 'echo "Unexpected error occurred."; exit 99' ERR @@ -991,5 +1067,8 @@ main() { safe_run permission_barrier "Permission validation failed — aborting install" safe_run download_mcsm "Failed to acquire MCSManager source" + safe_run mcsm_install_prepare "Error while preparing for installation" + + } main "$@" \ No newline at end of file From 1734516ff6d09e2dd5609ba2567f706280d48839 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 14 May 2025 03:07:52 -0400 Subject: [PATCH 292/463] minor language fix --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index c683537..8f5de3c 100644 --- a/setup.sh +++ b/setup.sh @@ -977,7 +977,7 @@ install_component() { local backup_data_path="${install_dir}${backup_prefix}${component}" local source_path="${install_tmp_dir}/mcsmanager/${component}" - cprint cyan bold "➡ Installing component: $component" + cprint cyan bold "Installing/Updating component: $component" # Step 1: Move new component to install_dir if [[ ! -d "$source_path" ]]; then @@ -1034,7 +1034,7 @@ install_component() { fi popd >/dev/null - cprint green bold "Component '$component' installed successfully." + cprint green bold "Component '$component' installed/updated successfully." } install_mcsm() { From e757094224fed58bc27b8be54c24f8396c9c813a Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 14 May 2025 03:31:22 -0400 Subject: [PATCH 293/463] added function to create service file --- setup.sh | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/setup.sh b/setup.sh index 8f5de3c..d5e028c 100644 --- a/setup.sh +++ b/setup.sh @@ -1037,13 +1037,83 @@ install_component() { cprint green bold "Component '$component' installed/updated successfully." } +# Create systemd service for a given component. +# This will overwrite the existing service file. +create_systemd_service() { + local component="$1" + local service_path="${systemd_file}${component}.service" + local working_dir="${install_dir}${component}" + local exec="${node_bin_path} app.js" + + if [[ ! -d "$working_dir" ]]; then + cprint red bold "Component directory not found: $working_dir" + return 1 + fi + + cprint cyan "Creating systemd service for '$component'..." + + cat > "$service_path" < 0 )); then + cprint cyan "Reloading systemd daemon..." + # systemctl daemon-reexec + systemctl daemon-reload + + for comp in "${components[@]}"; do + local svc="mcsm-${comp}.service" + + cprint cyan "Enabling service: $svc" + if systemctl enable "$svc" &>/dev/null; then + cprint green "Enabled service: $svc" + else + cprint red bold "Failed to enable service: $svc" + exit 1 + fi + done fi } From 3fda815352ba38074fc242679689bf3a55820819 Mon Sep 17 00:00:00 2001 From: KUMAKAIHA Date: Thu, 15 May 2025 10:38:08 +0800 Subject: [PATCH 294/463] Separate Chinese and English scripts and further automate the process. --- setup_macOS.sh | 223 ++++++++++++++++++++++------------------- setup_macOS_cn.sh | 245 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 366 insertions(+), 102 deletions(-) create mode 100644 setup_macOS_cn.sh diff --git a/setup_macOS.sh b/setup_macOS.sh index f4fbdc4..68de860 100644 --- a/setup_macOS.sh +++ b/setup_macOS.sh @@ -1,197 +1,220 @@ #!/bin/bash -# 获取脚本所在的目录作为安装目录 -# 使用 dirname "$0" 获取脚本路径,然后 cd 到该目录并打印当前路径 (pwd -P 处理符号链接) -# 使用 || exit 表示如果 cd 失败就退出 INSTALL_DIR="$(cd "$(dirname "$0")" || exit; pwd -P)" -MCSM_DIR="$INSTALL_DIR/mcsmanager" # MCSManager 文件解压后的目录 +MCSM_DIR="$INSTALL_DIR/mcsmanager" echo "==================================================" -echo " MCSManager 安装脚本 (macOS)" +echo " MCSManager Installation Script (macOS)" echo "==================================================" -echo "安装目录: $INSTALL_DIR" -echo "注意:需要 Homebrew 和 Node.js 已安装。" +echo "Install directory: $INSTALL_DIR" +echo "Note: Homebrew and Node.js are required." echo "==================================================" -# --- 检查必要命令 --- -echo "检查必要命令 (brew, node, npm, curl, tar, pm2)..." +echo "Automatically checking and installing required dependencies (brew, node, npm, curl, tar, pm2)..." + if ! command -v brew &> /dev/null; then - echo "错误: Homebrew 未找到。请先安装 Homebrew。" - exit 1 + echo "Homebrew not found, installing Homebrew..." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + if ! command -v brew &> /dev/null; then + echo "Error: Homebrew installation failed." + exit 1 + fi fi + if ! command -v node &> /dev/null; then - echo "错误: Node.js 未找到。请使用 'brew install node' 安装。" - exit 1 + echo "Node.js not found, installing Node.js via Homebrew..." + brew install node + if ! command -v node &> /dev/null; then + echo "Error: Node.js installation failed." + exit 1 + fi fi + if ! command -v npm &> /dev/null; then - echo "错误: npm 未找到。请确保 Node.js 安装正确。" - exit 1 + echo "npm not found, reinstalling Node.js via Homebrew..." + brew install node + if ! command -v npm &> /dev/null; then + echo "Error: npm installation failed." + exit 1 + fi fi + if ! command -v curl &> /dev/null; then - echo "错误: curl 未找到。" - exit 1 + echo "curl not found, installing curl via Homebrew..." + brew install curl + if ! command -v curl &> /dev/null; then + echo "Error: curl installation failed." + exit 1 + fi fi + if ! command -v tar &> /dev/null; then - echo "错误: tar 未找到。" - exit 1 + echo "tar not found, installing tar via Homebrew..." + brew install tar + if ! command -v tar &> /dev/null; then + echo "Error: tar installation failed." + exit 1 + fi fi -# 检查 PM2 是否全局安装,如果没有则提示用户或尝试安装 if ! command -v pm2 &> /dev/null; then - echo "PM2 未找到。尝试全局安装 PM2..." + echo "PM2 not found, installing PM2 globally..." npm install -g pm2 if ! command -v pm2 &> /dev/null; then - echo "错误: PM2 安装失败。请手动运行 'npm install -g pm2'。" + echo "Error: PM2 installation failed. Please run 'npm install -g pm2' manually." exit 1 fi - echo "PM2 安装成功。" + echo "PM2 installed successfully." else - echo "PM2 已安装。" + echo "PM2 is already installed." fi -echo "必要命令检查通过。" - -# --- 提供安装选项 --- -echo "请选择安装模式:" -echo "1) 安装 Web 面板 + 节点 (Daemon) (推荐)" -echo "2) 只安装节点 (Daemon)" -read -p "请输入选项 (1 或 2): " choice +echo "All dependencies checked and installed." -# 验证用户输入 -if [[ "$choice" != "1" && "$choice" != "2" ]]; then - echo "无效的输入。请重新运行脚本并选择 1 或 2。" - exit 1 +echo "Web Panel + Node (Daemon) will be installed automatically (recommended)." +read -p "Continue installation? (y/n): " confirm +if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then + echo "Installation cancelled." + exit 0 fi +choice="1" -# --- 创建安装目录 (脚本所在目录已存在,但需要确保是可写) --- -echo "使用安装目录: $INSTALL_DIR" +echo "Using install directory: $INSTALL_DIR" if [ ! -w "$INSTALL_DIR" ]; then - echo "错误: 脚本所在目录 $INSTALL_DIR 不可写。请检查权限。" + echo "Error: $INSTALL_DIR is not writable. Please check permissions." exit 1 fi -echo "目录权限检查通过。" +echo "Directory permission check passed." -# --- 下载 MCSManager Release --- -# 使用 Linux 版本,因为 Node.js 部分是跨平台的,且 release 包同时包含 web 和 daemon MCSM_TAR_URL="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" MCSM_TAR_FILE="$INSTALL_DIR/mcsmanager_linux_release.tar.gz" -echo "下载 MCSManager Release ($MCSM_TAR_URL) 到 $MCSM_TAR_FILE" -# 使用 curl 下载,-L 跟随重定向,-o 指定输出文件,-f 在 HTTP 错误时退出 +echo "Downloading MCSManager Release ($MCSM_TAR_URL) to $MCSM_TAR_FILE" curl -L -f "$MCSM_TAR_URL" -o "$MCSM_TAR_FILE" if [ $? -ne 0 ]; then - echo "错误: 下载失败。请检查网络连接或 URL。" + echo "Error: Download failed. Please check your network or the URL." exit 1 fi -echo "下载成功。" +echo "Download successful." -# --- 解压 MCSManager Release --- -echo "解压 $MCSM_TAR_FILE 到 $INSTALL_DIR" -# -C 指定解压目录 +echo "Extracting $MCSM_TAR_FILE to $INSTALL_DIR" tar -zxf "$MCSM_TAR_FILE" -C "$INSTALL_DIR" if [ $? -ne 0 ]; then - echo "错误: 解压失败。" - # 尝试删除可能不完整的目录 + echo "Error: Extraction failed." rm -rf "$MCSM_DIR" exit 1 fi -# 检查解压是否成功创建了 mcsmanager 目录 if [ ! -d "$MCSM_DIR" ]; then - echo "错误: 解压失败。未找到目录 $MCSM_DIR。" + echo "Error: Extraction failed. Directory $MCSM_DIR not found." exit 1 fi -echo "解压成功。" +echo "Extraction successful." -# 清理下载的压缩包 -echo "移除下载的压缩包: $MCSM_TAR_FILE" +echo "Removing downloaded archive: $MCSM_TAR_FILE" rm "$MCSM_TAR_FILE" -# --- 进入 MCSManager 目录并安装依赖 --- -echo "切换到目录: $MCSM_DIR" +echo "Changing to directory: $MCSM_DIR" cd "$MCSM_DIR" if [ $? -ne 0 ]; then - echo "错误: 无法切换到目录 $MCSM_DIR。" + echo "Error: Failed to change directory to $MCSM_DIR." exit 1 fi -echo "运行 ./install.sh 安装依赖..." -# 使用 bash 确保脚本正确执行 +echo "Running ./install.sh to install dependencies..." bash ./install.sh if [ $? -ne 0 ]; then - echo "错误: ./install.sh 运行失败。请检查输出信息。" + echo "Error: ./install.sh failed. Please check the output." exit 1 fi -echo "依赖安装步骤完成。" +echo "Dependency installation completed." -# --- 使用 PM2 启动 MCSManager 进程并配置自启动 --- -echo "使用 PM2 启动 MCSManager 进程..." +echo "Starting MCSManager processes with PM2..." -# 停止并删除旧的 PM2 进程(如果存在) -echo "停止并删除旧的 PM2 进程 (如果存在)..." +echo "Stopping and deleting old PM2 processes (if any)..." pm2 stop MCSManager-Daemon &> /dev/null pm2 delete MCSManager-Daemon &> /dev/null pm2 stop MCSManager-Web &> /dev/null pm2 delete MCSManager-Web &> /dev/null -sleep 1 # 等待片刻确保进程停止 +sleep 1 -# 启动 Daemon -echo "启动 MCSManager Daemon..." -pm2 start ./start-daemon.sh --name "MCSManager-Daemon" --output "$INSTALL_DIR/daemon_output.log" --error "$INSTALL_DIR/daemon_error.log" -sleep 3 # 等待片刻让 PM2 启动进程 +echo "Starting MCSManager Daemon..." +pm2 start ./start-daemon.sh --name "MCSManager-Daemon" --output "$MCSM_DIR/daemon_output.log" --error "$MCSM_DIR/daemon_error.log" +sleep 3 if ! pm2 status | grep -q "MCSManager-Daemon"; then - echo "错误: PM2 未能成功启动 MCSManager-Daemon。" + echo "Error: PM2 failed to start MCSManager-Daemon." pm2 logs MCSManager-Daemon exit 1 fi -echo "MCSManager Daemon 已通过 PM2 启动。" -echo "查看 Daemon 状态: pm2 status MCSManager-Daemon" -echo "查看 Daemon 日志: pm2 logs MCSManager-Daemon" -echo "Daemon 默认监听端口: 24444" +echo "MCSManager Daemon started with PM2." +echo "Check Daemon status: pm2 status MCSManager-Daemon" +echo "Check Daemon logs: pm2 logs MCSManager-Daemon" +echo "Daemon default port: 24444" - -# 如果选择安装 Web 面板 if [ "$choice" == "1" ]; then echo "" - echo "启动 MCSManager Web 面板..." - pm2 start ./start-web.sh --name "MCSManager-Web" --output "$INSTALL_DIR/web_output.log" --error "$INSTALL_DIR/web_error.log" - sleep 3 # 等待片刻让 PM2 启动进程 + echo "Starting MCSManager Web Panel..." + pm2 start ./start-web.sh --name "MCSManager-Web" --output "$MCSM_DIR/web_output.log" --error "$MCSM_DIR/web_error.log" + sleep 3 if ! pm2 status | grep -q "MCSManager-Web"; then - echo "错误: PM2 未能成功启动 MCSManager-Web。" + echo "Error: PM2 failed to start MCSManager-Web." pm2 logs MCSManager-Web - # 注意:这里不退出,因为 Daemon 可能已经启动成功 - echo "请手动检查 MCSManager-Web 的问题。" + echo "Please check the MCSManager-Web issue manually." else - echo "MCSManager Web 面板已通过 PM2 启动。" - echo "查看 Web 状态: pm2 status MCSManager-Web" - echo "查看 Web 日志: pm2 logs MCSManager-Web" - echo "Web 默认监听端口: 23333" + echo "MCSManager Web Panel started with PM2." + echo "Check Web status: pm2 status MCSManager-Web" + echo "Check Web logs: pm2 logs MCSManager-Web" + echo "Web default port: 23333" fi fi echo "" -echo "配置 PM2 自启动 (使用 launchd)..." -# 这个命令会生成一个 launchd 配置文件,并通常会输出一条需要用户手动运行的命令 -# 运行一次即可,它配置的是 PM2 daemon 本身,而不是 MCSM 进程 -pm2 startup launchd +echo "Configuring PM2 startup (using launchd)..." +startup_cmd=$(pm2 startup launchd | grep 'sudo' | sed 's/^.*\(sudo.*\)$/\1/') +if [ -n "$startup_cmd" ]; then + echo "Executing PM2 startup command automatically..." + eval $startup_cmd + if [ $? -eq 0 ]; then + echo "PM2 startup configuration completed automatically." + else + echo "Failed to execute PM2 startup command automatically. Please run the following command manually:" + echo " $startup_cmd" + fi +else + echo "Failed to get PM2 startup command automatically. Please run 'pm2 startup launchd' and follow the instructions." +fi echo "" echo "==================================================" if [ "$choice" == "1" ]; then - echo " MCSManager Web 面板 + 节点 安装完成!" + echo " MCSManager Web Panel + Node installation completed!" else - echo " MCSManager 节点 (Daemon) 安装完成!" + echo " MCSManager Node (Daemon) installation completed!" fi echo "==================================================" -echo "安装目录: $INSTALL_DIR" +echo "Install directory: $INSTALL_DIR" echo "" +GLOBAL_JSON="$MCSM_DIR/daemon/data/Config/global.json" +if [ -f "$GLOBAL_JSON" ]; then + NODE_KEY=$(grep '"key"' "$GLOBAL_JSON" | head -n1 | sed 's/.*"key": *"\([^"]*\)".*/\1/') + if [ -n "$NODE_KEY" ]; then + echo "请及时复制以下远程节点密钥,用于连接节点:" + echo "节点 Key: $NODE_KEY" + else + echo "未能自动获取节点 Key,请手动查看 $GLOBAL_JSON" + fi +else + echo "未找到 $GLOBAL_JSON,无法获取节点 Key。" +fi + +echo "" echo "--- PM2 控制命令参考 ---" echo "查看所有 MCSManager 进程状态:" echo " pm2 status" echo "" echo "--- Daemon (节点) ---" echo "进程名: MCSManager-Daemon" -echo "日志文件: $INSTALL_DIR/daemon_output.log, $INSTALL_DIR/daemon_error.log" +echo "日志文件: $MCSM_DIR/daemon_output.log, $MCSM_DIR/daemon_error.log" echo "启动 Daemon: pm2 start MCSManager-Daemon" echo "停止 Daemon: pm2 stop MCSManager-Daemon" echo "重启 Daemon: pm2 restart MCSManager-Daemon" @@ -203,7 +226,7 @@ echo "" if [ "$choice" == "1" ]; then echo "--- Web 面板 ---" echo "进程名: MCSManager-Web" - echo "日志文件: $INSTALL_DIR/web_output.log, $INSTALL_DIR/web_error.log" + echo "日志文件: $MCSM_DIR/web_output.log, $MCSM_DIR/web_error.log" echo "启动 Web: pm2 start MCSManager-Web" echo "停止 Web: pm2 stop MCSManager-Web" echo "重启 Web: pm2 restart MCSManager-Web" @@ -215,11 +238,7 @@ if [ "$choice" == "1" ]; then fi echo "--- 重要:完成自启动设置 ---" -echo "请查找上面 'pm2 startup launchd' 命令的输出,它会显示一条需要您手动执行的命令,通常以 'sudo env PATH=...' 开头。" -echo "请复制并粘贴该命令到终端中运行,以确保 PM2 Daemon 本身在系统重启后自动启动,从而管理 MCSManager 进程。" -echo "示例 (请运行实际输出的命令):" -echo " sudo env PATH=\$PATH:/usr/local/bin /Users/youruser/.nvm/versions/node/vX.Y.Z/bin/pm2 startup launchd -u youruser --hp /Users/youruser" -echo "" +echo "PM2 自启动配置已自动尝试执行。若有报错,请参考上方命令手动执行。" echo "==================================================" exit 0 diff --git a/setup_macOS_cn.sh b/setup_macOS_cn.sh new file mode 100644 index 0000000..6374f67 --- /dev/null +++ b/setup_macOS_cn.sh @@ -0,0 +1,245 @@ +#!/bin/bash + +INSTALL_DIR="$(cd "$(dirname "$0")" || exit; pwd -P)" +MCSM_DIR="$INSTALL_DIR/mcsmanager" + +echo "==================================================" +echo " MCSManager 安装脚本 (macOS)" +echo "==================================================" +echo "安装目录: $INSTALL_DIR" +echo "注意:需要 Homebrew 和 Node.js 已安装。" +echo "==================================================" + +echo "将自动检测并安装所需依赖 (brew, node, npm, curl, tar, pm2)..." + +if ! command -v brew &> /dev/null; then + echo "未检测到 Homebrew,正在自动安装 Homebrew..." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + if ! command -v brew &> /dev/null; then + echo "错误: Homebrew 安装失败。" + exit 1 + fi +fi + +if ! command -v node &> /dev/null; then + echo "未检测到 Node.js,正在通过 Homebrew 安装 Node.js..." + brew install node + if ! command -v node &> /dev/null; then + echo "错误: Node.js 安装失败。" + exit 1 + fi +fi + +if ! command -v npm &> /dev/null; then + echo "未检测到 npm,正在通过 Homebrew 重新安装 Node.js..." + brew install node + if ! command -v npm &> /dev/null; then + echo "错误: npm 安装失败。" + exit 1 + fi +fi + +if ! command -v curl &> /dev/null; then + echo "未检测到 curl,正在通过 Homebrew 安装 curl..." + brew install curl + if ! command -v curl &> /dev/null; then + echo "错误: curl 安装失败。" + exit 1 + fi +fi + +if ! command -v tar &> /dev/null; then + echo "未检测到 tar,正在通过 Homebrew 安装 tar..." + brew install tar + if ! command -v tar &> /dev/null; then + echo "错误: tar 安装失败。" + exit 1 + fi +fi + +if ! command -v pm2 &> /dev/null; then + echo "未检测到 PM2,正在全局安装 PM2..." + npm install -g pm2 + if ! command -v pm2 &> /dev/null; then + echo "错误: PM2 安装失败。请手动运行 'npm install -g pm2'。" + exit 1 + fi + echo "PM2 安装成功。" +else + echo "PM2 已安装。" +fi +echo "所有依赖检测并安装完成。" + +echo "将自动安装 Web 面板 + 节点 (Daemon) (推荐)" +read -p "是否继续安装?(y/n): " confirm +if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then + echo "已取消安装。" + exit 0 +fi +choice="1" + +echo "使用安装目录: $INSTALL_DIR" +if [ ! -w "$INSTALL_DIR" ]; then + echo "错误: 脚本所在目录 $INSTALL_DIR 不可写。请检查权限。" + exit 1 +fi +echo "目录权限检查通过。" + +MCSM_TAR_URL="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" +MCSM_TAR_FILE="$INSTALL_DIR/mcsmanager_linux_release.tar.gz" + +echo "下载 MCSManager Release ($MCSM_TAR_URL) 到 $MCSM_TAR_FILE" +curl -L -f "$MCSM_TAR_URL" -o "$MCSM_TAR_FILE" +if [ $? -ne 0 ]; then + echo "错误: 下载失败。请检查网络连接或 URL。" + exit 1 +fi +echo "下载成功。" + +echo "解压 $MCSM_TAR_FILE 到 $INSTALL_DIR" +tar -zxf "$MCSM_TAR_FILE" -C "$INSTALL_DIR" +if [ $? -ne 0 ]; then + echo "错误: 解压失败。" + rm -rf "$MCSM_DIR" + exit 1 +fi + +if [ ! -d "$MCSM_DIR" ]; then + echo "错误: 解压失败。未找到目录 $MCSM_DIR。" + exit 1 +fi +echo "解压成功。" + +echo "移除下载的压缩包: $MCSM_TAR_FILE" +rm "$MCSM_TAR_FILE" + +echo "切换到目录: $MCSM_DIR" +cd "$MCSM_DIR" +if [ $? -ne 0 ]; then + echo "错误: 无法切换到目录 $MCSM_DIR。" + exit 1 +fi + +echo "运行 ./install.sh 安装依赖..." +bash ./install.sh +if [ $? -ne 0 ]; then + echo "错误: ./install.sh 运行失败。请检查输出信息。" + exit 1 +fi +echo "依赖安装步骤完成。" + +echo "使用 PM2 启动 MCSManager 进程..." + +echo "停止并删除旧的 PM2 进程 (如果存在)..." +pm2 stop MCSManager-Daemon &> /dev/null +pm2 delete MCSManager-Daemon &> /dev/null +pm2 stop MCSManager-Web &> /dev/null +pm2 delete MCSManager-Web &> /dev/null +sleep 1 + +echo "启动 MCSManager Daemon..." +pm2 start ./start-daemon.sh --name "MCSManager-Daemon" --output "$MCSM_DIR/daemon_output.log" --error "$MCSM_DIR/daemon_error.log" +sleep 3 +if ! pm2 status | grep -q "MCSManager-Daemon"; then + echo "错误: PM2 未能成功启动 MCSManager-Daemon。" + pm2 logs MCSManager-Daemon + exit 1 +fi +echo "MCSManager Daemon 已通过 PM2 启动。" +echo "查看 Daemon 状态: pm2 status MCSManager-Daemon" +echo "查看 Daemon 日志: pm2 logs MCSManager-Daemon" +echo "Daemon 默认监听端口: 24444" + +if [ "$choice" == "1" ]; then + echo "" + echo "启动 MCSManager Web 面板..." + pm2 start ./start-web.sh --name "MCSManager-Web" --output "$MCSM_DIR/web_output.log" --error "$MCSM_DIR/web_error.log" + sleep 3 + if ! pm2 status | grep -q "MCSManager-Web"; then + echo "错误: PM2 未能成功启动 MCSManager-Web。" + pm2 logs MCSManager-Web + echo "请手动检查 MCSManager-Web 的问题。" + else + echo "MCSManager Web 面板已通过 PM2 启动。" + echo "查看 Web 状态: pm2 status MCSManager-Web" + echo "查看 Web 日志: pm2 logs MCSManager-Web" + echo "Web 默认监听端口: 23333" + fi +fi + +echo "" +echo "配置 PM2 自启动 (使用 launchd)..." +startup_cmd=$(pm2 startup launchd | grep 'sudo' | sed 's/^.*\(sudo.*\)$/\1/') +if [ -n "$startup_cmd" ]; then + echo "自动执行 PM2 自启动命令..." + eval $startup_cmd + if [ $? -eq 0 ]; then + echo "PM2 自启动配置已自动完成。" + else + echo "自动执行 PM2 自启动命令失败,请手动执行以下命令:" + echo " $startup_cmd" + fi +else + echo "未能自动获取 PM2 自启动命令,请手动运行 'pm2 startup launchd' 并按提示操作。" +fi + +echo "" +echo "==================================================" +if [ "$choice" == "1" ]; then + echo " MCSManager Web 面板 + 节点 安装完成!" +else + echo " MCSManager 节点 (Daemon) 安装完成!" +fi +echo "==================================================" +echo "安装目录: $INSTALL_DIR" +echo "" + +GLOBAL_JSON="$MCSM_DIR/daemon/data/Config/global.json" +if [ -f "$GLOBAL_JSON" ]; then + NODE_KEY=$(grep '"key"' "$GLOBAL_JSON" | head -n1 | sed 's/.*"key": *"\([^"]*\)".*/\1/') + if [ -n "$NODE_KEY" ]; then + echo "请及时复制以下远程节点密钥,用于连接节点:" + echo "节点 Key: $NODE_KEY" + else + echo "未能自动获取节点 Key,请手动查看 $GLOBAL_JSON" + fi +else + echo "未找到 $GLOBAL_JSON,无法获取节点 Key。" +fi + +echo "" +echo "--- PM2 控制命令参考 ---" +echo "查看所有 MCSManager 进程状态:" +echo " pm2 status" +echo "" +echo "--- Daemon (节点) ---" +echo "进程名: MCSManager-Daemon" +echo "日志文件: $MCSM_DIR/daemon_output.log, $MCSM_DIR/daemon_error.log" +echo "启动 Daemon: pm2 start MCSManager-Daemon" +echo "停止 Daemon: pm2 stop MCSManager-Daemon" +echo "重启 Daemon: pm2 restart MCSManager-Daemon" +echo "删除 Daemon (从 PM2 列表移除): pm2 delete MCSManager-Daemon" +echo "查看 Daemon 日志: pm2 logs MCSManager-Daemon" +echo "查看 Daemon 实时日志: pm2 logs MCSManager-Daemon --follow" +echo "" + +if [ "$choice" == "1" ]; then + echo "--- Web 面板 ---" + echo "进程名: MCSManager-Web" + echo "日志文件: $MCSM_DIR/web_output.log, $MCSM_DIR/web_error.log" + echo "启动 Web: pm2 start MCSManager-Web" + echo "停止 Web: pm2 stop MCSManager-Web" + echo "重启 Web: pm2 restart MCSManager-Web" + echo "删除 Web (从 PM2 列表移除): pm2 delete MCSManager-Web" + echo "查看 Web 日志: pm2 logs MCSManager-Web" + echo "查看 Web 实时日志: pm2 logs MCSManager-Web --follow" + echo "" + echo "默认访问地址: http://localhost:23333" +fi + +echo "--- 重要:完成自启动设置 ---" +echo "PM2 自启动配置已自动尝试执行。若有报错,请参考上方命令手动执行。" +echo "==================================================" + +exit 0 + From edfb57be17431c8622137325f6a1d9af7436f430 Mon Sep 17 00:00:00 2001 From: KUMAKAIHA Date: Thu, 15 May 2025 11:27:15 +0800 Subject: [PATCH 295/463] Add a separate installation option for nodes --- setup_macOS.sh | 67 ++++++++++++++++++++++++----------------------- setup_macOS_cn.sh | 13 ++++----- 2 files changed, 41 insertions(+), 39 deletions(-) diff --git a/setup_macOS.sh b/setup_macOS.sh index 68de860..3df4d1b 100644 --- a/setup_macOS.sh +++ b/setup_macOS.sh @@ -70,13 +70,14 @@ else fi echo "All dependencies checked and installed." -echo "Web Panel + Node (Daemon) will be installed automatically (recommended)." -read -p "Continue installation? (y/n): " confirm -if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then - echo "Installation cancelled." - exit 0 +echo "Please select installation mode:" +echo "1) Install Web Panel + Node (Daemon) (recommended)" +echo "2) Install Node (Daemon) only" +read -p "Enter your choice (1 or 2): " choice +if [[ "$choice" != "1" && "$choice" != "2" ]]; then + echo "Invalid input. Please rerun the script and select 1 or 2." + exit 1 fi -choice="1" echo "Using install directory: $INSTALL_DIR" if [ ! -w "$INSTALL_DIR" ]; then @@ -198,47 +199,47 @@ GLOBAL_JSON="$MCSM_DIR/daemon/data/Config/global.json" if [ -f "$GLOBAL_JSON" ]; then NODE_KEY=$(grep '"key"' "$GLOBAL_JSON" | head -n1 | sed 's/.*"key": *"\([^"]*\)".*/\1/') if [ -n "$NODE_KEY" ]; then - echo "请及时复制以下远程节点密钥,用于连接节点:" - echo "节点 Key: $NODE_KEY" + echo "Please copy the following remote node key for connecting this node:" + echo "Node Key: $NODE_KEY" else - echo "未能自动获取节点 Key,请手动查看 $GLOBAL_JSON" + echo "Failed to automatically get node key, please check $GLOBAL_JSON manually." fi else - echo "未找到 $GLOBAL_JSON,无法获取节点 Key。" + echo "File $GLOBAL_JSON not found, unable to get node key." fi echo "" -echo "--- PM2 控制命令参考 ---" -echo "查看所有 MCSManager 进程状态:" +echo "--- PM2 Command Reference ---" +echo "Check all MCSManager process status:" echo " pm2 status" echo "" -echo "--- Daemon (节点) ---" -echo "进程名: MCSManager-Daemon" -echo "日志文件: $MCSM_DIR/daemon_output.log, $MCSM_DIR/daemon_error.log" -echo "启动 Daemon: pm2 start MCSManager-Daemon" -echo "停止 Daemon: pm2 stop MCSManager-Daemon" -echo "重启 Daemon: pm2 restart MCSManager-Daemon" -echo "删除 Daemon (从 PM2 列表移除): pm2 delete MCSManager-Daemon" -echo "查看 Daemon 日志: pm2 logs MCSManager-Daemon" -echo "查看 Daemon 实时日志: pm2 logs MCSManager-Daemon --follow" +echo "--- Daemon (Node) ---" +echo "Process name: MCSManager-Daemon" +echo "Log files: $MCSM_DIR/daemon_output.log, $MCSM_DIR/daemon_error.log" +echo "Start Daemon: pm2 start MCSManager-Daemon" +echo "Stop Daemon: pm2 stop MCSManager-Daemon" +echo "Restart Daemon: pm2 restart MCSManager-Daemon" +echo "Delete Daemon (remove from PM2): pm2 delete MCSManager-Daemon" +echo "View Daemon logs: pm2 logs MCSManager-Daemon" +echo "View Daemon live logs: pm2 logs MCSManager-Daemon --follow" echo "" if [ "$choice" == "1" ]; then - echo "--- Web 面板 ---" - echo "进程名: MCSManager-Web" - echo "日志文件: $MCSM_DIR/web_output.log, $MCSM_DIR/web_error.log" - echo "启动 Web: pm2 start MCSManager-Web" - echo "停止 Web: pm2 stop MCSManager-Web" - echo "重启 Web: pm2 restart MCSManager-Web" - echo "删除 Web (从 PM2 列表移除): pm2 delete MCSManager-Web" - echo "查看 Web 日志: pm2 logs MCSManager-Web" - echo "查看 Web 实时日志: pm2 logs MCSManager-Web --follow" + echo "--- Web Panel ---" + echo "Process name: MCSManager-Web" + echo "Log files: $MCSM_DIR/web_output.log, $MCSM_DIR/web_error.log" + echo "Start Web: pm2 start MCSManager-Web" + echo "Stop Web: pm2 stop MCSManager-Web" + echo "Restart Web: pm2 restart MCSManager-Web" + echo "Delete Web (remove from PM2): pm2 delete MCSManager-Web" + echo "View Web logs: pm2 logs MCSManager-Web" + echo "View Web live logs: pm2 logs MCSManager-Web --follow" echo "" - echo "默认访问地址: http://localhost:23333" + echo "Default access: http://localhost:23333" fi -echo "--- 重要:完成自启动设置 ---" -echo "PM2 自启动配置已自动尝试执行。若有报错,请参考上方命令手动执行。" +echo "--- IMPORTANT: Complete PM2 Startup Setup ---" +echo "PM2 startup configuration has been attempted automatically. If there are errors, please refer to the command above and run it manually." echo "==================================================" exit 0 diff --git a/setup_macOS_cn.sh b/setup_macOS_cn.sh index 6374f67..55294ff 100644 --- a/setup_macOS_cn.sh +++ b/setup_macOS_cn.sh @@ -70,13 +70,14 @@ else fi echo "所有依赖检测并安装完成。" -echo "将自动安装 Web 面板 + 节点 (Daemon) (推荐)" -read -p "是否继续安装?(y/n): " confirm -if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then - echo "已取消安装。" - exit 0 +echo "请选择安装模式:" +echo "1) 安装 Web 面板 + 节点 (Daemon) (推荐)" +echo "2) 只安装节点 (Daemon)" +read -p "请输入选项 (1 或 2): " choice +if [[ "$choice" != "1" && "$choice" != "2" ]]; then + echo "无效的输入。请重新运行脚本并选择 1 或 2。" + exit 1 fi -choice="1" echo "使用安装目录: $INSTALL_DIR" if [ ! -w "$INSTALL_DIR" ]; then From 8624ebe17769171931e28192e9e4b2288fa198a4 Mon Sep 17 00:00:00 2001 From: KUMAKAIHA Date: Thu, 15 May 2025 11:34:39 +0800 Subject: [PATCH 296/463] Optimize script prompt text --- setup_macOS.sh | 2 +- setup_macOS_cn.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup_macOS.sh b/setup_macOS.sh index 3df4d1b..f711303 100644 --- a/setup_macOS.sh +++ b/setup_macOS.sh @@ -172,7 +172,7 @@ echo "" echo "Configuring PM2 startup (using launchd)..." startup_cmd=$(pm2 startup launchd | grep 'sudo' | sed 's/^.*\(sudo.*\)$/\1/') if [ -n "$startup_cmd" ]; then - echo "Executing PM2 startup command automatically..." + echo "Executing PM2 startup command automatically. Please enter your password below (not visible):" eval $startup_cmd if [ $? -eq 0 ]; then echo "PM2 startup configuration completed automatically." diff --git a/setup_macOS_cn.sh b/setup_macOS_cn.sh index 55294ff..abcc950 100644 --- a/setup_macOS_cn.sh +++ b/setup_macOS_cn.sh @@ -172,7 +172,7 @@ echo "" echo "配置 PM2 自启动 (使用 launchd)..." startup_cmd=$(pm2 startup launchd | grep 'sudo' | sed 's/^.*\(sudo.*\)$/\1/') if [ -n "$startup_cmd" ]; then - echo "自动执行 PM2 自启动命令..." + echo "自动执行 PM2 自启动命令 请在下方输入密码(非明文)" eval $startup_cmd if [ $? -eq 0 ]; then echo "PM2 自启动配置已自动完成。" From 4612c7d72e23f80a5453bc08f01011daedc2c09a Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 15 May 2025 01:15:58 -0400 Subject: [PATCH 297/463] added function to extract daemon key and http port --- setup.sh | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/setup.sh b/setup.sh index d5e028c..d9adcd8 100644 --- a/setup.sh +++ b/setup.sh @@ -125,6 +125,12 @@ node_arch="" # Hold Node.js intallation path, e.g. ${node_install_dir}/node-${node_version}-linux-${arch} node_path="" +# For installation result +daemon_key="" +web_port="" +daemon_key_config_subpath="data/Config/global.json" +web_port_config_subpath="data/SystemConfig/config.json" + # Terminal color & style related # Default to false, auto check later SUPPORTS_COLOR=false @@ -1082,6 +1088,64 @@ EOF return 0 } +# Extract daemon key and/or http port +extract_component_info() { + # DAEMON SECTION + if [[ "$install_daemon" == true ]]; then + local daemon_service="mcsm-daemon.service" + local daemon_path="${install_dir}/daemon" + local daemon_config_path="${daemon_path}/${daemon_key_config_subpath}" + + cprint cyan bold "Starting daemon service..." + if systemctl start "$daemon_service"; then + cprint green "Daemon service started." + + sleep 1 # Let the service init and config populate + + if [[ -f "$daemon_config_path" ]]; then + daemon_key=$(grep -oP '"key"\s*:\s*"\K[^"]+' "$daemon_config_path") + if [[ -n "$daemon_key" ]]; then + cprint green "Extracted daemon key: $daemon_key" + else + cprint red "Failed to extract daemon key from: $daemon_config_path" + fi + else + cprint red "Daemon config file not found: $daemon_config_path" + fi + else + cprint red bold "Failed to start daemon service: $daemon_service" + fi + fi + + # WEB SECTION + if [[ "$install_web" == true ]]; then + local web_service="mcsm-web.service" + local web_path="${install_dir}/web" + local web_config_path="${web_path}/${web_port_config_subpath}" + + cprint cyan bold "Starting web service..." + if systemctl start "$web_service"; then + cprint green "Web service started." + + sleep 1 + + if [[ -f "$web_config_path" ]]; then + web_port=$(grep -oP '"httpPort"\s*:\s*"\K[^"]+' "$web_config_path") + if [[ -n "$web_port" ]]; then + cprint green "Extracted web port: $web_port" + else + cprint red "Failed to extract web port from: $web_config_path" + fi + else + cprint red "Web config file not found: $web_config_path" + fi + else + cprint red bold "Failed to start web service: $web_service" + fi + fi +} + + install_mcsm() { local components=() From 3a845786f33871c51c5413083d087a3e0863be6c Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 15 May 2025 03:26:12 -0400 Subject: [PATCH 298/463] added support for daemon port --- setup.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index d9adcd8..01cf92a 100644 --- a/setup.sh +++ b/setup.sh @@ -127,6 +127,7 @@ node_path="" # For installation result daemon_key="" +daemon_port="" web_port="" daemon_key_config_subpath="data/Config/global.json" web_port_config_subpath="data/SystemConfig/config.json" @@ -1100,15 +1101,23 @@ extract_component_info() { if systemctl start "$daemon_service"; then cprint green "Daemon service started." - sleep 1 # Let the service init and config populate + sleep 1 # Allow service to init and write configs if [[ -f "$daemon_config_path" ]]; then daemon_key=$(grep -oP '"key"\s*:\s*"\K[^"]+' "$daemon_config_path") + daemon_port=$(grep -oP '"port"\s*:\s*\K[0-9]+' "$daemon_config_path") + if [[ -n "$daemon_key" ]]; then cprint green "Extracted daemon key: $daemon_key" else cprint red "Failed to extract daemon key from: $daemon_config_path" fi + + if [[ -n "$daemon_port" ]]; then + cprint green "Extracted daemon port: $daemon_port" + else + cprint red "Failed to extract daemon port from: $daemon_config_path" + fi else cprint red "Daemon config file not found: $daemon_config_path" fi @@ -1127,7 +1136,7 @@ extract_component_info() { if systemctl start "$web_service"; then cprint green "Web service started." - sleep 1 + sleep 1 # Allow time to populate config if [[ -f "$web_config_path" ]]; then web_port=$(grep -oP '"httpPort"\s*:\s*"\K[^"]+' "$web_config_path") @@ -1145,7 +1154,6 @@ extract_component_info() { fi } - install_mcsm() { local components=() From f659d3272a95b37b44d163aa7b8617b50d809aec Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 15 May 2025 03:52:11 -0400 Subject: [PATCH 299/463] added intallation result --- setup.sh | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 01cf92a..d6767a0 100644 --- a/setup.sh +++ b/setup.sh @@ -1154,6 +1154,100 @@ extract_component_info() { fi } +print_install_result() { + # Clear the screen + clear &>/dev/null || true + + # Print ASCII banner + echo "" + echo " _/ _/ _/_/_/ _/_/_/ _/ _/ " + echo " _/_/ _/_/ _/ _/ _/_/ _/_/ _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/_/ _/ _/_/ " + echo " _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/ _/_/ " + echo " _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ " + echo "_/ _/ _/_/_/ _/_/_/ _/ _/ _/_/_/ _/ _/ _/_/_/ _/_/_/ _/_/_/ _/ " + echo " _/ " + echo " _/_/ " + echo "" + + # status summary + echo "Installed/Updated Components:" + if [[ "$install_daemon" == true && -n "$daemon_key" && -n "$daemon_port" ]]; then + echo "Daemon" + elif [[ "$install_daemon" == true ]]; then + echo "Daemon (partial, config not fully detected)" + fi + + if [[ "$install_web" == true && -n "$web_port" ]]; then + echo "Web Interface" + elif [[ "$install_web" == true ]]; then + echo "Web Interface (partial, config not fully detected)" + fi + + echo "" + + # Local IP detection + local ip_address + ip_address=$(hostname -I 2>/dev/null | awk '{print $1}') + [[ -z "$ip_address" ]] && ip_address="YOUR-IP" + + # Daemon info + if [[ "$install_daemon" == true ]]; then + local daemon_address="ws://$ip_address:${daemon_port:-Failed to Retrieve from Config file}" + local daemon_key_display="${daemon_key:-Failed to Retrieve from Config file}" + + echo "Daemon Address:" + echo " $daemon_address" + echo "Daemon Key:" + echo " $daemon_key_display" + echo "" + fi + + # Web info + if [[ "$install_web" == true ]]; then + local web_address="http://$ip_address:${web_port:-Failed to Retrieve from Config file}" + echo "HTTP Web Interface:" + echo " $web_address (open in browser)" + echo "" + fi + + # Port guidance + echo "NOTE:" + echo " Make sure to expose the above ports through your firewall." + echo " If accessing from outside your network, you may need to configure port forwarding on your router." + echo "" + + # Service management help + echo "Service Management Commands:" + if [[ "$install_daemon" == true ]]; then + echo " systemctl start mcsm-daemon.service" + echo " systemctl stop mcsm-daemon.service" + echo " systemctl restart mcsm-daemon.service" + echo " systemctl status mcsm-daemon.service" + fi + if [[ "$install_web" == true ]]; then + echo " systemctl start mcsm-web.service" + echo " systemctl stop mcsm-web.service" + echo " systemctl restart mcsm-web.service" + echo " systemctl status mcsm-web.service" + fi + echo "" + + # Official doc + echo "Official Documentation:" + echo " https://docs.mcsmanager.com/" + echo "" + + # HTTPS support + echo "Need HTTPS?" + echo " To enable secure HTTPS access, configure a reverse proxy:" + echo " https://docs.mcsmanager.com/ops/proxy_https.html" + echo "" + + # Closing message + echo "Installation completed. Enjoy managing your servers with MCSManager!" + echo "" +} + install_mcsm() { local components=() @@ -1187,6 +1281,10 @@ install_mcsm() { fi done fi + + # Extract installed component info + safe_run extract_component_info "Failed to extract runtime info from installed services" + safe_rul print_install_result "Failed to print installation result" } main() { @@ -1211,6 +1309,6 @@ main() { safe_run download_mcsm "Failed to acquire MCSManager source" safe_run mcsm_install_prepare "Error while preparing for installation" - + safe_run install_mcsm "Failed to install MCSManager" } main "$@" \ No newline at end of file From bb92ae41a2a8e8aaa15f55bfc2849e9074888705 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 15 May 2025 03:54:41 -0400 Subject: [PATCH 300/463] added function to clear tmp dir --- setup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup.sh b/setup.sh index d6767a0..b2506d6 100644 --- a/setup.sh +++ b/setup.sh @@ -1282,9 +1282,17 @@ install_mcsm() { done fi + # Clear temp dir + if rm -rf "$install_tmp_dir"; then + cprint green "Cleaned up temporary install folder: $install_tmp_dir" + else + cprint red "Failed to remove temporary folder: $install_tmp_dir" + fi + # Extract installed component info safe_run extract_component_info "Failed to extract runtime info from installed services" safe_rul print_install_result "Failed to print installation result" + } main() { From 387bad9f1973a66102becee75aac4aaf77c054ae Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 15 May 2025 03:56:04 -0400 Subject: [PATCH 301/463] updated ascii banner --- setup.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/setup.sh b/setup.sh index b2506d6..a1d236e 100644 --- a/setup.sh +++ b/setup.sh @@ -1159,16 +1159,12 @@ print_install_result() { clear &>/dev/null || true # Print ASCII banner - echo "" - echo " _/ _/ _/_/_/ _/_/_/ _/ _/ " - echo " _/_/ _/_/ _/ _/ _/_/ _/_/ _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/_/ _/ _/_/ " - echo " _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/ _/_/ " - echo " _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ " - echo "_/ _/ _/_/_/ _/_/_/ _/ _/ _/_/_/ _/ _/ _/_/_/ _/_/_/ _/_/_/ _/ " - echo " _/ " - echo " _/_/ " - echo "" - + echo "______ _______________________ ___" + echo "___ |/ /_ ____/_ ___/__ |/ /_____ _____________ _______ _____________" + echo "__ /|_/ /_ / _____ \__ /|_/ /_ __ \`/_ __ \ __ \`/_ __ \`/ _ \_ ___/" + echo "_ / / / / /___ ____/ /_ / / / / /_/ /_ / / / /_/ /_ /_/ // __/ /" + echo "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" + echo " # status summary echo "Installed/Updated Components:" if [[ "$install_daemon" == true && -n "$daemon_key" && -n "$daemon_port" ]]; then From 5fc4f823016f5eb9a6a9baf6e03d0e40cff4caaa Mon Sep 17 00:00:00 2001 From: shane0411 Date: Sun, 18 May 2025 11:28:48 +0800 Subject: [PATCH 302/463] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BB=A5=E5=8F=8A=E7=B4=94=E7=AF=80=E9=BB=9E=E5=AE=89?= =?UTF-8?q?=E8=A3=9D=E8=85=B3=E6=9C=AC=EF=BC=8C=E5=B0=87setup=E8=85=B3?= =?UTF-8?q?=E6=9C=AC=E4=B8=AD=E7=8D=B2=E5=8F=96=E7=89=88=E6=9C=AC=E6=94=B9?= =?UTF-8?q?=E7=82=BA=E8=87=AA=E5=8B=95=E7=8D=B2=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + daemon/setup.sh | 220 ++++++++++++++++++++++++++++++++ daemon/setup_cn.sh | 219 +++++++++++++++++++++++++++++++ setup.sh | 4 +- setup_cn.sh | 4 +- update/setup.sh | 311 +++++++++++++++++++++++++++++++++++++++++++++ update/setup_cn.sh | 308 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 1064 insertions(+), 4 deletions(-) create mode 100644 daemon/setup.sh create mode 100644 daemon/setup_cn.sh create mode 100644 update/setup.sh create mode 100644 update/setup_cn.sh diff --git a/.gitignore b/.gitignore index 6741c00..5b443b9 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ bin-release/ # Remove old cli sh cli_old.sh + +.idea diff --git a/daemon/setup.sh b/daemon/setup.sh new file mode 100644 index 0000000..aa1a6c2 --- /dev/null +++ b/daemon/setup.sh @@ -0,0 +1,220 @@ +#!/bin/bash +# Official installation script. + +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_download_addr=$(curl -s https://api.github.com/repos/MCSManager/MCSManager/releases/latest | grep -o 'https://.*linux.*\.tar\.gz') +package_name="mcsmanager_linux_release.tar.gz" +node="v20.12.2" +arch=$(uname -m) + +if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run as root. Please use \"sudo bash\" instead." + exit 1 +fi + +printf "\033c" + +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +# script info +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +" + +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + +Install_Node() { + echo_cyan_n "[+] Install Node.JS environment...\n" + + rm -irf "$node_install_path" + + cd /opt || Red_Error "[x] Failed to enter /opt" + + rm -rf "node-$node-linux-$arch.tar.gz" + + wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + + tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" + + rm -rf "node-$node-linux-$arch.tar.gz" + + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Success" + else + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node.JS Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node.JS Version ===============" + echo + + sleep 3 +} + +Install_MCSManager() { + echo_cyan "[+] Install MCSManager..." + + # stop service + systemctl disable --now mcsm-{web,daemon} + + # delete service + rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + systemctl daemon-reload + + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" + + # cd /opt/mcsmanager + cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" + + # download MCSManager release + wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" + tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" + rm -rf "${mcsmanager_install_path}/${package_name}" + + # compatible with tar.gz packages of different formats + if [ -d "/opt/mcsmanager/mcsmanager" ]; then + cp -rf /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ + rm -rf /opt/mcsmanager/mcsmanager + fi + + rm -rf "${mcsmanager_install_path}/web" + + # echo "[→] cd daemon" + cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" + + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" + + echo + echo_yellow "=============== MCSManager ===============" + echo_green "Daemon: ${mcsmanager_install_path}/daemon" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" + + chmod -R 755 "$mcsmanager_install_path" + + sleep 3 +} + +Create_Service() { + echo_cyan "[+] Create MCSManager service..." + + echo "[Unit] +Description=MCSManager-Daemon + +[Service] +WorkingDirectory=${mcsmanager_install_path}/daemon +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" >/etc/systemd/system/mcsm-daemon.service + + systemctl daemon-reload + systemctl enable --now mcsm-daemon.service + echo_green "Registered!" + + sleep 2 + + printf "\n\n\n\n" + + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_yellow " " + echo_cyan_n "Daemon Address: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose ports " + echo_yellow "24444" + echo_red " to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-daemon.service" + echo_cyan "systemctl stop mcsm-daemon.service" + echo_cyan "systemctl restart mcsm-daemon.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" +} + +# Environmental inspection +if [[ "$arch" == x86_64 ]]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [[ $arch == aarch64 ]]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [[ $arch == arm ]]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [[ $arch == ppc64le ]]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [[ $arch == s390x ]]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" +fi + +# Define the variable Node installation directory +node_install_path="/opt/node-$node-linux-$arch" + +# Check network connection +echo_cyan "[-] Architecture: $arch" + +# Install related software +echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " +if [[ -x "$(command -v yum)" ]]; then + yum install -y git tar wget +elif [[ -x "$(command -v apt-get)" ]]; then + apt-get install -y git tar wget +elif [[ -x "$(command -v pacman)" ]]; then + pacman -S --noconfirm --needed git tar wget +elif [[ -x "$(command -v zypper)" ]]; then + zypper --non-interactive install git tar wget +else + echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" +fi + +# Determine whether the relevant software is installed successfully +if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then + echo_green "Success" +else + Red_Error "[x] Failed to find git, tar and wget, please install them manually!" +fi + +# Install the Node environment +Install_Node + +# Install MCSManager +Install_MCSManager + +# Create MCSManager background service +Create_Service diff --git a/daemon/setup_cn.sh b/daemon/setup_cn.sh new file mode 100644 index 0000000..8726b5c --- /dev/null +++ b/daemon/setup_cn.sh @@ -0,0 +1,219 @@ +#!/bin/bash +# This script file is specifically designed for the Chinese region, and servers in the Chinese region are used to accelerate file downloads. + +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_download_addr="https://cdn.imlazy.ink:233/files/mcsmanager_linux_release.tar.gz" +package_name="mcsmanager_linux_release.tar.gz" +node="v20.12.2" +arch=$(uname -m) + +if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run as root. Please use \"sudo bash\" instead." + exit 1 +fi + +printf "\033c" + +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +# script info +echo_cyan "+---------------------------------------------------------------------- +| MCSManager 安装脚本 (MCSManager Installer) ++---------------------------------------------------------------------- +" + +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + +Install_Node() { + echo_cyan_n "[+] Install Node.JS environment...\n" + + rm -irf "$node_install_path" + + cd /opt || Red_Error "[x] Failed to enter /opt" + + rm -rf "node-$node-linux-$arch.tar.gz" + + # wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + wget "https://registry.npmmirror.com/-/binary/node/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + + tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" + + rm -rf "node-$node-linux-$arch.tar.gz" + + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Success" + else + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node.JS Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node.JS Version ===============" + echo + + sleep 3 +} + +Install_MCSManager() { + echo_cyan "[+] Install MCSManager..." + + # stop service + systemctl disable --now mcsm-{web,daemon} + + # delete service + rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + systemctl daemon-reload + + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" + + # cd /opt/mcsmanager + cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" + + # download MCSManager release + wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" + tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" + rm -rf "${mcsmanager_install_path}/${package_name}" + + # compatible with tar.gz packages of different formats + if [ -d "/opt/mcsmanager/mcsmanager" ]; then + cp -rf /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ + rm -rf /opt/mcsmanager/mcsmanager + fi + + rm -rf "${mcsmanager_install_path}/web" + + # echo "[→] cd daemon" + cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" + + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" + + echo + echo_yellow "=============== MCSManager ===============" + echo_green "Daemon: ${mcsmanager_install_path}/daemon" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" + + chmod -R 755 "$mcsmanager_install_path" + + sleep 3 +} + +Create_Service() { + echo_cyan "[+] Create MCSManager service..." + + echo "[Unit] +Description=MCSManager-Daemon + +[Service] +WorkingDirectory=${mcsmanager_install_path}/daemon +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" >/etc/systemd/system/mcsm-daemon.service + + systemctl daemon-reload + systemctl enable --now mcsm-daemon.service + echo_green "Registered!" + + sleep 2 + + printf "\n\n\n\n" + + echo_yellow "==================================================================" + echo_green "安装完成,欢迎使用 MCSManager !" + echo_yellow " " + echo_cyan_n "被控守护进程地址: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "默认情况下,你必须开放 24444 端口才能确保面板工作正常!" + echo_yellow " " + echo_cyan "面板开关指令:" + echo_cyan "systemctl start mcsm-daemon.service" + echo_cyan "systemctl stop mcsm-daemon.service" + echo_cyan "systemctl restart mcsm-daemon.service" + echo_yellow " " + echo_green "官方文档: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" +} + +# Environmental inspection +if [[ "$arch" == x86_64 ]]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [[ $arch == aarch64 ]]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [[ $arch == arm ]]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [[ $arch == ppc64le ]]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [[ $arch == s390x ]]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" +fi + +# Define the variable Node installation directory +node_install_path="/opt/node-$node-linux-$arch" + +# Check network connection +echo_cyan "[-] Architecture: $arch" + +# Install related software +echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " +if [[ -x "$(command -v yum)" ]]; then + yum install -y git tar wget +elif [[ -x "$(command -v apt-get)" ]]; then + apt-get install -y git tar wget +elif [[ -x "$(command -v pacman)" ]]; then + pacman -S --noconfirm --needed git tar wget +elif [[ -x "$(command -v zypper)" ]]; then + zypper --non-interactive install git tar wget +else + echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" +fi + +# Determine whether the relevant software is installed successfully +if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then + echo_green "Success" +else + Red_Error "[x] Failed to find git, tar and wget, please install them manually!" +fi + +# Install the Node environment +Install_Node + +# Install MCSManager +Install_MCSManager + +# Create MCSManager background service +Create_Service diff --git a/setup.sh b/setup.sh index f7abe1f..c2af0eb 100644 --- a/setup.sh +++ b/setup.sh @@ -2,12 +2,12 @@ # Official installation script. mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" +mcsmanager_download_addr=$(curl -s https://api.github.com/repos/MCSManager/MCSManager/releases/latest | grep -o 'https://.*linux.*\.tar\.gz') package_name="mcsmanager_linux_release.tar.gz" node="v20.12.2" arch=$(uname -m) -if [ "$(id -u)" -ne 0]; then +if [ "$(id -u)" -ne 0 ]; then echo "This script must be run as root. Please use \"sudo bash\" instead." exit 1 fi diff --git a/setup_cn.sh b/setup_cn.sh index d9a7083..2566d51 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -4,10 +4,10 @@ mcsmanager_install_path="/opt/mcsmanager" mcsmanager_download_addr="https://cdn.imlazy.ink:233/files/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" -node="v16.20.2" +node="v20.12.2" arch=$(uname -m) -if [ "$(id -u)" -ne 0]; then +if [ "$(id -u)" -ne 0 ]; then echo "This script must be run as root. Please use \"sudo bash\" instead." exit 1 fi diff --git a/update/setup.sh b/update/setup.sh new file mode 100644 index 0000000..bc3c57c --- /dev/null +++ b/update/setup.sh @@ -0,0 +1,311 @@ +#!/bin/bash +# Official installation script. + +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_download_addr=$(curl -s https://api.github.com/repos/MCSManager/MCSManager/releases/latest | grep -o 'https://.*linux.*\.tar\.gz') +package_name="mcsmanager_linux_release.tar.gz" +node="v20.12.2" +arch=$(uname -m) + +if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run as root. Please use \"sudo bash\" instead." + exit 1 +fi + +printf "\033c" + +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +# script info +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Update ++---------------------------------------------------------------------- +" + +web_install=true +if [[ -d "${mcsmanager_install_path}" ]] && [[ ! -d "${mcsmanager_install_path}/web" ]]; then + web_install=false +fi + +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + +Update_Node() { + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Node.js version is up-to-date, skipping installation." + return + else + echo_red "Node not find, start to install node.js" + fi + + echo_cyan_n "[+] Install Node.JS environment...\n" + + rm -irf "$node_install_path" + + cd /opt || Red_Error "[x] Failed to enter /opt" + + rm -rf "node-$node-linux-$arch.tar.gz" + + wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + + tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" + + rm -rf "node-$node-linux-$arch.tar.gz" + + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Success" + else + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node.JS Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node.JS Version ===============" + echo + + sleep 3 +} + +Update_MCSManager() { + echo_cyan "[+] Update MCSManager..." + + if [ "$web_install" = false ]; then + echo_yellow "[-] will not update web... (The web folder was not found)" + fi + + # stop service + systemctl disable --now mcsm-{web,daemon} + + # delete service + rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + systemctl daemon-reload + + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" + + # cd /opt/mcsmanager + cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" + + # backup data + if [ -d "${mcsmanager_install_path}/daemon/data" ]; then + mkdir -p "$mcsmanager_install_path/temp/daemon" + cp -rf $mcsmanager_install_path/daemon/data/* $mcsmanager_install_path/temp/daemon + fi + + if [ -d "${mcsmanager_install_path}/web/data" ]; then + mkdir -p "$mcsmanager_install_path/temp/web" + cp -rf $mcsmanager_install_path/web/data/* $mcsmanager_install_path/temp/web + fi + + # download MCSManager release + wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" + tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" + rm -rf "${mcsmanager_install_path}/${package_name}" + + # compatible with tar.gz packages of different formats + if [ -d "$mcsmanager_install_path/mcsmanager" ]; then + cp -rf $mcsmanager_install_path/mcsmanager/* $mcsmanager_install_path/ + rm -rf $mcsmanager_install_path/mcsmanager + fi + + if [ -d "${mcsmanager_install_path}/temp/daemon" ]; then + cp -rf $mcsmanager_install_path/temp/daemon/* $mcsmanager_install_path/daemon/data + rm -rf $mcsmanager_install_path/temp/daemon + fi + + if [ -d "${mcsmanager_install_path}/temp/web" ]; then + cp -rf $mcsmanager_install_path/temp/web/* $mcsmanager_install_path/web/data + rm -rf $mcsmanager_install_path/temp/web + fi + + if [ -d "${mcsmanager_install_path}/temp" ]; then + rm -rf $mcsmanager_install_path/temp + fi + + # echo "[→] cd daemon" + cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" + + echo_cyan "[+] Update MCSManager-Daemon dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" + + if [ "$web_install" = true ]; then + # echo "[←] cd .." + cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" + + echo_cyan "[+] Update MCSManager-Web dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" + else + rm -rf "${mcsmanager_install_path}/web" + fi + + echo + echo_yellow "=============== MCSManager ===============" + echo_green "Daemon: ${mcsmanager_install_path}/daemon" + if [ "$web_install" = true ]; then + echo_green "Web: ${mcsmanager_install_path}/web" + fi + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" + + chmod -R 755 "$mcsmanager_install_path" + + sleep 3 +} + +Create_Service() { + echo_cyan "[+] Create MCSManager service..." + + echo "[Unit] +Description=MCSManager-Daemon + +[Service] +WorkingDirectory=${mcsmanager_install_path}/daemon +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" >/etc/systemd/system/mcsm-daemon.service + + if [ "$web_install" = true ]; then + echo "[Unit] +Description=MCSManager-Web + +[Service] +WorkingDirectory=${mcsmanager_install_path}/web +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" >/etc/systemd/system/mcsm-web.service + fi + + systemctl daemon-reload + if [ "$web_install" = true ]; then + systemctl enable --now mcsm-{daemon,web}.service + else + systemctl enable --now mcsm-daemon.service + fi + echo_green "Registered!" + + sleep 2 + + printf "\n\n\n\n" + + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_yellow " " + if [ "$web_install" = true ]; then + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" + fi + + echo_cyan_n "Daemon Address: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose ports " + + if [ "$web_install" = true ]; then + echo_yellow "23333" + echo_red " and " + fi + + echo_yellow "24444" + echo_red " to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + + if [ "$web_install" = true ]; then + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + else + echo_cyan "systemctl start mcsm-daemon.service" + echo_cyan "systemctl stop mcsm-daemon.service" + echo_cyan "systemctl restart mcsm-daemon.service" + fi + + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" +} + +# Environmental inspection +if [[ "$arch" == x86_64 ]]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [[ $arch == aarch64 ]]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [[ $arch == arm ]]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [[ $arch == ppc64le ]]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [[ $arch == s390x ]]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" +fi + +# Define the variable Node installation directory +node_install_path="/opt/node-$node-linux-$arch" + +# Check network connection +echo_cyan "[-] Architecture: $arch" + +# Install related software +echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " +if [[ -x "$(command -v yum)" ]]; then + yum install -y git tar wget +elif [[ -x "$(command -v apt-get)" ]]; then + apt-get install -y git tar wget +elif [[ -x "$(command -v pacman)" ]]; then + pacman -S --noconfirm --needed git tar wget +elif [[ -x "$(command -v zypper)" ]]; then + zypper --non-interactive install git tar wget +else + echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" +fi + +# Determine whether the relevant software is installed successfully +if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then + echo_green "Success" +else + Red_Error "[x] Failed to find git, tar and wget, please install them manually!" +fi + +# Install the Node environment +Update_Node + +# Install MCSManager +Update_MCSManager + +# Create MCSManager background service +Create_Service diff --git a/update/setup_cn.sh b/update/setup_cn.sh new file mode 100644 index 0000000..c7d1a6c --- /dev/null +++ b/update/setup_cn.sh @@ -0,0 +1,308 @@ +#!/bin/bash +# This script file is specifically designed for the Chinese region, and servers in the Chinese region are used to accelerate file downloads. + +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_download_addr="https://cdn.imlazy.ink:233/files/mcsmanager_linux_release.tar.gz" +package_name="mcsmanager_linux_release.tar.gz" +node="v20.12.2" +arch=$(uname -m) + +if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run as root. Please use \"sudo bash\" instead." + exit 1 +fi + +printf "\033c" + +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" +} +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" +} +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" +} +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" +} +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" +} + +# script info +echo_cyan "+---------------------------------------------------------------------- +| MCSManager 更新脚本 (MCSManager Update) ++---------------------------------------------------------------------- +" + +web_install=true +if [[ -d "${mcsmanager_install_path}" ]] && [[ ! -d "${mcsmanager_install_path}/web" ]]; then + web_install=false +fi + +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 +} + +Update_Node() { + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Node.js version is up-to-date, skipping installation." + return + else + echo_red "Node not find, start to install node.js" + fi + + echo_cyan_n "[+] Install Node.JS environment...\n" + + rm -irf "$node_install_path" + + cd /opt || Red_Error "[x] Failed to enter /opt" + + rm -rf "node-$node-linux-$arch.tar.gz" + +# wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + wget "https://registry.npmmirror.com/-/binary/node/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + + tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" + + rm -rf "node-$node-linux-$arch.tar.gz" + + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Success" + else + Red_Error "[x] Node installation failed!" + fi + + echo + echo_yellow "=============== Node.JS Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node.JS Version ===============" + echo + + sleep 3 +} + +Update_MCSManager() { + echo_cyan "[+] Update MCSManager..." + + if [ "$web_install" = false ]; then + echo_yellow "[-] will not update web... (The web folder was not found)" + fi + + # stop service + systemctl disable --now mcsm-{web,daemon} + + # delete service + rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + systemctl daemon-reload + + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" + + # cd /opt/mcsmanager + cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" + + # backup data + if [ -d "${mcsmanager_install_path}/daemon/data" ]; then + mkdir -p "$mcsmanager_install_path/temp/daemon" + cp -rf $mcsmanager_install_path/daemon/data/* $mcsmanager_install_path/temp/daemon + fi + + if [ -d "${mcsmanager_install_path}/web/data" ]; then + mkdir -p "$mcsmanager_install_path/temp/web" + cp -rf $mcsmanager_install_path/web/data/* $mcsmanager_install_path/temp/web + fi + + # download MCSManager release + wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" + tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" + rm -rf "${mcsmanager_install_path}/${package_name}" + + # compatible with tar.gz packages of different formats + if [ -d "$mcsmanager_install_path/mcsmanager" ]; then + cp -rf $mcsmanager_install_path/mcsmanager/* $mcsmanager_install_path/ + rm -rf $mcsmanager_install_path/mcsmanager + fi + + if [ -d "${mcsmanager_install_path}/temp/daemon" ]; then + cp -rf $mcsmanager_install_path/temp/daemon/* $mcsmanager_install_path/daemon/data + rm -rf $mcsmanager_install_path/temp/daemon + fi + + if [ -d "${mcsmanager_install_path}/temp/web" ]; then + cp -rf $mcsmanager_install_path/temp/web/* $mcsmanager_install_path/web/data + rm -rf $mcsmanager_install_path/temp/web + fi + + if [ -d "${mcsmanager_install_path}/temp" ]; then + rm -rf $mcsmanager_install_path/temp + fi + + # echo "[→] cd daemon" + cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" + + echo_cyan "[+] Update MCSManager-Daemon dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" + + if [ "$web_install" = true ]; then + # echo "[←] cd .." + cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" + + echo_cyan "[+] Update MCSManager-Web dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" + else + rm -rf "${mcsmanager_install_path}/web" + fi + + echo + echo_yellow "=============== MCSManager ===============" + echo_green "Daemon: ${mcsmanager_install_path}/daemon" + if [ "$web_install" = true ]; then + echo_green "Web: ${mcsmanager_install_path}/web" + fi + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" + + chmod -R 755 "$mcsmanager_install_path" + + sleep 3 +} + +Create_Service() { + echo_cyan "[+] Create MCSManager service..." + + echo "[Unit] +Description=MCSManager-Daemon + +[Service] +WorkingDirectory=${mcsmanager_install_path}/daemon +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" >/etc/systemd/system/mcsm-daemon.service + + if [ "$web_install" = true ]; then + echo "[Unit] +Description=MCSManager-Web + +[Service] +WorkingDirectory=${mcsmanager_install_path}/web +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID +Environment=\"PATH=${PATH}\" + +[Install] +WantedBy=multi-user.target +" >/etc/systemd/system/mcsm-web.service + fi + + systemctl daemon-reload + if [ "$web_install" = true ]; then + systemctl enable --now mcsm-{daemon,web}.service + else + systemctl enable --now mcsm-daemon.service + fi + echo_green "Registered!" + + sleep 2 + + printf "\n\n\n\n" + + echo_yellow "==================================================================" + echo_green "更新完成,欢迎使用 MCSManager !" + echo_yellow " " + if [ "$web_install" = true ]; then + echo_cyan_n "主控网页访问地址: " + echo_yellow "http://:23333 (Browser)" + fi + + echo_cyan_n "被控守护进程地址: " + echo_yellow "ws://:24444 (Cluster)" + + if [ "$web_install" = true ]; then + echo_red "默认情况下,你必须开放\033[1;33m 23333 和 24444 \033[1;31m端口才能确保面板工作正常!" + else + echo_red "默认情况下,你必须开放\033[1;33m 24444 \033[1;31m端口才能确保面板工作正常!" + fi + + echo_yellow " " + echo_cyan "面板开关指令:" + if [ "$web_install" = true ]; then + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + else + echo_cyan "systemctl start mcsm-daemon.service" + echo_cyan "systemctl stop mcsm-daemon.service" + echo_cyan "systemctl restart mcsm-daemon.service" + fi + echo_yellow " " + echo_green "官方文档: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" +} + +# Environmental inspection +if [[ "$arch" == x86_64 ]]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [[ $arch == aarch64 ]]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [[ $arch == arm ]]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [[ $arch == ppc64le ]]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [[ $arch == s390x ]]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" +fi + +# Define the variable Node installation directory +node_install_path="/opt/node-$node-linux-$arch" + +# Check network connection +echo_cyan "[-] Architecture: $arch" + +# Install related software +echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " +if [[ -x "$(command -v yum)" ]]; then + yum install -y git tar wget +elif [[ -x "$(command -v apt-get)" ]]; then + apt-get install -y git tar wget +elif [[ -x "$(command -v pacman)" ]]; then + pacman -S --noconfirm --needed git tar wget +elif [[ -x "$(command -v zypper)" ]]; then + zypper --non-interactive install git tar wget +else + echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" +fi + +# Determine whether the relevant software is installed successfully +if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then + echo_green "Success" +else + Red_Error "[x] Failed to find git, tar and wget, please install them manually!" +fi + +# Install the Node environment +Update_Node + +# Install MCSManager +Update_MCSManager + +# Create MCSManager background service +Create_Service From d0646922f47c4631a644277b8e141c03866e40bf Mon Sep 17 00:00:00 2001 From: shane0411 Date: Sun, 18 May 2025 17:12:02 +0800 Subject: [PATCH 303/463] =?UTF-8?q?feat:=20=E5=B0=87=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=85=B3=E6=9C=AC=E8=88=87=E5=AE=89=E8=A3=9D=E8=85=B3=E6=9C=AC?= =?UTF-8?q?=E5=90=88=E4=BD=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.sh | 116 +++++++++++++---- setup_cn.sh | 118 +++++++++++++---- update/setup.sh | 311 --------------------------------------------- update/setup_cn.sh | 308 -------------------------------------------- 4 files changed, 185 insertions(+), 668 deletions(-) delete mode 100644 update/setup.sh delete mode 100644 update/setup_cn.sh diff --git a/setup.sh b/setup.sh index c2af0eb..bc3c57c 100644 --- a/setup.sh +++ b/setup.sh @@ -32,10 +32,15 @@ echo_yellow() { # script info echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer +| MCSManager Update +---------------------------------------------------------------------- " +web_install=true +if [[ -d "${mcsmanager_install_path}" ]] && [[ ! -d "${mcsmanager_install_path}/web" ]]; then + web_install=false +fi + Red_Error() { echo '=================================================' printf '\033[1;31;40m%b\033[0m\n' "$@" @@ -43,7 +48,14 @@ Red_Error() { exit 1 } -Install_Node() { +Update_Node() { + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Node.js version is up-to-date, skipping installation." + return + else + echo_red "Node not find, start to install node.js" + fi + echo_cyan_n "[+] Install Node.JS environment...\n" rm -irf "$node_install_path" @@ -74,8 +86,12 @@ Install_Node() { sleep 3 } -Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." +Update_MCSManager() { + echo_cyan "[+] Update MCSManager..." + + if [ "$web_install" = false ]; then + echo_yellow "[-] will not update web... (The web folder was not found)" + fi # stop service systemctl disable --now mcsm-{web,daemon} @@ -89,33 +105,64 @@ Install_MCSManager() { # cd /opt/mcsmanager cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" + # backup data + if [ -d "${mcsmanager_install_path}/daemon/data" ]; then + mkdir -p "$mcsmanager_install_path/temp/daemon" + cp -rf $mcsmanager_install_path/daemon/data/* $mcsmanager_install_path/temp/daemon + fi + + if [ -d "${mcsmanager_install_path}/web/data" ]; then + mkdir -p "$mcsmanager_install_path/temp/web" + cp -rf $mcsmanager_install_path/web/data/* $mcsmanager_install_path/temp/web + fi + # download MCSManager release wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" # compatible with tar.gz packages of different formats - if [ -d "/opt/mcsmanager/mcsmanager" ]; then - cp -rf /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ - rm -rf /opt/mcsmanager/mcsmanager + if [ -d "$mcsmanager_install_path/mcsmanager" ]; then + cp -rf $mcsmanager_install_path/mcsmanager/* $mcsmanager_install_path/ + rm -rf $mcsmanager_install_path/mcsmanager + fi + + if [ -d "${mcsmanager_install_path}/temp/daemon" ]; then + cp -rf $mcsmanager_install_path/temp/daemon/* $mcsmanager_install_path/daemon/data + rm -rf $mcsmanager_install_path/temp/daemon + fi + + if [ -d "${mcsmanager_install_path}/temp/web" ]; then + cp -rf $mcsmanager_install_path/temp/web/* $mcsmanager_install_path/web/data + rm -rf $mcsmanager_install_path/temp/web + fi + + if [ -d "${mcsmanager_install_path}/temp" ]; then + rm -rf $mcsmanager_install_path/temp fi # echo "[→] cd daemon" cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" - echo_cyan "[+] Install MCSManager-Daemon dependencies..." + echo_cyan "[+] Update MCSManager-Daemon dependencies..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" - # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" + if [ "$web_install" = true ]; then + # echo "[←] cd .." + cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - echo_cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" + echo_cyan "[+] Update MCSManager-Web dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" + else + rm -rf "${mcsmanager_install_path}/web" + fi echo echo_yellow "=============== MCSManager ===============" echo_green "Daemon: ${mcsmanager_install_path}/daemon" - echo_green "Web: ${mcsmanager_install_path}/web" + if [ "$web_install" = true ]; then + echo_green "Web: ${mcsmanager_install_path}/web" + fi echo_yellow "=============== MCSManager ===============" echo echo_green "[+] MCSManager installation success!" @@ -142,7 +189,8 @@ Environment=\"PATH=${PATH}\" WantedBy=multi-user.target " >/etc/systemd/system/mcsm-daemon.service - echo "[Unit] + if [ "$web_install" = true ]; then + echo "[Unit] Description=MCSManager-Web [Service] @@ -155,9 +203,14 @@ Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target " >/etc/systemd/system/mcsm-web.service + fi systemctl daemon-reload - systemctl enable --now mcsm-{daemon,web}.service + if [ "$web_install" = true ]; then + systemctl enable --now mcsm-{daemon,web}.service + else + systemctl enable --now mcsm-daemon.service + fi echo_green "Registered!" sleep 2 @@ -167,20 +220,35 @@ WantedBy=multi-user.target echo_yellow "==================================================================" echo_green "Installation is complete! Welcome to the MCSManager!!!" echo_yellow " " - echo_cyan_n "HTTP Web Service: " - echo_yellow "http://:23333 (Browser)" + if [ "$web_install" = true ]; then + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" + fi + echo_cyan_n "Daemon Address: " echo_yellow "ws://:24444 (Cluster)" echo_red "You must expose ports " - echo_yellow "23333" - echo_red " and " + + if [ "$web_install" = true ]; then + echo_yellow "23333" + echo_red " and " + fi + echo_yellow "24444" echo_red " to use the service properly on the Internet." echo_yellow " " echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" + + if [ "$web_install" = true ]; then + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + else + echo_cyan "systemctl start mcsm-daemon.service" + echo_cyan "systemctl stop mcsm-daemon.service" + echo_cyan "systemctl restart mcsm-daemon.service" + fi + echo_yellow " " echo_green "Official Document: https://docs.mcsmanager.com/" echo_yellow "==================================================================" @@ -234,10 +302,10 @@ else fi # Install the Node environment -Install_Node +Update_Node # Install MCSManager -Install_MCSManager +Update_MCSManager # Create MCSManager background service Create_Service diff --git a/setup_cn.sh b/setup_cn.sh index 2566d51..c7d1a6c 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -32,10 +32,15 @@ echo_yellow() { # script info echo_cyan "+---------------------------------------------------------------------- -| MCSManager 安装脚本 (MCSManager Installer) +| MCSManager 更新脚本 (MCSManager Update) +---------------------------------------------------------------------- " +web_install=true +if [[ -d "${mcsmanager_install_path}" ]] && [[ ! -d "${mcsmanager_install_path}/web" ]]; then + web_install=false +fi + Red_Error() { echo '=================================================' printf '\033[1;31;40m%b\033[0m\n' "$@" @@ -43,7 +48,14 @@ Red_Error() { exit 1 } -Install_Node() { +Update_Node() { + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Node.js version is up-to-date, skipping installation." + return + else + echo_red "Node not find, start to install node.js" + fi + echo_cyan_n "[+] Install Node.JS environment...\n" rm -irf "$node_install_path" @@ -52,7 +64,7 @@ Install_Node() { rm -rf "node-$node-linux-$arch.tar.gz" - # wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" +# wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" wget "https://registry.npmmirror.com/-/binary/node/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" @@ -75,8 +87,12 @@ Install_Node() { sleep 3 } -Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." +Update_MCSManager() { + echo_cyan "[+] Update MCSManager..." + + if [ "$web_install" = false ]; then + echo_yellow "[-] will not update web... (The web folder was not found)" + fi # stop service systemctl disable --now mcsm-{web,daemon} @@ -90,33 +106,64 @@ Install_MCSManager() { # cd /opt/mcsmanager cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" + # backup data + if [ -d "${mcsmanager_install_path}/daemon/data" ]; then + mkdir -p "$mcsmanager_install_path/temp/daemon" + cp -rf $mcsmanager_install_path/daemon/data/* $mcsmanager_install_path/temp/daemon + fi + + if [ -d "${mcsmanager_install_path}/web/data" ]; then + mkdir -p "$mcsmanager_install_path/temp/web" + cp -rf $mcsmanager_install_path/web/data/* $mcsmanager_install_path/temp/web + fi + # download MCSManager release wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" # compatible with tar.gz packages of different formats - if [ -d "/opt/mcsmanager/mcsmanager" ]; then - cp -rf /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ - rm -rf /opt/mcsmanager/mcsmanager + if [ -d "$mcsmanager_install_path/mcsmanager" ]; then + cp -rf $mcsmanager_install_path/mcsmanager/* $mcsmanager_install_path/ + rm -rf $mcsmanager_install_path/mcsmanager + fi + + if [ -d "${mcsmanager_install_path}/temp/daemon" ]; then + cp -rf $mcsmanager_install_path/temp/daemon/* $mcsmanager_install_path/daemon/data + rm -rf $mcsmanager_install_path/temp/daemon + fi + + if [ -d "${mcsmanager_install_path}/temp/web" ]; then + cp -rf $mcsmanager_install_path/temp/web/* $mcsmanager_install_path/web/data + rm -rf $mcsmanager_install_path/temp/web + fi + + if [ -d "${mcsmanager_install_path}/temp" ]; then + rm -rf $mcsmanager_install_path/temp fi # echo "[→] cd daemon" cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" - echo_cyan "[+] Install MCSManager-Daemon dependencies..." + echo_cyan "[+] Update MCSManager-Daemon dependencies..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" - # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" + if [ "$web_install" = true ]; then + # echo "[←] cd .." + cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - echo_cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" + echo_cyan "[+] Update MCSManager-Web dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" + else + rm -rf "${mcsmanager_install_path}/web" + fi echo echo_yellow "=============== MCSManager ===============" echo_green "Daemon: ${mcsmanager_install_path}/daemon" - echo_green "Web: ${mcsmanager_install_path}/web" + if [ "$web_install" = true ]; then + echo_green "Web: ${mcsmanager_install_path}/web" + fi echo_yellow "=============== MCSManager ===============" echo echo_green "[+] MCSManager installation success!" @@ -143,7 +190,8 @@ Environment=\"PATH=${PATH}\" WantedBy=multi-user.target " >/etc/systemd/system/mcsm-daemon.service - echo "[Unit] + if [ "$web_install" = true ]; then + echo "[Unit] Description=MCSManager-Web [Service] @@ -156,9 +204,14 @@ Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target " >/etc/systemd/system/mcsm-web.service + fi systemctl daemon-reload - systemctl enable --now mcsm-{daemon,web}.service + if [ "$web_install" = true ]; then + systemctl enable --now mcsm-{daemon,web}.service + else + systemctl enable --now mcsm-daemon.service + fi echo_green "Registered!" sleep 2 @@ -166,18 +219,33 @@ WantedBy=multi-user.target printf "\n\n\n\n" echo_yellow "==================================================================" - echo_green "安装完成,欢迎使用 MCSManager !" + echo_green "更新完成,欢迎使用 MCSManager !" echo_yellow " " - echo_cyan_n "主控网页访问地址: " - echo_yellow "http://:23333 (Browser)" + if [ "$web_install" = true ]; then + echo_cyan_n "主控网页访问地址: " + echo_yellow "http://:23333 (Browser)" + fi + echo_cyan_n "被控守护进程地址: " echo_yellow "ws://:24444 (Cluster)" - echo_red "默认情况下,你必须开放 23333 和 24444 端口才能确保面板工作正常!" + + if [ "$web_install" = true ]; then + echo_red "默认情况下,你必须开放\033[1;33m 23333 和 24444 \033[1;31m端口才能确保面板工作正常!" + else + echo_red "默认情况下,你必须开放\033[1;33m 24444 \033[1;31m端口才能确保面板工作正常!" + fi + echo_yellow " " echo_cyan "面板开关指令:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" + if [ "$web_install" = true ]; then + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + else + echo_cyan "systemctl start mcsm-daemon.service" + echo_cyan "systemctl stop mcsm-daemon.service" + echo_cyan "systemctl restart mcsm-daemon.service" + fi echo_yellow " " echo_green "官方文档: https://docs.mcsmanager.com/" echo_yellow "==================================================================" @@ -231,10 +299,10 @@ else fi # Install the Node environment -Install_Node +Update_Node # Install MCSManager -Install_MCSManager +Update_MCSManager # Create MCSManager background service Create_Service diff --git a/update/setup.sh b/update/setup.sh deleted file mode 100644 index bc3c57c..0000000 --- a/update/setup.sh +++ /dev/null @@ -1,311 +0,0 @@ -#!/bin/bash -# Official installation script. - -mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr=$(curl -s https://api.github.com/repos/MCSManager/MCSManager/releases/latest | grep -o 'https://.*linux.*\.tar\.gz') -package_name="mcsmanager_linux_release.tar.gz" -node="v20.12.2" -arch=$(uname -m) - -if [ "$(id -u)" -ne 0 ]; then - echo "This script must be run as root. Please use \"sudo bash\" instead." - exit 1 -fi - -printf "\033c" - -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" -} -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} - -# script info -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Update -+---------------------------------------------------------------------- -" - -web_install=true -if [[ -d "${mcsmanager_install_path}" ]] && [[ ! -d "${mcsmanager_install_path}/web" ]]; then - web_install=false -fi - -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 -} - -Update_Node() { - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Node.js version is up-to-date, skipping installation." - return - else - echo_red "Node not find, start to install node.js" - fi - - echo_cyan_n "[+] Install Node.JS environment...\n" - - rm -irf "$node_install_path" - - cd /opt || Red_Error "[x] Failed to enter /opt" - - rm -rf "node-$node-linux-$arch.tar.gz" - - wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - - tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" - - rm -rf "node-$node-linux-$arch.tar.gz" - - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Success" - else - Red_Error "[x] Node installation failed!" - fi - - echo - echo_yellow "=============== Node.JS Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" - echo - - sleep 3 -} - -Update_MCSManager() { - echo_cyan "[+] Update MCSManager..." - - if [ "$web_install" = false ]; then - echo_yellow "[-] will not update web... (The web folder was not found)" - fi - - # stop service - systemctl disable --now mcsm-{web,daemon} - - # delete service - rm -rf /etc/systemd/system/mcsm-{daemon,web}.service - systemctl daemon-reload - - mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" - - # cd /opt/mcsmanager - cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" - - # backup data - if [ -d "${mcsmanager_install_path}/daemon/data" ]; then - mkdir -p "$mcsmanager_install_path/temp/daemon" - cp -rf $mcsmanager_install_path/daemon/data/* $mcsmanager_install_path/temp/daemon - fi - - if [ -d "${mcsmanager_install_path}/web/data" ]; then - mkdir -p "$mcsmanager_install_path/temp/web" - cp -rf $mcsmanager_install_path/web/data/* $mcsmanager_install_path/temp/web - fi - - # download MCSManager release - wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" - tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" - rm -rf "${mcsmanager_install_path}/${package_name}" - - # compatible with tar.gz packages of different formats - if [ -d "$mcsmanager_install_path/mcsmanager" ]; then - cp -rf $mcsmanager_install_path/mcsmanager/* $mcsmanager_install_path/ - rm -rf $mcsmanager_install_path/mcsmanager - fi - - if [ -d "${mcsmanager_install_path}/temp/daemon" ]; then - cp -rf $mcsmanager_install_path/temp/daemon/* $mcsmanager_install_path/daemon/data - rm -rf $mcsmanager_install_path/temp/daemon - fi - - if [ -d "${mcsmanager_install_path}/temp/web" ]; then - cp -rf $mcsmanager_install_path/temp/web/* $mcsmanager_install_path/web/data - rm -rf $mcsmanager_install_path/temp/web - fi - - if [ -d "${mcsmanager_install_path}/temp" ]; then - rm -rf $mcsmanager_install_path/temp - fi - - # echo "[→] cd daemon" - cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" - - echo_cyan "[+] Update MCSManager-Daemon dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" - - if [ "$web_install" = true ]; then - # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - - echo_cyan "[+] Update MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" - else - rm -rf "${mcsmanager_install_path}/web" - fi - - echo - echo_yellow "=============== MCSManager ===============" - echo_green "Daemon: ${mcsmanager_install_path}/daemon" - if [ "$web_install" = true ]; then - echo_green "Web: ${mcsmanager_install_path}/web" - fi - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" - - chmod -R 755 "$mcsmanager_install_path" - - sleep 3 -} - -Create_Service() { - echo_cyan "[+] Create MCSManager service..." - - echo "[Unit] -Description=MCSManager-Daemon - -[Service] -WorkingDirectory=${mcsmanager_install_path}/daemon -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service - - if [ "$web_install" = true ]; then - echo "[Unit] -Description=MCSManager-Web - -[Service] -WorkingDirectory=${mcsmanager_install_path}/web -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-web.service - fi - - systemctl daemon-reload - if [ "$web_install" = true ]; then - systemctl enable --now mcsm-{daemon,web}.service - else - systemctl enable --now mcsm-daemon.service - fi - echo_green "Registered!" - - sleep 2 - - printf "\n\n\n\n" - - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" - echo_yellow " " - if [ "$web_install" = true ]; then - echo_cyan_n "HTTP Web Service: " - echo_yellow "http://:23333 (Browser)" - fi - - echo_cyan_n "Daemon Address: " - echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports " - - if [ "$web_install" = true ]; then - echo_yellow "23333" - echo_red " and " - fi - - echo_yellow "24444" - echo_red " to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - - if [ "$web_install" = true ]; then - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - else - echo_cyan "systemctl start mcsm-daemon.service" - echo_cyan "systemctl stop mcsm-daemon.service" - echo_cyan "systemctl restart mcsm-daemon.service" - fi - - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" -} - -# Environmental inspection -if [[ "$arch" == x86_64 ]]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [[ $arch == aarch64 ]]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [[ $arch == arm ]]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [[ $arch == ppc64le ]]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [[ $arch == s390x ]]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" -fi - -# Define the variable Node installation directory -node_install_path="/opt/node-$node-linux-$arch" - -# Check network connection -echo_cyan "[-] Architecture: $arch" - -# Install related software -echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " -if [[ -x "$(command -v yum)" ]]; then - yum install -y git tar wget -elif [[ -x "$(command -v apt-get)" ]]; then - apt-get install -y git tar wget -elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm --needed git tar wget -elif [[ -x "$(command -v zypper)" ]]; then - zypper --non-interactive install git tar wget -else - echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" -fi - -# Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "Success" -else - Red_Error "[x] Failed to find git, tar and wget, please install them manually!" -fi - -# Install the Node environment -Update_Node - -# Install MCSManager -Update_MCSManager - -# Create MCSManager background service -Create_Service diff --git a/update/setup_cn.sh b/update/setup_cn.sh deleted file mode 100644 index c7d1a6c..0000000 --- a/update/setup_cn.sh +++ /dev/null @@ -1,308 +0,0 @@ -#!/bin/bash -# This script file is specifically designed for the Chinese region, and servers in the Chinese region are used to accelerate file downloads. - -mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://cdn.imlazy.ink:233/files/mcsmanager_linux_release.tar.gz" -package_name="mcsmanager_linux_release.tar.gz" -node="v20.12.2" -arch=$(uname -m) - -if [ "$(id -u)" -ne 0 ]; then - echo "This script must be run as root. Please use \"sudo bash\" instead." - exit 1 -fi - -printf "\033c" - -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" -} -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" -} -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" -} -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" -} -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" -} - -# script info -echo_cyan "+---------------------------------------------------------------------- -| MCSManager 更新脚本 (MCSManager Update) -+---------------------------------------------------------------------- -" - -web_install=true -if [[ -d "${mcsmanager_install_path}" ]] && [[ ! -d "${mcsmanager_install_path}/web" ]]; then - web_install=false -fi - -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 -} - -Update_Node() { - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Node.js version is up-to-date, skipping installation." - return - else - echo_red "Node not find, start to install node.js" - fi - - echo_cyan_n "[+] Install Node.JS environment...\n" - - rm -irf "$node_install_path" - - cd /opt || Red_Error "[x] Failed to enter /opt" - - rm -rf "node-$node-linux-$arch.tar.gz" - -# wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - wget "https://registry.npmmirror.com/-/binary/node/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - - tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" - - rm -rf "node-$node-linux-$arch.tar.gz" - - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Success" - else - Red_Error "[x] Node installation failed!" - fi - - echo - echo_yellow "=============== Node.JS Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" - echo - - sleep 3 -} - -Update_MCSManager() { - echo_cyan "[+] Update MCSManager..." - - if [ "$web_install" = false ]; then - echo_yellow "[-] will not update web... (The web folder was not found)" - fi - - # stop service - systemctl disable --now mcsm-{web,daemon} - - # delete service - rm -rf /etc/systemd/system/mcsm-{daemon,web}.service - systemctl daemon-reload - - mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" - - # cd /opt/mcsmanager - cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" - - # backup data - if [ -d "${mcsmanager_install_path}/daemon/data" ]; then - mkdir -p "$mcsmanager_install_path/temp/daemon" - cp -rf $mcsmanager_install_path/daemon/data/* $mcsmanager_install_path/temp/daemon - fi - - if [ -d "${mcsmanager_install_path}/web/data" ]; then - mkdir -p "$mcsmanager_install_path/temp/web" - cp -rf $mcsmanager_install_path/web/data/* $mcsmanager_install_path/temp/web - fi - - # download MCSManager release - wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" - tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" - rm -rf "${mcsmanager_install_path}/${package_name}" - - # compatible with tar.gz packages of different formats - if [ -d "$mcsmanager_install_path/mcsmanager" ]; then - cp -rf $mcsmanager_install_path/mcsmanager/* $mcsmanager_install_path/ - rm -rf $mcsmanager_install_path/mcsmanager - fi - - if [ -d "${mcsmanager_install_path}/temp/daemon" ]; then - cp -rf $mcsmanager_install_path/temp/daemon/* $mcsmanager_install_path/daemon/data - rm -rf $mcsmanager_install_path/temp/daemon - fi - - if [ -d "${mcsmanager_install_path}/temp/web" ]; then - cp -rf $mcsmanager_install_path/temp/web/* $mcsmanager_install_path/web/data - rm -rf $mcsmanager_install_path/temp/web - fi - - if [ -d "${mcsmanager_install_path}/temp" ]; then - rm -rf $mcsmanager_install_path/temp - fi - - # echo "[→] cd daemon" - cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" - - echo_cyan "[+] Update MCSManager-Daemon dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" - - if [ "$web_install" = true ]; then - # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - - echo_cyan "[+] Update MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" - else - rm -rf "${mcsmanager_install_path}/web" - fi - - echo - echo_yellow "=============== MCSManager ===============" - echo_green "Daemon: ${mcsmanager_install_path}/daemon" - if [ "$web_install" = true ]; then - echo_green "Web: ${mcsmanager_install_path}/web" - fi - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" - - chmod -R 755 "$mcsmanager_install_path" - - sleep 3 -} - -Create_Service() { - echo_cyan "[+] Create MCSManager service..." - - echo "[Unit] -Description=MCSManager-Daemon - -[Service] -WorkingDirectory=${mcsmanager_install_path}/daemon -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service - - if [ "$web_install" = true ]; then - echo "[Unit] -Description=MCSManager-Web - -[Service] -WorkingDirectory=${mcsmanager_install_path}/web -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" - -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-web.service - fi - - systemctl daemon-reload - if [ "$web_install" = true ]; then - systemctl enable --now mcsm-{daemon,web}.service - else - systemctl enable --now mcsm-daemon.service - fi - echo_green "Registered!" - - sleep 2 - - printf "\n\n\n\n" - - echo_yellow "==================================================================" - echo_green "更新完成,欢迎使用 MCSManager !" - echo_yellow " " - if [ "$web_install" = true ]; then - echo_cyan_n "主控网页访问地址: " - echo_yellow "http://:23333 (Browser)" - fi - - echo_cyan_n "被控守护进程地址: " - echo_yellow "ws://:24444 (Cluster)" - - if [ "$web_install" = true ]; then - echo_red "默认情况下,你必须开放\033[1;33m 23333 和 24444 \033[1;31m端口才能确保面板工作正常!" - else - echo_red "默认情况下,你必须开放\033[1;33m 24444 \033[1;31m端口才能确保面板工作正常!" - fi - - echo_yellow " " - echo_cyan "面板开关指令:" - if [ "$web_install" = true ]; then - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - else - echo_cyan "systemctl start mcsm-daemon.service" - echo_cyan "systemctl stop mcsm-daemon.service" - echo_cyan "systemctl restart mcsm-daemon.service" - fi - echo_yellow " " - echo_green "官方文档: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" -} - -# Environmental inspection -if [[ "$arch" == x86_64 ]]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [[ $arch == aarch64 ]]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [[ $arch == arm ]]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [[ $arch == ppc64le ]]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [[ $arch == s390x ]]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" -fi - -# Define the variable Node installation directory -node_install_path="/opt/node-$node-linux-$arch" - -# Check network connection -echo_cyan "[-] Architecture: $arch" - -# Install related software -echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " -if [[ -x "$(command -v yum)" ]]; then - yum install -y git tar wget -elif [[ -x "$(command -v apt-get)" ]]; then - apt-get install -y git tar wget -elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm --needed git tar wget -elif [[ -x "$(command -v zypper)" ]]; then - zypper --non-interactive install git tar wget -else - echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" -fi - -# Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "Success" -else - Red_Error "[x] Failed to find git, tar and wget, please install them manually!" -fi - -# Install the Node environment -Update_Node - -# Install MCSManager -Update_MCSManager - -# Create MCSManager background service -Create_Service From c1bd8e0447cc0833bd71b2a8ad0f2bc1a25127af Mon Sep 17 00:00:00 2001 From: shane0411 Date: Sun, 18 May 2025 17:50:32 +0800 Subject: [PATCH 304/463] =?UTF-8?q?style:=20=E6=8A=8Aupdate=E6=94=B9?= =?UTF-8?q?=E7=82=BAinstall?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.sh | 22 ++++++++++------------ setup_cn.sh | 24 +++++++++++------------- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/setup.sh b/setup.sh index bc3c57c..aa0854a 100644 --- a/setup.sh +++ b/setup.sh @@ -32,7 +32,7 @@ echo_yellow() { # script info echo_cyan "+---------------------------------------------------------------------- -| MCSManager Update +| MCSManager Installer +---------------------------------------------------------------------- " @@ -48,15 +48,13 @@ Red_Error() { exit 1 } -Update_Node() { +Install_Node() { if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then echo_green "Node.js version is up-to-date, skipping installation." return - else - echo_red "Node not find, start to install node.js" fi - echo_cyan_n "[+] Install Node.JS environment...\n" + echo_cyan "[+] Install Node.JS environment..." rm -irf "$node_install_path" @@ -86,11 +84,11 @@ Update_Node() { sleep 3 } -Update_MCSManager() { - echo_cyan "[+] Update MCSManager..." +Install_MCSManager() { + echo_cyan "[+] Install MCSManager..." if [ "$web_install" = false ]; then - echo_yellow "[-] will not update web... (The web folder was not found)" + echo_yellow "[-] will not install web... (The web folder was not found)" fi # stop service @@ -144,14 +142,14 @@ Update_MCSManager() { # echo "[→] cd daemon" cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" - echo_cyan "[+] Update MCSManager-Daemon dependencies..." + echo_cyan "[+] Install MCSManager-Daemon dependencies..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" if [ "$web_install" = true ]; then # echo "[←] cd .." cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - echo_cyan "[+] Update MCSManager-Web dependencies..." + echo_cyan "[+] Install MCSManager-Web dependencies..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" else rm -rf "${mcsmanager_install_path}/web" @@ -302,10 +300,10 @@ else fi # Install the Node environment -Update_Node +Install_Node # Install MCSManager -Update_MCSManager +Install_MCSManager # Create MCSManager background service Create_Service diff --git a/setup_cn.sh b/setup_cn.sh index c7d1a6c..c2714ca 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -32,7 +32,7 @@ echo_yellow() { # script info echo_cyan "+---------------------------------------------------------------------- -| MCSManager 更新脚本 (MCSManager Update) +| MCSManager 安裝脚本 (MCSManager Installer) +---------------------------------------------------------------------- " @@ -48,15 +48,13 @@ Red_Error() { exit 1 } -Update_Node() { +Install_Node() { if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then echo_green "Node.js version is up-to-date, skipping installation." return - else - echo_red "Node not find, start to install node.js" fi - echo_cyan_n "[+] Install Node.JS environment...\n" + echo_cyan "[+] Install Node.JS environment..." rm -irf "$node_install_path" @@ -87,11 +85,11 @@ Update_Node() { sleep 3 } -Update_MCSManager() { - echo_cyan "[+] Update MCSManager..." +Install_MCSManager() { + echo_cyan "[+] Install MCSManager..." if [ "$web_install" = false ]; then - echo_yellow "[-] will not update web... (The web folder was not found)" + echo_yellow "[-] will not install web... (The web folder was not found)" fi # stop service @@ -145,14 +143,14 @@ Update_MCSManager() { # echo "[→] cd daemon" cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" - echo_cyan "[+] Update MCSManager-Daemon dependencies..." + echo_cyan "[+] Install MCSManager-Daemon dependencies..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" if [ "$web_install" = true ]; then # echo "[←] cd .." cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - echo_cyan "[+] Update MCSManager-Web dependencies..." + echo_cyan "[+] Install MCSManager-Web dependencies..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" else rm -rf "${mcsmanager_install_path}/web" @@ -219,7 +217,7 @@ WantedBy=multi-user.target printf "\n\n\n\n" echo_yellow "==================================================================" - echo_green "更新完成,欢迎使用 MCSManager !" + echo_green "安装完成,欢迎使用 MCSManager !" echo_yellow " " if [ "$web_install" = true ]; then echo_cyan_n "主控网页访问地址: " @@ -299,10 +297,10 @@ else fi # Install the Node environment -Update_Node +Install_Node # Install MCSManager -Update_MCSManager +Install_MCSManager # Create MCSManager background service Create_Service From d8c893fbae6b9d261a240ed251f268b4b9f51ff3 Mon Sep 17 00:00:00 2001 From: shane0411 Date: Wed, 21 May 2025 23:07:49 +0800 Subject: [PATCH 305/463] =?UTF-8?q?feat:=20=E5=B0=87setup=E5=BE=A9?= =?UTF-8?q?=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/MCSManager/Script/pull/53#issuecomment-2897056688 --- daemon/setup.sh | 2 +- setup.sh | 97 +++++++++---------------------------------------- setup_cn.sh | 97 +++++++++---------------------------------------- 3 files changed, 37 insertions(+), 159 deletions(-) diff --git a/daemon/setup.sh b/daemon/setup.sh index aa1a6c2..3456253 100644 --- a/daemon/setup.sh +++ b/daemon/setup.sh @@ -2,7 +2,7 @@ # Official installation script. mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr=$(curl -s https://api.github.com/repos/MCSManager/MCSManager/releases/latest | grep -o 'https://.*linux.*\.tar\.gz') +mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" node="v20.12.2" arch=$(uname -m) diff --git a/setup.sh b/setup.sh index aa0854a..6af7a4c 100644 --- a/setup.sh +++ b/setup.sh @@ -2,7 +2,7 @@ # Official installation script. mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr=$(curl -s https://api.github.com/repos/MCSManager/MCSManager/releases/latest | grep -o 'https://.*linux.*\.tar\.gz') +mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" node="v20.12.2" arch=$(uname -m) @@ -36,11 +36,6 @@ echo_cyan "+-------------------------------------------------------------------- +---------------------------------------------------------------------- " -web_install=true -if [[ -d "${mcsmanager_install_path}" ]] && [[ ! -d "${mcsmanager_install_path}/web" ]]; then - web_install=false -fi - Red_Error() { echo '=================================================' printf '\033[1;31;40m%b\033[0m\n' "$@" @@ -87,10 +82,6 @@ Install_Node() { Install_MCSManager() { echo_cyan "[+] Install MCSManager..." - if [ "$web_install" = false ]; then - echo_yellow "[-] will not install web... (The web folder was not found)" - fi - # stop service systemctl disable --now mcsm-{web,daemon} @@ -103,40 +94,15 @@ Install_MCSManager() { # cd /opt/mcsmanager cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" - # backup data - if [ -d "${mcsmanager_install_path}/daemon/data" ]; then - mkdir -p "$mcsmanager_install_path/temp/daemon" - cp -rf $mcsmanager_install_path/daemon/data/* $mcsmanager_install_path/temp/daemon - fi - - if [ -d "${mcsmanager_install_path}/web/data" ]; then - mkdir -p "$mcsmanager_install_path/temp/web" - cp -rf $mcsmanager_install_path/web/data/* $mcsmanager_install_path/temp/web - fi - # download MCSManager release wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" # compatible with tar.gz packages of different formats - if [ -d "$mcsmanager_install_path/mcsmanager" ]; then - cp -rf $mcsmanager_install_path/mcsmanager/* $mcsmanager_install_path/ - rm -rf $mcsmanager_install_path/mcsmanager - fi - - if [ -d "${mcsmanager_install_path}/temp/daemon" ]; then - cp -rf $mcsmanager_install_path/temp/daemon/* $mcsmanager_install_path/daemon/data - rm -rf $mcsmanager_install_path/temp/daemon - fi - - if [ -d "${mcsmanager_install_path}/temp/web" ]; then - cp -rf $mcsmanager_install_path/temp/web/* $mcsmanager_install_path/web/data - rm -rf $mcsmanager_install_path/temp/web - fi - - if [ -d "${mcsmanager_install_path}/temp" ]; then - rm -rf $mcsmanager_install_path/temp + if [ -d "/opt/mcsmanager/mcsmanager" ]; then + cp -rf /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ + rm -rf /opt/mcsmanager/mcsmanager fi # echo "[→] cd daemon" @@ -145,22 +111,16 @@ Install_MCSManager() { echo_cyan "[+] Install MCSManager-Daemon dependencies..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" - if [ "$web_install" = true ]; then - # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" + # echo "[←] cd .." + cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - echo_cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" - else - rm -rf "${mcsmanager_install_path}/web" - fi + echo_cyan "[+] Install MCSManager-Web dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" echo echo_yellow "=============== MCSManager ===============" echo_green "Daemon: ${mcsmanager_install_path}/daemon" - if [ "$web_install" = true ]; then - echo_green "Web: ${mcsmanager_install_path}/web" - fi + echo_green "Web: ${mcsmanager_install_path}/web" echo_yellow "=============== MCSManager ===============" echo echo_green "[+] MCSManager installation success!" @@ -187,8 +147,7 @@ Environment=\"PATH=${PATH}\" WantedBy=multi-user.target " >/etc/systemd/system/mcsm-daemon.service - if [ "$web_install" = true ]; then - echo "[Unit] + echo "[Unit] Description=MCSManager-Web [Service] @@ -201,14 +160,9 @@ Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target " >/etc/systemd/system/mcsm-web.service - fi systemctl daemon-reload - if [ "$web_install" = true ]; then - systemctl enable --now mcsm-{daemon,web}.service - else - systemctl enable --now mcsm-daemon.service - fi + systemctl enable --now mcsm-{daemon,web}.service echo_green "Registered!" sleep 2 @@ -218,35 +172,20 @@ WantedBy=multi-user.target echo_yellow "==================================================================" echo_green "Installation is complete! Welcome to the MCSManager!!!" echo_yellow " " - if [ "$web_install" = true ]; then - echo_cyan_n "HTTP Web Service: " - echo_yellow "http://:23333 (Browser)" - fi - + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" echo_cyan_n "Daemon Address: " echo_yellow "ws://:24444 (Cluster)" echo_red "You must expose ports " - - if [ "$web_install" = true ]; then - echo_yellow "23333" - echo_red " and " - fi - + echo_yellow "23333" + echo_red " and " echo_yellow "24444" echo_red " to use the service properly on the Internet." echo_yellow " " echo_cyan "Usage:" - - if [ "$web_install" = true ]; then - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - else - echo_cyan "systemctl start mcsm-daemon.service" - echo_cyan "systemctl stop mcsm-daemon.service" - echo_cyan "systemctl restart mcsm-daemon.service" - fi - + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" echo_yellow " " echo_green "Official Document: https://docs.mcsmanager.com/" echo_yellow "==================================================================" diff --git a/setup_cn.sh b/setup_cn.sh index c2714ca..97e9b8c 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -32,15 +32,10 @@ echo_yellow() { # script info echo_cyan "+---------------------------------------------------------------------- -| MCSManager 安裝脚本 (MCSManager Installer) +| MCSManager 安装脚本 (MCSManager Installer) +---------------------------------------------------------------------- " -web_install=true -if [[ -d "${mcsmanager_install_path}" ]] && [[ ! -d "${mcsmanager_install_path}/web" ]]; then - web_install=false -fi - Red_Error() { echo '=================================================' printf '\033[1;31;40m%b\033[0m\n' "$@" @@ -62,7 +57,7 @@ Install_Node() { rm -rf "node-$node-linux-$arch.tar.gz" -# wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + # wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" wget "https://registry.npmmirror.com/-/binary/node/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" @@ -88,10 +83,6 @@ Install_Node() { Install_MCSManager() { echo_cyan "[+] Install MCSManager..." - if [ "$web_install" = false ]; then - echo_yellow "[-] will not install web... (The web folder was not found)" - fi - # stop service systemctl disable --now mcsm-{web,daemon} @@ -104,40 +95,15 @@ Install_MCSManager() { # cd /opt/mcsmanager cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" - # backup data - if [ -d "${mcsmanager_install_path}/daemon/data" ]; then - mkdir -p "$mcsmanager_install_path/temp/daemon" - cp -rf $mcsmanager_install_path/daemon/data/* $mcsmanager_install_path/temp/daemon - fi - - if [ -d "${mcsmanager_install_path}/web/data" ]; then - mkdir -p "$mcsmanager_install_path/temp/web" - cp -rf $mcsmanager_install_path/web/data/* $mcsmanager_install_path/temp/web - fi - # download MCSManager release wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" # compatible with tar.gz packages of different formats - if [ -d "$mcsmanager_install_path/mcsmanager" ]; then - cp -rf $mcsmanager_install_path/mcsmanager/* $mcsmanager_install_path/ - rm -rf $mcsmanager_install_path/mcsmanager - fi - - if [ -d "${mcsmanager_install_path}/temp/daemon" ]; then - cp -rf $mcsmanager_install_path/temp/daemon/* $mcsmanager_install_path/daemon/data - rm -rf $mcsmanager_install_path/temp/daemon - fi - - if [ -d "${mcsmanager_install_path}/temp/web" ]; then - cp -rf $mcsmanager_install_path/temp/web/* $mcsmanager_install_path/web/data - rm -rf $mcsmanager_install_path/temp/web - fi - - if [ -d "${mcsmanager_install_path}/temp" ]; then - rm -rf $mcsmanager_install_path/temp + if [ -d "/opt/mcsmanager/mcsmanager" ]; then + cp -rf /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ + rm -rf /opt/mcsmanager/mcsmanager fi # echo "[→] cd daemon" @@ -146,22 +112,16 @@ Install_MCSManager() { echo_cyan "[+] Install MCSManager-Daemon dependencies..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" - if [ "$web_install" = true ]; then - # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" + # echo "[←] cd .." + cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - echo_cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" - else - rm -rf "${mcsmanager_install_path}/web" - fi + echo_cyan "[+] Install MCSManager-Web dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" echo echo_yellow "=============== MCSManager ===============" echo_green "Daemon: ${mcsmanager_install_path}/daemon" - if [ "$web_install" = true ]; then - echo_green "Web: ${mcsmanager_install_path}/web" - fi + echo_green "Web: ${mcsmanager_install_path}/web" echo_yellow "=============== MCSManager ===============" echo echo_green "[+] MCSManager installation success!" @@ -188,8 +148,7 @@ Environment=\"PATH=${PATH}\" WantedBy=multi-user.target " >/etc/systemd/system/mcsm-daemon.service - if [ "$web_install" = true ]; then - echo "[Unit] + echo "[Unit] Description=MCSManager-Web [Service] @@ -202,14 +161,9 @@ Environment=\"PATH=${PATH}\" [Install] WantedBy=multi-user.target " >/etc/systemd/system/mcsm-web.service - fi systemctl daemon-reload - if [ "$web_install" = true ]; then - systemctl enable --now mcsm-{daemon,web}.service - else - systemctl enable --now mcsm-daemon.service - fi + systemctl enable --now mcsm-{daemon,web}.service echo_green "Registered!" sleep 2 @@ -219,31 +173,16 @@ WantedBy=multi-user.target echo_yellow "==================================================================" echo_green "安装完成,欢迎使用 MCSManager !" echo_yellow " " - if [ "$web_install" = true ]; then - echo_cyan_n "主控网页访问地址: " - echo_yellow "http://:23333 (Browser)" - fi - + echo_cyan_n "主控网页访问地址: " + echo_yellow "http://:23333 (Browser)" echo_cyan_n "被控守护进程地址: " echo_yellow "ws://:24444 (Cluster)" - - if [ "$web_install" = true ]; then - echo_red "默认情况下,你必须开放\033[1;33m 23333 和 24444 \033[1;31m端口才能确保面板工作正常!" - else - echo_red "默认情况下,你必须开放\033[1;33m 24444 \033[1;31m端口才能确保面板工作正常!" - fi - + echo_red "默认情况下,你必须开放 23333 和 24444 端口才能确保面板工作正常!" echo_yellow " " echo_cyan "面板开关指令:" - if [ "$web_install" = true ]; then - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - else - echo_cyan "systemctl start mcsm-daemon.service" - echo_cyan "systemctl stop mcsm-daemon.service" - echo_cyan "systemctl restart mcsm-daemon.service" - fi + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" echo_yellow " " echo_green "官方文档: https://docs.mcsmanager.com/" echo_yellow "==================================================================" From fdf5ef723476e6494bd45565835e1e5c4e217059 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 02:37:36 -0400 Subject: [PATCH 306/463] minor syntax fix --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index a1d236e..a183e19 100644 --- a/setup.sh +++ b/setup.sh @@ -1164,7 +1164,7 @@ print_install_result() { echo "__ /|_/ /_ / _____ \__ /|_/ /_ __ \`/_ __ \ __ \`/_ __ \`/ _ \_ ___/" echo "_ / / / / /___ ____/ /_ / / / / /_/ /_ / / / /_/ /_ /_/ // __/ /" echo "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" - echo " + echo "" # status summary echo "Installed/Updated Components:" if [[ "$install_daemon" == true && -n "$daemon_key" && -n "$daemon_port" ]]; then From 7ec8cfd5534499fc5fe479c052acbd46017ea215 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 02:48:23 -0400 Subject: [PATCH 307/463] fix node path when installed --- setup.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index a183e19..afe8740 100644 --- a/setup.sh +++ b/setup.sh @@ -632,16 +632,17 @@ resolve_node_arch() { # This function check Node.js version + NPM (if Node.js valid) verify_node_at_path() { local node_path="$1" - local bin_node="$node_path/bin/node" - local bin_npm="$node_path/bin/npm" + # Assign value to vlobal variables when verifying + node_bin_path="$node_path/bin/node" + npm_bin_path="$node_path/bin/npm" # Node binary missing - if [ ! -x "$bin_node" ]; then + if [ ! -x "$node_bin_path" ]; then return 1 fi local installed_ver - installed_ver="$("$bin_node" -v 2>/dev/null | sed 's/^v//')" + installed_ver="$("$node_bin_path" -v 2>/dev/null | sed 's/^v//')" # Node exists but version not returned if [[ -z "$installed_ver" ]]; then @@ -663,7 +664,7 @@ verify_node_at_path() { fi # node cmd valid, but npm is missing or broken. - if [ ! -x "$bin_npm" ] || ! "$bin_npm" --version >/dev/null 2>&1; then + if [ ! -x "$npm_bin_path" ] || ! "$npm_bin_path" --version >/dev/null 2>&1; then return 4 fi From 58b6ee43b9ee1aa21e28658c8e2bd6091c80010a Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 02:55:59 -0400 Subject: [PATCH 308/463] add cleanup when error --- setup.sh | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/setup.sh b/setup.sh index afe8740..a6d4a5d 100644 --- a/setup.sh +++ b/setup.sh @@ -72,7 +72,7 @@ systemd_file="/etc/systemd/system/mcsm-" install_source_path="" # temp path for extracted file(s) -install_tmp_dir="" +install_tmp_dir="/opt/mcsmanager/mcsm_abcd" # dir name for data dir backup # e.g. /opt/mcsmanager/daemon/data -> /opt/mcsmanager/data_bak_data @@ -926,6 +926,7 @@ mcsm_install_prepare() { cprint cyan "Changing ownership of $install_tmp_dir to user '$install_user'..." chown -R "$install_user":"$install_user" "$install_tmp_dir" || { cprint red bold "Failed to change ownership of $install_tmp_dir" + cleanup_install_tmp exit 1 } @@ -952,13 +953,15 @@ mcsm_install_prepare() { if [[ -d "$data_dir" ]]; then if [[ -e "$backup_path" ]]; then cprint red bold "Backup destination already exists: $backup_path" - cprint red " Please resolve this conflict manually before continuing." + cprint red "Please resolve this conflict manually before continuing." + cleanup_install_tmp exit 1 fi cprint cyan "Backing up data directory for $component..." mv "$data_dir" "$backup_path" || { cprint red bold "Failed to move $data_dir to $backup_path" + cleanup_install_tmp exit 1 } cprint green "Moved $data_dir → $backup_path" @@ -969,6 +972,7 @@ mcsm_install_prepare() { cprint cyan "Removing old component directory: $component_path" rm -rf "$component_path" || { cprint red bold "Failed to remove old component directory: $component_path" + cleanup_install_tmp exit 1 } fi @@ -990,17 +994,20 @@ install_component() { # Step 1: Move new component to install_dir if [[ ! -d "$source_path" ]]; then cprint red bold "Source directory not found: $source_path" + cleanup_install_tmp exit 1 fi if [[ -e "$target_path" ]]; then cprint red bold "Target path already exists: $target_path" cprint red " This should not happen — possible permission error or unclean install." + cleanup_install_tmp exit 1 fi mv "$source_path" "$target_path" || { cprint red bold "Failed to move $source_path → $target_path" + cleanup_install_tmp exit 1 } @@ -1015,6 +1022,7 @@ install_component() { rm -rf "$target_data_path" # Ensure no conflict mv "$backup_data_path" "$target_data_path" || { cprint red bold "Failed to restore data directory to $target_data_path" + cleanup_install_tmp exit 1 } @@ -1026,18 +1034,21 @@ install_component() { # Step 3: Install NPM dependencies if [[ ! -x "$npm_bin_path" ]]; then cprint red bold "npm binary not found or not executable: $npm_bin_path" + cleanup_install_tmp exit 1 fi cprint cyan "Installing dependencies for $component using npm..." pushd "$target_path" >/dev/null || { cprint red bold "Failed to change directory to $target_path" + cleanup_install_tmp exit 1 } if ! "$npm_bin_path" install --no-audit --no-fund --loglevel=warn; then cprint red bold "NPM dependency installation failed for $component" popd >/dev/null + cleanup_install_tmp exit 1 fi @@ -1055,6 +1066,7 @@ create_systemd_service() { if [[ ! -d "$working_dir" ]]; then cprint red bold "Component directory not found: $working_dir" + cleanup_install_tmp return 1 fi @@ -1082,6 +1094,7 @@ EOF if [[ $? -ne 0 ]]; then cprint red bold "Failed to write service file: $service_path" + cleanup_install_tmp return 1 fi @@ -1155,6 +1168,16 @@ extract_component_info() { fi } +cleanup_install_tmp() { + if [[ -n "$install_tmp_dir" && -d "$install_tmp_dir" ]]; then + if rm -rf "$install_tmp_dir"; then + cprint green "Cleaned up temporary install folder: $install_tmp_dir" + else + cprint red "Failed to remove temporary folder: $install_tmp_dir" + fi + fi +} + print_install_result() { # Clear the screen clear &>/dev/null || true @@ -1274,18 +1297,14 @@ install_mcsm() { cprint green "Enabled service: $svc" else cprint red bold "Failed to enable service: $svc" + cleanup_install_tmp exit 1 fi done fi - # Clear temp dir - if rm -rf "$install_tmp_dir"; then - cprint green "Cleaned up temporary install folder: $install_tmp_dir" - else - cprint red "Failed to remove temporary folder: $install_tmp_dir" - fi - + # Clean tmp dir + cleanup_install_tmp # Extract installed component info safe_run extract_component_info "Failed to extract runtime info from installed services" safe_rul print_install_result "Failed to print installation result" From 63a859592c583ccd133bdd3d73d6a8278acc2d02 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 03:11:53 -0400 Subject: [PATCH 309/463] fix component detection logic --- setup.sh | 75 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/setup.sh b/setup.sh index a6d4a5d..34ecac2 100644 --- a/setup.sh +++ b/setup.sh @@ -287,8 +287,9 @@ check_component_permission() { -# Parse cmd arguments. parse_args() { + local explicit_install_flag=false + while [[ $# -gt 0 ]]; do case "$1" in --install-dir) @@ -310,23 +311,28 @@ parse_args() { fi ;; --install) - if [[ -n "$2" ]]; then + explicit_install_flag=true + if [[ -n "$2" && "$2" != --* ]]; then case "$2" in daemon) install_daemon=true - check_component_permission "daemon" + is_component_installed "daemon" install_web=false + check_component_permission "daemon" ;; web) install_daemon=false + is_component_installed "web" install_web=true - check_component_permission "web" + check_component_permission "web" ;; all) install_daemon=true - check_component_permission "daemon" install_web=true - check_component_permission "web" + is_component_installed "daemon" + is_component_installed "web" + check_component_permission "daemon" + check_component_permission "web" ;; *) echo "Error: Invalid value for --install. Expected 'daemon', 'web', or 'all'." @@ -336,32 +342,9 @@ parse_args() { esac shift 2 else - # No argument passed with --install, detect based on installed components - daemon_installed=false - web_installed=false - - if is_component_installed "daemon"; then - daemon_installed=true - check_component_permission "daemon" - fi - if is_component_installed "web"; then - web_installed=true - check_component_permission "web" - fi - - if [[ "$daemon_installed" == true && "$web_installed" == false ]]; then - install_daemon=true - install_web=false - elif [[ "$daemon_installed" == false && "$web_installed" == true ]]; then - install_daemon=false - install_web=true - else - # None or both installed perform fresh install or update both - install_daemon=true - install_web=true - fi - - shift 1 + echo "Error: --install flag provided but no value. Please specify: daemon, web, or all." + echo "Usage: --install daemon|web|all" + exit 1 fi ;; --user) @@ -400,8 +383,36 @@ parse_args() { ;; esac done + + # Auto-detect branch: only run if --install was not explicitly passed + if [[ "$explicit_install_flag" == false ]]; then + daemon_installed=false + web_installed=false + + if is_component_installed "daemon"; then + daemon_installed=true + check_component_permission "daemon" + fi + if is_component_installed "web"; then + web_installed=true + check_component_permission "web" + fi + + # When only one component installed, we wanted to process that one only. + if [[ "$daemon_installed" == true && "$web_installed" == false ]]; then + install_daemon=true + install_web=false + elif [[ "$daemon_installed" == false && "$web_installed" == true ]]; then + install_daemon=false + install_web=true + else + install_daemon=true + install_web=true + fi + fi } + # Get Distribution & Architecture Info detect_os_info() { distro="Unknown" From baf3b67899f2e823389c101cf657f1f1fccb6eb7 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 03:12:20 -0400 Subject: [PATCH 310/463] minor language fix --- setup.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index 34ecac2..bfcc2c6 100644 --- a/setup.sh +++ b/setup.sh @@ -574,17 +574,17 @@ permission_barrier() { # Step 0: Ensure installed user is detected if [[ -z "$installed_user" ]]; then cprint red bold "Detected that '$component' is installed but could not determine the user from its systemd service file." - cprint red " This may indicate a custom or unsupported service file setup." - cprint red " Refusing to proceed to avoid potential conflicts." + cprint red "This may indicate a custom or unsupported service file setup." + cprint red "Refusing to proceed to avoid potential conflicts." exit 1 fi # Step 1: User match check if [[ "$installed_user" != "$install_user" ]]; then cprint red bold "Permission mismatch for '$component':" - cprint red " Installed as user: $installed_user" - cprint red " Current install target user: $install_user" - cprint red " Unable to proceed due to ownership conflict." + cprint red "Installed as user: $installed_user" + cprint red "Current install target user: $install_user" + cprint red "Unable to proceed due to ownership conflict." exit 1 fi fi From 7fb10a4653a91e27a3a5a25078aca8f853e48ee0 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 03:17:46 -0400 Subject: [PATCH 311/463] minor fix --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index bfcc2c6..8a99b87 100644 --- a/setup.sh +++ b/setup.sh @@ -1318,7 +1318,7 @@ install_mcsm() { cleanup_install_tmp # Extract installed component info safe_run extract_component_info "Failed to extract runtime info from installed services" - safe_rul print_install_result "Failed to print installation result" + safe_run print_install_result "Failed to print installation result" } From 7f1e7d904af1fb6921be9535aeb1abf1f3f2c6a0 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 03:18:45 -0400 Subject: [PATCH 312/463] fixed web port extraction --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 8a99b87..cd1d6aa 100644 --- a/setup.sh +++ b/setup.sh @@ -1164,7 +1164,7 @@ extract_component_info() { sleep 1 # Allow time to populate config if [[ -f "$web_config_path" ]]; then - web_port=$(grep -oP '"httpPort"\s*:\s*"\K[^"]+' "$web_config_path") + web_port=$(grep -oP '"httpPort"\s*:\s*\K[0-9]+' "$web_config_path") if [[ -n "$web_port" ]]; then cprint green "Extracted web port: $web_port" else From 9abf86a1ccbe98f72f8a0a221d2c4d3f9a115212 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 03:29:54 -0400 Subject: [PATCH 313/463] added timestamp to each output --- setup.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index cd1d6aa..643472f 100644 --- a/setup.sh +++ b/setup.sh @@ -103,6 +103,7 @@ required_commands=( stat useradd usermod + date ) # Node.js related sections @@ -531,7 +532,7 @@ cprint() { local color="" local text="" local styles="" - + while [[ $# -gt 1 ]]; do case "$1" in black|red|green|yellow|blue|magenta|cyan|white) @@ -546,6 +547,12 @@ cprint() { text="$1" + # Build the prefix timestamp and script label in white, always + local timestamp="[$(date +%H:%M:%S)]" + local label="[MCSM Installer]" + local fixed_prefix="${FG_COLORS[white]}$timestamp $label${RESET} " + + # Apply color and style to the message content only local prefix="" if [[ -n "$color" && "$SUPPORTS_COLOR" = true ]]; then prefix+="${FG_COLORS[$color]}" @@ -554,9 +561,10 @@ cprint() { prefix="$styles$prefix" fi - printf "%b%s%b\n" "$prefix" "$text" "$RESET" + printf "%b%b%s%b\n" "$fixed_prefix" "$prefix" "$text" "$RESET" } + # Permission check before proceed with installation permission_barrier() { if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then From 8e797e6aa46f32dc8c32e90ba89cdf4cddb73aa2 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 03:32:35 -0400 Subject: [PATCH 314/463] added timestamp exception --- setup.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index 643472f..98fefa6 100644 --- a/setup.sh +++ b/setup.sh @@ -532,6 +532,7 @@ cprint() { local color="" local text="" local styles="" + local disable_prefix=false while [[ $# -gt 1 ]]; do case "$1" in @@ -541,30 +542,35 @@ cprint() { bold|underline|italic|clear_line|strikethrough) styles+="${STYLES[$1]}" ;; + noprefix) + disable_prefix=true + ;; esac shift done text="$1" - # Build the prefix timestamp and script label in white, always - local timestamp="[$(date +%H:%M:%S)]" - local label="[MCSM Installer]" - local fixed_prefix="${FG_COLORS[white]}$timestamp $label${RESET} " + local prefix_text="" + if [[ "$disable_prefix" != true ]]; then + local timestamp="[$(date +%H:%M:%S)]" + local label="[MCSM Installer]" + prefix_text="${FG_COLORS[white]}$timestamp $label${RESET} " + fi - # Apply color and style to the message content only local prefix="" if [[ -n "$color" && "$SUPPORTS_COLOR" = true ]]; then prefix+="${FG_COLORS[$color]}" fi - if [ "$SUPPORTS_STYLE" = true ] || [[ "$styles" == *"${STYLES[clear_line]}"* ]]; then + if [[ "$SUPPORTS_STYLE" = true || "$styles" == *"${STYLES[clear_line]}"* ]]; then prefix="$styles$prefix" fi - printf "%b%b%s%b\n" "$fixed_prefix" "$prefix" "$text" "$RESET" + printf "%b%b%s%b\n" "$prefix_text" "$prefix" "$text" "$RESET" } + # Permission check before proceed with installation permission_barrier() { if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then From 1c674063edb8c6a2fb51c8d36c734fa1561e2cd1 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 03:38:26 -0400 Subject: [PATCH 315/463] allows printing without newline --- setup.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 98fefa6..f64b745 100644 --- a/setup.sh +++ b/setup.sh @@ -533,6 +533,7 @@ cprint() { local text="" local styles="" local disable_prefix=false + local disable_newline=false while [[ $# -gt 1 ]]; do case "$1" in @@ -545,6 +546,9 @@ cprint() { noprefix) disable_prefix=true ;; + nonl) + disable_newline=true + ;; esac shift done @@ -566,11 +570,16 @@ cprint() { prefix="$styles$prefix" fi - printf "%b%b%s%b\n" "$prefix_text" "$prefix" "$text" "$RESET" + if [[ "$disable_newline" == true ]]; then + printf "%b%b%s%b" "$prefix_text" "$prefix" "$text" "$RESET" + else + printf "%b%b%s%b\n" "$prefix_text" "$prefix" "$text" "$RESET" + fi } + # Permission check before proceed with installation permission_barrier() { if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then @@ -897,7 +906,7 @@ download_mcsm() { # Prepare user if needed prepare_user() { if [[ "$install_user" == "root" ]]; then - cprint cyan "✔ install_user is 'root' — skipping user creation." + cprint cyan "install_user is 'root' — skipping user creation." return 0 fi From b6a6d49427edda0493ffe572e3b514d7669e754d Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 03:50:42 -0400 Subject: [PATCH 316/463] optimize display --- setup.sh | 78 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/setup.sh b/setup.sh index f64b745..e102110 100644 --- a/setup.sh +++ b/setup.sh @@ -1217,24 +1217,26 @@ print_install_result() { clear &>/dev/null || true # Print ASCII banner - echo "______ _______________________ ___" - echo "___ |/ /_ ____/_ ___/__ |/ /_____ _____________ _______ _____________" - echo "__ /|_/ /_ / _____ \__ /|_/ /_ __ \`/_ __ \ __ \`/_ __ \`/ _ \_ ___/" - echo "_ / / / / /___ ____/ /_ / / / / /_/ /_ / / / /_/ /_ /_/ // __/ /" - echo "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" + cprint green noprefix "______ _______________________ ___" + cprint green noprefix "___ |/ /_ ____/_ ___/__ |/ /_____ _____________ _______ _____________" + cprint green noprefix "__ /|_/ /_ / _____ \__ /|_/ /_ __ \`/_ __ \ __ \`/_ __ \`/ _ \_ ___/" + cprint green noprefix "_ / / / / /___ ____/ /_ / / / / /_/ /_ / / / /_/ /_ /_/ // __/ /" + cprint green noprefix "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" echo "" # status summary - echo "Installed/Updated Components:" + cprint yellow noprefix "Installed/Updated Components:" if [[ "$install_daemon" == true && -n "$daemon_key" && -n "$daemon_port" ]]; then - echo "Daemon" + cprint cyan noprefix "Daemon" elif [[ "$install_daemon" == true ]]; then - echo "Daemon (partial, config not fully detected)" + cprint cyan noprefix nonl "Daemon " + cprint yellow noprefix "(partial, config not fully detected)" fi if [[ "$install_web" == true && -n "$web_port" ]]; then - echo "Web Interface" + cprint cyan noprefix "Web" elif [[ "$install_web" == true ]]; then - echo "Web Interface (partial, config not fully detected)" + cprint cyan noprefix nonl "Web " + cprint yellow noprefix "(partial, config not fully detected)" fi echo "" @@ -1249,56 +1251,64 @@ print_install_result() { local daemon_address="ws://$ip_address:${daemon_port:-Failed to Retrieve from Config file}" local daemon_key_display="${daemon_key:-Failed to Retrieve from Config file}" - echo "Daemon Address:" - echo " $daemon_address" - echo "Daemon Key:" - echo " $daemon_key_display" + cprint yellow noprefix "Daemon Address:" + cprint cyan noprefix " $daemon_address" + cprint yellow noprefix "Daemon Key:" + cprint cyan noprefix " $daemon_key_display" echo "" fi # Web info if [[ "$install_web" == true ]]; then local web_address="http://$ip_address:${web_port:-Failed to Retrieve from Config file}" - echo "HTTP Web Interface:" - echo " $web_address (open in browser)" + cprint yellow noprefix "HTTP Web Interface:" + cprint cyan noprefix " $web_address (open in browser)" echo "" fi # Port guidance - echo "NOTE:" - echo " Make sure to expose the above ports through your firewall." - echo " If accessing from outside your network, you may need to configure port forwarding on your router." + cprint yellow noprefix "NOTE:" + cprint cyan noprefix " Make sure to expose the above ports through your firewall." + cprint cyan noprefix " If accessing from outside your network, you may need to configure port forwarding on your router." echo "" # Service management help - echo "Service Management Commands:" + cprint yellow noprefix "Service Management Commands:" if [[ "$install_daemon" == true ]]; then - echo " systemctl start mcsm-daemon.service" - echo " systemctl stop mcsm-daemon.service" - echo " systemctl restart mcsm-daemon.service" - echo " systemctl status mcsm-daemon.service" + cprint green noprefix nonl " systemctl start " + cprint cyan noprefix "mcsm-daemon.service" + cprint green noprefix nonl " systemctl stop " + cprint cyan noprefix "mcsm-daemon.service" + cprint green noprefix nonl " systemctl restart " + cprint cyan noprefix "mcsm-daemon.service" + cprint green noprefix nonl " systemctl status " + cprint cyan noprefix "mcsm-daemon.service" fi if [[ "$install_web" == true ]]; then - echo " systemctl start mcsm-web.service" - echo " systemctl stop mcsm-web.service" - echo " systemctl restart mcsm-web.service" - echo " systemctl status mcsm-web.service" + cprint green noprefix nonl " systemctl start " + cprint cyan noprefix "mcsm-web.service" + cprint green noprefix nonl " systemctl stop " + cprint cyan noprefix "mcsm-web.service" + cprint green noprefix nonl " systemctl restart " + cprint cyan noprefix "mcsm-web.service" + cprint green noprefix nonl " systemctl status " + cprint cyan noprefix "mcsm-web.service" fi echo "" # Official doc - echo "Official Documentation:" - echo " https://docs.mcsmanager.com/" + cprint yellow noprefix "Official Documentation:" + cprint cyan noprefix " https://docs.mcsmanager.com/" echo "" # HTTPS support - echo "Need HTTPS?" - echo " To enable secure HTTPS access, configure a reverse proxy:" - echo " https://docs.mcsmanager.com/ops/proxy_https.html" + cprint yellow noprefix "Need HTTPS?" + cprint cyan noprefix " To enable secure HTTPS access, configure a reverse proxy:" + cprint cyan noprefix " https://docs.mcsmanager.com/ops/proxy_https.html" echo "" # Closing message - echo "Installation completed. Enjoy managing your servers with MCSManager!" + cprint green noprefix "Installation completed. Enjoy managing your servers with MCSManager!" echo "" } From a7de08e366f13cf09ea9e0049dd198e3d49d4a19 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 03:59:02 -0400 Subject: [PATCH 317/463] optimize display --- setup.sh | 93 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/setup.sh b/setup.sh index e102110..0144b56 100644 --- a/setup.sh +++ b/setup.sh @@ -180,13 +180,13 @@ check_root() { # Using Bash's built-in EUID variable if [ -n "$EUID" ]; then if [ "$EUID" -ne 0 ]; then - echo "Error: This script must be run as root. Please use sudo or switch to the root user." + cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." exit 1 fi else # Fallback to using id -u if EUID is unavailable (e.g., non-Bash shell or misconfigured environment) if [ "$(id -u)" -ne 0 ]; then - echo "Error: This script must be run as root. Please use sudo or switch to the root user." + cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." exit 1 fi fi @@ -207,15 +207,15 @@ detect_terminal_capabilities() { fi if [ "$SUPPORTS_COLOR" = true ]; then - echo "[OK] Terminal supports colored output." + cprint green "[OK] Terminal supports colored output." else - echo "Note: Terminal does not support colored output. Continuing without formatting." + cprint yellow "Note: Terminal does not support colored output. Continuing without formatting." fi if [ "$SUPPORTS_STYLE" = true ]; then - echo "[OK] Terminal supports bold and underline formatting." + cprint green "[OK] Terminal supports bold and underline formatting." else - echo "Note: Terminal does not support advanced text styles." + cprint yellow "Note: Terminal does not support advanced text styles." fi } @@ -473,8 +473,8 @@ detect_os_info() { version="unknown" fi - echo "Detected OS: $distro $version_full" - echo "Detected Architecture: $arch" + cprint cyan "Detected OS: $distro $version_full" + cprint cyan "Detected Architecture: $arch" } @@ -493,7 +493,7 @@ check_supported_os() { return 1 fi - echo "OS compatibility check passed." + cprint green "OS compatibility check passed." return 0 } @@ -513,7 +513,7 @@ check_required_commands() { return 1 fi - echo "All required commands are available." + cprint green "All required commands are available." return 0 } @@ -834,7 +834,7 @@ download_mcsm() { local primary_url="${download_base_url}${archive_name}" local fallback="$download_fallback_url" - cprint cyan bold "➡ Downloading MCSManager package..." + cprint cyan bold "Downloading MCSManager package..." # Step 1: Try downloading from primary URL if ! wget --progress=bar:force -O "$archive_path" "$primary_url"; then @@ -1217,26 +1217,26 @@ print_install_result() { clear &>/dev/null || true # Print ASCII banner - cprint green noprefix "______ _______________________ ___" - cprint green noprefix "___ |/ /_ ____/_ ___/__ |/ /_____ _____________ _______ _____________" - cprint green noprefix "__ /|_/ /_ / _____ \__ /|_/ /_ __ \`/_ __ \ __ \`/_ __ \`/ _ \_ ___/" - cprint green noprefix "_ / / / / /___ ____/ /_ / / / / /_/ /_ / / / /_/ /_ /_/ // __/ /" - cprint green noprefix "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" + cprint white noprefix "______ _______________________ ___" + cprint white noprefix "___ |/ /_ ____/_ ___/__ |/ /_____ _____________ _______ _____________" + cprint white noprefix "__ /|_/ /_ / _____ \__ /|_/ /_ __ \`/_ __ \ __ \`/_ __ \`/ _ \_ ___/" + cprint white noprefix "_ / / / / /___ ____/ /_ / / / / /_/ /_ / / / /_/ /_ /_/ // __/ /" + cprint white noprefix "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" echo "" # status summary - cprint yellow noprefix "Installed/Updated Components:" + cprint green noprefix "Installed/Updated Components:" if [[ "$install_daemon" == true && -n "$daemon_key" && -n "$daemon_port" ]]; then - cprint cyan noprefix "Daemon" + cprint yellow noprefix "Daemon" elif [[ "$install_daemon" == true ]]; then - cprint cyan noprefix nonl "Daemon " - cprint yellow noprefix "(partial, config not fully detected)" + cprint yellow noprefix nonl "Daemon " + cprint red noprefix "(partial, config not fully detected)" fi if [[ "$install_web" == true && -n "$web_port" ]]; then - cprint cyan noprefix "Web" + cprint yellow noprefix "Web" elif [[ "$install_web" == true ]]; then - cprint cyan noprefix nonl "Web " - cprint yellow noprefix "(partial, config not fully detected)" + cprint yellow noprefix nonl "Web " + cprint red noprefix "(partial, config not fully detected)" fi echo "" @@ -1251,60 +1251,61 @@ print_install_result() { local daemon_address="ws://$ip_address:${daemon_port:-Failed to Retrieve from Config file}" local daemon_key_display="${daemon_key:-Failed to Retrieve from Config file}" - cprint yellow noprefix "Daemon Address:" - cprint cyan noprefix " $daemon_address" - cprint yellow noprefix "Daemon Key:" - cprint cyan noprefix " $daemon_key_display" + cprint green noprefix "Daemon Address:" + cprint white noprefix " $daemon_address" + cprint green noprefix "Daemon Key:" + cprint white noprefix " $daemon_key_display" echo "" fi # Web info if [[ "$install_web" == true ]]; then local web_address="http://$ip_address:${web_port:-Failed to Retrieve from Config file}" - cprint yellow noprefix "HTTP Web Interface:" - cprint cyan noprefix " $web_address (open in browser)" + cprint green noprefix "HTTP Web Interface:" + cprint white noprefix nonl" $web_address " + cprint yellow noprefix"(open in browser)" echo "" fi # Port guidance - cprint yellow noprefix "NOTE:" + cprint green noprefix "NOTE:" cprint cyan noprefix " Make sure to expose the above ports through your firewall." cprint cyan noprefix " If accessing from outside your network, you may need to configure port forwarding on your router." echo "" # Service management help - cprint yellow noprefix "Service Management Commands:" + cprint green noprefix "Service Management Commands:" if [[ "$install_daemon" == true ]]; then cprint green noprefix nonl " systemctl start " - cprint cyan noprefix "mcsm-daemon.service" + cprint yellow noprefix "mcsm-daemon.service" cprint green noprefix nonl " systemctl stop " - cprint cyan noprefix "mcsm-daemon.service" + cprint yellow noprefix "mcsm-daemon.service" cprint green noprefix nonl " systemctl restart " - cprint cyan noprefix "mcsm-daemon.service" + cprint yellow noprefix "mcsm-daemon.service" cprint green noprefix nonl " systemctl status " - cprint cyan noprefix "mcsm-daemon.service" + cprint yellow noprefix "mcsm-daemon.service" fi if [[ "$install_web" == true ]]; then cprint green noprefix nonl " systemctl start " - cprint cyan noprefix "mcsm-web.service" + cprint yellow noprefix "mcsm-web.service" cprint green noprefix nonl " systemctl stop " - cprint cyan noprefix "mcsm-web.service" + cprint yellow noprefix "mcsm-web.service" cprint green noprefix nonl " systemctl restart " - cprint cyan noprefix "mcsm-web.service" + cprint yellow noprefix "mcsm-web.service" cprint green noprefix nonl " systemctl status " - cprint cyan noprefix "mcsm-web.service" + cprint yellow noprefix "mcsm-web.service" fi echo "" # Official doc - cprint yellow noprefix "Official Documentation:" - cprint cyan noprefix " https://docs.mcsmanager.com/" + cprint green noprefix "Official Documentation:" + cprint white noprefix " https://docs.mcsmanager.com/" echo "" # HTTPS support - cprint yellow noprefix "Need HTTPS?" - cprint cyan noprefix " To enable secure HTTPS access, configure a reverse proxy:" - cprint cyan noprefix " https://docs.mcsmanager.com/ops/proxy_https.html" + cprint green noprefix "Need HTTPS?" + cprint yellow noprefix " To enable secure HTTPS access, configure a reverse proxy:" + cprint white noprefix " https://docs.mcsmanager.com/ops/proxy_https.html" echo "" # Closing message @@ -1357,7 +1358,7 @@ install_mcsm() { main() { trap 'echo "Unexpected error occurred."; exit 99' ERR - + safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" safe_run check_root "Script must be run as root" safe_run parse_args "Failed to parse arguments" "$@" safe_run detect_os_info "Failed to detect OS" @@ -1366,7 +1367,7 @@ main() { safe_run resolve_node_arch "Failed to resolve Node.js architecture" safe_run check_required_commands "Missing required system commands" - safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" + safe_run check_node_installed "Failed to detect Node.js or npm at expected path. Node.js will be installed." if [ "$install_node" = true ]; then safe_run install_node "Node.js installation failed" From 035a09b10e6fb2014592af15decd352b0e68402e Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 04:01:31 -0400 Subject: [PATCH 318/463] optimize printed result --- setup.sh | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/setup.sh b/setup.sh index 0144b56..2eb4df0 100644 --- a/setup.sh +++ b/setup.sh @@ -1224,7 +1224,7 @@ print_install_result() { cprint white noprefix "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" echo "" # status summary - cprint green noprefix "Installed/Updated Components:" + cprint cyan noprefix "Installed/Updated Components:" if [[ "$install_daemon" == true && -n "$daemon_key" && -n "$daemon_port" ]]; then cprint yellow noprefix "Daemon" elif [[ "$install_daemon" == true ]]; then @@ -1251,9 +1251,9 @@ print_install_result() { local daemon_address="ws://$ip_address:${daemon_port:-Failed to Retrieve from Config file}" local daemon_key_display="${daemon_key:-Failed to Retrieve from Config file}" - cprint green noprefix "Daemon Address:" + cprint cyan noprefix "Daemon Address:" cprint white noprefix " $daemon_address" - cprint green noprefix "Daemon Key:" + cprint cyan noprefix "Daemon Key:" cprint white noprefix " $daemon_key_display" echo "" fi @@ -1261,50 +1261,50 @@ print_install_result() { # Web info if [[ "$install_web" == true ]]; then local web_address="http://$ip_address:${web_port:-Failed to Retrieve from Config file}" - cprint green noprefix "HTTP Web Interface:" + cprint cyan noprefix "HTTP Web Interface:" cprint white noprefix nonl" $web_address " - cprint yellow noprefix"(open in browser)" + cprint yellow noprefix "(open in browser)" echo "" fi # Port guidance - cprint green noprefix "NOTE:" - cprint cyan noprefix " Make sure to expose the above ports through your firewall." - cprint cyan noprefix " If accessing from outside your network, you may need to configure port forwarding on your router." + cprint yellow noprefix "NOTE:" + cprint white noprefix " Make sure to expose the above ports through your firewall." + cprint white noprefix " If accessing from outside your network, you may need to configure port forwarding on your router." echo "" # Service management help - cprint green noprefix "Service Management Commands:" + cprint cyan noprefix "Service Management Commands:" if [[ "$install_daemon" == true ]]; then - cprint green noprefix nonl " systemctl start " - cprint yellow noprefix "mcsm-daemon.service" - cprint green noprefix nonl " systemctl stop " - cprint yellow noprefix "mcsm-daemon.service" - cprint green noprefix nonl " systemctl restart " - cprint yellow noprefix "mcsm-daemon.service" - cprint green noprefix nonl " systemctl status " - cprint yellow noprefix "mcsm-daemon.service" + cprint yellow noprefix nonl " systemctl start " + cprint white noprefix "mcsm-daemon.service" + cprint yellow noprefix nonl " systemctl stop " + cprint white noprefix "mcsm-daemon.service" + cprint yellow noprefix nonl " systemctl restart " + cprint white noprefix "mcsm-daemon.service" + cprint yellow noprefix nonl " systemctl status " + cprint white noprefix "mcsm-daemon.service" fi if [[ "$install_web" == true ]]; then - cprint green noprefix nonl " systemctl start " - cprint yellow noprefix "mcsm-web.service" - cprint green noprefix nonl " systemctl stop " - cprint yellow noprefix "mcsm-web.service" - cprint green noprefix nonl " systemctl restart " - cprint yellow noprefix "mcsm-web.service" - cprint green noprefix nonl " systemctl status " - cprint yellow noprefix "mcsm-web.service" + cprint yellow noprefix nonl " systemctl start " + cprint white noprefix "mcsm-web.service" + cprint yellow noprefix nonl " systemctl stop " + cprint white noprefix "mcsm-web.service" + cprint yellow noprefix nonl " systemctl restart " + cprint white noprefix "mcsm-web.service" + cprint yellow noprefix nonl " systemctl status " + cprint white noprefix "mcsm-web.service" fi echo "" # Official doc - cprint green noprefix "Official Documentation:" + cprint cyan noprefix "Official Documentation:" cprint white noprefix " https://docs.mcsmanager.com/" echo "" # HTTPS support - cprint green noprefix "Need HTTPS?" - cprint yellow noprefix " To enable secure HTTPS access, configure a reverse proxy:" + cprint cyan noprefix "Need HTTPS?" + cprint white noprefix " To enable secure HTTPS access, configure a reverse proxy:" cprint white noprefix " https://docs.mcsmanager.com/ops/proxy_https.html" echo "" From b4dfa7c4aefdab41edbdfbe295d09f1ef672694e Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 04:04:06 -0400 Subject: [PATCH 319/463] optimize result printed --- setup.sh | 60 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/setup.sh b/setup.sh index 2eb4df0..67a71cf 100644 --- a/setup.sh +++ b/setup.sh @@ -1224,19 +1224,19 @@ print_install_result() { cprint white noprefix "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" echo "" # status summary - cprint cyan noprefix "Installed/Updated Components:" + cprint yellow noprefix "Installed/Updated Components:" if [[ "$install_daemon" == true && -n "$daemon_key" && -n "$daemon_port" ]]; then - cprint yellow noprefix "Daemon" + cprint white noprefix "Daemon" elif [[ "$install_daemon" == true ]]; then - cprint yellow noprefix nonl "Daemon " - cprint red noprefix "(partial, config not fully detected)" + cprint white noprefix nonl "Daemon " + cprint yellow noprefix "(partial, config not fully detected)" fi if [[ "$install_web" == true && -n "$web_port" ]]; then - cprint yellow noprefix "Web" + cprint white noprefix "Web" elif [[ "$install_web" == true ]]; then - cprint yellow noprefix nonl "Web " - cprint red noprefix "(partial, config not fully detected)" + cprint white noprefix nonl "Web " + cprint yellow noprefix "(partial, config not fully detected)" fi echo "" @@ -1251,9 +1251,9 @@ print_install_result() { local daemon_address="ws://$ip_address:${daemon_port:-Failed to Retrieve from Config file}" local daemon_key_display="${daemon_key:-Failed to Retrieve from Config file}" - cprint cyan noprefix "Daemon Address:" + cprint yellow noprefix "Daemon Address:" cprint white noprefix " $daemon_address" - cprint cyan noprefix "Daemon Key:" + cprint yellow noprefix "Daemon Key:" cprint white noprefix " $daemon_key_display" echo "" fi @@ -1261,8 +1261,8 @@ print_install_result() { # Web info if [[ "$install_web" == true ]]; then local web_address="http://$ip_address:${web_port:-Failed to Retrieve from Config file}" - cprint cyan noprefix "HTTP Web Interface:" - cprint white noprefix nonl" $web_address " + cprint yellow noprefix "HTTP Web Interface:" + cprint white noprefix nonl " $web_address " cprint yellow noprefix "(open in browser)" echo "" fi @@ -1274,36 +1274,36 @@ print_install_result() { echo "" # Service management help - cprint cyan noprefix "Service Management Commands:" + cprint yellow noprefix "Service Management Commands:" if [[ "$install_daemon" == true ]]; then - cprint yellow noprefix nonl " systemctl start " - cprint white noprefix "mcsm-daemon.service" - cprint yellow noprefix nonl " systemctl stop " - cprint white noprefix "mcsm-daemon.service" - cprint yellow noprefix nonl " systemctl restart " - cprint white noprefix "mcsm-daemon.service" - cprint yellow noprefix nonl " systemctl status " - cprint white noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl start " + cprint yellow noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl stop " + cprint yellow noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl restart " + cprint yellow noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl status " + cprint yellow noprefix "mcsm-daemon.service" fi if [[ "$install_web" == true ]]; then - cprint yellow noprefix nonl " systemctl start " - cprint white noprefix "mcsm-web.service" - cprint yellow noprefix nonl " systemctl stop " - cprint white noprefix "mcsm-web.service" - cprint yellow noprefix nonl " systemctl restart " - cprint white noprefix "mcsm-web.service" - cprint yellow noprefix nonl " systemctl status " - cprint white noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl start " + cprint yellow noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl stop " + cprint yellow noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl restart " + cprint yellow noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl status " + cprint yellow noprefix "mcsm-web.service" fi echo "" # Official doc - cprint cyan noprefix "Official Documentation:" + cprint yellow noprefix "Official Documentation:" cprint white noprefix " https://docs.mcsmanager.com/" echo "" # HTTPS support - cprint cyan noprefix "Need HTTPS?" + cprint yellow noprefix "Need HTTPS?" cprint white noprefix " To enable secure HTTPS access, configure a reverse proxy:" cprint white noprefix " https://docs.mcsmanager.com/ops/proxy_https.html" echo "" From 8923455a6fdbeec2a31fe2fde86a94d19f6eef95 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 22 May 2025 04:04:34 -0400 Subject: [PATCH 320/463] clear console after install --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 67a71cf..f6157fa 100644 --- a/setup.sh +++ b/setup.sh @@ -1214,7 +1214,7 @@ cleanup_install_tmp() { print_install_result() { # Clear the screen - clear &>/dev/null || true + clear || true # Print ASCII banner cprint white noprefix "______ _______________________ ___" From 80c7102ba47d31bd5b8d5785d713ff1766f65eff Mon Sep 17 00:00:00 2001 From: SkyKing_PX Date: Thu, 22 May 2025 11:17:58 +0000 Subject: [PATCH 321/463] Add Purpur 1.21.5 Build --- templates.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/templates.json b/templates.json index a02e914..7efb6be 100644 --- a/templates.json +++ b/templates.json @@ -11,6 +11,25 @@ } ], "packages": [ + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.5 Purpur", + "title": "Minecraft 1.21.5", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "55MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.5-2434.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.5-2434.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "[Purpur] Minecraft 1.21.4 Purpur", From 7661b48184a3a8c85fe70e61f36c154b5f38abca Mon Sep 17 00:00:00 2001 From: SkyKing_PX Date: Thu, 22 May 2025 11:18:57 +0000 Subject: [PATCH 322/463] Update Paper 1.21.4 Build --- templates.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates.json b/templates.json index 7efb6be..63e26e6 100644 --- a/templates.json +++ b/templates.json @@ -228,11 +228,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/227/downloads/paper-1.21.4-227.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/231/downloads/paper-1.21.4-231.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-227.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-231.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", From fb95f62a082d0d868ad74d0d44d4d4898dac00d5 Mon Sep 17 00:00:00 2001 From: shane0411 Date: Sun, 25 May 2025 18:52:13 +0800 Subject: [PATCH 323/463] =?UTF-8?q?revert:=20=E5=8F=96=E6=B6=88=E5=B0=8Dwe?= =?UTF-8?q?b=E7=9A=84=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- daemon/setup.sh | 4 +--- daemon/setup_cn.sh | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/daemon/setup.sh b/daemon/setup.sh index 3456253..a0ed362 100644 --- a/daemon/setup.sh +++ b/daemon/setup.sh @@ -81,7 +81,7 @@ Install_MCSManager() { systemctl disable --now mcsm-{web,daemon} # delete service - rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + rm -rf /etc/systemd/system/mcsm-daemon.service systemctl daemon-reload mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" @@ -100,8 +100,6 @@ Install_MCSManager() { rm -rf /opt/mcsmanager/mcsmanager fi - rm -rf "${mcsmanager_install_path}/web" - # echo "[→] cd daemon" cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" diff --git a/daemon/setup_cn.sh b/daemon/setup_cn.sh index 8726b5c..aacb7b4 100644 --- a/daemon/setup_cn.sh +++ b/daemon/setup_cn.sh @@ -82,7 +82,7 @@ Install_MCSManager() { systemctl disable --now mcsm-{web,daemon} # delete service - rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + rm -rf /etc/systemd/system/mcsm-daemon.service systemctl daemon-reload mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" @@ -101,8 +101,6 @@ Install_MCSManager() { rm -rf /opt/mcsmanager/mcsmanager fi - rm -rf "${mcsmanager_install_path}/web" - # echo "[→] cd daemon" cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" From 5eaee9f8d1f1b48f169f72523dd844c1cad3b0df Mon Sep 17 00:00:00 2001 From: KUMAKAIHA Date: Sun, 22 Jun 2025 20:08:48 +0800 Subject: [PATCH 324/463] Auto install Brew --- setup_macOS.sh | 17 +++++++++++++++++ setup_macOS_cn.sh | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/setup_macOS.sh b/setup_macOS.sh index f711303..ebbc02f 100644 --- a/setup_macOS.sh +++ b/setup_macOS.sh @@ -15,6 +15,13 @@ echo "Automatically checking and installing required dependencies (brew, node, n if ! command -v brew &> /dev/null; then echo "Homebrew not found, installing Homebrew..." /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + if [ -x "/opt/homebrew/bin/brew" ]; then + eval "$(/opt/homebrew/bin/brew shellenv)" + export PATH="/opt/homebrew/bin:$PATH" + elif [ -x "/usr/local/bin/brew" ]; then + eval "$(/usr/local/bin/brew shellenv)" + export PATH="/usr/local/bin:$PATH" + fi if ! command -v brew &> /dev/null; then echo "Error: Homebrew installation failed." exit 1 @@ -24,6 +31,8 @@ fi if ! command -v node &> /dev/null; then echo "Node.js not found, installing Node.js via Homebrew..." brew install node + export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + hash -r if ! command -v node &> /dev/null; then echo "Error: Node.js installation failed." exit 1 @@ -33,6 +42,8 @@ fi if ! command -v npm &> /dev/null; then echo "npm not found, reinstalling Node.js via Homebrew..." brew install node + export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + hash -r if ! command -v npm &> /dev/null; then echo "Error: npm installation failed." exit 1 @@ -42,6 +53,8 @@ fi if ! command -v curl &> /dev/null; then echo "curl not found, installing curl via Homebrew..." brew install curl + export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + hash -r if ! command -v curl &> /dev/null; then echo "Error: curl installation failed." exit 1 @@ -51,6 +64,8 @@ fi if ! command -v tar &> /dev/null; then echo "tar not found, installing tar via Homebrew..." brew install tar + export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + hash -r if ! command -v tar &> /dev/null; then echo "Error: tar installation failed." exit 1 @@ -60,6 +75,8 @@ fi if ! command -v pm2 &> /dev/null; then echo "PM2 not found, installing PM2 globally..." npm install -g pm2 + export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + hash -r if ! command -v pm2 &> /dev/null; then echo "Error: PM2 installation failed. Please run 'npm install -g pm2' manually." exit 1 diff --git a/setup_macOS_cn.sh b/setup_macOS_cn.sh index abcc950..3a71b86 100644 --- a/setup_macOS_cn.sh +++ b/setup_macOS_cn.sh @@ -15,6 +15,13 @@ echo "将自动检测并安装所需依赖 (brew, node, npm, curl, tar, pm2)..." if ! command -v brew &> /dev/null; then echo "未检测到 Homebrew,正在自动安装 Homebrew..." /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + if [ -x "/opt/homebrew/bin/brew" ]; then + eval "$(/opt/homebrew/bin/brew shellenv)" + export PATH="/opt/homebrew/bin:$PATH" + elif [ -x "/usr/local/bin/brew" ]; then + eval "$(/usr/local/bin/brew shellenv)" + export PATH="/usr/local/bin:$PATH" + fi if ! command -v brew &> /dev/null; then echo "错误: Homebrew 安装失败。" exit 1 @@ -24,6 +31,8 @@ fi if ! command -v node &> /dev/null; then echo "未检测到 Node.js,正在通过 Homebrew 安装 Node.js..." brew install node + export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + hash -r if ! command -v node &> /dev/null; then echo "错误: Node.js 安装失败。" exit 1 @@ -33,6 +42,8 @@ fi if ! command -v npm &> /dev/null; then echo "未检测到 npm,正在通过 Homebrew 重新安装 Node.js..." brew install node + export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + hash -r if ! command -v npm &> /dev/null; then echo "错误: npm 安装失败。" exit 1 @@ -42,6 +53,8 @@ fi if ! command -v curl &> /dev/null; then echo "未检测到 curl,正在通过 Homebrew 安装 curl..." brew install curl + export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + hash -r if ! command -v curl &> /dev/null; then echo "错误: curl 安装失败。" exit 1 @@ -51,6 +64,8 @@ fi if ! command -v tar &> /dev/null; then echo "未检测到 tar,正在通过 Homebrew 安装 tar..." brew install tar + export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + hash -r if ! command -v tar &> /dev/null; then echo "错误: tar 安装失败。" exit 1 @@ -60,6 +75,8 @@ fi if ! command -v pm2 &> /dev/null; then echo "未检测到 PM2,正在全局安装 PM2..." npm install -g pm2 + export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" + hash -r if ! command -v pm2 &> /dev/null; then echo "错误: PM2 安装失败。请手动运行 'npm install -g pm2'。" exit 1 From 0abdd2afede90938a1b956b656cc2460888ae3b1 Mon Sep 17 00:00:00 2001 From: SkyKingPX Date: Mon, 21 Jul 2025 11:04:51 +0200 Subject: [PATCH 325/463] Update Modloader and Plugin Software --- templates.json | 230 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 210 insertions(+), 20 deletions(-) diff --git a/templates.json b/templates.json index 63e26e6..cbfb42b 100644 --- a/templates.json +++ b/templates.json @@ -11,6 +11,44 @@ } ], "packages": [ + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.8 Purpur", + "title": "Minecraft 1.21.8", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "55MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.6 Purpur", + "title": "Minecraft 1.21.6", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "55MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.6-2465.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.6-2465.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "[Purpur] Minecraft 1.21.5 Purpur", @@ -19,11 +57,11 @@ "hardware": "RAM 4G+", "size": "55MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.5-2434.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.5-2450.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.5-2434.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.5-2450.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -220,6 +258,44 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.21.8 Paper", + "title": "Minecraft 1.21.8", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/10/downloads/paper-1.21.8-10.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-10.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.21.6 Paper", + "title": "Minecraft 1.21.6", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.6/builds/48/downloads/paper-1.21.4-48.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.6-48.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "[Paper] Minecraft 1.21.4 Paper", @@ -228,11 +304,11 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/231/downloads/paper-1.21.4-231.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-231.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-232.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -486,6 +562,44 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "NeoForge 1.21.8 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.4-beta/neoforge-21.8.4-beta-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.8.4-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "NeoForge 1.21.6 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.6.20-beta/neoforge-21.6.20-beta-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.6.20-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", @@ -494,13 +608,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.5.63-beta/neoforge-21.5.63-beta-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.5.87/neoforge-21.5.87-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.5.63-beta-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.5.87-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -513,13 +627,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.135/neoforge-21.4.135-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.147/neoforge-21.4.147-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.4.135-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.4.147-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -532,13 +646,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.169/neoforge-21.1.169-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.193/neoforge-21.1.193-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.1.169-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.1.193-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -551,13 +665,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.6.135/neoforge-20.6.135-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.6.137/neoforge-20.6.137-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-20.6.135-installer.jar --installServer", + "updateCommand": "java -jar neoforge-20.6.137-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -600,6 +714,44 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "Forge 1.21.8 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.0.0/forge-1.21.8-58.0.0-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.8-58.0.0-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "Forge 1.21.6 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.6-56.0.9/forge-1.21.6-56.0.9-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.6-56.0.9-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", @@ -608,13 +760,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.5-55.0.9/forge-1.21.5-55.0.9-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.5-55.0.23/forge-1.21.5-55.0.23-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.5-55.0.9-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.5-55.0.23-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -646,13 +798,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.0/forge-1.21.1-52.0.53-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.1/forge-1.21.1-52.1.1-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.1-52.1.0-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.1-52.1.1-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -703,13 +855,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.4.0/forge-1.20.1-47.4.0-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.4.4/forge-1.20.1-47.4.4-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.1-47.4.0-installer.jar --installServer", + "updateCommand": "java -jar forge-1.20.1-47.4.4-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -866,6 +1018,44 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "description": "Minecraft 1.21.8 with Fabric Loader", + "title": "Fabric 1.21.8 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.8 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.21.6 with Fabric Loader", + "title": "Fabric 1.21.6 (Supports Mods)", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.6 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "Minecraft 1.21.5 with Fabric Loader", @@ -880,7 +1070,7 @@ "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.5 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.5 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -899,7 +1089,7 @@ "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.1.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } From 1ad13b29f35cef202dc93a9928f14b7431fde129 Mon Sep 17 00:00:00 2001 From: SkyKingPX Date: Mon, 21 Jul 2025 19:19:53 +0200 Subject: [PATCH 326/463] Update Vanilla Templates --- templates.json | 62 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/templates.json b/templates.json index cbfb42b..e902033 100644 --- a/templates.json +++ b/templates.json @@ -1303,6 +1303,44 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.21.8", + "title": "Minecraft 1.21.8", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.21.6", + "title": "Minecraft 1.21.6", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/6e64dcabba3c01a7271b4fa6bd898483b794c59b/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "description": "[Vanilla] Minecraft 1.21.5", @@ -1312,7 +1350,7 @@ "size": "55MB", "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/e6ec2f64e6080b9b5d9b471b291c33cc7f509733/server.jar", - "author": "Mojang", + "author": "Mojang Studios", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1331,7 +1369,7 @@ "size": "55MB", "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar", - "author": "Mojang", + "author": "Mojang Studios", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1350,7 +1388,7 @@ "size": "50MB", "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/59353fb40c36d304f2035d51e7d6e6baa98dc05c/server.jar", - "author": "Mojang", + "author": "Mojang Studios", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1369,7 +1407,7 @@ "size": "50MB", "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/145ff0858209bcfc164859ba735d4199aafa1eea/server.jar", - "author": "Mojang", + "author": "Mojang Studios", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1388,7 +1426,7 @@ "size": "50MB", "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/8dd1a28015f51b1803213892b50b7b4fc76e594d/server.jar", - "author": "Mojang", + "author": "Mojang Studios", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1407,7 +1445,7 @@ "size": "50MB", "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/84194a2f286ef7c14ed7ce0090dba59902951553/server.jar", - "author": "Mojang", + "author": "Mojang Studios", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1426,7 +1464,7 @@ "size": "50MB", "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/8f3112a1049751cc472ec13e397eade5336ca7ae/server.jar", - "author": "Mojang", + "author": "Mojang Studios", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1445,7 +1483,7 @@ "size": "45MB", "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/c8f83c5655308435b3dcf03c06d9fe8740a77469/server.jar", - "author": "Mojang", + "author": "Mojang Studios", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1464,7 +1502,7 @@ "size": "45MB", "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/a16d67e5807f57fc4e550299cf20226194497dc2/server.jar", - "author": "Mojang", + "author": "Mojang Studios", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1483,7 +1521,7 @@ "size": "45MB", "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/1b557e7b033b583cd9f66746b7a9ab1ec1673ced/server.jar", - "author": "Mojang", + "author": "Mojang Studios", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1502,7 +1540,7 @@ "size": "30MB", "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/886945bfb2b978778c3a0288fd7fab09d315b25f/server.jar", - "author": "Mojang", + "author": "Mojang Studios", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1521,7 +1559,7 @@ "size": "10MB", "remark": "Minecraft Java", "targetLink": "https://launcher.mojang.com/v1/objects/b58b2ceb36e01bcd8dbf49c8fb66c55a9f0676cd/server.jar", - "author": "Mojang", + "author": "Mojang Studios", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", From 037df45bb1fb6c0542162c641e3b44aa8fc9c274 Mon Sep 17 00:00:00 2001 From: SkyKingPX Date: Fri, 25 Jul 2025 17:37:16 +0200 Subject: [PATCH 327/463] Add Categories --- templates.json | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/templates.json b/templates.json index e902033..788d5de 100644 --- a/templates.json +++ b/templates.json @@ -15,6 +15,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.21.8 Purpur", "title": "Minecraft 1.21.8", + "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "55MB", @@ -34,6 +35,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.21.6 Purpur", "title": "Minecraft 1.21.6", + "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "55MB", @@ -53,6 +55,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.21.5 Purpur", "title": "Minecraft 1.21.5", + "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "55MB", @@ -72,6 +75,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.21.4 Purpur", "title": "Minecraft 1.21.4", + "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", @@ -91,6 +95,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.21.3 Purpur", "title": "Minecraft 1.21.3", + "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", @@ -110,6 +115,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.21.1 Purpur", "title": "Minecraft 1.21.1", + "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", @@ -129,6 +135,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.20.6 Purpur", "title": "Minecraft 1.20.6", + "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", @@ -148,6 +155,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.20.4 Purpur", "title": "Minecraft 1.20.4", + "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", @@ -167,6 +175,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.20.1 Purpur", "title": "Minecraft 1.20.1", + "category": "mc-purpur", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "50MB", @@ -186,6 +195,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.19.2 Purpur", "title": "Minecraft 1.19.2", + "category": "mc-purpur", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "50MB", @@ -205,6 +215,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.18.2 Purpur", "title": "Minecraft 1.18.2", + "category": "mc-purpur", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "50MB", @@ -224,6 +235,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.17.1 Purpur", "title": "Minecraft 1.17.1", + "category": "mc-purpur", "runtime": "Java 16+", "hardware": "RAM 4G+", "size": "50MB", @@ -243,6 +255,7 @@ "language": "en_us", "description": "[Purpur] Minecraft 1.16.5 Purpur", "title": "Minecraft 1.16.5", + "category": "mc-purpur", "runtime": "Java 8+", "hardware": "RAM 4G+", "size": "50MB", @@ -262,6 +275,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.21.8 Paper", "title": "Minecraft 1.21.8", + "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", @@ -281,6 +295,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.21.6 Paper", "title": "Minecraft 1.21.6", + "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", @@ -300,6 +315,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.21.4 Paper", "title": "Minecraft 1.21.4", + "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", @@ -319,6 +335,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.21.3 Paper", "title": "Minecraft 1.21.3", + "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", @@ -338,6 +355,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.21.1 Paper", "title": "Minecraft 1.21.1", + "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", @@ -357,6 +375,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.20.6 Paper", "title": "Minecraft 1.20.6", + "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", @@ -376,6 +395,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.20.4 Paper", "title": "Minecraft 1.20.4", + "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "50MB", @@ -395,6 +415,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.20.2 Paper", "title": "Minecraft 1.20.2", + "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "150MB", @@ -414,6 +435,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.20.1 Paper", "title": "Minecraft 1.20.1", + "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "200MB", @@ -433,6 +455,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.19.4 Paper", "title": "Minecraft 1.19.4", + "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "50MB", @@ -452,6 +475,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.19.2 Paper", "title": "Minecraft 1.19.2", + "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "50MB", @@ -471,6 +495,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.18.2 Paper", "title": "Minecraft 1.18.2", + "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "50MB", @@ -490,6 +515,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.17.1 Paper", "title": "Minecraft 1.17.1", + "category": "mc-paper", "runtime": "Java 16+", "hardware": "RAM 4G+", "size": "60MB", @@ -509,6 +535,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.16.5 Paper", "title": "Minecraft 1.16.5", + "category": "mc-paper", "runtime": "Java 8+", "hardware": "RAM 4G+", "size": "50MB", @@ -528,6 +555,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.12.2 Paper", "title": "Minecraft 1.12.2", + "category": "mc-paper", "runtime": "Java 8+", "hardware": "RAM 4G+", "size": "50MB", @@ -547,6 +575,7 @@ "language": "en_us", "description": "[Paper] Minecraft 1.8.8 Paper", "title": "Minecraft 1.8.8", + "category": "mc-paper", "runtime": "Java 7+", "hardware": "RAM 4G+", "size": "20MB", @@ -566,6 +595,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.21.8 (Supports Mods)", + "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -585,6 +615,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.21.6 (Supports Mods)", + "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -604,6 +635,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.21.5 (Supports Mods)", + "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -623,6 +655,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.21.4 (Supports Mods)", + "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -642,6 +675,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.21.1 (Supports Mods)", + "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -661,6 +695,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.20.6 (Supports Mods)", + "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -680,6 +715,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.20.4 (Supports Mods)", + "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -699,6 +735,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.20.2 (Supports Mods)", + "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -718,6 +755,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.8 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -737,6 +775,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.6 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -756,6 +795,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.5 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -775,6 +815,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.4 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -794,6 +835,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.1 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -813,6 +855,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.20.6 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -832,6 +875,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.20.4 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -851,6 +895,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.20.1 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", @@ -870,6 +915,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.19.4 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", @@ -889,6 +935,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.19.2 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", @@ -908,6 +955,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.18.2 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", @@ -927,6 +975,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.17.1 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 16+", "hardware": "RAM 8G+", "size": "7MB", @@ -946,6 +995,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.16.5 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 8+", "hardware": "RAM 8G+", "size": "7MB", @@ -965,6 +1015,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.12.2 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 8+", "hardware": "RAM 8G+", "size": "5MB", @@ -984,6 +1035,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.8.9 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 7+", "hardware": "RAM 8G+", "size": "5MB", @@ -1003,6 +1055,7 @@ "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.7.10 (Supports Mods)", + "category": "mc-forge", "runtime": "Java 7+", "hardware": "RAM 8G+", "size": "5MB", @@ -1022,6 +1075,7 @@ "language": "en_us", "description": "Minecraft 1.21.8 with Fabric Loader", "title": "Fabric 1.21.8 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", @@ -1041,6 +1095,7 @@ "language": "en_us", "description": "Minecraft 1.21.6 with Fabric Loader", "title": "Fabric 1.21.6 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", @@ -1060,6 +1115,7 @@ "language": "en_us", "description": "Minecraft 1.21.5 with Fabric Loader", "title": "Fabric 1.21.5 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", @@ -1079,6 +1135,7 @@ "language": "en_us", "description": "Minecraft 1.21.4 with Fabric Loader", "title": "Fabric 1.21.4 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", @@ -1098,6 +1155,7 @@ "language": "en_us", "description": "Minecraft 1.21.1 with Fabric Loader", "title": "Fabric 1.21.1 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", @@ -1117,6 +1175,7 @@ "language": "en_us", "description": "Minecraft 1.20.6 with Fabric Loader", "title": "Fabric 1.20.6 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", @@ -1136,6 +1195,7 @@ "language": "en_us", "description": "Minecraft 1.20.4 with Fabric Loader", "title": "Fabric 1.20.4 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "5MB", @@ -1155,6 +1215,7 @@ "language": "en_us", "description": "Minecraft 1.20.1 with Fabric Loader", "title": "Fabric 1.20.1 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "5MB", @@ -1174,6 +1235,7 @@ "language": "en_us", "description": "Minecraft 1.19.4 with Fabric Loader", "title": "Fabric 1.19.4 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "5MB", @@ -1193,6 +1255,7 @@ "language": "en_us", "description": "Minecraft 1.19.2 with Fabric Loader", "title": "Fabric 1.19.2 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "5MB", @@ -1212,6 +1275,7 @@ "language": "en_us", "description": "Minecraft 1.18.2 with Fabric Loader", "title": "Fabric 1.18.2 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "5MB", @@ -1231,6 +1295,7 @@ "language": "en_us", "description": "Minecraft 1.17.1 with Fabric Loader", "title": "Fabric 1.17.1 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 16+", "hardware": "RAM 4G+", "size": "5MB", @@ -1250,6 +1315,7 @@ "language": "en_us", "description": "Minecraft 1.16.5 with Fabric Loader", "title": "Fabric 1.16.5 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 8+", "hardware": "RAM 4G+", "size": "5MB", @@ -1269,6 +1335,7 @@ "language": "en_us", "description": "Minecraft 1.15.2 with Fabric Loader", "title": "Fabric 1.15.2 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 8+", "hardware": "RAM 4G+", "size": "5MB", @@ -1288,6 +1355,7 @@ "language": "en_us", "description": "Minecraft 1.14.4 with Fabric Loader", "title": "Fabric 1.14.4 (Supports Mods)", + "category": "mc-fabric", "runtime": "Java 8+", "hardware": "RAM 4G+", "size": "5MB", @@ -1307,6 +1375,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.21.8", "title": "Minecraft 1.21.8", + "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", "size": "55MB", @@ -1326,6 +1395,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.21.6", "title": "Minecraft 1.21.6", + "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", "size": "55MB", @@ -1345,6 +1415,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.21.5", "title": "Minecraft 1.21.5", + "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", "size": "55MB", @@ -1364,6 +1435,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.21.4", "title": "Minecraft 1.21.4", + "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", "size": "55MB", @@ -1383,6 +1455,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.21.1", "title": "Minecraft 1.21.1", + "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", "size": "50MB", @@ -1402,6 +1475,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.20.6", "title": "Minecraft 1.20.6", + "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", "size": "50MB", @@ -1421,6 +1495,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.20.4", "title": "Minecraft 1.20.4", + "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", "size": "50MB", @@ -1440,6 +1515,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.20.1", "title": "Minecraft 1.20.1", + "category": "mc-vanilla", "runtime": "Java 17+", "hardware": "RAM 2G+", "size": "50MB", @@ -1459,6 +1535,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.19.4", "title": "Minecraft 1.19.4", + "category": "mc-vanilla", "runtime": "Java 17+", "hardware": "RAM 2G+", "size": "50MB", @@ -1478,6 +1555,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.18.2", "title": "Minecraft 1.18.2", + "category": "mc-vanilla", "runtime": "Java 17+", "hardware": "RAM 2G+", "size": "45MB", @@ -1497,6 +1575,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.17.1", "title": "Minecraft 1.17.1", + "category": "mc-vanilla", "runtime": "Java 16+", "hardware": "RAM 2G+", "size": "45MB", @@ -1516,6 +1595,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.16.5", "title": "Minecraft 1.16.5", + "category": "mc-vanilla", "runtime": "Java 8+", "hardware": "RAM 2G+", "size": "45MB", @@ -1535,6 +1615,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.12.2", "title": "Minecraft 1.12.2", + "category": "mc-vanilla", "runtime": "Java 8+", "hardware": "RAM 2G+", "size": "30MB", @@ -1554,6 +1635,7 @@ "language": "en_us", "description": "[Vanilla] Minecraft 1.8.9", "title": "Minecraft 1.8.9", + "category": "mc-vanilla", "runtime": "Java 7+", "hardware": "RAM 2G+", "size": "10MB", @@ -1573,6 +1655,7 @@ "language": "zh_cn", "description": "[Paper] Minecraft 1.21.1 快速开服", "title": "Minecraft 1.20.1", + "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 4G+", "size": "250MB", @@ -1592,6 +1675,7 @@ "language": "zh_cn", "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", "title": "Minecraft 1.20.4 (低配机器推荐)", + "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 6G+", "size": "140MB", @@ -1611,6 +1695,7 @@ "language": "zh_cn", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "title": "Forge 1.20.1 Java 版 (支持模组)", + "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", @@ -1630,6 +1715,7 @@ "language": "zh_cn", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "title": "Forge 1.20.6 Java 版 (支持模组)", + "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "7MB", @@ -1649,6 +1735,7 @@ "language": "zh_cn", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "title": "Forge 1.19.2 Java 版 (支持模组)", + "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", "size": "7MB", From e708ab20127e5fd4b59404be6b86db9a9702230e Mon Sep 17 00:00:00 2001 From: yumao233 Date: Mon, 28 Jul 2025 14:38:36 +0800 Subject: [PATCH 328/463] feat: new test file --- templates-test.json | 1898 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1898 insertions(+) create mode 100644 templates-test.json diff --git a/templates-test.json b/templates-test.json new file mode 100644 index 0000000..5d90dc4 --- /dev/null +++ b/templates-test.json @@ -0,0 +1,1898 @@ +{ + "name": "MCSManager Game Server Template Marketplace", + "languages": [ + { + "label": "English", + "value": "en_us" + }, + { + "label": "简体中文", + "value": "zh_cn" + } + ], + "games": [ + { + "label": "Minecraft", + "value": "minecraft", + "language": "" + }, + { + "label": "幻兽帕鲁", + "value": "palworld", + "language": "zh_cn" + } + ], + "packages": [ + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.8 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.21.8", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "55MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.6 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.21.6", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "55MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.6-2465.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.6-2465.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.5 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.21.5", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "55MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.5-2450.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.5-2450.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.4 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.21.4", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2416.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2416.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.3 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.21.3", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.3-2358.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.3-2358.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.21.1 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.21.1", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.1-2329.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.1-2329.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.20.6 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.20.6", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.6-2233.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.20.6-2233.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.20.4 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.20.4", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.4-2176.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.20.4-2176.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.20.1 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.20.1", + "category": "mc-purpur", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.1-2062.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.20.1-2062.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.19.2 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.19.2", + "category": "mc-purpur", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.19.2-1858.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.19.2-1858.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.18.2 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.18.2", + "category": "mc-purpur", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.18.2-1632.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.18.2-1632.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.17.1 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.17.1", + "category": "mc-purpur", + "runtime": "Java 16+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.17.1-1428.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.17.1-1428.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Purpur] Minecraft 1.16.5 Purpur", + "gameType": "minecraft", + "title": "Minecraft 1.16.5", + "category": "mc-purpur", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.16.5-1171.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.16.5-1171.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.21.8 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.21.8", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/10/downloads/paper-1.21.8-10.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-10.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.21.6 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.21.6", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.6/builds/48/downloads/paper-1.21.4-48.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.6-48.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.21.4 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.21.4", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-232.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.21.3 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.21.3", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.3/builds/82/downloads/paper-1.21.3-82.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.3-82.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.21.1 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.21.1", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/132/downloads/paper-1.21.1-132.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.1-132.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.20.6 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.20.6", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.6/builds/151/downloads/paper-1.20.6-151.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.6-151.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.20.4 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.20.4", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/499/downloads/paper-1.20.4-499.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.4-499.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.20.2 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.20.2", + "category": "mc-paper", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "150MB", + "remark": "Includes some basic plugins", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.2/builds/318/downloads/paper-1.20.2-318.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.2-318.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.20.1 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.20.1", + "category": "mc-paper", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "200MB", + "remark": "Includes some basic plugins", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.1/builds/196/downloads/paper-1.20.1-196.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.1-196.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.19.4 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.19.4", + "category": "mc-paper", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.19.4/builds/550/downloads/paper-1.19.4-550.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.19.4-550.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.19.2 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.19.2", + "category": "mc-paper", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.19.2/builds/307/downloads/paper-1.19.2-307.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.19.2-307.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.18.2 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.18.2", + "category": "mc-paper", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.18.2/builds/388/downloads/paper-1.18.2-388.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.18.2-388.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.17.1 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.17.1", + "category": "mc-paper", + "runtime": "Java 16+", + "hardware": "RAM 4G+", + "size": "60MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.17.1/builds/411/downloads/paper-1.17.1-411.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.17.1-411.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.16.5 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.16.5", + "category": "mc-paper", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.16.5/builds/794/downloads/paper-1.16.5-794.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.16.5-794.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.12.2 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.12.2", + "category": "mc-paper", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.12.2/builds/1620/downloads/paper-1.12.2-1620.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.12.2-1620.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Paper] Minecraft 1.8.8 Paper", + "gameType": "minecraft", + "title": "Minecraft 1.8.8", + "category": "mc-paper", + "runtime": "Java 7+", + "hardware": "RAM 4G+", + "size": "20MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.8.8/builds/445/downloads/paper-1.8.8-445.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.8.8-445.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "NeoForge 1.21.8 (Supports Mods)", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.4-beta/neoforge-21.8.4-beta-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.8.4-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "NeoForge 1.21.6 (Supports Mods)", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.6.20-beta/neoforge-21.6.20-beta-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.6.20-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "NeoForge 1.21.5 (Supports Mods)", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.5.87/neoforge-21.5.87-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.5.87-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "NeoForge 1.21.4 (Supports Mods)", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.147/neoforge-21.4.147-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.4.147-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "NeoForge 1.21.1 (Supports Mods)", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.193/neoforge-21.1.193-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.1.193-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "NeoForge 1.20.6 (Supports Mods)", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.6.137/neoforge-20.6.137-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-20.6.137-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "NeoForge 1.20.4 (Supports Mods)", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.4.248/neoforge-20.4.248-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-20.4.248-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "NeoForge 1.20.2 (Supports Mods)", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.2.93/neoforge-20.2.93-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-20.2.93-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.21.8 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.0.0/forge-1.21.8-58.0.0-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.8-58.0.0-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.21.6 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.6-56.0.9/forge-1.21.6-56.0.9-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.6-56.0.9-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.21.5 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.5-55.0.23/forge-1.21.5-55.0.23-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.5-55.0.23-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.21.4 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.3/forge-1.21.4-54.1.3-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.4-54.1.3-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.21.1 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.1/forge-1.21.1-52.1.1-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.1-52.1.1-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.20.6 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.2.0/forge-1.20.6-50.2.0-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.20.6-50.2.0-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.20.4 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.4-49.2.0/forge-1.20.4-49.2.0-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.20.4-49.2.0-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.20.1 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.4.4/forge-1.20.1-47.4.4-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.20.1-47.4.4-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.19.4 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.4-45.4.0/forge-1.19.4-45.4.0-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.19.4-45.4.0-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.19.2 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.5.0/forge-1.19.2-43.5.0-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.19.2-43.5.0-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.18.2 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.3.9/forge-1.18.2-40.3.9-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.18.2-40.3.9-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.17.1 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 16+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.17.1-37.1.1/forge-1.17.1-37.1.1-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.17.1-37.1.1-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.16.5 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 8+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.16.5-36.2.42/forge-1.16.5-36.2.42-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.16.5-36.2.42-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.12.2 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 8+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.12.2-14.23.5.2860/forge-1.12.2-14.23.5.2860-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.12.2-14.23.5.2860-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.8.9 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 7+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.8.9-11.15.1.2318-1.8.9/forge-1.8.9-11.15.1.2318-1.8.9-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.8.9-11.15.1.2318-1.8.9-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "gameType": "minecraft", + "title": "Forge 1.7.10 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 7+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/forge-1.7.10-10.13.4.1614-1.7.10-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.7.10-10.13.4.1614-1.7.10-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.21.8 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.21.8 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.8 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.21.6 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.21.6 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.6 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.21.5 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.21.5 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.5 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.21.4 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.21.4 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.21.1 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.21.1 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.1 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.20.6 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.20.6 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.20.6 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.20.4 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.20.4 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.20.4 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.20.1 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.20.1 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.20.1 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.19.4 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.19.4 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.19.4 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.19.2 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.19.2 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.19.2 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.18.2 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.18.2 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.18.2 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.17.1 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.17.1 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 16+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.17.1 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.16.5 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.16.5 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.16.5 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.15.2 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.15.2 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.15.2 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "Minecraft 1.14.4 with Fabric Loader", + "gameType": "minecraft", + "title": "Fabric 1.14.4 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 8+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.14.4 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.21.8", + "gameType": "minecraft", + "title": "Minecraft 1.21.8", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.21.6", + "gameType": "minecraft", + "title": "Minecraft 1.21.6", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/6e64dcabba3c01a7271b4fa6bd898483b794c59b/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.21.5", + "gameType": "minecraft", + "title": "Minecraft 1.21.5", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/e6ec2f64e6080b9b5d9b471b291c33cc7f509733/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.21.4", + "gameType": "minecraft", + "title": "Minecraft 1.21.4", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.21.1", + "gameType": "minecraft", + "title": "Minecraft 1.21.1", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "50MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/59353fb40c36d304f2035d51e7d6e6baa98dc05c/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.20.6", + "gameType": "minecraft", + "title": "Minecraft 1.20.6", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "50MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/145ff0858209bcfc164859ba735d4199aafa1eea/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.20.4", + "gameType": "minecraft", + "title": "Minecraft 1.20.4", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "50MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/8dd1a28015f51b1803213892b50b7b4fc76e594d/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.20.1", + "gameType": "minecraft", + "title": "Minecraft 1.20.1", + "category": "mc-vanilla", + "runtime": "Java 17+", + "hardware": "RAM 2G+", + "size": "50MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/84194a2f286ef7c14ed7ce0090dba59902951553/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.19.4", + "gameType": "minecraft", + "title": "Minecraft 1.19.4", + "category": "mc-vanilla", + "runtime": "Java 17+", + "hardware": "RAM 2G+", + "size": "50MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/8f3112a1049751cc472ec13e397eade5336ca7ae/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.18.2", + "gameType": "minecraft", + "title": "Minecraft 1.18.2", + "category": "mc-vanilla", + "runtime": "Java 17+", + "hardware": "RAM 2G+", + "size": "45MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/c8f83c5655308435b3dcf03c06d9fe8740a77469/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.17.1", + "gameType": "minecraft", + "title": "Minecraft 1.17.1", + "category": "mc-vanilla", + "runtime": "Java 16+", + "hardware": "RAM 2G+", + "size": "45MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/a16d67e5807f57fc4e550299cf20226194497dc2/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.16.5", + "gameType": "minecraft", + "title": "Minecraft 1.16.5", + "category": "mc-vanilla", + "runtime": "Java 8+", + "hardware": "RAM 2G+", + "size": "45MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/1b557e7b033b583cd9f66746b7a9ab1ec1673ced/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.12.2", + "gameType": "minecraft", + "title": "Minecraft 1.12.2", + "category": "mc-vanilla", + "runtime": "Java 8+", + "hardware": "RAM 2G+", + "size": "30MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/886945bfb2b978778c3a0288fd7fab09d315b25f/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "description": "[Vanilla] Minecraft 1.8.9", + "gameType": "minecraft", + "title": "Minecraft 1.8.9", + "category": "mc-vanilla", + "runtime": "Java 7+", + "hardware": "RAM 2G+", + "size": "10MB", + "remark": "Minecraft Java", + "targetLink": "https://launcher.mojang.com/v1/objects/b58b2ceb36e01bcd8dbf49c8fb66c55a9f0676cd/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "zh_cn", + "description": "[Paper] Minecraft 1.21.1 快速开服", + "gameType": "minecraft", + "title": "Minecraft 1.21.1 快速开服", + "category": "mc-paper", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "250MB", + "remark": "包含基础插件,萌新快速开服!低配机器专属!", + "targetLink": "https://cloud.alongw.cn/f/DzvHK/Paper-1.21.1-ZH.zip", + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms4096M -Xmx4096M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "zh_cn", + "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", + "gameType": "minecraft", + "title": "Minecraft 1.20.4", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 6G+", + "size": "140MB", + "remark": "支持插件,最低 8GB 内存要求", + "targetLink": "https://url.alww.top/mcsm/paper1.20.4.zip", + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms6144M -Xmx6144M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "zh_cn", + "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", + "gameType": "minecraft", + "title": "Forge 1.20.1 Java 版 (支持模组)", + "category": "mc-forge", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.3.33/forge-1.20.1-47.3.33-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.20.1-47.3.33-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "zh_cn", + "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", + "gameType": "minecraft", + "title": "Forge 1.20.6 Java 版 (支持模组)", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.1.48/forge-1.20.6-50.1.48-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.20.6-50.1.48-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "zh_cn", + "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", + "gameType": "minecraft", + "title": "Forge 1.19.2 Java 版 (支持模组)", + "category": "mc-forge", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.4.20/forge-1.19.2-43.4.20-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.19.2-43.4.20-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "zh_cn", + "description": "[幻兽帕鲁](Windows)", + "remark": "适用于 Windows 下的幻兽帕鲁安装包", + "gameType": "other", + "title": "Minecraft 1.21.8", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "55MB", + + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "zh_cn", + "description": "[幻兽帕鲁](Linux Docker)", + "remark": "适用于 Linux Docker 下的幻兽帕鲁安装包", + "gameType": "other", + "title": "Minecraft 1.21.8", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "55MB", + + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + } + ] +} From 7922d738893bc020f1fefcf63400800a76da3d1a Mon Sep 17 00:00:00 2001 From: yumao233 Date: Mon, 28 Jul 2025 15:02:18 +0800 Subject: [PATCH 329/463] fix: category --- templates-test.json | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/templates-test.json b/templates-test.json index 5d90dc4..ce680fe 100644 --- a/templates-test.json +++ b/templates-test.json @@ -10,18 +10,6 @@ "value": "zh_cn" } ], - "games": [ - { - "label": "Minecraft", - "value": "minecraft", - "language": "" - }, - { - "label": "幻兽帕鲁", - "value": "palworld", - "language": "zh_cn" - } - ], "packages": [ { "language": "en_us", @@ -1856,7 +1844,7 @@ "remark": "适用于 Windows 下的幻兽帕鲁安装包", "gameType": "other", "title": "Minecraft 1.21.8", - "category": "mc-purpur", + "category": "Windows", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "55MB", @@ -1876,9 +1864,9 @@ "language": "zh_cn", "description": "[幻兽帕鲁](Linux Docker)", "remark": "适用于 Linux Docker 下的幻兽帕鲁安装包", - "gameType": "other", + "gameType": "Palworld", "title": "Minecraft 1.21.8", - "category": "mc-purpur", + "category": "Linux", "runtime": "Java 21+", "hardware": "RAM 4G+", "size": "55MB", From a8ec5996b18bcdb4dbe83ba075edc74ca6532175 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Mon, 28 Jul 2025 15:08:59 +0800 Subject: [PATCH 330/463] fix: category --- templates-test.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates-test.json b/templates-test.json index ce680fe..1443294 100644 --- a/templates-test.json +++ b/templates-test.json @@ -1842,7 +1842,7 @@ "language": "zh_cn", "description": "[幻兽帕鲁](Windows)", "remark": "适用于 Windows 下的幻兽帕鲁安装包", - "gameType": "other", + "gameType": "Palworld", "title": "Minecraft 1.21.8", "category": "Windows", "runtime": "Java 21+", From bad89d6aeece9c423c461e99d3d37e5c118d1043 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Mon, 28 Jul 2025 15:19:04 +0800 Subject: [PATCH 331/463] fix: category --- templates-test.json | 174 ++++++++++++++++++++++---------------------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/templates-test.json b/templates-test.json index 1443294..3e0a347 100644 --- a/templates-test.json +++ b/templates-test.json @@ -14,7 +14,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.21.8 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.8", "category": "mc-purpur", "runtime": "Java 21+", @@ -35,7 +35,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.21.6 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.6", "category": "mc-purpur", "runtime": "Java 21+", @@ -56,7 +56,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.21.5 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.5", "category": "mc-purpur", "runtime": "Java 21+", @@ -77,7 +77,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.21.4 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.4", "category": "mc-purpur", "runtime": "Java 21+", @@ -98,7 +98,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.21.3 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.3", "category": "mc-purpur", "runtime": "Java 21+", @@ -119,7 +119,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.21.1 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.1", "category": "mc-purpur", "runtime": "Java 21+", @@ -140,7 +140,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.20.6 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.20.6", "category": "mc-purpur", "runtime": "Java 21+", @@ -161,7 +161,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.20.4 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.20.4", "category": "mc-purpur", "runtime": "Java 21+", @@ -182,7 +182,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.20.1 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.20.1", "category": "mc-purpur", "runtime": "Java 17+", @@ -203,7 +203,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.19.2 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.19.2", "category": "mc-purpur", "runtime": "Java 17+", @@ -224,7 +224,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.18.2 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.18.2", "category": "mc-purpur", "runtime": "Java 17+", @@ -245,7 +245,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.17.1 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.17.1", "category": "mc-purpur", "runtime": "Java 16+", @@ -266,7 +266,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.16.5 Purpur", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.16.5", "category": "mc-purpur", "runtime": "Java 8+", @@ -287,7 +287,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.21.8 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.8", "category": "mc-paper", "runtime": "Java 21+", @@ -308,7 +308,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.21.6 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.6", "category": "mc-paper", "runtime": "Java 21+", @@ -329,7 +329,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.21.4 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.4", "category": "mc-paper", "runtime": "Java 21+", @@ -350,7 +350,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.21.3 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.3", "category": "mc-paper", "runtime": "Java 21+", @@ -371,7 +371,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.21.1 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.1", "category": "mc-paper", "runtime": "Java 21+", @@ -392,7 +392,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.20.6 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.20.6", "category": "mc-paper", "runtime": "Java 21+", @@ -413,7 +413,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.20.4 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.20.4", "category": "mc-paper", "runtime": "Java 21+", @@ -434,7 +434,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.20.2 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.20.2", "category": "mc-paper", "runtime": "Java 17+", @@ -455,7 +455,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.20.1 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.20.1", "category": "mc-paper", "runtime": "Java 17+", @@ -476,7 +476,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.19.4 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.19.4", "category": "mc-paper", "runtime": "Java 17+", @@ -497,7 +497,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.19.2 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.19.2", "category": "mc-paper", "runtime": "Java 17+", @@ -518,7 +518,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.18.2 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.18.2", "category": "mc-paper", "runtime": "Java 17+", @@ -539,7 +539,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.17.1 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.17.1", "category": "mc-paper", "runtime": "Java 16+", @@ -560,7 +560,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.16.5 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.16.5", "category": "mc-paper", "runtime": "Java 8+", @@ -581,7 +581,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.12.2 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.12.2", "category": "mc-paper", "runtime": "Java 8+", @@ -602,7 +602,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.8.8 Paper", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.8.8", "category": "mc-paper", "runtime": "Java 7+", @@ -623,7 +623,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "NeoForge 1.21.8 (Supports Mods)", "category": "mc-neoforge", "runtime": "Java 21+", @@ -644,7 +644,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "NeoForge 1.21.6 (Supports Mods)", "category": "mc-neoforge", "runtime": "Java 21+", @@ -665,7 +665,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "NeoForge 1.21.5 (Supports Mods)", "category": "mc-neoforge", "runtime": "Java 21+", @@ -686,7 +686,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "NeoForge 1.21.4 (Supports Mods)", "category": "mc-neoforge", "runtime": "Java 21+", @@ -707,7 +707,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "NeoForge 1.21.1 (Supports Mods)", "category": "mc-neoforge", "runtime": "Java 21+", @@ -728,7 +728,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "NeoForge 1.20.6 (Supports Mods)", "category": "mc-neoforge", "runtime": "Java 21+", @@ -749,7 +749,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "NeoForge 1.20.4 (Supports Mods)", "category": "mc-neoforge", "runtime": "Java 21+", @@ -770,7 +770,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "NeoForge 1.20.2 (Supports Mods)", "category": "mc-neoforge", "runtime": "Java 21+", @@ -791,7 +791,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.21.8 (Supports Mods)", "category": "mc-forge", "runtime": "Java 21+", @@ -812,7 +812,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.21.6 (Supports Mods)", "category": "mc-forge", "runtime": "Java 21+", @@ -833,7 +833,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.21.5 (Supports Mods)", "category": "mc-forge", "runtime": "Java 21+", @@ -854,7 +854,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.21.4 (Supports Mods)", "category": "mc-forge", "runtime": "Java 21+", @@ -875,7 +875,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.21.1 (Supports Mods)", "category": "mc-forge", "runtime": "Java 21+", @@ -896,7 +896,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.20.6 (Supports Mods)", "category": "mc-forge", "runtime": "Java 21+", @@ -917,7 +917,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.20.4 (Supports Mods)", "category": "mc-forge", "runtime": "Java 21+", @@ -938,7 +938,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.20.1 (Supports Mods)", "category": "mc-forge", "runtime": "Java 17+", @@ -959,7 +959,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.19.4 (Supports Mods)", "category": "mc-forge", "runtime": "Java 17+", @@ -980,7 +980,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.19.2 (Supports Mods)", "category": "mc-forge", "runtime": "Java 17+", @@ -1001,7 +1001,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.18.2 (Supports Mods)", "category": "mc-forge", "runtime": "Java 17+", @@ -1022,7 +1022,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.17.1 (Supports Mods)", "category": "mc-forge", "runtime": "Java 16+", @@ -1043,7 +1043,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.16.5 (Supports Mods)", "category": "mc-forge", "runtime": "Java 8+", @@ -1064,7 +1064,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.12.2 (Supports Mods)", "category": "mc-forge", "runtime": "Java 8+", @@ -1085,7 +1085,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.8.9 (Supports Mods)", "category": "mc-forge", "runtime": "Java 7+", @@ -1106,7 +1106,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.7.10 (Supports Mods)", "category": "mc-forge", "runtime": "Java 7+", @@ -1127,7 +1127,7 @@ { "language": "en_us", "description": "Minecraft 1.21.8 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.21.8 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 21+", @@ -1148,7 +1148,7 @@ { "language": "en_us", "description": "Minecraft 1.21.6 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.21.6 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 21+", @@ -1169,7 +1169,7 @@ { "language": "en_us", "description": "Minecraft 1.21.5 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.21.5 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 21+", @@ -1190,7 +1190,7 @@ { "language": "en_us", "description": "Minecraft 1.21.4 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.21.4 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 21+", @@ -1211,7 +1211,7 @@ { "language": "en_us", "description": "Minecraft 1.21.1 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.21.1 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 21+", @@ -1232,7 +1232,7 @@ { "language": "en_us", "description": "Minecraft 1.20.6 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.20.6 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 21+", @@ -1253,7 +1253,7 @@ { "language": "en_us", "description": "Minecraft 1.20.4 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.20.4 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 21+", @@ -1274,7 +1274,7 @@ { "language": "en_us", "description": "Minecraft 1.20.1 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.20.1 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 17+", @@ -1295,7 +1295,7 @@ { "language": "en_us", "description": "Minecraft 1.19.4 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.19.4 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 17+", @@ -1316,7 +1316,7 @@ { "language": "en_us", "description": "Minecraft 1.19.2 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.19.2 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 17+", @@ -1337,7 +1337,7 @@ { "language": "en_us", "description": "Minecraft 1.18.2 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.18.2 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 17+", @@ -1358,7 +1358,7 @@ { "language": "en_us", "description": "Minecraft 1.17.1 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.17.1 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 16+", @@ -1379,7 +1379,7 @@ { "language": "en_us", "description": "Minecraft 1.16.5 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.16.5 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 8+", @@ -1400,7 +1400,7 @@ { "language": "en_us", "description": "Minecraft 1.15.2 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.15.2 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 8+", @@ -1421,7 +1421,7 @@ { "language": "en_us", "description": "Minecraft 1.14.4 with Fabric Loader", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Fabric 1.14.4 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 8+", @@ -1442,7 +1442,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.21.8", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.8", "category": "mc-vanilla", "runtime": "Java 21+", @@ -1463,7 +1463,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.21.6", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.6", "category": "mc-vanilla", "runtime": "Java 21+", @@ -1484,7 +1484,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.21.5", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.5", "category": "mc-vanilla", "runtime": "Java 21+", @@ -1505,7 +1505,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.21.4", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.4", "category": "mc-vanilla", "runtime": "Java 21+", @@ -1526,7 +1526,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.21.1", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.1", "category": "mc-vanilla", "runtime": "Java 21+", @@ -1547,7 +1547,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.20.6", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.20.6", "category": "mc-vanilla", "runtime": "Java 21+", @@ -1568,7 +1568,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.20.4", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.20.4", "category": "mc-vanilla", "runtime": "Java 21+", @@ -1589,7 +1589,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.20.1", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.20.1", "category": "mc-vanilla", "runtime": "Java 17+", @@ -1610,7 +1610,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.19.4", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.19.4", "category": "mc-vanilla", "runtime": "Java 17+", @@ -1631,7 +1631,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.18.2", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.18.2", "category": "mc-vanilla", "runtime": "Java 17+", @@ -1652,7 +1652,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.17.1", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.17.1", "category": "mc-vanilla", "runtime": "Java 16+", @@ -1673,7 +1673,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.16.5", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.16.5", "category": "mc-vanilla", "runtime": "Java 8+", @@ -1694,7 +1694,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.12.2", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.12.2", "category": "mc-vanilla", "runtime": "Java 8+", @@ -1715,7 +1715,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.8.9", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.8.9", "category": "mc-vanilla", "runtime": "Java 7+", @@ -1736,7 +1736,7 @@ { "language": "zh_cn", "description": "[Paper] Minecraft 1.21.1 快速开服", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.21.1 快速开服", "category": "mc-paper", "runtime": "Java 17+", @@ -1757,7 +1757,7 @@ { "language": "zh_cn", "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Minecraft 1.20.4", "category": "mc-paper", "runtime": "Java 21+", @@ -1778,7 +1778,7 @@ { "language": "zh_cn", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.20.1 Java 版 (支持模组)", "category": "mc-forge", "runtime": "Java 17+", @@ -1799,7 +1799,7 @@ { "language": "zh_cn", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.20.6 Java 版 (支持模组)", "category": "mc-forge", "runtime": "Java 21+", @@ -1820,7 +1820,7 @@ { "language": "zh_cn", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", - "gameType": "minecraft", + "gameType": "Minecraft", "title": "Forge 1.19.2 Java 版 (支持模组)", "category": "mc-forge", "runtime": "Java 17+", From 0c6dfac8f646efb449f827627e786dea25285285 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Mon, 28 Jul 2025 15:22:33 +0800 Subject: [PATCH 332/463] fix: category --- templates-test.json | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/templates-test.json b/templates-test.json index 3e0a347..aa5f8af 100644 --- a/templates-test.json +++ b/templates-test.json @@ -1840,15 +1840,14 @@ }, { "language": "zh_cn", - "description": "[幻兽帕鲁](Windows)", - "remark": "适用于 Windows 下的幻兽帕鲁安装包", + "title": "幻兽帕鲁官方服务器(Windows)", + "description": "适用于 Windows 的帕鲁们的最佳服务器!", + "remark": "", "gameType": "Palworld", - "title": "Minecraft 1.21.8", "category": "Windows", - "runtime": "Java 21+", + "runtime": "Windows 10+", "hardware": "RAM 4G+", - "size": "55MB", - + "size": "", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", "author": "purpurmc.org", "setupInfo": { @@ -1862,15 +1861,14 @@ }, { "language": "zh_cn", - "description": "[幻兽帕鲁](Linux Docker)", - "remark": "适用于 Linux Docker 下的幻兽帕鲁安装包", + "title": "幻兽帕鲁官方服务器(Linux + Docker)", + "description": "适用于 Windows 的帕鲁们的最佳服务器!本模板使用 Docker 安装,Linux 服务器必须安装 Docker!", + "remark": "", "gameType": "Palworld", - "title": "Minecraft 1.21.8", "category": "Linux", - "runtime": "Java 21+", + "runtime": "Ubuntu/Centos LTS", "hardware": "RAM 4G+", - "size": "55MB", - + "size": "", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", "author": "purpurmc.org", "setupInfo": { From 3cf9286495c30c9b651e0150988b1fc9c4c1b5e4 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Wed, 30 Jul 2025 14:41:05 +0800 Subject: [PATCH 333/463] feat: new template file --- templates-test.json | 89 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/templates-test.json b/templates-test.json index aa5f8af..77d806a 100644 --- a/templates-test.json +++ b/templates-test.json @@ -14,6 +14,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.21.8 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.8", "category": "mc-purpur", @@ -35,6 +36,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.21.6 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.6", "category": "mc-purpur", @@ -56,6 +58,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.21.5 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.5", "category": "mc-purpur", @@ -77,6 +80,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.21.4 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.4", "category": "mc-purpur", @@ -98,6 +102,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.21.3 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.3", "category": "mc-purpur", @@ -119,6 +124,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.21.1 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.1", "category": "mc-purpur", @@ -140,6 +146,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.20.6 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.20.6", "category": "mc-purpur", @@ -161,6 +168,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.20.4 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.20.4", "category": "mc-purpur", @@ -182,6 +190,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.20.1 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.20.1", "category": "mc-purpur", @@ -203,6 +212,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.19.2 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.19.2", "category": "mc-purpur", @@ -224,6 +234,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.18.2 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.18.2", "category": "mc-purpur", @@ -245,6 +256,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.17.1 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.17.1", "category": "mc-purpur", @@ -266,6 +278,7 @@ { "language": "en_us", "description": "[Purpur] Minecraft 1.16.5 Purpur", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.16.5", "category": "mc-purpur", @@ -287,6 +300,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.21.8 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.8", "category": "mc-paper", @@ -308,6 +322,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.21.6 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.6", "category": "mc-paper", @@ -329,6 +344,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.21.4 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.4", "category": "mc-paper", @@ -350,6 +366,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.21.3 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.3", "category": "mc-paper", @@ -371,6 +388,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.21.1 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.1", "category": "mc-paper", @@ -392,6 +410,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.20.6 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.20.6", "category": "mc-paper", @@ -413,6 +432,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.20.4 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.20.4", "category": "mc-paper", @@ -434,6 +454,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.20.2 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.20.2", "category": "mc-paper", @@ -455,6 +476,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.20.1 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.20.1", "category": "mc-paper", @@ -476,6 +498,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.19.4 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.19.4", "category": "mc-paper", @@ -497,6 +520,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.19.2 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.19.2", "category": "mc-paper", @@ -518,6 +542,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.18.2 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.18.2", "category": "mc-paper", @@ -539,6 +564,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.17.1 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.17.1", "category": "mc-paper", @@ -560,6 +586,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.16.5 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.16.5", "category": "mc-paper", @@ -581,6 +608,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.12.2 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.12.2", "category": "mc-paper", @@ -602,6 +630,7 @@ { "language": "en_us", "description": "[Paper] Minecraft 1.8.8 Paper", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.8.8", "category": "mc-paper", @@ -623,6 +652,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "NeoForge 1.21.8 (Supports Mods)", "category": "mc-neoforge", @@ -644,6 +674,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "NeoForge 1.21.6 (Supports Mods)", "category": "mc-neoforge", @@ -665,6 +696,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "NeoForge 1.21.5 (Supports Mods)", "category": "mc-neoforge", @@ -686,6 +718,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "NeoForge 1.21.4 (Supports Mods)", "category": "mc-neoforge", @@ -707,6 +740,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "NeoForge 1.21.1 (Supports Mods)", "category": "mc-neoforge", @@ -728,6 +762,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "NeoForge 1.20.6 (Supports Mods)", "category": "mc-neoforge", @@ -749,6 +784,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "NeoForge 1.20.4 (Supports Mods)", "category": "mc-neoforge", @@ -770,6 +806,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "NeoForge 1.20.2 (Supports Mods)", "category": "mc-neoforge", @@ -791,6 +828,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.21.8 (Supports Mods)", "category": "mc-forge", @@ -812,6 +850,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.21.6 (Supports Mods)", "category": "mc-forge", @@ -833,6 +872,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.21.5 (Supports Mods)", "category": "mc-forge", @@ -854,6 +894,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.21.4 (Supports Mods)", "category": "mc-forge", @@ -875,6 +916,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.21.1 (Supports Mods)", "category": "mc-forge", @@ -896,6 +938,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.20.6 (Supports Mods)", "category": "mc-forge", @@ -917,6 +960,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.20.4 (Supports Mods)", "category": "mc-forge", @@ -938,6 +982,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.20.1 (Supports Mods)", "category": "mc-forge", @@ -959,6 +1004,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.19.4 (Supports Mods)", "category": "mc-forge", @@ -980,6 +1026,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.19.2 (Supports Mods)", "category": "mc-forge", @@ -1001,6 +1048,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.18.2 (Supports Mods)", "category": "mc-forge", @@ -1022,6 +1070,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.17.1 (Supports Mods)", "category": "mc-forge", @@ -1043,6 +1092,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.16.5 (Supports Mods)", "category": "mc-forge", @@ -1064,6 +1114,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.12.2 (Supports Mods)", "category": "mc-forge", @@ -1085,6 +1136,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.8.9 (Supports Mods)", "category": "mc-forge", @@ -1106,6 +1158,7 @@ { "language": "en_us", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.7.10 (Supports Mods)", "category": "mc-forge", @@ -1127,6 +1180,7 @@ { "language": "en_us", "description": "Minecraft 1.21.8 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.21.8 (Supports Mods)", "category": "mc-fabric", @@ -1148,6 +1202,7 @@ { "language": "en_us", "description": "Minecraft 1.21.6 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.21.6 (Supports Mods)", "category": "mc-fabric", @@ -1169,6 +1224,7 @@ { "language": "en_us", "description": "Minecraft 1.21.5 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.21.5 (Supports Mods)", "category": "mc-fabric", @@ -1190,6 +1246,7 @@ { "language": "en_us", "description": "Minecraft 1.21.4 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.21.4 (Supports Mods)", "category": "mc-fabric", @@ -1211,6 +1268,7 @@ { "language": "en_us", "description": "Minecraft 1.21.1 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.21.1 (Supports Mods)", "category": "mc-fabric", @@ -1232,6 +1290,7 @@ { "language": "en_us", "description": "Minecraft 1.20.6 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.20.6 (Supports Mods)", "category": "mc-fabric", @@ -1253,6 +1312,7 @@ { "language": "en_us", "description": "Minecraft 1.20.4 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.20.4 (Supports Mods)", "category": "mc-fabric", @@ -1274,6 +1334,7 @@ { "language": "en_us", "description": "Minecraft 1.20.1 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.20.1 (Supports Mods)", "category": "mc-fabric", @@ -1295,6 +1356,7 @@ { "language": "en_us", "description": "Minecraft 1.19.4 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.19.4 (Supports Mods)", "category": "mc-fabric", @@ -1316,6 +1378,7 @@ { "language": "en_us", "description": "Minecraft 1.19.2 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.19.2 (Supports Mods)", "category": "mc-fabric", @@ -1337,6 +1400,7 @@ { "language": "en_us", "description": "Minecraft 1.18.2 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.18.2 (Supports Mods)", "category": "mc-fabric", @@ -1358,6 +1422,7 @@ { "language": "en_us", "description": "Minecraft 1.17.1 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.17.1 (Supports Mods)", "category": "mc-fabric", @@ -1379,6 +1444,7 @@ { "language": "en_us", "description": "Minecraft 1.16.5 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.16.5 (Supports Mods)", "category": "mc-fabric", @@ -1400,6 +1466,7 @@ { "language": "en_us", "description": "Minecraft 1.15.2 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.15.2 (Supports Mods)", "category": "mc-fabric", @@ -1421,6 +1488,7 @@ { "language": "en_us", "description": "Minecraft 1.14.4 with Fabric Loader", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Fabric 1.14.4 (Supports Mods)", "category": "mc-fabric", @@ -1442,6 +1510,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.21.8", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.8", "category": "mc-vanilla", @@ -1463,6 +1532,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.21.6", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.6", "category": "mc-vanilla", @@ -1484,6 +1554,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.21.5", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.5", "category": "mc-vanilla", @@ -1505,6 +1576,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.21.4", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.4", "category": "mc-vanilla", @@ -1526,6 +1598,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.21.1", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.1", "category": "mc-vanilla", @@ -1547,6 +1620,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.20.6", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.20.6", "category": "mc-vanilla", @@ -1568,6 +1642,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.20.4", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.20.4", "category": "mc-vanilla", @@ -1589,6 +1664,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.20.1", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.20.1", "category": "mc-vanilla", @@ -1610,6 +1686,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.19.4", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.19.4", "category": "mc-vanilla", @@ -1631,6 +1708,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.18.2", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.18.2", "category": "mc-vanilla", @@ -1652,6 +1730,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.17.1", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.17.1", "category": "mc-vanilla", @@ -1673,6 +1752,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.16.5", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.16.5", "category": "mc-vanilla", @@ -1694,6 +1774,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.12.2", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.12.2", "category": "mc-vanilla", @@ -1715,6 +1796,7 @@ { "language": "en_us", "description": "[Vanilla] Minecraft 1.8.9", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.8.9", "category": "mc-vanilla", @@ -1736,6 +1818,7 @@ { "language": "zh_cn", "description": "[Paper] Minecraft 1.21.1 快速开服", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.1 快速开服", "category": "mc-paper", @@ -1757,6 +1840,7 @@ { "language": "zh_cn", "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.20.4", "category": "mc-paper", @@ -1778,6 +1862,7 @@ { "language": "zh_cn", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.20.1 Java 版 (支持模组)", "category": "mc-forge", @@ -1799,6 +1884,7 @@ { "language": "zh_cn", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.20.6 Java 版 (支持模组)", "category": "mc-forge", @@ -1820,6 +1906,7 @@ { "language": "zh_cn", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.19.2 Java 版 (支持模组)", "category": "mc-forge", @@ -1842,6 +1929,7 @@ "language": "zh_cn", "title": "幻兽帕鲁官方服务器(Windows)", "description": "适用于 Windows 的帕鲁们的最佳服务器!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", "remark": "", "gameType": "Palworld", "category": "Windows", @@ -1863,6 +1951,7 @@ "language": "zh_cn", "title": "幻兽帕鲁官方服务器(Linux + Docker)", "description": "适用于 Windows 的帕鲁们的最佳服务器!本模板使用 Docker 安装,Linux 服务器必须安装 Docker!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", "remark": "", "gameType": "Palworld", "category": "Linux", From ba4224bec8515910a9538e1f2c86b68b4e5ff554 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Wed, 30 Jul 2025 14:56:06 +0800 Subject: [PATCH 334/463] feat: new template file --- templates-test.json | 112 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 89 insertions(+), 23 deletions(-) diff --git a/templates-test.json b/templates-test.json index 77d806a..43940aa 100644 --- a/templates-test.json +++ b/templates-test.json @@ -13,6 +13,7 @@ "packages": [ { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.21.8 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -35,6 +36,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.21.6 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -57,6 +59,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.21.5 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -79,6 +82,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.21.4 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -101,6 +105,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.21.3 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -123,6 +128,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.21.1 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -145,6 +151,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.20.6 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -167,6 +174,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.20.4 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -189,6 +197,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.20.1 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -211,6 +220,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.19.2 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -233,6 +243,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.18.2 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -255,6 +266,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.17.1 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -277,6 +289,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Purpur] Minecraft 1.16.5 Purpur", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -299,6 +312,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.21.8 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -321,6 +335,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.21.6 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -343,6 +358,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.21.4 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -365,6 +381,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.21.3 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -387,6 +404,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.21.1 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -409,6 +427,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.20.6 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -431,6 +450,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.20.4 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -453,6 +473,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.20.2 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -475,6 +496,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.20.1 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -497,6 +519,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.19.4 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -519,6 +542,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.19.2 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -541,6 +565,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.18.2 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -563,6 +588,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.17.1 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -585,6 +611,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.16.5 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -607,6 +634,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Paper] Minecraft 1.12.2 Paper", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -629,28 +657,7 @@ }, { "language": "en_us", - "description": "[Paper] Minecraft 1.8.8 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.8.8", - "category": "mc-paper", - "runtime": "Java 7+", - "hardware": "RAM 4G+", - "size": "20MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.8.8/builds/445/downloads/paper-1.8.8-445.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.8.8-445.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", + "platform": "Linux", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -673,6 +680,7 @@ }, { "language": "en_us", + "platform": "Linux", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -695,6 +703,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -717,6 +726,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -739,6 +749,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -761,6 +772,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -783,6 +795,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -805,6 +818,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -827,6 +841,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -849,6 +864,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -871,6 +887,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -893,6 +910,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -915,6 +933,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -937,6 +956,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -959,6 +979,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -981,6 +1002,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1003,6 +1025,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1025,6 +1048,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1047,6 +1071,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1069,6 +1094,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1091,6 +1117,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1113,6 +1140,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1135,6 +1163,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1157,6 +1186,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1179,6 +1209,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.21.8 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1201,6 +1232,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.21.6 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1223,6 +1255,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.21.5 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1245,6 +1278,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.21.4 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1267,6 +1301,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.21.1 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1289,6 +1324,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.20.6 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1311,6 +1347,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.20.4 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1333,6 +1370,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.20.1 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1355,6 +1393,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.19.4 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1377,6 +1416,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.19.2 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1399,6 +1439,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.18.2 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1421,6 +1462,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.17.1 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1443,6 +1485,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.16.5 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1465,6 +1508,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.15.2 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1487,6 +1531,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "Minecraft 1.14.4 with Fabric Loader", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1509,6 +1554,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.21.8", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1531,6 +1577,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.21.6", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1553,6 +1600,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.21.5", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1575,6 +1623,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.21.4", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1597,6 +1646,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.21.1", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1619,6 +1669,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.20.6", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1641,6 +1692,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.20.4", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1663,6 +1715,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.20.1", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1685,6 +1738,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.19.4", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1707,6 +1761,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.18.2", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1729,6 +1784,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.17.1", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1751,6 +1807,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.16.5", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1773,6 +1830,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.12.2", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1795,6 +1853,7 @@ }, { "language": "en_us", + "platform": "ALL", "description": "[Vanilla] Minecraft 1.8.9", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1817,6 +1876,7 @@ }, { "language": "zh_cn", + "platform": "ALL", "description": "[Paper] Minecraft 1.21.1 快速开服", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1839,6 +1899,7 @@ }, { "language": "zh_cn", + "platform": "ALL", "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1861,6 +1922,7 @@ }, { "language": "zh_cn", + "platform": "ALL", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1883,6 +1945,7 @@ }, { "language": "zh_cn", + "platform": "ALL", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1905,6 +1968,7 @@ }, { "language": "zh_cn", + "platform": "ALL", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -1928,6 +1992,7 @@ { "language": "zh_cn", "title": "幻兽帕鲁官方服务器(Windows)", + "platform": "Windows", "description": "适用于 Windows 的帕鲁们的最佳服务器!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", "remark": "", @@ -1949,7 +2014,8 @@ }, { "language": "zh_cn", - "title": "幻兽帕鲁官方服务器(Linux + Docker)", + "title": "幻兽帕鲁官方服务器(Docker)", + "platform": "Linux", "description": "适用于 Windows 的帕鲁们的最佳服务器!本模板使用 Docker 安装,Linux 服务器必须安装 Docker!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", "remark": "", From de5f01a226262adc76857f1ea88ba8e21fea5668 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Wed, 30 Jul 2025 15:06:36 +0800 Subject: [PATCH 335/463] feat: new template file --- templates-test.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates-test.json b/templates-test.json index 43940aa..ba5d176 100644 --- a/templates-test.json +++ b/templates-test.json @@ -1997,7 +1997,7 @@ "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", "remark": "", "gameType": "Palworld", - "category": "Windows", + "category": "最新版本", "runtime": "Windows 10+", "hardware": "RAM 4G+", "size": "", @@ -2020,7 +2020,7 @@ "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", "remark": "", "gameType": "Palworld", - "category": "Linux", + "category": "最新版本", "runtime": "Ubuntu/Centos LTS", "hardware": "RAM 4G+", "size": "", From 2797b071e5aea82cc3ca0cd4f71370a377ec36ed Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 3 Aug 2025 15:49:24 +0800 Subject: [PATCH 336/463] feat: test new templates --- templates-test.json | 92 ++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/templates-test.json b/templates-test.json index ba5d176..55355ce 100644 --- a/templates-test.json +++ b/templates-test.json @@ -11,6 +11,52 @@ } ], "packages": [ + { + "language": "zh_cn", + "title": "幻兽帕鲁官方服务器(Windows)", + "platform": "Windows", + "description": "适用于 Windows 的帕鲁们的最佳服务器!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", + "remark": "", + "gameType": "Palworld", + "category": "最新版本", + "runtime": "Windows 10+", + "hardware": "RAM 4G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "setupInfo": { + "type": "steam/universal", + "startCommand": "PalServer.exe", + "stopCommand": "exit", + "updateCommand": "{mcsm_steamcmd} steamcmd +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2394010 +quit", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "zh_cn", + "title": "幻兽帕鲁官方服务器(Docker)", + "platform": "Linux", + "description": "适用于 Windows 的帕鲁们的最佳服务器!本模板使用 Docker 安装,Linux 服务器必须安装 Docker!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", + "remark": "", + "gameType": "Palworld", + "category": "最新版本", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 4G+", + "size": "", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", + "stopCommand": "stop", + "updateCommand": "{mcsm_steamcmd} steamcmd +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2394010 +quit", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "platform": "ALL", @@ -1988,52 +2034,6 @@ "ie": "utf-8", "oe": "utf-8" } - }, - { - "language": "zh_cn", - "title": "幻兽帕鲁官方服务器(Windows)", - "platform": "Windows", - "description": "适用于 Windows 的帕鲁们的最佳服务器!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", - "remark": "", - "gameType": "Palworld", - "category": "最新版本", - "runtime": "Windows 10+", - "hardware": "RAM 4G+", - "size": "", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "title": "幻兽帕鲁官方服务器(Docker)", - "platform": "Linux", - "description": "适用于 Windows 的帕鲁们的最佳服务器!本模板使用 Docker 安装,Linux 服务器必须安装 Docker!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", - "remark": "", - "gameType": "Palworld", - "category": "最新版本", - "runtime": "Ubuntu/Centos LTS", - "hardware": "RAM 4G+", - "size": "", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } } ] } From 5aa44ceb512e442c9c279bab2ae3f3a954574a9e Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 3 Aug 2025 16:13:43 +0800 Subject: [PATCH 337/463] feat: test new templates --- templates-test.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates-test.json b/templates-test.json index 55355ce..6200834 100644 --- a/templates-test.json +++ b/templates-test.json @@ -29,7 +29,7 @@ "type": "steam/universal", "startCommand": "PalServer.exe", "stopCommand": "exit", - "updateCommand": "{mcsm_steamcmd} steamcmd +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2394010 +quit", + "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2394010 +quit", "ie": "utf-8", "oe": "utf-8" } From 4d5a3c4aafd1d09de893771b51fd50e302bf894d Mon Sep 17 00:00:00 2001 From: yumao233 Date: Tue, 5 Aug 2025 17:02:52 +0800 Subject: [PATCH 338/463] feat: add gametype --- templates.json | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/templates.json b/templates.json index 788d5de..6bd8682 100644 --- a/templates.json +++ b/templates.json @@ -13,6 +13,7 @@ "packages": [ { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.21.8 Purpur", "title": "Minecraft 1.21.8", "category": "mc-purpur", @@ -33,6 +34,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.21.6 Purpur", "title": "Minecraft 1.21.6", "category": "mc-purpur", @@ -53,6 +55,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.21.5 Purpur", "title": "Minecraft 1.21.5", "category": "mc-purpur", @@ -73,6 +76,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.21.4 Purpur", "title": "Minecraft 1.21.4", "category": "mc-purpur", @@ -93,6 +97,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.21.3 Purpur", "title": "Minecraft 1.21.3", "category": "mc-purpur", @@ -113,6 +118,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.21.1 Purpur", "title": "Minecraft 1.21.1", "category": "mc-purpur", @@ -133,6 +139,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.20.6 Purpur", "title": "Minecraft 1.20.6", "category": "mc-purpur", @@ -153,6 +160,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.20.4 Purpur", "title": "Minecraft 1.20.4", "category": "mc-purpur", @@ -173,6 +181,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.20.1 Purpur", "title": "Minecraft 1.20.1", "category": "mc-purpur", @@ -193,6 +202,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.19.2 Purpur", "title": "Minecraft 1.19.2", "category": "mc-purpur", @@ -213,6 +223,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.18.2 Purpur", "title": "Minecraft 1.18.2", "category": "mc-purpur", @@ -233,6 +244,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.17.1 Purpur", "title": "Minecraft 1.17.1", "category": "mc-purpur", @@ -253,6 +265,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.16.5 Purpur", "title": "Minecraft 1.16.5", "category": "mc-purpur", @@ -273,6 +286,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.8 Paper", "title": "Minecraft 1.21.8", "category": "mc-paper", @@ -293,6 +307,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.6 Paper", "title": "Minecraft 1.21.6", "category": "mc-paper", @@ -313,6 +328,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.4 Paper", "title": "Minecraft 1.21.4", "category": "mc-paper", @@ -333,6 +349,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.3 Paper", "title": "Minecraft 1.21.3", "category": "mc-paper", @@ -353,6 +370,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.1 Paper", "title": "Minecraft 1.21.1", "category": "mc-paper", @@ -373,6 +391,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.20.6 Paper", "title": "Minecraft 1.20.6", "category": "mc-paper", @@ -393,6 +412,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.20.4 Paper", "title": "Minecraft 1.20.4", "category": "mc-paper", @@ -413,6 +433,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.20.2 Paper", "title": "Minecraft 1.20.2", "category": "mc-paper", @@ -433,6 +454,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.20.1 Paper", "title": "Minecraft 1.20.1", "category": "mc-paper", @@ -453,6 +475,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.19.4 Paper", "title": "Minecraft 1.19.4", "category": "mc-paper", @@ -473,6 +496,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.19.2 Paper", "title": "Minecraft 1.19.2", "category": "mc-paper", @@ -493,6 +517,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.18.2 Paper", "title": "Minecraft 1.18.2", "category": "mc-paper", @@ -513,6 +538,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.17.1 Paper", "title": "Minecraft 1.17.1", "category": "mc-paper", @@ -533,6 +559,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.16.5 Paper", "title": "Minecraft 1.16.5", "category": "mc-paper", @@ -553,6 +580,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.12.2 Paper", "title": "Minecraft 1.12.2", "category": "mc-paper", @@ -573,6 +601,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.8.8 Paper", "title": "Minecraft 1.8.8", "category": "mc-paper", @@ -593,6 +622,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.21.8 (Supports Mods)", "category": "mc-neoforge", @@ -613,6 +643,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.21.6 (Supports Mods)", "category": "mc-neoforge", @@ -633,6 +664,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.21.5 (Supports Mods)", "category": "mc-neoforge", @@ -653,6 +685,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.21.4 (Supports Mods)", "category": "mc-neoforge", @@ -673,6 +706,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.21.1 (Supports Mods)", "category": "mc-neoforge", @@ -693,6 +727,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.20.6 (Supports Mods)", "category": "mc-neoforge", @@ -713,6 +748,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.20.4 (Supports Mods)", "category": "mc-neoforge", @@ -733,6 +769,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "NeoForge 1.20.2 (Supports Mods)", "category": "mc-neoforge", @@ -753,6 +790,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.8 (Supports Mods)", "category": "mc-forge", @@ -773,6 +811,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.6 (Supports Mods)", "category": "mc-forge", @@ -793,6 +832,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.5 (Supports Mods)", "category": "mc-forge", @@ -813,6 +853,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.4 (Supports Mods)", "category": "mc-forge", @@ -833,6 +874,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.21.1 (Supports Mods)", "category": "mc-forge", @@ -853,6 +895,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.20.6 (Supports Mods)", "category": "mc-forge", @@ -873,6 +916,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.20.4 (Supports Mods)", "category": "mc-forge", @@ -893,6 +937,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.20.1 (Supports Mods)", "category": "mc-forge", @@ -913,6 +958,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.19.4 (Supports Mods)", "category": "mc-forge", @@ -933,6 +979,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.19.2 (Supports Mods)", "category": "mc-forge", @@ -953,6 +1000,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.18.2 (Supports Mods)", "category": "mc-forge", @@ -973,6 +1021,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.17.1 (Supports Mods)", "category": "mc-forge", @@ -993,6 +1042,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.16.5 (Supports Mods)", "category": "mc-forge", @@ -1013,6 +1063,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.12.2 (Supports Mods)", "category": "mc-forge", @@ -1033,6 +1084,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.8.9 (Supports Mods)", "category": "mc-forge", @@ -1053,6 +1105,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", "title": "Forge 1.7.10 (Supports Mods)", "category": "mc-forge", @@ -1073,6 +1126,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.21.8 with Fabric Loader", "title": "Fabric 1.21.8 (Supports Mods)", "category": "mc-fabric", @@ -1093,6 +1147,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.21.6 with Fabric Loader", "title": "Fabric 1.21.6 (Supports Mods)", "category": "mc-fabric", @@ -1113,6 +1168,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.21.5 with Fabric Loader", "title": "Fabric 1.21.5 (Supports Mods)", "category": "mc-fabric", @@ -1133,6 +1189,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.21.4 with Fabric Loader", "title": "Fabric 1.21.4 (Supports Mods)", "category": "mc-fabric", @@ -1153,6 +1210,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.21.1 with Fabric Loader", "title": "Fabric 1.21.1 (Supports Mods)", "category": "mc-fabric", @@ -1173,6 +1231,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.20.6 with Fabric Loader", "title": "Fabric 1.20.6 (Supports Mods)", "category": "mc-fabric", @@ -1193,6 +1252,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.20.4 with Fabric Loader", "title": "Fabric 1.20.4 (Supports Mods)", "category": "mc-fabric", @@ -1213,6 +1273,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.20.1 with Fabric Loader", "title": "Fabric 1.20.1 (Supports Mods)", "category": "mc-fabric", @@ -1233,6 +1294,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.19.4 with Fabric Loader", "title": "Fabric 1.19.4 (Supports Mods)", "category": "mc-fabric", @@ -1253,6 +1315,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.19.2 with Fabric Loader", "title": "Fabric 1.19.2 (Supports Mods)", "category": "mc-fabric", @@ -1273,6 +1336,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.18.2 with Fabric Loader", "title": "Fabric 1.18.2 (Supports Mods)", "category": "mc-fabric", @@ -1293,6 +1357,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.17.1 with Fabric Loader", "title": "Fabric 1.17.1 (Supports Mods)", "category": "mc-fabric", @@ -1313,6 +1378,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.16.5 with Fabric Loader", "title": "Fabric 1.16.5 (Supports Mods)", "category": "mc-fabric", @@ -1333,6 +1399,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.15.2 with Fabric Loader", "title": "Fabric 1.15.2 (Supports Mods)", "category": "mc-fabric", @@ -1353,6 +1420,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "Minecraft 1.14.4 with Fabric Loader", "title": "Fabric 1.14.4 (Supports Mods)", "category": "mc-fabric", @@ -1373,6 +1441,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.21.8", "title": "Minecraft 1.21.8", "category": "mc-vanilla", @@ -1393,6 +1462,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.21.6", "title": "Minecraft 1.21.6", "category": "mc-vanilla", @@ -1413,6 +1483,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.21.5", "title": "Minecraft 1.21.5", "category": "mc-vanilla", @@ -1433,6 +1504,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.21.4", "title": "Minecraft 1.21.4", "category": "mc-vanilla", @@ -1453,6 +1525,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.21.1", "title": "Minecraft 1.21.1", "category": "mc-vanilla", @@ -1473,6 +1546,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.20.6", "title": "Minecraft 1.20.6", "category": "mc-vanilla", @@ -1493,6 +1567,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.20.4", "title": "Minecraft 1.20.4", "category": "mc-vanilla", @@ -1513,6 +1588,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.20.1", "title": "Minecraft 1.20.1", "category": "mc-vanilla", @@ -1533,6 +1609,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.19.4", "title": "Minecraft 1.19.4", "category": "mc-vanilla", @@ -1553,6 +1630,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.18.2", "title": "Minecraft 1.18.2", "category": "mc-vanilla", @@ -1573,6 +1651,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.17.1", "title": "Minecraft 1.17.1", "category": "mc-vanilla", @@ -1593,6 +1672,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.16.5", "title": "Minecraft 1.16.5", "category": "mc-vanilla", @@ -1613,6 +1693,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.12.2", "title": "Minecraft 1.12.2", "category": "mc-vanilla", @@ -1633,6 +1714,7 @@ }, { "language": "en_us", + "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.8.9", "title": "Minecraft 1.8.9", "category": "mc-vanilla", @@ -1653,6 +1735,7 @@ }, { "language": "zh_cn", + "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.1 快速开服", "title": "Minecraft 1.20.1", "category": "mc-paper", @@ -1673,6 +1756,7 @@ }, { "language": "zh_cn", + "gameType": "Minecraft", "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", "title": "Minecraft 1.20.4 (低配机器推荐)", "category": "mc-paper", @@ -1693,6 +1777,7 @@ }, { "language": "zh_cn", + "gameType": "Minecraft", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "title": "Forge 1.20.1 Java 版 (支持模组)", "category": "mc-forge", @@ -1713,6 +1798,7 @@ }, { "language": "zh_cn", + "gameType": "Minecraft", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "title": "Forge 1.20.6 Java 版 (支持模组)", "category": "mc-forge", @@ -1733,6 +1819,7 @@ }, { "language": "zh_cn", + "gameType": "Minecraft", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "title": "Forge 1.19.2 Java 版 (支持模组)", "category": "mc-forge", From 56acd41ab791ba3deb8c4ec7d5e84bd9991f3fb6 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Tue, 5 Aug 2025 20:38:58 +0800 Subject: [PATCH 339/463] dev: new pack --- templates-test.json | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/templates-test.json b/templates-test.json index 6200834..c3861d8 100644 --- a/templates-test.json +++ b/templates-test.json @@ -38,23 +38,40 @@ "language": "zh_cn", "title": "幻兽帕鲁官方服务器(Docker)", "platform": "Linux", - "description": "适用于 Windows 的帕鲁们的最佳服务器!本模板使用 Docker 安装,Linux 服务器必须安装 Docker!", + "description": "适用于 Windows 的帕鲁们的最佳服务器!本模板使用 Docker 安装,Linux 服务器必须安装 Docker!安装后默认的密码是 123456", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", - "remark": "", "gameType": "Palworld", "category": "最新版本", "runtime": "Ubuntu/Centos LTS", "hardware": "RAM 4G+", "size": "", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", - "author": "purpurmc.org", + "targetLink": "", + "author": "MCSManager", "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", "stopCommand": "stop", - "updateCommand": "{mcsm_steamcmd} steamcmd +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2394010 +quit", - "ie": "utf-8", - "oe": "utf-8" + "ie": "utf8", + "oe": "utf8", + "type": "steam/game", + "tag": ["palworld"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "kagurazakanyaa/palworld:latest", + "containerName": "palworld-server", + "ports": ["{mcsm_port1}:8211/tcp", "{mcsm_port2}:25575/tcp"], + "extraVolumes": [], + "memory": 8192, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "/opt/palworld/Pal/Saved", + "env": [ + "SERVER_NAME=Private PalWorld Server", + "SERVER_DESC=Private PalWorld Server", + "ADMIN_PASSWORD=123456" + ], + "changeWorkdir": false + } } }, { From ad82ab50d9a01ba1cafb56f6bbba09867cc715e5 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Tue, 5 Aug 2025 21:19:53 +0800 Subject: [PATCH 340/463] dev: new pack --- templates-test.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates-test.json b/templates-test.json index c3861d8..e059b78 100644 --- a/templates-test.json +++ b/templates-test.json @@ -51,7 +51,7 @@ "stopCommand": "stop", "ie": "utf8", "oe": "utf8", - "type": "steam/game", + "type": "steam/universal", "tag": ["palworld"], "fileCode": "utf8", "processType": "docker", From dca59d7277feafe5e4a0e2bddece543a374ac496 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Tue, 5 Aug 2025 21:52:54 +0800 Subject: [PATCH 341/463] dev: new pack --- templates-test.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates-test.json b/templates-test.json index e059b78..5547c4f 100644 --- a/templates-test.json +++ b/templates-test.json @@ -38,7 +38,7 @@ "language": "zh_cn", "title": "幻兽帕鲁官方服务器(Docker)", "platform": "Linux", - "description": "适用于 Windows 的帕鲁们的最佳服务器!本模板使用 Docker 安装,Linux 服务器必须安装 Docker!安装后默认的密码是 123456", + "description": "适用于 Windows 的帕鲁们的最佳服务器!本模板使用 Docker 安装,Linux 服务器必须安装 Docker!安装后默认的密码是 123456,修改请前往环境变量处修改。", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", "gameType": "Palworld", "category": "最新版本", @@ -47,6 +47,7 @@ "size": "", "targetLink": "", "author": "MCSManager", + "tags": ["适用于商业出租", "Docker 版"], "setupInfo": { "stopCommand": "stop", "ie": "utf8", From b4164b81e7c8f8e7dc336c5f5df2819c3d26c981 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Tue, 5 Aug 2025 22:36:54 +0800 Subject: [PATCH 342/463] dev: new pack --- templates-test.json | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/templates-test.json b/templates-test.json index 5547c4f..dd4d1d6 100644 --- a/templates-test.json +++ b/templates-test.json @@ -13,7 +13,7 @@ "packages": [ { "language": "zh_cn", - "title": "幻兽帕鲁官方服务器(Windows)", + "title": "幻兽帕鲁官方服务器", "platform": "Windows", "description": "适用于 Windows 的帕鲁们的最佳服务器!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", @@ -25,6 +25,7 @@ "size": "", "targetLink": "", "author": "MCSManager", + "tags": ["仅适合个人使用", "Windows 版"], "setupInfo": { "type": "steam/universal", "startCommand": "PalServer.exe", @@ -36,7 +37,7 @@ }, { "language": "zh_cn", - "title": "幻兽帕鲁官方服务器(Docker)", + "title": "幻兽帕鲁官方服务器", "platform": "Linux", "description": "适用于 Windows 的帕鲁们的最佳服务器!本模板使用 Docker 安装,Linux 服务器必须安装 Docker!安装后默认的密码是 123456,修改请前往环境变量处修改。", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", @@ -47,7 +48,7 @@ "size": "", "targetLink": "", "author": "MCSManager", - "tags": ["适用于商业出租", "Docker 版"], + "tags": ["可以商业出租", "Docker 版"], "setupInfo": { "stopCommand": "stop", "ie": "utf8", @@ -59,19 +60,16 @@ "updateCommand": "", "docker": { "image": "kagurazakanyaa/palworld:latest", - "containerName": "palworld-server", - "ports": ["{mcsm_port1}:8211/tcp", "{mcsm_port2}:25575/tcp"], - "extraVolumes": [], - "memory": 8192, + "changeWorkdir": false, "networkMode": "bridge", - "cpuUsage": 100, + "containerName": "palworld-server", "workingDir": "/opt/palworld/Pal/Saved", + "ports": ["{mcsm_port1}:8211/tcp", "{mcsm_port2}:25575/tcp"], "env": [ "SERVER_NAME=Private PalWorld Server", "SERVER_DESC=Private PalWorld Server", "ADMIN_PASSWORD=123456" - ], - "changeWorkdir": false + ] } } }, From 408ed33424ce45fccdef9b75c861d1aa3bc5f376 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Thu, 7 Aug 2025 20:12:56 +0800 Subject: [PATCH 343/463] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=96=87=E4=BB=B6=20templates-test.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates-config.json | 287 ++++++ templates-test.json | 2055 ----------------------------------------- 2 files changed, 287 insertions(+), 2055 deletions(-) create mode 100644 templates-config.json delete mode 100644 templates-test.json diff --git a/templates-config.json b/templates-config.json new file mode 100644 index 0000000..9cb265d --- /dev/null +++ b/templates-config.json @@ -0,0 +1,287 @@ +{ + "languages": [ + { + "label": "English", + "value": "en_us", + "path": "templates-en.json" + }, + { + "label": "中文", + "value": "zh_cn", + "path": "templates-zh.json" + } + ], + "packages": [ + { + "title": "幻兽帕鲁官方服务器", + "platform": "Windows", + "description": "适用于 Windows 的帕鲁们的最佳服务器!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", + "remark": "", + "gameType": "Palworld", + "category": "最新版本", + "runtime": "Windows 10+", + "hardware": "RAM 4G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["仅适合个人使用", "Windows 版"], + "setupInfo": { + "tag": ["Palworld"], + "type": "steam/universal", + "startCommand": "PalServer.exe", + "stopCommand": "exit", + "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2394010 +quit", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "title": "幻兽帕鲁官方服务器", + "platform": "Linux", + "description": "本模板使用 Docker 安装,Linux 服务器必须安装 Docker!安装后默认的密码是 123456,修改请前往环境变量处修改。", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", + "gameType": "Palworld", + "category": "最新版本", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 4G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["可以商业出租", "Docker 版"], + "setupInfo": { + "stopCommand": "stop", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": ["Palworld"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "kagurazakanyaa/palworld:latest", + "changeWorkdir": false, + "networkMode": "bridge", + "containerName": "palworld-server", + "workingDir": "/opt/palworld/Pal/Saved", + "ports": ["{mcsm_port1}:8211/tcp", "{mcsm_port2}:25575/tcp"], + "env": [ + "SERVER_NAME=Private PalWorld Server", + "SERVER_DESC=Private PalWorld Server", + "ADMIN_PASSWORD=123456" + ] + } + } + }, + { + "title": "僵尸毁灭工程", + "platform": "Linux", + "description": "适用于 Linux 系统,使用《僵尸毁灭工程》第三方 Docker 镜像,快速开服!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/pzomboid.webp", + "gameType": "Zombie Survival", + "category": "最新版本", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 4G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["可以商业出租", "Docker 版"], + "setupInfo": { + "startCommand": "", + "stopCommand": "stop", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": ["Project Zomboid"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "renegademaster/zomboid-dedicated-server:latest", + "containerName": "zomboid-dedicated-server", + "ports": ["{mcsm_port2}:16262/udp", "{mcsm_port1}:16261/udp"], + "extraVolumes": [ + "{mcsm_workspace}/ZomboidConfig|/home/steam/Zomboid", + "{mcsm_workspace}/ZomboidDedicatedServer|/home/steam/ZomboidDedicatedServer" + ], + "memory": 4096, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "", + "env": [], + "changeWorkdir": false + } + } + }, + + { + "title": "Terraria 服务器", + "platform": "Linux", + "description": "适用于 Linux 系统,使用《Terraria》第三方 Docker 镜像,快速开服!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/terraria.webp", + "gameType": "Terraria", + "category": "最新版本", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 4G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["可以商业出租", "Docker 版"], + "setupInfo": { + "startCommand": "", + "stopCommand": "exit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/terraria", + "tag": ["terraria"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "ryshe/terraria:latest", + "containerName": "terraria-server", + "ports": ["{mcsm_port1}:7777/tcp"], + "extraVolumes": [], + "memory": 4096, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "/root/.local/share/Terraria/Worlds", + "env": [], + "changeWorkdir": false + } + } + }, + + { + "platform": "ALL", + "description": "[Paper] Minecraft 1.21.1 快速开服", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "title": "Minecraft 1.21.1 快速开服", + "category": "mc-paper", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "250MB", + "remark": "包含基础插件,萌新快速开服!低配机器专属!", + "targetLink": "https://cloud.alongw.cn/f/DzvHK/Paper-1.21.1-ZH.zip", + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms4096M -Xmx4096M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "title": "Minecraft 1.20.4", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 6G+", + "size": "140MB", + "remark": "支持插件,最低 8GB 内存要求", + "targetLink": "https://url.alww.top/mcsm/paper1.20.4.zip", + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms6144M -Xmx6144M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "title": "Forge 1.20.1 Java 版 (支持模组)", + "category": "mc-forge", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.3.33/forge-1.20.1-47.3.33-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.20.1-47.3.33-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "title": "Forge 1.20.6 Java 版 (支持模组)", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.1.48/forge-1.20.6-50.1.48-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.20.6-50.1.48-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "title": "Forge 1.19.2 Java 版 (支持模组)", + "category": "mc-forge", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.4.20/forge-1.19.2-43.4.20-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.19.2-43.4.20-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Purpur] Minecraft 1.21.8 Purpur", + "title": "Minecraft 1.21.8", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "55MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + } + ] +} diff --git a/templates-test.json b/templates-test.json deleted file mode 100644 index dd4d1d6..0000000 --- a/templates-test.json +++ /dev/null @@ -1,2055 +0,0 @@ -{ - "name": "MCSManager Game Server Template Marketplace", - "languages": [ - { - "label": "English", - "value": "en_us" - }, - { - "label": "简体中文", - "value": "zh_cn" - } - ], - "packages": [ - { - "language": "zh_cn", - "title": "幻兽帕鲁官方服务器", - "platform": "Windows", - "description": "适用于 Windows 的帕鲁们的最佳服务器!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", - "remark": "", - "gameType": "Palworld", - "category": "最新版本", - "runtime": "Windows 10+", - "hardware": "RAM 4G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": ["仅适合个人使用", "Windows 版"], - "setupInfo": { - "type": "steam/universal", - "startCommand": "PalServer.exe", - "stopCommand": "exit", - "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2394010 +quit", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "title": "幻兽帕鲁官方服务器", - "platform": "Linux", - "description": "适用于 Windows 的帕鲁们的最佳服务器!本模板使用 Docker 安装,Linux 服务器必须安装 Docker!安装后默认的密码是 123456,修改请前往环境变量处修改。", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", - "gameType": "Palworld", - "category": "最新版本", - "runtime": "Ubuntu/Centos LTS", - "hardware": "RAM 4G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": ["可以商业出租", "Docker 版"], - "setupInfo": { - "stopCommand": "stop", - "ie": "utf8", - "oe": "utf8", - "type": "steam/universal", - "tag": ["palworld"], - "fileCode": "utf8", - "processType": "docker", - "updateCommand": "", - "docker": { - "image": "kagurazakanyaa/palworld:latest", - "changeWorkdir": false, - "networkMode": "bridge", - "containerName": "palworld-server", - "workingDir": "/opt/palworld/Pal/Saved", - "ports": ["{mcsm_port1}:8211/tcp", "{mcsm_port2}:25575/tcp"], - "env": [ - "SERVER_NAME=Private PalWorld Server", - "SERVER_DESC=Private PalWorld Server", - "ADMIN_PASSWORD=123456" - ] - } - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.21.8 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.8", - "category": "mc-purpur", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "55MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.21.6 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.6", - "category": "mc-purpur", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "55MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.6-2465.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.6-2465.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.21.5 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.5", - "category": "mc-purpur", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "55MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.5-2450.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.5-2450.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.21.4 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.4", - "category": "mc-purpur", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2416.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2416.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.21.3 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.3", - "category": "mc-purpur", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.3-2358.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.3-2358.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.21.1 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.1", - "category": "mc-purpur", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.1-2329.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.1-2329.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.20.6 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.20.6", - "category": "mc-purpur", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.6-2233.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.20.6-2233.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.20.4 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.20.4", - "category": "mc-purpur", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.4-2176.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.20.4-2176.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.20.1 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.20.1", - "category": "mc-purpur", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.1-2062.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.20.1-2062.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.19.2 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.19.2", - "category": "mc-purpur", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.19.2-1858.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.19.2-1858.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.18.2 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.18.2", - "category": "mc-purpur", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.18.2-1632.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.18.2-1632.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.17.1 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.17.1", - "category": "mc-purpur", - "runtime": "Java 16+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.17.1-1428.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.17.1-1428.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Purpur] Minecraft 1.16.5 Purpur", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.16.5", - "category": "mc-purpur", - "runtime": "Java 8+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.16.5-1171.jar", - "author": "purpurmc.org", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.16.5-1171.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.21.8 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.8", - "category": "mc-paper", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/10/downloads/paper-1.21.8-10.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-10.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.21.6 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.6", - "category": "mc-paper", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.6/builds/48/downloads/paper-1.21.4-48.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.6-48.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.21.4 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.4", - "category": "mc-paper", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-232.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.21.3 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.3", - "category": "mc-paper", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.3/builds/82/downloads/paper-1.21.3-82.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.3-82.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.21.1 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.1", - "category": "mc-paper", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/132/downloads/paper-1.21.1-132.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.1-132.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.20.6 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.20.6", - "category": "mc-paper", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.6/builds/151/downloads/paper-1.20.6-151.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.6-151.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.20.4 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.20.4", - "category": "mc-paper", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/499/downloads/paper-1.20.4-499.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.4-499.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.20.2 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.20.2", - "category": "mc-paper", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "150MB", - "remark": "Includes some basic plugins", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.2/builds/318/downloads/paper-1.20.2-318.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.2-318.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.20.1 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.20.1", - "category": "mc-paper", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "200MB", - "remark": "Includes some basic plugins", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.1/builds/196/downloads/paper-1.20.1-196.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.1-196.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.19.4 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.19.4", - "category": "mc-paper", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.19.4/builds/550/downloads/paper-1.19.4-550.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.19.4-550.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.19.2 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.19.2", - "category": "mc-paper", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.19.2/builds/307/downloads/paper-1.19.2-307.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.19.2-307.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.18.2 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.18.2", - "category": "mc-paper", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.18.2/builds/388/downloads/paper-1.18.2-388.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.18.2-388.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.17.1 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.17.1", - "category": "mc-paper", - "runtime": "Java 16+", - "hardware": "RAM 4G+", - "size": "60MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.17.1/builds/411/downloads/paper-1.17.1-411.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.17.1-411.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.16.5 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.16.5", - "category": "mc-paper", - "runtime": "Java 8+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.16.5/builds/794/downloads/paper-1.16.5-794.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.16.5-794.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Paper] Minecraft 1.12.2 Paper", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.12.2", - "category": "mc-paper", - "runtime": "Java 8+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.12.2/builds/1620/downloads/paper-1.12.2-1620.jar", - "author": "papermc.io", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.12.2-1620.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "Linux", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "NeoForge 1.21.8 (Supports Mods)", - "category": "mc-neoforge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.4-beta/neoforge-21.8.4-beta-installer.jar", - "author": "neoforged.net", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.8.4-beta-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "Linux", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "NeoForge 1.21.6 (Supports Mods)", - "category": "mc-neoforge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.6.20-beta/neoforge-21.6.20-beta-installer.jar", - "author": "neoforged.net", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.6.20-beta-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "NeoForge 1.21.5 (Supports Mods)", - "category": "mc-neoforge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.5.87/neoforge-21.5.87-installer.jar", - "author": "neoforged.net", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.5.87-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "NeoForge 1.21.4 (Supports Mods)", - "category": "mc-neoforge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.147/neoforge-21.4.147-installer.jar", - "author": "neoforged.net", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.4.147-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "NeoForge 1.21.1 (Supports Mods)", - "category": "mc-neoforge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.193/neoforge-21.1.193-installer.jar", - "author": "neoforged.net", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.1.193-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "NeoForge 1.20.6 (Supports Mods)", - "category": "mc-neoforge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.6.137/neoforge-20.6.137-installer.jar", - "author": "neoforged.net", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar neoforge-20.6.137-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "NeoForge 1.20.4 (Supports Mods)", - "category": "mc-neoforge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.4.248/neoforge-20.4.248-installer.jar", - "author": "neoforged.net", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar neoforge-20.4.248-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "NeoForge 1.20.2 (Supports Mods)", - "category": "mc-neoforge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.2.93/neoforge-20.2.93-installer.jar", - "author": "neoforged.net", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar neoforge-20.2.93-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.21.8 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.0.0/forge-1.21.8-58.0.0-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.8-58.0.0-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.21.6 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.6-56.0.9/forge-1.21.6-56.0.9-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.6-56.0.9-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.21.5 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.5-55.0.23/forge-1.21.5-55.0.23-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.5-55.0.23-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.21.4 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.3/forge-1.21.4-54.1.3-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.4-54.1.3-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.21.1 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.1/forge-1.21.1-52.1.1-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.1-52.1.1-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.20.6 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.2.0/forge-1.20.6-50.2.0-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.6-50.2.0-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.20.4 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.4-49.2.0/forge-1.20.4-49.2.0-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.4-49.2.0-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.20.1 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.4.4/forge-1.20.1-47.4.4-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.1-47.4.4-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.19.4 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.4-45.4.0/forge-1.19.4-45.4.0-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.19.4-45.4.0-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.19.2 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.5.0/forge-1.19.2-43.5.0-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.19.2-43.5.0-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.18.2 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.3.9/forge-1.18.2-40.3.9-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.18.2-40.3.9-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.17.1 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 16+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.17.1-37.1.1/forge-1.17.1-37.1.1-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.17.1-37.1.1-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.16.5 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 8+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.16.5-36.2.42/forge-1.16.5-36.2.42-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.16.5-36.2.42-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.12.2 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 8+", - "hardware": "RAM 8G+", - "size": "5MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.12.2-14.23.5.2860/forge-1.12.2-14.23.5.2860-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.12.2-14.23.5.2860-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.8.9 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 7+", - "hardware": "RAM 8G+", - "size": "5MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.8.9-11.15.1.2318-1.8.9/forge-1.8.9-11.15.1.2318-1.8.9-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.8.9-11.15.1.2318-1.8.9-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.7.10 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 7+", - "hardware": "RAM 8G+", - "size": "5MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/forge-1.7.10-10.13.4.1614-1.7.10-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.7.10-10.13.4.1614-1.7.10-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.21.8 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.21.8 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.8 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.21.6 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.21.6 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.6 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.21.5 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.21.5 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.5 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.21.4 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.21.4 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.21.1 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.21.1 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.1 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.20.6 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.20.6 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.20.6 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.20.4 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.20.4 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.20.4 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.20.1 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.20.1 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.20.1 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.19.4 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.19.4 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.19.4 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.19.2 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.19.2 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.19.2 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.18.2 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.18.2 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.18.2 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.17.1 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.17.1 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 16+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.17.1 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.16.5 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.16.5 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 8+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.16.5 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.15.2 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.15.2 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 8+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.15.2 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "Minecraft 1.14.4 with Fabric Loader", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Fabric 1.14.4 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 8+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.14.4 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.21.8", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.8", - "category": "mc-vanilla", - "runtime": "Java 21+", - "hardware": "RAM 2G+", - "size": "55MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.21.6", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.6", - "category": "mc-vanilla", - "runtime": "Java 21+", - "hardware": "RAM 2G+", - "size": "55MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/6e64dcabba3c01a7271b4fa6bd898483b794c59b/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.21.5", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.5", - "category": "mc-vanilla", - "runtime": "Java 21+", - "hardware": "RAM 2G+", - "size": "55MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/e6ec2f64e6080b9b5d9b471b291c33cc7f509733/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.21.4", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.4", - "category": "mc-vanilla", - "runtime": "Java 21+", - "hardware": "RAM 2G+", - "size": "55MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.21.1", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.1", - "category": "mc-vanilla", - "runtime": "Java 21+", - "hardware": "RAM 2G+", - "size": "50MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/59353fb40c36d304f2035d51e7d6e6baa98dc05c/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.20.6", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.20.6", - "category": "mc-vanilla", - "runtime": "Java 21+", - "hardware": "RAM 2G+", - "size": "50MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/145ff0858209bcfc164859ba735d4199aafa1eea/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.20.4", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.20.4", - "category": "mc-vanilla", - "runtime": "Java 21+", - "hardware": "RAM 2G+", - "size": "50MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/8dd1a28015f51b1803213892b50b7b4fc76e594d/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.20.1", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.20.1", - "category": "mc-vanilla", - "runtime": "Java 17+", - "hardware": "RAM 2G+", - "size": "50MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/84194a2f286ef7c14ed7ce0090dba59902951553/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.19.4", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.19.4", - "category": "mc-vanilla", - "runtime": "Java 17+", - "hardware": "RAM 2G+", - "size": "50MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/8f3112a1049751cc472ec13e397eade5336ca7ae/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.18.2", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.18.2", - "category": "mc-vanilla", - "runtime": "Java 17+", - "hardware": "RAM 2G+", - "size": "45MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/c8f83c5655308435b3dcf03c06d9fe8740a77469/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.17.1", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.17.1", - "category": "mc-vanilla", - "runtime": "Java 16+", - "hardware": "RAM 2G+", - "size": "45MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/a16d67e5807f57fc4e550299cf20226194497dc2/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.16.5", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.16.5", - "category": "mc-vanilla", - "runtime": "Java 8+", - "hardware": "RAM 2G+", - "size": "45MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/1b557e7b033b583cd9f66746b7a9ab1ec1673ced/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.12.2", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.12.2", - "category": "mc-vanilla", - "runtime": "Java 8+", - "hardware": "RAM 2G+", - "size": "30MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/886945bfb2b978778c3a0288fd7fab09d315b25f/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "platform": "ALL", - "description": "[Vanilla] Minecraft 1.8.9", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.8.9", - "category": "mc-vanilla", - "runtime": "Java 7+", - "hardware": "RAM 2G+", - "size": "10MB", - "remark": "Minecraft Java", - "targetLink": "https://launcher.mojang.com/v1/objects/b58b2ceb36e01bcd8dbf49c8fb66c55a9f0676cd/server.jar", - "author": "Mojang Studios", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "platform": "ALL", - "description": "[Paper] Minecraft 1.21.1 快速开服", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.1 快速开服", - "category": "mc-paper", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "250MB", - "remark": "包含基础插件,萌新快速开服!低配机器专属!", - "targetLink": "https://cloud.alongw.cn/f/DzvHK/Paper-1.21.1-ZH.zip", - "author": "alongw.cn", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms4096M -Xmx4096M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "platform": "ALL", - "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.20.4", - "category": "mc-paper", - "runtime": "Java 21+", - "hardware": "RAM 6G+", - "size": "140MB", - "remark": "支持插件,最低 8GB 内存要求", - "targetLink": "https://url.alww.top/mcsm/paper1.20.4.zip", - "author": "alongw.cn", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms6144M -Xmx6144M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "platform": "ALL", - "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.20.1 Java 版 (支持模组)", - "category": "mc-forge", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.3.33/forge-1.20.1-47.3.33-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.1-47.3.33-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "platform": "ALL", - "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.20.6 Java 版 (支持模组)", - "category": "mc-forge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.1.48/forge-1.20.6-50.1.48-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.6-50.1.48-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "platform": "ALL", - "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Forge 1.19.2 Java 版 (支持模组)", - "category": "mc-forge", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.4.20/forge-1.19.2-43.4.20-installer.jar", - "author": "minecraftforge.net", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.19.2-43.4.20-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - } - ] -} From 541a37f67b306112d011a863548bd93ded81e0f5 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Thu, 7 Aug 2025 20:15:00 +0800 Subject: [PATCH 344/463] feat: test new config --- templates-config.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/templates-config.json b/templates-config.json index 9cb265d..6ac8055 100644 --- a/templates-config.json +++ b/templates-config.json @@ -14,6 +14,7 @@ "packages": [ { "title": "幻兽帕鲁官方服务器", + "language": "zh_cn", "platform": "Windows", "description": "适用于 Windows 的帕鲁们的最佳服务器!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", @@ -38,6 +39,7 @@ }, { "title": "幻兽帕鲁官方服务器", + "language": "zh_cn", "platform": "Linux", "description": "本模板使用 Docker 安装,Linux 服务器必须安装 Docker!安装后默认的密码是 123456,修改请前往环境变量处修改。", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", @@ -75,6 +77,7 @@ }, { "title": "僵尸毁灭工程", + "language": "zh_cn", "platform": "Linux", "description": "适用于 Linux 系统,使用《僵尸毁灭工程》第三方 Docker 镜像,快速开服!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/pzomboid.webp", @@ -116,6 +119,7 @@ { "title": "Terraria 服务器", + "language": "zh_cn", "platform": "Linux", "description": "适用于 Linux 系统,使用《Terraria》第三方 Docker 镜像,快速开服!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/terraria.webp", @@ -158,6 +162,7 @@ "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.1 快速开服", + "language": "zh_cn", "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 4G+", @@ -175,6 +180,7 @@ } }, { + "language": "zh_cn", "platform": "ALL", "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", @@ -197,6 +203,7 @@ } }, { + "language": "zh_cn", "platform": "ALL", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", @@ -219,6 +226,7 @@ } }, { + "language": "zh_cn", "platform": "ALL", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", @@ -241,6 +249,7 @@ } }, { + "language": "zh_cn", "platform": "ALL", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", From 881f09861c400eb3baa3024ab9aa87a630ac6f62 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Thu, 7 Aug 2025 20:26:58 +0800 Subject: [PATCH 345/463] feat: test new config --- templates-config.json | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/templates-config.json b/templates-config.json index 6ac8055..d13c06a 100644 --- a/templates-config.json +++ b/templates-config.json @@ -273,6 +273,7 @@ }, { "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.21.8 Purpur", "title": "Minecraft 1.21.8", @@ -291,6 +292,52 @@ "ie": "utf-8", "oe": "utf-8" } + }, + { + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "platform": "Linux", + "description": "Forge 1.21.1 Server for Linux", + "title": "Forge 1.21.1 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.1/forge-1.21.1-52.1.1-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.1-52.1.1-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "platform": "Windows", + "description": "Forge 1.21.1 Server for Windows", + "title": "Forge 1.21.1 (Supports Mods)", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.1/forge-1.21.1-52.1.1-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.1-52.1.1-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } } ] } From 31230d71c7b340f6e7bd6c229c02947b317058fd Mon Sep 17 00:00:00 2001 From: yumao233 Date: Mon, 11 Aug 2025 20:09:28 +0800 Subject: [PATCH 346/463] feat: test new config --- templates-config.json => market.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename templates-config.json => market.json (100%) diff --git a/templates-config.json b/market.json similarity index 100% rename from templates-config.json rename to market.json From 47bfc9eaa06fb5def931ca9f1014f5b105e18554 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Mon, 11 Aug 2025 20:45:48 +0800 Subject: [PATCH 347/463] feat: test new config --- market.json | 326 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 316 insertions(+), 10 deletions(-) diff --git a/market.json b/market.json index d13c06a..3d20036 100644 --- a/market.json +++ b/market.json @@ -157,12 +157,12 @@ }, { + "language": "zh_cn", "platform": "ALL", "description": "[Paper] Minecraft 1.21.1 快速开服", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.1 快速开服", - "language": "zh_cn", "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 4G+", @@ -204,8 +204,8 @@ }, { "language": "zh_cn", - "platform": "ALL", - "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", + "platform": "Linux", + "description": "Minecraft Forge 1.20.1 服务器,支持 Forge 模组!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.20.1 Java 版 (支持模组)", @@ -227,7 +227,30 @@ }, { "language": "zh_cn", - "platform": "ALL", + "platform": "Windows", + "description": "Minecraft Forge 1.20.1 服务器,支持 Forge 模组!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "title": "Forge 1.20.1 Java 版 (支持模组)", + "category": "mc-forge", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.3.33/forge-1.20.1-47.3.33-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "start.bat", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.20.1-47.3.33-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "zh_cn", + "platform": "Windows", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -241,7 +264,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", + "startCommand": "start.bat", "stopCommand": "stop", "updateCommand": "java -jar forge-1.20.6-50.1.48-installer.jar --installServer", "ie": "utf-8", @@ -250,7 +273,7 @@ }, { "language": "zh_cn", - "platform": "ALL", + "platform": "Windows", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", @@ -264,14 +287,159 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", + "startCommand": "start.bat", "stopCommand": "stop", "updateCommand": "java -jar forge-1.19.2-43.4.20-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, + + { + "title": "Palworld Official Server", + "language": "en_us", + "platform": "Windows", + "description": "The best Palworld server for Windows!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", + "remark": "", + "gameType": "Palworld", + "category": "Latest Version", + "runtime": "Windows 10+", + "hardware": "RAM 4G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["Windows version"], + "setupInfo": { + "tag": ["Palworld"], + "type": "steam/universal", + "startCommand": "PalServer.exe", + "stopCommand": "exit", + "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2394010 +quit", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "title": "Palworld Official Server", + "language": "en_us", + "platform": "Linux", + "description": "This template uses Docker for installation. Docker must be installed on your Linux server! The default password after installation is 123456. To change it, please go to the environment variables.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", + "gameType": "Palworld", + "category": "Latest Version", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 4G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["Docker version"], + "setupInfo": { + "stopCommand": "stop", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": ["Palworld"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "kagurazakanyaa/palworld:latest", + "changeWorkdir": false, + "networkMode": "bridge", + "containerName": "palworld-server", + "workingDir": "/opt/palworld/Pal/Saved", + "ports": ["{mcsm_port1}:8211/tcp", "{mcsm_port2}:25575/tcp"], + "env": [ + "SERVER_NAME=Private PalWorld Server", + "SERVER_DESC=Private PalWorld Server", + "ADMIN_PASSWORD=123456" + ] + } + } + }, + { + "title": "Project Zomboid", + "language": "en_us", + "platform": "Linux", + "description": "For Linux systems, using a third-party Docker image of Project Zomboid for quick server deployment!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/pzomboid.webp", + "gameType": "Zombie Survival", + "category": "Latest Version", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 4G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["Docker version"], + "setupInfo": { + "startCommand": "", + "stopCommand": "stop", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": ["Project Zomboid"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "renegademaster/zomboid-dedicated-server:latest", + "containerName": "zomboid-dedicated-server", + "ports": ["{mcsm_port2}:16262/udp", "{mcsm_port1}:16261/udp"], + "extraVolumes": [ + "{mcsm_workspace}/ZomboidConfig|/home/steam/Zomboid", + "{mcsm_workspace}/ZomboidDedicatedServer|/home/steam/ZomboidDedicatedServer" + ], + "memory": 4096, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "", + "env": [], + "changeWorkdir": false + } + } + }, + + { + "title": "Terraria Server", + "language": "en_us", + "platform": "Linux", + "description": "For Linux systems, using a third-party Docker image of Terraria for quick server deployment!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/terraria.webp", + "gameType": "Terraria", + "category": "Latest Version", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 4G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["Docker version"], + "setupInfo": { + "startCommand": "", + "stopCommand": "exit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/terraria", + "tag": ["terraria"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "ryshe/terraria:latest", + "containerName": "terraria-server", + "ports": ["{mcsm_port1}:7777/tcp"], + "extraVolumes": [], + "memory": 4096, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "/root/.local/share/Terraria/Worlds", + "env": [], + "changeWorkdir": false + } + } + }, { + "platform": "ALL", "language": "en_us", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", "gameType": "Minecraft", @@ -294,10 +462,10 @@ } }, { + "platform": "Linux", "language": "en_us", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", "gameType": "Minecraft", - "platform": "Linux", "description": "Forge 1.21.1 Server for Linux", "title": "Forge 1.21.1 (Supports Mods)", "category": "mc-forge", @@ -317,10 +485,10 @@ } }, { + "platform": "Windows", "language": "en_us", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", "gameType": "Minecraft", - "platform": "Windows", "description": "Forge 1.21.1 Server for Windows", "title": "Forge 1.21.1 (Supports Mods)", "category": "mc-forge", @@ -332,12 +500,150 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "sh ./run.bat", + "startCommand": "start.bat", "stopCommand": "stop", "updateCommand": "java -jar forge-1.21.1-52.1.1-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-purpur.webp", + "description": "[Purpur] Minecraft 1.21.4 Purpur", + "title": "Minecraft 1.21.4", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2416.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2416.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "[Paper] Minecraft 1.21.4 Paper", + "title": "Minecraft 1.21.4", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-232.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "[Vanilla] Minecraft 1.21.8", + "title": "Minecraft 1.21.8", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "[Vanilla] Minecraft 1.21.4", + "title": "Minecraft 1.21.4", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-fabric.webp", + "description": "Minecraft 1.21.4 with Fabric Loader", + "title": "Fabric 1.21.4 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-fabric.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.8 with Fabric Loader", + "title": "Fabric 1.21.8 (Supports Mods)", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.8 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } } ] } From e31dd39bd6cd5986be75f0c4abddb8a60522aef3 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Tue, 12 Aug 2025 19:15:40 +0800 Subject: [PATCH 348/463] feat: test new config --- market.json | 79 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 17 deletions(-) diff --git a/market.json b/market.json index 3d20036..9e81a8c 100644 --- a/market.json +++ b/market.json @@ -22,7 +22,7 @@ "gameType": "Palworld", "category": "最新版本", "runtime": "Windows 10+", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "", "targetLink": "", "author": "MCSManager", @@ -46,7 +46,7 @@ "gameType": "Palworld", "category": "最新版本", "runtime": "Ubuntu/Centos LTS", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "", "targetLink": "", "author": "MCSManager", @@ -84,7 +84,7 @@ "gameType": "Zombie Survival", "category": "最新版本", "runtime": "Ubuntu/Centos LTS", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "", "targetLink": "", "author": "MCSManager", @@ -126,7 +126,7 @@ "gameType": "Terraria", "category": "最新版本", "runtime": "Ubuntu/Centos LTS", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "", "targetLink": "", "author": "MCSManager", @@ -155,7 +155,52 @@ } } }, - + { + "platform": "ALL", + "language": "zh_cn", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "[Paper] Minecraft 1.21.8 Paper 快速开服", + "title": "Paper Minecraft 1.21.8 快速开服,性能强,占用少,支持插件,不支持模组", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "100MB", + "remark": "仅包含 Paper 版本", + "targetLink": "https://fill-data.papermc.io/v1/objects/d310c61899acc608b683515c5c7ef929774bfd1b90262dac965e76c7e9ea8d22/paper-1.21.8-30.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-30.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "zh_cn", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "[Paper] Minecraft 1.20.1 Paper 快速开服", + "title": "Paper Minecraft 1.20.1 快速开服,性能强,占用少,支持插件,不支持模组", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "100MB", + "remark": "仅包含 Paper 版本", + "targetLink": "https://fill-data.papermc.io/v1/objects/234a9b32098100c6fc116664d64e36ccdb58b5b649af0f80bcccb08b0255eaea/paper-1.20.1-196.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.1-196.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "zh_cn", "platform": "ALL", @@ -165,7 +210,7 @@ "title": "Minecraft 1.21.1 快速开服", "category": "mc-paper", "runtime": "Java 17+", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "250MB", "remark": "包含基础插件,萌新快速开服!低配机器专属!", "targetLink": "https://cloud.alongw.cn/f/DzvHK/Paper-1.21.1-ZH.zip", @@ -251,7 +296,7 @@ { "language": "zh_cn", "platform": "Windows", - "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", + "description": "适用于 Windows 系统,支持 Minecraft Forge 模组,快速开服!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.20.6 Java 版 (支持模组)", @@ -274,7 +319,7 @@ { "language": "zh_cn", "platform": "Windows", - "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", + "description": "适用于 Windows 系统,支持 Minecraft Forge 模组,快速开服!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "title": "Forge 1.19.2 Java 版 (支持模组)", @@ -305,7 +350,7 @@ "gameType": "Palworld", "category": "Latest Version", "runtime": "Windows 10+", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "", "targetLink": "", "author": "MCSManager", @@ -329,7 +374,7 @@ "gameType": "Palworld", "category": "Latest Version", "runtime": "Ubuntu/Centos LTS", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "", "targetLink": "", "author": "MCSManager", @@ -367,7 +412,7 @@ "gameType": "Zombie Survival", "category": "Latest Version", "runtime": "Ubuntu/Centos LTS", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "", "targetLink": "", "author": "MCSManager", @@ -409,7 +454,7 @@ "gameType": "Terraria", "category": "Latest Version", "runtime": "Ubuntu/Centos LTS", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "", "targetLink": "", "author": "MCSManager", @@ -447,7 +492,7 @@ "title": "Minecraft 1.21.8", "category": "mc-purpur", "runtime": "Java 21+", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "55MB", "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", @@ -516,7 +561,7 @@ "title": "Minecraft 1.21.4", "category": "mc-purpur", "runtime": "Java 21+", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "50MB", "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2416.jar", @@ -539,7 +584,7 @@ "title": "Minecraft 1.21.4", "category": "mc-paper", "runtime": "Java 21+", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "50MB", "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", @@ -608,7 +653,7 @@ "title": "Fabric 1.21.4 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 21+", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "5MB", "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", @@ -631,7 +676,7 @@ "title": "Fabric 1.21.8 (Supports Mods)", "category": "mc-fabric", "runtime": "Java 21+", - "hardware": "RAM 4G+", + "hardware": "RAM 8G+", "size": "5MB", "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", From b405ed29e46e97fac9df311c1afa52a85929d528 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Tue, 12 Aug 2025 19:16:11 +0800 Subject: [PATCH 349/463] feat: test new config --- market.json | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/market.json b/market.json index 9e81a8c..4e6d077 100644 --- a/market.json +++ b/market.json @@ -483,6 +483,52 @@ } } }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "[Paper] Minecraft 1.21.8 Paper Quick Server Setup", + "title": "Paper Minecraft 1.21.8 Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "100MB", + "remark": "Paper version only", + "targetLink": "https://fill-data.papermc.io/v1/objects/d310c61899acc608b683515c5c7ef929774bfd1b90262dac965e76c7e9ea8d22/paper-1.21.8-30.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-30.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "[Paper] Minecraft 1.20.1 Paper Quick Server Setup", + "title": "Paper Minecraft 1.20.1 Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "100MB", + "remark": "Paper version only", + "targetLink": "https://fill-data.papermc.io/v1/objects/234a9b32098100c6fc116664d64e36ccdb58b5b649af0f80bcccb08b0255eaea/paper-1.20.1-196.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.1-196.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "ALL", "language": "en_us", From df39fa835cb828b372020deae46b3e095f32f2d0 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Tue, 12 Aug 2025 19:17:39 +0800 Subject: [PATCH 350/463] feat: test new config --- market.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/market.json b/market.json index 4e6d077..aba3874 100644 --- a/market.json +++ b/market.json @@ -160,8 +160,8 @@ "language": "zh_cn", "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "[Paper] Minecraft 1.21.8 Paper 快速开服", - "title": "Paper Minecraft 1.21.8 快速开服,性能强,占用少,支持插件,不支持模组", + "description": "Paper Minecraft 1.21.8 快速开服,性能强,占用少,支持插件,不支持模组", + "title": "[Paper] Minecraft 1.21.8 Paper 快速开服", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -183,8 +183,8 @@ "language": "zh_cn", "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "[Paper] Minecraft 1.20.1 Paper 快速开服", - "title": "Paper Minecraft 1.20.1 快速开服,性能强,占用少,支持插件,不支持模组", + "description": "Paper Minecraft 1.20.1 快速开服,性能强,占用少,支持插件,不支持模组", + "title": "[Paper] Minecraft 1.20.1 Paper 快速开服", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -488,8 +488,8 @@ "language": "en_us", "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "[Paper] Minecraft 1.21.8 Paper Quick Server Setup", - "title": "Paper Minecraft 1.21.8 Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "description": "[Paper] Minecraft 1.21.8 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "Paper Minecraft 1.21.8 Quick Server Setup", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -511,8 +511,8 @@ "language": "en_us", "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "[Paper] Minecraft 1.20.1 Paper Quick Server Setup", - "title": "Paper Minecraft 1.20.1 Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "description": "[Paper] Minecraft 1.20.1 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "Paper Minecraft 1.20.1 Quick Server Setup", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 8G+", From 7b15861251bb9aed8df950f5df15a009bd2ddabc Mon Sep 17 00:00:00 2001 From: Yumao Date: Wed, 13 Aug 2025 20:31:14 +0800 Subject: [PATCH 351/463] Update market.json --- market.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/market.json b/market.json index aba3874..9cb8a7f 100644 --- a/market.json +++ b/market.json @@ -602,7 +602,7 @@ "platform": "ALL", "language": "en_us", "gameType": "Minecraft", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-purpur.webp", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "description": "[Purpur] Minecraft 1.21.4 Purpur", "title": "Minecraft 1.21.4", "category": "mc-purpur", @@ -694,7 +694,7 @@ "platform": "ALL", "language": "en_us", "gameType": "Minecraft", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-fabric.webp", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "description": "Minecraft 1.21.4 with Fabric Loader", "title": "Fabric 1.21.4 (Supports Mods)", "category": "mc-fabric", @@ -716,7 +716,7 @@ { "platform": "ALL", "language": "en_us", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-fabric.webp", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "description": "Minecraft 1.21.8 with Fabric Loader", "title": "Fabric 1.21.8 (Supports Mods)", From 8ac50703a6424f21189235c332a25706c354093a Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sat, 16 Aug 2025 19:48:10 +0800 Subject: [PATCH 352/463] =?UTF-8?q?feat:=20=E6=8D=A2=E4=B8=AA=E5=9B=BE?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- market.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/market.json b/market.json index 9cb8a7f..de4e39d 100644 --- a/market.json +++ b/market.json @@ -251,7 +251,7 @@ "language": "zh_cn", "platform": "Linux", "description": "Minecraft Forge 1.20.1 服务器,支持 Forge 模组!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-mod.webp", "gameType": "Minecraft", "title": "Forge 1.20.1 Java 版 (支持模组)", "category": "mc-forge", @@ -274,7 +274,7 @@ "language": "zh_cn", "platform": "Windows", "description": "Minecraft Forge 1.20.1 服务器,支持 Forge 模组!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-mod.webp", "gameType": "Minecraft", "title": "Forge 1.20.1 Java 版 (支持模组)", "category": "mc-forge", @@ -297,7 +297,7 @@ "language": "zh_cn", "platform": "Windows", "description": "适用于 Windows 系统,支持 Minecraft Forge 模组,快速开服!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-mod.webp", "gameType": "Minecraft", "title": "Forge 1.20.6 Java 版 (支持模组)", "category": "mc-forge", @@ -320,7 +320,7 @@ "language": "zh_cn", "platform": "Windows", "description": "适用于 Windows 系统,支持 Minecraft Forge 模组,快速开服!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-mod.webp", "gameType": "Minecraft", "title": "Forge 1.19.2 Java 版 (支持模组)", "category": "mc-forge", @@ -555,7 +555,7 @@ { "platform": "Linux", "language": "en_us", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-mod.webp", "gameType": "Minecraft", "description": "Forge 1.21.1 Server for Linux", "title": "Forge 1.21.1 (Supports Mods)", @@ -578,7 +578,7 @@ { "platform": "Windows", "language": "en_us", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-mod.webp", "gameType": "Minecraft", "description": "Forge 1.21.1 Server for Windows", "title": "Forge 1.21.1 (Supports Mods)", From a2d9f9513287208254645ae8432efd0736ed8130 Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sat, 16 Aug 2025 19:58:58 +0800 Subject: [PATCH 353/463] feat: del windows --- market.json | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/market.json b/market.json index de4e39d..e59f968 100644 --- a/market.json +++ b/market.json @@ -12,31 +12,6 @@ } ], "packages": [ - { - "title": "幻兽帕鲁官方服务器", - "language": "zh_cn", - "platform": "Windows", - "description": "适用于 Windows 的帕鲁们的最佳服务器!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", - "remark": "", - "gameType": "Palworld", - "category": "最新版本", - "runtime": "Windows 10+", - "hardware": "RAM 8G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": ["仅适合个人使用", "Windows 版"], - "setupInfo": { - "tag": ["Palworld"], - "type": "steam/universal", - "startCommand": "PalServer.exe", - "stopCommand": "exit", - "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2394010 +quit", - "ie": "utf-8", - "oe": "utf-8" - } - }, { "title": "幻兽帕鲁官方服务器", "language": "zh_cn", @@ -116,7 +91,6 @@ } } }, - { "title": "Terraria 服务器", "language": "zh_cn", @@ -339,32 +313,6 @@ "oe": "utf-8" } }, - - { - "title": "Palworld Official Server", - "language": "en_us", - "platform": "Windows", - "description": "The best Palworld server for Windows!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", - "remark": "", - "gameType": "Palworld", - "category": "Latest Version", - "runtime": "Windows 10+", - "hardware": "RAM 8G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": ["Windows version"], - "setupInfo": { - "tag": ["Palworld"], - "type": "steam/universal", - "startCommand": "PalServer.exe", - "stopCommand": "exit", - "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2394010 +quit", - "ie": "utf-8", - "oe": "utf-8" - } - }, { "title": "Palworld Official Server", "language": "en_us", From 54db55d52c63d299fe28669fcda0a0dcd7c75aec Mon Sep 17 00:00:00 2001 From: mmyddd Date: Sat, 16 Aug 2025 20:48:51 +0800 Subject: [PATCH 354/463] =?UTF-8?q?=E6=A3=AE=E6=9E=97=E4=B9=8B=E5=AD=90?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- market.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/market.json b/market.json index 9cb8a7f..42ec6ed 100644 --- a/market.json +++ b/market.json @@ -735,6 +735,31 @@ "ie": "utf-8", "oe": "utf-8" } + }, + { + "title": "森林之子 服务器", + "language": "zh_cn", + "platform": "Windows", + "description": "森林之子服务器,适用于 Windows 系统", + "image": "https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/1326470/header.jpg?t=1708624856", + "remark": "请在防火墙放行8766(UDP) 27016(UDP) 9700(UDP)端口", + "gameType": "Son Of The Forest", + "category": "最新版本", + "runtime": "Windows 10+", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["仅适合个人使用", "Windows 版"], + "setupInfo": { + "tag": ["SonsOfTheForest"], + "type": "steam/universal", + "startCommand": "set SteamAppId=1326470 && set SteamGameId=1326470 && SonsOfTheForestDS.exe -userdatapath \"{mcsm_workspace}/userdata\" | consoleparser -colorize", + "stopCommand": "^C", + "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2465200 +quit", + "ie": "utf-8", + "oe": "utf-8" + } } ] } From c387b675de916d99292564a223a261bf738d75b4 Mon Sep 17 00:00:00 2001 From: mmyddd Date: Sat, 16 Aug 2025 21:50:21 +0800 Subject: [PATCH 355/463] =?UTF-8?q?scpsl=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- market.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/market.json b/market.json index 42ec6ed..f7fd721 100644 --- a/market.json +++ b/market.json @@ -760,6 +760,31 @@ "ie": "utf-8", "oe": "utf-8" } + }, + { + "title": "SCP秘密实验室 服务器", + "language": "zh_cn", + "platform": "Windows", + "description": "SCP秘密实验室服务器,适用于 Windows 系统", + "image": "https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/700330/dad38399643cda1a4084b1faff60452427bef8c0/header.jpg?t=1747606719", + "remark": "第一次启动需要配置", + "gameType": "SCP秘密实验室", + "category": "最新版本", + "runtime": "Windows 10+", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["仅适合个人使用", "Windows 版"], + "setupInfo": { + "tag": ["SCP秘密实验室"], + "type": "steam/universal", + "startCommand": "LocalAdmin.exe", + "stopCommand": "stop", + "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 996560 +quit", + "ie": "utf-8", + "oe": "utf-8" + } } ] } From c06f43628209ae59a2debd602563ef28648ff275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Sat, 16 Aug 2025 22:38:02 +0800 Subject: [PATCH 356/463] Update market.json --- market.json | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/market.json b/market.json index e59f968..f19eb85 100644 --- a/market.json +++ b/market.json @@ -392,7 +392,6 @@ } } }, - { "title": "Terraria Server", "language": "en_us", @@ -683,6 +682,52 @@ "ie": "utf-8", "oe": "utf-8" } + }, + { + "title": "Squad 服务器", + "language": "zh_cn", + "platform": "Windows", + "description": "适用于 Windows 系统,快速开服", + "image": "https://squadovo.cn/img/header.jpg", + "gameType": "Squad", + "category": "最新版本", + "runtime": "Windows Server", + "hardware": "Intel Core 平台、RAM 8G+", + "size": "20GB", + "author": "南赛", + "remark": "需安装 Visual C++ 才可以运行", + "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", + "setupInfo": { + "type": "steam/universal", + "startCommand": ""steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", + "stopCommand": "^C", + "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "title": "Squad Server", + "language": "en_us", + "platform": "Windows", + "description": "Suitable for Windows system, quick server setup", + "image": "https://squadovo.cn/img/header.jpg", + "gameType": "Squad", + "category": "Latest Version", + "runtime": "Windows Server", + "hardware": "Intel Core platform、RAM 8G+", + "size": "20GB", + "author": "南赛", + "remark": "Need to install Visual C++", + "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", + "setupInfo": { + "type": "steam/universal", + "startCommand": ""steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", + "stopCommand": "^C", + "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", + "ie": "utf-8", + "oe": "utf-8" + } } ] } From 04e73ed8e490f68dccec8758f00a05f7fda07e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Sat, 16 Aug 2025 22:41:18 +0800 Subject: [PATCH 357/463] Update market.json --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index f19eb85..b03c4c8 100644 --- a/market.json +++ b/market.json @@ -699,7 +699,7 @@ "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", "setupInfo": { "type": "steam/universal", - "startCommand": ""steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", + "startCommand": ""\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", "stopCommand": "^C", "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", "ie": "utf-8", @@ -722,7 +722,7 @@ "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", "setupInfo": { "type": "steam/universal", - "startCommand": ""steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", + "startCommand": ""\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", "stopCommand": "^C", "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", "ie": "utf-8", From c17d91e0cf877a7e9e6fd8cea1bfaf895ece0314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Sat, 16 Aug 2025 22:41:50 +0800 Subject: [PATCH 358/463] Update market.json --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index b03c4c8..25b58a2 100644 --- a/market.json +++ b/market.json @@ -699,7 +699,7 @@ "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", "setupInfo": { "type": "steam/universal", - "startCommand": ""\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", + "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", "stopCommand": "^C", "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", "ie": "utf-8", @@ -722,7 +722,7 @@ "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", "setupInfo": { "type": "steam/universal", - "startCommand": ""\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", + "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", "stopCommand": "^C", "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", "ie": "utf-8", From 3518729cf7a61bff39642647d43b98f96b61994c Mon Sep 17 00:00:00 2001 From: mmyddd <98249707+mmyddd@users.noreply.github.com> Date: Sun, 17 Aug 2025 04:20:07 +0800 Subject: [PATCH 359/463] Update market.json --- market.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/market.json b/market.json index f7fd721..84439f1 100644 --- a/market.json +++ b/market.json @@ -747,9 +747,9 @@ "category": "最新版本", "runtime": "Windows 10+", "hardware": "RAM 8G+", - "size": "", + "size": "3.5GB", "targetLink": "", - "author": "MCSManager", + "author": "mmyddd", "tags": ["仅适合个人使用", "Windows 版"], "setupInfo": { "tag": ["SonsOfTheForest"], @@ -772,9 +772,9 @@ "category": "最新版本", "runtime": "Windows 10+", "hardware": "RAM 8G+", - "size": "", + "size": "1GB", "targetLink": "", - "author": "MCSManager", + "author": "mmyddd", "tags": ["仅适合个人使用", "Windows 版"], "setupInfo": { "tag": ["SCP秘密实验室"], From da36630164cd13015eea24a6ee9e0fbcb8693775 Mon Sep 17 00:00:00 2001 From: mmyddd <98249707+mmyddd@users.noreply.github.com> Date: Sun, 17 Aug 2025 04:31:39 +0800 Subject: [PATCH 360/463] =?UTF-8?q?=E8=A7=84=E8=8C=83=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=EF=BC=8C=E5=A2=9E=E5=8A=A0enus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- market.json | 78 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 64 insertions(+), 14 deletions(-) diff --git a/market.json b/market.json index 84439f1..1567f0a 100644 --- a/market.json +++ b/market.json @@ -339,6 +339,56 @@ "oe": "utf-8" } }, + { + "title": "森林之子 服务器", + "language": "zh_cn", + "platform": "Windows", + "description": "森林之子服务器,适用于 Windows 系统", + "image": "https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/1326470/header.jpg?t=1708624856", + "remark": "请在防火墙放行8766(UDP) 27016(UDP) 9700(UDP)端口", + "gameType": "Son Of The Forest", + "category": "最新版本", + "runtime": "Windows 10+", + "hardware": "RAM 8G+", + "size": "3.5GB", + "targetLink": "", + "author": "mmyddd", + "tags": ["仅适合个人使用", "Windows 版"], + "setupInfo": { + "tag": ["SonsOfTheForest"], + "type": "steam/universal", + "startCommand": "set SteamAppId=1326470 && set SteamGameId=1326470 && SonsOfTheForestDS.exe -userdatapath \"{mcsm_workspace}/userdata\" | consoleparser -colorize", + "stopCommand": "^C", + "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2465200 +quit", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "title": "SCP秘密实验室 服务器", + "language": "zh_cn", + "platform": "Windows", + "description": "SCP秘密实验室服务器,适用于 Windows 系统", + "image": "https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/700330/dad38399643cda1a4084b1faff60452427bef8c0/header.jpg?t=1747606719", + "remark": "第一次启动需要在控制台配置。服务器设置路径:%APPDATA%/SCP Secret Laboratory/config/{启动时控制台设置的端口}", + "gameType": "SCP秘密实验室", + "category": "最新版本", + "runtime": "Windows 10+", + "hardware": "RAM 8G+", + "size": "1GB", + "targetLink": "", + "author": "mmyddd", + "tags": ["仅适合个人使用", "Windows 版"], + "setupInfo": { + "tag": ["SCP秘密实验室"], + "type": "steam/universal", + "startCommand": "LocalAdmin.exe", + "stopCommand": "stop", + "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 996560 +quit", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "title": "Palworld Official Server", @@ -737,20 +787,20 @@ } }, { - "title": "森林之子 服务器", - "language": "zh_cn", + "title": "Son Of The Forest Offical Server", + "language": "en_us", "platform": "Windows", - "description": "森林之子服务器,适用于 Windows 系统", + "description": "Son Of The Forest Server for Windows system.", "image": "https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/1326470/header.jpg?t=1708624856", - "remark": "请在防火墙放行8766(UDP) 27016(UDP) 9700(UDP)端口", + "remark": "Please allow port 8766 (UDP) 27016 (UDP) 9700 (UDP) to pass through the firewall.", "gameType": "Son Of The Forest", - "category": "最新版本", + "category": "latest", "runtime": "Windows 10+", "hardware": "RAM 8G+", "size": "3.5GB", "targetLink": "", "author": "mmyddd", - "tags": ["仅适合个人使用", "Windows 版"], + "tags": ["Windows version"], "setupInfo": { "tag": ["SonsOfTheForest"], "type": "steam/universal", @@ -762,22 +812,22 @@ } }, { - "title": "SCP秘密实验室 服务器", - "language": "zh_cn", + "title": "SCP:SL Offical Server", + "language": "en_us", "platform": "Windows", - "description": "SCP秘密实验室服务器,适用于 Windows 系统", + "description": "SCP:SL Offical Server for Windows systen", "image": "https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/700330/dad38399643cda1a4084b1faff60452427bef8c0/header.jpg?t=1747606719", - "remark": "第一次启动需要配置", - "gameType": "SCP秘密实验室", - "category": "最新版本", + "remark": "The first startup requires configuration in the console.Server Config Path:%APPDATA%/SCP Secret Laboratory/config/{port}", + "gameType": "SCP:SL", + "category": "latest", "runtime": "Windows 10+", "hardware": "RAM 8G+", "size": "1GB", "targetLink": "", "author": "mmyddd", - "tags": ["仅适合个人使用", "Windows 版"], + "tags": ["Windows version"], "setupInfo": { - "tag": ["SCP秘密实验室"], + "tag": ["SCP:SL"], "type": "steam/universal", "startCommand": "LocalAdmin.exe", "stopCommand": "stop", From a545241e92906ccfcdd59dd4a74b4ce67788f724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=9C=E5=86=BB?= <414630368@qq.com> Date: Sun, 17 Aug 2025 14:24:31 +0800 Subject: [PATCH 361/463] =?UTF-8?q?=E6=B7=BB=E5=8A=A0EndstoneMC=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- market.json | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/market.json b/market.json index e59f968..cba85a3 100644 --- a/market.json +++ b/market.json @@ -683,6 +683,44 @@ "ie": "utf-8", "oe": "utf-8" } + }, + { + "title": "EndstoneMC官方服务器", + "language": "zh_cn", + "platform": "Linux", + "description": "适用于 Linux 系统,使用Endstone官方Docker镜像,一键快速开服!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "category": "最新版本", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 2G+", + "size": "", + "targetLink": "", + "author": "EndstoneMC", + "tags": ["可以商业出租","Docker版","官方镜像"], + "setupInfo": { + "startCommand": "endstone -y -s .", + "stopCommand": "stop", + "ie": "utf8", + "oe": "utf8", + "type": "minecraft/bedrock", + "tag": ["bedrock"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "endstone/endstone:latest", + "containerName": "endstone-server", + "ports": ["{mcsm_port1}:19132/udp"], + "extraVolumes": [], + "memory": 2048, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "", + "env": [], + "changeWorkdir": true + } + } } ] } From 0b6b1dc7b29891d2e764cc7d90cd762b2f1d275e Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 17 Aug 2025 18:26:29 +0800 Subject: [PATCH 362/463] feat: update market --- market.json | 60 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/market.json b/market.json index 82b2c29..fd11d6d 100644 --- a/market.json +++ b/market.json @@ -687,21 +687,21 @@ "title": "Squad 服务器", "language": "zh_cn", "platform": "Windows", - "description": "适用于 Windows 系统,快速开服", + "description": "适用于 Windows 系统的战术新队服务器,快速开服", "image": "https://squadovo.cn/img/header.jpg", "gameType": "Squad", "category": "最新版本", - "runtime": "Windows Server", + "runtime": "Windows", "hardware": "Intel Core 平台、RAM 8G+", "size": "20GB", "author": "南赛", "remark": "需安装 Visual C++ 才可以运行", - "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", + "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", "setupInfo": { "type": "steam/universal", "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", "stopCommand": "^C", - "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", + "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", "ie": "utf-8", "oe": "utf-8" } @@ -719,30 +719,68 @@ "size": "20GB", "author": "南赛", "remark": "Need to install Visual C++", - "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", + "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", "setupInfo": { "type": "steam/universal", "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", "stopCommand": "^C", - "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", + "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", "ie": "utf-8", "oe": "utf-8" } }, { - "title": "EndstoneMC官方服务器", + "title": "EndStone MC 服务端", "language": "zh_cn", "platform": "Linux", - "description": "适用于 Linux 系统,使用Endstone官方Docker镜像,一键快速开服!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "适用于 Linux 系统,使用 EndStone MC 官方 Docker 镜像,一键快速开服!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/endstone_mc.webp", "gameType": "Minecraft", "category": "最新版本", "runtime": "Ubuntu/Centos LTS", "hardware": "RAM 2G+", "size": "", "targetLink": "", - "author": "EndstoneMC", - "tags": ["可以商业出租","Docker版","官方镜像"], + "author": "EndStone", + "tags": ["可以商业出租", "Docker版"], + "setupInfo": { + "startCommand": "endstone -y -s .", + "stopCommand": "stop", + "ie": "utf8", + "oe": "utf8", + "type": "minecraft/bedrock", + "tag": ["bedrock"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "endstone/endstone:latest", + "containerName": "endstone-server", + "ports": ["{mcsm_port1}:19132/udp"], + "extraVolumes": [], + "memory": 2048, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "", + "env": [], + "changeWorkdir": true + } + } + }, + { + "title": "EndStone MC Server", + "language": "en_us", + "platform": "Linux", + "description": "For Linux, using the official EndStone MC Docker image, one-click to quickly set up the server!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/endstone_mc.webp", + "gameType": "Minecraft", + "category": "Latest Version", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 2G+", + "size": "", + "targetLink": "", + "author": "EndStone", + "tags": ["Docker version"], "setupInfo": { "startCommand": "endstone -y -s .", "stopCommand": "stop", From 38164f34f421e2de2320679821d8f28d447b8fde Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 17 Aug 2025 18:27:28 +0800 Subject: [PATCH 363/463] feat: update market --- templates.json | 189 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) diff --git a/templates.json b/templates.json index 6bd8682..f2fb252 100644 --- a/templates.json +++ b/templates.json @@ -1775,6 +1775,195 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Paper] Minecraft 1.21.8 Paper", + "title": "Minecraft 1.21.8", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/10/downloads/paper-1.21.8-10.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-10.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Paper] Minecraft 1.21.6 Paper", + "title": "Minecraft 1.21.6", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.6/builds/48/downloads/paper-1.21.4-48.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.6-48.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Paper] Minecraft 1.21.4 Paper", + "title": "Minecraft 1.21.4", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-232.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Paper] Minecraft 1.21.3 Paper", + "title": "Minecraft 1.21.3", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.3/builds/82/downloads/paper-1.21.3-82.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.3-82.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Paper] Minecraft 1.21.1 Paper", + "title": "Minecraft 1.21.1", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/132/downloads/paper-1.21.1-132.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.1-132.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Paper] Minecraft 1.20.6 Paper", + "title": "Minecraft 1.20.6", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.6/builds/151/downloads/paper-1.20.6-151.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.6-151.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Paper] Minecraft 1.20.4 Paper", + "title": "Minecraft 1.20.4", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/499/downloads/paper-1.20.4-499.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.4-499.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Paper] Minecraft 1.20.2 Paper", + "title": "Minecraft 1.20.2", + "category": "mc-paper", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "150MB", + "remark": "Includes some basic plugins", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.2/builds/318/downloads/paper-1.20.2-318.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.2-318.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Paper] Minecraft 1.20.1 Paper", + "title": "Minecraft 1.20.1", + "category": "mc-paper", + "runtime": "Java 17+", + "hardware": "RAM 4G+", + "size": "200MB", + "remark": "Includes some basic plugins", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.1/builds/196/downloads/paper-1.20.1-196.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.1-196.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "zh_cn", "gameType": "Minecraft", From c4a25c52c30df3d8e8e3f071e39ea77cf95d2f38 Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 17 Aug 2025 18:32:31 +0800 Subject: [PATCH 364/463] feat: update market --- market.json | 186 ++++++++++++++++++++++++++-------------------------- 1 file changed, 94 insertions(+), 92 deletions(-) diff --git a/market.json b/market.json index fd11d6d..6219e01 100644 --- a/market.json +++ b/market.json @@ -12,6 +12,52 @@ } ], "packages": [ + { + "language": "zh_cn", + "platform": "ALL", + "description": "[Paper] Minecraft 1.21.1 快速开服", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/wallpaper.webp", + "gameType": "Minecraft", + "title": "Minecraft 1.21.1 快速开服", + "category": "mc-paper", + "runtime": "Java 17+", + "hardware": "RAM 8G+", + "size": "250MB", + "remark": "包含基础插件,萌新快速开服!低配机器专属!", + "targetLink": "https://cloud.alongw.cn/f/DzvHK/Paper-1.21.1-ZH.zip", + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms4096M -Xmx4096M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "zh_cn", + "platform": "ALL", + "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/wallpaper.webp", + "gameType": "Minecraft", + "title": "Minecraft 1.20.4", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 6G+", + "size": "140MB", + "remark": "支持插件,最低 8GB 内存要求", + "targetLink": "https://url.alww.top/mcsm/paper1.20.4.zip", + "author": "alongw.cn", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms6144M -Xmx6144M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "title": "幻兽帕鲁官方服务器", "language": "zh_cn", @@ -129,6 +175,52 @@ } } }, + { + "title": "Squad 服务器", + "language": "zh_cn", + "platform": "Windows", + "description": "适用于 Windows 系统的战术新队服务器,快速开服", + "image": "https://squadovo.cn/img/header.jpg", + "gameType": "Squad", + "category": "最新版本", + "runtime": "Windows", + "hardware": "Intel Core 平台、RAM 8G+", + "size": "20GB", + "author": "南赛", + "remark": "需安装 Visual C++ 才可以运行", + "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", + "setupInfo": { + "type": "steam/universal", + "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", + "stopCommand": "^C", + "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "title": "Squad Server", + "language": "en_us", + "platform": "Windows", + "description": "Suitable for Windows system, quick server setup", + "image": "https://squadovo.cn/img/header.jpg", + "gameType": "Squad", + "category": "Latest Version", + "runtime": "Windows Server", + "hardware": "Intel Core platform、RAM 8G+", + "size": "20GB", + "author": "南赛", + "remark": "Need to install Visual C++", + "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", + "setupInfo": { + "type": "steam/universal", + "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", + "stopCommand": "^C", + "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "ALL", "language": "zh_cn", @@ -175,52 +267,7 @@ "oe": "utf-8" } }, - { - "language": "zh_cn", - "platform": "ALL", - "description": "[Paper] Minecraft 1.21.1 快速开服", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.21.1 快速开服", - "category": "mc-paper", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "250MB", - "remark": "包含基础插件,萌新快速开服!低配机器专属!", - "targetLink": "https://cloud.alongw.cn/f/DzvHK/Paper-1.21.1-ZH.zip", - "author": "alongw.cn", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms4096M -Xmx4096M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "zh_cn", - "platform": "ALL", - "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "gameType": "Minecraft", - "title": "Minecraft 1.20.4", - "category": "mc-paper", - "runtime": "Java 21+", - "hardware": "RAM 6G+", - "size": "140MB", - "remark": "支持插件,最低 8GB 内存要求", - "targetLink": "https://url.alww.top/mcsm/paper1.20.4.zip", - "author": "alongw.cn", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms6144M -Xmx6144M -jar server.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, + { "language": "zh_cn", "platform": "Linux", @@ -683,52 +730,7 @@ "oe": "utf-8" } }, - { - "title": "Squad 服务器", - "language": "zh_cn", - "platform": "Windows", - "description": "适用于 Windows 系统的战术新队服务器,快速开服", - "image": "https://squadovo.cn/img/header.jpg", - "gameType": "Squad", - "category": "最新版本", - "runtime": "Windows", - "hardware": "Intel Core 平台、RAM 8G+", - "size": "20GB", - "author": "南赛", - "remark": "需安装 Visual C++ 才可以运行", - "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", - "setupInfo": { - "type": "steam/universal", - "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", - "stopCommand": "^C", - "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "title": "Squad Server", - "language": "en_us", - "platform": "Windows", - "description": "Suitable for Windows system, quick server setup", - "image": "https://squadovo.cn/img/header.jpg", - "gameType": "Squad", - "category": "Latest Version", - "runtime": "Windows Server", - "hardware": "Intel Core platform、RAM 8G+", - "size": "20GB", - "author": "南赛", - "remark": "Need to install Visual C++", - "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", - "setupInfo": { - "type": "steam/universal", - "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", - "stopCommand": "^C", - "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", - "ie": "utf-8", - "oe": "utf-8" - } - }, + { "title": "EndStone MC 服务端", "language": "zh_cn", From 964f611fcb3b89fec4798342573457b528b1f81b Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 17 Aug 2025 18:33:43 +0800 Subject: [PATCH 365/463] feat: update market --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index 6219e01..bdc68d9 100644 --- a/market.json +++ b/market.json @@ -138,7 +138,7 @@ } }, { - "title": "Terraria 服务器", + "title": "泰拉瑞亚服务器", "language": "zh_cn", "platform": "Linux", "description": "适用于 Linux 系统,使用《Terraria》第三方 Docker 镜像,快速开服!", @@ -176,7 +176,7 @@ } }, { - "title": "Squad 服务器", + "title": "战术小队服务器", "language": "zh_cn", "platform": "Windows", "description": "适用于 Windows 系统的战术新队服务器,快速开服", From c4939be2a01331099737c31c37a922b94b221c8f Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 17 Aug 2025 18:34:31 +0800 Subject: [PATCH 366/463] feat: update market --- market.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/market.json b/market.json index bdc68d9..f35cf94 100644 --- a/market.json +++ b/market.json @@ -15,7 +15,7 @@ { "language": "zh_cn", "platform": "ALL", - "description": "[Paper] Minecraft 1.21.1 快速开服", + "description": " Minecraft 1.21.1 快速开服", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/wallpaper.webp", "gameType": "Minecraft", "title": "Minecraft 1.21.1 快速开服", @@ -38,7 +38,7 @@ { "language": "zh_cn", "platform": "ALL", - "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", + "description": " 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/wallpaper.webp", "gameType": "Minecraft", "title": "Minecraft 1.20.4", @@ -227,7 +227,7 @@ "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "description": "Paper Minecraft 1.21.8 快速开服,性能强,占用少,支持插件,不支持模组", - "title": "[Paper] Minecraft 1.21.8 Paper 快速开服", + "title": "Minecraft 1.21.8 Paper 快速开服", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -250,7 +250,7 @@ "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "description": "Paper Minecraft 1.20.1 快速开服,性能强,占用少,支持插件,不支持模组", - "title": "[Paper] Minecraft 1.20.1 Paper 快速开服", + "title": "Minecraft 1.20.1 Paper 快速开服", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -482,7 +482,7 @@ "language": "en_us", "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "[Paper] Minecraft 1.21.8 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "description": "Minecraft 1.21.8 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", "title": "Paper Minecraft 1.21.8 Quick Server Setup", "category": "mc-paper", "runtime": "Java 21+", @@ -505,7 +505,7 @@ "language": "en_us", "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "[Paper] Minecraft 1.20.1 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "description": "Minecraft 1.20.1 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", "title": "Paper Minecraft 1.20.1 Quick Server Setup", "category": "mc-paper", "runtime": "Java 21+", @@ -620,7 +620,7 @@ "language": "en_us", "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "[Paper] Minecraft 1.21.4 Paper", + "description": "Minecraft 1.21.4 Paper", "title": "Minecraft 1.21.4", "category": "mc-paper", "runtime": "Java 21+", From 2a2250ed1a23a2bb89382b584977ae3a97a715df Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 17 Aug 2025 18:46:14 +0800 Subject: [PATCH 367/463] feat: update market --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index f35cf94..763d796 100644 --- a/market.json +++ b/market.json @@ -193,7 +193,7 @@ "type": "steam/universal", "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", "stopCommand": "^C", - "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", + "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 403240 validate +quit", "ie": "utf-8", "oe": "utf-8" } @@ -216,7 +216,7 @@ "type": "steam/universal", "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", "stopCommand": "^C", - "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"%CD%\" +app_update 403240 validate +quit", + "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 403240 validate +quit", "ie": "utf-8", "oe": "utf-8" } From 828305f4f05185d520040ac8323c28f22632c4fb Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 17 Aug 2025 18:50:18 +0800 Subject: [PATCH 368/463] feat: update market --- market.json | 272 ++++++++++++++++++++++++++-------------------------- 1 file changed, 137 insertions(+), 135 deletions(-) diff --git a/market.json b/market.json index 763d796..86d79a8 100644 --- a/market.json +++ b/market.json @@ -12,6 +12,44 @@ } ], "packages": [ + { + "title": "泰拉瑞亚服务器", + "language": "zh_cn", + "platform": "Linux", + "description": "适用于 Linux 系统,使用《Terraria》第三方 Docker 镜像,快速开服!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/terraria.webp", + "gameType": "Terraria", + "category": "最新版本", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["可以商业出租", "Docker 版"], + "setupInfo": { + "startCommand": "", + "stopCommand": "exit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/terraria", + "tag": ["terraria"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "ryshe/terraria:latest", + "containerName": "terraria-server", + "ports": ["{mcsm_port1}:7777/tcp"], + "extraVolumes": [], + "memory": 4096, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "/root/.local/share/Terraria/Worlds", + "env": [], + "changeWorkdir": false + } + } + }, { "language": "zh_cn", "platform": "ALL", @@ -138,89 +176,43 @@ } }, { - "title": "泰拉瑞亚服务器", - "language": "zh_cn", + "title": "EndStone MC Server", + "language": "en_us", "platform": "Linux", - "description": "适用于 Linux 系统,使用《Terraria》第三方 Docker 镜像,快速开服!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/terraria.webp", - "gameType": "Terraria", - "category": "最新版本", + "description": "For Linux, using the official EndStone MC Docker image, one-click to quickly set up the server!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/endstone_mc.webp", + "gameType": "Minecraft", + "category": "Latest Version", "runtime": "Ubuntu/Centos LTS", - "hardware": "RAM 8G+", + "hardware": "RAM 2G+", "size": "", "targetLink": "", - "author": "MCSManager", - "tags": ["可以商业出租", "Docker 版"], + "author": "EndStone", + "tags": ["Docker version"], "setupInfo": { - "startCommand": "", - "stopCommand": "exit", + "startCommand": "endstone -y -s .", + "stopCommand": "stop", "ie": "utf8", "oe": "utf8", - "type": "steam/terraria", - "tag": ["terraria"], + "type": "minecraft/bedrock", + "tag": ["bedrock"], "fileCode": "utf8", "processType": "docker", "updateCommand": "", "docker": { - "image": "ryshe/terraria:latest", - "containerName": "terraria-server", - "ports": ["{mcsm_port1}:7777/tcp"], + "image": "endstone/endstone:latest", + "containerName": "endstone-server", + "ports": ["{mcsm_port1}:19132/udp"], "extraVolumes": [], - "memory": 4096, + "memory": 2048, "networkMode": "bridge", "cpuUsage": 100, - "workingDir": "/root/.local/share/Terraria/Worlds", + "workingDir": "", "env": [], - "changeWorkdir": false + "changeWorkdir": true } } }, - { - "title": "战术小队服务器", - "language": "zh_cn", - "platform": "Windows", - "description": "适用于 Windows 系统的战术新队服务器,快速开服", - "image": "https://squadovo.cn/img/header.jpg", - "gameType": "Squad", - "category": "最新版本", - "runtime": "Windows", - "hardware": "Intel Core 平台、RAM 8G+", - "size": "20GB", - "author": "南赛", - "remark": "需安装 Visual C++ 才可以运行", - "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", - "setupInfo": { - "type": "steam/universal", - "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", - "stopCommand": "^C", - "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 403240 validate +quit", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "title": "Squad Server", - "language": "en_us", - "platform": "Windows", - "description": "Suitable for Windows system, quick server setup", - "image": "https://squadovo.cn/img/header.jpg", - "gameType": "Squad", - "category": "Latest Version", - "runtime": "Windows Server", - "hardware": "Intel Core platform、RAM 8G+", - "size": "20GB", - "author": "南赛", - "remark": "Need to install Visual C++", - "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", - "setupInfo": { - "type": "steam/universal", - "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", - "stopCommand": "^C", - "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 403240 validate +quit", - "ie": "utf-8", - "oe": "utf-8" - } - }, { "platform": "ALL", "language": "zh_cn", @@ -360,6 +352,44 @@ "oe": "utf-8" } }, + { + "title": "Terraria Server", + "language": "en_us", + "platform": "Linux", + "description": "For Linux systems, using a third-party Docker image of Terraria for quick server deployment!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/terraria.webp", + "gameType": "Terraria", + "category": "Latest Version", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["Docker version"], + "setupInfo": { + "startCommand": "", + "stopCommand": "exit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/terraria", + "tag": ["terraria"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "ryshe/terraria:latest", + "containerName": "terraria-server", + "ports": ["{mcsm_port1}:7777/tcp"], + "extraVolumes": [], + "memory": 4096, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "/root/.local/share/Terraria/Worlds", + "env": [], + "changeWorkdir": false + } + } + }, { "title": "Palworld Official Server", "language": "en_us", @@ -439,44 +469,7 @@ } } }, - { - "title": "Terraria Server", - "language": "en_us", - "platform": "Linux", - "description": "For Linux systems, using a third-party Docker image of Terraria for quick server deployment!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/terraria.webp", - "gameType": "Terraria", - "category": "Latest Version", - "runtime": "Ubuntu/Centos LTS", - "hardware": "RAM 8G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": ["Docker version"], - "setupInfo": { - "startCommand": "", - "stopCommand": "exit", - "ie": "utf8", - "oe": "utf8", - "type": "steam/terraria", - "tag": ["terraria"], - "fileCode": "utf8", - "processType": "docker", - "updateCommand": "", - "docker": { - "image": "ryshe/terraria:latest", - "containerName": "terraria-server", - "ports": ["{mcsm_port1}:7777/tcp"], - "extraVolumes": [], - "memory": 4096, - "networkMode": "bridge", - "cpuUsage": 100, - "workingDir": "/root/.local/share/Terraria/Worlds", - "env": [], - "changeWorkdir": false - } - } - }, + { "platform": "ALL", "language": "en_us", @@ -769,42 +762,51 @@ } } }, + { - "title": "EndStone MC Server", + "title": "战术小队服务器", + "language": "zh_cn", + "platform": "Windows", + "description": "适用于 Windows 系统的战术新队服务器,快速开服", + "image": "https://squadovo.cn/img/header.jpg", + "gameType": "Squad", + "category": "最新版本", + "runtime": "Windows", + "hardware": "Intel Core 平台、RAM 8G+", + "size": "20GB", + "author": "南赛", + "remark": "需安装 Visual C++ 才可以运行", + "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", + "setupInfo": { + "type": "steam/universal", + "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", + "stopCommand": "^C", + "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 403240 validate +quit", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "title": "Squad Server", "language": "en_us", - "platform": "Linux", - "description": "For Linux, using the official EndStone MC Docker image, one-click to quickly set up the server!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/endstone_mc.webp", - "gameType": "Minecraft", + "platform": "Windows", + "description": "Suitable for Windows system, quick server setup", + "image": "https://squadovo.cn/img/header.jpg", + "gameType": "Squad", "category": "Latest Version", - "runtime": "Ubuntu/Centos LTS", - "hardware": "RAM 2G+", - "size": "", - "targetLink": "", - "author": "EndStone", - "tags": ["Docker version"], + "runtime": "Windows Server", + "hardware": "Intel Core platform、RAM 8G+", + "size": "20GB", + "author": "南赛", + "remark": "Need to install Visual C++", + "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", "setupInfo": { - "startCommand": "endstone -y -s .", - "stopCommand": "stop", - "ie": "utf8", - "oe": "utf8", - "type": "minecraft/bedrock", - "tag": ["bedrock"], - "fileCode": "utf8", - "processType": "docker", - "updateCommand": "", - "docker": { - "image": "endstone/endstone:latest", - "containerName": "endstone-server", - "ports": ["{mcsm_port1}:19132/udp"], - "extraVolumes": [], - "memory": 2048, - "networkMode": "bridge", - "cpuUsage": 100, - "workingDir": "", - "env": [], - "changeWorkdir": true - } + "type": "steam/universal", + "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", + "stopCommand": "^C", + "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 403240 validate +quit", + "ie": "utf-8", + "oe": "utf-8" } } ] From 6b58b26bcbe9a3851fa22e4a636db79243386b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Sun, 17 Aug 2025 19:10:57 +0800 Subject: [PATCH 369/463] Update market.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 人渣 修复了原仓库错别字 --- market.json | 52 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/market.json b/market.json index 86d79a8..5426ee5 100644 --- a/market.json +++ b/market.json @@ -764,10 +764,10 @@ }, { - "title": "战术小队服务器", + "title": "战术小队 服务器", "language": "zh_cn", "platform": "Windows", - "description": "适用于 Windows 系统的战术新队服务器,快速开服", + "description": "适用于 Windows 系统的战术小队服务器,快速开服", "image": "https://squadovo.cn/img/header.jpg", "gameType": "Squad", "category": "最新版本", @@ -790,7 +790,7 @@ "title": "Squad Server", "language": "en_us", "platform": "Windows", - "description": "Suitable for Windows system, quick server setup", + "description": "Squad Server suitable for Windows system, fast server setup", "image": "https://squadovo.cn/img/header.jpg", "gameType": "Squad", "category": "Latest Version", @@ -808,6 +808,52 @@ "ie": "utf-8", "oe": "utf-8" } + }, + { + "title": "人渣 服务器", + "language": "zh_cn", + "platform": "Windows", + "description": "适用于 Windows 系统的人渣服务器,快速开服", + "image": "https://api.nansai.cc/img/scum/header_chinese.jpg", + "gameType": "SCUM", + "category": "最新版本", + "runtime": "Windows Server", + "hardware": "Intel Core 平台、RAM 8G+", + "size": "20GB", + "author": "南赛", + "remark": "需安装 Visual C++ 才可以运行", + "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", + "setupInfo": { + "type": "steam/universal", + "startCommand": "\"steamapps/common/SCUM Server/SCUM/Binaries/Win64/SCUMServer.exe\" -port=7779 -log", + "stopCommand": "^C", + "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"%CD%\" +app_update 3792580 validate +quit", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "title": "SCUM Server", + "language": "zh_cn", + "platform": "Windows", + "description": "SCUM Server suitable for Windows system, fast server setup", + "image": "https://api.nansai.cc/img/scum/header_English.jpg", + "gameType": "SCUM", + "category": "最新版本", + "runtime": "Windows Server", + "hardware": "Intel Core platform、RAM 8G+", + "size": "20GB", + "author": "南赛", + "remark": "need install Visual C++", + "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", + "setupInfo": { + "type": "steam/universal", + "startCommand": "\"steamapps/common/SCUM Server/SCUM/Binaries/Win64/SCUMServer.exe\" -port=7779 -log", + "stopCommand": "^C", + "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"%CD%\" +app_update 3792580 validate +quit", + "ie": "utf-8", + "oe": "utf-8" + } } ] } From f306aaca5c9553b8486a1c5146b765a43b6b8929 Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Mon, 18 Aug 2025 00:31:59 +0800 Subject: [PATCH 370/463] feat: update market --- market.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/market.json b/market.json index 5426ee5..9a00aa5 100644 --- a/market.json +++ b/market.json @@ -827,14 +827,14 @@ "type": "steam/universal", "startCommand": "\"steamapps/common/SCUM Server/SCUM/Binaries/Win64/SCUMServer.exe\" -port=7779 -log", "stopCommand": "^C", - "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"%CD%\" +app_update 3792580 validate +quit", + "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 3792580 validate +quit", "ie": "utf-8", "oe": "utf-8" } }, { "title": "SCUM Server", - "language": "zh_cn", + "language": "en_us", "platform": "Windows", "description": "SCUM Server suitable for Windows system, fast server setup", "image": "https://api.nansai.cc/img/scum/header_English.jpg", @@ -850,7 +850,7 @@ "type": "steam/universal", "startCommand": "\"steamapps/common/SCUM Server/SCUM/Binaries/Win64/SCUMServer.exe\" -port=7779 -log", "stopCommand": "^C", - "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"%CD%\" +app_update 3792580 validate +quit", + "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 3792580 validate +quit", "ie": "utf-8", "oe": "utf-8" } From be89e8389add097f4e5f8a5c05b0b60cf02aaabd Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Mon, 18 Aug 2025 00:33:31 +0800 Subject: [PATCH 371/463] feat: update market --- market.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index 9a00aa5..7f27da7 100644 --- a/market.json +++ b/market.json @@ -821,6 +821,7 @@ "hardware": "Intel Core 平台、RAM 8G+", "size": "20GB", "author": "南赛", + "tags": ["不完全兼容面板"], "remark": "需安装 Visual C++ 才可以运行", "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", "setupInfo": { @@ -839,11 +840,12 @@ "description": "SCUM Server suitable for Windows system, fast server setup", "image": "https://api.nansai.cc/img/scum/header_English.jpg", "gameType": "SCUM", - "category": "最新版本", + "category": "Latest Version", "runtime": "Windows Server", "hardware": "Intel Core platform、RAM 8G+", "size": "20GB", - "author": "南赛", + "author": "LanSai", + "tags": ["Incompatible with panel"], "remark": "need install Visual C++", "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", "setupInfo": { From 100642513556967c61a5e16363f16802864cb59d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Mon, 18 Aug 2025 22:21:17 +0800 Subject: [PATCH 372/463] Update market.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了一些问题 --- market.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/market.json b/market.json index 7f27da7..2d10641 100644 --- a/market.json +++ b/market.json @@ -775,11 +775,12 @@ "hardware": "Intel Core 平台、RAM 8G+", "size": "20GB", "author": "南赛", + "tags": ["不完全兼容面板"], "remark": "需安装 Visual C++ 才可以运行", "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", "setupInfo": { "type": "steam/universal", - "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", + "startCommand": "\"SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 -log", "stopCommand": "^C", "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 403240 validate +quit", "ie": "utf-8", @@ -797,12 +798,13 @@ "runtime": "Windows Server", "hardware": "Intel Core platform、RAM 8G+", "size": "20GB", - "author": "南赛", + "author": "NanSai", + "tags": ["不完全兼容面板"], "remark": "Need to install Visual C++", "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", "setupInfo": { "type": "steam/universal", - "startCommand": "\"steamapps/common/Squad Dedicated Server/SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 FIXEDMAXTICKRATE=30 -log", + "startCommand": "\"SquadGame/Binaries/Win64/SquadGameServer.exe\" Port=7787 QueryPort=15000 -log", "stopCommand": "^C", "updateCommand": "steamcmd.exe +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 403240 validate +quit", "ie": "utf-8", @@ -826,7 +828,7 @@ "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", "setupInfo": { "type": "steam/universal", - "startCommand": "\"steamapps/common/SCUM Server/SCUM/Binaries/Win64/SCUMServer.exe\" -port=7779 -log", + "startCommand": "\"SCUM/Binaries/Win64/SCUMServer.exe\" -port=7779 -log", "stopCommand": "^C", "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 3792580 validate +quit", "ie": "utf-8", @@ -844,13 +846,13 @@ "runtime": "Windows Server", "hardware": "Intel Core platform、RAM 8G+", "size": "20GB", - "author": "LanSai", + "author": "NanSai", "tags": ["Incompatible with panel"], "remark": "need install Visual C++", "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", "setupInfo": { "type": "steam/universal", - "startCommand": "\"steamapps/common/SCUM Server/SCUM/Binaries/Win64/SCUMServer.exe\" -port=7779 -log", + "startCommand": "\"SCUM/Binaries/Win64/SCUMServer.exe\" -port=7779 -log", "stopCommand": "^C", "updateCommand": "SteamCMD.exe +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 3792580 validate +quit", "ie": "utf-8", From afa92476dc4faf93bd3337f2cce7f0ee115c605a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Mon, 18 Aug 2025 22:25:58 +0800 Subject: [PATCH 373/463] Update market.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更换了 yumao233 的 MCSManager 专用 Steam 下载链接 --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index 2d10641..2a37d07 100644 --- a/market.json +++ b/market.json @@ -825,7 +825,7 @@ "author": "南赛", "tags": ["不完全兼容面板"], "remark": "需安装 Visual C++ 才可以运行", - "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", + "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", "setupInfo": { "type": "steam/universal", "startCommand": "\"SCUM/Binaries/Win64/SCUMServer.exe\" -port=7779 -log", @@ -849,7 +849,7 @@ "author": "NanSai", "tags": ["Incompatible with panel"], "remark": "need install Visual C++", - "targetLink": "https://download.nansai.cc/steam/SteamCMD.exe", + "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", "setupInfo": { "type": "steam/universal", "startCommand": "\"SCUM/Binaries/Win64/SCUMServer.exe\" -port=7779 -log", From 8714851f168d74a8cccea1ce5731f94eecbd8a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Tue, 19 Aug 2025 00:49:00 +0800 Subject: [PATCH 374/463] Update market.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加了 Docker Squad Server --- market.json | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/market.json b/market.json index 2a37d07..69342a6 100644 --- a/market.json +++ b/market.json @@ -858,6 +858,82 @@ "ie": "utf-8", "oe": "utf-8" } + }, + { + "title": "战术小队 官方服务器", + "language": "zh_cn", + "platform": "Linux", + "description": "适用于 Linux 系统,使用《战术小队》官方 Docker 镜像,快速开服!", + "image": "https://squadovo.cn/img/header.jpg", + "gameType": "Squad", + "category": "最新版本", + "runtime": "Centos/Ubuntu/Debian", + "hardware": "Intel Core platform、RAM 8G+", + "size": "", + "targetLink": "", + "author": "南赛", + "tags": ["可以商业出租", "Docker 版"], + "setupInfo": { + "startCommand": "", + "stopCommand": "docker stop squad-dedicated", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": ["Squad"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "docker restart squad-dedicated", + "docker": { + "image": "cm2network/squad", + "containerName": "squad-dedicated", + "ports": ["{mcsm_port1}:7787/udp", "{mcsm_port2}:15000/udp"], + "extraVolumes": ["{mcsm_workspace}/SquadConfig:/home/steam/squad-dedicated/SquadGame/ServerConfig/"], + "memory": 8192, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "", + "env": [], + "changeWorkdir": false + } + } + }, + { + "title": "Squad Docker Server", + "language": "en_us", + "platform": "Linux", + "description": "Suitable for Linux systems, use the official Docker image of Squad Server to quickly get started!", + "image": "https://squadovo.cn/img/header.jpg", + "gameType": "Squad", + "category": "Latest Version", + "runtime": "Centos/Ubuntu/Debian", + "hardware": "Intel Core platform、RAM 8G+", + "size": "", + "targetLink": "", + "author": "Nansai", + "tags": ["Commercial Use Allowed", "Docker version"], + "setupInfo": { + "startCommand": "", + "stopCommand": "docker stop squad-dedicated", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": ["Squad"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "docker restart squad-dedicated", + "docker": { + "image": "cm2network/squad", + "containerName": "squad-dedicated", + "ports": ["{mcsm_port1}:7787/udp", "{mcsm_port2}:15000/udp"], + "extraVolumes": ["{mcsm_workspace}/SquadConfig:/home/steam/squad-dedicated/SquadGame/ServerConfig/"], + "memory": 8192, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "", + "env": [], + "changeWorkdir": false + } + } } ] } From 571e2f56668adf77b9c58a687afa25eebc96a715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Wed, 20 Aug 2025 02:27:27 +0800 Subject: [PATCH 375/463] Update market.json --- market.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/market.json b/market.json index 1247877..bf59261 100644 --- a/market.json +++ b/market.json @@ -967,7 +967,7 @@ "gameType": "Squad", "category": "最新版本", "runtime": "Centos/Ubuntu/Debian", - "hardware": "Intel Core platform、RAM 8G+", + "hardware": "Intel Core 平台、RAM 8G+", "size": "", "targetLink": "", "author": "南赛", From 62465b0e81a527e46ced873f0c37810bf2fe52db Mon Sep 17 00:00:00 2001 From: yumao233 Date: Wed, 20 Aug 2025 19:34:22 +0800 Subject: [PATCH 376/463] =?UTF-8?q?=E9=87=8D=E6=9E=84=E5=B8=82=E5=9C=BA?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E9=87=8D=E6=96=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B3=B0=E6=8B=89=E7=91=9E=E4=BA=9A=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E7=9A=84=E8=AF=A6=E7=BB=86=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- market.json | 76 ++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/market.json b/market.json index bf59261..a5fbf05 100644 --- a/market.json +++ b/market.json @@ -12,44 +12,6 @@ } ], "packages": [ - { - "title": "泰拉瑞亚服务器", - "language": "zh_cn", - "platform": "Linux", - "description": "适用于 Linux 系统,使用《Terraria》第三方 Docker 镜像,快速开服!", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/terraria.webp", - "gameType": "Terraria", - "category": "最新版本", - "runtime": "Ubuntu/Centos LTS", - "hardware": "RAM 8G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": ["可以商业出租", "Docker 版"], - "setupInfo": { - "startCommand": "", - "stopCommand": "exit", - "ie": "utf8", - "oe": "utf8", - "type": "steam/terraria", - "tag": ["terraria"], - "fileCode": "utf8", - "processType": "docker", - "updateCommand": "", - "docker": { - "image": "ryshe/terraria:latest", - "containerName": "terraria-server", - "ports": ["{mcsm_port1}:7777/tcp"], - "extraVolumes": [], - "memory": 4096, - "networkMode": "bridge", - "cpuUsage": 100, - "workingDir": "/root/.local/share/Terraria/Worlds", - "env": [], - "changeWorkdir": false - } - } - }, { "language": "zh_cn", "platform": "ALL", @@ -96,6 +58,44 @@ "oe": "utf-8" } }, + { + "title": "泰拉瑞亚服务器", + "language": "zh_cn", + "platform": "Linux", + "description": "适用于 Linux 系统,使用《Terraria》第三方 Docker 镜像,快速开服!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/terraria.webp", + "gameType": "Terraria", + "category": "最新版本", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": ["可以商业出租", "Docker 版"], + "setupInfo": { + "startCommand": "", + "stopCommand": "exit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/terraria", + "tag": ["terraria"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "ryshe/terraria:latest", + "containerName": "terraria-server", + "ports": ["{mcsm_port1}:7777/tcp"], + "extraVolumes": [], + "memory": 4096, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "/root/.local/share/Terraria/Worlds", + "env": [], + "changeWorkdir": false + } + } + }, { "title": "幻兽帕鲁官方服务器", "language": "zh_cn", From 561c040d6f7bb7403188da6151925cdcc42964eb Mon Sep 17 00:00:00 2001 From: mmyddd Date: Wed, 20 Aug 2025 21:43:21 +0800 Subject: [PATCH 377/463] update market.json --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index a5fbf05..cb48050 100644 --- a/market.json +++ b/market.json @@ -741,7 +741,7 @@ "setupInfo": { "tag": ["SonsOfTheForest"], "type": "steam/universal", - "startCommand": "set SteamAppId=1326470 && set SteamGameId=1326470 && SonsOfTheForestDS.exe -userdatapath \"{mcsm_workspace}/userdata\" | consoleparser -colorize", + "startCommand": "echo|set /p="1326470" > steam_appid.txt & set SteamAppId=1326470 && set SteamGameId=1326470 && SonsOfTheForestDS.exe -userdatapath \"{mcsm_workspace}/userdata\" | consoleparser -colorize", "stopCommand": "^C", "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2465200 +quit", "ie": "utf-8", @@ -791,7 +791,7 @@ "setupInfo": { "tag": ["SonsOfTheForest"], "type": "steam/universal", - "startCommand": "set SteamAppId=1326470 && set SteamGameId=1326470 && SonsOfTheForestDS.exe -userdatapath \"{mcsm_workspace}/userdata\" | consoleparser -colorize", + "startCommand": "echo|set /p="1326470" > steam_appid.txt & set SteamAppId=1326470 && set SteamGameId=1326470 && SonsOfTheForestDS.exe -userdatapath \"{mcsm_workspace}/userdata\" | consoleparser -colorize", "stopCommand": "^C", "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2465200 +quit", "ie": "utf-8", From 7663c83609ec60e2b8ed2d8bb6b95f6cee2d36f6 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sat, 23 Aug 2025 19:32:58 +0800 Subject: [PATCH 378/463] fix: /home/steam/squad-dedicated/SquadGame/ServerConfig/ --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index a5fbf05..677dc91 100644 --- a/market.json +++ b/market.json @@ -987,7 +987,7 @@ "containerName": "squad-dedicated", "ports": ["{mcsm_port1}:7787/udp", "{mcsm_port2}:15000/udp"], "extraVolumes": [ - "{mcsm_workspace}/SquadConfig:/home/steam/squad-dedicated/SquadGame/ServerConfig/" + "{mcsm_workspace}/SquadConfig|/home/steam/squad-dedicated/SquadGame/ServerConfig/" ], "memory": 8192, "networkMode": "bridge", @@ -1027,7 +1027,7 @@ "containerName": "squad-dedicated", "ports": ["{mcsm_port1}:7787/udp", "{mcsm_port2}:15000/udp"], "extraVolumes": [ - "{mcsm_workspace}/SquadConfig:/home/steam/squad-dedicated/SquadGame/ServerConfig/" + "{mcsm_workspace}/SquadConfig|/home/steam/squad-dedicated/SquadGame/ServerConfig/" ], "memory": 8192, "networkMode": "bridge", From c9660b85d94c28e0e19512aff8f231a22442e0bd Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sat, 23 Aug 2025 19:34:00 +0800 Subject: [PATCH 379/463] fix: json err --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index fcea59c..61049d3 100644 --- a/market.json +++ b/market.json @@ -741,7 +741,7 @@ "setupInfo": { "tag": ["SonsOfTheForest"], "type": "steam/universal", - "startCommand": "echo|set /p="1326470" > steam_appid.txt & set SteamAppId=1326470 && set SteamGameId=1326470 && SonsOfTheForestDS.exe -userdatapath \"{mcsm_workspace}/userdata\" | consoleparser -colorize", + "startCommand": "echo|set /p=\"1326470\" > steam_appid.txt & set SteamAppId=1326470 && set SteamGameId=1326470 && SonsOfTheForestDS.exe -userdatapath \"{mcsm_workspace}/userdata\" | consoleparser -colorize", "stopCommand": "^C", "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2465200 +quit", "ie": "utf-8", @@ -791,7 +791,7 @@ "setupInfo": { "tag": ["SonsOfTheForest"], "type": "steam/universal", - "startCommand": "echo|set /p="1326470" > steam_appid.txt & set SteamAppId=1326470 && set SteamGameId=1326470 && SonsOfTheForestDS.exe -userdatapath \"{mcsm_workspace}/userdata\" | consoleparser -colorize", + "startCommand": "echo|set /p=\"1326470\" > steam_appid.txt & set SteamAppId=1326470 && set SteamGameId=1326470 && SonsOfTheForestDS.exe -userdatapath \"{mcsm_workspace}/userdata\" | consoleparser -colorize", "stopCommand": "^C", "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 2465200 +quit", "ie": "utf-8", From 5c506fd8f77b694672ce7f50adc5dec16b343bd9 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sat, 23 Aug 2025 19:36:17 +0800 Subject: [PATCH 380/463] fix: typo --- market.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/market.json b/market.json index 61049d3..8a83779 100644 --- a/market.json +++ b/market.json @@ -774,7 +774,7 @@ } }, { - "title": "Son Of The Forest Offical Server", + "title": "Son Of The Forest Official Server", "language": "en_us", "platform": "Windows", "description": "Son Of The Forest Server for Windows system.", @@ -799,10 +799,10 @@ } }, { - "title": "SCP:SL Offical Server", + "title": "SCP:SL Official Server", "language": "en_us", "platform": "Windows", - "description": "SCP:SL Offical Server for Windows systen", + "description": "SCP:SL Official Server for Windows", "image": "https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/700330/dad38399643cda1a4084b1faff60452427bef8c0/header.jpg?t=1747606719", "remark": "The first startup requires configuration in the console.Server Config Path:%APPDATA%/SCP Secret Laboratory/config/{port}", "gameType": "SCP:SL", From d9963494adf3b407636030cd4816c0b72581a439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Sun, 24 Aug 2025 18:35:48 +0800 Subject: [PATCH 381/463] Update market.json --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index 8a83779..7eb1e9f 100644 --- a/market.json +++ b/market.json @@ -961,7 +961,7 @@ { "title": "战术小队 官方服务器", "language": "zh_cn", - "platform": "Linux", + "platform": "ALL", "description": "适用于 Linux 系统,使用《战术小队》官方 Docker 镜像,快速开服!", "image": "https://squadovo.cn/img/header.jpg", "gameType": "Squad", @@ -1001,7 +1001,7 @@ { "title": "Squad Docker Server", "language": "en_us", - "platform": "Linux", + "platform": "ALL", "description": "Suitable for Linux systems, use the official Docker image of Squad Server to quickly get started!", "image": "https://squadovo.cn/img/header.jpg", "gameType": "Squad", From 092d301325f8cf35700a4a7f581173641d21f77a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Sun, 24 Aug 2025 18:37:07 +0800 Subject: [PATCH 382/463] Update market.json --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index 7eb1e9f..20e9d18 100644 --- a/market.json +++ b/market.json @@ -966,7 +966,7 @@ "image": "https://squadovo.cn/img/header.jpg", "gameType": "Squad", "category": "最新版本", - "runtime": "Centos/Ubuntu/Debian", + "runtime": "Windows/Linux", "hardware": "Intel Core 平台、RAM 8G+", "size": "", "targetLink": "", @@ -1006,7 +1006,7 @@ "image": "https://squadovo.cn/img/header.jpg", "gameType": "Squad", "category": "Latest Version", - "runtime": "Centos/Ubuntu/Debian", + "runtime": "Windows/Linux", "hardware": "Intel Core platform、RAM 8G+", "size": "", "targetLink": "", From 60855a65c05d834a09f945a28ba66b8903766c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Sun, 24 Aug 2025 18:42:39 +0800 Subject: [PATCH 383/463] Update market.json --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index 20e9d18..c36c1ba 100644 --- a/market.json +++ b/market.json @@ -962,7 +962,7 @@ "title": "战术小队 官方服务器", "language": "zh_cn", "platform": "ALL", - "description": "适用于 Linux 系统,使用《战术小队》官方 Docker 镜像,快速开服!", + "description": "使用《战术小队》官方 Docker 镜像,快速开服!", "image": "https://squadovo.cn/img/header.jpg", "gameType": "Squad", "category": "最新版本", @@ -1002,7 +1002,7 @@ "title": "Squad Docker Server", "language": "en_us", "platform": "ALL", - "description": "Suitable for Linux systems, use the official Docker image of Squad Server to quickly get started!", + "description": "use the official Docker image of Squad Server to quickly get started!", "image": "https://squadovo.cn/img/header.jpg", "gameType": "Squad", "category": "Latest Version", From e9363f461bc05c2ab1d0bdf1a842f22187b7d5e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Sun, 24 Aug 2025 19:00:47 +0800 Subject: [PATCH 384/463] Update market.json --- market.json | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/market.json b/market.json index c36c1ba..cedd7e9 100644 --- a/market.json +++ b/market.json @@ -1037,6 +1037,96 @@ "changeWorkdir": false } } + }, + { + "title": "Rust 官方服务器", + "language": "zh_cn", + "platform": "ALL", + "description": "使用 Rust 官方 Docker 镜像,快速开服!", + "image": "https://api.nansai.cc/img/rust/header.jpg", + "gameType": "Rust", + "category": "最新版本", + "runtime": "Windows/Linux", + "hardware": "Intel Core 平台、RAM 16G+", + "size": "", + "targetLink": "", + "author": "南赛", + "tags": ["可以商业出租", "Docker 版"], + "setupInfo": { + "startCommand": "", + "stopCommand": "docker stop rust-server", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": ["Rust"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "docker restart rust-server", + "docker": { + "image": "facepunch/rust-server", + "containerName": "rust-server", + "ports": [ + "{mcsm_port1}:28015/udp", + "{mcsm_port2}:28016/udp" + ], + "extraVolumes": [ + "{mcsm_workspace}/server:/server", + "{mcsm_workspace}/config:/app/.config/unity3d/Facepunch/Rust", + "{mcsm_workspace}/data:/data" + ], + "memory": 16384, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "", + "env": [], + "changeWorkdir": false + } + } + }, + { + "title": "Rust Docker Server", + "language": "en_us", + "platform": "ALL", + "description": "Use Rust's official Docker image to quickly get started!", + "image": "https://api.nansai.cc/img/rust/header.jpg", + "gameType": "Rust", + "category": "Latest Version", + "runtime": "Windows/Linux", + "hardware": "Intel Core platform、RAM 16G+", + "size": "", + "targetLink": "", + "author": "南赛", + "tags": ["Commercial Use Allowed", "Docker version"], + "setupInfo": { + "startCommand": "", + "stopCommand": "docker stop rust-server", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": ["Rust"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "docker restart rust-server", + "docker": { + "image": "facepunch/rust-server", + "containerName": "rust-server", + "ports": [ + "{mcsm_port1}:28015/udp", + "{mcsm_port2}:28016/udp" + ], + "extraVolumes": [ + "{mcsm_workspace}/server:/server", + "{mcsm_workspace}/config:/app/.config/unity3d/Facepunch/Rust", + "{mcsm_workspace}/data:/data" + ], + "memory": 16384, + "networkMode": "bridge", + "cpuUsage": 100, + "workingDir": "", + "env": [], + "changeWorkdir": false + } + } } ] } From f24559f080cc622401ffb3bbd1f3bc427419d5fa Mon Sep 17 00:00:00 2001 From: yumao233 Date: Thu, 28 Aug 2025 23:01:05 +0800 Subject: [PATCH 385/463] feat: update download addr --- setup_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index 97e9b8c..7306fe9 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -2,7 +2,7 @@ # This script file is specifically designed for the Chinese region, and servers in the Chinese region are used to accelerate file downloads. mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://cdn.imlazy.ink:233/files/mcsmanager_linux_release.tar.gz" +mcsmanager_download_addr="https://download.mcsmanager.com/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" node="v20.12.2" arch=$(uname -m) From 42ee976bf14f9228b40790f6cce7e1e7a4a3d013 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Thu, 28 Aug 2025 23:08:35 +0800 Subject: [PATCH 386/463] fix: linux only info --- market.json | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/market.json b/market.json index cedd7e9..981b9f4 100644 --- a/market.json +++ b/market.json @@ -961,12 +961,12 @@ { "title": "战术小队 官方服务器", "language": "zh_cn", - "platform": "ALL", + "platform": "Linux", "description": "使用《战术小队》官方 Docker 镜像,快速开服!", "image": "https://squadovo.cn/img/header.jpg", "gameType": "Squad", "category": "最新版本", - "runtime": "Windows/Linux", + "runtime": "Linux", "hardware": "Intel Core 平台、RAM 8G+", "size": "", "targetLink": "", @@ -1001,12 +1001,12 @@ { "title": "Squad Docker Server", "language": "en_us", - "platform": "ALL", + "platform": "Linux", "description": "use the official Docker image of Squad Server to quickly get started!", "image": "https://squadovo.cn/img/header.jpg", "gameType": "Squad", "category": "Latest Version", - "runtime": "Windows/Linux", + "runtime": "Linux", "hardware": "Intel Core platform、RAM 8G+", "size": "", "targetLink": "", @@ -1065,10 +1065,7 @@ "docker": { "image": "facepunch/rust-server", "containerName": "rust-server", - "ports": [ - "{mcsm_port1}:28015/udp", - "{mcsm_port2}:28016/udp" - ], + "ports": ["{mcsm_port1}:28015/udp", "{mcsm_port2}:28016/udp"], "extraVolumes": [ "{mcsm_workspace}/server:/server", "{mcsm_workspace}/config:/app/.config/unity3d/Facepunch/Rust", @@ -1110,10 +1107,7 @@ "docker": { "image": "facepunch/rust-server", "containerName": "rust-server", - "ports": [ - "{mcsm_port1}:28015/udp", - "{mcsm_port2}:28016/udp" - ], + "ports": ["{mcsm_port1}:28015/udp", "{mcsm_port2}:28016/udp"], "extraVolumes": [ "{mcsm_workspace}/server:/server", "{mcsm_workspace}/config:/app/.config/unity3d/Facepunch/Rust", From b0b338c314059884e9af09f0f265bfaaad610dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E8=B5=9B?= <3776473137@qq.com> Date: Mon, 1 Sep 2025 18:01:05 +0800 Subject: [PATCH 387/463] Update market.json --- market.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/market.json b/market.json index 981b9f4..1becb16 100644 --- a/market.json +++ b/market.json @@ -1039,10 +1039,10 @@ } }, { - "title": "Rust 官方服务器", + "title": "Rust 服务器", "language": "zh_cn", - "platform": "ALL", - "description": "使用 Rust 官方 Docker 镜像,快速开服!", + "platform": "Linux", + "description": "使用 Rust 第三方 Docker 镜像,快速开服!", "image": "https://api.nansai.cc/img/rust/header.jpg", "gameType": "Rust", "category": "最新版本", @@ -1063,7 +1063,7 @@ "processType": "docker", "updateCommand": "docker restart rust-server", "docker": { - "image": "facepunch/rust-server", + "image": "didstopia/rust-server", "containerName": "rust-server", "ports": ["{mcsm_port1}:28015/udp", "{mcsm_port2}:28016/udp"], "extraVolumes": [ @@ -1083,8 +1083,8 @@ { "title": "Rust Docker Server", "language": "en_us", - "platform": "ALL", - "description": "Use Rust's official Docker image to quickly get started!", + "platform": "Linux", + "description": "Use Rust third-party Docker images to quickly get started!", "image": "https://api.nansai.cc/img/rust/header.jpg", "gameType": "Rust", "category": "Latest Version", @@ -1105,7 +1105,7 @@ "processType": "docker", "updateCommand": "docker restart rust-server", "docker": { - "image": "facepunch/rust-server", + "image": "didstopia/rust-server", "containerName": "rust-server", "ports": ["{mcsm_port1}:28015/udp", "{mcsm_port2}:28016/udp"], "extraVolumes": [ From 787f31995795bc8d4e972e560df8d08e92f68ec1 Mon Sep 17 00:00:00 2001 From: Capslock800000 Date: Mon, 1 Sep 2025 19:25:46 +0800 Subject: [PATCH 388/463] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=BA=86=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E7=9A=84=E5=AE=89=E8=A3=85=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup_cn.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index 7306fe9..5e7c0ad 100755 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -81,7 +81,7 @@ Install_Node() { } Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." + echo_cyan "[+] 安装 MCSManager..." # stop service systemctl disable --now mcsm-{web,daemon} @@ -96,7 +96,7 @@ Install_MCSManager() { cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" # download MCSManager release - wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" + wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] 未能成功下载 MCSManager" tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" @@ -132,7 +132,7 @@ Install_MCSManager() { } Create_Service() { - echo_cyan "[+] Create MCSManager service..." + echo_cyan "[+] 创建 MCSManager 面板服务..." echo "[Unit] Description=MCSManager-Daemon @@ -177,7 +177,7 @@ WantedBy=multi-user.target echo_yellow "http://:23333 (Browser)" echo_cyan_n "被控守护进程地址: " echo_yellow "ws://:24444 (Cluster)" - echo_red "默认情况下,你必须开放 23333 和 24444 端口才能确保面板工作正常!" + echo_red "默认情况下,你必须在防火墙放行 23333 和 24444 端口才能确保面板工作正常!" echo_yellow " " echo_cyan "面板开关指令:" echo_cyan "systemctl start mcsm-{daemon,web}.service" @@ -215,7 +215,7 @@ node_install_path="/opt/node-$node-linux-$arch" echo_cyan "[-] Architecture: $arch" # Install related software -echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " +echo_cyan_n "[+] 正在安装依赖软件 (git, tar, wget)... " if [[ -x "$(command -v yum)" ]]; then yum install -y git tar wget elif [[ -x "$(command -v apt-get)" ]]; then @@ -225,14 +225,14 @@ elif [[ -x "$(command -v pacman)" ]]; then elif [[ -x "$(command -v zypper)" ]]; then zypper --non-interactive install git tar wget else - echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" + echo_red "[!] 找不到你的软件包管理器! 你需要先去安装 git, tar 和 wget!" fi # Determine whether the relevant software is installed successfully if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then echo_green "Success" else - Red_Error "[x] Failed to find git, tar and wget, please install them manually!" + Red_Error "[x] 没有安装 git, tar 和 wget, 请先在安装MCSManager前安装它们!" fi # Install the Node environment From 2d049ef5cbab47b3e0b979f7ae64fb9ad5b430f3 Mon Sep 17 00:00:00 2001 From: Capslock800000 Date: Mon, 1 Sep 2025 19:51:01 +0800 Subject: [PATCH 389/463] =?UTF-8?q?=E7=AC=AC2=E6=AC=A1=E6=9B=B4=E6=94=B9se?= =?UTF-8?q?tup=5Fcn.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup_cn.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) mode change 100755 => 100644 setup_cn.sh diff --git a/setup_cn.sh b/setup_cn.sh old mode 100755 new mode 100644 index 5e7c0ad..c3b09f9 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -8,7 +8,7 @@ node="v20.12.2" arch=$(uname -m) if [ "$(id -u)" -ne 0 ]; then - echo "This script must be run as root. Please use \"sudo bash\" instead." + echo "这个脚本必须使用root权限运行! 请使用 \"sudo bash\" instead." exit 1 fi @@ -49,11 +49,11 @@ Install_Node() { return fi - echo_cyan "[+] Install Node.JS environment..." + echo_cyan "[+] 正在安装l Node.JS..." rm -irf "$node_install_path" - cd /opt || Red_Error "[x] Failed to enter /opt" + cd /opt || Red_Error "[x] 未能进入 /opt目录" rm -rf "node-$node-linux-$arch.tar.gz" @@ -67,7 +67,7 @@ Install_Node() { if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then echo_green "Success" else - Red_Error "[x] Node installation failed!" + Red_Error "[x] Node.JS 安装失败!" fi echo @@ -90,14 +90,14 @@ Install_MCSManager() { rm -rf /etc/systemd/system/mcsm-{daemon,web}.service systemctl daemon-reload - mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] 未能创建 ${mcsmanager_install_path}" # cd /opt/mcsmanager - cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" + cd "${mcsmanager_install_path}" || Red_Error "[x] 未能进入 ${mcsmanager_install_path}" # download MCSManager release wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] 未能成功下载 MCSManager" - tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" + tar -zxf ${package_name} -o || Red_Error "[x] 未能成功解压 ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" # compatible with tar.gz packages of different formats @@ -107,16 +107,16 @@ Install_MCSManager() { fi # echo "[→] cd daemon" - cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" + cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] 未能进入 ${mcsmanager_install_path}/daemon" - echo_cyan "[+] Install MCSManager-Daemon dependencies..." + echo_cyan "[+] 正在安装 MCSManager-Daemon 依赖库..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" + cd "${mcsmanager_install_path}/web" || Red_Error "[x] 未能进入 ${mcsmanager_install_path}/web" - echo_cyan "[+] Install MCSManager-Web dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" + echo_cyan "[+] 正在安装 MCSManager-Web 依赖库..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] 未能在以下目录使用npm install编译依赖库: ${mcsmanager_install_path}/web" echo echo_yellow "=============== MCSManager ===============" @@ -124,7 +124,7 @@ Install_MCSManager() { echo_green "Web: ${mcsmanager_install_path}/web" echo_yellow "=============== MCSManager ===============" echo - echo_green "[+] MCSManager installation success!" + echo_green "[+] MCSManager 安装完成!" chmod -R 755 "$mcsmanager_install_path" @@ -164,7 +164,7 @@ WantedBy=multi-user.target systemctl daemon-reload systemctl enable --now mcsm-{daemon,web}.service - echo_green "Registered!" + echo_green "已注册MCSManager到系统服务!" sleep 2 @@ -184,7 +184,7 @@ WantedBy=multi-user.target echo_cyan "systemctl stop mcsm-{daemon,web}.service" echo_cyan "systemctl restart mcsm-{daemon,web}.service" echo_yellow " " - echo_green "官方文档: https://docs.mcsmanager.com/" + echo_green "官方文档: https://docs.mcsmanager.com/zh_cn/" echo_yellow "==================================================================" } @@ -205,7 +205,7 @@ elif [[ $arch == s390x ]]; then arch=s390x #echo "[-] IBM LinuxONE architecture detected" else - Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" + Red_Error "[x] 对不起,这个架构还不支持安装MCSManager!\n[x]请尝试手动安装: https://github.com/MCSManager/MCSManager#linux" fi # Define the variable Node installation directory @@ -230,7 +230,7 @@ fi # Determine whether the relevant software is installed successfully if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "Success" + echo_green "完成" else Red_Error "[x] 没有安装 git, tar 和 wget, 请先在安装MCSManager前安装它们!" fi From 830baccda07e6d0f19705aa333eef888a7f91de1 Mon Sep 17 00:00:00 2001 From: Capslock800000 Date: Mon, 1 Sep 2025 20:12:39 +0800 Subject: [PATCH 390/463] =?UTF-8?q?=E6=B1=89=E5=8C=96=E4=BA=86=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E5=AE=89=E8=A3=85=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup_cn.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index c3b09f9..e7ec82b 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -8,7 +8,7 @@ node="v20.12.2" arch=$(uname -m) if [ "$(id -u)" -ne 0 ]; then - echo "这个脚本必须使用root权限运行! 请使用 \"sudo bash\" instead." + echo "此脚本必须以 root 身份运行,请使用“sudo bash”代替" exit 1 fi @@ -49,11 +49,11 @@ Install_Node() { return fi - echo_cyan "[+] 正在安装l Node.JS..." + echo_cyan "[+] 正在安装 Node.JS..." rm -irf "$node_install_path" - cd /opt || Red_Error "[x] 未能进入 /opt目录" + cd /opt || Red_Error "[x] 未能进入 /opt 目录" rm -rf "node-$node-linux-$arch.tar.gz" @@ -67,7 +67,7 @@ Install_Node() { if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then echo_green "Success" else - Red_Error "[x] Node.JS 安装失败!" + Red_Error "[x] Node.js 安装失败!" fi echo From d13778f57e8b1a3bb422f6d049a16f9dbf0982d8 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Mon, 1 Sep 2025 21:06:07 +0800 Subject: [PATCH 391/463] feat: add default image --- templates.json | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/templates.json b/templates.json index f2fb252..8cbd314 100644 --- a/templates.json +++ b/templates.json @@ -23,6 +23,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", @@ -44,6 +45,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.6-2465.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.6-2465.jar nogui", @@ -65,6 +67,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.5-2450.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.5-2450.jar nogui", @@ -86,6 +89,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2416.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2416.jar nogui", @@ -107,6 +111,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.3-2358.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.3-2358.jar nogui", @@ -128,6 +133,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.1-2329.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.1-2329.jar nogui", @@ -149,6 +155,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.6-2233.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.20.6-2233.jar nogui", @@ -170,6 +177,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.4-2176.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.20.4-2176.jar nogui", @@ -191,6 +199,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.20.1-2062.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.20.1-2062.jar nogui", @@ -212,6 +221,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.19.2-1858.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.19.2-1858.jar nogui", @@ -233,6 +243,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.18.2-1632.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.18.2-1632.jar nogui", @@ -254,6 +265,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.17.1-1428.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.17.1-1428.jar nogui", @@ -275,6 +287,7 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.16.5-1171.jar", "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.16.5-1171.jar nogui", @@ -296,6 +309,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/10/downloads/paper-1.21.8-10.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-10.jar nogui", @@ -317,6 +331,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.6/builds/48/downloads/paper-1.21.4-48.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.6-48.jar nogui", @@ -338,6 +353,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-232.jar nogui", @@ -359,6 +375,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.3/builds/82/downloads/paper-1.21.3-82.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.3-82.jar nogui", @@ -380,6 +397,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/132/downloads/paper-1.21.1-132.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.1-132.jar nogui", @@ -401,6 +419,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.6/builds/151/downloads/paper-1.20.6-151.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.6-151.jar nogui", @@ -422,6 +441,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/499/downloads/paper-1.20.4-499.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.4-499.jar nogui", @@ -443,6 +463,7 @@ "remark": "Includes some basic plugins", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.2/builds/318/downloads/paper-1.20.2-318.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.2-318.jar nogui", @@ -464,6 +485,7 @@ "remark": "Includes some basic plugins", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.1/builds/196/downloads/paper-1.20.1-196.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.1-196.jar nogui", @@ -485,6 +507,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.19.4/builds/550/downloads/paper-1.19.4-550.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.19.4-550.jar nogui", @@ -506,6 +529,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.19.2/builds/307/downloads/paper-1.19.2-307.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.19.2-307.jar nogui", @@ -527,6 +551,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.18.2/builds/388/downloads/paper-1.18.2-388.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.18.2-388.jar nogui", @@ -548,6 +573,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.17.1/builds/411/downloads/paper-1.17.1-411.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.17.1-411.jar nogui", @@ -569,6 +595,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.16.5/builds/794/downloads/paper-1.16.5-794.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.16.5-794.jar nogui", @@ -590,6 +617,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.12.2/builds/1620/downloads/paper-1.12.2-1620.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.12.2-1620.jar nogui", @@ -611,6 +639,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.8.8/builds/445/downloads/paper-1.8.8-445.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.8.8-445.jar nogui", @@ -632,6 +661,7 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.4-beta/neoforge-21.8.4-beta-installer.jar", "author": "neoforged.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", @@ -653,6 +683,7 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.6.20-beta/neoforge-21.6.20-beta-installer.jar", "author": "neoforged.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", @@ -674,6 +705,7 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.5.87/neoforge-21.5.87-installer.jar", "author": "neoforged.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", @@ -695,6 +727,7 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.147/neoforge-21.4.147-installer.jar", "author": "neoforged.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", @@ -716,6 +749,7 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.193/neoforge-21.1.193-installer.jar", "author": "neoforged.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", @@ -737,6 +771,7 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.6.137/neoforge-20.6.137-installer.jar", "author": "neoforged.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", @@ -758,6 +793,7 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.4.248/neoforge-20.4.248-installer.jar", "author": "neoforged.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", @@ -779,6 +815,7 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.2.93/neoforge-20.2.93-installer.jar", "author": "neoforged.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", @@ -800,6 +837,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.0.0/forge-1.21.8-58.0.0-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -821,6 +859,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.6-56.0.9/forge-1.21.6-56.0.9-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -842,6 +881,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.5-55.0.23/forge-1.21.5-55.0.23-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -863,6 +903,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.3/forge-1.21.4-54.1.3-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -884,6 +925,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.1/forge-1.21.1-52.1.1-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -905,6 +947,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.2.0/forge-1.20.6-50.2.0-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -926,6 +969,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.4-49.2.0/forge-1.20.4-49.2.0-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -947,6 +991,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.4.4/forge-1.20.1-47.4.4-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -968,6 +1013,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.4-45.4.0/forge-1.19.4-45.4.0-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -989,6 +1035,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.5.0/forge-1.19.2-43.5.0-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -1010,6 +1057,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.18.2-40.3.9/forge-1.18.2-40.3.9-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -1031,6 +1079,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.17.1-37.1.1/forge-1.17.1-37.1.1-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -1052,6 +1101,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.16.5-36.2.42/forge-1.16.5-36.2.42-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -1073,6 +1123,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.12.2-14.23.5.2860/forge-1.12.2-14.23.5.2860-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -1094,6 +1145,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.8.9-11.15.1.2318-1.8.9/forge-1.8.9-11.15.1.2318-1.8.9-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -1115,6 +1167,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/forge-1.7.10-10.13.4.1614-1.7.10-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -1136,6 +1189,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1157,6 +1211,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1178,6 +1233,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1199,6 +1255,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1220,6 +1277,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1241,6 +1299,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1262,6 +1321,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1283,6 +1343,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1304,6 +1365,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1325,6 +1387,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1346,6 +1409,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1367,6 +1431,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1388,6 +1453,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1409,6 +1475,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1430,6 +1497,7 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1451,6 +1519,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1472,6 +1541,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/6e64dcabba3c01a7271b4fa6bd898483b794c59b/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1493,6 +1563,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/e6ec2f64e6080b9b5d9b471b291c33cc7f509733/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1514,6 +1585,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1535,6 +1607,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/59353fb40c36d304f2035d51e7d6e6baa98dc05c/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1556,6 +1629,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/145ff0858209bcfc164859ba735d4199aafa1eea/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1577,6 +1651,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/8dd1a28015f51b1803213892b50b7b4fc76e594d/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1598,6 +1673,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/84194a2f286ef7c14ed7ce0090dba59902951553/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1619,6 +1695,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/8f3112a1049751cc472ec13e397eade5336ca7ae/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1640,6 +1717,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/c8f83c5655308435b3dcf03c06d9fe8740a77469/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1661,6 +1739,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/a16d67e5807f57fc4e550299cf20226194497dc2/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1682,6 +1761,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/1b557e7b033b583cd9f66746b7a9ab1ec1673ced/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1703,6 +1783,7 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/886945bfb2b978778c3a0288fd7fab09d315b25f/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1724,6 +1805,7 @@ "remark": "Minecraft Java", "targetLink": "https://launcher.mojang.com/v1/objects/b58b2ceb36e01bcd8dbf49c8fb66c55a9f0676cd/server.jar", "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1745,6 +1827,7 @@ "remark": "包含基础插件,萌新快速开服!低配机器专属!", "targetLink": "https://cloud.alongw.cn/f/DzvHK/Paper-1.21.1-ZH.zip", "author": "alongw.cn", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms4096M -Xmx4096M -jar server.jar nogui", @@ -1766,6 +1849,7 @@ "remark": "支持插件,最低 8GB 内存要求", "targetLink": "https://url.alww.top/mcsm/paper1.20.4.zip", "author": "alongw.cn", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms6144M -Xmx6144M -jar server.jar nogui", @@ -1787,6 +1871,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/10/downloads/paper-1.21.8-10.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-10.jar nogui", @@ -1808,6 +1893,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.6/builds/48/downloads/paper-1.21.4-48.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.6-48.jar nogui", @@ -1829,6 +1915,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-232.jar nogui", @@ -1850,6 +1937,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.3/builds/82/downloads/paper-1.21.3-82.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.3-82.jar nogui", @@ -1871,6 +1959,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/132/downloads/paper-1.21.1-132.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.1-132.jar nogui", @@ -1892,6 +1981,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.6/builds/151/downloads/paper-1.20.6-151.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.6-151.jar nogui", @@ -1913,6 +2003,7 @@ "remark": "Only Paper included", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/499/downloads/paper-1.20.4-499.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.4-499.jar nogui", @@ -1934,6 +2025,7 @@ "remark": "Includes some basic plugins", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.2/builds/318/downloads/paper-1.20.2-318.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.2-318.jar nogui", @@ -1955,6 +2047,7 @@ "remark": "Includes some basic plugins", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.1/builds/196/downloads/paper-1.20.1-196.jar", "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.1-196.jar nogui", @@ -1976,6 +2069,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.3.33/forge-1.20.1-47.3.33-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -1997,6 +2091,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.1.48/forge-1.20.6-50.1.48-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -2018,6 +2113,7 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.4.20/forge-1.19.2-43.4.20-installer.jar", "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", From 3c027882ca0dc6ed1ad4f3b751b7c09c52fb0f9c Mon Sep 17 00:00:00 2001 From: Capslock800000 Date: Tue, 2 Sep 2025 12:15:08 +0800 Subject: [PATCH 392/463] =?UTF-8?q?=E6=B1=89=E5=8C=96=E4=BA=86=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- daemon/setup_cn.sh | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/daemon/setup_cn.sh b/daemon/setup_cn.sh index aacb7b4..a3a4113 100644 --- a/daemon/setup_cn.sh +++ b/daemon/setup_cn.sh @@ -8,7 +8,7 @@ node="v20.12.2" arch=$(uname -m) if [ "$(id -u)" -ne 0 ]; then - echo "This script must be run as root. Please use \"sudo bash\" instead." + echo "这个脚本必须使用root权限运行。 请使用 \"sudo bash\" 替代它" exit 1 fi @@ -32,7 +32,7 @@ echo_yellow() { # script info echo_cyan "+---------------------------------------------------------------------- -| MCSManager 安装脚本 (MCSManager Installer) +| MCSManager Daemon安装脚本 (MCSManager Installer) +---------------------------------------------------------------------- " @@ -44,25 +44,25 @@ Red_Error() { } Install_Node() { - echo_cyan_n "[+] Install Node.JS environment...\n" + echo_cyan_n "[+] 安装 Node.JS...\n" rm -irf "$node_install_path" - cd /opt || Red_Error "[x] Failed to enter /opt" + cd /opt || Red_Error "[x] 未能进入 /opt" rm -rf "node-$node-linux-$arch.tar.gz" # wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - wget "https://registry.npmmirror.com/-/binary/node/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + wget "https://registry.npmmirror.com/-/binary/node/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] 未能下载node" tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" rm -rf "node-$node-linux-$arch.tar.gz" if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Success" + echo_green "完成" else - Red_Error "[x] Node installation failed!" + Red_Error "[x] Node 安装失败!" fi echo @@ -76,7 +76,7 @@ Install_Node() { } Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." + echo_cyan "[+] 安装 MCSManager..." # stop service systemctl disable --now mcsm-{web,daemon} @@ -85,13 +85,13 @@ Install_MCSManager() { rm -rf /etc/systemd/system/mcsm-daemon.service systemctl daemon-reload - mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] 未能创建 ${mcsmanager_install_path}" # cd /opt/mcsmanager - cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" + cd "${mcsmanager_install_path}" || Red_Error "[x] 未能进入 ${mcsmanager_install_path}" # download MCSManager release - wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" + wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] 未能下载 MCSManager" tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" rm -rf "${mcsmanager_install_path}/${package_name}" @@ -104,7 +104,7 @@ Install_MCSManager() { # echo "[→] cd daemon" cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" - echo_cyan "[+] Install MCSManager-Daemon dependencies..." + echo_cyan "[+] 安装 MCSManager-Daemon 依赖库..." env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" echo @@ -112,7 +112,7 @@ Install_MCSManager() { echo_green "Daemon: ${mcsmanager_install_path}/daemon" echo_yellow "=============== MCSManager ===============" echo - echo_green "[+] MCSManager installation success!" + echo_green "[+] MCSManager 安装完成!" chmod -R 755 "$mcsmanager_install_path" @@ -120,7 +120,7 @@ Install_MCSManager() { } Create_Service() { - echo_cyan "[+] Create MCSManager service..." + echo_cyan "[+] 创建 MCSManager 服务..." echo "[Unit] Description=MCSManager-Daemon @@ -177,17 +177,17 @@ elif [[ $arch == s390x ]]; then arch=s390x #echo "[-] IBM LinuxONE architecture detected" else - Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" + Red_Error "[x] 对不起,这个架构目前还不受支持!\n[x]请尝试手动安装: https://github.com/MCSManager/MCSManager#linux" fi # Define the variable Node installation directory node_install_path="/opt/node-$node-linux-$arch" # Check network connection -echo_cyan "[-] Architecture: $arch" +echo_cyan "[-] 架构: $arch" # Install related software -echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " +echo_cyan_n "[+] 正在安装依赖软件 (git, tar, wget)... " if [[ -x "$(command -v yum)" ]]; then yum install -y git tar wget elif [[ -x "$(command -v apt-get)" ]]; then @@ -197,14 +197,14 @@ elif [[ -x "$(command -v pacman)" ]]; then elif [[ -x "$(command -v zypper)" ]]; then zypper --non-interactive install git tar wget else - echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" + echo_red "[!] 找不到你的软件包管理器! 你需要去安装 git, tar 和 wget!" fi # Determine whether the relevant software is installed successfully if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "Success" + echo_green "完成" else - Red_Error "[x] Failed to find git, tar and wget, please install them manually!" + Red_Error "[x] 找不到 git, tar 和 wget, 请先安装它们!" fi # Install the Node environment From d4e488227b4b99576815ff6cc82ecc6a914343a9 Mon Sep 17 00:00:00 2001 From: SkyKingPX Date: Mon, 15 Sep 2025 20:02:36 +0200 Subject: [PATCH 393/463] Updated Versions & Removed Outdated ones --- market.json | 44 +++--- templates.json | 394 +++++++------------------------------------------ 2 files changed, 76 insertions(+), 362 deletions(-) diff --git a/market.json b/market.json index 1becb16..f2a22a1 100644 --- a/market.json +++ b/market.json @@ -481,12 +481,12 @@ "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "100MB", - "remark": "Paper version only", - "targetLink": "https://fill-data.papermc.io/v1/objects/d310c61899acc608b683515c5c7ef929774bfd1b90262dac965e76c7e9ea8d22/paper-1.21.8-30.jar", + "remark": "Minecraft Paper", + "targetLink": "https://fill-data.papermc.io/v1/objects/8de7c52c3b02403503d16fac58003f1efef7dd7a0256786843927fa92ee57f1e/paper-1.21.8-60.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-30.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-60.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -504,7 +504,7 @@ "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "100MB", - "remark": "Paper version only", + "remark": "Minecraft Paper", "targetLink": "https://fill-data.papermc.io/v1/objects/234a9b32098100c6fc116664d64e36ccdb58b5b649af0f80bcccb08b0255eaea/paper-1.20.1-196.jar", "author": "papermc.io", "setupInfo": { @@ -521,18 +521,18 @@ "language": "en_us", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", "gameType": "Minecraft", - "description": "[Purpur] Minecraft 1.21.8 Purpur", - "title": "Minecraft 1.21.8", + "description": "Minecraft 1.21.8 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "Purpur Minecraft 1.21.8 Quick Server Setup", "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "55MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", + "remark": "Minecraft Purpur", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2496.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2496.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -551,13 +551,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.1/forge-1.21.1-52.1.1-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.3/forge-1.21.1-52.1.3-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.1-52.1.1-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.1-52.1.3-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -574,13 +574,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.1/forge-1.21.1-52.1.1-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.3/forge-1.21.1-52.1.3-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "start.bat", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.1-52.1.1-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.1-52.1.3-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -619,7 +619,7 @@ "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "50MB", - "remark": "Only Paper included", + "remark": "Minecraft Paper", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", "author": "papermc.io", "setupInfo": { @@ -689,13 +689,13 @@ "hardware": "RAM 8G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -712,13 +712,13 @@ "hardware": "RAM 8G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.8 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.8 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -730,7 +730,7 @@ "description": "森林之子服务器,适用于 Windows 系统", "image": "https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/1326470/header.jpg?t=1708624856", "remark": "请在防火墙放行8766(UDP) 27016(UDP) 9700(UDP)端口", - "gameType": "Son Of The Forest", + "gameType": "Sons Of The Forest", "category": "最新版本", "runtime": "Windows 10+", "hardware": "RAM 8G+", @@ -774,13 +774,13 @@ } }, { - "title": "Son Of The Forest Official Server", + "title": "Sons Of The Forest Official Server", "language": "en_us", "platform": "Windows", - "description": "Son Of The Forest Server for Windows system.", + "description": "Sons Of The Forest Server for Windows system.", "image": "https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/1326470/header.jpg?t=1708624856", "remark": "Please allow port 8766 (UDP) 27016 (UDP) 9700 (UDP) to pass through the firewall.", - "gameType": "Son Of The Forest", + "gameType": "Sons Of The Forest", "category": "latest", "runtime": "Windows 10+", "hardware": "RAM 8G+", diff --git a/templates.json b/templates.json index 8cbd314..e54a464 100644 --- a/templates.json +++ b/templates.json @@ -21,12 +21,12 @@ "hardware": "RAM 4G+", "size": "55MB", "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2481.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2496.jar", "author": "purpurmc.org", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2481.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2496.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -307,12 +307,12 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/10/downloads/paper-1.21.8-10.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/60/downloads/paper-1.21.8-60.jar", "author": "papermc.io", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-10.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-60.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -329,7 +329,7 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.6/builds/48/downloads/paper-1.21.4-48.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.6/builds/48/downloads/paper-1.21.6-48.jar", "author": "papermc.io", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { @@ -451,28 +451,6 @@ "oe": "utf-8" } }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "[Paper] Minecraft 1.20.2 Paper", - "title": "Minecraft 1.20.2", - "category": "mc-paper", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "150MB", - "remark": "Includes some basic plugins", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.20.2/builds/318/downloads/paper-1.20.2-318.jar", - "author": "papermc.io", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.2-318.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, { "language": "en_us", "gameType": "Minecraft", @@ -495,160 +473,6 @@ "oe": "utf-8" } }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "[Paper] Minecraft 1.19.4 Paper", - "title": "Minecraft 1.19.4", - "category": "mc-paper", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.19.4/builds/550/downloads/paper-1.19.4-550.jar", - "author": "papermc.io", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.19.4-550.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "[Paper] Minecraft 1.19.2 Paper", - "title": "Minecraft 1.19.2", - "category": "mc-paper", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.19.2/builds/307/downloads/paper-1.19.2-307.jar", - "author": "papermc.io", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.19.2-307.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "[Paper] Minecraft 1.18.2 Paper", - "title": "Minecraft 1.18.2", - "category": "mc-paper", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.18.2/builds/388/downloads/paper-1.18.2-388.jar", - "author": "papermc.io", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.18.2-388.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "[Paper] Minecraft 1.17.1 Paper", - "title": "Minecraft 1.17.1", - "category": "mc-paper", - "runtime": "Java 16+", - "hardware": "RAM 4G+", - "size": "60MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.17.1/builds/411/downloads/paper-1.17.1-411.jar", - "author": "papermc.io", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.17.1-411.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "[Paper] Minecraft 1.16.5 Paper", - "title": "Minecraft 1.16.5", - "category": "mc-paper", - "runtime": "Java 8+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.16.5/builds/794/downloads/paper-1.16.5-794.jar", - "author": "papermc.io", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.16.5-794.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "[Paper] Minecraft 1.12.2 Paper", - "title": "Minecraft 1.12.2", - "category": "mc-paper", - "runtime": "Java 8+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.12.2/builds/1620/downloads/paper-1.12.2-1620.jar", - "author": "papermc.io", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.12.2-1620.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "[Paper] Minecraft 1.8.8 Paper", - "title": "Minecraft 1.8.8", - "category": "mc-paper", - "runtime": "Java 7+", - "hardware": "RAM 4G+", - "size": "20MB", - "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.8.8/builds/445/downloads/paper-1.8.8-445.jar", - "author": "papermc.io", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.8.8-445.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, { "language": "en_us", "gameType": "Minecraft", @@ -659,14 +483,14 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.4-beta/neoforge-21.8.4-beta-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.47/neoforge-21.8.47-installer.jar", "author": "neoforged.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.8.4-beta-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.8.47-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -703,14 +527,14 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.5.87/neoforge-21.5.87-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.5.95/neoforge-21.5.95-installer.jar", "author": "neoforged.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.5.87-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.5.95-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -725,14 +549,14 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.147/neoforge-21.4.147-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.154/neoforge-21.4.154-installer.jar", "author": "neoforged.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.4.147-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.4.154-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -747,14 +571,14 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.193/neoforge-21.1.193-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.209/neoforge-21.1.209-installer.jar", "author": "neoforged.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.1.193-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.1.209-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -769,14 +593,14 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.6.137/neoforge-20.6.137-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.6.138/neoforge-20.6.138-installer.jar", "author": "neoforged.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-20.6.137-installer.jar --installServer", + "updateCommand": "java -jar neoforge-20.6.138-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -791,36 +615,14 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.4.248/neoforge-20.4.248-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.4.250/neoforge-20.4.250-installer.jar", "author": "neoforged.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-20.4.248-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "NeoForge 1.20.2 (Supports Mods)", - "category": "mc-neoforge", - "runtime": "Java 21+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/20.2.93/neoforge-20.2.93-installer.jar", - "author": "neoforged.net", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar neoforge-20.2.93-installer.jar --installServer", + "updateCommand": "java -jar neoforge-20.4.250-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -835,14 +637,14 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.0.0/forge-1.21.8-58.0.0-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.1/forge-1.21.8-58.1.1-installer.jar", "author": "minecraftforge.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.8-58.0.0-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.8-58.1.1-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -879,14 +681,14 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.5-55.0.23/forge-1.21.5-55.0.23-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.5-55.1.0/forge-1.21.5-55.1.0-installer.jar", "author": "minecraftforge.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.5-55.0.23-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.5-55.1.0-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -901,14 +703,14 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.3/forge-1.21.4-54.1.3-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.6/forge-1.21.4-54.1.6-installer.jar", "author": "minecraftforge.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.4-54.1.3-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.4-54.1.6-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -923,14 +725,14 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.1/forge-1.21.1-52.1.1-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.3/forge-1.21.1-52.1.3-installer.jar", "author": "minecraftforge.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.1-52.1.1-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.1-52.1.3-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -945,14 +747,14 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.2.0/forge-1.20.6-50.2.0-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.2.1/forge-1.20.6-50.2.1-installer.jar", "author": "minecraftforge.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.20.6-50.2.0-installer.jar --installServer", + "updateCommand": "java -jar forge-1.20.6-50.2.1-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -1023,28 +825,6 @@ "oe": "utf-8" } }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.19.2 (Supports Mods)", - "category": "mc-forge", - "runtime": "Java 17+", - "hardware": "RAM 8G+", - "size": "7MB", - "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.5.0/forge-1.19.2-43.5.0-installer.jar", - "author": "minecraftforge.net", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/forge", - "startCommand": "sh ./run.sh", - "stopCommand": "stop", - "updateCommand": "java -jar forge-1.19.2-43.5.0-installer.jar --installServer", - "ie": "utf-8", - "oe": "utf-8" - } - }, { "language": "en_us", "gameType": "Minecraft", @@ -1187,14 +967,14 @@ "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.8 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.8 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -1209,14 +989,14 @@ "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.6 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.6 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -1231,14 +1011,14 @@ "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.5 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.5 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -1253,14 +1033,14 @@ "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -1275,14 +1055,14 @@ "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.21.1 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.1 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -1297,14 +1077,14 @@ "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.20.6 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.20.6 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -1319,14 +1099,14 @@ "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.20.4 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.20.4 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -1341,14 +1121,14 @@ "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.20.1 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.20.1 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -1363,36 +1143,14 @@ "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.19.4 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "Minecraft 1.19.2 with Fabric Loader", - "title": "Fabric 1.19.2 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 17+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.19.2 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.19.4 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -1407,14 +1165,14 @@ "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.18.2 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.18.2 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -1429,14 +1187,14 @@ "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.17.1 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.17.1 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -1451,58 +1209,14 @@ "hardware": "RAM 4G+", "size": "5MB", "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.16.5 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "Minecraft 1.15.2 with Fabric Loader", - "title": "Fabric 1.15.2 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 8+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", - "author": "fabricmc.net", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/fabric", - "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", - "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.15.2 -downloadMinecraft -noprofile", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "Minecraft 1.14.4 with Fabric Loader", - "title": "Fabric 1.14.4 (Supports Mods)", - "category": "mc-fabric", - "runtime": "Java 8+", - "hardware": "RAM 4G+", - "size": "5MB", - "remark": "Minecraft Fabric", - "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.3/fabric-installer-1.0.3.jar", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.0.3.jar server -mcversion 1.14.4 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.16.5 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -1869,12 +1583,12 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/10/downloads/paper-1.21.8-10.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/60/downloads/paper-1.21.8-60.jar", "author": "papermc.io", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-10.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-60.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -1891,7 +1605,7 @@ "hardware": "RAM 4G+", "size": "50MB", "remark": "Only Paper included", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.6/builds/48/downloads/paper-1.21.4-48.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.6/builds/48/downloads/paper-1.21.6-48.jar", "author": "papermc.io", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "setupInfo": { From 63eb7418de5be3eb13e9eb06c7003c9a56317ecc Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 21 Sep 2025 13:31:12 +0800 Subject: [PATCH 394/463] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E9=85=8D=E7=BD=AE=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- market.json | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/market.json b/market.json index f2a22a1..d984da1 100644 --- a/market.json +++ b/market.json @@ -166,9 +166,6 @@ "{mcsm_workspace}/ZomboidConfig|/home/steam/Zomboid", "{mcsm_workspace}/ZomboidDedicatedServer|/home/steam/ZomboidDedicatedServer" ], - "memory": 4096, - "networkMode": "bridge", - "cpuUsage": 100, "workingDir": "", "env": [], "changeWorkdir": false @@ -204,9 +201,6 @@ "containerName": "endstone-server", "ports": ["{mcsm_port1}:19132/udp"], "extraVolumes": [], - "memory": 2048, - "networkMode": "bridge", - "cpuUsage": 100, "workingDir": "", "env": [], "changeWorkdir": true @@ -381,9 +375,6 @@ "containerName": "terraria-server", "ports": ["{mcsm_port1}:7777/tcp"], "extraVolumes": [], - "memory": 4096, - "networkMode": "bridge", - "cpuUsage": 100, "workingDir": "/root/.local/share/Terraria/Worlds", "env": [], "changeWorkdir": false @@ -460,9 +451,6 @@ "{mcsm_workspace}/ZomboidConfig|/home/steam/Zomboid", "{mcsm_workspace}/ZomboidDedicatedServer|/home/steam/ZomboidDedicatedServer" ], - "memory": 4096, - "networkMode": "bridge", - "cpuUsage": 100, "workingDir": "", "env": [], "changeWorkdir": false @@ -852,9 +840,6 @@ "containerName": "endstone-server", "ports": ["{mcsm_port1}:19132/udp"], "extraVolumes": [], - "memory": 2048, - "networkMode": "bridge", - "cpuUsage": 100, "workingDir": "", "env": [], "changeWorkdir": true @@ -989,9 +974,6 @@ "extraVolumes": [ "{mcsm_workspace}/SquadConfig|/home/steam/squad-dedicated/SquadGame/ServerConfig/" ], - "memory": 8192, - "networkMode": "bridge", - "cpuUsage": 100, "workingDir": "", "env": [], "changeWorkdir": false @@ -1029,9 +1011,6 @@ "extraVolumes": [ "{mcsm_workspace}/SquadConfig|/home/steam/squad-dedicated/SquadGame/ServerConfig/" ], - "memory": 8192, - "networkMode": "bridge", - "cpuUsage": 100, "workingDir": "", "env": [], "changeWorkdir": false @@ -1071,9 +1050,6 @@ "{mcsm_workspace}/config:/app/.config/unity3d/Facepunch/Rust", "{mcsm_workspace}/data:/data" ], - "memory": 16384, - "networkMode": "bridge", - "cpuUsage": 100, "workingDir": "", "env": [], "changeWorkdir": false @@ -1113,9 +1089,6 @@ "{mcsm_workspace}/config:/app/.config/unity3d/Facepunch/Rust", "{mcsm_workspace}/data:/data" ], - "memory": 16384, - "networkMode": "bridge", - "cpuUsage": 100, "workingDir": "", "env": [], "changeWorkdir": false From 259345703c904dbbe3a04ce97e243e2f3ff5d691 Mon Sep 17 00:00:00 2001 From: SkyKingPX Date: Tue, 23 Sep 2025 12:33:07 +0200 Subject: [PATCH 395/463] Updated Versions & Descriptions fix: Fixed Windows start command Added NeoForge Versions --- market.json | 410 ++++++++++++++++++++++++++++++++++++++++--------- templates.json | 236 ++++++++++------------------ 2 files changed, 420 insertions(+), 226 deletions(-) diff --git a/market.json b/market.json index d984da1..f91b492 100644 --- a/market.json +++ b/market.json @@ -15,10 +15,10 @@ { "language": "zh_cn", "platform": "ALL", - "description": " Minecraft 1.21.1 快速开服", + "description": " Minecraft 1.21.1 快速开服 ", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/wallpaper.webp", "gameType": "Minecraft", - "title": "Minecraft 1.21.1 快速开服", + "title": "[PaperMC] Minecraft 1.21.1 快速开服", "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 8G+", @@ -41,7 +41,7 @@ "description": " 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/wallpaper.webp", "gameType": "Minecraft", - "title": "Minecraft 1.20.4", + "title": "[PaperMC] Minecraft 1.20.4", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 6G+", @@ -213,7 +213,7 @@ "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "description": "Paper Minecraft 1.21.8 快速开服,性能强,占用少,支持插件,不支持模组", - "title": "Minecraft 1.21.8 Paper 快速开服", + "title": "[PaperMC] Minecraft 1.21.8 快速开服", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -236,7 +236,7 @@ "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "description": "Paper Minecraft 1.20.1 快速开服,性能强,占用少,支持插件,不支持模组", - "title": "Minecraft 1.20.1 Paper 快速开服", + "title": "[PaperMC] Minecraft 1.20.1 快速开服", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -260,7 +260,7 @@ "description": "Minecraft Forge 1.20.1 服务器,支持 Forge 模组!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-mod.webp", "gameType": "Minecraft", - "title": "Forge 1.20.1 Java 版 (支持模组)", + "title": "[Forge] Minecraft 1.20.1 Java 版 (支持模组)", "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", @@ -283,7 +283,7 @@ "description": "Minecraft Forge 1.20.1 服务器,支持 Forge 模组!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-mod.webp", "gameType": "Minecraft", - "title": "Forge 1.20.1 Java 版 (支持模组)", + "title": "[Forge] Minecraft 1.20.1 Java 版 (支持模组)", "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", @@ -293,7 +293,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "start.bat", + "startCommand": ".\\run.bat", "stopCommand": "stop", "updateCommand": "java -jar forge-1.20.1-47.3.33-installer.jar --installServer", "ie": "utf-8", @@ -306,7 +306,7 @@ "description": "适用于 Windows 系统,支持 Minecraft Forge 模组,快速开服!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-mod.webp", "gameType": "Minecraft", - "title": "Forge 1.20.6 Java 版 (支持模组)", + "title": "[Forge] Minecraft 1.20.6 Java 版 (支持模组)", "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -316,7 +316,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "start.bat", + "startCommand": ".\\run.bat", "stopCommand": "stop", "updateCommand": "java -jar forge-1.20.6-50.1.48-installer.jar --installServer", "ie": "utf-8", @@ -329,7 +329,7 @@ "description": "适用于 Windows 系统,支持 Minecraft Forge 模组,快速开服!", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-mod.webp", "gameType": "Minecraft", - "title": "Forge 1.19.2 Java 版 (支持模组)", + "title": "[Forge] Minecraft 1.19.2 Java 版 (支持模组)", "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", @@ -339,7 +339,7 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "start.bat", + "startCommand": ".\\run.bat", "stopCommand": "stop", "updateCommand": "java -jar forge-1.19.2-43.4.20-installer.jar --installServer", "ie": "utf-8", @@ -458,13 +458,14 @@ } }, + { "platform": "ALL", "language": "en_us", "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "description": "Minecraft 1.21.8 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", - "title": "Paper Minecraft 1.21.8 Quick Server Setup", + "title": "[PaperMC] Minecraft 1.21.8", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -481,13 +482,36 @@ "oe": "utf-8" } }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.4 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PaperMC] Minecraft 1.21.4", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "50MB", + "remark": "Minecraft Paper", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-232.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "ALL", "language": "en_us", "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "description": "Minecraft 1.20.1 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", - "title": "Paper Minecraft 1.20.1 Quick Server Setup", + "title": "[PaperMC] Minecraft 1.20.1", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -504,13 +528,14 @@ "oe": "utf-8" } }, + { "platform": "ALL", "language": "en_us", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", "description": "Minecraft 1.21.8 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", - "title": "Purpur Minecraft 1.21.8 Quick Server Setup", + "title": "[PurpurMC] Minecraft 1.21.8", "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -527,13 +552,129 @@ "oe": "utf-8" } }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.4 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.4", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2416.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2416.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { "platform": "Linux", "language": "en_us", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-mod.webp", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.8 Forge Quick Server Setup, Mod Support for Linux", + "title": "[Forge] Minecraft 1.21.8", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.4/forge-1.21.8-58.1.4-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.8-58.1.4-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", "gameType": "Minecraft", - "description": "Forge 1.21.1 Server for Linux", - "title": "Forge 1.21.1 (Supports Mods)", + "description": "Minecraft 1.21.8 Forge Quick Server Setup, Mod Support for Windows", + "title": "[Forge] Minecraft 1.21.8", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.4/forge-1.21.8-58.1.4-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.8-58.1.4-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.4 Forge Quick Server Setup, Mod Support for Linux", + "title": "[Forge] Minecraft 1.21.4", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.7/forge-1.21.4-54.1.7-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.4-54.1.7-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.4 Forge Quick Server Setup, Mod Support for Windows", + "title": "[Forge] Minecraft 1.21.4", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.7/forge-1.21.4-54.1.7-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.4-54.1.7-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.1 Forge Quick Server Setup, Mod Support for Linux", + "title": "[Forge] Minecraft 1.21.1", "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -553,10 +694,10 @@ { "platform": "Windows", "language": "en_us", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-mod.webp", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", "gameType": "Minecraft", - "description": "Forge 1.21.1 Server for Windows", - "title": "Forge 1.21.1 (Supports Mods)", + "description": "Minecraft 1.21.1 Forge Quick Server Setup, Mod Support for Windows", + "title": "[Forge] Minecraft 1.21.1", "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -566,101 +707,172 @@ "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", - "startCommand": "start.bat", + "startCommand": ".\\run.bat", "stopCommand": "stop", "updateCommand": "java -jar forge-1.21.1-52.1.3-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, + { - "platform": "ALL", + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.8 NeoForge Quick Server Setup, Mod Support for Linux", + "title": "[NeoForge] Minecraft 1.21.8", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.47/neoforge-21.8.47-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.8.47-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", + "description": "Minecraft 1.21.8 NeoForge Quick Server Setup, Mod Support for Windows", + "title": "[NeoForge] Minecraft 1.21.8", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.47/neoforge-21.8.47-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.8.47-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "[Purpur] Minecraft 1.21.4 Purpur", - "title": "Minecraft 1.21.4", - "category": "mc-purpur", + "gameType": "Minecraft", + "description": "Minecraft 1.21.4 NeoForge Quick Server Setup, Mod Support for Linux", + "title": "[NeoForge] Minecraft 1.21.4", + "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2416.jar", - "author": "purpurmc.org", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.154/neoforge-21.4.154-installer.jar", + "author": "neoforged.net", "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2416.jar nogui", + "type": "minecraft/java/neoforge", + "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "", + "updateCommand": "java -jar neoforge-21.4.154-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { - "platform": "ALL", + "platform": "Windows", "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", + "description": "Minecraft 1.21.4 NeoForge Quick Server Setup, Mod Support for Windows", + "title": "[NeoForge] Minecraft 1.21.4", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.154/neoforge-21.4.154-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.4.154-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "Minecraft 1.21.4 Paper", - "title": "Minecraft 1.21.4", - "category": "mc-paper", + "gameType": "Minecraft", + "description": "Minecraft 1.21.1 NeoForge Quick Server Setup, Mod Support for Linux", + "title": "[NeoForge] Minecraft 1.21.1", + "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", - "size": "50MB", - "remark": "Minecraft Paper", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", - "author": "papermc.io", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.209/neoforge-21.1.209-installer.jar", + "author": "neoforged.net", "setupInfo": { - "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-232.jar nogui", + "type": "minecraft/java/neoforge", + "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "", + "updateCommand": "java -jar neoforge-21.1.209-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, { - "platform": "ALL", + "platform": "Windows", "language": "en_us", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", - "description": "[Vanilla] Minecraft 1.21.8", - "title": "Minecraft 1.21.8", - "category": "mc-vanilla", + "description": "Minecraft 1.21.1 NeoForge Quick Server Setup, Mod Support for Windows", + "title": "[NeoForge] Minecraft 1.21.1", + "category": "mc-neoforge", "runtime": "Java 21+", - "hardware": "RAM 2G+", - "size": "55MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar", - "author": "Mojang Studios", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.209/neoforge-21.1.209-installer.jar", + "author": "neoforged.net", "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "type": "minecraft/java/neoforge", + "startCommand": ".\\run.bat", "stopCommand": "stop", - "updateCommand": "", + "updateCommand": "java -jar neoforge-21.1.209-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, + { "platform": "ALL", "language": "en_us", - "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "[Vanilla] Minecraft 1.21.4", - "title": "Minecraft 1.21.4", - "category": "mc-vanilla", + "gameType": "Minecraft", + "description": "Minecraft 1.21.8 Fabric Quick Server Setup, Mod Support", + "title": "[FabricMC] Minecraft 1.21.8", + "category": "mc-fabric", "runtime": "Java 21+", - "hardware": "RAM 2G+", - "size": "55MB", - "remark": "Minecraft Java", - "targetLink": "https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar", - "author": "Mojang Studios", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", + "author": "fabricmc.net", "setupInfo": { - "type": "minecraft/java", - "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.8 -downloadMinecraft -noprofile", "ie": "utf-8", "oe": "utf-8" } @@ -670,8 +882,8 @@ "language": "en_us", "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "Minecraft 1.21.4 with Fabric Loader", - "title": "Fabric 1.21.4 (Supports Mods)", + "description": "Minecraft 1.21.4 Fabric Quick Server Setup, Mod Support", + "title": "[FabricMC] Minecraft 1.21.4", "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -691,10 +903,10 @@ { "platform": "ALL", "language": "en_us", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", "gameType": "Minecraft", - "description": "Minecraft 1.21.8 with Fabric Loader", - "title": "Fabric 1.21.8 (Supports Mods)", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.1 Fabric Quick Server Setup, Mod Support", + "title": "[FabricMC] Minecraft 1.21.1", "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -706,11 +918,59 @@ "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", "stopCommand": "stop", - "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.8 -downloadMinecraft -noprofile", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.1 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Standard Vanilla Minecraft 1.21.8 Server Setup (Official) - No Mod/Plugin Support", + "title": "[Vanilla] Minecraft 1.21.8", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Standard Vanilla Minecraft 1.21.4 Server Setup (Official) - No Mod/Plugin Support", + "title": "[Vanilla] Minecraft 1.21.4", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", "ie": "utf-8", "oe": "utf-8" } }, + { "title": "森林之子 服务器", "language": "zh_cn", diff --git a/templates.json b/templates.json index e54a464..156065c 100644 --- a/templates.json +++ b/templates.json @@ -14,8 +14,8 @@ { "language": "en_us", "gameType": "Minecraft", - "description": "[Purpur] Minecraft 1.21.8 Purpur", - "title": "Minecraft 1.21.8", + "description": "Minecraft 1.21.8 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.8", "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -36,8 +36,8 @@ { "language": "en_us", "gameType": "Minecraft", - "description": "[Purpur] Minecraft 1.21.6 Purpur", - "title": "Minecraft 1.21.6", + "description": "Minecraft 1.21.6 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.6", "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -58,30 +58,8 @@ { "language": "en_us", "gameType": "Minecraft", - "description": "[Purpur] Minecraft 1.21.5 Purpur", - "title": "Minecraft 1.21.5", - "category": "mc-purpur", - "runtime": "Java 21+", - "hardware": "RAM 4G+", - "size": "55MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.5-2450.jar", - "author": "purpurmc.org", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.5-2450.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "[Purpur] Minecraft 1.21.4 Purpur", - "title": "Minecraft 1.21.4", + "description": "Minecraft 1.21.4 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.4", "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -102,8 +80,8 @@ { "language": "en_us", "gameType": "Minecraft", - "description": "[Purpur] Minecraft 1.21.3 Purpur", - "title": "Minecraft 1.21.3", + "description": "Minecraft 1.21.3 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.3", "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -124,8 +102,8 @@ { "language": "en_us", "gameType": "Minecraft", - "description": "[Purpur] Minecraft 1.21.1 Purpur", - "title": "Minecraft 1.21.1", + "description": "Minecraft 1.21.1 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.1", "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -147,7 +125,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.20.6 Purpur", - "title": "Minecraft 1.20.6", + "title": "[PurpurMC] Minecraft 1.20.6", "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -169,7 +147,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.20.4 Purpur", - "title": "Minecraft 1.20.4", + "title": "[PurpurMC] Minecraft 1.20.4", "category": "mc-purpur", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -191,7 +169,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.20.1 Purpur", - "title": "Minecraft 1.20.1", + "title": "[PurpurMC] Minecraft 1.20.1", "category": "mc-purpur", "runtime": "Java 17+", "hardware": "RAM 4G+", @@ -213,7 +191,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.19.2 Purpur", - "title": "Minecraft 1.19.2", + "title": "[PurpurMC] Minecraft 1.19.2", "category": "mc-purpur", "runtime": "Java 17+", "hardware": "RAM 4G+", @@ -235,7 +213,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Purpur] Minecraft 1.18.2 Purpur", - "title": "Minecraft 1.18.2", + "title": "[PurpurMC] Minecraft 1.18.2", "category": "mc-purpur", "runtime": "Java 17+", "hardware": "RAM 4G+", @@ -253,55 +231,11 @@ "oe": "utf-8" } }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "[Purpur] Minecraft 1.17.1 Purpur", - "title": "Minecraft 1.17.1", - "category": "mc-purpur", - "runtime": "Java 16+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.17.1-1428.jar", - "author": "purpurmc.org", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.17.1-1428.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, - { - "language": "en_us", - "gameType": "Minecraft", - "description": "[Purpur] Minecraft 1.16.5 Purpur", - "title": "Minecraft 1.16.5", - "category": "mc-purpur", - "runtime": "Java 8+", - "hardware": "RAM 4G+", - "size": "50MB", - "remark": "Only Purpur included", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.16.5-1171.jar", - "author": "purpurmc.org", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "setupInfo": { - "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.16.5-1171.jar nogui", - "stopCommand": "stop", - "updateCommand": "", - "ie": "utf-8", - "oe": "utf-8" - } - }, { "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.8 Paper", - "title": "Minecraft 1.21.8", + "title": "[PaperMC] Minecraft 1.21.8", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -323,7 +257,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.6 Paper", - "title": "Minecraft 1.21.6", + "title": "[PaperMC] Minecraft 1.21.6", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -345,7 +279,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.4 Paper", - "title": "Minecraft 1.21.4", + "title": "[PaperMC] Minecraft 1.21.4", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -367,7 +301,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.3 Paper", - "title": "Minecraft 1.21.3", + "title": "[PaperMC] Minecraft 1.21.3", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -389,7 +323,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.1 Paper", - "title": "Minecraft 1.21.1", + "title": "[PaperMC] Minecraft 1.21.1", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -411,7 +345,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.20.6 Paper", - "title": "Minecraft 1.20.6", + "title": "[PaperMC] Minecraft 1.20.6", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -433,7 +367,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.20.4 Paper", - "title": "Minecraft 1.20.4", + "title": "[PaperMC] Minecraft 1.20.4", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -455,7 +389,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.20.1 Paper", - "title": "Minecraft 1.20.1", + "title": "[PaperMC] Minecraft 1.20.1", "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 4G+", @@ -477,7 +411,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "NeoForge 1.21.8 (Supports Mods)", + "title": "[NeoForge] Minecraft 1.21.8", "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -499,7 +433,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "NeoForge 1.21.6 (Supports Mods)", + "title": "[NeoForge] Minecraft 1.21.6", "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -521,7 +455,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "NeoForge 1.21.5 (Supports Mods)", + "title": "[NeoForge] Minecraft 1.21.5", "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -543,7 +477,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "NeoForge 1.21.4 (Supports Mods)", + "title": "[NeoForge] Minecraft 1.21.4", "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -565,7 +499,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "NeoForge 1.21.1 (Supports Mods)", + "title": "[NeoForge] Minecraft 1.21.1", "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -587,7 +521,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "NeoForge 1.20.6 (Supports Mods)", + "title": "[NeoForge] Minecraft 1.20.6", "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -609,7 +543,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "NeoForge 1.20.4 (Supports Mods)", + "title": "[NeoForge] Minecraft 1.20.4", "category": "mc-neoforge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -631,7 +565,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.21.8 (Supports Mods)", + "title": "[Forge] Minecraft 1.21.8", "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -653,7 +587,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.21.6 (Supports Mods)", + "title": "[Forge] Minecraft 1.21.6", "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -675,7 +609,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.21.5 (Supports Mods)", + "title": "[Forge] Minecraft 1.21.5", "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -697,7 +631,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.21.4 (Supports Mods)", + "title": "[Forge] Minecraft 1.21.4", "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -719,7 +653,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.21.1 (Supports Mods)", + "title": "[Forge] Minecraft 1.21.1", "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -741,7 +675,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.20.6 (Supports Mods)", + "title": "[Forge] Minecraft 1.20.6", "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -763,7 +697,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.20.4 (Supports Mods)", + "title": "[Forge] Minecraft 1.20.4", "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -785,7 +719,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.20.1 (Supports Mods)", + "title": "[Forge] Minecraft 1.20.1", "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", @@ -807,7 +741,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.19.4 (Supports Mods)", + "title": "[Forge] Minecraft 1.19.4", "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", @@ -829,7 +763,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.18.2 (Supports Mods)", + "title": "[Forge] Minecraft 1.18.2", "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", @@ -851,7 +785,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.17.1 (Supports Mods)", + "title": "[Forge] Minecraft 1.17.1", "category": "mc-forge", "runtime": "Java 16+", "hardware": "RAM 8G+", @@ -873,7 +807,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.16.5 (Supports Mods)", + "title": "[Forge] Minecraft 1.16.5", "category": "mc-forge", "runtime": "Java 8+", "hardware": "RAM 8G+", @@ -895,7 +829,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.12.2 (Supports Mods)", + "title": "[Forge] Minecraft 1.12.2", "category": "mc-forge", "runtime": "Java 8+", "hardware": "RAM 8G+", @@ -917,7 +851,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.8.9 (Supports Mods)", + "title": "[Forge] Minecraft 1.8.9", "category": "mc-forge", "runtime": "Java 7+", "hardware": "RAM 8G+", @@ -939,7 +873,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", - "title": "Forge 1.7.10 (Supports Mods)", + "title": "[Forge] Minecraft 1.7.10", "category": "mc-forge", "runtime": "Java 7+", "hardware": "RAM 8G+", @@ -961,7 +895,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Minecraft 1.21.8 with Fabric Loader", - "title": "Fabric 1.21.8 (Supports Mods)", + "title": "[FabricMC] Minecraft 1.21.8", "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -983,7 +917,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Minecraft 1.21.6 with Fabric Loader", - "title": "Fabric 1.21.6 (Supports Mods)", + "title": "[FabricMC] Minecraft 1.21.6", "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1005,7 +939,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Minecraft 1.21.5 with Fabric Loader", - "title": "Fabric 1.21.5 (Supports Mods)", + "title": "[FabricMC] Minecraft 1.21.5", "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1027,7 +961,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Minecraft 1.21.4 with Fabric Loader", - "title": "Fabric 1.21.4 (Supports Mods)", + "title": "[FabricMC] Minecraft 1.21.4", "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1049,7 +983,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Minecraft 1.21.1 with Fabric Loader", - "title": "Fabric 1.21.1 (Supports Mods)", + "title": "[FabricMC] Minecraft 1.21.1", "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1071,7 +1005,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Minecraft 1.20.6 with Fabric Loader", - "title": "Fabric 1.20.6 (Supports Mods)", + "title": "[FabricMC] Minecraft 1.20.6", "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1093,7 +1027,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Minecraft 1.20.4 with Fabric Loader", - "title": "Fabric 1.20.4 (Supports Mods)", + "title": "[FabricMC] Minecraft 1.20.4", "category": "mc-fabric", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1115,7 +1049,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Minecraft 1.20.1 with Fabric Loader", - "title": "Fabric 1.20.1 (Supports Mods)", + "title": "[FabricMC] Minecraft 1.20.1", "category": "mc-fabric", "runtime": "Java 17+", "hardware": "RAM 4G+", @@ -1137,7 +1071,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Minecraft 1.19.4 with Fabric Loader", - "title": "Fabric 1.19.4 (Supports Mods)", + "title": "[FabricMC] Minecraft 1.19.4", "category": "mc-fabric", "runtime": "Java 17+", "hardware": "RAM 4G+", @@ -1159,7 +1093,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Minecraft 1.18.2 with Fabric Loader", - "title": "Fabric 1.18.2 (Supports Mods)", + "title": "[FabricMC] Minecraft 1.18.2", "category": "mc-fabric", "runtime": "Java 17+", "hardware": "RAM 4G+", @@ -1181,7 +1115,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Minecraft 1.17.1 with Fabric Loader", - "title": "Fabric 1.17.1 (Supports Mods)", + "title": "[FabricMC] Minecraft 1.17.1", "category": "mc-fabric", "runtime": "Java 16+", "hardware": "RAM 4G+", @@ -1203,7 +1137,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "Minecraft 1.16.5 with Fabric Loader", - "title": "Fabric 1.16.5 (Supports Mods)", + "title": "[FabricMC] Minecraft 1.16.5", "category": "mc-fabric", "runtime": "Java 8+", "hardware": "RAM 4G+", @@ -1225,7 +1159,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.21.8", - "title": "Minecraft 1.21.8", + "title": "[Vanilla] Minecraft 1.21.8", "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", @@ -1247,7 +1181,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.21.6", - "title": "Minecraft 1.21.6", + "title": "[Vanilla] Minecraft 1.21.6", "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", @@ -1269,7 +1203,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.21.5", - "title": "Minecraft 1.21.5", + "title": "[Vanilla] Minecraft 1.21.5", "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", @@ -1291,7 +1225,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.21.4", - "title": "Minecraft 1.21.4", + "title": "[Vanilla] Minecraft 1.21.4", "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", @@ -1313,7 +1247,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.21.1", - "title": "Minecraft 1.21.1", + "title": "[Vanilla] Minecraft 1.21.1", "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", @@ -1335,7 +1269,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.20.6", - "title": "Minecraft 1.20.6", + "title": "[Vanilla] Minecraft 1.20.6", "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", @@ -1357,7 +1291,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.20.4", - "title": "Minecraft 1.20.4", + "title": "[Vanilla] Minecraft 1.20.4", "category": "mc-vanilla", "runtime": "Java 21+", "hardware": "RAM 2G+", @@ -1379,7 +1313,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.20.1", - "title": "Minecraft 1.20.1", + "title": "[Vanilla] Minecraft 1.20.1", "category": "mc-vanilla", "runtime": "Java 17+", "hardware": "RAM 2G+", @@ -1401,7 +1335,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.19.4", - "title": "Minecraft 1.19.4", + "title": "[Vanilla] Minecraft 1.19.4", "category": "mc-vanilla", "runtime": "Java 17+", "hardware": "RAM 2G+", @@ -1423,7 +1357,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.18.2", - "title": "Minecraft 1.18.2", + "title": "[Vanilla] Minecraft 1.18.2", "category": "mc-vanilla", "runtime": "Java 17+", "hardware": "RAM 2G+", @@ -1445,7 +1379,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.17.1", - "title": "Minecraft 1.17.1", + "title": "[Vanilla] Minecraft 1.17.1", "category": "mc-vanilla", "runtime": "Java 16+", "hardware": "RAM 2G+", @@ -1467,7 +1401,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.16.5", - "title": "Minecraft 1.16.5", + "title": "[Vanilla] Minecraft 1.16.5", "category": "mc-vanilla", "runtime": "Java 8+", "hardware": "RAM 2G+", @@ -1489,7 +1423,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.12.2", - "title": "Minecraft 1.12.2", + "title": "[Vanilla] Minecraft 1.12.2", "category": "mc-vanilla", "runtime": "Java 8+", "hardware": "RAM 2G+", @@ -1511,7 +1445,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Vanilla] Minecraft 1.8.9", - "title": "Minecraft 1.8.9", + "title": "[Vanilla] Minecraft 1.8.9", "category": "mc-vanilla", "runtime": "Java 7+", "hardware": "RAM 2G+", @@ -1533,7 +1467,7 @@ "language": "zh_cn", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.1 快速开服", - "title": "Minecraft 1.20.1", + "title": "[PaperMC] Minecraft 1.20.1", "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 4G+", @@ -1555,7 +1489,7 @@ "language": "zh_cn", "gameType": "Minecraft", "description": "[Paper] 中小型互通服推荐,1.20.4 版本,快速开服,包含ESS、锁箱子、操作回滚、领地商店等基础插件。", - "title": "Minecraft 1.20.4 (低配机器推荐)", + "title": "[PaperPC] Minecraft 1.20.4 (低配机器推荐)", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 6G+", @@ -1577,7 +1511,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.8 Paper", - "title": "Minecraft 1.21.8", + "title": "[PaperMC] Minecraft 1.21.8", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1599,7 +1533,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.6 Paper", - "title": "Minecraft 1.21.6", + "title": "[PaperMC] Minecraft 1.21.6", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1621,7 +1555,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.4 Paper", - "title": "Minecraft 1.21.4", + "title": "[PaperMC] Minecraft 1.21.4", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1643,7 +1577,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.3 Paper", - "title": "Minecraft 1.21.3", + "title": "[PaperMC] Minecraft 1.21.3", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1665,7 +1599,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.21.1 Paper", - "title": "Minecraft 1.21.1", + "title": "[PaperMC] Minecraft 1.21.1", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1687,7 +1621,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.20.6 Paper", - "title": "Minecraft 1.20.6", + "title": "[PaperMC] Minecraft 1.20.6", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1709,7 +1643,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.20.4 Paper", - "title": "Minecraft 1.20.4", + "title": "[PaperMC] Minecraft 1.20.4", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 4G+", @@ -1731,7 +1665,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.20.2 Paper", - "title": "Minecraft 1.20.2", + "title": "[PaperMC] Minecraft 1.20.2", "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 4G+", @@ -1753,7 +1687,7 @@ "language": "en_us", "gameType": "Minecraft", "description": "[Paper] Minecraft 1.20.1 Paper", - "title": "Minecraft 1.20.1", + "title": "[PaperMC] Minecraft 1.20.1", "category": "mc-paper", "runtime": "Java 17+", "hardware": "RAM 4G+", @@ -1775,7 +1709,7 @@ "language": "zh_cn", "gameType": "Minecraft", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", - "title": "Forge 1.20.1 Java 版 (支持模组)", + "title": "[Forge] Minecraft 1.20.1 Java 版 (支持模组)", "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", @@ -1797,7 +1731,7 @@ "language": "zh_cn", "gameType": "Minecraft", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", - "title": "Forge 1.20.6 Java 版 (支持模组)", + "title": "[Forge] Minecraft 1.20.6 Java 版 (支持模组)", "category": "mc-forge", "runtime": "Java 21+", "hardware": "RAM 8G+", @@ -1819,7 +1753,7 @@ "language": "zh_cn", "gameType": "Minecraft", "description": "注意:默认的启动命令是 \"sh ./run.sh\",如果需要在 Windows 上运行,请在安装后将命令修改为 \"start.bat\"", - "title": "Forge 1.19.2 Java 版 (支持模组)", + "title": "[Forge] Minecraft 1.19.2 Java 版 (支持模组)", "category": "mc-forge", "runtime": "Java 17+", "hardware": "RAM 8G+", From 51e624465c5facf300e180b51f8434b9030246af Mon Sep 17 00:00:00 2001 From: yumao233 Date: Mon, 29 Sep 2025 16:01:10 +0800 Subject: [PATCH 396/463] fix: memory --- market.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/market.json b/market.json index f91b492..4c507a0 100644 --- a/market.json +++ b/market.json @@ -87,7 +87,6 @@ "containerName": "terraria-server", "ports": ["{mcsm_port1}:7777/tcp"], "extraVolumes": [], - "memory": 4096, "networkMode": "bridge", "cpuUsage": 100, "workingDir": "/root/.local/share/Terraria/Worlds", @@ -458,7 +457,6 @@ } }, - { "platform": "ALL", "language": "en_us", From ef9fdaf860a7162b2e0e1d610ee77c95690f8ea8 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sun, 5 Oct 2025 12:14:32 +0800 Subject: [PATCH 397/463] fix: syntax error: unexpected end of file --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 704e332..82ef7b3 100644 --- a/setup.sh +++ b/setup.sh @@ -1303,4 +1303,4 @@ main() { safe_run install_mcsm "Failed to install MCSManager" } -main "$@" \ No newline at end of file +main "$@" From 21f04dcd90383c1e3e9349b679bc16a6c1df934a Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sun, 5 Oct 2025 12:18:19 +0800 Subject: [PATCH 398/463] fix: syntax error: unexpected end of file --- setup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.sh b/setup.sh index 82ef7b3..6c62918 100644 --- a/setup.sh +++ b/setup.sh @@ -1303,4 +1303,6 @@ main() { safe_run install_mcsm "Failed to install MCSManager" } + main "$@" +# End of file From 10d420af2092a9aa96e0847255844ea20bc527ba Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sun, 5 Oct 2025 12:24:31 +0800 Subject: [PATCH 399/463] fix: by ai --- setup.sh | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/setup.sh b/setup.sh index 6c62918..4d0e09d 100644 --- a/setup.sh +++ b/setup.sh @@ -432,14 +432,6 @@ check_supported_os() { return 0 } -Install_Node() { - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Node.js version is up-to-date, skipping installation." - return - fi - - echo_cyan "[+] Install Node.JS environment..." - # Print with specified color and style, fallback to RESET if not supported. # Supported colors*: black|red|green|yellow|blue|magenta|cyan|white # Supported styles*: bold|underline|italic|clear_line|strikethrough @@ -506,7 +498,7 @@ cprint() { # Permission check before proceed with installation permission_barrier() { if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then - cprint cyan "No components currently installed — skipping permission check." + cprint cyan "No components currently installed - skipping permission check." return 0 fi @@ -829,7 +821,7 @@ download_mcsm() { # Prepare user if needed prepare_user() { if [[ "$install_user" == "root" ]]; then - cprint cyan "install_user is 'root' — skipping user creation." + cprint cyan "install_user is 'root' - skipping user creation." return 0 fi @@ -847,7 +839,7 @@ prepare_user() { # Docker integration if command -v docker &>/dev/null; then - cprint cyan "Docker is installed — checking group assignment..." + cprint cyan "Docker is installed - checking group assignment..." if getent group docker &>/dev/null; then if id -nG "$install_user" | grep -qw docker; then @@ -864,7 +856,7 @@ prepare_user() { cprint red "Docker installed but 'docker' group not found. Skipping group assignment." fi else - cprint yellow "Docker not installed — skipping Docker group configuration." + cprint yellow "Docker not installed - skipping Docker group configuration." fi return 0 @@ -891,7 +883,7 @@ mcsm_install_prepare() { [[ "${install_dir}" != */ ]] && install_dir="${install_dir}/" if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then - cprint cyan "No existing components detected — skipping data backup/cleanup." + cprint cyan "No existing components detected - skipping data backup/cleanup." return 0 fi @@ -923,7 +915,7 @@ mcsm_install_prepare() { } cprint green "Moved $data_dir → $backup_path" else - cprint yellow "No data directory found for $component — skipping backup." + cprint yellow "No data directory found for $component - skipping backup." fi cprint cyan "Removing old component directory: $component_path" @@ -957,7 +949,7 @@ install_component() { if [[ -e "$target_path" ]]; then cprint red bold "Target path already exists: $target_path" - cprint red " This should not happen — possible permission error or unclean install." + cprint red " This should not happen - possible permission error or unclean install." cleanup_install_tmp exit 1 fi @@ -985,7 +977,7 @@ install_component() { cprint green "Data directory restored: $target_data_path" else - cprint yellow "No backed-up data directory found for $component — fresh install assumed." + cprint yellow "No backed-up data directory found for $component - fresh install assumed." fi # Step 3: Install NPM dependencies @@ -1296,7 +1288,7 @@ main() { safe_run install_node "Node.js installation failed" fi - safe_run permission_barrier "Permission validation failed — aborting install" + safe_run permission_barrier "Permission validation failed - aborting install" safe_run download_mcsm "Failed to acquire MCSManager source" safe_run mcsm_install_prepare "Error while preparing for installation" From 24ec93b544ff4de1100bea8a67ae9a3a4cdd6eb0 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sun, 5 Oct 2025 12:26:22 +0800 Subject: [PATCH 400/463] fix: merge err --- setup.sh | 113 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 98 insertions(+), 15 deletions(-) diff --git a/setup.sh b/setup.sh index 4d0e09d..f1264ab 100644 --- a/setup.sh +++ b/setup.sh @@ -23,10 +23,75 @@ download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/ # Name of the release package to download/detect package_name="mcsmanager_linux_release.tar.gz" -if [ "$(id -u)" -ne 0 ]; then - echo "This script must be run as root. Please use \"sudo bash\" instead." - exit 1 -fi +# Node.js version to be installed +# Keep the leading "v" +node_version="v20.12.2" + +# Node download base URL - primary +node_download_url_base="https://nodejs.org/dist/" + +# Node download URL - fallback. +# This is the URL points directly to the file, not the base. This can also be a local absolute path. +# Only supports https:// or http:// for web locations. +node_download_fallback="" + +# Node.js installation path (defaults to the MCSManager installation path. Can be overridden with --node-install-dir) +node_install_dir="$install_dir" + +# Temp dir for file extraction +tmp_dir="/tmp" + +# --------------- Global Variables ---------------# +# DO NOT MODIFY # + + +# Component installation options. +# For fresh installs, both daemon and web components are installed by default. +# For updates, behavior depends on detected existing components. +# Can be overridden with --install daemon/web/all +install_daemon=true +install_web=true + +# Install MCSM as (default: root). +# To install as a general user (e.g., "mcsm"), use the --user option: --user mcsm +# To ensure compatibility, only user mcsm is supported. +install_user="root" +# Installed user, for permission check +web_installed=false +daemon_installed=false +web_installed_user="" +daemon_installed_user="" + +# Service file locations +# the final dir = systemd_file + {web/daemon} + ".service" +systemd_file="/etc/systemd/system/mcsm-" +# Optional: Override the default installation source file. +# If --install-source is specified, the installer will use the provided +# "mcsmanager_linux_release.tar.gz" file instead of downloading it. +# Only support local absolute path. +install_source_path="" + +# temp path for extracted file(s) +install_tmp_dir="/opt/mcsmanager/mcsm_abcd" + +# dir name for data dir backup +# e.g. /opt/mcsmanager/daemon/data -> /opt/mcsmanager/data_bak_data +# only valid for when during an update +backup_prefix="data_bak_" + +# System architecture (detected automatically) +arch="" +version="" +distro="" + +# Supported OS versions (map-style structure) +# Format: supported_os["distro_name"]="version1 version2 version3 ..." +declare -A supported_os +supported_os["Ubuntu"]="18 20 22 24" +supported_os["Debian"]="10 11 12 13" +supported_os["CentOS"]="7 8 8-stream 9-stream 10-stream" +supported_os["RHEL"]="7 8 9 10" +supported_os["Arch"]="rolling" # Required system commands for installation # These will be checked before logic process @@ -432,6 +497,26 @@ check_supported_os() { return 0 } +# Check if all required commands are available +check_required_commands() { + local missing=0 + + for cmd in "${required_commands[@]}"; do + if ! command -v "$cmd" >/dev/null 2>&1; then + echo "Error: Required command '$cmd' is not available in PATH." + missing=1 + fi + done + + if [ "$missing" -ne 0 ]; then + echo "One or more required commands are missing. Please install them and try again." + return 1 + fi + + cprint green "All required commands are available." + return 0 +} + # Print with specified color and style, fallback to RESET if not supported. # Supported colors*: black|red|green|yellow|blue|magenta|cyan|white # Supported styles*: bold|underline|italic|clear_line|strikethrough @@ -498,7 +583,7 @@ cprint() { # Permission check before proceed with installation permission_barrier() { if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then - cprint cyan "No components currently installed - skipping permission check." + cprint cyan "No components currently installed — skipping permission check." return 0 fi @@ -821,7 +906,7 @@ download_mcsm() { # Prepare user if needed prepare_user() { if [[ "$install_user" == "root" ]]; then - cprint cyan "install_user is 'root' - skipping user creation." + cprint cyan "install_user is 'root' — skipping user creation." return 0 fi @@ -839,7 +924,7 @@ prepare_user() { # Docker integration if command -v docker &>/dev/null; then - cprint cyan "Docker is installed - checking group assignment..." + cprint cyan "Docker is installed — checking group assignment..." if getent group docker &>/dev/null; then if id -nG "$install_user" | grep -qw docker; then @@ -856,7 +941,7 @@ prepare_user() { cprint red "Docker installed but 'docker' group not found. Skipping group assignment." fi else - cprint yellow "Docker not installed - skipping Docker group configuration." + cprint yellow "Docker not installed — skipping Docker group configuration." fi return 0 @@ -883,7 +968,7 @@ mcsm_install_prepare() { [[ "${install_dir}" != */ ]] && install_dir="${install_dir}/" if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then - cprint cyan "No existing components detected - skipping data backup/cleanup." + cprint cyan "No existing components detected — skipping data backup/cleanup." return 0 fi @@ -915,7 +1000,7 @@ mcsm_install_prepare() { } cprint green "Moved $data_dir → $backup_path" else - cprint yellow "No data directory found for $component - skipping backup." + cprint yellow "No data directory found for $component — skipping backup." fi cprint cyan "Removing old component directory: $component_path" @@ -949,7 +1034,7 @@ install_component() { if [[ -e "$target_path" ]]; then cprint red bold "Target path already exists: $target_path" - cprint red " This should not happen - possible permission error or unclean install." + cprint red " This should not happen — possible permission error or unclean install." cleanup_install_tmp exit 1 fi @@ -977,7 +1062,7 @@ install_component() { cprint green "Data directory restored: $target_data_path" else - cprint yellow "No backed-up data directory found for $component - fresh install assumed." + cprint yellow "No backed-up data directory found for $component — fresh install assumed." fi # Step 3: Install NPM dependencies @@ -1288,13 +1373,11 @@ main() { safe_run install_node "Node.js installation failed" fi - safe_run permission_barrier "Permission validation failed - aborting install" + safe_run permission_barrier "Permission validation failed — aborting install" safe_run download_mcsm "Failed to acquire MCSManager source" safe_run mcsm_install_prepare "Error while preparing for installation" safe_run install_mcsm "Failed to install MCSManager" } - main "$@" -# End of file From 12cb0e39daf2c7e3655dd0b6a735106ea69cc4b1 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sun, 5 Oct 2025 12:34:41 +0800 Subject: [PATCH 401/463] fix: rollback --- setup.sh | 1521 +++++++---------------------------------------------- setup2.sh | 1383 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1576 insertions(+), 1328 deletions(-) create mode 100644 setup2.sh diff --git a/setup.sh b/setup.sh index f1264ab..959b3b4 100644 --- a/setup.sh +++ b/setup.sh @@ -1,1383 +1,248 @@ #!/bin/bash -# Official MCSManager installation script. -# This script installs or updates the MCSManager Web and/or Daemon to the latest version. -# ------------------------------------------------------------------------------ -# Supported Linux distributions: -# This script supports the following mainstream Linux distributions: -# - Ubuntu: 18.04, 20.04, 22.04, 24.04 -# - Debian: 10, 11, 12, 13 -# - CentOS: 7, 8 Stream, 9 Stream, 10 Stream -# - RHEL: 7, 8, 9, 10 -# - Arch Linux: Support planned (TBD) -# ------------------------------------------------------------------------------ +# Official installation script. -# Target installation directory (can be overridden with --install-dir) -install_dir="/opt/mcsmanager" - -# Primary download URL bas. Full package URL = download_base_url + package_name -download_base_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" - -# Fallback download URL (can also be a local directory or mirror) -download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" - -# Name of the release package to download/detect +mcsmanager_install_path="/opt/mcsmanager" +mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" package_name="mcsmanager_linux_release.tar.gz" +node="v20.12.2" +arch=$(uname -m) -# Node.js version to be installed -# Keep the leading "v" -node_version="v20.12.2" - -# Node download base URL - primary -node_download_url_base="https://nodejs.org/dist/" - -# Node download URL - fallback. -# This is the URL points directly to the file, not the base. This can also be a local absolute path. -# Only supports https:// or http:// for web locations. -node_download_fallback="" - -# Node.js installation path (defaults to the MCSManager installation path. Can be overridden with --node-install-dir) -node_install_dir="$install_dir" - -# Temp dir for file extraction -tmp_dir="/tmp" - -# --------------- Global Variables ---------------# -# DO NOT MODIFY # - - -# Component installation options. -# For fresh installs, both daemon and web components are installed by default. -# For updates, behavior depends on detected existing components. -# Can be overridden with --install daemon/web/all -install_daemon=true -install_web=true - -# Install MCSM as (default: root). -# To install as a general user (e.g., "mcsm"), use the --user option: --user mcsm -# To ensure compatibility, only user mcsm is supported. -install_user="root" -# Installed user, for permission check -web_installed=false -daemon_installed=false -web_installed_user="" -daemon_installed_user="" - -# Service file locations -# the final dir = systemd_file + {web/daemon} + ".service" -systemd_file="/etc/systemd/system/mcsm-" -# Optional: Override the default installation source file. -# If --install-source is specified, the installer will use the provided -# "mcsmanager_linux_release.tar.gz" file instead of downloading it. -# Only support local absolute path. -install_source_path="" - -# temp path for extracted file(s) -install_tmp_dir="/opt/mcsmanager/mcsm_abcd" - -# dir name for data dir backup -# e.g. /opt/mcsmanager/daemon/data -> /opt/mcsmanager/data_bak_data -# only valid for when during an update -backup_prefix="data_bak_" - -# System architecture (detected automatically) -arch="" -version="" -distro="" - -# Supported OS versions (map-style structure) -# Format: supported_os["distro_name"]="version1 version2 version3 ..." -declare -A supported_os -supported_os["Ubuntu"]="18 20 22 24" -supported_os["Debian"]="10 11 12 13" -supported_os["CentOS"]="7 8 8-stream 9-stream 10-stream" -supported_os["RHEL"]="7 8 9 10" -supported_os["Arch"]="rolling" +if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run as root. Please use \"sudo bash\" instead." + exit 1 +fi -# Required system commands for installation -# These will be checked before logic process -required_commands=( - chmod - chown - wget - tar - stat - useradd - usermod - date -) +printf "\033c" -# Node.js related sections -# Enable strict version checking (exact match) -# enabled -> strict requriement for defined node version -# false -> newer version allowed -# Older version is NEVER allowed -strict_node_version_check=false - -# Will be set based on actual node status -install_node=true -# Remove leading "v" from defined version -required_node_ver="${node_version#v}" - -# Holds absolute path for node & npm -node_bin_path="" -npm_bin_path="" -# Hold Node.js arch name, e.g. x86_64 -> x64 -node_arch="" -# Hold Node.js intallation path, e.g. ${node_install_dir}/node-${node_version}-linux-${arch} -node_path="" - -# For installation result -daemon_key="" -daemon_port="" -web_port="" -daemon_key_config_subpath="data/Config/global.json" -web_port_config_subpath="data/SystemConfig/config.json" - -# Terminal color & style related -# Default to false, auto check later -SUPPORTS_COLOR=false -SUPPORTS_STYLE=false -# Declare ANSI reset -RESET="\033[0m" - -# Foreground colors -declare -A FG_COLORS=( - [black]="\033[0;30m" - [red]="\033[0;31m" - [green]="\033[0;32m" - [yellow]="\033[0;33m" - [blue]="\033[0;34m" - [magenta]="\033[0;35m" - [cyan]="\033[0;36m" - [white]="\033[0;37m" -) - -# Font styles -declare -A STYLES=( - [bold]="\033[1m" - [underline]="\033[4m" - [italic]="\033[3m" # Often ignored - [clear_line]="\r\033[2K" - [strikethrough]="\033[9m" -) - - -### Helper Functions -# Execution wrapper, avoid unexpected crashes. -safe_run() { - local func="$1" - local err_msg="$2" - shift 2 - - if ! "$func" "$@"; then - echo "Error: $err_msg" - exit 1 - fi +echo_cyan() { + printf '\033[1;36m%b\033[0m\n' "$@" } - -# Function to ensure the script is run as root -check_root() { - # Using Bash's built-in EUID variable - if [ -n "$EUID" ]; then - if [ "$EUID" -ne 0 ]; then - cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." - exit 1 - fi - else - # Fallback to using id -u if EUID is unavailable (e.g., non-Bash shell or misconfigured environment) - if [ "$(id -u)" -ne 0 ]; then - cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." - exit 1 - fi - fi +echo_red() { + printf '\033[1;31m%b\033[0m\n' "$@" } - -# Function to check whether current terminal support color & style -detect_terminal_capabilities() { - SUPPORTS_COLOR=false - SUPPORTS_STYLE=false - - if [ -t 1 ] && command -v tput >/dev/null 2>&1; then - if [ "$(tput colors)" -ge 8 ]; then - SUPPORTS_COLOR=true - fi - if tput bold >/dev/null 2>&1 && tput smul >/dev/null 2>&1; then - SUPPORTS_STYLE=true - fi - fi - - if [ "$SUPPORTS_COLOR" = true ]; then - cprint green "[OK] Terminal supports colored output." - else - cprint yellow "Note: Terminal does not support colored output. Continuing without formatting." - fi - - if [ "$SUPPORTS_STYLE" = true ]; then - cprint green "[OK] Terminal supports bold and underline formatting." - else - cprint yellow "Note: Terminal does not support advanced text styles." - fi +echo_green() { + printf '\033[1;32m%b\033[0m\n' "$@" } - -# Check whether daemon or web is installed -is_component_installed() { - local component_name="$1" - local component_path="${install_dir}/${component_name}" - - if [[ -d "$component_path" ]]; then - cprint green "Component '$component_name' is already installed at $component_path" - - # Set corresponding global variable - if [[ "$component_name" == "daemon" ]]; then - daemon_installed=true - elif [[ "$component_name" == "web" ]]; then - web_installed=true - fi - - return 0 - else - cprint yellow "Component '$component_name' is not installed" - - # Set corresponding global variable - if [[ "$component_name" == "daemon" ]]; then - daemon_installed=false - elif [[ "$component_name" == "web" ]]; then - web_installed=false - fi - - return 1 - fi +echo_cyan_n() { + printf '\033[1;36m%b\033[0m' "$@" } - -check_component_permission() { - local component="$1" - local service_file="${systemd_file}${component}.service" - - if [[ ! -f "$service_file" ]]; then - cprint yellow "Service file not found: $service_file" - return 0 # nothing changed - fi - - # Extract the User= line if it exists - local user_line - user_line=$(grep -E '^User=' "$service_file" 2>/dev/null | head -1) - - local user - if [[ -z "$user_line" ]]; then - user="root" # default if no User= is defined - else - user="${user_line#User=}" - fi - - # Validate user - if [[ "$user" != "root" && "$user" != "mcsm" ]]; then - cprint red bold "Unsupported user '$user' in $service_file. Expected 'root' or 'mcsm'." - exit 1 - fi - - # Assign to appropriate global - if [[ "$component" == "web" ]]; then - web_installed_user="$user" - elif [[ "$component" == "daemon" ]]; then - daemon_installed_user="$user" - fi - - cprint cyan "Detected $component installed as user: $user" - return 0 +echo_yellow() { + printf '\033[1;33m%b\033[0m\n' "$@" } +# script info +echo_cyan "+---------------------------------------------------------------------- +| MCSManager Installer ++---------------------------------------------------------------------- +" - -parse_args() { - local explicit_install_flag=false - - while [[ $# -gt 0 ]]; do - case "$1" in - --install-dir) - if [[ -n "$2" ]]; then - install_dir="$2" - shift 2 - else - echo "Error: --install-dir requires a path argument." - exit 1 - fi - ;; - --node-install-dir) - if [[ -n "$2" ]]; then - node_install_dir="$2" - shift 2 - else - echo "Error: --node-install-dir requires a path argument." - exit 1 - fi - ;; - --install) - explicit_install_flag=true - if [[ -n "$2" && "$2" != --* ]]; then - case "$2" in - daemon) - install_daemon=true - is_component_installed "daemon" - install_web=false - check_component_permission "daemon" - ;; - web) - install_daemon=false - is_component_installed "web" - install_web=true - check_component_permission "web" - ;; - all) - install_daemon=true - install_web=true - is_component_installed "daemon" - is_component_installed "web" - check_component_permission "daemon" - check_component_permission "web" - ;; - *) - echo "Error: Invalid value for --install. Expected 'daemon', 'web', or 'all'." - echo "Usage: --install daemon|web|all" - exit 1 - ;; - esac - shift 2 - else - echo "Error: --install flag provided but no value. Please specify: daemon, web, or all." - echo "Usage: --install daemon|web|all" - exit 1 - fi - ;; - --user) - if [[ -n "$2" ]]; then - case "$2" in - root) - install_user="root" - ;; - mcsm) - install_user="mcsm" - ;; - *) - echo "Error: Invalid user '$2'. Only 'root' and 'mcsm' are supported." - echo "Usage: --user root|mcsm" - exit 1 - ;; - esac - shift 2 - else - echo "Error: --user requires a value (root or mcsm)." - exit 1 - fi - ;; - --install-source) - if [[ -n "$2" ]]; then - install_source_path="$2" - shift 2 - else - echo "Error: --install-source requires a file path." - exit 1 - fi - ;; - *) - echo "Error: Unknown argument: $1" - exit 1 - ;; - esac - done - - # Auto-detect branch: only run if --install was not explicitly passed - if [[ "$explicit_install_flag" == false ]]; then - daemon_installed=false - web_installed=false - - if is_component_installed "daemon"; then - daemon_installed=true - check_component_permission "daemon" - fi - if is_component_installed "web"; then - web_installed=true - check_component_permission "web" - fi - - # When only one component installed, we wanted to process that one only. - if [[ "$daemon_installed" == true && "$web_installed" == false ]]; then - install_daemon=true - install_web=false - elif [[ "$daemon_installed" == false && "$web_installed" == true ]]; then - install_daemon=false - install_web=true - else - install_daemon=true - install_web=true - fi - fi +Red_Error() { + echo '=================================================' + printf '\033[1;31;40m%b\033[0m\n' "$@" + echo '=================================================' + exit 1 } - -# Get Distribution & Architecture Info -detect_os_info() { - distro="Unknown" - version="Unknown" - arch=$(uname -m) - - # Try primary source - if [ -f /etc/os-release ]; then - . /etc/os-release - distro_id="${ID,,}" - version_id="${VERSION_ID,,}" - - case "$distro_id" in - ubuntu) - distro="Ubuntu" - version="$version_id" - ;; - debian) - distro="Debian" - version="$version_id" - ;; - centos) - distro="CentOS" - version="$version_id" - ;; - rhel*) - distro="RHEL" - version="$version_id" - ;; - arch) - distro="Arch" - version="rolling" - ;; - *) - distro="${ID:-Unknown}" - version="$version_id" - ;; - esac - fi - - # Fallbacks for missing or invalid version - if [[ -z "$version" || "$version" == "unknown" || "$version" == "" ]]; then - if [ -f /etc/issue ]; then - version_guess=$(grep -oP '[0-9]+(\.[0-9]+)*' /etc/issue | head -1) - if [[ -n "$version_guess" ]]; then - version="$version_guess" - fi - fi - fi - - # Normalize version: keep only major version - version_full="$version" - if [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then - version="${version%%.*}" - else - echo "Warning: Could not detect a clean numeric version. Defaulting to unknown." - version="unknown" +Install_Node() { + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Node.js version is up-to-date, skipping installation." + return fi - cprint cyan "Detected OS: $distro $version_full" - cprint cyan "Detected Architecture: $arch" -} - - -# Check if current OS is supported -check_supported_os() { - local supported_versions="${supported_os[$distro]}" + echo_cyan "[+] Install Node.JS environment..." - if [[ -z "$supported_versions" ]]; then - echo "Error: Distribution '$distro' is not supported by this installer." - return 1 - fi + rm -irf "$node_install_path" - if [[ "$supported_versions" != *"$version"* ]]; then - echo "Error: Version '$version' of '$distro' is not supported." - echo "Supported versions are: $supported_versions" - return 1 - fi + cd /opt || Red_Error "[x] Failed to enter /opt" - cprint green "OS compatibility check passed." - return 0 -} + rm -rf "node-$node-linux-$arch.tar.gz" -# Check if all required commands are available -check_required_commands() { - local missing=0 + wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - for cmd in "${required_commands[@]}"; do - if ! command -v "$cmd" >/dev/null 2>&1; then - echo "Error: Required command '$cmd' is not available in PATH." - missing=1 - fi - done + tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" - if [ "$missing" -ne 0 ]; then - echo "One or more required commands are missing. Please install them and try again." - return 1 - fi + rm -rf "node-$node-linux-$arch.tar.gz" - cprint green "All required commands are available." - return 0 -} - -# Print with specified color and style, fallback to RESET if not supported. -# Supported colors*: black|red|green|yellow|blue|magenta|cyan|white -# Supported styles*: bold|underline|italic|clear_line|strikethrough -# *Note: some style may not necessarily work on all terminals. -# Example usage: -# cprint green bold "Installation completed successfully." -# cprint red underline "Failed to detect required command: wget" -# cprint yellow "Warning: Disk space is low." -# cprint underline "Failed to detect required command: wget" -# cprint bold green underline"Installation completed successfully." - -cprint() { - local color="" - local text="" - local styles="" - local disable_prefix=false - local disable_newline=false - - while [[ $# -gt 1 ]]; do - case "$1" in - black|red|green|yellow|blue|magenta|cyan|white) - color="$1" - ;; - bold|underline|italic|clear_line|strikethrough) - styles+="${STYLES[$1]}" - ;; - noprefix) - disable_prefix=true - ;; - nonl) - disable_newline=true - ;; - esac - shift - done - - text="$1" - - local prefix_text="" - if [[ "$disable_prefix" != true ]]; then - local timestamp="[$(date +%H:%M:%S)]" - local label="[MCSM Installer]" - prefix_text="${FG_COLORS[white]}$timestamp $label${RESET} " - fi - - local prefix="" - if [[ -n "$color" && "$SUPPORTS_COLOR" = true ]]; then - prefix+="${FG_COLORS[$color]}" - fi - if [[ "$SUPPORTS_STYLE" = true || "$styles" == *"${STYLES[clear_line]}"* ]]; then - prefix="$styles$prefix" - fi - - if [[ "$disable_newline" == true ]]; then - printf "%b%b%s%b" "$prefix_text" "$prefix" "$text" "$RESET" + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Success" else - printf "%b%b%s%b\n" "$prefix_text" "$prefix" "$text" "$RESET" - fi -} - - - - -# Permission check before proceed with installation -permission_barrier() { - if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then - cprint cyan "No components currently installed — skipping permission check." - return 0 - fi - - for component in web daemon; do - local is_installed_var="${component}_installed" - local installed_user_var="${component}_installed_user" - - if [[ "${!is_installed_var}" == true ]]; then - local installed_user="${!installed_user_var}" - - # Step 0: Ensure installed user is detected - if [[ -z "$installed_user" ]]; then - cprint red bold "Detected that '$component' is installed but could not determine the user from its systemd service file." - cprint red "This may indicate a custom or unsupported service file setup." - cprint red "Refusing to proceed to avoid potential conflicts." - exit 1 - fi - - # Step 1: User match check - if [[ "$installed_user" != "$install_user" ]]; then - cprint red bold "Permission mismatch for '$component':" - cprint red "Installed as user: $installed_user" - cprint red "Current install target user: $install_user" - cprint red "Unable to proceed due to ownership conflict." - exit 1 - fi - fi - done - - # Step 2: Directory ownership check - local dir_owner - dir_owner=$(stat -c '%U' "$install_dir" 2>/dev/null) - - if [[ -z "$dir_owner" ]]; then - cprint red bold "Unable to determine owner of install_dir: $install_dir" - exit 1 + Red_Error "[x] Node installation failed!" fi - if [[ "$dir_owner" != "$install_user" ]]; then - cprint red bold "Install directory ownership mismatch:" - cprint red " Directory: $install_dir" - cprint red " Owned by: $dir_owner" - cprint red " Expected: $install_user" - exit 1 - fi + echo + echo_yellow "=============== Node.JS Version ===============" + echo_yellow " node: $("$node_install_path"/bin/node -v)" + echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" + echo_yellow "=============== Node.JS Version ===============" + echo - cprint green bold "Permissions and ownership validated. Proceeding." - return 0 + sleep 3 } +Install_MCSManager() { + echo_cyan "[+] Install MCSManager..." + # stop service + systemctl disable --now mcsm-{web,daemon} -# Map OS arch with actual Node.js Arch name -# This function should be placed after var arch has been assigned a valid value. -resolve_node_arch() { - case "$arch" in - x86_64) - node_arch="x64" - ;; - aarch64) - node_arch="arm64" - ;; - armv7l) - node_arch="armv7l" - ;; - *) - cprint red bold "Unsupported architecture for Node.js: $arch" - return 1 - ;; - esac + # delete service + rm -rf /etc/systemd/system/mcsm-{daemon,web}.service + systemctl daemon-reload - # Assign node_path based on resolved arch and current version/install dir - node_path="${node_install_dir}/node-${node_version}-linux-${node_arch}" + mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" - cprint cyan "Resolved Node.js architecture: $node_arch" - cprint cyan "Computed Node.js install path: $node_path" -} + # cd /opt/mcsmanager + cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" -# Check if Node.js at PATH is valid. -# This function check Node.js version + NPM (if Node.js valid) -verify_node_at_path() { - local node_path="$1" - # Assign value to vlobal variables when verifying - node_bin_path="$node_path/bin/node" - npm_bin_path="$node_path/bin/npm" + # download MCSManager release + wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" + tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" + rm -rf "${mcsmanager_install_path}/${package_name}" - # Node binary missing - if [ ! -x "$node_bin_path" ]; then - return 1 + # compatible with tar.gz packages of different formats + if [ -d "/opt/mcsmanager/mcsmanager" ]; then + cp -rf /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ + rm -rf /opt/mcsmanager/mcsmanager fi - local installed_ver - installed_ver="$("$node_bin_path" -v 2>/dev/null | sed 's/^v//')" + # echo "[→] cd daemon" + cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" - # Node exists but version not returned - if [[ -z "$installed_ver" ]]; then - return 1 - fi + echo_cyan "[+] Install MCSManager-Daemon dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" - # Version mismatch, even if newer - if [ "$strict_node_version_check" = true ]; then - if [[ "$installed_ver" != "$required_node_ver" ]]; then - return 3 - fi - else - # Version mismatch, too old. - local cmp - cmp=$(printf "%s\n%s\n" "$required_node_ver" "$installed_ver" | sort -V | head -1) - if [[ "$cmp" != "$required_node_ver" ]]; then - return 2 - fi - fi + # echo "[←] cd .." + cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" - # node cmd valid, but npm is missing or broken. - if [ ! -x "$npm_bin_path" ] || ! "$npm_bin_path" --version >/dev/null 2>&1; then - return 4 - fi + echo_cyan "[+] Install MCSManager-Web dependencies..." + env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/web" - return 0 -} + echo + echo_yellow "=============== MCSManager ===============" + echo_green "Daemon: ${mcsmanager_install_path}/daemon" + echo_green "Web: ${mcsmanager_install_path}/web" + echo_yellow "=============== MCSManager ===============" + echo + echo_green "[+] MCSManager installation success!" -# Node.js pre-check. check if we need to install Node.js before installer run. -# Use postcheck_node_after_install() to check after install. -check_node_installed() { - verify_node_at_path "$node_path" - local result=$? + chmod -R 755 "$mcsmanager_install_path" - case $result in - 0) - cprint green bold "Node.js and npm found at $node_path (version $required_node_ver or compatible)" - install_node=false - ;; - 1) - cprint yellow bold "Node.js binary not found or unusable at $node_path" - install_node=true - ;; - 2) - cprint red bold "Node.js version at $node_path is too old. Required: >= $required_node_ver" - install_node=true - ;; - 3) - cprint red bold "Node.js version mismatch. Required: $required_node_ver, found something else." - install_node=true - ;; - 4) - cprint red bold "Node.js is present but npm is missing or broken." - install_node=true - ;; - *) - cprint red bold "Unexpected error in node verification." - install_node=true - ;; - esac + sleep 3 } -# Node.js post-check. check if Node.js is valid after install. -postcheck_node_after_install() { - verify_node_at_path "$node_path" - if [[ $? -ne 0 ]]; then - cprint red bold "Node.js installation failed or is invalid at $node_path" - return 1 - else - cprint green bold "Node.js is installed and functioning at $node_path" - return 0 - fi -} - -# Install Node.js and check -install_node() { - local archive_name="node-${node_version}-linux-${node_arch}.tar.xz" - local target_dir="${node_install_dir}/node-${node_version}-linux-${node_arch}" - local archive_path="${node_install_dir}/${archive_name}" - local download_url="${node_download_url_base}${node_version}/${archive_name}" - local fallback="$node_download_fallback" - - cprint cyan bold "Installing Node.js $node_version for arch: $node_arch" - - mkdir -p "$node_install_dir" || { - cprint red bold "Failed to create node install directory: $node_install_dir" - return 1 - } - - # Download - cprint cyan "Downloading Node.js from: $download_url" - if ! wget --progress=bar:force -O "$archive_path" "$download_url"; then - cprint yellow "Primary download failed. Attempting fallback..." - - if [[ -n "$fallback" ]]; then - if [[ "$fallback" =~ ^https?:// ]]; then - cprint cyan "Downloading from fallback URL: $fallback" - if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then - cprint red bold "Fallback download failed from: $fallback" - return 1 - fi - elif [ -f "$fallback" ]; then - cprint cyan "Copying from local fallback: $fallback" - cp "$fallback" "$archive_path" || { - cprint red bold "Failed to copy fallback Node.js archive from $fallback" - return 1 - } - else - cprint red bold "Invalid fallback path: $fallback" - return 1 - fi - else - cprint red bold "No fallback source configured. Cannot proceed." - return 1 - fi - fi - - # Extract archive - cprint cyan "Extracting Node.js archive..." - if ! tar -xf "$archive_path" -C "$node_install_dir"; then - cprint red bold "Failed to extract Node.js archive." - return 1 - fi - - chmod -R a+rx "$target_dir" || { - cprint red bold "Failed to set execute permissions on Node.js files." - return 1 - } - - verify_node_at_path "$target_dir" - local result=$? - if [[ $result -ne 0 ]]; then - cprint red bold "Node.js installation failed verification." - return 1 - fi - - cprint cyan "Cleaning up archive..." - rm -f "$archive_path" +Create_Service() { + echo_cyan "[+] Create MCSManager service..." - cprint green bold "Node.js $node_version installed successfully at $target_dir" - # Save resolved binary paths to global variables - node_bin_path="${target_dir}/bin/node" - npm_bin_path="${target_dir}/bin/npm" - - cprint green "Node.js binary: $node_bin_path" - cprint green "npm binary: $npm_bin_path" - return 0 -} - -# Function to download MCSM package. fetch from primary URL first, then fallback URL. -# This function only put extracted file(s) into install_dir, it does not perform the actual update. -download_mcsm() { - local archive_name="$package_name" - local archive_path="${tmp_dir}/${archive_name}" - local primary_url="${download_base_url}${archive_name}" - local fallback="$download_fallback_url" - - cprint cyan bold "Downloading MCSManager package..." - - # Step 1: Try downloading from primary URL - if ! wget --progress=bar:force -O "$archive_path" "$primary_url"; then - cprint yellow "Primary download failed. Attempting fallback source..." - - if [[ -z "$fallback" ]]; then - cprint red bold "No fallback URL or path specified." - return 1 - fi - - if [[ "$fallback" =~ ^https?:// ]]; then - if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then - cprint red bold "Fallback download failed from $fallback" - return 1 - fi - elif [[ -f "$fallback" ]]; then - cp "$fallback" "$archive_path" || { - cprint red bold "Failed to copy fallback archive from $fallback" - return 1 - } - else - cprint red bold "Fallback path is invalid: $fallback" - return 1 - fi - fi - - # Step 2: Generate extract directory - local suffix - suffix=$(tr -dc 'a-z0-9' /dev/null; then - cprint green "User '$install_user' already exists." - else - cprint cyan "Creating system user: $install_user (nologin, no password)..." - if ! useradd --system --home "$install_dir" --shell /usr/sbin/nologin "$install_user"; then - cprint red bold "Failed to create user: $install_user" - exit 1 - fi - cprint green "User '$install_user' created." - fi - - # Docker integration - if command -v docker &>/dev/null; then - cprint cyan "Docker is installed — checking group assignment..." - - if getent group docker &>/dev/null; then - if id -nG "$install_user" | grep -qw docker; then - cprint green "User '$install_user' is already in the 'docker' group." - else - cprint cyan "Adding user '$install_user' to 'docker' group..." - if usermod -aG docker "$install_user"; then - cprint green "Docker group access granted to '$install_user'." - else - cprint red "Failed to add '$install_user' to 'docker' group. Docker may not be usable by this user." - fi - fi - else - cprint red "Docker installed but 'docker' group not found. Skipping group assignment." - fi - else - cprint yellow "Docker not installed — skipping Docker group configuration." - fi - - return 0 -} - -# Prepare file & permissions before install. -mcsm_install_prepare() { - # Prepare the user first - prepare_user - - if [[ ! -d "$install_tmp_dir" ]]; then - cprint red bold "install_tmp_dir does not exist: $install_tmp_dir" - exit 1 - fi - - cprint cyan "Changing ownership of $install_tmp_dir to user '$install_user'..." - chown -R "$install_user":"$install_user" "$install_tmp_dir" || { - cprint red bold "Failed to change ownership of $install_tmp_dir" - cleanup_install_tmp - exit 1 - } - - # Normalize install_dir to ensure it ends with a slash - [[ "${install_dir}" != */ ]] && install_dir="${install_dir}/" - - if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then - cprint cyan "No existing components detected — skipping data backup/cleanup." - return 0 - fi - - for component in web daemon; do - local is_installed_var="${component}_installed" - if [[ "${!is_installed_var}" == true ]]; then - local component_path="${install_dir}${component}" - local data_dir="${component_path}/data" - local backup_path="${install_dir}${backup_prefix}${component}" - - if [[ ! -d "$component_path" ]]; then - cprint yellow "Expected installed component directory not found: $component_path" - continue - fi - - if [[ -d "$data_dir" ]]; then - if [[ -e "$backup_path" ]]; then - cprint red bold "Backup destination already exists: $backup_path" - cprint red "Please resolve this conflict manually before continuing." - cleanup_install_tmp - exit 1 - fi - - cprint cyan "Backing up data directory for $component..." - mv "$data_dir" "$backup_path" || { - cprint red bold "Failed to move $data_dir to $backup_path" - cleanup_install_tmp - exit 1 - } - cprint green "Moved $data_dir → $backup_path" - else - cprint yellow "No data directory found for $component — skipping backup." - fi - - cprint cyan "Removing old component directory: $component_path" - rm -rf "$component_path" || { - cprint red bold "Failed to remove old component directory: $component_path" - cleanup_install_tmp - exit 1 - } - fi - done - - cprint green bold "Existing components prepared successfully." - return 0 -} - -# Install or update a component -install_component() { - local component="$1" - local target_path="${install_dir}${component}" - local backup_data_path="${install_dir}${backup_prefix}${component}" - local source_path="${install_tmp_dir}/mcsmanager/${component}" - - cprint cyan bold "Installing/Updating component: $component" - - # Step 1: Move new component to install_dir - if [[ ! -d "$source_path" ]]; then - cprint red bold "Source directory not found: $source_path" - cleanup_install_tmp - exit 1 - fi - - if [[ -e "$target_path" ]]; then - cprint red bold "Target path already exists: $target_path" - cprint red " This should not happen — possible permission error or unclean install." - cleanup_install_tmp - exit 1 - fi - - mv "$source_path" "$target_path" || { - cprint red bold "Failed to move $source_path → $target_path" - cleanup_install_tmp - exit 1 - } - - cprint green "Moved $component to $target_path" - - # Step 2: Restore backed-up data directory if present - if [[ -d "$backup_data_path" ]]; then - local target_data_path="${target_path}/data" - - cprint cyan "Restoring backed-up data directory for $component..." - - rm -rf "$target_data_path" # Ensure no conflict - mv "$backup_data_path" "$target_data_path" || { - cprint red bold "Failed to restore data directory to $target_data_path" - cleanup_install_tmp - exit 1 - } - - cprint green "Data directory restored: $target_data_path" - else - cprint yellow "No backed-up data directory found for $component — fresh install assumed." - fi - - # Step 3: Install NPM dependencies - if [[ ! -x "$npm_bin_path" ]]; then - cprint red bold "npm binary not found or not executable: $npm_bin_path" - cleanup_install_tmp - exit 1 - fi - - cprint cyan "Installing dependencies for $component using npm..." - pushd "$target_path" >/dev/null || { - cprint red bold "Failed to change directory to $target_path" - cleanup_install_tmp - exit 1 - } - - if ! "$npm_bin_path" install --no-audit --no-fund --loglevel=warn; then - cprint red bold "NPM dependency installation failed for $component" - popd >/dev/null - cleanup_install_tmp - exit 1 - fi - - popd >/dev/null - cprint green bold "Component '$component' installed/updated successfully." -} - -# Create systemd service for a given component. -# This will overwrite the existing service file. -create_systemd_service() { - local component="$1" - local service_path="${systemd_file}${component}.service" - local working_dir="${install_dir}${component}" - local exec="${node_bin_path} app.js" - - if [[ ! -d "$working_dir" ]]; then - cprint red bold "Component directory not found: $working_dir" - cleanup_install_tmp - return 1 - fi - - cprint cyan "Creating systemd service for '$component'..." - - cat > "$service_path" </dev/null | awk '{print $1}') - [[ -z "$ip_address" ]] && ip_address="YOUR-IP" - - # Daemon info - if [[ "$install_daemon" == true ]]; then - local daemon_address="ws://$ip_address:${daemon_port:-Failed to Retrieve from Config file}" - local daemon_key_display="${daemon_key:-Failed to Retrieve from Config file}" - - cprint yellow noprefix "Daemon Address:" - cprint white noprefix " $daemon_address" - cprint yellow noprefix "Daemon Key:" - cprint white noprefix " $daemon_key_display" - echo "" - fi +" >/etc/systemd/system/mcsm-daemon.service - # Web info - if [[ "$install_web" == true ]]; then - local web_address="http://$ip_address:${web_port:-Failed to Retrieve from Config file}" - cprint yellow noprefix "HTTP Web Interface:" - cprint white noprefix nonl " $web_address " - cprint yellow noprefix "(open in browser)" - echo "" - fi - - # Port guidance - cprint yellow noprefix "NOTE:" - cprint white noprefix " Make sure to expose the above ports through your firewall." - cprint white noprefix " If accessing from outside your network, you may need to configure port forwarding on your router." - echo "" - - # Service management help - cprint yellow noprefix "Service Management Commands:" - if [[ "$install_daemon" == true ]]; then - cprint white noprefix nonl " systemctl start " - cprint yellow noprefix "mcsm-daemon.service" - cprint white noprefix nonl " systemctl stop " - cprint yellow noprefix "mcsm-daemon.service" - cprint white noprefix nonl " systemctl restart " - cprint yellow noprefix "mcsm-daemon.service" - cprint white noprefix nonl " systemctl status " - cprint yellow noprefix "mcsm-daemon.service" - fi - if [[ "$install_web" == true ]]; then - cprint white noprefix nonl " systemctl start " - cprint yellow noprefix "mcsm-web.service" - cprint white noprefix nonl " systemctl stop " - cprint yellow noprefix "mcsm-web.service" - cprint white noprefix nonl " systemctl restart " - cprint yellow noprefix "mcsm-web.service" - cprint white noprefix nonl " systemctl status " - cprint yellow noprefix "mcsm-web.service" - fi - echo "" - - # Official doc - cprint yellow noprefix "Official Documentation:" - cprint white noprefix " https://docs.mcsmanager.com/" - echo "" + echo "[Unit] +Description=MCSManager-Web - # HTTPS support - cprint yellow noprefix "Need HTTPS?" - cprint white noprefix " To enable secure HTTPS access, configure a reverse proxy:" - cprint white noprefix " https://docs.mcsmanager.com/ops/proxy_https.html" - echo "" - - # Closing message - cprint green noprefix "Installation completed. Enjoy managing your servers with MCSManager!" - echo "" -} - -install_mcsm() { - local components=() - - if [[ "$install_web" == true ]]; then - install_component "web" - create_systemd_service "web" - components+=("web") - fi - - if [[ "$install_daemon" == true ]]; then - install_component "daemon" - create_systemd_service "daemon" - components+=("daemon") - fi - - # Reload systemd after any service file changes - if (( ${#components[@]} > 0 )); then - cprint cyan "Reloading systemd daemon..." - # systemctl daemon-reexec - systemctl daemon-reload - - for comp in "${components[@]}"; do - local svc="mcsm-${comp}.service" - - cprint cyan "Enabling service: $svc" - if systemctl enable "$svc" &>/dev/null; then - cprint green "Enabled service: $svc" - else - cprint red bold "Failed to enable service: $svc" - cleanup_install_tmp - exit 1 - fi - done - fi - - # Clean tmp dir - cleanup_install_tmp - # Extract installed component info - safe_run extract_component_info "Failed to extract runtime info from installed services" - safe_run print_install_result "Failed to print installation result" - -} +[Service] +WorkingDirectory=${mcsmanager_install_path}/web +ExecStart=${node_install_path}/bin/node app.js +ExecReload=/bin/kill -s QUIT \$MAINPID +ExecStop=/bin/kill -s QUIT \$MAINPID +Environment=\"PATH=${PATH}\" -main() { - trap 'echo "Unexpected error occurred."; exit 99' ERR - safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" - safe_run check_root "Script must be run as root" - safe_run parse_args "Failed to parse arguments" "$@" - safe_run detect_os_info "Failed to detect OS" - safe_run check_supported_os "Unsupported OS or version" - # To be moved to a master pre check function. - safe_run resolve_node_arch "Failed to resolve Node.js architecture" - - safe_run check_required_commands "Missing required system commands" - - safe_run check_node_installed "Failed to detect Node.js or npm at expected path. Node.js will be installed." - if [ "$install_node" = true ]; then - safe_run install_node "Node.js installation failed" - fi - - safe_run permission_barrier "Permission validation failed — aborting install" - - safe_run download_mcsm "Failed to acquire MCSManager source" - safe_run mcsm_install_prepare "Error while preparing for installation" - - safe_run install_mcsm "Failed to install MCSManager" -} -main "$@" +[Install] +WantedBy=multi-user.target +" >/etc/systemd/system/mcsm-web.service + + systemctl daemon-reload + systemctl enable --now mcsm-{daemon,web}.service + echo_green "Registered!" + + sleep 2 + + printf "\n\n\n\n" + + echo_yellow "==================================================================" + echo_green "Installation is complete! Welcome to the MCSManager!!!" + echo_yellow " " + echo_cyan_n "HTTP Web Service: " + echo_yellow "http://:23333 (Browser)" + echo_cyan_n "Daemon Address: " + echo_yellow "ws://:24444 (Cluster)" + echo_red "You must expose ports " + echo_yellow "23333" + echo_red " and " + echo_yellow "24444" + echo_red " to use the service properly on the Internet." + echo_yellow " " + echo_cyan "Usage:" + echo_cyan "systemctl start mcsm-{daemon,web}.service" + echo_cyan "systemctl stop mcsm-{daemon,web}.service" + echo_cyan "systemctl restart mcsm-{daemon,web}.service" + echo_yellow " " + echo_green "Official Document: https://docs.mcsmanager.com/" + echo_yellow "==================================================================" +} + +# Environmental inspection +if [[ "$arch" == x86_64 ]]; then + arch=x64 + #echo "[-] x64 architecture detected" +elif [[ $arch == aarch64 ]]; then + arch=arm64 + #echo "[-] 64-bit ARM architecture detected" +elif [[ $arch == arm ]]; then + arch=armv7l + #echo "[-] 32-bit ARM architecture detected" +elif [[ $arch == ppc64le ]]; then + arch=ppc64le + #echo "[-] IBM POWER architecture detected" +elif [[ $arch == s390x ]]; then + arch=s390x + #echo "[-] IBM LinuxONE architecture detected" +else + Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" +fi + +# Define the variable Node installation directory +node_install_path="/opt/node-$node-linux-$arch" + +# Check network connection +echo_cyan "[-] Architecture: $arch" + +# Install related software +echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " +if [[ -x "$(command -v yum)" ]]; then + yum install -y git tar wget +elif [[ -x "$(command -v apt-get)" ]]; then + apt-get install -y git tar wget +elif [[ -x "$(command -v pacman)" ]]; then + pacman -S --noconfirm --needed git tar wget +elif [[ -x "$(command -v zypper)" ]]; then + zypper --non-interactive install git tar wget +else + echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" +fi + +# Determine whether the relevant software is installed successfully +if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then + echo_green "Success" +else + Red_Error "[x] Failed to find git, tar and wget, please install them manually!" +fi + +# Install the Node environment +Install_Node + +# Install MCSManager +Install_MCSManager + +# Create MCSManager background service +Create_Service \ No newline at end of file diff --git a/setup2.sh b/setup2.sh new file mode 100644 index 0000000..f1264ab --- /dev/null +++ b/setup2.sh @@ -0,0 +1,1383 @@ +#!/bin/bash +# Official MCSManager installation script. +# This script installs or updates the MCSManager Web and/or Daemon to the latest version. +# ------------------------------------------------------------------------------ +# Supported Linux distributions: +# This script supports the following mainstream Linux distributions: +# - Ubuntu: 18.04, 20.04, 22.04, 24.04 +# - Debian: 10, 11, 12, 13 +# - CentOS: 7, 8 Stream, 9 Stream, 10 Stream +# - RHEL: 7, 8, 9, 10 +# - Arch Linux: Support planned (TBD) +# ------------------------------------------------------------------------------ + +# Target installation directory (can be overridden with --install-dir) +install_dir="/opt/mcsmanager" + +# Primary download URL bas. Full package URL = download_base_url + package_name +download_base_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" + +# Fallback download URL (can also be a local directory or mirror) +download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" + +# Name of the release package to download/detect +package_name="mcsmanager_linux_release.tar.gz" + +# Node.js version to be installed +# Keep the leading "v" +node_version="v20.12.2" + +# Node download base URL - primary +node_download_url_base="https://nodejs.org/dist/" + +# Node download URL - fallback. +# This is the URL points directly to the file, not the base. This can also be a local absolute path. +# Only supports https:// or http:// for web locations. +node_download_fallback="" + +# Node.js installation path (defaults to the MCSManager installation path. Can be overridden with --node-install-dir) +node_install_dir="$install_dir" + +# Temp dir for file extraction +tmp_dir="/tmp" + +# --------------- Global Variables ---------------# +# DO NOT MODIFY # + + +# Component installation options. +# For fresh installs, both daemon and web components are installed by default. +# For updates, behavior depends on detected existing components. +# Can be overridden with --install daemon/web/all +install_daemon=true +install_web=true + +# Install MCSM as (default: root). +# To install as a general user (e.g., "mcsm"), use the --user option: --user mcsm +# To ensure compatibility, only user mcsm is supported. +install_user="root" +# Installed user, for permission check +web_installed=false +daemon_installed=false +web_installed_user="" +daemon_installed_user="" + +# Service file locations +# the final dir = systemd_file + {web/daemon} + ".service" +systemd_file="/etc/systemd/system/mcsm-" +# Optional: Override the default installation source file. +# If --install-source is specified, the installer will use the provided +# "mcsmanager_linux_release.tar.gz" file instead of downloading it. +# Only support local absolute path. +install_source_path="" + +# temp path for extracted file(s) +install_tmp_dir="/opt/mcsmanager/mcsm_abcd" + +# dir name for data dir backup +# e.g. /opt/mcsmanager/daemon/data -> /opt/mcsmanager/data_bak_data +# only valid for when during an update +backup_prefix="data_bak_" + +# System architecture (detected automatically) +arch="" +version="" +distro="" + +# Supported OS versions (map-style structure) +# Format: supported_os["distro_name"]="version1 version2 version3 ..." +declare -A supported_os +supported_os["Ubuntu"]="18 20 22 24" +supported_os["Debian"]="10 11 12 13" +supported_os["CentOS"]="7 8 8-stream 9-stream 10-stream" +supported_os["RHEL"]="7 8 9 10" +supported_os["Arch"]="rolling" + +# Required system commands for installation +# These will be checked before logic process +required_commands=( + chmod + chown + wget + tar + stat + useradd + usermod + date +) + +# Node.js related sections +# Enable strict version checking (exact match) +# enabled -> strict requriement for defined node version +# false -> newer version allowed +# Older version is NEVER allowed +strict_node_version_check=false + +# Will be set based on actual node status +install_node=true +# Remove leading "v" from defined version +required_node_ver="${node_version#v}" + +# Holds absolute path for node & npm +node_bin_path="" +npm_bin_path="" +# Hold Node.js arch name, e.g. x86_64 -> x64 +node_arch="" +# Hold Node.js intallation path, e.g. ${node_install_dir}/node-${node_version}-linux-${arch} +node_path="" + +# For installation result +daemon_key="" +daemon_port="" +web_port="" +daemon_key_config_subpath="data/Config/global.json" +web_port_config_subpath="data/SystemConfig/config.json" + +# Terminal color & style related +# Default to false, auto check later +SUPPORTS_COLOR=false +SUPPORTS_STYLE=false +# Declare ANSI reset +RESET="\033[0m" + +# Foreground colors +declare -A FG_COLORS=( + [black]="\033[0;30m" + [red]="\033[0;31m" + [green]="\033[0;32m" + [yellow]="\033[0;33m" + [blue]="\033[0;34m" + [magenta]="\033[0;35m" + [cyan]="\033[0;36m" + [white]="\033[0;37m" +) + +# Font styles +declare -A STYLES=( + [bold]="\033[1m" + [underline]="\033[4m" + [italic]="\033[3m" # Often ignored + [clear_line]="\r\033[2K" + [strikethrough]="\033[9m" +) + + +### Helper Functions +# Execution wrapper, avoid unexpected crashes. +safe_run() { + local func="$1" + local err_msg="$2" + shift 2 + + if ! "$func" "$@"; then + echo "Error: $err_msg" + exit 1 + fi +} + +# Function to ensure the script is run as root +check_root() { + # Using Bash's built-in EUID variable + if [ -n "$EUID" ]; then + if [ "$EUID" -ne 0 ]; then + cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." + exit 1 + fi + else + # Fallback to using id -u if EUID is unavailable (e.g., non-Bash shell or misconfigured environment) + if [ "$(id -u)" -ne 0 ]; then + cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." + exit 1 + fi + fi +} + +# Function to check whether current terminal support color & style +detect_terminal_capabilities() { + SUPPORTS_COLOR=false + SUPPORTS_STYLE=false + + if [ -t 1 ] && command -v tput >/dev/null 2>&1; then + if [ "$(tput colors)" -ge 8 ]; then + SUPPORTS_COLOR=true + fi + if tput bold >/dev/null 2>&1 && tput smul >/dev/null 2>&1; then + SUPPORTS_STYLE=true + fi + fi + + if [ "$SUPPORTS_COLOR" = true ]; then + cprint green "[OK] Terminal supports colored output." + else + cprint yellow "Note: Terminal does not support colored output. Continuing without formatting." + fi + + if [ "$SUPPORTS_STYLE" = true ]; then + cprint green "[OK] Terminal supports bold and underline formatting." + else + cprint yellow "Note: Terminal does not support advanced text styles." + fi +} + +# Check whether daemon or web is installed +is_component_installed() { + local component_name="$1" + local component_path="${install_dir}/${component_name}" + + if [[ -d "$component_path" ]]; then + cprint green "Component '$component_name' is already installed at $component_path" + + # Set corresponding global variable + if [[ "$component_name" == "daemon" ]]; then + daemon_installed=true + elif [[ "$component_name" == "web" ]]; then + web_installed=true + fi + + return 0 + else + cprint yellow "Component '$component_name' is not installed" + + # Set corresponding global variable + if [[ "$component_name" == "daemon" ]]; then + daemon_installed=false + elif [[ "$component_name" == "web" ]]; then + web_installed=false + fi + + return 1 + fi +} + +check_component_permission() { + local component="$1" + local service_file="${systemd_file}${component}.service" + + if [[ ! -f "$service_file" ]]; then + cprint yellow "Service file not found: $service_file" + return 0 # nothing changed + fi + + # Extract the User= line if it exists + local user_line + user_line=$(grep -E '^User=' "$service_file" 2>/dev/null | head -1) + + local user + if [[ -z "$user_line" ]]; then + user="root" # default if no User= is defined + else + user="${user_line#User=}" + fi + + # Validate user + if [[ "$user" != "root" && "$user" != "mcsm" ]]; then + cprint red bold "Unsupported user '$user' in $service_file. Expected 'root' or 'mcsm'." + exit 1 + fi + + # Assign to appropriate global + if [[ "$component" == "web" ]]; then + web_installed_user="$user" + elif [[ "$component" == "daemon" ]]; then + daemon_installed_user="$user" + fi + + cprint cyan "Detected $component installed as user: $user" + return 0 +} + + + +parse_args() { + local explicit_install_flag=false + + while [[ $# -gt 0 ]]; do + case "$1" in + --install-dir) + if [[ -n "$2" ]]; then + install_dir="$2" + shift 2 + else + echo "Error: --install-dir requires a path argument." + exit 1 + fi + ;; + --node-install-dir) + if [[ -n "$2" ]]; then + node_install_dir="$2" + shift 2 + else + echo "Error: --node-install-dir requires a path argument." + exit 1 + fi + ;; + --install) + explicit_install_flag=true + if [[ -n "$2" && "$2" != --* ]]; then + case "$2" in + daemon) + install_daemon=true + is_component_installed "daemon" + install_web=false + check_component_permission "daemon" + ;; + web) + install_daemon=false + is_component_installed "web" + install_web=true + check_component_permission "web" + ;; + all) + install_daemon=true + install_web=true + is_component_installed "daemon" + is_component_installed "web" + check_component_permission "daemon" + check_component_permission "web" + ;; + *) + echo "Error: Invalid value for --install. Expected 'daemon', 'web', or 'all'." + echo "Usage: --install daemon|web|all" + exit 1 + ;; + esac + shift 2 + else + echo "Error: --install flag provided but no value. Please specify: daemon, web, or all." + echo "Usage: --install daemon|web|all" + exit 1 + fi + ;; + --user) + if [[ -n "$2" ]]; then + case "$2" in + root) + install_user="root" + ;; + mcsm) + install_user="mcsm" + ;; + *) + echo "Error: Invalid user '$2'. Only 'root' and 'mcsm' are supported." + echo "Usage: --user root|mcsm" + exit 1 + ;; + esac + shift 2 + else + echo "Error: --user requires a value (root or mcsm)." + exit 1 + fi + ;; + --install-source) + if [[ -n "$2" ]]; then + install_source_path="$2" + shift 2 + else + echo "Error: --install-source requires a file path." + exit 1 + fi + ;; + *) + echo "Error: Unknown argument: $1" + exit 1 + ;; + esac + done + + # Auto-detect branch: only run if --install was not explicitly passed + if [[ "$explicit_install_flag" == false ]]; then + daemon_installed=false + web_installed=false + + if is_component_installed "daemon"; then + daemon_installed=true + check_component_permission "daemon" + fi + if is_component_installed "web"; then + web_installed=true + check_component_permission "web" + fi + + # When only one component installed, we wanted to process that one only. + if [[ "$daemon_installed" == true && "$web_installed" == false ]]; then + install_daemon=true + install_web=false + elif [[ "$daemon_installed" == false && "$web_installed" == true ]]; then + install_daemon=false + install_web=true + else + install_daemon=true + install_web=true + fi + fi +} + + +# Get Distribution & Architecture Info +detect_os_info() { + distro="Unknown" + version="Unknown" + arch=$(uname -m) + + # Try primary source + if [ -f /etc/os-release ]; then + . /etc/os-release + distro_id="${ID,,}" + version_id="${VERSION_ID,,}" + + case "$distro_id" in + ubuntu) + distro="Ubuntu" + version="$version_id" + ;; + debian) + distro="Debian" + version="$version_id" + ;; + centos) + distro="CentOS" + version="$version_id" + ;; + rhel*) + distro="RHEL" + version="$version_id" + ;; + arch) + distro="Arch" + version="rolling" + ;; + *) + distro="${ID:-Unknown}" + version="$version_id" + ;; + esac + fi + + # Fallbacks for missing or invalid version + if [[ -z "$version" || "$version" == "unknown" || "$version" == "" ]]; then + if [ -f /etc/issue ]; then + version_guess=$(grep -oP '[0-9]+(\.[0-9]+)*' /etc/issue | head -1) + if [[ -n "$version_guess" ]]; then + version="$version_guess" + fi + fi + fi + + # Normalize version: keep only major version + version_full="$version" + if [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then + version="${version%%.*}" + else + echo "Warning: Could not detect a clean numeric version. Defaulting to unknown." + version="unknown" + fi + + cprint cyan "Detected OS: $distro $version_full" + cprint cyan "Detected Architecture: $arch" +} + + +# Check if current OS is supported +check_supported_os() { + local supported_versions="${supported_os[$distro]}" + + if [[ -z "$supported_versions" ]]; then + echo "Error: Distribution '$distro' is not supported by this installer." + return 1 + fi + + if [[ "$supported_versions" != *"$version"* ]]; then + echo "Error: Version '$version' of '$distro' is not supported." + echo "Supported versions are: $supported_versions" + return 1 + fi + + cprint green "OS compatibility check passed." + return 0 +} + +# Check if all required commands are available +check_required_commands() { + local missing=0 + + for cmd in "${required_commands[@]}"; do + if ! command -v "$cmd" >/dev/null 2>&1; then + echo "Error: Required command '$cmd' is not available in PATH." + missing=1 + fi + done + + if [ "$missing" -ne 0 ]; then + echo "One or more required commands are missing. Please install them and try again." + return 1 + fi + + cprint green "All required commands are available." + return 0 +} + +# Print with specified color and style, fallback to RESET if not supported. +# Supported colors*: black|red|green|yellow|blue|magenta|cyan|white +# Supported styles*: bold|underline|italic|clear_line|strikethrough +# *Note: some style may not necessarily work on all terminals. +# Example usage: +# cprint green bold "Installation completed successfully." +# cprint red underline "Failed to detect required command: wget" +# cprint yellow "Warning: Disk space is low." +# cprint underline "Failed to detect required command: wget" +# cprint bold green underline"Installation completed successfully." + +cprint() { + local color="" + local text="" + local styles="" + local disable_prefix=false + local disable_newline=false + + while [[ $# -gt 1 ]]; do + case "$1" in + black|red|green|yellow|blue|magenta|cyan|white) + color="$1" + ;; + bold|underline|italic|clear_line|strikethrough) + styles+="${STYLES[$1]}" + ;; + noprefix) + disable_prefix=true + ;; + nonl) + disable_newline=true + ;; + esac + shift + done + + text="$1" + + local prefix_text="" + if [[ "$disable_prefix" != true ]]; then + local timestamp="[$(date +%H:%M:%S)]" + local label="[MCSM Installer]" + prefix_text="${FG_COLORS[white]}$timestamp $label${RESET} " + fi + + local prefix="" + if [[ -n "$color" && "$SUPPORTS_COLOR" = true ]]; then + prefix+="${FG_COLORS[$color]}" + fi + if [[ "$SUPPORTS_STYLE" = true || "$styles" == *"${STYLES[clear_line]}"* ]]; then + prefix="$styles$prefix" + fi + + if [[ "$disable_newline" == true ]]; then + printf "%b%b%s%b" "$prefix_text" "$prefix" "$text" "$RESET" + else + printf "%b%b%s%b\n" "$prefix_text" "$prefix" "$text" "$RESET" + fi +} + + + + +# Permission check before proceed with installation +permission_barrier() { + if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then + cprint cyan "No components currently installed — skipping permission check." + return 0 + fi + + for component in web daemon; do + local is_installed_var="${component}_installed" + local installed_user_var="${component}_installed_user" + + if [[ "${!is_installed_var}" == true ]]; then + local installed_user="${!installed_user_var}" + + # Step 0: Ensure installed user is detected + if [[ -z "$installed_user" ]]; then + cprint red bold "Detected that '$component' is installed but could not determine the user from its systemd service file." + cprint red "This may indicate a custom or unsupported service file setup." + cprint red "Refusing to proceed to avoid potential conflicts." + exit 1 + fi + + # Step 1: User match check + if [[ "$installed_user" != "$install_user" ]]; then + cprint red bold "Permission mismatch for '$component':" + cprint red "Installed as user: $installed_user" + cprint red "Current install target user: $install_user" + cprint red "Unable to proceed due to ownership conflict." + exit 1 + fi + fi + done + + # Step 2: Directory ownership check + local dir_owner + dir_owner=$(stat -c '%U' "$install_dir" 2>/dev/null) + + if [[ -z "$dir_owner" ]]; then + cprint red bold "Unable to determine owner of install_dir: $install_dir" + exit 1 + fi + + if [[ "$dir_owner" != "$install_user" ]]; then + cprint red bold "Install directory ownership mismatch:" + cprint red " Directory: $install_dir" + cprint red " Owned by: $dir_owner" + cprint red " Expected: $install_user" + exit 1 + fi + + cprint green bold "Permissions and ownership validated. Proceeding." + return 0 +} + + + +# Map OS arch with actual Node.js Arch name +# This function should be placed after var arch has been assigned a valid value. +resolve_node_arch() { + case "$arch" in + x86_64) + node_arch="x64" + ;; + aarch64) + node_arch="arm64" + ;; + armv7l) + node_arch="armv7l" + ;; + *) + cprint red bold "Unsupported architecture for Node.js: $arch" + return 1 + ;; + esac + + # Assign node_path based on resolved arch and current version/install dir + node_path="${node_install_dir}/node-${node_version}-linux-${node_arch}" + + cprint cyan "Resolved Node.js architecture: $node_arch" + cprint cyan "Computed Node.js install path: $node_path" +} + +# Check if Node.js at PATH is valid. +# This function check Node.js version + NPM (if Node.js valid) +verify_node_at_path() { + local node_path="$1" + # Assign value to vlobal variables when verifying + node_bin_path="$node_path/bin/node" + npm_bin_path="$node_path/bin/npm" + + # Node binary missing + if [ ! -x "$node_bin_path" ]; then + return 1 + fi + + local installed_ver + installed_ver="$("$node_bin_path" -v 2>/dev/null | sed 's/^v//')" + + # Node exists but version not returned + if [[ -z "$installed_ver" ]]; then + return 1 + fi + + # Version mismatch, even if newer + if [ "$strict_node_version_check" = true ]; then + if [[ "$installed_ver" != "$required_node_ver" ]]; then + return 3 + fi + else + # Version mismatch, too old. + local cmp + cmp=$(printf "%s\n%s\n" "$required_node_ver" "$installed_ver" | sort -V | head -1) + if [[ "$cmp" != "$required_node_ver" ]]; then + return 2 + fi + fi + + # node cmd valid, but npm is missing or broken. + if [ ! -x "$npm_bin_path" ] || ! "$npm_bin_path" --version >/dev/null 2>&1; then + return 4 + fi + + return 0 +} + +# Node.js pre-check. check if we need to install Node.js before installer run. +# Use postcheck_node_after_install() to check after install. +check_node_installed() { + verify_node_at_path "$node_path" + local result=$? + + case $result in + 0) + cprint green bold "Node.js and npm found at $node_path (version $required_node_ver or compatible)" + install_node=false + ;; + 1) + cprint yellow bold "Node.js binary not found or unusable at $node_path" + install_node=true + ;; + 2) + cprint red bold "Node.js version at $node_path is too old. Required: >= $required_node_ver" + install_node=true + ;; + 3) + cprint red bold "Node.js version mismatch. Required: $required_node_ver, found something else." + install_node=true + ;; + 4) + cprint red bold "Node.js is present but npm is missing or broken." + install_node=true + ;; + *) + cprint red bold "Unexpected error in node verification." + install_node=true + ;; + esac +} + +# Node.js post-check. check if Node.js is valid after install. +postcheck_node_after_install() { + verify_node_at_path "$node_path" + if [[ $? -ne 0 ]]; then + cprint red bold "Node.js installation failed or is invalid at $node_path" + return 1 + else + cprint green bold "Node.js is installed and functioning at $node_path" + return 0 + fi +} + +# Install Node.js and check +install_node() { + local archive_name="node-${node_version}-linux-${node_arch}.tar.xz" + local target_dir="${node_install_dir}/node-${node_version}-linux-${node_arch}" + local archive_path="${node_install_dir}/${archive_name}" + local download_url="${node_download_url_base}${node_version}/${archive_name}" + local fallback="$node_download_fallback" + + cprint cyan bold "Installing Node.js $node_version for arch: $node_arch" + + mkdir -p "$node_install_dir" || { + cprint red bold "Failed to create node install directory: $node_install_dir" + return 1 + } + + # Download + cprint cyan "Downloading Node.js from: $download_url" + if ! wget --progress=bar:force -O "$archive_path" "$download_url"; then + cprint yellow "Primary download failed. Attempting fallback..." + + if [[ -n "$fallback" ]]; then + if [[ "$fallback" =~ ^https?:// ]]; then + cprint cyan "Downloading from fallback URL: $fallback" + if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then + cprint red bold "Fallback download failed from: $fallback" + return 1 + fi + elif [ -f "$fallback" ]; then + cprint cyan "Copying from local fallback: $fallback" + cp "$fallback" "$archive_path" || { + cprint red bold "Failed to copy fallback Node.js archive from $fallback" + return 1 + } + else + cprint red bold "Invalid fallback path: $fallback" + return 1 + fi + else + cprint red bold "No fallback source configured. Cannot proceed." + return 1 + fi + fi + + # Extract archive + cprint cyan "Extracting Node.js archive..." + if ! tar -xf "$archive_path" -C "$node_install_dir"; then + cprint red bold "Failed to extract Node.js archive." + return 1 + fi + + chmod -R a+rx "$target_dir" || { + cprint red bold "Failed to set execute permissions on Node.js files." + return 1 + } + + verify_node_at_path "$target_dir" + local result=$? + if [[ $result -ne 0 ]]; then + cprint red bold "Node.js installation failed verification." + return 1 + fi + + cprint cyan "Cleaning up archive..." + rm -f "$archive_path" + + cprint green bold "Node.js $node_version installed successfully at $target_dir" + # Save resolved binary paths to global variables + node_bin_path="${target_dir}/bin/node" + npm_bin_path="${target_dir}/bin/npm" + + cprint green "Node.js binary: $node_bin_path" + cprint green "npm binary: $npm_bin_path" + return 0 +} + +# Function to download MCSM package. fetch from primary URL first, then fallback URL. +# This function only put extracted file(s) into install_dir, it does not perform the actual update. +download_mcsm() { + local archive_name="$package_name" + local archive_path="${tmp_dir}/${archive_name}" + local primary_url="${download_base_url}${archive_name}" + local fallback="$download_fallback_url" + + cprint cyan bold "Downloading MCSManager package..." + + # Step 1: Try downloading from primary URL + if ! wget --progress=bar:force -O "$archive_path" "$primary_url"; then + cprint yellow "Primary download failed. Attempting fallback source..." + + if [[ -z "$fallback" ]]; then + cprint red bold "No fallback URL or path specified." + return 1 + fi + + if [[ "$fallback" =~ ^https?:// ]]; then + if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then + cprint red bold "Fallback download failed from $fallback" + return 1 + fi + elif [[ -f "$fallback" ]]; then + cp "$fallback" "$archive_path" || { + cprint red bold "Failed to copy fallback archive from $fallback" + return 1 + } + else + cprint red bold "Fallback path is invalid: $fallback" + return 1 + fi + fi + + # Step 2: Generate extract directory + local suffix + suffix=$(tr -dc 'a-z0-9' /dev/null; then + cprint green "User '$install_user' already exists." + else + cprint cyan "Creating system user: $install_user (nologin, no password)..." + if ! useradd --system --home "$install_dir" --shell /usr/sbin/nologin "$install_user"; then + cprint red bold "Failed to create user: $install_user" + exit 1 + fi + cprint green "User '$install_user' created." + fi + + # Docker integration + if command -v docker &>/dev/null; then + cprint cyan "Docker is installed — checking group assignment..." + + if getent group docker &>/dev/null; then + if id -nG "$install_user" | grep -qw docker; then + cprint green "User '$install_user' is already in the 'docker' group." + else + cprint cyan "Adding user '$install_user' to 'docker' group..." + if usermod -aG docker "$install_user"; then + cprint green "Docker group access granted to '$install_user'." + else + cprint red "Failed to add '$install_user' to 'docker' group. Docker may not be usable by this user." + fi + fi + else + cprint red "Docker installed but 'docker' group not found. Skipping group assignment." + fi + else + cprint yellow "Docker not installed — skipping Docker group configuration." + fi + + return 0 +} + +# Prepare file & permissions before install. +mcsm_install_prepare() { + # Prepare the user first + prepare_user + + if [[ ! -d "$install_tmp_dir" ]]; then + cprint red bold "install_tmp_dir does not exist: $install_tmp_dir" + exit 1 + fi + + cprint cyan "Changing ownership of $install_tmp_dir to user '$install_user'..." + chown -R "$install_user":"$install_user" "$install_tmp_dir" || { + cprint red bold "Failed to change ownership of $install_tmp_dir" + cleanup_install_tmp + exit 1 + } + + # Normalize install_dir to ensure it ends with a slash + [[ "${install_dir}" != */ ]] && install_dir="${install_dir}/" + + if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then + cprint cyan "No existing components detected — skipping data backup/cleanup." + return 0 + fi + + for component in web daemon; do + local is_installed_var="${component}_installed" + if [[ "${!is_installed_var}" == true ]]; then + local component_path="${install_dir}${component}" + local data_dir="${component_path}/data" + local backup_path="${install_dir}${backup_prefix}${component}" + + if [[ ! -d "$component_path" ]]; then + cprint yellow "Expected installed component directory not found: $component_path" + continue + fi + + if [[ -d "$data_dir" ]]; then + if [[ -e "$backup_path" ]]; then + cprint red bold "Backup destination already exists: $backup_path" + cprint red "Please resolve this conflict manually before continuing." + cleanup_install_tmp + exit 1 + fi + + cprint cyan "Backing up data directory for $component..." + mv "$data_dir" "$backup_path" || { + cprint red bold "Failed to move $data_dir to $backup_path" + cleanup_install_tmp + exit 1 + } + cprint green "Moved $data_dir → $backup_path" + else + cprint yellow "No data directory found for $component — skipping backup." + fi + + cprint cyan "Removing old component directory: $component_path" + rm -rf "$component_path" || { + cprint red bold "Failed to remove old component directory: $component_path" + cleanup_install_tmp + exit 1 + } + fi + done + + cprint green bold "Existing components prepared successfully." + return 0 +} + +# Install or update a component +install_component() { + local component="$1" + local target_path="${install_dir}${component}" + local backup_data_path="${install_dir}${backup_prefix}${component}" + local source_path="${install_tmp_dir}/mcsmanager/${component}" + + cprint cyan bold "Installing/Updating component: $component" + + # Step 1: Move new component to install_dir + if [[ ! -d "$source_path" ]]; then + cprint red bold "Source directory not found: $source_path" + cleanup_install_tmp + exit 1 + fi + + if [[ -e "$target_path" ]]; then + cprint red bold "Target path already exists: $target_path" + cprint red " This should not happen — possible permission error or unclean install." + cleanup_install_tmp + exit 1 + fi + + mv "$source_path" "$target_path" || { + cprint red bold "Failed to move $source_path → $target_path" + cleanup_install_tmp + exit 1 + } + + cprint green "Moved $component to $target_path" + + # Step 2: Restore backed-up data directory if present + if [[ -d "$backup_data_path" ]]; then + local target_data_path="${target_path}/data" + + cprint cyan "Restoring backed-up data directory for $component..." + + rm -rf "$target_data_path" # Ensure no conflict + mv "$backup_data_path" "$target_data_path" || { + cprint red bold "Failed to restore data directory to $target_data_path" + cleanup_install_tmp + exit 1 + } + + cprint green "Data directory restored: $target_data_path" + else + cprint yellow "No backed-up data directory found for $component — fresh install assumed." + fi + + # Step 3: Install NPM dependencies + if [[ ! -x "$npm_bin_path" ]]; then + cprint red bold "npm binary not found or not executable: $npm_bin_path" + cleanup_install_tmp + exit 1 + fi + + cprint cyan "Installing dependencies for $component using npm..." + pushd "$target_path" >/dev/null || { + cprint red bold "Failed to change directory to $target_path" + cleanup_install_tmp + exit 1 + } + + if ! "$npm_bin_path" install --no-audit --no-fund --loglevel=warn; then + cprint red bold "NPM dependency installation failed for $component" + popd >/dev/null + cleanup_install_tmp + exit 1 + fi + + popd >/dev/null + cprint green bold "Component '$component' installed/updated successfully." +} + +# Create systemd service for a given component. +# This will overwrite the existing service file. +create_systemd_service() { + local component="$1" + local service_path="${systemd_file}${component}.service" + local working_dir="${install_dir}${component}" + local exec="${node_bin_path} app.js" + + if [[ ! -d "$working_dir" ]]; then + cprint red bold "Component directory not found: $working_dir" + cleanup_install_tmp + return 1 + fi + + cprint cyan "Creating systemd service for '$component'..." + + cat > "$service_path" </dev/null | awk '{print $1}') + [[ -z "$ip_address" ]] && ip_address="YOUR-IP" + + # Daemon info + if [[ "$install_daemon" == true ]]; then + local daemon_address="ws://$ip_address:${daemon_port:-Failed to Retrieve from Config file}" + local daemon_key_display="${daemon_key:-Failed to Retrieve from Config file}" + + cprint yellow noprefix "Daemon Address:" + cprint white noprefix " $daemon_address" + cprint yellow noprefix "Daemon Key:" + cprint white noprefix " $daemon_key_display" + echo "" + fi + + # Web info + if [[ "$install_web" == true ]]; then + local web_address="http://$ip_address:${web_port:-Failed to Retrieve from Config file}" + cprint yellow noprefix "HTTP Web Interface:" + cprint white noprefix nonl " $web_address " + cprint yellow noprefix "(open in browser)" + echo "" + fi + + # Port guidance + cprint yellow noprefix "NOTE:" + cprint white noprefix " Make sure to expose the above ports through your firewall." + cprint white noprefix " If accessing from outside your network, you may need to configure port forwarding on your router." + echo "" + + # Service management help + cprint yellow noprefix "Service Management Commands:" + if [[ "$install_daemon" == true ]]; then + cprint white noprefix nonl " systemctl start " + cprint yellow noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl stop " + cprint yellow noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl restart " + cprint yellow noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl status " + cprint yellow noprefix "mcsm-daemon.service" + fi + if [[ "$install_web" == true ]]; then + cprint white noprefix nonl " systemctl start " + cprint yellow noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl stop " + cprint yellow noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl restart " + cprint yellow noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl status " + cprint yellow noprefix "mcsm-web.service" + fi + echo "" + + # Official doc + cprint yellow noprefix "Official Documentation:" + cprint white noprefix " https://docs.mcsmanager.com/" + echo "" + + # HTTPS support + cprint yellow noprefix "Need HTTPS?" + cprint white noprefix " To enable secure HTTPS access, configure a reverse proxy:" + cprint white noprefix " https://docs.mcsmanager.com/ops/proxy_https.html" + echo "" + + # Closing message + cprint green noprefix "Installation completed. Enjoy managing your servers with MCSManager!" + echo "" +} + +install_mcsm() { + local components=() + + if [[ "$install_web" == true ]]; then + install_component "web" + create_systemd_service "web" + components+=("web") + fi + + if [[ "$install_daemon" == true ]]; then + install_component "daemon" + create_systemd_service "daemon" + components+=("daemon") + fi + + # Reload systemd after any service file changes + if (( ${#components[@]} > 0 )); then + cprint cyan "Reloading systemd daemon..." + # systemctl daemon-reexec + systemctl daemon-reload + + for comp in "${components[@]}"; do + local svc="mcsm-${comp}.service" + + cprint cyan "Enabling service: $svc" + if systemctl enable "$svc" &>/dev/null; then + cprint green "Enabled service: $svc" + else + cprint red bold "Failed to enable service: $svc" + cleanup_install_tmp + exit 1 + fi + done + fi + + # Clean tmp dir + cleanup_install_tmp + # Extract installed component info + safe_run extract_component_info "Failed to extract runtime info from installed services" + safe_run print_install_result "Failed to print installation result" + +} + +main() { + trap 'echo "Unexpected error occurred."; exit 99' ERR + safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" + safe_run check_root "Script must be run as root" + safe_run parse_args "Failed to parse arguments" "$@" + safe_run detect_os_info "Failed to detect OS" + safe_run check_supported_os "Unsupported OS or version" + # To be moved to a master pre check function. + safe_run resolve_node_arch "Failed to resolve Node.js architecture" + + safe_run check_required_commands "Missing required system commands" + + safe_run check_node_installed "Failed to detect Node.js or npm at expected path. Node.js will be installed." + if [ "$install_node" = true ]; then + safe_run install_node "Node.js installation failed" + fi + + safe_run permission_barrier "Permission validation failed — aborting install" + + safe_run download_mcsm "Failed to acquire MCSManager source" + safe_run mcsm_install_prepare "Error while preparing for installation" + + safe_run install_mcsm "Failed to install MCSManager" +} +main "$@" From 5393bb3f7b3d16d681ae640bd84fe2427a6d6daf Mon Sep 17 00:00:00 2001 From: KevinLu Date: Mon, 6 Oct 2025 00:31:54 -0400 Subject: [PATCH 402/463] fix: detect npm using node --- setup.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index f6157fa..ed8162c 100644 --- a/setup.sh +++ b/setup.sh @@ -666,7 +666,6 @@ resolve_node_arch() { # This function check Node.js version + NPM (if Node.js valid) verify_node_at_path() { local node_path="$1" - # Assign value to vlobal variables when verifying node_bin_path="$node_path/bin/node" npm_bin_path="$node_path/bin/npm" @@ -678,18 +677,15 @@ verify_node_at_path() { local installed_ver installed_ver="$("$node_bin_path" -v 2>/dev/null | sed 's/^v//')" - # Node exists but version not returned if [[ -z "$installed_ver" ]]; then return 1 fi - # Version mismatch, even if newer if [ "$strict_node_version_check" = true ]; then if [[ "$installed_ver" != "$required_node_ver" ]]; then return 3 fi else - # Version mismatch, too old. local cmp cmp=$(printf "%s\n%s\n" "$required_node_ver" "$installed_ver" | sort -V | head -1) if [[ "$cmp" != "$required_node_ver" ]]; then @@ -697,14 +693,22 @@ verify_node_at_path() { fi fi - # node cmd valid, but npm is missing or broken. - if [ ! -x "$npm_bin_path" ] || ! "$npm_bin_path" --version >/dev/null 2>&1; then + # Check if npm exists and works using node (not $PATH/npm) + if [ ! -x "$npm_bin_path" ]; then + return 4 + fi + + # Use node to run npm.js directly, in case env is broken + local npm_version + npm_version="$("$node_bin_path" "$npm_bin_path" --version 2>/dev/null)" + if [[ -z "$npm_version" ]]; then return 4 fi return 0 } + # Node.js pre-check. check if we need to install Node.js before installer run. # Use postcheck_node_after_install() to check after install. check_node_installed() { @@ -1224,7 +1228,7 @@ print_install_result() { cprint white noprefix "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" echo "" # status summary - cprint yellow noprefix "Installed/Updated Components:" + cprint yellow noprefix "Installed/Updated Component(s):" if [[ "$install_daemon" == true && -n "$daemon_key" && -n "$daemon_port" ]]; then cprint white noprefix "Daemon" elif [[ "$install_daemon" == true ]]; then From 49c5ead583fb450ba29ed999d49c9d4a44f2b097 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Mon, 6 Oct 2025 00:33:26 -0400 Subject: [PATCH 403/463] fix: execute npm using node --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index ed8162c..97ecd5f 100644 --- a/setup.sh +++ b/setup.sh @@ -1083,10 +1083,10 @@ install_component() { exit 1 } - if ! "$npm_bin_path" install --no-audit --no-fund --loglevel=warn; then + if ! "$node_bin_path" "$npm_bin_path" install --no-audit --no-fund --loglevel=warn; then cprint red bold "NPM dependency installation failed for $component" popd >/dev/null - cleanup_install_tmp + cleanup_install_tmp exit 1 fi From e55a91ee36bc7e483f15de500a46beb20a8b648d Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 8 Oct 2025 02:47:09 -0400 Subject: [PATCH 404/463] updated .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 250ffcc..1dc7e63 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ bin-release/ cli_old.sh .idea + +design.txt \ No newline at end of file From 02d99865976eabeb1cfcac3e9c17e5637933bbdc Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 8 Oct 2025 02:52:46 -0400 Subject: [PATCH 405/463] feat: update logic - replace backup with file override --- setup.sh | 69 ++------------------------------------------------------ 1 file changed, 2 insertions(+), 67 deletions(-) diff --git a/setup.sh b/setup.sh index 529a70b..e094f3a 100644 --- a/setup.sh +++ b/setup.sh @@ -899,46 +899,6 @@ mcsm_install_prepare() { return 0 fi - for component in web daemon; do - local is_installed_var="${component}_installed" - if [[ "${!is_installed_var}" == true ]]; then - local component_path="${install_dir}${component}" - local data_dir="${component_path}/data" - local backup_path="${install_dir}${backup_prefix}${component}" - - if [[ ! -d "$component_path" ]]; then - cprint yellow "Expected installed component directory not found: $component_path" - continue - fi - - if [[ -d "$data_dir" ]]; then - if [[ -e "$backup_path" ]]; then - cprint red bold "Backup destination already exists: $backup_path" - cprint red "Please resolve this conflict manually before continuing." - cleanup_install_tmp - exit 1 - fi - - cprint cyan "Backing up data directory for $component..." - mv "$data_dir" "$backup_path" || { - cprint red bold "Failed to move $data_dir to $backup_path" - cleanup_install_tmp - exit 1 - } - cprint green "Moved $data_dir → $backup_path" - else - cprint yellow "No data directory found for $component — skipping backup." - fi - - cprint cyan "Removing old component directory: $component_path" - rm -rf "$component_path" || { - cprint red bold "Failed to remove old component directory: $component_path" - cleanup_install_tmp - exit 1 - } - fi - done - cprint green bold "Existing components prepared successfully." return 0 } @@ -959,39 +919,14 @@ install_component() { exit 1 fi - if [[ -e "$target_path" ]]; then - cprint red bold "Target path already exists: $target_path" - cprint red " This should not happen — possible permission error or unclean install." - cleanup_install_tmp - exit 1 - fi - mv "$source_path" "$target_path" || { + mv -f "$source_path" "$target_path" || { cprint red bold "Failed to move $source_path → $target_path" - cleanup_install_tmp + cleanup_install_tmp exit 1 } - cprint green "Moved $component to $target_path" - # Step 2: Restore backed-up data directory if present - if [[ -d "$backup_data_path" ]]; then - local target_data_path="${target_path}/data" - - cprint cyan "Restoring backed-up data directory for $component..." - - rm -rf "$target_data_path" # Ensure no conflict - mv "$backup_data_path" "$target_data_path" || { - cprint red bold "Failed to restore data directory to $target_data_path" - cleanup_install_tmp - exit 1 - } - - cprint green "Data directory restored: $target_data_path" - else - cprint yellow "No backed-up data directory found for $component — fresh install assumed." - fi - # Step 3: Install NPM dependencies if [[ ! -x "$npm_bin_path" ]]; then cprint red bold "npm binary not found or not executable: $npm_bin_path" From d1688081343fb4c59a48397f4de60c6792fed375 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 8 Oct 2025 03:00:30 -0400 Subject: [PATCH 406/463] fix: fix EOL issue --- setup.sh | 102 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 90 insertions(+), 12 deletions(-) diff --git a/setup.sh b/setup.sh index e094f3a..ea32fc6 100644 --- a/setup.sh +++ b/setup.sh @@ -23,10 +23,75 @@ download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/ # Name of the release package to download/detect package_name="mcsmanager_linux_release.tar.gz" -if [ "$(id -u)" -ne 0 ]; then - echo "This script must be run as root. Please use \"sudo bash\" instead." - exit 1 -fi +# Node.js version to be installed +# Keep the leading "v" +node_version="v20.12.2" + +# Node download base URL - primary +node_download_url_base="https://nodejs.org/dist/" + +# Node download URL - fallback. +# This is the URL points directly to the file, not the base. This can also be a local absolute path. +# Only supports https:// or http:// for web locations. +node_download_fallback="" + +# Node.js installation path (defaults to the MCSManager installation path. Can be overridden with --node-install-dir) +node_install_dir="$install_dir" + +# Temp dir for file extraction +tmp_dir="/tmp" + +# --------------- Global Variables ---------------# +# DO NOT MODIFY # + + +# Component installation options. +# For fresh installs, both daemon and web components are installed by default. +# For updates, behavior depends on detected existing components. +# Can be overridden with --install daemon/web/all +install_daemon=true +install_web=true + +# Install MCSM as (default: root). +# To install as a general user (e.g., "mcsm"), use the --user option: --user mcsm +# To ensure compatibility, only user mcsm is supported. +install_user="root" +# Installed user, for permission check +web_installed=false +daemon_installed=false +web_installed_user="" +daemon_installed_user="" + +# Service file locations +# the final dir = systemd_file + {web/daemon} + ".service" +systemd_file="/etc/systemd/system/mcsm-" +# Optional: Override the default installation source file. +# If --install-source is specified, the installer will use the provided +# "mcsmanager_linux_release.tar.gz" file instead of downloading it. +# Only support local absolute path. +install_source_path="" + +# temp path for extracted file(s) +install_tmp_dir="/opt/mcsmanager/mcsm_abcd" + +# dir name for data dir backup +# e.g. /opt/mcsmanager/daemon/data -> /opt/mcsmanager/data_bak_data +# only valid for when during an update +backup_prefix="data_bak_" + +# System architecture (detected automatically) +arch="" +version="" +distro="" + +# Supported OS versions (map-style structure) +# Format: supported_os["distro_name"]="version1 version2 version3 ..." +declare -A supported_os +supported_os["Ubuntu"]="18 20 22 24" +supported_os["Debian"]="10 11 12 13" +supported_os["CentOS"]="7 8 8-stream 9-stream 10-stream" +supported_os["RHEL"]="7 8 9 10" +supported_os["Arch"]="rolling" # Required system commands for installation # These will be checked before logic process @@ -432,13 +497,25 @@ check_supported_os() { return 0 } -Install_Node() { - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Node.js version is up-to-date, skipping installation." - return +# Check if all required commands are available +check_required_commands() { + local missing=0 + + for cmd in "${required_commands[@]}"; do + if ! command -v "$cmd" >/dev/null 2>&1; then + echo "Error: Required command '$cmd' is not available in PATH." + missing=1 + fi + done + + if [ "$missing" -ne 0 ]; then + echo "One or more required commands are missing. Please install them and try again." + return 1 fi - echo_cyan "[+] Install Node.JS environment..." + cprint green "All required commands are available." + return 0 +} # Print with specified color and style, fallback to RESET if not supported. # Supported colors*: black|red|green|yellow|blue|magenta|cyan|white @@ -919,14 +996,15 @@ install_component() { exit 1 fi - mv -f "$source_path" "$target_path" || { - cprint red bold "Failed to move $source_path → $target_path" - cleanup_install_tmp + cprint red bold "Failed to move $source_path -> $target_path" + cleanup_install_tmp exit 1 } + cprint green "Moved $component to $target_path" + # Step 3: Install NPM dependencies if [[ ! -x "$npm_bin_path" ]]; then cprint red bold "npm binary not found or not executable: $npm_bin_path" From 3a846adb4b228e5f7887c0839ec8c28b1e48c653 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 8 Oct 2025 03:01:01 -0400 Subject: [PATCH 407/463] feat: enforce node version check by default --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index ea32fc6..746a5ae 100644 --- a/setup.sh +++ b/setup.sh @@ -111,7 +111,7 @@ required_commands=( # enabled -> strict requriement for defined node version # false -> newer version allowed # Older version is NEVER allowed -strict_node_version_check=false +strict_node_version_check=true # Will be set based on actual node status install_node=true From 9d8a35959ef819cdfe9e623a603b4e1ec3671eb6 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 8 Oct 2025 03:09:06 -0400 Subject: [PATCH 408/463] feat: stop web & daemon service before update --- setup.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/setup.sh b/setup.sh index 746a5ae..3500fce 100644 --- a/setup.sh +++ b/setup.sh @@ -950,11 +950,41 @@ prepare_user() { return 0 } +# Function to stop MCSM services if they exist +stop_mcsm_services() { + cprint yellow bold "Attempting to stop mcsm-web and mcsm-daemon services..." + + # Stop mcsm-web if the service exists + if systemctl list-units --full --all | grep -q '^mcsm-web\.service'; then + cprint blue "Stopping mcsm-web..." + if systemctl stop mcsm-web; then + cprint green "mcsm-web stopped successfully." + else + cprint red bold "Warning: Failed to stop mcsm-web." + fi + else + cprint cyan "mcsm-web service not found. Skipping." + fi + + # Stop mcsm-daemon if the service exists + if systemctl list-units --full --all | grep -q '^mcsm-daemon\.service'; then + cprint blue "Stopping mcsm-daemon..." + if systemctl stop mcsm-daemon; then + cprint green "mcsm-daemon stopped successfully." + else + cprint red bold "Warning: Failed to stop mcsm-daemon." + fi + else + cprint cyan "mcsm-daemon service not found. Skipping." + fi +} # Prepare file & permissions before install. mcsm_install_prepare() { # Prepare the user first prepare_user + # Stop service if existed + stop_mcsm_services if [[ ! -d "$install_tmp_dir" ]]; then cprint red bold "install_tmp_dir does not exist: $install_tmp_dir" From 6811701c4ef0cd92cb93560af72da85b8d5d2984 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Wed, 8 Oct 2025 03:12:44 -0400 Subject: [PATCH 409/463] fix: file override issue & service detection --- setup.sh | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/setup.sh b/setup.sh index 3500fce..fdbc859 100644 --- a/setup.sh +++ b/setup.sh @@ -954,31 +954,22 @@ prepare_user() { stop_mcsm_services() { cprint yellow bold "Attempting to stop mcsm-web and mcsm-daemon services..." - # Stop mcsm-web if the service exists - if systemctl list-units --full --all | grep -q '^mcsm-web\.service'; then - cprint blue "Stopping mcsm-web..." - if systemctl stop mcsm-web; then - cprint green "mcsm-web stopped successfully." - else - cprint red bold "Warning: Failed to stop mcsm-web." - fi + # Attempt to stop mcsm-web + cprint blue "Stopping mcsm-web..." + if systemctl stop mcsm-web; then + cprint green "mcsm-web stopped successfully." else - cprint cyan "mcsm-web service not found. Skipping." + cprint red bold "Warning: Failed to stop mcsm-web (may not exist or already stopped)." fi - # Stop mcsm-daemon if the service exists - if systemctl list-units --full --all | grep -q '^mcsm-daemon\.service'; then - cprint blue "Stopping mcsm-daemon..." - if systemctl stop mcsm-daemon; then - cprint green "mcsm-daemon stopped successfully." - else - cprint red bold "Warning: Failed to stop mcsm-daemon." - fi + # Attempt to stop mcsm-daemon + cprint blue "Stopping mcsm-daemon..." + if systemctl stop mcsm-daemon; then + cprint green "mcsm-daemon stopped successfully." else - cprint cyan "mcsm-daemon service not found. Skipping." + cprint red bold "Warning: Failed to stop mcsm-daemon (may not exist or already stopped)." fi } - # Prepare file & permissions before install. mcsm_install_prepare() { # Prepare the user first @@ -1026,12 +1017,14 @@ install_component() { exit 1 fi - mv -f "$source_path" "$target_path" || { - cprint red bold "Failed to move $source_path -> $target_path" - cleanup_install_tmp + if cp -a "$source_path"/. "$target_path"; then + cprint green "Updated files from $source_path → $target_path" + rm -rf "$source_path" + else + cprint red bold "Failed to update files from $source_path → $target_path" + cleanup_install_tmp exit 1 - } - + fi cprint green "Moved $component to $target_path" From 12b8b407d6d5a2d1135d479e9f00740a5f55b652 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 9 Oct 2025 22:00:42 -0400 Subject: [PATCH 410/463] change ownership of install dir --- setup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup.sh b/setup.sh index fdbc859..fcfe626 100644 --- a/setup.sh +++ b/setup.sh @@ -925,6 +925,14 @@ prepare_user() { fi cprint green "User '$install_user' created." fi + + cprint cyan "Changing ownership of $install_dir to user '$install_user'..." + chown -R "$install_user":"$install_user" "$install_dir" || { + cprint red bold "Failed to change ownership of $install_dir" + cleanup_install_tmp + exit 1 + } + # Docker integration if command -v docker &>/dev/null; then From 8d6080adfe053368b936960dc9005793b790f431 Mon Sep 17 00:00:00 2001 From: shane0411 Date: Fri, 10 Oct 2025 10:13:33 +0800 Subject: [PATCH 411/463] feat: add daemon script node check --- daemon/setup.sh | 5 +++++ daemon/setup_cn.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/daemon/setup.sh b/daemon/setup.sh index a0ed362..c5d4c85 100644 --- a/daemon/setup.sh +++ b/daemon/setup.sh @@ -44,6 +44,11 @@ Red_Error() { } Install_Node() { + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Node.js version is up-to-date, skipping installation." + return + fi + echo_cyan_n "[+] Install Node.JS environment...\n" rm -irf "$node_install_path" diff --git a/daemon/setup_cn.sh b/daemon/setup_cn.sh index a3a4113..aec9b51 100644 --- a/daemon/setup_cn.sh +++ b/daemon/setup_cn.sh @@ -44,6 +44,11 @@ Red_Error() { } Install_Node() { + if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then + echo_green "Node.js version is up-to-date, skipping installation." + return + fi + echo_cyan_n "[+] 安装 Node.JS...\n" rm -irf "$node_install_path" From 04bf77160dcc46487f1ecba380936a39de6a6fe1 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 9 Oct 2025 22:19:15 -0400 Subject: [PATCH 412/463] fix: prepare user before file permission barrier --- setup.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index fcfe626..dc66597 100644 --- a/setup.sh +++ b/setup.sh @@ -980,8 +980,7 @@ stop_mcsm_services() { } # Prepare file & permissions before install. mcsm_install_prepare() { - # Prepare the user first - prepare_user + # Stop service if existed stop_mcsm_services @@ -1343,7 +1342,7 @@ main() { if [ "$install_node" = true ]; then safe_run install_node "Node.js installation failed" fi - + safe_run prepare_user "Failed to prepare user permission." safe_run permission_barrier "Permission validation failed — aborting install" safe_run download_mcsm "Failed to acquire MCSManager source" From 8a2931f30acf105b39044a768b2a0dfeda31b507 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 9 Oct 2025 22:54:05 -0400 Subject: [PATCH 413/463] feat: added flag to skip perm check and update permission --- setup.sh | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index dc66597..f232c4b 100644 --- a/setup.sh +++ b/setup.sh @@ -41,6 +41,10 @@ node_install_dir="$install_dir" # Temp dir for file extraction tmp_dir="/tmp" +# Bypass installed user permission check, override by --force-permission +force_permission=false + + # --------------- Global Variables ---------------# # DO NOT MODIFY # @@ -84,6 +88,8 @@ arch="" version="" distro="" + + # Supported OS versions (map-style structure) # Format: supported_os["distro_name"]="version1 version2 version3 ..." declare -A supported_os @@ -378,6 +384,10 @@ parse_args() { exit 1 fi ;; + --force-permission) + force_permission=true + shift + ;; *) echo "Error: Unknown argument: $1" exit 1 @@ -602,14 +612,24 @@ permission_barrier() { exit 1 fi - # Step 1: User match check + # Step 1: User match check with optional force override if [[ "$installed_user" != "$install_user" ]]; then - cprint red bold "Permission mismatch for '$component':" - cprint red "Installed as user: $installed_user" - cprint red "Current install target user: $install_user" - cprint red "Unable to proceed due to ownership conflict." - exit 1 + if [[ "$force_permission" == true ]]; then + cprint yellow bold "Permission mismatch for '$component':" + cprint yellow "Installed as user: $installed_user" + cprint yellow "Target install user: $install_user" + cprint yellow "User mismatch, but --force-permission is set. Continuing and updating permissions..." + else + cprint red bold "Permission mismatch for '$component':" + cprint red "Installed as user: $installed_user" + cprint red "Current install target user: $install_user" + cprint red "Unable to proceed due to ownership conflict. Use --force-permission to override and update file permission." + exit 1 + fi + else + cprint green bold "Permission check passed: '$installed_user' matches target user." fi + fi done From 31d365b9d181876f6fbf58c214fdc1a73bb161d2 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 9 Oct 2025 23:09:11 -0400 Subject: [PATCH 414/463] misc: remove global permission update by default --- setup.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/setup.sh b/setup.sh index f232c4b..b0b7feb 100644 --- a/setup.sh +++ b/setup.sh @@ -945,14 +945,7 @@ prepare_user() { fi cprint green "User '$install_user' created." fi - - cprint cyan "Changing ownership of $install_dir to user '$install_user'..." - chown -R "$install_user":"$install_user" "$install_dir" || { - cprint red bold "Failed to change ownership of $install_dir" - cleanup_install_tmp - exit 1 - } - + # Docker integration if command -v docker &>/dev/null; then From 1f3e725233872618307725a5075a7c681a58bfde Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 9 Oct 2025 23:20:16 -0400 Subject: [PATCH 415/463] minor: text update --- setup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index b0b7feb..27926d1 100644 --- a/setup.sh +++ b/setup.sh @@ -679,7 +679,7 @@ resolve_node_arch() { node_path="${node_install_dir}/node-${node_version}-linux-${node_arch}" cprint cyan "Resolved Node.js architecture: $node_arch" - cprint cyan "Computed Node.js install path: $node_path" + cprint cyan "Node.js install path: $node_path" } # Check if Node.js at PATH is valid. @@ -1290,6 +1290,11 @@ print_install_result() { cprint white noprefix " To enable secure HTTPS access, configure a reverse proxy:" cprint white noprefix " https://docs.mcsmanager.com/ops/proxy_https.html" echo "" + + if [[ "$force_permission" == true ]]; then + cprint red noprefix "[Important] You chose to override permission during install." + cprint red noprefix " You may need to run: chown -R $install_user to update permission manually." + fi # Closing message cprint green noprefix "Installation completed. Enjoy managing your servers with MCSManager!" From 88029d8a51d00ae87a04f4d4aee37b312c17109d Mon Sep 17 00:00:00 2001 From: KevinLu Date: Thu, 9 Oct 2025 23:31:11 -0400 Subject: [PATCH 416/463] fix: flag skip dir perm check --- setup.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index 27926d1..472bcc6 100644 --- a/setup.sh +++ b/setup.sh @@ -619,6 +619,7 @@ permission_barrier() { cprint yellow "Installed as user: $installed_user" cprint yellow "Target install user: $install_user" cprint yellow "User mismatch, but --force-permission is set. Continuing and updating permissions..." + sleep 3 else cprint red bold "Permission mismatch for '$component':" cprint red "Installed as user: $installed_user" @@ -643,11 +644,22 @@ permission_barrier() { fi if [[ "$dir_owner" != "$install_user" ]]; then - cprint red bold "Install directory ownership mismatch:" - cprint red " Directory: $install_dir" - cprint red " Owned by: $dir_owner" - cprint red " Expected: $install_user" + if [[ "$force_permission" == true ]]; then + cprint yellow bold "Install directory ownership mismatch:" + cprint yellow " Directory: $install_dir" + cprint yellow " Owned by: $dir_owner" + cprint yellow " Expected: $install_user" + cprint yellow " --force-permission is set. Continuing despite mismatch." + sleep 3 + else + cprint red bold "Install directory ownership mismatch:" + cprint red " Directory: $install_dir" + cprint red " Owned by: $dir_owner" + cprint red " Expected: $install_user" exit 1 + fi + else + cprint green bold "Install directory ownership check passed: '$install_dir' is owned by '$install_user'." fi cprint green bold "Permissions and ownership validated. Proceeding." From fc66f2f2ed7dd53085a179dd296cf721e773cc98 Mon Sep 17 00:00:00 2001 From: Capslock800000 Date: Fri, 10 Oct 2025 19:20:41 +0800 Subject: [PATCH 417/463] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B9=B6=E6=B1=89?= =?UTF-8?q?=E5=8C=96=E4=BA=86=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup_cn.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index e7ec82b..0771775 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -212,7 +212,7 @@ fi node_install_path="/opt/node-$node-linux-$arch" # Check network connection -echo_cyan "[-] Architecture: $arch" +echo_cyan "[-] 当前系统架构: $arch" # Install related software echo_cyan_n "[+] 正在安装依赖软件 (git, tar, wget)... " @@ -230,7 +230,7 @@ fi # Determine whether the relevant software is installed successfully if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "完成" + echo_green "完成!" else Red_Error "[x] 没有安装 git, tar 和 wget, 请先在安装MCSManager前安装它们!" fi From ff74cb06dd51cb8811362d4fa961e1185087a2ef Mon Sep 17 00:00:00 2001 From: KevinLu Date: Sat, 11 Oct 2025 00:05:07 -0400 Subject: [PATCH 418/463] fix: move user add logic after perm check/rollback --- setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 472bcc6..79b397e 100644 --- a/setup.sh +++ b/setup.sh @@ -1372,8 +1372,10 @@ main() { if [ "$install_node" = true ]; then safe_run install_node "Node.js installation failed" fi - safe_run prepare_user "Failed to prepare user permission." + safe_run permission_barrier "Permission validation failed — aborting install" + + safe_run prepare_user "Failed to prepare user permission." safe_run download_mcsm "Failed to acquire MCSManager source" safe_run mcsm_install_prepare "Error while preparing for installation" From d2911e682b46bd206cdee2c013958fa65f8bd634 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Sat, 18 Oct 2025 01:24:46 -0400 Subject: [PATCH 419/463] fix: use restart than start --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 79b397e..469b21a 100644 --- a/setup.sh +++ b/setup.sh @@ -1141,7 +1141,7 @@ extract_component_info() { local daemon_config_path="${daemon_path}/${daemon_key_config_subpath}" cprint cyan bold "Starting daemon service..." - if systemctl start "$daemon_service"; then + if systemctl restart "$daemon_service"; then cprint green "Daemon service started." sleep 1 # Allow service to init and write configs @@ -1176,7 +1176,7 @@ extract_component_info() { local web_config_path="${web_path}/${web_port_config_subpath}" cprint cyan bold "Starting web service..." - if systemctl start "$web_service"; then + if systemctl restart "$web_service"; then cprint green "Web service started." sleep 1 # Allow time to populate config From e2888e140c48eec3acbf8d15a5ee81482409186e Mon Sep 17 00:00:00 2001 From: SkyKingPX Date: Thu, 23 Oct 2025 15:16:36 +0200 Subject: [PATCH 420/463] Added MC 1.21.10 & Updated Versions --- market.json | 281 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 244 insertions(+), 37 deletions(-) diff --git a/market.json b/market.json index 4c507a0..2b4c954 100644 --- a/market.json +++ b/market.json @@ -206,6 +206,29 @@ } } }, + { + "platform": "ALL", + "language": "zh_cn", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Paper Minecraft 1.21.10 快速开服,性能强,占用少,支持插件,不支持模组", + "title": "[PaperMC] Minecraft 1.21.10 快速开服", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "100MB", + "remark": "仅包含 Paper 版本", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.10/builds/84/downloads/paper-1.21.10-84.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.10-84.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "ALL", "language": "zh_cn", @@ -218,11 +241,11 @@ "hardware": "RAM 8G+", "size": "100MB", "remark": "仅包含 Paper 版本", - "targetLink": "https://fill-data.papermc.io/v1/objects/d310c61899acc608b683515c5c7ef929774bfd1b90262dac965e76c7e9ea8d22/paper-1.21.8-30.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/60/downloads/paper-1.21.8-60.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-30.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-60.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -234,18 +257,18 @@ "language": "zh_cn", "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "Paper Minecraft 1.20.1 快速开服,性能强,占用少,支持插件,不支持模组", - "title": "[PaperMC] Minecraft 1.20.1 快速开服", + "description": "Paper Minecraft 1.21.1 快速开服,性能强,占用少,支持插件,不支持模组", + "title": "[PaperMC] Minecraft 1.21.1 快速开服", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "100MB", "remark": "仅包含 Paper 版本", - "targetLink": "https://fill-data.papermc.io/v1/objects/234a9b32098100c6fc116664d64e36ccdb58b5b649af0f80bcccb08b0255eaea/paper-1.20.1-196.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/133/downloads/paper-1.21.1-133.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.1-196.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.1-133.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -457,6 +480,29 @@ } }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.10 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PaperMC] Minecraft 1.21.10", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "100MB", + "remark": "Minecraft Paper", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.10/builds/84/downloads/paper-1.21.10-84.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.10-84.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "ALL", "language": "en_us", @@ -469,7 +515,7 @@ "hardware": "RAM 8G+", "size": "100MB", "remark": "Minecraft Paper", - "targetLink": "https://fill-data.papermc.io/v1/objects/8de7c52c3b02403503d16fac58003f1efef7dd7a0256786843927fa92ee57f1e/paper-1.21.8-60.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/60/downloads/paper-1.21.8-60.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", @@ -508,18 +554,18 @@ "language": "en_us", "gameType": "Minecraft", "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", - "description": "Minecraft 1.20.1 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", - "title": "[PaperMC] Minecraft 1.20.1", + "description": "Minecraft 1.21.1 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PaperMC] Minecraft 1.21.1", "category": "mc-paper", "runtime": "Java 21+", "hardware": "RAM 8G+", "size": "100MB", "remark": "Minecraft Paper", - "targetLink": "https://fill-data.papermc.io/v1/objects/234a9b32098100c6fc116664d64e36ccdb58b5b649af0f80bcccb08b0255eaea/paper-1.20.1-196.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/133/downloads/paper-1.21.1-133.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.20.1-196.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.1-133.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -527,6 +573,29 @@ } }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.10", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "55MB", + "remark": "Minecraft Purpur", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.10-2511-experimental.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.10-2511-experimental.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "ALL", "language": "en_us", @@ -539,11 +608,11 @@ "hardware": "RAM 8G+", "size": "55MB", "remark": "Minecraft Purpur", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2496.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2497.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2496.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2497.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -574,6 +643,52 @@ } }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 Forge Quick Server Setup, Mod Support for Linux", + "title": "[Forge] Minecraft 1.21.10", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.0.11/forge-1.21.10-60.0.11-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.10-60.0.11-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 Forge Quick Server Setup, Mod Support for Windows", + "title": "[Forge] Minecraft 1.21.10", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.0.11/forge-1.21.10-60.0.11-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.10-60.0.11-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "Linux", "language": "en_us", @@ -586,13 +701,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.4/forge-1.21.8-58.1.4-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.7/forge-1.21.8-58.1.7-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.8-58.1.4-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.8-58.1.7-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -609,13 +724,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.4/forge-1.21.8-58.1.4-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.7/forge-1.21.8-58.1.7-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.8-58.1.4-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.8-58.1.7-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -632,13 +747,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.7/forge-1.21.4-54.1.7-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.8/forge-1.21.4-54.1.8-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.4-54.1.7-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.4-54.1.8-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -655,13 +770,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.7/forge-1.21.4-54.1.7-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.8/forge-1.21.4-54.1.8-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.4-54.1.7-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.4-54.1.8-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -678,13 +793,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.3/forge-1.21.1-52.1.3-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.6/forge-1.21.1-52.1.6-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.1-52.1.3-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.1-52.1.6-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -701,18 +816,64 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.3/forge-1.21.1-52.1.3-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.6/forge-1.21.1-52.1.6-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.1-52.1.3-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.1-52.1.6-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 NeoForge Quick Server Setup, Mod Support for Linux", + "title": "[NeoForge] Minecraft 1.21.10", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.10.32-beta/neoforge-21.10.32-beta-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.10.32-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 NeoForge Quick Server Setup, Mod Support for Windows", + "title": "[NeoForge] Minecraft 1.21.10", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.10.32-beta/neoforge-21.10.32-beta-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.10.32-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "Linux", "language": "en_us", @@ -725,13 +886,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.47/neoforge-21.8.47-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.48/neoforge-21.8.48-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.8.47-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.8.48-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -748,13 +909,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.47/neoforge-21.8.47-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.48/neoforge-21.8.48-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": ".\\run.bat", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.8.47-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.8.48-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -771,13 +932,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.154/neoforge-21.4.154-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.155/neoforge-21.4.155-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.4.154-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.4.155-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -794,13 +955,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.154/neoforge-21.4.154-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.155/neoforge-21.4.155-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": ".\\run.bat", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.4.154-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.4.155-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -817,13 +978,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.209/neoforge-21.1.209-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.213/neoforge-21.1.213-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.1.209-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.1.213-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -840,18 +1001,41 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.209/neoforge-21.1.209-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.213/neoforge-21.1.213-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": ".\\run.bat", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.1.209-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.1.213-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 Fabric Quick Server Setup, Mod Support", + "title": "[FabricMC] Minecraft 1.21.10", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.10 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "ALL", "language": "en_us", @@ -922,6 +1106,29 @@ } }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Standard Vanilla Minecraft 1.21.10 Server Setup (Official) - No Mod/Plugin Support", + "title": "[Vanilla] Minecraft 1.21.10", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/95495a7f485eedd84ce928cef5e223b757d2f764/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "ALL", "language": "en_us", From 09c55c52e8bfc1d201d4832b3a420e62fb71381b Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sat, 8 Nov 2025 16:42:37 +0800 Subject: [PATCH 421/463] chore: sync script --- setup.sh | 347 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 182 insertions(+), 165 deletions(-) diff --git a/setup.sh b/setup.sh index daa248e..469b21a 100644 --- a/setup.sh +++ b/setup.sh @@ -1,11 +1,27 @@ #!/bin/bash -# Official installation script. - -mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" +# Official MCSManager installation script. +# This script installs or updates the MCSManager Web and/or Daemon to the latest version. +# ------------------------------------------------------------------------------ +# Supported Linux distributions: +# This script supports the following mainstream Linux distributions: +# - Ubuntu: 18.04, 20.04, 22.04, 24.04 +# - Debian: 10, 11, 12, 13 +# - CentOS: 7, 8 Stream, 9 Stream, 10 Stream +# - RHEL: 7, 8, 9, 10 +# - Arch Linux: Support planned (TBD) +# ------------------------------------------------------------------------------ + +# Target installation directory (can be overridden with --install-dir) +install_dir="/opt/mcsmanager" + +# Primary download URL bas. Full package URL = download_base_url + package_name +download_base_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" + +# Fallback download URL (can also be a local directory or mirror) +download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" + +# Name of the release package to download/detect package_name="mcsmanager_linux_release.tar.gz" -node="v20.12.2" -arch=$(uname -m) # Node.js version to be installed # Keep the leading "v" @@ -83,7 +99,18 @@ supported_os["CentOS"]="7 8 8-stream 9-stream 10-stream" supported_os["RHEL"]="7 8 9 10" supported_os["Arch"]="rolling" -printf "\033c" +# Required system commands for installation +# These will be checked before logic process +required_commands=( + chmod + chown + wget + tar + stat + useradd + usermod + date +) # Node.js related sections # Enable strict version checking (exact match) @@ -154,11 +181,22 @@ safe_run() { fi } -# script info -echo_cyan "+---------------------------------------------------------------------- -| MCSManager Installer -+---------------------------------------------------------------------- -" +# Function to ensure the script is run as root +check_root() { + # Using Bash's built-in EUID variable + if [ -n "$EUID" ]; then + if [ "$EUID" -ne 0 ]; then + cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." + exit 1 + fi + else + # Fallback to using id -u if EUID is unavailable (e.g., non-Bash shell or misconfigured environment) + if [ "$(id -u)" -ne 0 ]; then + cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." + exit 1 + fi + fi +} # Function to check whether current terminal support color & style detect_terminal_capabilities() { @@ -489,68 +527,90 @@ check_required_commands() { return 0 } - rm -irf "$node_install_path" - - cd /opt || Red_Error "[x] Failed to enter /opt" - - rm -rf "node-$node-linux-$arch.tar.gz" +# Print with specified color and style, fallback to RESET if not supported. +# Supported colors*: black|red|green|yellow|blue|magenta|cyan|white +# Supported styles*: bold|underline|italic|clear_line|strikethrough +# *Note: some style may not necessarily work on all terminals. +# Example usage: +# cprint green bold "Installation completed successfully." +# cprint red underline "Failed to detect required command: wget" +# cprint yellow "Warning: Disk space is low." +# cprint underline "Failed to detect required command: wget" +# cprint bold green underline"Installation completed successfully." + +cprint() { + local color="" + local text="" + local styles="" + local disable_prefix=false + local disable_newline=false + + while [[ $# -gt 1 ]]; do + case "$1" in + black|red|green|yellow|blue|magenta|cyan|white) + color="$1" + ;; + bold|underline|italic|clear_line|strikethrough) + styles+="${STYLES[$1]}" + ;; + noprefix) + disable_prefix=true + ;; + nonl) + disable_newline=true + ;; + esac + shift + done - wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + text="$1" - tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" + local prefix_text="" + if [[ "$disable_prefix" != true ]]; then + local timestamp="[$(date +%H:%M:%S)]" + local label="[MCSM Installer]" + prefix_text="${FG_COLORS[white]}$timestamp $label${RESET} " + fi - rm -rf "node-$node-linux-$arch.tar.gz" + local prefix="" + if [[ -n "$color" && "$SUPPORTS_COLOR" = true ]]; then + prefix+="${FG_COLORS[$color]}" + fi + if [[ "$SUPPORTS_STYLE" = true || "$styles" == *"${STYLES[clear_line]}"* ]]; then + prefix="$styles$prefix" + fi - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Success" + if [[ "$disable_newline" == true ]]; then + printf "%b%b%s%b" "$prefix_text" "$prefix" "$text" "$RESET" else - Red_Error "[x] Node installation failed!" + printf "%b%b%s%b\n" "$prefix_text" "$prefix" "$text" "$RESET" fi - - echo - echo_yellow "=============== Node.JS Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" - echo - - sleep 3 } -Install_MCSManager() { - echo_cyan "[+] Install MCSManager..." - - # stop service - systemctl disable --now mcsm-{web,daemon} - - # delete service - rm -rf /etc/systemd/system/mcsm-{daemon,web}.service - systemctl daemon-reload - mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] Failed to create ${mcsmanager_install_path}" - # cd /opt/mcsmanager - cd "${mcsmanager_install_path}" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}" - # download MCSManager release - wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] Failed to download MCSManager" - tar -zxf ${package_name} -o || Red_Error "[x] Failed to untar ${package_name}" - rm -rf "${mcsmanager_install_path}/${package_name}" - - # compatible with tar.gz packages of different formats - if [ -d "/opt/mcsmanager/mcsmanager" ]; then - cp -rf /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ - rm -rf /opt/mcsmanager/mcsmanager +# Permission check before proceed with installation +permission_barrier() { + if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then + cprint cyan "No components currently installed — skipping permission check." + return 0 fi - # echo "[→] cd daemon" - cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/daemon" + for component in web daemon; do + local is_installed_var="${component}_installed" + local installed_user_var="${component}_installed_user" - echo_cyan "[+] Install MCSManager-Daemon dependencies..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" + if [[ "${!is_installed_var}" == true ]]; then + local installed_user="${!installed_user_var}" - # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] Failed to enter ${mcsmanager_install_path}/web" + # Step 0: Ensure installed user is detected + if [[ -z "$installed_user" ]]; then + cprint red bold "Detected that '$component' is installed but could not determine the user from its systemd service file." + cprint red "This may indicate a custom or unsupported service file setup." + cprint red "Refusing to proceed to avoid potential conflicts." + exit 1 + fi # Step 1: User match check with optional force override if [[ "$installed_user" != "$install_user" ]]; then @@ -574,15 +634,14 @@ Install_MCSManager() { fi done - echo - echo_yellow "=============== MCSManager ===============" - echo_green "Daemon: ${mcsmanager_install_path}/daemon" - echo_green "Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager installation success!" + # Step 2: Directory ownership check + local dir_owner + dir_owner=$(stat -c '%U' "$install_dir" 2>/dev/null) - chmod -R 755 "$mcsmanager_install_path" + if [[ -z "$dir_owner" ]]; then + cprint red bold "Unable to determine owner of install_dir: $install_dir" + exit 1 + fi if [[ "$dir_owner" != "$install_user" ]]; then if [[ "$force_permission" == true ]]; then @@ -607,8 +666,6 @@ Install_MCSManager() { return 0 } -Create_Service() { - echo_cyan "[+] Create MCSManager service..." # Map OS arch with actual Node.js Arch name @@ -1050,113 +1107,73 @@ Description=MCSManager-${component^} After=network.target [Service] -WorkingDirectory=${mcsmanager_install_path}/daemon -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" +Type=simple +WorkingDirectory=${working_dir} +ExecStart=${exec} +ExecReload=/bin/kill -s HUP \$MAINPID +ExecStop=/bin/kill -s TERM \$MAINPID +Restart=on-failure +User=${install_user} +Environment="PATH=${PATH}" +Environment="NODE_ENV=production" [Install] WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service +EOF - echo "[Unit] -Description=MCSManager-Web - -[Service] -WorkingDirectory=${mcsmanager_install_path}/web -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" + if [[ $? -ne 0 ]]; then + cprint red bold "Failed to write service file: $service_path" + cleanup_install_tmp + return 1 + fi -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-web.service - - systemctl daemon-reload - systemctl enable --now mcsm-{daemon,web}.service - echo_green "Registered!" - - sleep 2 - - printf "\n\n\n\n" - - echo_yellow "==================================================================" - echo_green "Installation is complete! Welcome to the MCSManager!!!" - echo_yellow " " - echo_cyan_n "HTTP Web Service: " - echo_yellow "http://:23333 (Browser)" - echo_cyan_n "Daemon Address: " - echo_yellow "ws://:24444 (Cluster)" - echo_red "You must expose ports " - echo_yellow "23333" - echo_red " and " - echo_yellow "24444" - echo_red " to use the service properly on the Internet." - echo_yellow " " - echo_cyan "Usage:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "Official Document: https://docs.mcsmanager.com/" - echo_yellow "==================================================================" + chmod 644 "$service_path" + cprint green "Created systemd unit: $service_path" + return 0 } -# Environmental inspection -if [[ "$arch" == x86_64 ]]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [[ $arch == aarch64 ]]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [[ $arch == arm ]]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [[ $arch == ppc64le ]]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [[ $arch == s390x ]]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - Red_Error "[x] Sorry, this architecture is not supported yet!\n[x]Please try to install manually: https://github.com/MCSManager/MCSManager#linux" -fi +# Extract daemon key and/or http port +extract_component_info() { + # DAEMON SECTION + if [[ "$install_daemon" == true ]]; then + local daemon_service="mcsm-daemon.service" + local daemon_path="${install_dir}/daemon" + local daemon_config_path="${daemon_path}/${daemon_key_config_subpath}" cprint cyan bold "Starting daemon service..." if systemctl restart "$daemon_service"; then cprint green "Daemon service started." -# Check network connection -echo_cyan "[-] Architecture: $arch" - -# Install related software -echo_cyan_n "[+] Installing dependent software (git, tar, wget)... " -if [[ -x "$(command -v yum)" ]]; then - yum install -y git tar wget -elif [[ -x "$(command -v apt-get)" ]]; then - apt-get install -y git tar wget -elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm --needed git tar wget -elif [[ -x "$(command -v zypper)" ]]; then - zypper --non-interactive install git tar wget -else - echo_red "[!] Cannot find your package manager! You may need to install git, tar and wget manually!" -fi - -# Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "Success" -else - Red_Error "[x] Failed to find git, tar and wget, please install them manually!" -fi - -# Install the Node environment -Install_Node - -# Install MCSManager -Install_MCSManager + sleep 1 # Allow service to init and write configs + + if [[ -f "$daemon_config_path" ]]; then + daemon_key=$(grep -oP '"key"\s*:\s*"\K[^"]+' "$daemon_config_path") + daemon_port=$(grep -oP '"port"\s*:\s*\K[0-9]+' "$daemon_config_path") + + if [[ -n "$daemon_key" ]]; then + cprint green "Extracted daemon key: $daemon_key" + else + cprint red "Failed to extract daemon key from: $daemon_config_path" + fi + + if [[ -n "$daemon_port" ]]; then + cprint green "Extracted daemon port: $daemon_port" + else + cprint red "Failed to extract daemon port from: $daemon_config_path" + fi + else + cprint red "Daemon config file not found: $daemon_config_path" + fi + else + cprint red bold "Failed to start daemon service: $daemon_service" + fi + fi + + # WEB SECTION + if [[ "$install_web" == true ]]; then + local web_service="mcsm-web.service" + local web_path="${install_dir}/web" + local web_config_path="${web_path}/${web_port_config_subpath}" cprint cyan bold "Starting web service..." if systemctl restart "$web_service"; then @@ -1365,4 +1382,4 @@ main() { safe_run install_mcsm "Failed to install MCSManager" } -main "$@" +main "$@" \ No newline at end of file From 73255711cca23ad50ce4dfc19cc2fcd45d2388f5 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sat, 8 Nov 2025 16:46:34 +0800 Subject: [PATCH 422/463] chore: sync script --- setup_cn.sh | 1520 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 1330 insertions(+), 190 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index e7ec82b..30955f4 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1,245 +1,1385 @@ #!/bin/bash -# This script file is specifically designed for the Chinese region, and servers in the Chinese region are used to accelerate file downloads. +# Official MCSManager installation script. +# This script installs or updates the MCSManager Web and/or Daemon to the latest version. +# ------------------------------------------------------------------------------ +# Supported Linux distributions: +# This script supports the following mainstream Linux distributions: +# - Ubuntu: 18.04, 20.04, 22.04, 24.04 +# - Debian: 10, 11, 12, 13 +# - CentOS: 7, 8 Stream, 9 Stream, 10 Stream +# - RHEL: 7, 8, 9, 10 +# - Arch Linux: Support planned (TBD) +# ------------------------------------------------------------------------------ -mcsmanager_install_path="/opt/mcsmanager" -mcsmanager_download_addr="https://download.mcsmanager.com/mcsmanager_linux_release.tar.gz" +# Target installation directory (can be overridden with --install-dir) +install_dir="/opt/mcsmanager" + +# Primary download URL bas. Full package URL = download_base_url + package_name +download_base_url="https://download.mcsmanager.com/" + +# Fallback download URL (can also be a local directory or mirror) +download_fallback_url="https://download.mcsmanager.com/" + +# Name of the release package to download/detect package_name="mcsmanager_linux_release.tar.gz" -node="v20.12.2" -arch=$(uname -m) -if [ "$(id -u)" -ne 0 ]; then - echo "此脚本必须以 root 身份运行,请使用“sudo bash”代替" - exit 1 -fi +# Node.js version to be installed +# Keep the leading "v" +node_version="v20.12.2" + +# Node download base URL - primary +node_download_url_base="https://nodejs.org/dist/" + +# Node download URL - fallback. +# This is the URL points directly to the file, not the base. This can also be a local absolute path. +# Only supports https:// or http:// for web locations. +node_download_fallback="" + +# Node.js installation path (defaults to the MCSManager installation path. Can be overridden with --node-install-dir) +node_install_dir="$install_dir" + +# Temp dir for file extraction +tmp_dir="/tmp" + +# Bypass installed user permission check, override by --force-permission +force_permission=false + + +# --------------- Global Variables ---------------# +# DO NOT MODIFY # + + +# Component installation options. +# For fresh installs, both daemon and web components are installed by default. +# For updates, behavior depends on detected existing components. +# Can be overridden with --install daemon/web/all +install_daemon=true +install_web=true + +# Install MCSM as (default: root). +# To install as a general user (e.g., "mcsm"), use the --user option: --user mcsm +# To ensure compatibility, only user mcsm is supported. +install_user="root" +# Installed user, for permission check +web_installed=false +daemon_installed=false +web_installed_user="" +daemon_installed_user="" + +# Service file locations +# the final dir = systemd_file + {web/daemon} + ".service" +systemd_file="/etc/systemd/system/mcsm-" +# Optional: Override the default installation source file. +# If --install-source is specified, the installer will use the provided +# "mcsmanager_linux_release.tar.gz" file instead of downloading it. +# Only support local absolute path. +install_source_path="" + +# temp path for extracted file(s) +install_tmp_dir="/opt/mcsmanager/mcsm_abcd" + +# dir name for data dir backup +# e.g. /opt/mcsmanager/daemon/data -> /opt/mcsmanager/data_bak_data +# only valid for when during an update +backup_prefix="data_bak_" + +# System architecture (detected automatically) +arch="" +version="" +distro="" -printf "\033c" -echo_cyan() { - printf '\033[1;36m%b\033[0m\n' "$@" + +# Supported OS versions (map-style structure) +# Format: supported_os["distro_name"]="version1 version2 version3 ..." +declare -A supported_os +supported_os["Ubuntu"]="18 20 22 24" +supported_os["Debian"]="10 11 12 13" +supported_os["CentOS"]="7 8 8-stream 9-stream 10-stream" +supported_os["RHEL"]="7 8 9 10" +supported_os["Arch"]="rolling" + +# Required system commands for installation +# These will be checked before logic process +required_commands=( + chmod + chown + wget + tar + stat + useradd + usermod + date +) + +# Node.js related sections +# Enable strict version checking (exact match) +# enabled -> strict requriement for defined node version +# false -> newer version allowed +# Older version is NEVER allowed +strict_node_version_check=true + +# Will be set based on actual node status +install_node=true +# Remove leading "v" from defined version +required_node_ver="${node_version#v}" + +# Holds absolute path for node & npm +node_bin_path="" +npm_bin_path="" +# Hold Node.js arch name, e.g. x86_64 -> x64 +node_arch="" +# Hold Node.js intallation path, e.g. ${node_install_dir}/node-${node_version}-linux-${arch} +node_path="" + +# For installation result +daemon_key="" +daemon_port="" +web_port="" +daemon_key_config_subpath="data/Config/global.json" +web_port_config_subpath="data/SystemConfig/config.json" + +# Terminal color & style related +# Default to false, auto check later +SUPPORTS_COLOR=false +SUPPORTS_STYLE=false +# Declare ANSI reset +RESET="\033[0m" + +# Foreground colors +declare -A FG_COLORS=( + [black]="\033[0;30m" + [red]="\033[0;31m" + [green]="\033[0;32m" + [yellow]="\033[0;33m" + [blue]="\033[0;34m" + [magenta]="\033[0;35m" + [cyan]="\033[0;36m" + [white]="\033[0;37m" +) + +# Font styles +declare -A STYLES=( + [bold]="\033[1m" + [underline]="\033[4m" + [italic]="\033[3m" # Often ignored + [clear_line]="\r\033[2K" + [strikethrough]="\033[9m" +) + + +### Helper Functions +# Execution wrapper, avoid unexpected crashes. +safe_run() { + local func="$1" + local err_msg="$2" + shift 2 + + if ! "$func" "$@"; then + echo "Error: $err_msg" + exit 1 + fi } -echo_red() { - printf '\033[1;31m%b\033[0m\n' "$@" + +# Function to ensure the script is run as root +check_root() { + # Using Bash's built-in EUID variable + if [ -n "$EUID" ]; then + if [ "$EUID" -ne 0 ]; then + cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." + exit 1 + fi + else + # Fallback to using id -u if EUID is unavailable (e.g., non-Bash shell or misconfigured environment) + if [ "$(id -u)" -ne 0 ]; then + cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." + exit 1 + fi + fi } -echo_green() { - printf '\033[1;32m%b\033[0m\n' "$@" + +# Function to check whether current terminal support color & style +detect_terminal_capabilities() { + SUPPORTS_COLOR=false + SUPPORTS_STYLE=false + + if [ -t 1 ] && command -v tput >/dev/null 2>&1; then + if [ "$(tput colors)" -ge 8 ]; then + SUPPORTS_COLOR=true + fi + if tput bold >/dev/null 2>&1 && tput smul >/dev/null 2>&1; then + SUPPORTS_STYLE=true + fi + fi + + if [ "$SUPPORTS_COLOR" = true ]; then + cprint green "[OK] Terminal supports colored output." + else + cprint yellow "Note: Terminal does not support colored output. Continuing without formatting." + fi + + if [ "$SUPPORTS_STYLE" = true ]; then + cprint green "[OK] Terminal supports bold and underline formatting." + else + cprint yellow "Note: Terminal does not support advanced text styles." + fi } -echo_cyan_n() { - printf '\033[1;36m%b\033[0m' "$@" + +# Check whether daemon or web is installed +is_component_installed() { + local component_name="$1" + local component_path="${install_dir}/${component_name}" + + if [[ -d "$component_path" ]]; then + cprint green "Component '$component_name' is already installed at $component_path" + + # Set corresponding global variable + if [[ "$component_name" == "daemon" ]]; then + daemon_installed=true + elif [[ "$component_name" == "web" ]]; then + web_installed=true + fi + + return 0 + else + cprint yellow "Component '$component_name' is not installed" + + # Set corresponding global variable + if [[ "$component_name" == "daemon" ]]; then + daemon_installed=false + elif [[ "$component_name" == "web" ]]; then + web_installed=false + fi + + return 1 + fi } -echo_yellow() { - printf '\033[1;33m%b\033[0m\n' "$@" + +check_component_permission() { + local component="$1" + local service_file="${systemd_file}${component}.service" + + if [[ ! -f "$service_file" ]]; then + cprint yellow "Service file not found: $service_file" + return 0 # nothing changed + fi + + # Extract the User= line if it exists + local user_line + user_line=$(grep -E '^User=' "$service_file" 2>/dev/null | head -1) + + local user + if [[ -z "$user_line" ]]; then + user="root" # default if no User= is defined + else + user="${user_line#User=}" + fi + + # Validate user + if [[ "$user" != "root" && "$user" != "mcsm" ]]; then + cprint red bold "Unsupported user '$user' in $service_file. Expected 'root' or 'mcsm'." + exit 1 + fi + + # Assign to appropriate global + if [[ "$component" == "web" ]]; then + web_installed_user="$user" + elif [[ "$component" == "daemon" ]]; then + daemon_installed_user="$user" + fi + + cprint cyan "Detected $component installed as user: $user" + return 0 } -# script info -echo_cyan "+---------------------------------------------------------------------- -| MCSManager 安装脚本 (MCSManager Installer) -+---------------------------------------------------------------------- -" -Red_Error() { - echo '=================================================' - printf '\033[1;31;40m%b\033[0m\n' "$@" - echo '=================================================' - exit 1 + +parse_args() { + local explicit_install_flag=false + + while [[ $# -gt 0 ]]; do + case "$1" in + --install-dir) + if [[ -n "$2" ]]; then + install_dir="$2" + shift 2 + else + echo "Error: --install-dir requires a path argument." + exit 1 + fi + ;; + --node-install-dir) + if [[ -n "$2" ]]; then + node_install_dir="$2" + shift 2 + else + echo "Error: --node-install-dir requires a path argument." + exit 1 + fi + ;; + --install) + explicit_install_flag=true + if [[ -n "$2" && "$2" != --* ]]; then + case "$2" in + daemon) + install_daemon=true + is_component_installed "daemon" + install_web=false + check_component_permission "daemon" + ;; + web) + install_daemon=false + is_component_installed "web" + install_web=true + check_component_permission "web" + ;; + all) + install_daemon=true + install_web=true + is_component_installed "daemon" + is_component_installed "web" + check_component_permission "daemon" + check_component_permission "web" + ;; + *) + echo "Error: Invalid value for --install. Expected 'daemon', 'web', or 'all'." + echo "Usage: --install daemon|web|all" + exit 1 + ;; + esac + shift 2 + else + echo "Error: --install flag provided but no value. Please specify: daemon, web, or all." + echo "Usage: --install daemon|web|all" + exit 1 + fi + ;; + --user) + if [[ -n "$2" ]]; then + case "$2" in + root) + install_user="root" + ;; + mcsm) + install_user="mcsm" + ;; + *) + echo "Error: Invalid user '$2'. Only 'root' and 'mcsm' are supported." + echo "Usage: --user root|mcsm" + exit 1 + ;; + esac + shift 2 + else + echo "Error: --user requires a value (root or mcsm)." + exit 1 + fi + ;; + --install-source) + if [[ -n "$2" ]]; then + install_source_path="$2" + shift 2 + else + echo "Error: --install-source requires a file path." + exit 1 + fi + ;; + --force-permission) + force_permission=true + shift + ;; + *) + echo "Error: Unknown argument: $1" + exit 1 + ;; + esac + done + + # Auto-detect branch: only run if --install was not explicitly passed + if [[ "$explicit_install_flag" == false ]]; then + daemon_installed=false + web_installed=false + + if is_component_installed "daemon"; then + daemon_installed=true + check_component_permission "daemon" + fi + if is_component_installed "web"; then + web_installed=true + check_component_permission "web" + fi + + # When only one component installed, we wanted to process that one only. + if [[ "$daemon_installed" == true && "$web_installed" == false ]]; then + install_daemon=true + install_web=false + elif [[ "$daemon_installed" == false && "$web_installed" == true ]]; then + install_daemon=false + install_web=true + else + install_daemon=true + install_web=true + fi + fi +} + + +# Get Distribution & Architecture Info +detect_os_info() { + distro="Unknown" + version="Unknown" + arch=$(uname -m) + + # Try primary source + if [ -f /etc/os-release ]; then + . /etc/os-release + distro_id="${ID,,}" + version_id="${VERSION_ID,,}" + + case "$distro_id" in + ubuntu) + distro="Ubuntu" + version="$version_id" + ;; + debian) + distro="Debian" + version="$version_id" + ;; + centos) + distro="CentOS" + version="$version_id" + ;; + rhel*) + distro="RHEL" + version="$version_id" + ;; + arch) + distro="Arch" + version="rolling" + ;; + *) + distro="${ID:-Unknown}" + version="$version_id" + ;; + esac + fi + + # Fallbacks for missing or invalid version + if [[ -z "$version" || "$version" == "unknown" || "$version" == "" ]]; then + if [ -f /etc/issue ]; then + version_guess=$(grep -oP '[0-9]+(\.[0-9]+)*' /etc/issue | head -1) + if [[ -n "$version_guess" ]]; then + version="$version_guess" + fi + fi + fi + + # Normalize version: keep only major version + version_full="$version" + if [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then + version="${version%%.*}" + else + echo "Warning: Could not detect a clean numeric version. Defaulting to unknown." + version="unknown" + fi + + cprint cyan "Detected OS: $distro $version_full" + cprint cyan "Detected Architecture: $arch" +} + + +# Check if current OS is supported +check_supported_os() { + local supported_versions="${supported_os[$distro]}" + + if [[ -z "$supported_versions" ]]; then + echo "Error: Distribution '$distro' is not supported by this installer." + return 1 + fi + + if [[ "$supported_versions" != *"$version"* ]]; then + echo "Error: Version '$version' of '$distro' is not supported." + echo "Supported versions are: $supported_versions" + return 1 + fi + + cprint green "OS compatibility check passed." + return 0 } -Install_Node() { - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Node.js version is up-to-date, skipping installation." - return +# Check if all required commands are available +check_required_commands() { + local missing=0 + + for cmd in "${required_commands[@]}"; do + if ! command -v "$cmd" >/dev/null 2>&1; then + echo "Error: Required command '$cmd' is not available in PATH." + missing=1 + fi + done + + if [ "$missing" -ne 0 ]; then + echo "One or more required commands are missing. Please install them and try again." + return 1 fi - echo_cyan "[+] 正在安装 Node.JS..." + cprint green "All required commands are available." + return 0 +} - rm -irf "$node_install_path" +# Print with specified color and style, fallback to RESET if not supported. +# Supported colors*: black|red|green|yellow|blue|magenta|cyan|white +# Supported styles*: bold|underline|italic|clear_line|strikethrough +# *Note: some style may not necessarily work on all terminals. +# Example usage: +# cprint green bold "Installation completed successfully." +# cprint red underline "Failed to detect required command: wget" +# cprint yellow "Warning: Disk space is low." +# cprint underline "Failed to detect required command: wget" +# cprint bold green underline"Installation completed successfully." - cd /opt || Red_Error "[x] 未能进入 /opt 目录" +cprint() { + local color="" + local text="" + local styles="" + local disable_prefix=false + local disable_newline=false - rm -rf "node-$node-linux-$arch.tar.gz" + while [[ $# -gt 1 ]]; do + case "$1" in + black|red|green|yellow|blue|magenta|cyan|white) + color="$1" + ;; + bold|underline|italic|clear_line|strikethrough) + styles+="${STYLES[$1]}" + ;; + noprefix) + disable_prefix=true + ;; + nonl) + disable_newline=true + ;; + esac + shift + done - # wget "https://nodejs.org/dist/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" - wget "https://registry.npmmirror.com/-/binary/node/$node/node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to download node release" + text="$1" - tar -zxf "node-$node-linux-$arch.tar.gz" || Red_Error "[x] Failed to untar node" + local prefix_text="" + if [[ "$disable_prefix" != true ]]; then + local timestamp="[$(date +%H:%M:%S)]" + local label="[MCSM Installer]" + prefix_text="${FG_COLORS[white]}$timestamp $label${RESET} " + fi - rm -rf "node-$node-linux-$arch.tar.gz" + local prefix="" + if [[ -n "$color" && "$SUPPORTS_COLOR" = true ]]; then + prefix+="${FG_COLORS[$color]}" + fi + if [[ "$SUPPORTS_STYLE" = true || "$styles" == *"${STYLES[clear_line]}"* ]]; then + prefix="$styles$prefix" + fi - if [[ -f "$node_install_path"/bin/node ]] && [[ "$("$node_install_path"/bin/node -v)" == "$node" ]]; then - echo_green "Success" + if [[ "$disable_newline" == true ]]; then + printf "%b%b%s%b" "$prefix_text" "$prefix" "$text" "$RESET" else - Red_Error "[x] Node.js 安装失败!" + printf "%b%b%s%b\n" "$prefix_text" "$prefix" "$text" "$RESET" + fi +} + + + + +# Permission check before proceed with installation +permission_barrier() { + if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then + cprint cyan "No components currently installed — skipping permission check." + return 0 + fi + + for component in web daemon; do + local is_installed_var="${component}_installed" + local installed_user_var="${component}_installed_user" + + if [[ "${!is_installed_var}" == true ]]; then + local installed_user="${!installed_user_var}" + + # Step 0: Ensure installed user is detected + if [[ -z "$installed_user" ]]; then + cprint red bold "Detected that '$component' is installed but could not determine the user from its systemd service file." + cprint red "This may indicate a custom or unsupported service file setup." + cprint red "Refusing to proceed to avoid potential conflicts." + exit 1 + fi + + # Step 1: User match check with optional force override + if [[ "$installed_user" != "$install_user" ]]; then + if [[ "$force_permission" == true ]]; then + cprint yellow bold "Permission mismatch for '$component':" + cprint yellow "Installed as user: $installed_user" + cprint yellow "Target install user: $install_user" + cprint yellow "User mismatch, but --force-permission is set. Continuing and updating permissions..." + sleep 3 + else + cprint red bold "Permission mismatch for '$component':" + cprint red "Installed as user: $installed_user" + cprint red "Current install target user: $install_user" + cprint red "Unable to proceed due to ownership conflict. Use --force-permission to override and update file permission." + exit 1 + fi + else + cprint green bold "Permission check passed: '$installed_user' matches target user." + fi + + fi + done + + # Step 2: Directory ownership check + local dir_owner + dir_owner=$(stat -c '%U' "$install_dir" 2>/dev/null) + + if [[ -z "$dir_owner" ]]; then + cprint red bold "Unable to determine owner of install_dir: $install_dir" + exit 1 fi - echo - echo_yellow "=============== Node.JS Version ===============" - echo_yellow " node: $("$node_install_path"/bin/node -v)" - echo_yellow " npm: v$(env "$node_install_path"/bin/node "$node_install_path"/bin/npm -v)" - echo_yellow "=============== Node.JS Version ===============" - echo + if [[ "$dir_owner" != "$install_user" ]]; then + if [[ "$force_permission" == true ]]; then + cprint yellow bold "Install directory ownership mismatch:" + cprint yellow " Directory: $install_dir" + cprint yellow " Owned by: $dir_owner" + cprint yellow " Expected: $install_user" + cprint yellow " --force-permission is set. Continuing despite mismatch." + sleep 3 + else + cprint red bold "Install directory ownership mismatch:" + cprint red " Directory: $install_dir" + cprint red " Owned by: $dir_owner" + cprint red " Expected: $install_user" + exit 1 + fi + else + cprint green bold "Install directory ownership check passed: '$install_dir' is owned by '$install_user'." + fi - sleep 3 + cprint green bold "Permissions and ownership validated. Proceeding." + return 0 } -Install_MCSManager() { - echo_cyan "[+] 安装 MCSManager..." - # stop service - systemctl disable --now mcsm-{web,daemon} - # delete service - rm -rf /etc/systemd/system/mcsm-{daemon,web}.service - systemctl daemon-reload +# Map OS arch with actual Node.js Arch name +# This function should be placed after var arch has been assigned a valid value. +resolve_node_arch() { + case "$arch" in + x86_64) + node_arch="x64" + ;; + aarch64) + node_arch="arm64" + ;; + armv7l) + node_arch="armv7l" + ;; + *) + cprint red bold "Unsupported architecture for Node.js: $arch" + return 1 + ;; + esac + + # Assign node_path based on resolved arch and current version/install dir + node_path="${node_install_dir}/node-${node_version}-linux-${node_arch}" + + cprint cyan "Resolved Node.js architecture: $node_arch" + cprint cyan "Node.js install path: $node_path" +} + +# Check if Node.js at PATH is valid. +# This function check Node.js version + NPM (if Node.js valid) +verify_node_at_path() { + local node_path="$1" + node_bin_path="$node_path/bin/node" + npm_bin_path="$node_path/bin/npm" - mkdir -p "${mcsmanager_install_path}" || Red_Error "[x] 未能创建 ${mcsmanager_install_path}" + # Node binary missing + if [ ! -x "$node_bin_path" ]; then + return 1 + fi - # cd /opt/mcsmanager - cd "${mcsmanager_install_path}" || Red_Error "[x] 未能进入 ${mcsmanager_install_path}" + local installed_ver + installed_ver="$("$node_bin_path" -v 2>/dev/null | sed 's/^v//')" - # download MCSManager release - wget "${mcsmanager_download_addr}" -O "${package_name}" || Red_Error "[x] 未能成功下载 MCSManager" - tar -zxf ${package_name} -o || Red_Error "[x] 未能成功解压 ${package_name}" - rm -rf "${mcsmanager_install_path}/${package_name}" + if [[ -z "$installed_ver" ]]; then + return 1 + fi - # compatible with tar.gz packages of different formats - if [ -d "/opt/mcsmanager/mcsmanager" ]; then - cp -rf /opt/mcsmanager/mcsmanager/* /opt/mcsmanager/ - rm -rf /opt/mcsmanager/mcsmanager + if [ "$strict_node_version_check" = true ]; then + if [[ "$installed_ver" != "$required_node_ver" ]]; then + return 3 + fi + else + local cmp + cmp=$(printf "%s\n%s\n" "$required_node_ver" "$installed_ver" | sort -V | head -1) + if [[ "$cmp" != "$required_node_ver" ]]; then + return 2 + fi fi - # echo "[→] cd daemon" - cd "${mcsmanager_install_path}/daemon" || Red_Error "[x] 未能进入 ${mcsmanager_install_path}/daemon" + # Check if npm exists and works using node (not $PATH/npm) + if [ ! -x "$npm_bin_path" ]; then + return 4 + fi - echo_cyan "[+] 正在安装 MCSManager-Daemon 依赖库..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] Failed to npm install in ${mcsmanager_install_path}/daemon" + # Use node to run npm.js directly, in case env is broken + local npm_version + npm_version="$("$node_bin_path" "$npm_bin_path" --version 2>/dev/null)" + if [[ -z "$npm_version" ]]; then + return 4 + fi - # echo "[←] cd .." - cd "${mcsmanager_install_path}/web" || Red_Error "[x] 未能进入 ${mcsmanager_install_path}/web" + return 0 +} - echo_cyan "[+] 正在安装 MCSManager-Web 依赖库..." - env "$node_install_path"/bin/node "$node_install_path"/bin/npm install --registry=https://registry.npmmirror.com --production --no-fund --no-audit &>/dev/null || Red_Error "[x] 未能在以下目录使用npm install编译依赖库: ${mcsmanager_install_path}/web" - echo - echo_yellow "=============== MCSManager ===============" - echo_green "Daemon: ${mcsmanager_install_path}/daemon" - echo_green "Web: ${mcsmanager_install_path}/web" - echo_yellow "=============== MCSManager ===============" - echo - echo_green "[+] MCSManager 安装完成!" +# Node.js pre-check. check if we need to install Node.js before installer run. +# Use postcheck_node_after_install() to check after install. +check_node_installed() { + verify_node_at_path "$node_path" + local result=$? - chmod -R 755 "$mcsmanager_install_path" + case $result in + 0) + cprint green bold "Node.js and npm found at $node_path (version $required_node_ver or compatible)" + install_node=false + ;; + 1) + cprint yellow bold "Node.js binary not found or unusable at $node_path" + install_node=true + ;; + 2) + cprint red bold "Node.js version at $node_path is too old. Required: >= $required_node_ver" + install_node=true + ;; + 3) + cprint red bold "Node.js version mismatch. Required: $required_node_ver, found something else." + install_node=true + ;; + 4) + cprint red bold "Node.js is present but npm is missing or broken." + install_node=true + ;; + *) + cprint red bold "Unexpected error in node verification." + install_node=true + ;; + esac +} - sleep 3 +# Node.js post-check. check if Node.js is valid after install. +postcheck_node_after_install() { + verify_node_at_path "$node_path" + if [[ $? -ne 0 ]]; then + cprint red bold "Node.js installation failed or is invalid at $node_path" + return 1 + else + cprint green bold "Node.js is installed and functioning at $node_path" + return 0 + fi } -Create_Service() { - echo_cyan "[+] 创建 MCSManager 面板服务..." +# Install Node.js and check +install_node() { + local archive_name="node-${node_version}-linux-${node_arch}.tar.xz" + local target_dir="${node_install_dir}/node-${node_version}-linux-${node_arch}" + local archive_path="${node_install_dir}/${archive_name}" + local download_url="${node_download_url_base}${node_version}/${archive_name}" + local fallback="$node_download_fallback" - echo "[Unit] -Description=MCSManager-Daemon + cprint cyan bold "Installing Node.js $node_version for arch: $node_arch" -[Service] -WorkingDirectory=${mcsmanager_install_path}/daemon -ExecStart=${node_install_path}/bin/node app.js -ExecReload=/bin/kill -s QUIT \$MAINPID -ExecStop=/bin/kill -s QUIT \$MAINPID -Environment=\"PATH=${PATH}\" + mkdir -p "$node_install_dir" || { + cprint red bold "Failed to create node install directory: $node_install_dir" + return 1 + } -[Install] -WantedBy=multi-user.target -" >/etc/systemd/system/mcsm-daemon.service + # Download + cprint cyan "Downloading Node.js from: $download_url" + if ! wget --progress=bar:force -O "$archive_path" "$download_url"; then + cprint yellow "Primary download failed. Attempting fallback..." + + if [[ -n "$fallback" ]]; then + if [[ "$fallback" =~ ^https?:// ]]; then + cprint cyan "Downloading from fallback URL: $fallback" + if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then + cprint red bold "Fallback download failed from: $fallback" + return 1 + fi + elif [ -f "$fallback" ]; then + cprint cyan "Copying from local fallback: $fallback" + cp "$fallback" "$archive_path" || { + cprint red bold "Failed to copy fallback Node.js archive from $fallback" + return 1 + } + else + cprint red bold "Invalid fallback path: $fallback" + return 1 + fi + else + cprint red bold "No fallback source configured. Cannot proceed." + return 1 + fi + fi - echo "[Unit] -Description=MCSManager-Web + # Extract archive + cprint cyan "Extracting Node.js archive..." + if ! tar -xf "$archive_path" -C "$node_install_dir"; then + cprint red bold "Failed to extract Node.js archive." + return 1 + fi + + chmod -R a+rx "$target_dir" || { + cprint red bold "Failed to set execute permissions on Node.js files." + return 1 + } + + verify_node_at_path "$target_dir" + local result=$? + if [[ $result -ne 0 ]]; then + cprint red bold "Node.js installation failed verification." + return 1 + fi + + cprint cyan "Cleaning up archive..." + rm -f "$archive_path" + + cprint green bold "Node.js $node_version installed successfully at $target_dir" + # Save resolved binary paths to global variables + node_bin_path="${target_dir}/bin/node" + npm_bin_path="${target_dir}/bin/npm" + + cprint green "Node.js binary: $node_bin_path" + cprint green "npm binary: $npm_bin_path" + return 0 +} + +# Function to download MCSM package. fetch from primary URL first, then fallback URL. +# This function only put extracted file(s) into install_dir, it does not perform the actual update. +download_mcsm() { + local archive_name="$package_name" + local archive_path="${tmp_dir}/${archive_name}" + local primary_url="${download_base_url}${archive_name}" + local fallback="$download_fallback_url" + + cprint cyan bold "Downloading MCSManager package..." + + # Step 1: Try downloading from primary URL + if ! wget --progress=bar:force -O "$archive_path" "$primary_url"; then + cprint yellow "Primary download failed. Attempting fallback source..." + + if [[ -z "$fallback" ]]; then + cprint red bold "No fallback URL or path specified." + return 1 + fi + + if [[ "$fallback" =~ ^https?:// ]]; then + if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then + cprint red bold "Fallback download failed from $fallback" + return 1 + fi + elif [[ -f "$fallback" ]]; then + cp "$fallback" "$archive_path" || { + cprint red bold "Failed to copy fallback archive from $fallback" + return 1 + } + else + cprint red bold "Fallback path is invalid: $fallback" + return 1 + fi + fi + + # Step 2: Generate extract directory + local suffix + suffix=$(tr -dc 'a-z0-9' /dev/null; then + cprint green "User '$install_user' already exists." + else + cprint cyan "Creating system user: $install_user (nologin, no password)..." + if ! useradd --system --home "$install_dir" --shell /usr/sbin/nologin "$install_user"; then + cprint red bold "Failed to create user: $install_user" + exit 1 + fi + cprint green "User '$install_user' created." + fi + + + # Docker integration + if command -v docker &>/dev/null; then + cprint cyan "Docker is installed — checking group assignment..." + + if getent group docker &>/dev/null; then + if id -nG "$install_user" | grep -qw docker; then + cprint green "User '$install_user' is already in the 'docker' group." + else + cprint cyan "Adding user '$install_user' to 'docker' group..." + if usermod -aG docker "$install_user"; then + cprint green "Docker group access granted to '$install_user'." + else + cprint red "Failed to add '$install_user' to 'docker' group. Docker may not be usable by this user." + fi + fi + else + cprint red "Docker installed but 'docker' group not found. Skipping group assignment." + fi + else + cprint yellow "Docker not installed — skipping Docker group configuration." + fi + + return 0 +} +# Function to stop MCSM services if they exist +stop_mcsm_services() { + cprint yellow bold "Attempting to stop mcsm-web and mcsm-daemon services..." + + # Attempt to stop mcsm-web + cprint blue "Stopping mcsm-web..." + if systemctl stop mcsm-web; then + cprint green "mcsm-web stopped successfully." + else + cprint red bold "Warning: Failed to stop mcsm-web (may not exist or already stopped)." + fi + + # Attempt to stop mcsm-daemon + cprint blue "Stopping mcsm-daemon..." + if systemctl stop mcsm-daemon; then + cprint green "mcsm-daemon stopped successfully." + else + cprint red bold "Warning: Failed to stop mcsm-daemon (may not exist or already stopped)." + fi +} +# Prepare file & permissions before install. +mcsm_install_prepare() { + + # Stop service if existed + stop_mcsm_services + + if [[ ! -d "$install_tmp_dir" ]]; then + cprint red bold "install_tmp_dir does not exist: $install_tmp_dir" + exit 1 + fi + + cprint cyan "Changing ownership of $install_tmp_dir to user '$install_user'..." + chown -R "$install_user":"$install_user" "$install_tmp_dir" || { + cprint red bold "Failed to change ownership of $install_tmp_dir" + cleanup_install_tmp + exit 1 + } + + # Normalize install_dir to ensure it ends with a slash + [[ "${install_dir}" != */ ]] && install_dir="${install_dir}/" + + if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then + cprint cyan "No existing components detected — skipping data backup/cleanup." + return 0 + fi + + cprint green bold "Existing components prepared successfully." + return 0 +} + +# Install or update a component +install_component() { + local component="$1" + local target_path="${install_dir}${component}" + local backup_data_path="${install_dir}${backup_prefix}${component}" + local source_path="${install_tmp_dir}/mcsmanager/${component}" + + cprint cyan bold "Installing/Updating component: $component" + + # Step 1: Move new component to install_dir + if [[ ! -d "$source_path" ]]; then + cprint red bold "Source directory not found: $source_path" + cleanup_install_tmp + exit 1 + fi + + if cp -a "$source_path"/. "$target_path"; then + cprint green "Updated files from $source_path → $target_path" + rm -rf "$source_path" + else + cprint red bold "Failed to update files from $source_path → $target_path" + cleanup_install_tmp + exit 1 + fi + cprint green "Moved $component to $target_path" + + + # Step 3: Install NPM dependencies + if [[ ! -x "$npm_bin_path" ]]; then + cprint red bold "npm binary not found or not executable: $npm_bin_path" + cleanup_install_tmp + exit 1 + fi + + cprint cyan "Installing dependencies for $component using npm..." + pushd "$target_path" >/dev/null || { + cprint red bold "Failed to change directory to $target_path" + cleanup_install_tmp + exit 1 + } + + if ! "$node_bin_path" "$npm_bin_path" install --no-audit --no-fund --loglevel=warn; then + cprint red bold "NPM dependency installation failed for $component" + popd >/dev/null + cleanup_install_tmp + exit 1 + fi + + popd >/dev/null + cprint green bold "Component '$component' installed/updated successfully." +} + +# Create systemd service for a given component. +# This will overwrite the existing service file. +create_systemd_service() { + local component="$1" + local service_path="${systemd_file}${component}.service" + local working_dir="${install_dir}${component}" + local exec="${node_bin_path} app.js" + + if [[ ! -d "$working_dir" ]]; then + cprint red bold "Component directory not found: $working_dir" + cleanup_install_tmp + return 1 + fi + + cprint cyan "Creating systemd service for '$component'..." + + cat > "$service_path" </etc/systemd/system/mcsm-web.service - - systemctl daemon-reload - systemctl enable --now mcsm-{daemon,web}.service - echo_green "已注册MCSManager到系统服务!" - - sleep 2 - - printf "\n\n\n\n" - - echo_yellow "==================================================================" - echo_green "安装完成,欢迎使用 MCSManager !" - echo_yellow " " - echo_cyan_n "主控网页访问地址: " - echo_yellow "http://:23333 (Browser)" - echo_cyan_n "被控守护进程地址: " - echo_yellow "ws://:24444 (Cluster)" - echo_red "默认情况下,你必须在防火墙放行 23333 和 24444 端口才能确保面板工作正常!" - echo_yellow " " - echo_cyan "面板开关指令:" - echo_cyan "systemctl start mcsm-{daemon,web}.service" - echo_cyan "systemctl stop mcsm-{daemon,web}.service" - echo_cyan "systemctl restart mcsm-{daemon,web}.service" - echo_yellow " " - echo_green "官方文档: https://docs.mcsmanager.com/zh_cn/" - echo_yellow "==================================================================" -} - -# Environmental inspection -if [[ "$arch" == x86_64 ]]; then - arch=x64 - #echo "[-] x64 architecture detected" -elif [[ $arch == aarch64 ]]; then - arch=arm64 - #echo "[-] 64-bit ARM architecture detected" -elif [[ $arch == arm ]]; then - arch=armv7l - #echo "[-] 32-bit ARM architecture detected" -elif [[ $arch == ppc64le ]]; then - arch=ppc64le - #echo "[-] IBM POWER architecture detected" -elif [[ $arch == s390x ]]; then - arch=s390x - #echo "[-] IBM LinuxONE architecture detected" -else - Red_Error "[x] 对不起,这个架构还不支持安装MCSManager!\n[x]请尝试手动安装: https://github.com/MCSManager/MCSManager#linux" -fi - -# Define the variable Node installation directory -node_install_path="/opt/node-$node-linux-$arch" - -# Check network connection -echo_cyan "[-] Architecture: $arch" - -# Install related software -echo_cyan_n "[+] 正在安装依赖软件 (git, tar, wget)... " -if [[ -x "$(command -v yum)" ]]; then - yum install -y git tar wget -elif [[ -x "$(command -v apt-get)" ]]; then - apt-get install -y git tar wget -elif [[ -x "$(command -v pacman)" ]]; then - pacman -S --noconfirm --needed git tar wget -elif [[ -x "$(command -v zypper)" ]]; then - zypper --non-interactive install git tar wget -else - echo_red "[!] 找不到你的软件包管理器! 你需要先去安装 git, tar 和 wget!" -fi - -# Determine whether the relevant software is installed successfully -if [[ -x "$(command -v git)" && -x "$(command -v tar)" && -x "$(command -v wget)" ]]; then - echo_green "完成" -else - Red_Error "[x] 没有安装 git, tar 和 wget, 请先在安装MCSManager前安装它们!" -fi - -# Install the Node environment -Install_Node - -# Install MCSManager -Install_MCSManager - -# Create MCSManager background service -Create_Service +EOF + + if [[ $? -ne 0 ]]; then + cprint red bold "Failed to write service file: $service_path" + cleanup_install_tmp + return 1 + fi + + chmod 644 "$service_path" + cprint green "Created systemd unit: $service_path" + return 0 +} + +# Extract daemon key and/or http port +extract_component_info() { + # DAEMON SECTION + if [[ "$install_daemon" == true ]]; then + local daemon_service="mcsm-daemon.service" + local daemon_path="${install_dir}/daemon" + local daemon_config_path="${daemon_path}/${daemon_key_config_subpath}" + + cprint cyan bold "Starting daemon service..." + if systemctl restart "$daemon_service"; then + cprint green "Daemon service started." + + sleep 1 # Allow service to init and write configs + + if [[ -f "$daemon_config_path" ]]; then + daemon_key=$(grep -oP '"key"\s*:\s*"\K[^"]+' "$daemon_config_path") + daemon_port=$(grep -oP '"port"\s*:\s*\K[0-9]+' "$daemon_config_path") + + if [[ -n "$daemon_key" ]]; then + cprint green "Extracted daemon key: $daemon_key" + else + cprint red "Failed to extract daemon key from: $daemon_config_path" + fi + + if [[ -n "$daemon_port" ]]; then + cprint green "Extracted daemon port: $daemon_port" + else + cprint red "Failed to extract daemon port from: $daemon_config_path" + fi + else + cprint red "Daemon config file not found: $daemon_config_path" + fi + else + cprint red bold "Failed to start daemon service: $daemon_service" + fi + fi + + # WEB SECTION + if [[ "$install_web" == true ]]; then + local web_service="mcsm-web.service" + local web_path="${install_dir}/web" + local web_config_path="${web_path}/${web_port_config_subpath}" + + cprint cyan bold "Starting web service..." + if systemctl restart "$web_service"; then + cprint green "Web service started." + + sleep 1 # Allow time to populate config + + if [[ -f "$web_config_path" ]]; then + web_port=$(grep -oP '"httpPort"\s*:\s*\K[0-9]+' "$web_config_path") + if [[ -n "$web_port" ]]; then + cprint green "Extracted web port: $web_port" + else + cprint red "Failed to extract web port from: $web_config_path" + fi + else + cprint red "Web config file not found: $web_config_path" + fi + else + cprint red bold "Failed to start web service: $web_service" + fi + fi +} + +cleanup_install_tmp() { + if [[ -n "$install_tmp_dir" && -d "$install_tmp_dir" ]]; then + if rm -rf "$install_tmp_dir"; then + cprint green "Cleaned up temporary install folder: $install_tmp_dir" + else + cprint red "Failed to remove temporary folder: $install_tmp_dir" + fi + fi +} + +print_install_result() { + # Clear the screen + clear || true + + # Print ASCII banner + cprint white noprefix "______ _______________________ ___" + cprint white noprefix "___ |/ /_ ____/_ ___/__ |/ /_____ _____________ _______ _____________" + cprint white noprefix "__ /|_/ /_ / _____ \__ /|_/ /_ __ \`/_ __ \ __ \`/_ __ \`/ _ \_ ___/" + cprint white noprefix "_ / / / / /___ ____/ /_ / / / / /_/ /_ / / / /_/ /_ /_/ // __/ /" + cprint white noprefix "/_/ /_/ \____/ /____/ /_/ /_/ \__,_/ /_/ /_/\__,_/ _\__, / \___//_/" + echo "" + # status summary + cprint yellow noprefix "Installed/Updated Component(s):" + if [[ "$install_daemon" == true && -n "$daemon_key" && -n "$daemon_port" ]]; then + cprint white noprefix "Daemon" + elif [[ "$install_daemon" == true ]]; then + cprint white noprefix nonl "Daemon " + cprint yellow noprefix "(partial, config not fully detected)" + fi + + if [[ "$install_web" == true && -n "$web_port" ]]; then + cprint white noprefix "Web" + elif [[ "$install_web" == true ]]; then + cprint white noprefix nonl "Web " + cprint yellow noprefix "(partial, config not fully detected)" + fi + + echo "" + + # Local IP detection + local ip_address + ip_address=$(hostname -I 2>/dev/null | awk '{print $1}') + [[ -z "$ip_address" ]] && ip_address="YOUR-IP" + + # Daemon info + if [[ "$install_daemon" == true ]]; then + local daemon_address="ws://$ip_address:${daemon_port:-Failed to Retrieve from Config file}" + local daemon_key_display="${daemon_key:-Failed to Retrieve from Config file}" + + cprint yellow noprefix "Daemon Address:" + cprint white noprefix " $daemon_address" + cprint yellow noprefix "Daemon Key:" + cprint white noprefix " $daemon_key_display" + echo "" + fi + + # Web info + if [[ "$install_web" == true ]]; then + local web_address="http://$ip_address:${web_port:-Failed to Retrieve from Config file}" + cprint yellow noprefix "HTTP Web Interface:" + cprint white noprefix nonl " $web_address " + cprint yellow noprefix "(open in browser)" + echo "" + fi + + # Port guidance + cprint yellow noprefix "NOTE:" + cprint white noprefix " Make sure to expose the above ports through your firewall." + cprint white noprefix " If accessing from outside your network, you may need to configure port forwarding on your router." + echo "" + + # Service management help + cprint yellow noprefix "Service Management Commands:" + if [[ "$install_daemon" == true ]]; then + cprint white noprefix nonl " systemctl start " + cprint yellow noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl stop " + cprint yellow noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl restart " + cprint yellow noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl status " + cprint yellow noprefix "mcsm-daemon.service" + fi + if [[ "$install_web" == true ]]; then + cprint white noprefix nonl " systemctl start " + cprint yellow noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl stop " + cprint yellow noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl restart " + cprint yellow noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl status " + cprint yellow noprefix "mcsm-web.service" + fi + echo "" + + # Official doc + cprint yellow noprefix "Official Documentation:" + cprint white noprefix " https://docs.mcsmanager.com/" + echo "" + + # HTTPS support + cprint yellow noprefix "Need HTTPS?" + cprint white noprefix " To enable secure HTTPS access, configure a reverse proxy:" + cprint white noprefix " https://docs.mcsmanager.com/ops/proxy_https.html" + echo "" + + if [[ "$force_permission" == true ]]; then + cprint red noprefix "[Important] You chose to override permission during install." + cprint red noprefix " You may need to run: chown -R $install_user to update permission manually." + fi + + # Closing message + cprint green noprefix "Installation completed. Enjoy managing your servers with MCSManager!" + echo "" +} + +install_mcsm() { + local components=() + + if [[ "$install_web" == true ]]; then + install_component "web" + create_systemd_service "web" + components+=("web") + fi + + if [[ "$install_daemon" == true ]]; then + install_component "daemon" + create_systemd_service "daemon" + components+=("daemon") + fi + + # Reload systemd after any service file changes + if (( ${#components[@]} > 0 )); then + cprint cyan "Reloading systemd daemon..." + # systemctl daemon-reexec + systemctl daemon-reload + + for comp in "${components[@]}"; do + local svc="mcsm-${comp}.service" + + cprint cyan "Enabling service: $svc" + if systemctl enable "$svc" &>/dev/null; then + cprint green "Enabled service: $svc" + else + cprint red bold "Failed to enable service: $svc" + cleanup_install_tmp + exit 1 + fi + done + fi + + # Clean tmp dir + cleanup_install_tmp + # Extract installed component info + safe_run extract_component_info "Failed to extract runtime info from installed services" + safe_run print_install_result "Failed to print installation result" + +} + +main() { + trap 'echo "Unexpected error occurred."; exit 99' ERR + safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" + safe_run check_root "Script must be run as root" + safe_run parse_args "Failed to parse arguments" "$@" + safe_run detect_os_info "Failed to detect OS" + safe_run check_supported_os "Unsupported OS or version" + # To be moved to a master pre check function. + safe_run resolve_node_arch "Failed to resolve Node.js architecture" + + safe_run check_required_commands "Missing required system commands" + + safe_run check_node_installed "Failed to detect Node.js or npm at expected path. Node.js will be installed." + if [ "$install_node" = true ]; then + safe_run install_node "Node.js installation failed" + fi + + safe_run permission_barrier "Permission validation failed — aborting install" + + safe_run prepare_user "Failed to prepare user permission." + + safe_run download_mcsm "Failed to acquire MCSManager source" + safe_run mcsm_install_prepare "Error while preparing for installation" + + safe_run install_mcsm "Failed to install MCSManager" +} +main "$@" \ No newline at end of file From 5df7d0fe5f97744a75123845ddcd43c11241e501 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sat, 8 Nov 2025 16:47:52 +0800 Subject: [PATCH 423/463] chore: sync script --- setup.sh | 2 +- setup_cn.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 469b21a..1e54712 100644 --- a/setup.sh +++ b/setup.sh @@ -18,7 +18,7 @@ install_dir="/opt/mcsmanager" download_base_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" # Fallback download URL (can also be a local directory or mirror) -download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" +download_fallback_url="https://download.mcsmanager.com/" # Name of the release package to download/detect package_name="mcsmanager_linux_release.tar.gz" diff --git a/setup_cn.sh b/setup_cn.sh index 30955f4..98ff5a2 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -18,7 +18,7 @@ install_dir="/opt/mcsmanager" download_base_url="https://download.mcsmanager.com/" # Fallback download URL (can also be a local directory or mirror) -download_fallback_url="https://download.mcsmanager.com/" +download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" # Name of the release package to download/detect package_name="mcsmanager_linux_release.tar.gz" From b82fdba2e1488156c3ee2fa40f8c74f85a0afe58 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sat, 8 Nov 2025 16:50:45 +0800 Subject: [PATCH 424/463] chore: clear script --- setup2.sh | 1383 ----------------------------------------------------- 1 file changed, 1383 deletions(-) delete mode 100644 setup2.sh diff --git a/setup2.sh b/setup2.sh deleted file mode 100644 index f1264ab..0000000 --- a/setup2.sh +++ /dev/null @@ -1,1383 +0,0 @@ -#!/bin/bash -# Official MCSManager installation script. -# This script installs or updates the MCSManager Web and/or Daemon to the latest version. -# ------------------------------------------------------------------------------ -# Supported Linux distributions: -# This script supports the following mainstream Linux distributions: -# - Ubuntu: 18.04, 20.04, 22.04, 24.04 -# - Debian: 10, 11, 12, 13 -# - CentOS: 7, 8 Stream, 9 Stream, 10 Stream -# - RHEL: 7, 8, 9, 10 -# - Arch Linux: Support planned (TBD) -# ------------------------------------------------------------------------------ - -# Target installation directory (can be overridden with --install-dir) -install_dir="/opt/mcsmanager" - -# Primary download URL bas. Full package URL = download_base_url + package_name -download_base_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" - -# Fallback download URL (can also be a local directory or mirror) -download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" - -# Name of the release package to download/detect -package_name="mcsmanager_linux_release.tar.gz" - -# Node.js version to be installed -# Keep the leading "v" -node_version="v20.12.2" - -# Node download base URL - primary -node_download_url_base="https://nodejs.org/dist/" - -# Node download URL - fallback. -# This is the URL points directly to the file, not the base. This can also be a local absolute path. -# Only supports https:// or http:// for web locations. -node_download_fallback="" - -# Node.js installation path (defaults to the MCSManager installation path. Can be overridden with --node-install-dir) -node_install_dir="$install_dir" - -# Temp dir for file extraction -tmp_dir="/tmp" - -# --------------- Global Variables ---------------# -# DO NOT MODIFY # - - -# Component installation options. -# For fresh installs, both daemon and web components are installed by default. -# For updates, behavior depends on detected existing components. -# Can be overridden with --install daemon/web/all -install_daemon=true -install_web=true - -# Install MCSM as (default: root). -# To install as a general user (e.g., "mcsm"), use the --user option: --user mcsm -# To ensure compatibility, only user mcsm is supported. -install_user="root" -# Installed user, for permission check -web_installed=false -daemon_installed=false -web_installed_user="" -daemon_installed_user="" - -# Service file locations -# the final dir = systemd_file + {web/daemon} + ".service" -systemd_file="/etc/systemd/system/mcsm-" -# Optional: Override the default installation source file. -# If --install-source is specified, the installer will use the provided -# "mcsmanager_linux_release.tar.gz" file instead of downloading it. -# Only support local absolute path. -install_source_path="" - -# temp path for extracted file(s) -install_tmp_dir="/opt/mcsmanager/mcsm_abcd" - -# dir name for data dir backup -# e.g. /opt/mcsmanager/daemon/data -> /opt/mcsmanager/data_bak_data -# only valid for when during an update -backup_prefix="data_bak_" - -# System architecture (detected automatically) -arch="" -version="" -distro="" - -# Supported OS versions (map-style structure) -# Format: supported_os["distro_name"]="version1 version2 version3 ..." -declare -A supported_os -supported_os["Ubuntu"]="18 20 22 24" -supported_os["Debian"]="10 11 12 13" -supported_os["CentOS"]="7 8 8-stream 9-stream 10-stream" -supported_os["RHEL"]="7 8 9 10" -supported_os["Arch"]="rolling" - -# Required system commands for installation -# These will be checked before logic process -required_commands=( - chmod - chown - wget - tar - stat - useradd - usermod - date -) - -# Node.js related sections -# Enable strict version checking (exact match) -# enabled -> strict requriement for defined node version -# false -> newer version allowed -# Older version is NEVER allowed -strict_node_version_check=false - -# Will be set based on actual node status -install_node=true -# Remove leading "v" from defined version -required_node_ver="${node_version#v}" - -# Holds absolute path for node & npm -node_bin_path="" -npm_bin_path="" -# Hold Node.js arch name, e.g. x86_64 -> x64 -node_arch="" -# Hold Node.js intallation path, e.g. ${node_install_dir}/node-${node_version}-linux-${arch} -node_path="" - -# For installation result -daemon_key="" -daemon_port="" -web_port="" -daemon_key_config_subpath="data/Config/global.json" -web_port_config_subpath="data/SystemConfig/config.json" - -# Terminal color & style related -# Default to false, auto check later -SUPPORTS_COLOR=false -SUPPORTS_STYLE=false -# Declare ANSI reset -RESET="\033[0m" - -# Foreground colors -declare -A FG_COLORS=( - [black]="\033[0;30m" - [red]="\033[0;31m" - [green]="\033[0;32m" - [yellow]="\033[0;33m" - [blue]="\033[0;34m" - [magenta]="\033[0;35m" - [cyan]="\033[0;36m" - [white]="\033[0;37m" -) - -# Font styles -declare -A STYLES=( - [bold]="\033[1m" - [underline]="\033[4m" - [italic]="\033[3m" # Often ignored - [clear_line]="\r\033[2K" - [strikethrough]="\033[9m" -) - - -### Helper Functions -# Execution wrapper, avoid unexpected crashes. -safe_run() { - local func="$1" - local err_msg="$2" - shift 2 - - if ! "$func" "$@"; then - echo "Error: $err_msg" - exit 1 - fi -} - -# Function to ensure the script is run as root -check_root() { - # Using Bash's built-in EUID variable - if [ -n "$EUID" ]; then - if [ "$EUID" -ne 0 ]; then - cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." - exit 1 - fi - else - # Fallback to using id -u if EUID is unavailable (e.g., non-Bash shell or misconfigured environment) - if [ "$(id -u)" -ne 0 ]; then - cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." - exit 1 - fi - fi -} - -# Function to check whether current terminal support color & style -detect_terminal_capabilities() { - SUPPORTS_COLOR=false - SUPPORTS_STYLE=false - - if [ -t 1 ] && command -v tput >/dev/null 2>&1; then - if [ "$(tput colors)" -ge 8 ]; then - SUPPORTS_COLOR=true - fi - if tput bold >/dev/null 2>&1 && tput smul >/dev/null 2>&1; then - SUPPORTS_STYLE=true - fi - fi - - if [ "$SUPPORTS_COLOR" = true ]; then - cprint green "[OK] Terminal supports colored output." - else - cprint yellow "Note: Terminal does not support colored output. Continuing without formatting." - fi - - if [ "$SUPPORTS_STYLE" = true ]; then - cprint green "[OK] Terminal supports bold and underline formatting." - else - cprint yellow "Note: Terminal does not support advanced text styles." - fi -} - -# Check whether daemon or web is installed -is_component_installed() { - local component_name="$1" - local component_path="${install_dir}/${component_name}" - - if [[ -d "$component_path" ]]; then - cprint green "Component '$component_name' is already installed at $component_path" - - # Set corresponding global variable - if [[ "$component_name" == "daemon" ]]; then - daemon_installed=true - elif [[ "$component_name" == "web" ]]; then - web_installed=true - fi - - return 0 - else - cprint yellow "Component '$component_name' is not installed" - - # Set corresponding global variable - if [[ "$component_name" == "daemon" ]]; then - daemon_installed=false - elif [[ "$component_name" == "web" ]]; then - web_installed=false - fi - - return 1 - fi -} - -check_component_permission() { - local component="$1" - local service_file="${systemd_file}${component}.service" - - if [[ ! -f "$service_file" ]]; then - cprint yellow "Service file not found: $service_file" - return 0 # nothing changed - fi - - # Extract the User= line if it exists - local user_line - user_line=$(grep -E '^User=' "$service_file" 2>/dev/null | head -1) - - local user - if [[ -z "$user_line" ]]; then - user="root" # default if no User= is defined - else - user="${user_line#User=}" - fi - - # Validate user - if [[ "$user" != "root" && "$user" != "mcsm" ]]; then - cprint red bold "Unsupported user '$user' in $service_file. Expected 'root' or 'mcsm'." - exit 1 - fi - - # Assign to appropriate global - if [[ "$component" == "web" ]]; then - web_installed_user="$user" - elif [[ "$component" == "daemon" ]]; then - daemon_installed_user="$user" - fi - - cprint cyan "Detected $component installed as user: $user" - return 0 -} - - - -parse_args() { - local explicit_install_flag=false - - while [[ $# -gt 0 ]]; do - case "$1" in - --install-dir) - if [[ -n "$2" ]]; then - install_dir="$2" - shift 2 - else - echo "Error: --install-dir requires a path argument." - exit 1 - fi - ;; - --node-install-dir) - if [[ -n "$2" ]]; then - node_install_dir="$2" - shift 2 - else - echo "Error: --node-install-dir requires a path argument." - exit 1 - fi - ;; - --install) - explicit_install_flag=true - if [[ -n "$2" && "$2" != --* ]]; then - case "$2" in - daemon) - install_daemon=true - is_component_installed "daemon" - install_web=false - check_component_permission "daemon" - ;; - web) - install_daemon=false - is_component_installed "web" - install_web=true - check_component_permission "web" - ;; - all) - install_daemon=true - install_web=true - is_component_installed "daemon" - is_component_installed "web" - check_component_permission "daemon" - check_component_permission "web" - ;; - *) - echo "Error: Invalid value for --install. Expected 'daemon', 'web', or 'all'." - echo "Usage: --install daemon|web|all" - exit 1 - ;; - esac - shift 2 - else - echo "Error: --install flag provided but no value. Please specify: daemon, web, or all." - echo "Usage: --install daemon|web|all" - exit 1 - fi - ;; - --user) - if [[ -n "$2" ]]; then - case "$2" in - root) - install_user="root" - ;; - mcsm) - install_user="mcsm" - ;; - *) - echo "Error: Invalid user '$2'. Only 'root' and 'mcsm' are supported." - echo "Usage: --user root|mcsm" - exit 1 - ;; - esac - shift 2 - else - echo "Error: --user requires a value (root or mcsm)." - exit 1 - fi - ;; - --install-source) - if [[ -n "$2" ]]; then - install_source_path="$2" - shift 2 - else - echo "Error: --install-source requires a file path." - exit 1 - fi - ;; - *) - echo "Error: Unknown argument: $1" - exit 1 - ;; - esac - done - - # Auto-detect branch: only run if --install was not explicitly passed - if [[ "$explicit_install_flag" == false ]]; then - daemon_installed=false - web_installed=false - - if is_component_installed "daemon"; then - daemon_installed=true - check_component_permission "daemon" - fi - if is_component_installed "web"; then - web_installed=true - check_component_permission "web" - fi - - # When only one component installed, we wanted to process that one only. - if [[ "$daemon_installed" == true && "$web_installed" == false ]]; then - install_daemon=true - install_web=false - elif [[ "$daemon_installed" == false && "$web_installed" == true ]]; then - install_daemon=false - install_web=true - else - install_daemon=true - install_web=true - fi - fi -} - - -# Get Distribution & Architecture Info -detect_os_info() { - distro="Unknown" - version="Unknown" - arch=$(uname -m) - - # Try primary source - if [ -f /etc/os-release ]; then - . /etc/os-release - distro_id="${ID,,}" - version_id="${VERSION_ID,,}" - - case "$distro_id" in - ubuntu) - distro="Ubuntu" - version="$version_id" - ;; - debian) - distro="Debian" - version="$version_id" - ;; - centos) - distro="CentOS" - version="$version_id" - ;; - rhel*) - distro="RHEL" - version="$version_id" - ;; - arch) - distro="Arch" - version="rolling" - ;; - *) - distro="${ID:-Unknown}" - version="$version_id" - ;; - esac - fi - - # Fallbacks for missing or invalid version - if [[ -z "$version" || "$version" == "unknown" || "$version" == "" ]]; then - if [ -f /etc/issue ]; then - version_guess=$(grep -oP '[0-9]+(\.[0-9]+)*' /etc/issue | head -1) - if [[ -n "$version_guess" ]]; then - version="$version_guess" - fi - fi - fi - - # Normalize version: keep only major version - version_full="$version" - if [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then - version="${version%%.*}" - else - echo "Warning: Could not detect a clean numeric version. Defaulting to unknown." - version="unknown" - fi - - cprint cyan "Detected OS: $distro $version_full" - cprint cyan "Detected Architecture: $arch" -} - - -# Check if current OS is supported -check_supported_os() { - local supported_versions="${supported_os[$distro]}" - - if [[ -z "$supported_versions" ]]; then - echo "Error: Distribution '$distro' is not supported by this installer." - return 1 - fi - - if [[ "$supported_versions" != *"$version"* ]]; then - echo "Error: Version '$version' of '$distro' is not supported." - echo "Supported versions are: $supported_versions" - return 1 - fi - - cprint green "OS compatibility check passed." - return 0 -} - -# Check if all required commands are available -check_required_commands() { - local missing=0 - - for cmd in "${required_commands[@]}"; do - if ! command -v "$cmd" >/dev/null 2>&1; then - echo "Error: Required command '$cmd' is not available in PATH." - missing=1 - fi - done - - if [ "$missing" -ne 0 ]; then - echo "One or more required commands are missing. Please install them and try again." - return 1 - fi - - cprint green "All required commands are available." - return 0 -} - -# Print with specified color and style, fallback to RESET if not supported. -# Supported colors*: black|red|green|yellow|blue|magenta|cyan|white -# Supported styles*: bold|underline|italic|clear_line|strikethrough -# *Note: some style may not necessarily work on all terminals. -# Example usage: -# cprint green bold "Installation completed successfully." -# cprint red underline "Failed to detect required command: wget" -# cprint yellow "Warning: Disk space is low." -# cprint underline "Failed to detect required command: wget" -# cprint bold green underline"Installation completed successfully." - -cprint() { - local color="" - local text="" - local styles="" - local disable_prefix=false - local disable_newline=false - - while [[ $# -gt 1 ]]; do - case "$1" in - black|red|green|yellow|blue|magenta|cyan|white) - color="$1" - ;; - bold|underline|italic|clear_line|strikethrough) - styles+="${STYLES[$1]}" - ;; - noprefix) - disable_prefix=true - ;; - nonl) - disable_newline=true - ;; - esac - shift - done - - text="$1" - - local prefix_text="" - if [[ "$disable_prefix" != true ]]; then - local timestamp="[$(date +%H:%M:%S)]" - local label="[MCSM Installer]" - prefix_text="${FG_COLORS[white]}$timestamp $label${RESET} " - fi - - local prefix="" - if [[ -n "$color" && "$SUPPORTS_COLOR" = true ]]; then - prefix+="${FG_COLORS[$color]}" - fi - if [[ "$SUPPORTS_STYLE" = true || "$styles" == *"${STYLES[clear_line]}"* ]]; then - prefix="$styles$prefix" - fi - - if [[ "$disable_newline" == true ]]; then - printf "%b%b%s%b" "$prefix_text" "$prefix" "$text" "$RESET" - else - printf "%b%b%s%b\n" "$prefix_text" "$prefix" "$text" "$RESET" - fi -} - - - - -# Permission check before proceed with installation -permission_barrier() { - if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then - cprint cyan "No components currently installed — skipping permission check." - return 0 - fi - - for component in web daemon; do - local is_installed_var="${component}_installed" - local installed_user_var="${component}_installed_user" - - if [[ "${!is_installed_var}" == true ]]; then - local installed_user="${!installed_user_var}" - - # Step 0: Ensure installed user is detected - if [[ -z "$installed_user" ]]; then - cprint red bold "Detected that '$component' is installed but could not determine the user from its systemd service file." - cprint red "This may indicate a custom or unsupported service file setup." - cprint red "Refusing to proceed to avoid potential conflicts." - exit 1 - fi - - # Step 1: User match check - if [[ "$installed_user" != "$install_user" ]]; then - cprint red bold "Permission mismatch for '$component':" - cprint red "Installed as user: $installed_user" - cprint red "Current install target user: $install_user" - cprint red "Unable to proceed due to ownership conflict." - exit 1 - fi - fi - done - - # Step 2: Directory ownership check - local dir_owner - dir_owner=$(stat -c '%U' "$install_dir" 2>/dev/null) - - if [[ -z "$dir_owner" ]]; then - cprint red bold "Unable to determine owner of install_dir: $install_dir" - exit 1 - fi - - if [[ "$dir_owner" != "$install_user" ]]; then - cprint red bold "Install directory ownership mismatch:" - cprint red " Directory: $install_dir" - cprint red " Owned by: $dir_owner" - cprint red " Expected: $install_user" - exit 1 - fi - - cprint green bold "Permissions and ownership validated. Proceeding." - return 0 -} - - - -# Map OS arch with actual Node.js Arch name -# This function should be placed after var arch has been assigned a valid value. -resolve_node_arch() { - case "$arch" in - x86_64) - node_arch="x64" - ;; - aarch64) - node_arch="arm64" - ;; - armv7l) - node_arch="armv7l" - ;; - *) - cprint red bold "Unsupported architecture for Node.js: $arch" - return 1 - ;; - esac - - # Assign node_path based on resolved arch and current version/install dir - node_path="${node_install_dir}/node-${node_version}-linux-${node_arch}" - - cprint cyan "Resolved Node.js architecture: $node_arch" - cprint cyan "Computed Node.js install path: $node_path" -} - -# Check if Node.js at PATH is valid. -# This function check Node.js version + NPM (if Node.js valid) -verify_node_at_path() { - local node_path="$1" - # Assign value to vlobal variables when verifying - node_bin_path="$node_path/bin/node" - npm_bin_path="$node_path/bin/npm" - - # Node binary missing - if [ ! -x "$node_bin_path" ]; then - return 1 - fi - - local installed_ver - installed_ver="$("$node_bin_path" -v 2>/dev/null | sed 's/^v//')" - - # Node exists but version not returned - if [[ -z "$installed_ver" ]]; then - return 1 - fi - - # Version mismatch, even if newer - if [ "$strict_node_version_check" = true ]; then - if [[ "$installed_ver" != "$required_node_ver" ]]; then - return 3 - fi - else - # Version mismatch, too old. - local cmp - cmp=$(printf "%s\n%s\n" "$required_node_ver" "$installed_ver" | sort -V | head -1) - if [[ "$cmp" != "$required_node_ver" ]]; then - return 2 - fi - fi - - # node cmd valid, but npm is missing or broken. - if [ ! -x "$npm_bin_path" ] || ! "$npm_bin_path" --version >/dev/null 2>&1; then - return 4 - fi - - return 0 -} - -# Node.js pre-check. check if we need to install Node.js before installer run. -# Use postcheck_node_after_install() to check after install. -check_node_installed() { - verify_node_at_path "$node_path" - local result=$? - - case $result in - 0) - cprint green bold "Node.js and npm found at $node_path (version $required_node_ver or compatible)" - install_node=false - ;; - 1) - cprint yellow bold "Node.js binary not found or unusable at $node_path" - install_node=true - ;; - 2) - cprint red bold "Node.js version at $node_path is too old. Required: >= $required_node_ver" - install_node=true - ;; - 3) - cprint red bold "Node.js version mismatch. Required: $required_node_ver, found something else." - install_node=true - ;; - 4) - cprint red bold "Node.js is present but npm is missing or broken." - install_node=true - ;; - *) - cprint red bold "Unexpected error in node verification." - install_node=true - ;; - esac -} - -# Node.js post-check. check if Node.js is valid after install. -postcheck_node_after_install() { - verify_node_at_path "$node_path" - if [[ $? -ne 0 ]]; then - cprint red bold "Node.js installation failed or is invalid at $node_path" - return 1 - else - cprint green bold "Node.js is installed and functioning at $node_path" - return 0 - fi -} - -# Install Node.js and check -install_node() { - local archive_name="node-${node_version}-linux-${node_arch}.tar.xz" - local target_dir="${node_install_dir}/node-${node_version}-linux-${node_arch}" - local archive_path="${node_install_dir}/${archive_name}" - local download_url="${node_download_url_base}${node_version}/${archive_name}" - local fallback="$node_download_fallback" - - cprint cyan bold "Installing Node.js $node_version for arch: $node_arch" - - mkdir -p "$node_install_dir" || { - cprint red bold "Failed to create node install directory: $node_install_dir" - return 1 - } - - # Download - cprint cyan "Downloading Node.js from: $download_url" - if ! wget --progress=bar:force -O "$archive_path" "$download_url"; then - cprint yellow "Primary download failed. Attempting fallback..." - - if [[ -n "$fallback" ]]; then - if [[ "$fallback" =~ ^https?:// ]]; then - cprint cyan "Downloading from fallback URL: $fallback" - if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then - cprint red bold "Fallback download failed from: $fallback" - return 1 - fi - elif [ -f "$fallback" ]; then - cprint cyan "Copying from local fallback: $fallback" - cp "$fallback" "$archive_path" || { - cprint red bold "Failed to copy fallback Node.js archive from $fallback" - return 1 - } - else - cprint red bold "Invalid fallback path: $fallback" - return 1 - fi - else - cprint red bold "No fallback source configured. Cannot proceed." - return 1 - fi - fi - - # Extract archive - cprint cyan "Extracting Node.js archive..." - if ! tar -xf "$archive_path" -C "$node_install_dir"; then - cprint red bold "Failed to extract Node.js archive." - return 1 - fi - - chmod -R a+rx "$target_dir" || { - cprint red bold "Failed to set execute permissions on Node.js files." - return 1 - } - - verify_node_at_path "$target_dir" - local result=$? - if [[ $result -ne 0 ]]; then - cprint red bold "Node.js installation failed verification." - return 1 - fi - - cprint cyan "Cleaning up archive..." - rm -f "$archive_path" - - cprint green bold "Node.js $node_version installed successfully at $target_dir" - # Save resolved binary paths to global variables - node_bin_path="${target_dir}/bin/node" - npm_bin_path="${target_dir}/bin/npm" - - cprint green "Node.js binary: $node_bin_path" - cprint green "npm binary: $npm_bin_path" - return 0 -} - -# Function to download MCSM package. fetch from primary URL first, then fallback URL. -# This function only put extracted file(s) into install_dir, it does not perform the actual update. -download_mcsm() { - local archive_name="$package_name" - local archive_path="${tmp_dir}/${archive_name}" - local primary_url="${download_base_url}${archive_name}" - local fallback="$download_fallback_url" - - cprint cyan bold "Downloading MCSManager package..." - - # Step 1: Try downloading from primary URL - if ! wget --progress=bar:force -O "$archive_path" "$primary_url"; then - cprint yellow "Primary download failed. Attempting fallback source..." - - if [[ -z "$fallback" ]]; then - cprint red bold "No fallback URL or path specified." - return 1 - fi - - if [[ "$fallback" =~ ^https?:// ]]; then - if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then - cprint red bold "Fallback download failed from $fallback" - return 1 - fi - elif [[ -f "$fallback" ]]; then - cp "$fallback" "$archive_path" || { - cprint red bold "Failed to copy fallback archive from $fallback" - return 1 - } - else - cprint red bold "Fallback path is invalid: $fallback" - return 1 - fi - fi - - # Step 2: Generate extract directory - local suffix - suffix=$(tr -dc 'a-z0-9' /dev/null; then - cprint green "User '$install_user' already exists." - else - cprint cyan "Creating system user: $install_user (nologin, no password)..." - if ! useradd --system --home "$install_dir" --shell /usr/sbin/nologin "$install_user"; then - cprint red bold "Failed to create user: $install_user" - exit 1 - fi - cprint green "User '$install_user' created." - fi - - # Docker integration - if command -v docker &>/dev/null; then - cprint cyan "Docker is installed — checking group assignment..." - - if getent group docker &>/dev/null; then - if id -nG "$install_user" | grep -qw docker; then - cprint green "User '$install_user' is already in the 'docker' group." - else - cprint cyan "Adding user '$install_user' to 'docker' group..." - if usermod -aG docker "$install_user"; then - cprint green "Docker group access granted to '$install_user'." - else - cprint red "Failed to add '$install_user' to 'docker' group. Docker may not be usable by this user." - fi - fi - else - cprint red "Docker installed but 'docker' group not found. Skipping group assignment." - fi - else - cprint yellow "Docker not installed — skipping Docker group configuration." - fi - - return 0 -} - -# Prepare file & permissions before install. -mcsm_install_prepare() { - # Prepare the user first - prepare_user - - if [[ ! -d "$install_tmp_dir" ]]; then - cprint red bold "install_tmp_dir does not exist: $install_tmp_dir" - exit 1 - fi - - cprint cyan "Changing ownership of $install_tmp_dir to user '$install_user'..." - chown -R "$install_user":"$install_user" "$install_tmp_dir" || { - cprint red bold "Failed to change ownership of $install_tmp_dir" - cleanup_install_tmp - exit 1 - } - - # Normalize install_dir to ensure it ends with a slash - [[ "${install_dir}" != */ ]] && install_dir="${install_dir}/" - - if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then - cprint cyan "No existing components detected — skipping data backup/cleanup." - return 0 - fi - - for component in web daemon; do - local is_installed_var="${component}_installed" - if [[ "${!is_installed_var}" == true ]]; then - local component_path="${install_dir}${component}" - local data_dir="${component_path}/data" - local backup_path="${install_dir}${backup_prefix}${component}" - - if [[ ! -d "$component_path" ]]; then - cprint yellow "Expected installed component directory not found: $component_path" - continue - fi - - if [[ -d "$data_dir" ]]; then - if [[ -e "$backup_path" ]]; then - cprint red bold "Backup destination already exists: $backup_path" - cprint red "Please resolve this conflict manually before continuing." - cleanup_install_tmp - exit 1 - fi - - cprint cyan "Backing up data directory for $component..." - mv "$data_dir" "$backup_path" || { - cprint red bold "Failed to move $data_dir to $backup_path" - cleanup_install_tmp - exit 1 - } - cprint green "Moved $data_dir → $backup_path" - else - cprint yellow "No data directory found for $component — skipping backup." - fi - - cprint cyan "Removing old component directory: $component_path" - rm -rf "$component_path" || { - cprint red bold "Failed to remove old component directory: $component_path" - cleanup_install_tmp - exit 1 - } - fi - done - - cprint green bold "Existing components prepared successfully." - return 0 -} - -# Install or update a component -install_component() { - local component="$1" - local target_path="${install_dir}${component}" - local backup_data_path="${install_dir}${backup_prefix}${component}" - local source_path="${install_tmp_dir}/mcsmanager/${component}" - - cprint cyan bold "Installing/Updating component: $component" - - # Step 1: Move new component to install_dir - if [[ ! -d "$source_path" ]]; then - cprint red bold "Source directory not found: $source_path" - cleanup_install_tmp - exit 1 - fi - - if [[ -e "$target_path" ]]; then - cprint red bold "Target path already exists: $target_path" - cprint red " This should not happen — possible permission error or unclean install." - cleanup_install_tmp - exit 1 - fi - - mv "$source_path" "$target_path" || { - cprint red bold "Failed to move $source_path → $target_path" - cleanup_install_tmp - exit 1 - } - - cprint green "Moved $component to $target_path" - - # Step 2: Restore backed-up data directory if present - if [[ -d "$backup_data_path" ]]; then - local target_data_path="${target_path}/data" - - cprint cyan "Restoring backed-up data directory for $component..." - - rm -rf "$target_data_path" # Ensure no conflict - mv "$backup_data_path" "$target_data_path" || { - cprint red bold "Failed to restore data directory to $target_data_path" - cleanup_install_tmp - exit 1 - } - - cprint green "Data directory restored: $target_data_path" - else - cprint yellow "No backed-up data directory found for $component — fresh install assumed." - fi - - # Step 3: Install NPM dependencies - if [[ ! -x "$npm_bin_path" ]]; then - cprint red bold "npm binary not found or not executable: $npm_bin_path" - cleanup_install_tmp - exit 1 - fi - - cprint cyan "Installing dependencies for $component using npm..." - pushd "$target_path" >/dev/null || { - cprint red bold "Failed to change directory to $target_path" - cleanup_install_tmp - exit 1 - } - - if ! "$npm_bin_path" install --no-audit --no-fund --loglevel=warn; then - cprint red bold "NPM dependency installation failed for $component" - popd >/dev/null - cleanup_install_tmp - exit 1 - fi - - popd >/dev/null - cprint green bold "Component '$component' installed/updated successfully." -} - -# Create systemd service for a given component. -# This will overwrite the existing service file. -create_systemd_service() { - local component="$1" - local service_path="${systemd_file}${component}.service" - local working_dir="${install_dir}${component}" - local exec="${node_bin_path} app.js" - - if [[ ! -d "$working_dir" ]]; then - cprint red bold "Component directory not found: $working_dir" - cleanup_install_tmp - return 1 - fi - - cprint cyan "Creating systemd service for '$component'..." - - cat > "$service_path" </dev/null | awk '{print $1}') - [[ -z "$ip_address" ]] && ip_address="YOUR-IP" - - # Daemon info - if [[ "$install_daemon" == true ]]; then - local daemon_address="ws://$ip_address:${daemon_port:-Failed to Retrieve from Config file}" - local daemon_key_display="${daemon_key:-Failed to Retrieve from Config file}" - - cprint yellow noprefix "Daemon Address:" - cprint white noprefix " $daemon_address" - cprint yellow noprefix "Daemon Key:" - cprint white noprefix " $daemon_key_display" - echo "" - fi - - # Web info - if [[ "$install_web" == true ]]; then - local web_address="http://$ip_address:${web_port:-Failed to Retrieve from Config file}" - cprint yellow noprefix "HTTP Web Interface:" - cprint white noprefix nonl " $web_address " - cprint yellow noprefix "(open in browser)" - echo "" - fi - - # Port guidance - cprint yellow noprefix "NOTE:" - cprint white noprefix " Make sure to expose the above ports through your firewall." - cprint white noprefix " If accessing from outside your network, you may need to configure port forwarding on your router." - echo "" - - # Service management help - cprint yellow noprefix "Service Management Commands:" - if [[ "$install_daemon" == true ]]; then - cprint white noprefix nonl " systemctl start " - cprint yellow noprefix "mcsm-daemon.service" - cprint white noprefix nonl " systemctl stop " - cprint yellow noprefix "mcsm-daemon.service" - cprint white noprefix nonl " systemctl restart " - cprint yellow noprefix "mcsm-daemon.service" - cprint white noprefix nonl " systemctl status " - cprint yellow noprefix "mcsm-daemon.service" - fi - if [[ "$install_web" == true ]]; then - cprint white noprefix nonl " systemctl start " - cprint yellow noprefix "mcsm-web.service" - cprint white noprefix nonl " systemctl stop " - cprint yellow noprefix "mcsm-web.service" - cprint white noprefix nonl " systemctl restart " - cprint yellow noprefix "mcsm-web.service" - cprint white noprefix nonl " systemctl status " - cprint yellow noprefix "mcsm-web.service" - fi - echo "" - - # Official doc - cprint yellow noprefix "Official Documentation:" - cprint white noprefix " https://docs.mcsmanager.com/" - echo "" - - # HTTPS support - cprint yellow noprefix "Need HTTPS?" - cprint white noprefix " To enable secure HTTPS access, configure a reverse proxy:" - cprint white noprefix " https://docs.mcsmanager.com/ops/proxy_https.html" - echo "" - - # Closing message - cprint green noprefix "Installation completed. Enjoy managing your servers with MCSManager!" - echo "" -} - -install_mcsm() { - local components=() - - if [[ "$install_web" == true ]]; then - install_component "web" - create_systemd_service "web" - components+=("web") - fi - - if [[ "$install_daemon" == true ]]; then - install_component "daemon" - create_systemd_service "daemon" - components+=("daemon") - fi - - # Reload systemd after any service file changes - if (( ${#components[@]} > 0 )); then - cprint cyan "Reloading systemd daemon..." - # systemctl daemon-reexec - systemctl daemon-reload - - for comp in "${components[@]}"; do - local svc="mcsm-${comp}.service" - - cprint cyan "Enabling service: $svc" - if systemctl enable "$svc" &>/dev/null; then - cprint green "Enabled service: $svc" - else - cprint red bold "Failed to enable service: $svc" - cleanup_install_tmp - exit 1 - fi - done - fi - - # Clean tmp dir - cleanup_install_tmp - # Extract installed component info - safe_run extract_component_info "Failed to extract runtime info from installed services" - safe_run print_install_result "Failed to print installation result" - -} - -main() { - trap 'echo "Unexpected error occurred."; exit 99' ERR - safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" - safe_run check_root "Script must be run as root" - safe_run parse_args "Failed to parse arguments" "$@" - safe_run detect_os_info "Failed to detect OS" - safe_run check_supported_os "Unsupported OS or version" - # To be moved to a master pre check function. - safe_run resolve_node_arch "Failed to resolve Node.js architecture" - - safe_run check_required_commands "Missing required system commands" - - safe_run check_node_installed "Failed to detect Node.js or npm at expected path. Node.js will be installed." - if [ "$install_node" = true ]; then - safe_run install_node "Node.js installation failed" - fi - - safe_run permission_barrier "Permission validation failed — aborting install" - - safe_run download_mcsm "Failed to acquire MCSManager source" - safe_run mcsm_install_prepare "Error while preparing for installation" - - safe_run install_mcsm "Failed to install MCSManager" -} -main "$@" From 46c12ed5dcda261c81cf6add944b69e646c991b0 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Sat, 8 Nov 2025 16:58:04 +0800 Subject: [PATCH 425/463] fix: update fallback download URLs in setup scripts --- setup.sh | 2 +- setup_cn.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 1e54712..fa87d73 100644 --- a/setup.sh +++ b/setup.sh @@ -18,7 +18,7 @@ install_dir="/opt/mcsmanager" download_base_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" # Fallback download URL (can also be a local directory or mirror) -download_fallback_url="https://download.mcsmanager.com/" +download_fallback_url="https://download.mcsmanager.com/mcsmanager_linux_release.tar.gz" # Name of the release package to download/detect package_name="mcsmanager_linux_release.tar.gz" diff --git a/setup_cn.sh b/setup_cn.sh index 98ff5a2..0a1ba01 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -18,7 +18,7 @@ install_dir="/opt/mcsmanager" download_base_url="https://download.mcsmanager.com/" # Fallback download URL (can also be a local directory or mirror) -download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/" +download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" # Name of the release package to download/detect package_name="mcsmanager_linux_release.tar.gz" From f980b315cd96e16bd18d0c18100f1649cb19e2c2 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Sat, 8 Nov 2025 08:17:49 -0500 Subject: [PATCH 426/463] misc: increase delay to 3 seconds for service to start --- setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 1e54712..623398d 100644 --- a/setup.sh +++ b/setup.sh @@ -1144,7 +1144,7 @@ extract_component_info() { if systemctl restart "$daemon_service"; then cprint green "Daemon service started." - sleep 1 # Allow service to init and write configs + sleep 3 # Allow service to init and write configs if [[ -f "$daemon_config_path" ]]; then daemon_key=$(grep -oP '"key"\s*:\s*"\K[^"]+' "$daemon_config_path") @@ -1179,7 +1179,7 @@ extract_component_info() { if systemctl restart "$web_service"; then cprint green "Web service started." - sleep 1 # Allow time to populate config + sleep 3 # Allow time to populate config if [[ -f "$web_config_path" ]]; then web_port=$(grep -oP '"httpPort"\s*:\s*\K[0-9]+' "$web_config_path") From 017284f1f6ce583e9fb270302d5ca8ac928654d4 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Sat, 8 Nov 2025 08:23:28 -0500 Subject: [PATCH 427/463] mics: fix version sanitizing for arch rolling --- setup.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 623398d..69a2295 100644 --- a/setup.sh +++ b/setup.sh @@ -476,7 +476,10 @@ detect_os_info() { # Normalize version: keep only major version version_full="$version" - if [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then + if [[ "$version" == "rolling" ]]; then + # Arch Linux, no change + : + elif [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then version="${version%%.*}" else echo "Warning: Could not detect a clean numeric version. Defaulting to unknown." From fec15e8a4b11e9eecf9abeab67b106bb8fc9f4f4 Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sat, 8 Nov 2025 21:56:50 +0800 Subject: [PATCH 428/463] fix: arch --- setup_cn.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index 0a1ba01..101c4c3 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -476,7 +476,10 @@ detect_os_info() { # Normalize version: keep only major version version_full="$version" - if [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then + if [[ "$version" == "rolling" ]]; then + # Arch Linux, no change + : + elif [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then version="${version%%.*}" else echo "Warning: Could not detect a clean numeric version. Defaulting to unknown." @@ -1144,7 +1147,7 @@ extract_component_info() { if systemctl restart "$daemon_service"; then cprint green "Daemon service started." - sleep 1 # Allow service to init and write configs + sleep 3 # Allow service to init and write configs if [[ -f "$daemon_config_path" ]]; then daemon_key=$(grep -oP '"key"\s*:\s*"\K[^"]+' "$daemon_config_path") @@ -1179,7 +1182,7 @@ extract_component_info() { if systemctl restart "$web_service"; then cprint green "Web service started." - sleep 1 # Allow time to populate config + sleep 3 # Allow time to populate config if [[ -f "$web_config_path" ]]; then web_port=$(grep -oP '"httpPort"\s*:\s*\K[0-9]+' "$web_config_path") From 337ed6ef87271e3cc85df8c44a730065e18aa479 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Sat, 8 Nov 2025 22:48:30 -0500 Subject: [PATCH 429/463] minor: fix os distro version check logic --- setup.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/setup.sh b/setup.sh index 69a2295..e83f63e 100644 --- a/setup.sh +++ b/setup.sh @@ -474,18 +474,53 @@ detect_os_info() { fi fi - # Normalize version: keep only major version + # Normalize version: if purely numeric/dotted keep only major; otherwise leave as-is version_full="$version" - if [[ "$version" == "rolling" ]]; then - # Arch Linux, no change - : - elif [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then + if [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then version="${version%%.*}" - else - echo "Warning: Could not detect a clean numeric version. Defaulting to unknown." + fi + + # Resolve the supported_os key from $distro: + # 1) exact key match, 2) case-insensitive match over existing keys + distro_key="" + if [[ -n "$distro" ]]; then + if [[ -n "${supported_os[$distro]+_}" ]]; then + distro_key="$distro" + else + for k in "${!supported_os[@]}"; do + if [[ "${k,,}" == "${distro,,}" ]]; then + distro_key="$k" + break + fi + done + fi + fi + + # Validate the (possibly normalized) version against supported_os for this distro + if [[ -z "$distro_key" ]]; then + cprint red "Warning: OS '$distro' not recognized. Defaulting version to unknown." version="unknown" + elif [[ -z "$version" ]]; then + cprint red "Warning: Version is empty. Defaulting to unknown." + version="unknown" + else + match_ok=0 + for v in ${supported_os[$distro_key]}; do + if [[ "$v" == "$version" ]]; then + match_ok=1 + break + fi + done + if (( match_ok )); then + : + else + cprint red "Warning: Version '${version}' (from '${version_full}') not supported for ${distro_key}." + #version="unknown" + fi fi + + cprint cyan "Detected OS: $distro $version_full" cprint cyan "Detected Architecture: $arch" } @@ -496,13 +531,13 @@ check_supported_os() { local supported_versions="${supported_os[$distro]}" if [[ -z "$supported_versions" ]]; then - echo "Error: Distribution '$distro' is not supported by this installer." + cprint red "Error: Distribution '$distro' is not supported by this installer." return 1 fi if [[ "$supported_versions" != *"$version"* ]]; then - echo "Error: Version '$version' of '$distro' is not supported." - echo "Supported versions are: $supported_versions" + cprint red "Error: Version '$version' of '$distro' is not supported." + cprint red "Supported versions are: $supported_versions" return 1 fi From 0c0e99d0a9c5a44bc5bcf14f96f75ab3f2a75a2c Mon Sep 17 00:00:00 2001 From: KevinLu Date: Sun, 9 Nov 2025 21:57:52 -0500 Subject: [PATCH 430/463] misc: skip os version blocker --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index e83f63e..a606914 100644 --- a/setup.sh +++ b/setup.sh @@ -1400,7 +1400,7 @@ main() { safe_run check_root "Script must be run as root" safe_run parse_args "Failed to parse arguments" "$@" safe_run detect_os_info "Failed to detect OS" - safe_run check_supported_os "Unsupported OS or version" + # safe_run check_supported_os "Unsupported OS or version" # To be moved to a master pre check function. safe_run resolve_node_arch "Failed to resolve Node.js architecture" From cbfc41e17b41879ee25fff0648bb7734320d7356 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Sun, 9 Nov 2025 22:07:40 -0500 Subject: [PATCH 431/463] misc: remove os version blocker --- setup.sh | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/setup.sh b/setup.sh index a606914..f843d89 100644 --- a/setup.sh +++ b/setup.sh @@ -525,26 +525,6 @@ detect_os_info() { cprint cyan "Detected Architecture: $arch" } - -# Check if current OS is supported -check_supported_os() { - local supported_versions="${supported_os[$distro]}" - - if [[ -z "$supported_versions" ]]; then - cprint red "Error: Distribution '$distro' is not supported by this installer." - return 1 - fi - - if [[ "$supported_versions" != *"$version"* ]]; then - cprint red "Error: Version '$version' of '$distro' is not supported." - cprint red "Supported versions are: $supported_versions" - return 1 - fi - - cprint green "OS compatibility check passed." - return 0 -} - # Check if all required commands are available check_required_commands() { local missing=0 @@ -1400,7 +1380,6 @@ main() { safe_run check_root "Script must be run as root" safe_run parse_args "Failed to parse arguments" "$@" safe_run detect_os_info "Failed to detect OS" - # safe_run check_supported_os "Unsupported OS or version" # To be moved to a master pre check function. safe_run resolve_node_arch "Failed to resolve Node.js architecture" From 0da8a78b1ec0f8012e10cb2e47929b1eca15681a Mon Sep 17 00:00:00 2001 From: KevinLu Date: Sun, 9 Nov 2025 22:13:56 -0500 Subject: [PATCH 432/463] misc: remove version collapse --- setup.sh | 48 +++--------------------------------------------- 1 file changed, 3 insertions(+), 45 deletions(-) diff --git a/setup.sh b/setup.sh index f843d89..7a3310b 100644 --- a/setup.sh +++ b/setup.sh @@ -476,51 +476,9 @@ detect_os_info() { # Normalize version: if purely numeric/dotted keep only major; otherwise leave as-is version_full="$version" - if [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then - version="${version%%.*}" - fi - - # Resolve the supported_os key from $distro: - # 1) exact key match, 2) case-insensitive match over existing keys - distro_key="" - if [[ -n "$distro" ]]; then - if [[ -n "${supported_os[$distro]+_}" ]]; then - distro_key="$distro" - else - for k in "${!supported_os[@]}"; do - if [[ "${k,,}" == "${distro,,}" ]]; then - distro_key="$k" - break - fi - done - fi - fi - - # Validate the (possibly normalized) version against supported_os for this distro - if [[ -z "$distro_key" ]]; then - cprint red "Warning: OS '$distro' not recognized. Defaulting version to unknown." - version="unknown" - elif [[ -z "$version" ]]; then - cprint red "Warning: Version is empty. Defaulting to unknown." - version="unknown" - else - match_ok=0 - for v in ${supported_os[$distro_key]}; do - if [[ "$v" == "$version" ]]; then - match_ok=1 - break - fi - done - if (( match_ok )); then - : - else - cprint red "Warning: Version '${version}' (from '${version_full}') not supported for ${distro_key}." - #version="unknown" - fi - fi - - - + #if [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then + # version="${version%%.*}" + #fi cprint cyan "Detected OS: $distro $version_full" cprint cyan "Detected Architecture: $arch" } From c9f23279cd89dfe58a860927d9fa0f95e374e5d7 Mon Sep 17 00:00:00 2001 From: KevinLu Date: Sun, 9 Nov 2025 22:25:04 -0500 Subject: [PATCH 433/463] misc: removed version blocker --- setup_cn.sh | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index 101c4c3..cb2c8d2 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -476,40 +476,10 @@ detect_os_info() { # Normalize version: keep only major version version_full="$version" - if [[ "$version" == "rolling" ]]; then - # Arch Linux, no change - : - elif [[ "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then - version="${version%%.*}" - else - echo "Warning: Could not detect a clean numeric version. Defaulting to unknown." - version="unknown" - fi - cprint cyan "Detected OS: $distro $version_full" cprint cyan "Detected Architecture: $arch" } - -# Check if current OS is supported -check_supported_os() { - local supported_versions="${supported_os[$distro]}" - - if [[ -z "$supported_versions" ]]; then - echo "Error: Distribution '$distro' is not supported by this installer." - return 1 - fi - - if [[ "$supported_versions" != *"$version"* ]]; then - echo "Error: Version '$version' of '$distro' is not supported." - echo "Supported versions are: $supported_versions" - return 1 - fi - - cprint green "OS compatibility check passed." - return 0 -} - # Check if all required commands are available check_required_commands() { local missing=0 @@ -1365,7 +1335,6 @@ main() { safe_run check_root "Script must be run as root" safe_run parse_args "Failed to parse arguments" "$@" safe_run detect_os_info "Failed to detect OS" - safe_run check_supported_os "Unsupported OS or version" # To be moved to a master pre check function. safe_run resolve_node_arch "Failed to resolve Node.js architecture" From c04101a6e7c78e9286b012c2f11f3ae7b40f19e1 Mon Sep 17 00:00:00 2001 From: Capslock800000 Date: Thu, 27 Nov 2025 20:29:57 +0800 Subject: [PATCH 434/463] =?UTF-8?q?=E6=B1=89=E5=8C=96=E4=BA=86=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E5=AE=89=E8=A3=85=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup_cn.sh | 386 ++++++++++++++++++++++++++-------------------------- 1 file changed, 193 insertions(+), 193 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index cb2c8d2..95a681d 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1,9 +1,9 @@ #!/bin/bash -# Official MCSManager installation script. -# This script installs or updates the MCSManager Web and/or Daemon to the latest version. +# MCSManager官方安装脚本. +# 这个脚本将会把MCSManager服务端和节点服务端更新/安装至最新发布版本. # ------------------------------------------------------------------------------ -# Supported Linux distributions: -# This script supports the following mainstream Linux distributions: +# 受支持的Linux: +# 此脚本支持以下Linux发行版: # - Ubuntu: 18.04, 20.04, 22.04, 24.04 # - Debian: 10, 11, 12, 13 # - CentOS: 7, 8 Stream, 9 Stream, 10 Stream @@ -186,13 +186,13 @@ check_root() { # Using Bash's built-in EUID variable if [ -n "$EUID" ]; then if [ "$EUID" -ne 0 ]; then - cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." + cprint red "错误: 这个脚本只能运行在root或sudo模式下,请尝试切换用户或者使用sudo." exit 1 fi else # Fallback to using id -u if EUID is unavailable (e.g., non-Bash shell or misconfigured environment) if [ "$(id -u)" -ne 0 ]; then - cprint red "Error: This script must be run as root. Please use sudo or switch to the root user." + cprint red "错误: 这个脚本只能运行在root或sudo模式下,请尝试切换用户或者使用sudo." exit 1 fi fi @@ -213,15 +213,15 @@ detect_terminal_capabilities() { fi if [ "$SUPPORTS_COLOR" = true ]; then - cprint green "[OK] Terminal supports colored output." + cprint green "[OK] 这个终端支持彩色输出." else - cprint yellow "Note: Terminal does not support colored output. Continuing without formatting." + cprint yellow "注:终端不支持彩色输出。不格式化继续." fi if [ "$SUPPORTS_STYLE" = true ]; then - cprint green "[OK] Terminal supports bold and underline formatting." + cprint green "[OK] 终端支持粗体和下划线格式." else - cprint yellow "Note: Terminal does not support advanced text styles." + cprint yellow "注意:终端不支持高级文本样式." fi } @@ -231,7 +231,7 @@ is_component_installed() { local component_path="${install_dir}/${component_name}" if [[ -d "$component_path" ]]; then - cprint green "Component '$component_name' is already installed at $component_path" + cprint green "组件 '$component_name' 已经被安装在 $component_path" # Set corresponding global variable if [[ "$component_name" == "daemon" ]]; then @@ -242,7 +242,7 @@ is_component_installed() { return 0 else - cprint yellow "Component '$component_name' is not installed" + cprint yellow "组件 '$component_name' 未被安装" # Set corresponding global variable if [[ "$component_name" == "daemon" ]]; then @@ -260,7 +260,7 @@ check_component_permission() { local service_file="${systemd_file}${component}.service" if [[ ! -f "$service_file" ]]; then - cprint yellow "Service file not found: $service_file" + cprint yellow "找不到服务文件: $service_file" return 0 # nothing changed fi @@ -277,7 +277,7 @@ check_component_permission() { # Validate user if [[ "$user" != "root" && "$user" != "mcsm" ]]; then - cprint red bold "Unsupported user '$user' in $service_file. Expected 'root' or 'mcsm'." + cprint red bold "不支持的用户 '$user' 在 $service_file. 使用 'root' 或 'mcsm'." exit 1 fi @@ -288,7 +288,7 @@ check_component_permission() { daemon_installed_user="$user" fi - cprint cyan "Detected $component installed as user: $user" + cprint cyan "已删除 $component 以用户身份安装: $user" return 0 } @@ -304,7 +304,7 @@ parse_args() { install_dir="$2" shift 2 else - echo "Error: --install-dir requires a path argument." + echo "错误:--install-dir需要一个路径参数." exit 1 fi ;; @@ -313,7 +313,7 @@ parse_args() { node_install_dir="$2" shift 2 else - echo "Error: --node-install-dir requires a path argument." + echo "错误:--node-install-dir需要一个路径参数." exit 1 fi ;; @@ -342,15 +342,15 @@ parse_args() { check_component_permission "web" ;; *) - echo "Error: Invalid value for --install. Expected 'daemon', 'web', or 'all'." + echo "错误:--install的值无效。期望‘daemon’, ‘web’或‘all’." echo "Usage: --install daemon|web|all" exit 1 ;; esac shift 2 else - echo "Error: --install flag provided but no value. Please specify: daemon, web, or all." - echo "Usage: --install daemon|web|all" + echo "错误:提供了--install标志,但没有值。请指定:daemon、web或all." + echo "使用方法: --install daemon|web|all" exit 1 fi ;; @@ -364,14 +364,14 @@ parse_args() { install_user="mcsm" ;; *) - echo "Error: Invalid user '$2'. Only 'root' and 'mcsm' are supported." - echo "Usage: --user root|mcsm" + echo "错误:无效用户 '$2'. 只有 'root' 和 'mcsm' 受支持." + echo "使用方法: --user root|mcsm" exit 1 ;; esac shift 2 else - echo "Error: --user requires a value (root or mcsm)." + echo "错误:--user需要一个值 (root 或 mcsm)." exit 1 fi ;; @@ -380,7 +380,7 @@ parse_args() { install_source_path="$2" shift 2 else - echo "Error: --install-source requires a file path." + echo "错误:--install-source需要文件路径." exit 1 fi ;; @@ -389,7 +389,7 @@ parse_args() { shift ;; *) - echo "Error: Unknown argument: $1" + echo "错误:未知参数t: $1" exit 1 ;; esac @@ -476,8 +476,8 @@ detect_os_info() { # Normalize version: keep only major version version_full="$version" - cprint cyan "Detected OS: $distro $version_full" - cprint cyan "Detected Architecture: $arch" + cprint cyan "检测到操作系统: $distro $version_full" + cprint cyan "检测到架构: $arch" } # Check if all required commands are available @@ -486,17 +486,17 @@ check_required_commands() { for cmd in "${required_commands[@]}"; do if ! command -v "$cmd" >/dev/null 2>&1; then - echo "Error: Required command '$cmd' is not available in PATH." + echo "错误:必需的命令 '$cmd' 在PATH中不可用." missing=1 fi done if [ "$missing" -ne 0 ]; then - echo "One or more required commands are missing. Please install them and try again." + echo "缺少一个或多个必需的命令。请安装后再试." return 1 fi - cprint green "All required commands are available." + cprint green "所有必需的命令都可用." return 0 } @@ -566,7 +566,7 @@ cprint() { # Permission check before proceed with installation permission_barrier() { if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then - cprint cyan "No components currently installed — skipping permission check." + cprint cyan "当前没有安装组件-跳过权限检查." return 0 fi @@ -579,29 +579,29 @@ permission_barrier() { # Step 0: Ensure installed user is detected if [[ -z "$installed_user" ]]; then - cprint red bold "Detected that '$component' is installed but could not determine the user from its systemd service file." - cprint red "This may indicate a custom or unsupported service file setup." - cprint red "Refusing to proceed to avoid potential conflicts." + cprint red bold "检测到 '$component' 已安装,但无法从其systemd服务文件确定用户." + cprint red "这可能表示自定义或不支持的服务文件设置." + cprint red "拒绝执行以避免潜在的冲突." exit 1 fi # Step 1: User match check with optional force override if [[ "$installed_user" != "$install_user" ]]; then if [[ "$force_permission" == true ]]; then - cprint yellow bold "Permission mismatch for '$component':" - cprint yellow "Installed as user: $installed_user" - cprint yellow "Target install user: $install_user" - cprint yellow "User mismatch, but --force-permission is set. Continuing and updating permissions..." + cprint yellow bold "权限不匹配 '$component':" + cprint yellow "以用户身份安装: $installed_user" + cprint yellow "目标安装用户: $install_user" + cprint yellow "用户不匹配,但设置了--force-permission。继续和更新权限…" sleep 3 else - cprint red bold "Permission mismatch for '$component':" - cprint red "Installed as user: $installed_user" - cprint red "Current install target user: $install_user" - cprint red "Unable to proceed due to ownership conflict. Use --force-permission to override and update file permission." + cprint red bold "权限不匹配 '$component':" + cprint red "以用户身份安装: $installed_user" + cprint red "目标安装用户: $install_user" + cprint red "用户不匹配,但设置了--force-permission。继续和更新权限..." exit 1 fi else - cprint green bold "Permission check passed: '$installed_user' matches target user." + cprint green bold "权限检查已通过: '$installed_user' 匹配目标用户." fi fi @@ -612,30 +612,30 @@ permission_barrier() { dir_owner=$(stat -c '%U' "$install_dir" 2>/dev/null) if [[ -z "$dir_owner" ]]; then - cprint red bold "Unable to determine owner of install_dir: $install_dir" + cprint red bold "无法确定安装目录的所有者: $install_dir" exit 1 fi if [[ "$dir_owner" != "$install_user" ]]; then if [[ "$force_permission" == true ]]; then - cprint yellow bold "Install directory ownership mismatch:" - cprint yellow " Directory: $install_dir" - cprint yellow " Owned by: $dir_owner" - cprint yellow " Expected: $install_user" - cprint yellow " --force-permission is set. Continuing despite mismatch." + cprint yellow bold "安装目录所有权不匹配:" + cprint yellow " 目录: $install_dir" + cprint yellow " 归: $dir_owner" + cprint yellow " 预期: $install_user" + cprint yellow " --force-permission设置。尽管不匹配,但继续." sleep 3 else - cprint red bold "Install directory ownership mismatch:" - cprint red " Directory: $install_dir" - cprint red " Owned by: $dir_owner" - cprint red " Expected: $install_user" + cprint red bold "安装目录所有权不匹配:" + cprint red " 目录: $install_dir" + cprint red " 归: $dir_owner" + cprint red " 预期: $install_user" exit 1 fi else - cprint green bold "Install directory ownership check passed: '$install_dir' is owned by '$install_user'." + cprint green bold "安装目录所有权检查通过: '$install_dir' is owned by '$install_user'." fi - cprint green bold "Permissions and ownership validated. Proceeding." + cprint green bold "验证了权限和所有权。继续." return 0 } @@ -655,7 +655,7 @@ resolve_node_arch() { node_arch="armv7l" ;; *) - cprint red bold "Unsupported architecture for Node.js: $arch" + cprint red bold "Node.js不支持的架构: $arch" return 1 ;; esac @@ -663,8 +663,8 @@ resolve_node_arch() { # Assign node_path based on resolved arch and current version/install dir node_path="${node_install_dir}/node-${node_version}-linux-${node_arch}" - cprint cyan "Resolved Node.js architecture: $node_arch" - cprint cyan "Node.js install path: $node_path" + cprint cyan "解析了Node.js架构: $node_arch" + cprint cyan "Node.js安装路径: $node_path" } # Check if Node.js at PATH is valid. @@ -722,27 +722,27 @@ check_node_installed() { case $result in 0) - cprint green bold "Node.js and npm found at $node_path (version $required_node_ver or compatible)" + cprint green bold "Node.js和npm在 $node_path (版本 $required_node_ver 或兼容)" install_node=false ;; 1) - cprint yellow bold "Node.js binary not found or unusable at $node_path" + cprint yellow bold "Node.js二进制文件未找到或无法使用 $node_path" install_node=true ;; 2) - cprint red bold "Node.js version at $node_path is too old. Required: >= $required_node_ver" + cprint red bold "Node.js版本 $node_path 太老. 要求: >= $required_node_ver" install_node=true ;; 3) - cprint red bold "Node.js version mismatch. Required: $required_node_ver, found something else." + cprint red bold "Node.js版本不匹配。要求: $required_node_ver, 发现了其他的Node.js版本." install_node=true ;; 4) - cprint red bold "Node.js is present but npm is missing or broken." + cprint red bold "Node.js存在,但npm缺失或损坏." install_node=true ;; *) - cprint red bold "Unexpected error in node verification." + cprint red bold "Node验证中出现意外错误." install_node=true ;; esac @@ -752,10 +752,10 @@ check_node_installed() { postcheck_node_after_install() { verify_node_at_path "$node_path" if [[ $? -ne 0 ]]; then - cprint red bold "Node.js installation failed or is invalid at $node_path" + cprint red bold "Node.js安装失败或无效 $node_path" return 1 else - cprint green bold "Node.js is installed and functioning at $node_path" + cprint green bold "Node.js的安装和运行在 $node_path" return 0 fi } @@ -768,70 +768,70 @@ install_node() { local download_url="${node_download_url_base}${node_version}/${archive_name}" local fallback="$node_download_fallback" - cprint cyan bold "Installing Node.js $node_version for arch: $node_arch" + cprint cyan bold "安装Node.js $node_version 架构: $node_arch" mkdir -p "$node_install_dir" || { - cprint red bold "Failed to create node install directory: $node_install_dir" + cprint red bold "创建Node安装目录失败: $node_install_dir" return 1 } # Download - cprint cyan "Downloading Node.js from: $download_url" + cprint cyan "下载Node.js: $download_url" if ! wget --progress=bar:force -O "$archive_path" "$download_url"; then - cprint yellow "Primary download failed. Attempting fallback..." + cprint yellow "主下载失败。尝试备用下载……" if [[ -n "$fallback" ]]; then if [[ "$fallback" =~ ^https?:// ]]; then - cprint cyan "Downloading from fallback URL: $fallback" + cprint cyan "从备用URL下载: $fallback" if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then - cprint red bold "Fallback download failed from: $fallback" + cprint red bold "备用下载失败: $fallback" return 1 fi elif [ -f "$fallback" ]; then - cprint cyan "Copying from local fallback: $fallback" + cprint cyan "从本地备份进行复制: $fallback" cp "$fallback" "$archive_path" || { - cprint red bold "Failed to copy fallback Node.js archive from $fallback" + cprint red bold "复制备用Node.js存档失败 $fallback" return 1 } else - cprint red bold "Invalid fallback path: $fallback" + cprint red bold "无效的备用路径: $fallback" return 1 fi else - cprint red bold "No fallback source configured. Cannot proceed." + cprint red bold "没有配置备用源。不能继续进行." return 1 fi fi # Extract archive - cprint cyan "Extracting Node.js archive..." + cprint cyan "提取Node.js存档..." if ! tar -xf "$archive_path" -C "$node_install_dir"; then - cprint red bold "Failed to extract Node.js archive." + cprint red bold "提取Node.js文件失败." return 1 fi chmod -R a+rx "$target_dir" || { - cprint red bold "Failed to set execute permissions on Node.js files." + cprint red bold "在Node.js文件上设置执行权限失败." return 1 } verify_node_at_path "$target_dir" local result=$? if [[ $result -ne 0 ]]; then - cprint red bold "Node.js installation failed verification." + cprint red bold "Node.js安装验证失败." return 1 fi - cprint cyan "Cleaning up archive..." + cprint cyan "清理文件……" rm -f "$archive_path" - cprint green bold "Node.js $node_version installed successfully at $target_dir" + cprint green bold "Node.js $node_version 安装成功 $target_dir" # Save resolved binary paths to global variables node_bin_path="${target_dir}/bin/node" npm_bin_path="${target_dir}/bin/npm" - cprint green "Node.js binary: $node_bin_path" - cprint green "npm binary: $npm_bin_path" + cprint green "Node.js 二进制文件: $node_bin_path" + cprint green "npm 二进制文件: $npm_bin_path" return 0 } @@ -843,29 +843,29 @@ download_mcsm() { local primary_url="${download_base_url}${archive_name}" local fallback="$download_fallback_url" - cprint cyan bold "Downloading MCSManager package..." + cprint cyan bold "下载MCSManager安装包…" # Step 1: Try downloading from primary URL if ! wget --progress=bar:force -O "$archive_path" "$primary_url"; then - cprint yellow "Primary download failed. Attempting fallback source..." + cprint yellow "主下载失败。尝试备用资源…" if [[ -z "$fallback" ]]; then - cprint red bold "No fallback URL or path specified." + cprint red bold "没有指定备用URL或路径." return 1 fi if [[ "$fallback" =~ ^https?:// ]]; then if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then - cprint red bold "Fallback download failed from $fallback" + cprint red bold "备用下载失败 $fallback" return 1 fi elif [[ -f "$fallback" ]]; then cp "$fallback" "$archive_path" || { - cprint red bold "Failed to copy fallback archive from $fallback" + cprint red bold "未能复制备用文件 $fallback" return 1 } else - cprint red bold "Fallback path is invalid: $fallback" + cprint red bold "备用路径无效: $fallback" return 1 fi fi @@ -876,18 +876,18 @@ download_mcsm() { local extracted_tmp_path="${tmp_dir}/mcsm_${suffix}" if [[ -e "$extracted_tmp_path" ]]; then - cprint red bold "Temporary extract path already exists: $extracted_tmp_path" + cprint red bold "临时提取路径已存在: $extracted_tmp_path" return 1 fi mkdir -p "$extracted_tmp_path" || { - cprint red bold "Failed to create temporary extract directory: $extracted_tmp_path" + cprint red bold "创建临时解压目录失败: $extracted_tmp_path" return 1 } - cprint cyan "Extracting archive to $extracted_tmp_path..." + cprint cyan "将存档提取到 $extracted_tmp_path..." if ! tar -xzf "$archive_path" -C "$extracted_tmp_path"; then - cprint red bold "Failed to extract archive." + cprint red bold "提取存档失败." rm -rf "$extracted_tmp_path" return 1 fi @@ -898,82 +898,82 @@ download_mcsm() { install_tmp_dir="${install_dir}/mcsm_${suffix}" if [[ -e "$install_tmp_dir" ]]; then - cprint red bold "Install target already exists at $install_tmp_dir" - cprint red " Please remove or rename it before proceeding." + cprint red bold "安装目标已经存在 $install_tmp_dir" + cprint red " 请在继续之前删除或重命名它." return 1 fi mv "$extracted_tmp_path" "$install_tmp_dir" || { - cprint red bold "Failed to move extracted files to $install_tmp_dir" + cprint red bold "未能将解压缩的文件移动到 $install_tmp_dir" return 1 } - cprint green bold "MCSManager source extracted and moved to: $install_tmp_dir" + cprint green bold "MCSManager源提取并移动到: $install_tmp_dir" return 0 } # Prepare user if needed prepare_user() { if [[ "$install_user" == "root" ]]; then - cprint cyan "install_user is 'root' — skipping user creation." + cprint cyan "安装用户是'root' -跳过用户创建." return 0 fi # Check if user already exists if id "$install_user" &>/dev/null; then - cprint green "User '$install_user' already exists." + cprint green "用户 '$install_user' 已经存在." else - cprint cyan "Creating system user: $install_user (nologin, no password)..." + cprint cyan "创建系统用户: $install_user (无登录,无密码)..." if ! useradd --system --home "$install_dir" --shell /usr/sbin/nologin "$install_user"; then - cprint red bold "Failed to create user: $install_user" + cprint red bold "创建用户失败: $install_user" exit 1 fi - cprint green "User '$install_user' created." + cprint green "用户 '$install_user' 已创建." fi # Docker integration if command -v docker &>/dev/null; then - cprint cyan "Docker is installed — checking group assignment..." + cprint cyan "Docker已被安装 -检查组分配…" if getent group docker &>/dev/null; then if id -nG "$install_user" | grep -qw docker; then - cprint green "User '$install_user' is already in the 'docker' group." + cprint green "用户 '$install_user' 已经在“docker”组中." else - cprint cyan "Adding user '$install_user' to 'docker' group..." + cprint cyan "添加用户 '$install_user' 到 'docker' 组..." if usermod -aG docker "$install_user"; then - cprint green "Docker group access granted to '$install_user'." + cprint green "授予的Docker组访问权限 '$install_user'." else - cprint red "Failed to add '$install_user' to 'docker' group. Docker may not be usable by this user." + cprint red "未能添加 '$install_user' 给“Docker”组。这个用户可能无法使用Docker." fi fi else - cprint red "Docker installed but 'docker' group not found. Skipping group assignment." + cprint red "安装了Docker,但没有找到Docker组。跳过组分配." fi else - cprint yellow "Docker not installed — skipping Docker group configuration." + cprint yellow "未安装Docker -跳过Docker组配置." fi return 0 } # Function to stop MCSM services if they exist stop_mcsm_services() { - cprint yellow bold "Attempting to stop mcsm-web and mcsm-daemon services..." + cprint yellow bold "试图停止mcsm-web和mcsm-daemon服务..." # Attempt to stop mcsm-web - cprint blue "Stopping mcsm-web..." + cprint blue "正在停止 mcsm-web..." if systemctl stop mcsm-web; then - cprint green "mcsm-web stopped successfully." + cprint green "mcsm-web 已停止." else - cprint red bold "Warning: Failed to stop mcsm-web (may not exist or already stopped)." + cprint red bold "警告:未能停止mcsm-web(可能不存在或已停止)." fi # Attempt to stop mcsm-daemon - cprint blue "Stopping mcsm-daemon..." + cprint blue "正在停止 mcsm-daemon..." if systemctl stop mcsm-daemon; then - cprint green "mcsm-daemon stopped successfully." + cprint green "mcsm-daemon 已停止." else - cprint red bold "Warning: Failed to stop mcsm-daemon (may not exist or already stopped)." + cprint red bold "警告:未能停止mcsm-daemon(可能不存在或已停止)." fi } # Prepare file & permissions before install. @@ -983,13 +983,13 @@ mcsm_install_prepare() { stop_mcsm_services if [[ ! -d "$install_tmp_dir" ]]; then - cprint red bold "install_tmp_dir does not exist: $install_tmp_dir" + cprint red bold "临时安装目录不存在: $install_tmp_dir" exit 1 fi - cprint cyan "Changing ownership of $install_tmp_dir to user '$install_user'..." + cprint cyan "改变所有权 $install_tmp_dir 到用户 '$install_user'..." chown -R "$install_user":"$install_user" "$install_tmp_dir" || { - cprint red bold "Failed to change ownership of $install_tmp_dir" + cprint red bold "所有权变更失败 $install_tmp_dir" cleanup_install_tmp exit 1 } @@ -998,11 +998,11 @@ mcsm_install_prepare() { [[ "${install_dir}" != */ ]] && install_dir="${install_dir}/" if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then - cprint cyan "No existing components detected — skipping data backup/cleanup." + cprint cyan "没有检测到现有组件-跳过数据备份/清理." return 0 fi - cprint green bold "Existing components prepared successfully." + cprint green bold "已成功准备现有组件." return 0 } @@ -1013,49 +1013,49 @@ install_component() { local backup_data_path="${install_dir}${backup_prefix}${component}" local source_path="${install_tmp_dir}/mcsmanager/${component}" - cprint cyan bold "Installing/Updating component: $component" + cprint cyan bold "安装/更新组件: $component" # Step 1: Move new component to install_dir if [[ ! -d "$source_path" ]]; then - cprint red bold "Source directory not found: $source_path" + cprint red bold "找不到源目录: $source_path" cleanup_install_tmp exit 1 fi if cp -a "$source_path"/. "$target_path"; then - cprint green "Updated files from $source_path → $target_path" + cprint green "更新的文件 $source_path → $target_path" rm -rf "$source_path" else - cprint red bold "Failed to update files from $source_path → $target_path" + cprint red bold "更新文件失败 $source_path → $target_path" cleanup_install_tmp exit 1 fi - cprint green "Moved $component to $target_path" + cprint green "已移动 $component 到 $target_path" # Step 3: Install NPM dependencies if [[ ! -x "$npm_bin_path" ]]; then - cprint red bold "npm binary not found or not executable: $npm_bin_path" + cprint red bold "找不到npm二进制文件或无法执行: $npm_bin_path" cleanup_install_tmp exit 1 fi - cprint cyan "Installing dependencies for $component using npm..." + cprint cyan "正在使用npm安装依赖库 $component ..." pushd "$target_path" >/dev/null || { - cprint red bold "Failed to change directory to $target_path" + cprint red bold "更改目录失败 $target_path" cleanup_install_tmp exit 1 } if ! "$node_bin_path" "$npm_bin_path" install --no-audit --no-fund --loglevel=warn; then - cprint red bold "NPM dependency installation failed for $component" + cprint red bold "NPM依赖项安装失败 $component" popd >/dev/null cleanup_install_tmp exit 1 fi popd >/dev/null - cprint green bold "Component '$component' installed/updated successfully." + cprint green bold "组件 '$component' 安装/更新成功." } # Create systemd service for a given component. @@ -1067,12 +1067,12 @@ create_systemd_service() { local exec="${node_bin_path} app.js" if [[ ! -d "$working_dir" ]]; then - cprint red bold "Component directory not found: $working_dir" + cprint red bold "找不到组件目录: $working_dir" cleanup_install_tmp return 1 fi - cprint cyan "Creating systemd service for '$component'..." + cprint cyan "创建systemd服务 '$component'..." cat > "$service_path" </dev/null | awk '{print $1}') - [[ -z "$ip_address" ]] && ip_address="YOUR-IP" + [[ -z "$ip_address" ]] && ip_address="你的IP" # Daemon info if [[ "$install_daemon" == true ]]; then local daemon_address="ws://$ip_address:${daemon_port:-Failed to Retrieve from Config file}" local daemon_key_display="${daemon_key:-Failed to Retrieve from Config file}" - cprint yellow noprefix "Daemon Address:" + cprint yellow noprefix "守护进程地址:" cprint white noprefix " $daemon_address" - cprint yellow noprefix "Daemon Key:" + cprint yellow noprefix "守护进程秘钥:" cprint white noprefix " $daemon_key_display" echo "" fi @@ -1229,20 +1229,20 @@ print_install_result() { # Web info if [[ "$install_web" == true ]]; then local web_address="http://$ip_address:${web_port:-Failed to Retrieve from Config file}" - cprint yellow noprefix "HTTP Web Interface:" + cprint yellow noprefix "HTTP面板地址:" cprint white noprefix nonl " $web_address " - cprint yellow noprefix "(open in browser)" + cprint yellow noprefix "(在你的浏览器中打开)" echo "" fi # Port guidance - cprint yellow noprefix "NOTE:" - cprint white noprefix " Make sure to expose the above ports through your firewall." - cprint white noprefix " If accessing from outside your network, you may need to configure port forwarding on your router." + cprint yellow noprefix "注意:" + cprint white noprefix " 确保防火墙放行上述端口." + cprint white noprefix " 如果从外部网络访问,您可能需要在路由器上配置端口转发." echo "" # Service management help - cprint yellow noprefix "Service Management Commands:" + cprint yellow noprefix "MCSManager管理命令:" if [[ "$install_daemon" == true ]]; then cprint white noprefix nonl " systemctl start " cprint yellow noprefix "mcsm-daemon.service" @@ -1266,23 +1266,23 @@ print_install_result() { echo "" # Official doc - cprint yellow noprefix "Official Documentation:" - cprint white noprefix " https://docs.mcsmanager.com/" + cprint yellow noprefix "官方文档:" + cprint white noprefix " https://docs.mcsmanager.com/zh_cn/" echo "" # HTTPS support - cprint yellow noprefix "Need HTTPS?" - cprint white noprefix " To enable secure HTTPS access, configure a reverse proxy:" - cprint white noprefix " https://docs.mcsmanager.com/ops/proxy_https.html" + cprint yellow noprefix "需要HTTPS?" + cprint white noprefix " 为了开启HTTPS安全访问,需要配置反向代理:" + cprint white noprefix " https://docs.mcsmanager.com/zh_cn/ops/proxy_https.html" echo "" if [[ "$force_permission" == true ]]; then - cprint red noprefix "[Important] You chose to override permission during install." - cprint red noprefix " You may need to run: chown -R $install_user to update permission manually." + cprint red noprefix "[重点] 您选择在安装期间重写权限." + cprint red noprefix " 你可能需要运行: chown -R $install_user 手动更新权限." fi # Closing message - cprint green noprefix "Installation completed. Enjoy managing your servers with MCSManager!" + cprint green noprefix "安装完成。享受使用MCSManager管理服务器的乐趣!" echo "" } @@ -1303,18 +1303,18 @@ install_mcsm() { # Reload systemd after any service file changes if (( ${#components[@]} > 0 )); then - cprint cyan "Reloading systemd daemon..." + cprint cyan "重新加载systemd守护进程..." # systemctl daemon-reexec systemctl daemon-reload for comp in "${components[@]}"; do local svc="mcsm-${comp}.service" - cprint cyan "Enabling service: $svc" + cprint cyan "启用服务: $svc" if systemctl enable "$svc" &>/dev/null; then - cprint green "Enabled service: $svc" + cprint green "已启用服务: $svc" else - cprint red bold "Failed to enable service: $svc" + cprint red bold "启用服务失败: $svc" cleanup_install_tmp exit 1 fi @@ -1324,34 +1324,34 @@ install_mcsm() { # Clean tmp dir cleanup_install_tmp # Extract installed component info - safe_run extract_component_info "Failed to extract runtime info from installed services" - safe_run print_install_result "Failed to print installation result" + safe_run extract_component_info "未能从已安装的服务中提取运行时信息" + safe_run print_install_result "未能打印安装结果" } main() { - trap 'echo "Unexpected error occurred."; exit 99' ERR - safe_run detect_terminal_capabilities "Failed to detect terminal capabilities" - safe_run check_root "Script must be run as root" - safe_run parse_args "Failed to parse arguments" "$@" - safe_run detect_os_info "Failed to detect OS" + trap 'echo "发生意外错误."; exit 99' ERR + safe_run detect_terminal_capabilities "检测终端功能失败" + safe_run check_root "脚本必须以root身份运行" + safe_run parse_args "解析参数失败" "$@" + safe_run detect_os_info "OS检测失败" # To be moved to a master pre check function. - safe_run resolve_node_arch "Failed to resolve Node.js architecture" + safe_run resolve_node_arch "解析Node.js架构失败" - safe_run check_required_commands "Missing required system commands" + safe_run check_required_commands "缺少必要的系统命令" - safe_run check_node_installed "Failed to detect Node.js or npm at expected path. Node.js will be installed." + safe_run check_node_installed "在预期目录上检测到Node.js或npm失败。Node.js将被安装." if [ "$install_node" = true ]; then - safe_run install_node "Node.js installation failed" + safe_run install_node "Node.js安装失败" fi - safe_run permission_barrier "Permission validation failed — aborting install" + safe_run permission_barrier "权限验证失败-中止安装" - safe_run prepare_user "Failed to prepare user permission." + safe_run prepare_user "准备用户权限失败。处理步骤." - safe_run download_mcsm "Failed to acquire MCSManager source" - safe_run mcsm_install_prepare "Error while preparing for installation" + safe_run download_mcsm "获取MCSManager源失败。处理步骤" + safe_run mcsm_install_prepare "准备安装时出错" - safe_run install_mcsm "Failed to install MCSManager" + safe_run install_mcsm "未能安装 MCSManager" } main "$@" \ No newline at end of file From 21fd75fbb72e83a24f8d676a53b988cc4db4746a Mon Sep 17 00:00:00 2001 From: SkyKing_PX Date: Mon, 1 Dec 2025 06:50:33 +0000 Subject: [PATCH 435/463] Updated Market --- market.json | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/market.json b/market.json index 2b4c954..be66063 100644 --- a/market.json +++ b/market.json @@ -492,11 +492,11 @@ "hardware": "RAM 8G+", "size": "100MB", "remark": "Minecraft Paper", - "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.10/builds/84/downloads/paper-1.21.10-84.jar", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.10/builds/117/downloads/paper-1.21.10-117.jar", "author": "papermc.io", "setupInfo": { "type": "minecraft/java/paper", - "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.10-84.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.10-117.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -585,11 +585,11 @@ "hardware": "RAM 8G+", "size": "55MB", "remark": "Minecraft Purpur", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.10-2511-experimental.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.10-2531.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.10-2511-experimental.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.10-2531.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -655,13 +655,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.0.11/forge-1.21.10-60.0.11-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.1.0/forge-1.21.10-60.1.0-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.10-60.0.11-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.10-60.1.0-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -678,13 +678,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.0.11/forge-1.21.10-60.0.11-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.1.0/forge-1.21.10-60.1.0-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.10-60.0.11-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.10-60.1.0-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -701,13 +701,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.7/forge-1.21.8-58.1.7-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.9/forge-1.21.8-58.1.9-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.8-58.1.7-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.8-58.1.9-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -724,13 +724,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.7/forge-1.21.8-58.1.7-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.9/forge-1.21.8-58.1.9-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.8-58.1.7-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.8-58.1.9-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -840,13 +840,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.10.32-beta/neoforge-21.10.32-beta-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.10.63/neoforge-21.10.63-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.10.32-beta-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.10.63-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -863,13 +863,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.10.32-beta/neoforge-21.10.32-beta-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.10.63/neoforge-21.10.63-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": ".\\run.bat", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.10.32-beta-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.10.63-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -886,13 +886,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.48/neoforge-21.8.48-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.52/neoforge-21.8.52-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.8.48-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.8.52-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -909,13 +909,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft NeoForge", - "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.48/neoforge-21.8.48-installer.jar", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.52/neoforge-21.8.52-installer.jar", "author": "neoforged.net", "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": ".\\run.bat", "stopCommand": "stop", - "updateCommand": "java -jar neoforge-21.8.48-installer.jar --installServer", + "updateCommand": "java -jar neoforge-21.8.52-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } From 62a2fcfa40c7aa983307907a0d3e873584932bac Mon Sep 17 00:00:00 2001 From: Creeper <62986412+Fhokud@users.noreply.github.com> Date: Thu, 11 Dec 2025 15:16:57 +0800 Subject: [PATCH 436/463] Add Factorio Add Factorio --- market.json | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/market.json b/market.json index be66063..c03dc86 100644 --- a/market.json +++ b/market.json @@ -1560,5 +1560,75 @@ } } } + { + "title": "Factorio 服务器", + "language": "zh_cn", + "platform": "Linux", + "description": "使用 Factorio 第三方 Docker 镜像,快速开服!", + "image": "https://cdn.factorio.com/assets/img/web/factorio-logo2.png", + "gameType": "Factorio", + "category": "最新版本", + "runtime": "Windows/Linux", + "hardware": "X86_64、RAM 4G+", + "size": "", + "targetLink": "", + "author": "TPing", + "tags": ["Docker 版"], + "setupInfo": { + "startCommand": "", + "stopCommand": "^C", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": ["Factorio"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "factoriotools/factorio:latest", + "containerName": "factorio-server", + "ports": ["{mcsm_port1}:34197/udp"], + "extraVolumes": [], + "workingDir": "/factorio", + "env": [], + "changeWorkdir": false + } + } + }, + { + "title": "Factorio Docker Server", + "language": "en_us", + "platform": "Linux", + "description": "Use Factorio third-party Docker images to quickly get started!", + "image": "https://cdn.factorio.com/assets/img/web/factorio-logo2.png", + "gameType": "Factorio", + "category": "Latest Version", + "runtime": "Windows/Linux", + "hardware": "X86_64、RAM 4G+", + "size": "", + "targetLink": "", + "author": "TPing", + "tags": ["Docker version"], + "setupInfo": { + "startCommand": "", + "stopCommand": "^C", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": ["Factorio"], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "factoriotools/factorio:latest", + "containerName": "factorio-server", + "ports": ["{mcsm_port1}:34197/udp"], + "extraVolumes": [], + "workingDir": "/factorio", + "env": [], + "changeWorkdir": false + } + } + } ] } From 988e97755a696c33ca3dab6bc77a64d64c6d3dc4 Mon Sep 17 00:00:00 2001 From: Creeper <62986412+Fhokud@users.noreply.github.com> Date: Thu, 11 Dec 2025 15:39:46 +0800 Subject: [PATCH 437/463] Clear containerName field in docker settings Removed container name from docker configuration. --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index c03dc86..d0959db 100644 --- a/market.json +++ b/market.json @@ -1586,7 +1586,7 @@ "updateCommand": "", "docker": { "image": "factoriotools/factorio:latest", - "containerName": "factorio-server", + "containerName": "", "ports": ["{mcsm_port1}:34197/udp"], "extraVolumes": [], "workingDir": "/factorio", @@ -1621,7 +1621,7 @@ "updateCommand": "", "docker": { "image": "factoriotools/factorio:latest", - "containerName": "factorio-server", + "containerName": "", "ports": ["{mcsm_port1}:34197/udp"], "extraVolumes": [], "workingDir": "/factorio", From d3a7ec58e3c2a4ceaa109c8f77fc7e113b0f1a69 Mon Sep 17 00:00:00 2001 From: Creeper <62986412+Fhokud@users.noreply.github.com> Date: Thu, 11 Dec 2025 16:02:30 +0800 Subject: [PATCH 438/463] Fix JSON Fix JSON --- market.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/market.json b/market.json index d0959db..86dfe4e 100644 --- a/market.json +++ b/market.json @@ -1559,7 +1559,7 @@ "changeWorkdir": false } } - } + }, { "title": "Factorio 服务器", "language": "zh_cn", From 3411c93e765231ad4c30144b718d1195227f12c6 Mon Sep 17 00:00:00 2001 From: Creeper <62986412+Fhokud@users.noreply.github.com> Date: Thu, 11 Dec 2025 16:10:33 +0800 Subject: [PATCH 439/463] Fix error RUST extraVolumes Change volume separator from ':' to '|' in market.json --- market.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/market.json b/market.json index 86dfe4e..c235aa9 100644 --- a/market.json +++ b/market.json @@ -1511,9 +1511,9 @@ "containerName": "rust-server", "ports": ["{mcsm_port1}:28015/udp", "{mcsm_port2}:28016/udp"], "extraVolumes": [ - "{mcsm_workspace}/server:/server", - "{mcsm_workspace}/config:/app/.config/unity3d/Facepunch/Rust", - "{mcsm_workspace}/data:/data" + "{mcsm_workspace}/server|/server", + "{mcsm_workspace}/config|/app/.config/unity3d/Facepunch/Rust", + "{mcsm_workspace}/data|/data" ], "workingDir": "", "env": [], @@ -1550,9 +1550,9 @@ "containerName": "rust-server", "ports": ["{mcsm_port1}:28015/udp", "{mcsm_port2}:28016/udp"], "extraVolumes": [ - "{mcsm_workspace}/server:/server", - "{mcsm_workspace}/config:/app/.config/unity3d/Facepunch/Rust", - "{mcsm_workspace}/data:/data" + "{mcsm_workspace}/server|/server", + "{mcsm_workspace}/config|/app/.config/unity3d/Facepunch/Rust", + "{mcsm_workspace}/data|/data" ], "workingDir": "", "env": [], From 510d0dfb027c97b803b9d9927137430d938d322b Mon Sep 17 00:00:00 2001 From: Yumao Date: Fri, 12 Dec 2025 17:59:40 +0800 Subject: [PATCH 440/463] Update setup_cn.sh --- setup_cn.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup_cn.sh b/setup_cn.sh index 95a681d..2107045 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -15,7 +15,7 @@ install_dir="/opt/mcsmanager" # Primary download URL bas. Full package URL = download_base_url + package_name -download_base_url="https://download.mcsmanager.com/" +download_base_url="https://cdn.imlazy.ink:233/files/" # Fallback download URL (can also be a local directory or mirror) download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" @@ -1354,4 +1354,4 @@ main() { safe_run install_mcsm "未能安装 MCSManager" } -main "$@" \ No newline at end of file +main "$@" From 0a80788f7184ecccd2676e284e06b178c9d49d58 Mon Sep 17 00:00:00 2001 From: Yumao Date: Sat, 13 Dec 2025 16:41:09 +0800 Subject: [PATCH 441/463] Update setup_cn.sh --- setup_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index 2107045..ce61c77 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -15,7 +15,7 @@ install_dir="/opt/mcsmanager" # Primary download URL bas. Full package URL = download_base_url + package_name -download_base_url="https://cdn.imlazy.ink:233/files/" +download_base_url="https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/" # Fallback download URL (can also be a local directory or mirror) download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" From 264f2d2a1aaba64c1638d5031f659319e5026802 Mon Sep 17 00:00:00 2001 From: gerjies <3839502757@qq.com> Date: Tue, 16 Dec 2025 20:57:08 +0800 Subject: [PATCH 442/463] Update market.json --- market.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/market.json b/market.json index c235aa9..48856dd 100644 --- a/market.json +++ b/market.json @@ -1226,6 +1226,31 @@ "oe": "utf-8" } }, + { + "title": "SCP秘密实验室 服务器", + "language": "zh_cn", + "platform": "Liunx", + "description": "SCP秘密实验室服务器,适用于 Liunx 系统", + "image": "https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/700330/dad38399643cda1a4084b1faff60452427bef8c0/header.jpg?t=1747606719", + "remark": "第一次启动需要在控制台配置。服务器设置路径:/home/{你的用户名}/.config/SCP Secret Laboratory/config/{启动时控制台设置的端口}", + "gameType": "SCP秘密实验室", + "category": "最新版本", + "runtime": "Windows 10+", + "hardware": "RAM 8G+", + "size": "1GB", + "targetLink": "", + "author": "mmyddd", + "tags": ["仅适合个人使用", "Liunx 版"], + "setupInfo": { + "tag": ["SCP秘密实验室"], + "type": "steam/universal", + "startCommand": "LocalAdmin", + "stopCommand": "stop", + "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 996560 +quit", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "title": "Sons Of The Forest Official Server", "language": "en_us", From 77fe2dafc48b4d85298afe69ddccd3a56ae402a8 Mon Sep 17 00:00:00 2001 From: SkyKing_PX Date: Wed, 17 Dec 2025 09:11:26 +0000 Subject: [PATCH 443/463] Updated Market & Added 1.21.11 --- market.json | 196 ++++++++++++++++++++++++++++++++++-- templates.json | 264 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 454 insertions(+), 6 deletions(-) diff --git a/market.json b/market.json index c235aa9..e745dff 100644 --- a/market.json +++ b/market.json @@ -480,6 +480,29 @@ } }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.11 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PaperMC] Minecraft 1.21.11", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "100MB", + "remark": "Minecraft Paper", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.11/builds/39/downloads/paper-1.21.11-39.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.11-39.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "ALL", "language": "en_us", @@ -573,6 +596,29 @@ } }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.11", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "55MB", + "remark": "Minecraft Purpur", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.11-2538.jar", + "author": "purpurmc.org", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.11-2538.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "ALL", "language": "en_us", @@ -585,11 +631,11 @@ "hardware": "RAM 8G+", "size": "55MB", "remark": "Minecraft Purpur", - "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.10-2531.jar", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.10-2535.jar", "author": "purpurmc.org", "setupInfo": { "type": "minecraft/java/purpur", - "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.10-2531.jar nogui", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.10-2535.jar nogui", "stopCommand": "stop", "updateCommand": "", "ie": "utf-8", @@ -643,6 +689,52 @@ } }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 Forge Quick Server Setup, Mod Support for Linux", + "title": "[Forge] Minecraft 1.21.11", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.11-61.0.3/forge-1.21.11-61.0.3-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.11-61.0.3-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 Forge Quick Server Setup, Mod Support for Windows", + "title": "[Forge] Minecraft 1.21.11", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.11-61.0.3/forge-1.21.11-61.0.3-installer.jar", + "author": "minecraftforge.net", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.11-61.0.3-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "Linux", "language": "en_us", @@ -655,13 +747,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.1.0/forge-1.21.10-60.1.0-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.1.5/forge-1.21.10-60.1.5-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.10-60.1.0-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.10-60.1.5-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -678,13 +770,13 @@ "hardware": "RAM 8G+", "size": "7MB", "remark": "Minecraft Forge", - "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.1.0/forge-1.21.10-60.1.0-installer.jar", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.1.5/forge-1.21.10-60.1.5-installer.jar", "author": "minecraftforge.net", "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", "stopCommand": "stop", - "updateCommand": "java -jar forge-1.21.10-60.1.0-installer.jar --installServer", + "updateCommand": "java -jar forge-1.21.10-60.1.5-installer.jar --installServer", "ie": "utf-8", "oe": "utf-8" } @@ -828,6 +920,52 @@ } }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 NeoForge Quick Server Setup, Mod Support for Linux", + "title": "[NeoForge] Minecraft 1.21.11", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.11.8-beta/neoforge-21.11.8-beta-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.11.8-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 NeoForge Quick Server Setup, Mod Support for Windows", + "title": "[NeoForge] Minecraft 1.21.11", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.11.8-beta/neoforge-21.11.8-beta-installer.jar", + "author": "neoforged.net", + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.11.8-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "Linux", "language": "en_us", @@ -1013,6 +1151,29 @@ } }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 Fabric Quick Server Setup, Mod Support", + "title": "[FabricMC] Minecraft 1.21.11", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", + "author": "fabricmc.net", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.11 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "ALL", "language": "en_us", @@ -1106,6 +1267,29 @@ } }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Standard Vanilla Minecraft 1.21.11 Server Setup (Official) - No Mod/Plugin Support", + "title": "[Vanilla] Minecraft 1.21.11", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/64bb6d763bed0a9f1d632ec347938594144943ed/server.jar", + "author": "Mojang Studios", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "platform": "ALL", "language": "en_us", diff --git a/templates.json b/templates.json index 156065c..d57e51e 100644 --- a/templates.json +++ b/templates.json @@ -11,6 +11,50 @@ } ], "packages": [ + { + "language": "en_us", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.11", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "55MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.11-2538.jar", + "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.11-2538.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.10", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "55MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.10-2535.jar", + "author": "purpurmc.org", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.10-2535.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "gameType": "Minecraft", @@ -231,6 +275,50 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Paper] Minecraft 1.21.11 Paper", + "title": "[PaperMC] Minecraft 1.21.11", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.11/builds/39/downloads/paper-1.21.11-39.jar", + "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.11-39.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Paper] Minecraft 1.21.10 Paper", + "title": "[PaperMC] Minecraft 1.21.10", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Only Paper included", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.10/builds/117/downloads/paper-1.21.10-117.jar", + "author": "papermc.io", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.10-117.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "gameType": "Minecraft", @@ -407,6 +495,50 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "[NeoForge] Minecraft 1.21.11", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.11.8-beta/neoforge-21.11.8-beta-installer.jar", + "author": "neoforged.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.11.8-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "[NeoForge] Minecraft 1.21.10", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.10.64/neoforge-21.10.64-installer.jar", + "author": "neoforged.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.10.64-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "gameType": "Minecraft", @@ -561,6 +693,50 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "[Forge] Minecraft 1.21.11", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.11-61.0.3/forge-1.21.11-61.0.3-installer.jar", + "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.11-61.0.3-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "Tip: The default startup command is \"sh ./run.sh\". If you need to run it on Windows, please change start command to \"run.bat\" after installation.", + "title": "[Forge] Minecraft 1.21.10", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.1.5/forge-1.21.10-60.1.5-installer.jar", + "author": "minecraftforge.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.10-60.1.5-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "gameType": "Minecraft", @@ -891,6 +1067,50 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 with Fabric Loader", + "title": "[FabricMC] Minecraft 1.21.11", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", + "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.11 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 with Fabric Loader", + "title": "[FabricMC] Minecraft 1.21.10", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", + "author": "fabricmc.net", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.10 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "gameType": "Minecraft", @@ -1155,6 +1375,50 @@ "oe": "utf-8" } }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Vanilla] Minecraft 1.21.11", + "title": "[Vanilla] Minecraft 1.21.11", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/64bb6d763bed0a9f1d632ec347938594144943ed/server.jar", + "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "language": "en_us", + "gameType": "Minecraft", + "description": "[Vanilla] Minecraft 1.21.10", + "title": "[Vanilla] Minecraft 1.21.10", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/95495a7f485eedd84ce928cef5e223b757d2f764/server.jar", + "author": "Mojang Studios", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, { "language": "en_us", "gameType": "Minecraft", From 1c32ef72023c5f61e1147ef8396bd20cb1a00f56 Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 21 Dec 2025 19:07:37 +0800 Subject: [PATCH 444/463] fix: download addr --- setup_cn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index ce61c77..2107045 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -15,7 +15,7 @@ install_dir="/opt/mcsmanager" # Primary download URL bas. Full package URL = download_base_url + package_name -download_base_url="https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/" +download_base_url="https://cdn.imlazy.ink:233/files/" # Fallback download URL (can also be a local directory or mirror) download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" From c415b278634559f086aafd3f6ee3902a32b2b1b5 Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 21 Dec 2025 19:39:05 +0800 Subject: [PATCH 445/463] fix: addr --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index e745dff..d254cfe 100644 --- a/market.json +++ b/market.json @@ -1671,7 +1671,7 @@ "language": "zh_cn", "platform": "Linux", "description": "使用 Rust 第三方 Docker 镜像,快速开服!", - "image": "https://api.nansai.cc/img/rust/header.jpg", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/rust.jpg", "gameType": "Rust", "category": "最新版本", "runtime": "Windows/Linux", @@ -1710,7 +1710,7 @@ "language": "en_us", "platform": "Linux", "description": "Use Rust third-party Docker images to quickly get started!", - "image": "https://api.nansai.cc/img/rust/header.jpg", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/rust.jpg", "gameType": "Rust", "category": "Latest Version", "runtime": "Windows/Linux", From 4b5bcd3cfd494fa3fc2f857dac3757f67ee86033 Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 28 Dec 2025 20:26:33 +0800 Subject: [PATCH 446/463] fix: update npm install command to use npmmirror registry --- setup_cn.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup_cn.sh b/setup_cn.sh index 2107045..b3f0c36 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1047,7 +1047,8 @@ install_component() { exit 1 } - if ! "$node_bin_path" "$npm_bin_path" install --no-audit --no-fund --loglevel=warn; then + + if ! "$node_bin_path" "$npm_bin_path" install --registry=https://registry.npmmirror.com --no-audit --no-fund --loglevel=warn; then cprint red bold "NPM依赖项安装失败 $component" popd >/dev/null cleanup_install_tmp From c6494726ad88aad4f3fa42f9892a9e7a75825493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=99=93=E8=A1=8C=20=28Zhang=20XiaoXing=29?= <15530012682@163.com> Date: Thu, 1 Jan 2026 17:18:40 +0800 Subject: [PATCH 447/463] Update Terraria server configuration in JSON Terraria server configuration for Windows x86 using TShock 5.2.4, targeting Terraria 1.4.4.9. Key Details: - Runtime: .NET 6+ - Hardware Requirements: 1GB RAM minimum - Platform: Windows (AMD64) - Server Software: TShock 5.2.4 - Game Version: Terraria 1.4.4.9 - Author: Dawn3901 Configuration Highlights: - Start command: `TShock.Server.exe` - Encoding: UTF-8 (input/output) - Terminal supports color output - Auto-start and auto-restart disabled by default - Docker support with bridge network mode - Ping configuration enabled (type 1) - RCON disabled Download: Available from the TShock GitHub releases page for Windows AMD64 architecture. This configuration is ready for deployment on Windows systems running .NET 6 or later. --- market.json | 319 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 251 insertions(+), 68 deletions(-) diff --git a/market.json b/market.json index cedb895..a14aba9 100644 --- a/market.json +++ b/market.json @@ -71,21 +71,28 @@ "size": "", "targetLink": "", "author": "MCSManager", - "tags": ["可以商业出租", "Docker 版"], + "tags": [ + "可以商业出租", + "Docker 版" + ], "setupInfo": { "startCommand": "", "stopCommand": "exit", "ie": "utf8", "oe": "utf8", "type": "steam/terraria", - "tag": ["terraria"], + "tag": [ + "terraria" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "", "docker": { "image": "ryshe/terraria:latest", "containerName": "terraria-server", - "ports": ["{mcsm_port1}:7777/tcp"], + "ports": [ + "{mcsm_port1}:7777/tcp" + ], "extraVolumes": [], "networkMode": "bridge", "cpuUsage": 100, @@ -108,13 +115,18 @@ "size": "", "targetLink": "", "author": "MCSManager", - "tags": ["可以商业出租", "Docker 版"], + "tags": [ + "可以商业出租", + "Docker 版" + ], "setupInfo": { "stopCommand": "stop", "ie": "utf8", "oe": "utf8", "type": "steam/universal", - "tag": ["Palworld"], + "tag": [ + "Palworld" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "", @@ -124,7 +136,10 @@ "networkMode": "bridge", "containerName": "palworld-server", "workingDir": "/opt/palworld/Pal/Saved", - "ports": ["{mcsm_port1}:8211/tcp", "{mcsm_port2}:25575/tcp"], + "ports": [ + "{mcsm_port1}:8211/tcp", + "{mcsm_port2}:25575/tcp" + ], "env": [ "SERVER_NAME=Private PalWorld Server", "SERVER_DESC=Private PalWorld Server", @@ -146,21 +161,29 @@ "size": "", "targetLink": "", "author": "MCSManager", - "tags": ["可以商业出租", "Docker 版"], + "tags": [ + "可以商业出租", + "Docker 版" + ], "setupInfo": { "startCommand": "", "stopCommand": "stop", "ie": "utf8", "oe": "utf8", "type": "steam/universal", - "tag": ["Project Zomboid"], + "tag": [ + "Project Zomboid" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "", "docker": { "image": "renegademaster/zomboid-dedicated-server:latest", "containerName": "zomboid-dedicated-server", - "ports": ["{mcsm_port2}:16262/udp", "{mcsm_port1}:16261/udp"], + "ports": [ + "{mcsm_port2}:16262/udp", + "{mcsm_port1}:16261/udp" + ], "extraVolumes": [ "{mcsm_workspace}/ZomboidConfig|/home/steam/Zomboid", "{mcsm_workspace}/ZomboidDedicatedServer|/home/steam/ZomboidDedicatedServer" @@ -184,21 +207,27 @@ "size": "", "targetLink": "", "author": "EndStone", - "tags": ["Docker version"], + "tags": [ + "Docker version" + ], "setupInfo": { "startCommand": "endstone -y -s .", "stopCommand": "stop", "ie": "utf8", "oe": "utf8", "type": "minecraft/bedrock", - "tag": ["bedrock"], + "tag": [ + "bedrock" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "", "docker": { "image": "endstone/endstone:latest", "containerName": "endstone-server", - "ports": ["{mcsm_port1}:19132/udp"], + "ports": [ + "{mcsm_port1}:19132/udp" + ], "extraVolumes": [], "workingDir": "", "env": [], @@ -275,7 +304,6 @@ "oe": "utf-8" } }, - { "language": "zh_cn", "platform": "Linux", @@ -381,21 +409,27 @@ "size": "", "targetLink": "", "author": "MCSManager", - "tags": ["Docker version"], + "tags": [ + "Docker version" + ], "setupInfo": { "startCommand": "", "stopCommand": "exit", "ie": "utf8", "oe": "utf8", "type": "steam/terraria", - "tag": ["terraria"], + "tag": [ + "terraria" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "", "docker": { "image": "ryshe/terraria:latest", "containerName": "terraria-server", - "ports": ["{mcsm_port1}:7777/tcp"], + "ports": [ + "{mcsm_port1}:7777/tcp" + ], "extraVolumes": [], "workingDir": "/root/.local/share/Terraria/Worlds", "env": [], @@ -416,13 +450,17 @@ "size": "", "targetLink": "", "author": "MCSManager", - "tags": ["Docker version"], + "tags": [ + "Docker version" + ], "setupInfo": { "stopCommand": "stop", "ie": "utf8", "oe": "utf8", "type": "steam/universal", - "tag": ["Palworld"], + "tag": [ + "Palworld" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "", @@ -432,7 +470,10 @@ "networkMode": "bridge", "containerName": "palworld-server", "workingDir": "/opt/palworld/Pal/Saved", - "ports": ["{mcsm_port1}:8211/tcp", "{mcsm_port2}:25575/tcp"], + "ports": [ + "{mcsm_port1}:8211/tcp", + "{mcsm_port2}:25575/tcp" + ], "env": [ "SERVER_NAME=Private PalWorld Server", "SERVER_DESC=Private PalWorld Server", @@ -454,21 +495,28 @@ "size": "", "targetLink": "", "author": "MCSManager", - "tags": ["Docker version"], + "tags": [ + "Docker version" + ], "setupInfo": { "startCommand": "", "stopCommand": "stop", "ie": "utf8", "oe": "utf8", "type": "steam/universal", - "tag": ["Project Zomboid"], + "tag": [ + "Project Zomboid" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "", "docker": { "image": "renegademaster/zomboid-dedicated-server:latest", "containerName": "zomboid-dedicated-server", - "ports": ["{mcsm_port2}:16262/udp", "{mcsm_port1}:16261/udp"], + "ports": [ + "{mcsm_port2}:16262/udp", + "{mcsm_port1}:16261/udp" + ], "extraVolumes": [ "{mcsm_workspace}/ZomboidConfig|/home/steam/Zomboid", "{mcsm_workspace}/ZomboidDedicatedServer|/home/steam/ZomboidDedicatedServer" @@ -479,7 +527,6 @@ } } }, - { "platform": "ALL", "language": "en_us", @@ -595,7 +642,6 @@ "oe": "utf-8" } }, - { "platform": "ALL", "language": "en_us", @@ -688,7 +734,6 @@ "oe": "utf-8" } }, - { "platform": "Linux", "language": "en_us", @@ -919,7 +964,6 @@ "oe": "utf-8" } }, - { "platform": "Linux", "language": "en_us", @@ -1150,7 +1194,6 @@ "oe": "utf-8" } }, - { "platform": "ALL", "language": "en_us", @@ -1266,7 +1309,6 @@ "oe": "utf-8" } }, - { "platform": "ALL", "language": "en_us", @@ -1359,7 +1401,6 @@ "oe": "utf-8" } }, - { "title": "森林之子 服务器", "language": "zh_cn", @@ -1374,9 +1415,14 @@ "size": "3.5GB", "targetLink": "", "author": "mmyddd", - "tags": ["仅适合个人使用", "Windows 版"], - "setupInfo": { - "tag": ["SonsOfTheForest"], + "tags": [ + "仅适合个人使用", + "Windows 版" + ], + "setupInfo": { + "tag": [ + "SonsOfTheForest" + ], "type": "steam/universal", "startCommand": "echo|set /p=\"1326470\" > steam_appid.txt & set SteamAppId=1326470 && set SteamGameId=1326470 && SonsOfTheForestDS.exe -userdatapath \"{mcsm_workspace}/userdata\" | consoleparser -colorize", "stopCommand": "^C", @@ -1399,9 +1445,14 @@ "size": "1GB", "targetLink": "", "author": "mmyddd", - "tags": ["仅适合个人使用", "Windows 版"], - "setupInfo": { - "tag": ["SCP秘密实验室"], + "tags": [ + "仅适合个人使用", + "Windows 版" + ], + "setupInfo": { + "tag": [ + "SCP秘密实验室" + ], "type": "steam/universal", "startCommand": "LocalAdmin.exe", "stopCommand": "stop", @@ -1424,9 +1475,14 @@ "size": "1GB", "targetLink": "", "author": "mmyddd", - "tags": ["仅适合个人使用", "Liunx 版"], - "setupInfo": { - "tag": ["SCP秘密实验室"], + "tags": [ + "仅适合个人使用", + "Liunx 版" + ], + "setupInfo": { + "tag": [ + "SCP秘密实验室" + ], "type": "steam/universal", "startCommand": "LocalAdmin", "stopCommand": "stop", @@ -1449,9 +1505,13 @@ "size": "3.5GB", "targetLink": "", "author": "mmyddd", - "tags": ["Windows version"], + "tags": [ + "Windows version" + ], "setupInfo": { - "tag": ["SonsOfTheForest"], + "tag": [ + "SonsOfTheForest" + ], "type": "steam/universal", "startCommand": "echo|set /p=\"1326470\" > steam_appid.txt & set SteamAppId=1326470 && set SteamGameId=1326470 && SonsOfTheForestDS.exe -userdatapath \"{mcsm_workspace}/userdata\" | consoleparser -colorize", "stopCommand": "^C", @@ -1474,9 +1534,13 @@ "size": "1GB", "targetLink": "", "author": "mmyddd", - "tags": ["Windows version"], + "tags": [ + "Windows version" + ], "setupInfo": { - "tag": ["SCP:SL"], + "tag": [ + "SCP:SL" + ], "type": "steam/universal", "startCommand": "LocalAdmin.exe", "stopCommand": "stop", @@ -1498,21 +1562,28 @@ "size": "", "targetLink": "", "author": "EndStone", - "tags": ["可以商业出租", "Docker版"], + "tags": [ + "可以商业出租", + "Docker版" + ], "setupInfo": { "startCommand": "endstone -y -s .", "stopCommand": "stop", "ie": "utf8", "oe": "utf8", "type": "minecraft/bedrock", - "tag": ["bedrock"], + "tag": [ + "bedrock" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "", "docker": { "image": "endstone/endstone:latest", "containerName": "endstone-server", - "ports": ["{mcsm_port1}:19132/udp"], + "ports": [ + "{mcsm_port1}:19132/udp" + ], "extraVolumes": [], "workingDir": "", "env": [], @@ -1520,7 +1591,6 @@ } } }, - { "title": "战术小队 服务器", "language": "zh_cn", @@ -1533,7 +1603,9 @@ "hardware": "Intel Core 平台、RAM 8G+", "size": "20GB", "author": "南赛", - "tags": ["不完全兼容面板"], + "tags": [ + "不完全兼容面板" + ], "remark": "需安装 Visual C++ 才可以运行", "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", "setupInfo": { @@ -1557,7 +1629,9 @@ "hardware": "Intel Core platform、RAM 8G+", "size": "20GB", "author": "NanSai", - "tags": ["不完全兼容面板"], + "tags": [ + "不完全兼容面板" + ], "remark": "Need to install Visual C++", "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", "setupInfo": { @@ -1581,7 +1655,9 @@ "hardware": "Intel Core 平台、RAM 8G+", "size": "20GB", "author": "南赛", - "tags": ["不完全兼容面板"], + "tags": [ + "不完全兼容面板" + ], "remark": "需安装 Visual C++ 才可以运行", "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", "setupInfo": { @@ -1605,7 +1681,9 @@ "hardware": "Intel Core platform、RAM 8G+", "size": "20GB", "author": "NanSai", - "tags": ["Incompatible with panel"], + "tags": [ + "Incompatible with panel" + ], "remark": "need install Visual C++", "targetLink": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/steamcmd.exe", "setupInfo": { @@ -1630,21 +1708,29 @@ "size": "", "targetLink": "", "author": "南赛", - "tags": ["可以商业出租", "Docker 版"], + "tags": [ + "可以商业出租", + "Docker 版" + ], "setupInfo": { "startCommand": "", "stopCommand": "docker stop squad-dedicated", "ie": "utf8", "oe": "utf8", "type": "steam/universal", - "tag": ["Squad"], + "tag": [ + "Squad" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "docker restart squad-dedicated", "docker": { "image": "cm2network/squad", "containerName": "squad-dedicated", - "ports": ["{mcsm_port1}:7787/udp", "{mcsm_port2}:15000/udp"], + "ports": [ + "{mcsm_port1}:7787/udp", + "{mcsm_port2}:15000/udp" + ], "extraVolumes": [ "{mcsm_workspace}/SquadConfig|/home/steam/squad-dedicated/SquadGame/ServerConfig/" ], @@ -1667,21 +1753,29 @@ "size": "", "targetLink": "", "author": "Nansai", - "tags": ["Commercial Use Allowed", "Docker version"], + "tags": [ + "Commercial Use Allowed", + "Docker version" + ], "setupInfo": { "startCommand": "", "stopCommand": "docker stop squad-dedicated", "ie": "utf8", "oe": "utf8", "type": "steam/universal", - "tag": ["Squad"], + "tag": [ + "Squad" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "docker restart squad-dedicated", "docker": { "image": "cm2network/squad", "containerName": "squad-dedicated", - "ports": ["{mcsm_port1}:7787/udp", "{mcsm_port2}:15000/udp"], + "ports": [ + "{mcsm_port1}:7787/udp", + "{mcsm_port2}:15000/udp" + ], "extraVolumes": [ "{mcsm_workspace}/SquadConfig|/home/steam/squad-dedicated/SquadGame/ServerConfig/" ], @@ -1704,21 +1798,29 @@ "size": "", "targetLink": "", "author": "南赛", - "tags": ["可以商业出租", "Docker 版"], + "tags": [ + "可以商业出租", + "Docker 版" + ], "setupInfo": { "startCommand": "", "stopCommand": "docker stop rust-server", "ie": "utf8", "oe": "utf8", "type": "steam/universal", - "tag": ["Rust"], + "tag": [ + "Rust" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "docker restart rust-server", "docker": { "image": "didstopia/rust-server", "containerName": "rust-server", - "ports": ["{mcsm_port1}:28015/udp", "{mcsm_port2}:28016/udp"], + "ports": [ + "{mcsm_port1}:28015/udp", + "{mcsm_port2}:28016/udp" + ], "extraVolumes": [ "{mcsm_workspace}/server|/server", "{mcsm_workspace}/config|/app/.config/unity3d/Facepunch/Rust", @@ -1743,21 +1845,29 @@ "size": "", "targetLink": "", "author": "南赛", - "tags": ["Commercial Use Allowed", "Docker version"], + "tags": [ + "Commercial Use Allowed", + "Docker version" + ], "setupInfo": { "startCommand": "", "stopCommand": "docker stop rust-server", "ie": "utf8", "oe": "utf8", "type": "steam/universal", - "tag": ["Rust"], + "tag": [ + "Rust" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "docker restart rust-server", "docker": { "image": "didstopia/rust-server", "containerName": "rust-server", - "ports": ["{mcsm_port1}:28015/udp", "{mcsm_port2}:28016/udp"], + "ports": [ + "{mcsm_port1}:28015/udp", + "{mcsm_port2}:28016/udp" + ], "extraVolumes": [ "{mcsm_workspace}/server|/server", "{mcsm_workspace}/config|/app/.config/unity3d/Facepunch/Rust", @@ -1782,21 +1892,27 @@ "size": "", "targetLink": "", "author": "TPing", - "tags": ["Docker 版"], + "tags": [ + "Docker 版" + ], "setupInfo": { "startCommand": "", "stopCommand": "^C", "ie": "utf8", "oe": "utf8", "type": "steam/universal", - "tag": ["Factorio"], + "tag": [ + "Factorio" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "", "docker": { "image": "factoriotools/factorio:latest", "containerName": "", - "ports": ["{mcsm_port1}:34197/udp"], + "ports": [ + "{mcsm_port1}:34197/udp" + ], "extraVolumes": [], "workingDir": "/factorio", "env": [], @@ -1817,27 +1933,94 @@ "size": "", "targetLink": "", "author": "TPing", - "tags": ["Docker version"], + "tags": [ + "Docker version" + ], "setupInfo": { "startCommand": "", "stopCommand": "^C", "ie": "utf8", "oe": "utf8", "type": "steam/universal", - "tag": ["Factorio"], + "tag": [ + "Factorio" + ], "fileCode": "utf8", "processType": "docker", "updateCommand": "", "docker": { "image": "factoriotools/factorio:latest", "containerName": "", - "ports": ["{mcsm_port1}:34197/udp"], + "ports": [ + "{mcsm_port1}:34197/udp" + ], "extraVolumes": [], "workingDir": "/factorio", "env": [], "changeWorkdir": false } } + }, + { + "language": "zh_cn", + "description": "使用TShock插件的泰拉瑞亚服务器", + "title": "Terraria_windows_x86", + "category": "最新版本", + "runtime": ".NET 6+", + "hardware": "RAM 1G", + "targetLink": "https://github.com/Pryaxis/TShock/releases/download/v5.2.4/TShock-5.2.4-for-Terraria-1.4.4.9-win-amd64-Release.zip", + "author": "Dawn3901", + "setupInfo": { + "startCommand": "TShock.Server.exe", + "stopCommand": "stop", + "ie": "UTF-8", + "oe": "UTF-8", + "createDatetime": 1767005798835, + "lastDatetime": 0, + "type": "universal", + "tag": [], + "endTime": 0, + "fileCode": "UTF-8", + "processType": "general", + "updateCommand": "{mcsm_steamcmd} +login anonymous +force_install_dir \"{mcsm_workspace}\" +app_update 380870 +quit", + "actionCommandList": [], + "crlf": 1, + "category": 0, + "enableRcon": false, + "terminalOption": { + "haveColor": true, + "pty": false, + "ptyWindowCol": 164, + "ptyWindowRow": 40 + }, + "eventTask": { + "autoStart": false, + "autoRestart": false, + "autoRestartMaxTimes": 3, + "ignore": false + }, + "docker": { + "ports": [], + "extraVolumes": [], + "networkMode": "bridge", + "networkAliases": [], + "workingDir": "/data", + "env": [], + "changeWorkdir": true + }, + "pingConfig": { + "type": 1 + }, + "extraServiceConfig": {} + }, + "gameType": "Terraria", + "image": "https://cdn.akamai.steamstatic.com/steam/apps/105600/header.jpg?t=1666290860", + "platform": "Windows", + "tags": [ + "TShock", + "Terraria" + ], + "isSummary": false } ] } From 7aaf2302a5b5ba8a6287400127f5037f6053c23c Mon Sep 17 00:00:00 2001 From: yijiong <59520517+y1jiong@users.noreply.github.com> Date: Sun, 18 Jan 2026 15:04:28 +0800 Subject: [PATCH 448/463] fix: typo: Liunx -> Linux --- market.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/market.json b/market.json index a14aba9..f528bb2 100644 --- a/market.json +++ b/market.json @@ -1464,8 +1464,8 @@ { "title": "SCP秘密实验室 服务器", "language": "zh_cn", - "platform": "Liunx", - "description": "SCP秘密实验室服务器,适用于 Liunx 系统", + "platform": "Linux", + "description": "SCP秘密实验室服务器,适用于 Linux 系统", "image": "https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/700330/dad38399643cda1a4084b1faff60452427bef8c0/header.jpg?t=1747606719", "remark": "第一次启动需要在控制台配置。服务器设置路径:/home/{你的用户名}/.config/SCP Secret Laboratory/config/{启动时控制台设置的端口}", "gameType": "SCP秘密实验室", @@ -1477,7 +1477,7 @@ "author": "mmyddd", "tags": [ "仅适合个人使用", - "Liunx 版" + "Linux 版" ], "setupInfo": { "tag": [ From 622f54ae32b5970d0973847fcf725075f8187626 Mon Sep 17 00:00:00 2001 From: SkyKingPX Date: Sat, 24 Jan 2026 17:24:48 +0100 Subject: [PATCH 449/463] Added Folia 1.21.11 & 1.21.8 + Hytale Servers --- market.json | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/market.json b/market.json index f528bb2..88e926c 100644 --- a/market.json +++ b/market.json @@ -2021,6 +2021,94 @@ "Terraria" ], "isSummary": false + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://hytale.com/static/images/logo.png", + "gameType": "Hytale", + "description": "Hytale Quick Server Setup, Mod Support", + "title": "Hytale Server", + "category": "hytale", + "runtime": "Java 25+", + "hardware": "RAM 4G+", + "targetLink": "https://github.com/SkyKingPX/Hytale-Server-Installer/releases/download/1.0.0/hytale-server-installer-win-mcsm.zip", + "author": "SkyKing_PX", + "setupInfo": { + "type": "hytale", + "startCommand": "java -Xms2G -Xmx4G -XX:AOTCache=HytaleServer.aot -jar HytaleServer.jar --assets Assets.zip", + "stopCommand": "stop", + "updateCommand": ".\\hytale-server-installer-win.exe", + "ie": "UTF-8", + "oe": "UTF-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://hytale.com/static/images/logo.png", + "gameType": "Hytale", + "description": "Hytale Quick Server Setup, Mod Support", + "title": "Hytale Server", + "category": "hytale", + "runtime": "Java 25+", + "hardware": "RAM 4G+", + "targetLink": "https://github.com/SkyKingPX/Hytale-Server-Installer/releases/download/1.0.0/hytale-server-installer-linux-mcsm.zip", + "author": "SkyKing_PX", + "setupInfo": { + "type": "hytale", + "startCommand": "java -Xms2G -Xmx4G -XX:AOTCache=HytaleServer.aot -jar HytaleServer.jar --assets Assets.zip", + "stopCommand": "stop", + "updateCommand": "sudo ./hytale-server-installer-linux", + "ie": "UTF-8", + "oe": "UTF-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 Folia Quick Server Setup, Plugin Support", + "title": "[Folia] Minecraft 1.21.11", + "category": "mc-folia", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Minecraft Folia", + "targetLink": "https://fill-data.papermc.io/v1/objects/f4e9c5c374a53d17b6173cac35242c05c12217b656b6cc5dc07354cc37ec4066/folia-1.21.11-11.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/folia", + "startCommand": "java -Xms4096M -Xmx4096M -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:G1MaxNewSizePercent=40 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1NewSizePercent=30 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:MaxGCPauseMillis=200 -XX:MaxTenuringThreshold=1 -XX:SurvivorRatio=32 -jar folia-1.21.11-11.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.8 Folia Quick Server Setup, Plugin Support", + "title": "[Folia] Minecraft 1.21.8", + "category": "mc-folia", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Minecraft Folia", + "targetLink": "https://fill-data.papermc.io/v1/objects/233843cfd5001b6f658fcab549178d694cc37f0277d004ea295de0a94c57278f/folia-1.21.8-6.jar", + "author": "papermc.io", + "setupInfo": { + "type": "minecraft/java/folia", + "startCommand": "java -Xms4096M -Xmx4096M -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:G1MaxNewSizePercent=40 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1NewSizePercent=30 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:MaxGCPauseMillis=200 -XX:MaxTenuringThreshold=1 -XX:SurvivorRatio=32 -jar folia-1.21.8-6.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } } ] } From a0015acf3ec2f2871efbbc7e6566bb0f4177bdec Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Thu, 26 Feb 2026 20:50:30 +0800 Subject: [PATCH 450/463] feat: add test install sh --- setup_cn_test.sh | 1365 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1365 insertions(+) create mode 100644 setup_cn_test.sh diff --git a/setup_cn_test.sh b/setup_cn_test.sh new file mode 100644 index 0000000..425d5e2 --- /dev/null +++ b/setup_cn_test.sh @@ -0,0 +1,1365 @@ +#!/bin/bash +# MCSManager官方安装脚本. +# 这个脚本将会把MCSManager服务端和节点服务端更新/安装至最新发布版本. +# ------------------------------------------------------------------------------ +# 受支持的Linux: +# 此脚本支持以下Linux发行版: +# - Ubuntu: 18.04, 20.04, 22.04, 24.04 +# - Debian: 10, 11, 12, 13 +# - CentOS: 7, 8 Stream, 9 Stream, 10 Stream +# - RHEL: 7, 8, 9, 10 +# - Arch Linux: Support planned (TBD) +# ------------------------------------------------------------------------------ + +# Target installation directory (can be overridden with --install-dir) +install_dir="/opt/mcsmanager" + +# Primary download URL bas. Full package URL = download_base_url + package_name +download_base_url="https://cdn.imlazy.ink:233/files/" + +# Fallback download URL (can also be a local directory or mirror) +download_fallback_url="https://github.com/MCSManager/MCSManager/releases/latest/download/mcsmanager_linux_release.tar.gz" + +# Name of the release package to download/detect +package_name="mcsmanager_linux_release.tar.gz" + +# Node.js version to be installed +# Keep the leading "v" +node_version="v20.12.2" + +# Node download base URL - primary +node_download_url_base="https://nodejs.org/dist/" + +# Node download URL - fallback. +# This is the URL points directly to the file, not the base. This can also be a local absolute path. +# Only supports https:// or http:// for web locations. +node_download_fallback="" + +# Node.js installation path (defaults to the MCSManager installation path. Can be overridden with --node-install-dir) +node_install_dir="$install_dir" + +# Temp dir for file extraction +tmp_dir="/tmp" + +# Bypass installed user permission check, override by --force-permission +force_permission=false + + +# --------------- Global Variables ---------------# +# DO NOT MODIFY # + + +# Component installation options. +# For fresh installs, both daemon and web components are installed by default. +# For updates, behavior depends on detected existing components. +# Can be overridden with --install daemon/web/all +install_daemon=true +install_web=true + +# Install MCSM as (default: root). +# To install as a general user (e.g., "mcsm"), use the --user option: --user mcsm +# To ensure compatibility, only user mcsm is supported. +install_user="root" +# Installed user, for permission check +web_installed=false +daemon_installed=false +web_installed_user="" +daemon_installed_user="" + +# Service file locations +# the final dir = systemd_file + {web/daemon} + ".service" +systemd_file="/etc/systemd/system/mcsm-" +# Optional: Override the default installation source file. +# If --install-source is specified, the installer will use the provided +# "mcsmanager_linux_release.tar.gz" file instead of downloading it. +# Only support local absolute path. +install_source_path="" + +# temp path for extracted file(s) +install_tmp_dir="/opt/mcsmanager/mcsm_abcd" + +# dir name for data dir backup +# e.g. /opt/mcsmanager/daemon/data -> /opt/mcsmanager/data_bak_data +# only valid for when during an update +backup_prefix="data_bak_" + +# System architecture (detected automatically) +arch="" +version="" +distro="" + + + +# Supported OS versions (map-style structure) +# Format: supported_os["distro_name"]="version1 version2 version3 ..." +declare -A supported_os +supported_os["Ubuntu"]="18 20 22 24" +supported_os["Debian"]="10 11 12 13" +supported_os["CentOS"]="7 8 8-stream 9-stream 10-stream" +supported_os["RHEL"]="7 8 9 10" +supported_os["Arch"]="rolling" + +# Required system commands for installation +# These will be checked before logic process +required_commands=( + chmod + chown + wget + tar + stat + useradd + usermod + date +) + +# Node.js related sections +# Enable strict version checking (exact match) +# enabled -> strict requriement for defined node version +# false -> newer version allowed +# Older version is NEVER allowed +strict_node_version_check=true + +# Will be set based on actual node status +install_node=true +# Remove leading "v" from defined version +required_node_ver="${node_version#v}" + +# Holds absolute path for node & npm +node_bin_path="" +npm_bin_path="" +# Hold Node.js arch name, e.g. x86_64 -> x64 +node_arch="" +# Hold Node.js intallation path, e.g. ${node_install_dir}/node-${node_version}-linux-${arch} +node_path="" + +# For installation result +daemon_key="" +daemon_port="" +web_port="" +daemon_key_config_subpath="data/Config/global.json" +web_port_config_subpath="data/SystemConfig/config.json" + +# Terminal color & style related +# Default to false, auto check later +SUPPORTS_COLOR=false +SUPPORTS_STYLE=false +# Declare ANSI reset +RESET="\033[0m" + +# Foreground colors +declare -A FG_COLORS=( + [black]="\033[0;30m" + [red]="\033[0;31m" + [green]="\033[0;32m" + [yellow]="\033[0;33m" + [blue]="\033[0;34m" + [magenta]="\033[0;35m" + [cyan]="\033[0;36m" + [white]="\033[0;37m" +) + +# Font styles +declare -A STYLES=( + [bold]="\033[1m" + [underline]="\033[4m" + [italic]="\033[3m" # Often ignored + [clear_line]="\r\033[2K" + [strikethrough]="\033[9m" +) + + +### Helper Functions +# Execution wrapper, avoid unexpected crashes. +safe_run() { + local func="$1" + local err_msg="$2" + shift 2 + + if ! "$func" "$@"; then + echo "Error: $err_msg" + exit 1 + fi +} + +# Function to ensure the script is run as root +check_root() { + # Using Bash's built-in EUID variable + if [ -n "$EUID" ]; then + if [ "$EUID" -ne 0 ]; then + cprint red "错误: 这个脚本只能运行在root或sudo模式下,请尝试切换用户或者使用sudo." + exit 1 + fi + else + # Fallback to using id -u if EUID is unavailable (e.g., non-Bash shell or misconfigured environment) + if [ "$(id -u)" -ne 0 ]; then + cprint red "错误: 这个脚本只能运行在root或sudo模式下,请尝试切换用户或者使用sudo." + exit 1 + fi + fi +} + +# Function to check whether current terminal support color & style +detect_terminal_capabilities() { + SUPPORTS_COLOR=false + SUPPORTS_STYLE=false + + if [ -t 1 ] && command -v tput >/dev/null 2>&1; then + if [ "$(tput colors)" -ge 8 ]; then + SUPPORTS_COLOR=true + fi + if tput bold >/dev/null 2>&1 && tput smul >/dev/null 2>&1; then + SUPPORTS_STYLE=true + fi + fi + + if [ "$SUPPORTS_COLOR" = true ]; then + cprint green "[OK] 这个终端支持彩色输出." + else + cprint yellow "注:终端不支持彩色输出。不格式化继续." + fi + + if [ "$SUPPORTS_STYLE" = true ]; then + cprint green "[OK] 终端支持粗体和下划线格式." + else + cprint yellow "注意:终端不支持高级文本样式." + fi +} + +# Check whether daemon or web is installed +is_component_installed() { + local component_name="$1" + local component_path="${install_dir}/${component_name}" + + if [[ -d "$component_path" ]]; then + cprint green "组件 '$component_name' 已经被安装在 $component_path" + + # Set corresponding global variable + if [[ "$component_name" == "daemon" ]]; then + daemon_installed=true + elif [[ "$component_name" == "web" ]]; then + web_installed=true + fi + + return 0 + else + cprint yellow "组件 '$component_name' 未被安装" + + # Set corresponding global variable + if [[ "$component_name" == "daemon" ]]; then + daemon_installed=false + elif [[ "$component_name" == "web" ]]; then + web_installed=false + fi + + return 1 + fi +} + +check_component_permission() { + local component="$1" + local service_file="${systemd_file}${component}.service" + + if [[ ! -f "$service_file" ]]; then + cprint yellow "找不到服务文件: $service_file" + return 0 # nothing changed + fi + + # Extract the User= line if it exists + local user_line + user_line=$(grep -E '^User=' "$service_file" 2>/dev/null | head -1) + + local user + if [[ -z "$user_line" ]]; then + user="root" # default if no User= is defined + else + user="${user_line#User=}" + fi + + # Validate user + if [[ "$user" != "root" && "$user" != "mcsm" ]]; then + cprint red bold "不支持的用户 '$user' 在 $service_file. 使用 'root' 或 'mcsm'." + exit 1 + fi + + # Assign to appropriate global + if [[ "$component" == "web" ]]; then + web_installed_user="$user" + elif [[ "$component" == "daemon" ]]; then + daemon_installed_user="$user" + fi + + cprint cyan "已删除 $component 以用户身份安装: $user" + return 0 +} + + + +parse_args() { + local explicit_install_flag=false + + while [[ $# -gt 0 ]]; do + case "$1" in + --install-dir) + if [[ -n "$2" ]]; then + install_dir="$2" + shift 2 + else + echo "错误:--install-dir需要一个路径参数." + exit 1 + fi + ;; + --node-install-dir) + if [[ -n "$2" ]]; then + node_install_dir="$2" + shift 2 + else + echo "错误:--node-install-dir需要一个路径参数." + exit 1 + fi + ;; + --install) + explicit_install_flag=true + if [[ -n "$2" && "$2" != --* ]]; then + case "$2" in + daemon) + install_daemon=true + is_component_installed "daemon" + install_web=false + check_component_permission "daemon" + ;; + web) + install_daemon=false + is_component_installed "web" + install_web=true + check_component_permission "web" + ;; + all) + install_daemon=true + install_web=true + is_component_installed "daemon" + is_component_installed "web" + check_component_permission "daemon" + check_component_permission "web" + ;; + *) + echo "错误:--install的值无效。期望‘daemon’, ‘web’或‘all’." + echo "Usage: --install daemon|web|all" + exit 1 + ;; + esac + shift 2 + else + echo "错误:提供了--install标志,但没有值。请指定:daemon、web或all." + echo "使用方法: --install daemon|web|all" + exit 1 + fi + ;; + --user) + if [[ -n "$2" ]]; then + case "$2" in + root) + install_user="root" + ;; + mcsm) + install_user="mcsm" + ;; + *) + echo "错误:无效用户 '$2'. 只有 'root' 和 'mcsm' 受支持." + echo "使用方法: --user root|mcsm" + exit 1 + ;; + esac + shift 2 + else + echo "错误:--user需要一个值 (root 或 mcsm)." + exit 1 + fi + ;; + --install-source) + if [[ -n "$2" ]]; then + install_source_path="$2" + shift 2 + else + echo "错误:--install-source需要文件路径." + exit 1 + fi + ;; + --force-permission) + force_permission=true + shift + ;; + *) + echo "错误:未知参数t: $1" + exit 1 + ;; + esac + done + + # Auto-detect branch: only run if --install was not explicitly passed + if [[ "$explicit_install_flag" == false ]]; then + daemon_installed=false + web_installed=false + + if is_component_installed "daemon"; then + daemon_installed=true + check_component_permission "daemon" + fi + if is_component_installed "web"; then + web_installed=true + check_component_permission "web" + fi + + # When only one component installed, we wanted to process that one only. + if [[ "$daemon_installed" == true && "$web_installed" == false ]]; then + install_daemon=true + install_web=false + elif [[ "$daemon_installed" == false && "$web_installed" == true ]]; then + install_daemon=false + install_web=true + else + install_daemon=true + install_web=true + fi + fi +} + + +# Get Distribution & Architecture Info +detect_os_info() { + distro="Unknown" + version="Unknown" + arch=$(uname -m) + + # Try primary source + if [ -f /etc/os-release ]; then + . /etc/os-release + distro_id="${ID,,}" + version_id="${VERSION_ID,,}" + + case "$distro_id" in + ubuntu) + distro="Ubuntu" + version="$version_id" + ;; + debian) + distro="Debian" + version="$version_id" + ;; + centos) + distro="CentOS" + version="$version_id" + ;; + rhel*) + distro="RHEL" + version="$version_id" + ;; + arch) + distro="Arch" + version="rolling" + ;; + *) + distro="${ID:-Unknown}" + version="$version_id" + ;; + esac + fi + + # Fallbacks for missing or invalid version + if [[ -z "$version" || "$version" == "unknown" || "$version" == "" ]]; then + if [ -f /etc/issue ]; then + version_guess=$(grep -oP '[0-9]+(\.[0-9]+)*' /etc/issue | head -1) + if [[ -n "$version_guess" ]]; then + version="$version_guess" + fi + fi + fi + + # Normalize version: keep only major version + version_full="$version" + cprint cyan "检测到操作系统: $distro $version_full" + cprint cyan "检测到架构: $arch" +} + +# Check if all required commands are available +check_required_commands() { + local missing=0 + + for cmd in "${required_commands[@]}"; do + if ! command -v "$cmd" >/dev/null 2>&1; then + echo "错误:必需的命令 '$cmd' 在PATH中不可用." + missing=1 + fi + done + + if [ "$missing" -ne 0 ]; then + echo "缺少一个或多个必需的命令。请安装后再试." + return 1 + fi + + cprint green "所有必需的命令都可用." + return 0 +} + +# Print with specified color and style, fallback to RESET if not supported. +# Supported colors*: black|red|green|yellow|blue|magenta|cyan|white +# Supported styles*: bold|underline|italic|clear_line|strikethrough +# *Note: some style may not necessarily work on all terminals. +# Example usage: +# cprint green bold "Installation completed successfully." +# cprint red underline "Failed to detect required command: wget" +# cprint yellow "Warning: Disk space is low." +# cprint underline "Failed to detect required command: wget" +# cprint bold green underline"Installation completed successfully." + +cprint() { + local color="" + local text="" + local styles="" + local disable_prefix=false + local disable_newline=false + + while [[ $# -gt 1 ]]; do + case "$1" in + black|red|green|yellow|blue|magenta|cyan|white) + color="$1" + ;; + bold|underline|italic|clear_line|strikethrough) + styles+="${STYLES[$1]}" + ;; + noprefix) + disable_prefix=true + ;; + nonl) + disable_newline=true + ;; + esac + shift + done + + text="$1" + + local prefix_text="" + if [[ "$disable_prefix" != true ]]; then + local timestamp="[$(date +%H:%M:%S)]" + local label="[MCSM Installer]" + prefix_text="${FG_COLORS[white]}$timestamp $label${RESET} " + fi + + local prefix="" + if [[ -n "$color" && "$SUPPORTS_COLOR" = true ]]; then + prefix+="${FG_COLORS[$color]}" + fi + if [[ "$SUPPORTS_STYLE" = true || "$styles" == *"${STYLES[clear_line]}"* ]]; then + prefix="$styles$prefix" + fi + + if [[ "$disable_newline" == true ]]; then + printf "%b%b%s%b" "$prefix_text" "$prefix" "$text" "$RESET" + else + printf "%b%b%s%b\n" "$prefix_text" "$prefix" "$text" "$RESET" + fi +} + + + + +# Permission check before proceed with installation +permission_barrier() { + if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then + cprint cyan "当前没有安装组件-跳过权限检查." + return 0 + fi + + for component in web daemon; do + local is_installed_var="${component}_installed" + local installed_user_var="${component}_installed_user" + + if [[ "${!is_installed_var}" == true ]]; then + local installed_user="${!installed_user_var}" + + # Step 0: Ensure installed user is detected + if [[ -z "$installed_user" ]]; then + cprint red bold "检测到 '$component' 已安装,但无法从其systemd服务文件确定用户." + cprint red "这可能表示自定义或不支持的服务文件设置." + cprint red "拒绝执行以避免潜在的冲突." + exit 1 + fi + + # Step 1: User match check with optional force override + if [[ "$installed_user" != "$install_user" ]]; then + if [[ "$force_permission" == true ]]; then + cprint yellow bold "权限不匹配 '$component':" + cprint yellow "以用户身份安装: $installed_user" + cprint yellow "目标安装用户: $install_user" + cprint yellow "用户不匹配,但设置了--force-permission。继续和更新权限…" + sleep 3 + else + cprint red bold "权限不匹配 '$component':" + cprint red "以用户身份安装: $installed_user" + cprint red "目标安装用户: $install_user" + cprint red "用户不匹配,但设置了--force-permission。继续和更新权限..." + exit 1 + fi + else + cprint green bold "权限检查已通过: '$installed_user' 匹配目标用户." + fi + + fi + done + + # Step 2: Directory ownership check + local dir_owner + dir_owner=$(stat -c '%U' "$install_dir" 2>/dev/null) + + if [[ -z "$dir_owner" ]]; then + cprint red bold "无法确定安装目录的所有者: $install_dir" + exit 1 + fi + + if [[ "$dir_owner" != "$install_user" ]]; then + if [[ "$force_permission" == true ]]; then + cprint yellow bold "安装目录所有权不匹配:" + cprint yellow " 目录: $install_dir" + cprint yellow " 归: $dir_owner" + cprint yellow " 预期: $install_user" + cprint yellow " --force-permission设置。尽管不匹配,但继续." + sleep 3 + else + cprint red bold "安装目录所有权不匹配:" + cprint red " 目录: $install_dir" + cprint red " 归: $dir_owner" + cprint red " 预期: $install_user" + exit 1 + fi + else + cprint green bold "安装目录所有权检查通过: '$install_dir' is owned by '$install_user'." + fi + + cprint green bold "验证了权限和所有权。继续." + return 0 +} + + + +# Map OS arch with actual Node.js Arch name +# This function should be placed after var arch has been assigned a valid value. +resolve_node_arch() { + case "$arch" in + x86_64) + node_arch="x64" + ;; + aarch64) + node_arch="arm64" + ;; + armv7l) + node_arch="armv7l" + ;; + *) + cprint red bold "Node.js不支持的架构: $arch" + return 1 + ;; + esac + + # Assign node_path based on resolved arch and current version/install dir + node_path="${node_install_dir}/node-${node_version}-linux-${node_arch}" + + cprint cyan "解析了Node.js架构: $node_arch" + cprint cyan "Node.js安装路径: $node_path" +} + +# Check if Node.js at PATH is valid. +# This function check Node.js version + NPM (if Node.js valid) +verify_node_at_path() { + local node_path="$1" + node_bin_path="$node_path/bin/node" + npm_bin_path="$node_path/bin/npm" + + # Node binary missing + if [ ! -x "$node_bin_path" ]; then + return 1 + fi + + local installed_ver + installed_ver="$("$node_bin_path" -v 2>/dev/null | sed 's/^v//')" + + if [[ -z "$installed_ver" ]]; then + return 1 + fi + + if [ "$strict_node_version_check" = true ]; then + if [[ "$installed_ver" != "$required_node_ver" ]]; then + return 3 + fi + else + local cmp + cmp=$(printf "%s\n%s\n" "$required_node_ver" "$installed_ver" | sort -V | head -1) + if [[ "$cmp" != "$required_node_ver" ]]; then + return 2 + fi + fi + + # Check if npm exists and works using node (not $PATH/npm) + if [ ! -x "$npm_bin_path" ]; then + return 4 + fi + + # Use node to run npm.js directly, in case env is broken + local npm_version + npm_version="$("$node_bin_path" "$npm_bin_path" --version 2>/dev/null)" + if [[ -z "$npm_version" ]]; then + return 4 + fi + + return 0 +} + + +# Node.js pre-check. check if we need to install Node.js before installer run. +# Use postcheck_node_after_install() to check after install. +check_node_installed() { + verify_node_at_path "$node_path" + local result=$? + + case $result in + 0) + cprint green bold "Node.js和npm在 $node_path (版本 $required_node_ver 或兼容)" + install_node=false + ;; + 1) + cprint yellow bold "Node.js二进制文件未找到或无法使用 $node_path" + install_node=true + ;; + 2) + cprint red bold "Node.js版本 $node_path 太老. 要求: >= $required_node_ver" + install_node=true + ;; + 3) + cprint red bold "Node.js版本不匹配。要求: $required_node_ver, 发现了其他的Node.js版本." + install_node=true + ;; + 4) + cprint red bold "Node.js存在,但npm缺失或损坏." + install_node=true + ;; + *) + cprint red bold "Node验证中出现意外错误." + install_node=true + ;; + esac +} + +# Node.js post-check. check if Node.js is valid after install. +postcheck_node_after_install() { + verify_node_at_path "$node_path" + if [[ $? -ne 0 ]]; then + cprint red bold "Node.js安装失败或无效 $node_path" + return 1 + else + cprint green bold "Node.js的安装和运行在 $node_path" + return 0 + fi +} + +# Install Node.js and check +install_node() { + local archive_name="node-${node_version}-linux-${node_arch}.tar.xz" + local target_dir="${node_install_dir}/node-${node_version}-linux-${node_arch}" + local archive_path="${node_install_dir}/${archive_name}" + local download_url="${node_download_url_base}${node_version}/${archive_name}" + local fallback="$node_download_fallback" + + cprint cyan bold "安装Node.js $node_version 架构: $node_arch" + + mkdir -p "$node_install_dir" || { + cprint red bold "创建Node安装目录失败: $node_install_dir" + return 1 + } + + # Download + cprint cyan "下载Node.js: $download_url" + if ! wget --progress=bar:force -O "$archive_path" "$download_url"; then + cprint yellow "主下载失败。尝试备用下载……" + + if [[ -n "$fallback" ]]; then + if [[ "$fallback" =~ ^https?:// ]]; then + cprint cyan "从备用URL下载: $fallback" + if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then + cprint red bold "备用下载失败: $fallback" + return 1 + fi + elif [ -f "$fallback" ]; then + cprint cyan "从本地备份进行复制: $fallback" + cp "$fallback" "$archive_path" || { + cprint red bold "复制备用Node.js存档失败 $fallback" + return 1 + } + else + cprint red bold "无效的备用路径: $fallback" + return 1 + fi + else + cprint red bold "没有配置备用源。不能继续进行." + return 1 + fi + fi + + # Extract archive + cprint cyan "提取Node.js存档..." + if ! tar -xf "$archive_path" -C "$node_install_dir"; then + cprint red bold "提取Node.js文件失败." + return 1 + fi + + chmod -R a+rx "$target_dir" || { + cprint red bold "在Node.js文件上设置执行权限失败." + return 1 + } + + verify_node_at_path "$target_dir" + local result=$? + if [[ $result -ne 0 ]]; then + cprint red bold "Node.js安装验证失败." + return 1 + fi + + cprint cyan "清理文件……" + rm -f "$archive_path" + + cprint green bold "Node.js $node_version 安装成功 $target_dir" + # Save resolved binary paths to global variables + node_bin_path="${target_dir}/bin/node" + npm_bin_path="${target_dir}/bin/npm" + + cprint green "Node.js 二进制文件: $node_bin_path" + cprint green "npm 二进制文件: $npm_bin_path" + return 0 +} + +# Function to download MCSM package. fetch from primary URL first, then fallback URL. +# This function only put extracted file(s) into install_dir, it does not perform the actual update. +download_mcsm() { + local archive_name="$package_name" + local archive_path="${tmp_dir}/${archive_name}" + local primary_url="${download_base_url}${archive_name}" + local fallback="$download_fallback_url" + + cprint cyan bold "下载MCSManager安装包…" + + # Step 1: Try downloading from primary URL + if ! wget --progress=bar:force -O "$archive_path" "$primary_url"; then + cprint yellow "主下载失败。尝试备用资源…" + + if [[ -z "$fallback" ]]; then + cprint red bold "没有指定备用URL或路径." + return 1 + fi + + if [[ "$fallback" =~ ^https?:// ]]; then + if ! wget --progress=bar:force -O "$archive_path" "$fallback"; then + cprint red bold "备用下载失败 $fallback" + return 1 + fi + elif [[ -f "$fallback" ]]; then + cp "$fallback" "$archive_path" || { + cprint red bold "未能复制备用文件 $fallback" + return 1 + } + else + cprint red bold "备用路径无效: $fallback" + return 1 + fi + fi + + # Step 2: Generate extract directory + local suffix + suffix=$(tr -dc 'a-z0-9' /dev/null; then + cprint green "用户 '$install_user' 已经存在." + else + cprint cyan "创建系统用户: $install_user (无登录,无密码)..." + if ! useradd --system --home "$install_dir" --shell /usr/sbin/nologin "$install_user"; then + cprint red bold "创建用户失败: $install_user" + exit 1 + fi + cprint green "用户 '$install_user' 已创建." + fi + + + # Docker integration + if command -v docker &>/dev/null; then + cprint cyan "Docker已被安装 -检查组分配…" + + if getent group docker &>/dev/null; then + if id -nG "$install_user" | grep -qw docker; then + cprint green "用户 '$install_user' 已经在“docker”组中." + else + cprint cyan "添加用户 '$install_user' 到 'docker' 组..." + if usermod -aG docker "$install_user"; then + cprint green "授予的Docker组访问权限 '$install_user'." + else + cprint red "未能添加 '$install_user' 给“Docker”组。这个用户可能无法使用Docker." + fi + fi + else + cprint red "安装了Docker,但没有找到Docker组。跳过组分配." + fi + else + cprint yellow "未安装Docker -跳过Docker组配置." + fi + + return 0 +} +# Function to stop MCSM services if they exist +stop_mcsm_services() { + cprint yellow bold "试图停止mcsm-web和mcsm-daemon服务..." + + # Attempt to stop mcsm-web + cprint blue "正在停止 mcsm-web..." + if systemctl stop mcsm-web; then + cprint green "mcsm-web 已停止." + else + cprint red bold "警告:未能停止mcsm-web(可能不存在或已停止)." + fi + + # Attempt to stop mcsm-daemon + cprint blue "正在停止 mcsm-daemon..." + if systemctl stop mcsm-daemon; then + cprint green "mcsm-daemon 已停止." + else + cprint red bold "警告:未能停止mcsm-daemon(可能不存在或已停止)." + fi +} +# Prepare file & permissions before install. +mcsm_install_prepare() { + + # Stop service if existed + stop_mcsm_services + + if [[ ! -d "$install_tmp_dir" ]]; then + cprint red bold "临时安装目录不存在: $install_tmp_dir" + exit 1 + fi + + cprint cyan "改变所有权 $install_tmp_dir 到用户 '$install_user'..." + chown -R "$install_user":"$install_user" "$install_tmp_dir" || { + cprint red bold "所有权变更失败 $install_tmp_dir" + cleanup_install_tmp + exit 1 + } + + # Normalize install_dir to ensure it ends with a slash + [[ "${install_dir}" != */ ]] && install_dir="${install_dir}/" + + if [[ "$web_installed" == false && "$daemon_installed" == false ]]; then + cprint cyan "没有检测到现有组件-跳过数据备份/清理." + return 0 + fi + + cprint green bold "已成功准备现有组件." + return 0 +} + +# Install or update a component +install_component() { + local component="$1" + local target_path="${install_dir}${component}" + local backup_data_path="${install_dir}${backup_prefix}${component}" + local source_path="${install_tmp_dir}/mcsmanager/${component}" + + cprint cyan bold "安装/更新组件: $component" + + # Step 1: Move new component to install_dir + if [[ ! -d "$source_path" ]]; then + cprint red bold "找不到源目录: $source_path" + cleanup_install_tmp + exit 1 + fi + +# [20:49:07] [MCSM Installer] 安装/更新组件: web +# [20:49:07] [MCSM Installer] 更新的文件 /opt/mcsmanager/mcsm_9gha/mcsmanager/web → /opt/mcsmanager/web +# [20:49:07] [MCSM Installer] 已移动 web 到 /opt/mcsmanager/web + cprint cyan "删除依赖库文件 $target_path/node_modules/" + if [[ -d "$target_path/node_modules/" ]]; then + rm -rf "$target_path/node_modules/" + + if cp -a "$source_path"/. "$target_path"; then + cprint green "更新的文件 $source_path → $target_path" + rm -rf "$source_path" + else + cprint red bold "更新文件失败 $source_path → $target_path" + cleanup_install_tmp + exit 1 + fi + cprint green "已移动 $component 到 $target_path" + + + # Step 3: Install NPM dependencies + if [[ ! -x "$npm_bin_path" ]]; then + cprint red bold "找不到npm二进制文件或无法执行: $npm_bin_path" + cleanup_install_tmp + exit 1 + fi + + cprint cyan "正在使用npm安装依赖库 $component ..." + pushd "$target_path" >/dev/null || { + cprint red bold "更改目录失败 $target_path" + cleanup_install_tmp + exit 1 + } + + + if ! "$node_bin_path" "$npm_bin_path" install --registry=https://registry.npmmirror.com --no-audit --no-fund --loglevel=warn; then + cprint red bold "NPM依赖项安装失败 $component" + popd >/dev/null + cleanup_install_tmp + exit 1 + fi + + popd >/dev/null + cprint green bold "组件 '$component' 安装/更新成功." +} + +# Create systemd service for a given component. +# This will overwrite the existing service file. +create_systemd_service() { + local component="$1" + local service_path="${systemd_file}${component}.service" + local working_dir="${install_dir}${component}" + local exec="${node_bin_path} app.js" + + if [[ ! -d "$working_dir" ]]; then + cprint red bold "找不到组件目录: $working_dir" + cleanup_install_tmp + return 1 + fi + + cprint cyan "创建systemd服务 '$component'..." + + cat > "$service_path" </dev/null | awk '{print $1}') + [[ -z "$ip_address" ]] && ip_address="你的IP" + + # Daemon info + if [[ "$install_daemon" == true ]]; then + local daemon_address="ws://$ip_address:${daemon_port:-Failed to Retrieve from Config file}" + local daemon_key_display="${daemon_key:-Failed to Retrieve from Config file}" + + cprint yellow noprefix "守护进程地址:" + cprint white noprefix " $daemon_address" + cprint yellow noprefix "守护进程秘钥:" + cprint white noprefix " $daemon_key_display" + echo "" + fi + + # Web info + if [[ "$install_web" == true ]]; then + local web_address="http://$ip_address:${web_port:-Failed to Retrieve from Config file}" + cprint yellow noprefix "HTTP面板地址:" + cprint white noprefix nonl " $web_address " + cprint yellow noprefix "(在你的浏览器中打开)" + echo "" + fi + + # Port guidance + cprint yellow noprefix "注意:" + cprint white noprefix " 确保防火墙放行上述端口." + cprint white noprefix " 如果从外部网络访问,您可能需要在路由器上配置端口转发." + echo "" + + # Service management help + cprint yellow noprefix "MCSManager管理命令:" + if [[ "$install_daemon" == true ]]; then + cprint white noprefix nonl " systemctl start " + cprint yellow noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl stop " + cprint yellow noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl restart " + cprint yellow noprefix "mcsm-daemon.service" + cprint white noprefix nonl " systemctl status " + cprint yellow noprefix "mcsm-daemon.service" + fi + if [[ "$install_web" == true ]]; then + cprint white noprefix nonl " systemctl start " + cprint yellow noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl stop " + cprint yellow noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl restart " + cprint yellow noprefix "mcsm-web.service" + cprint white noprefix nonl " systemctl status " + cprint yellow noprefix "mcsm-web.service" + fi + echo "" + + # Official doc + cprint yellow noprefix "官方文档:" + cprint white noprefix " https://docs.mcsmanager.com/zh_cn/" + echo "" + + # HTTPS support + cprint yellow noprefix "需要HTTPS?" + cprint white noprefix " 为了开启HTTPS安全访问,需要配置反向代理:" + cprint white noprefix " https://docs.mcsmanager.com/zh_cn/ops/proxy_https.html" + echo "" + + if [[ "$force_permission" == true ]]; then + cprint red noprefix "[重点] 您选择在安装期间重写权限." + cprint red noprefix " 你可能需要运行: chown -R $install_user 手动更新权限." + fi + + # Closing message + cprint green noprefix "安装完成。享受使用MCSManager管理服务器的乐趣!" + echo "" +} + +install_mcsm() { + local components=() + + if [[ "$install_web" == true ]]; then + install_component "web" + create_systemd_service "web" + components+=("web") + fi + + if [[ "$install_daemon" == true ]]; then + install_component "daemon" + create_systemd_service "daemon" + components+=("daemon") + fi + + # Reload systemd after any service file changes + if (( ${#components[@]} > 0 )); then + cprint cyan "重新加载systemd守护进程..." + # systemctl daemon-reexec + systemctl daemon-reload + + for comp in "${components[@]}"; do + local svc="mcsm-${comp}.service" + + cprint cyan "启用服务: $svc" + if systemctl enable "$svc" &>/dev/null; then + cprint green "已启用服务: $svc" + else + cprint red bold "启用服务失败: $svc" + cleanup_install_tmp + exit 1 + fi + done + fi + + # Clean tmp dir + cleanup_install_tmp + # Extract installed component info + safe_run extract_component_info "未能从已安装的服务中提取运行时信息" + safe_run print_install_result "未能打印安装结果" + +} + +main() { + trap 'echo "发生意外错误."; exit 99' ERR + safe_run detect_terminal_capabilities "检测终端功能失败" + safe_run check_root "脚本必须以root身份运行" + safe_run parse_args "解析参数失败" "$@" + safe_run detect_os_info "OS检测失败" + # To be moved to a master pre check function. + safe_run resolve_node_arch "解析Node.js架构失败" + + safe_run check_required_commands "缺少必要的系统命令" + + safe_run check_node_installed "在预期目录上检测到Node.js或npm失败。Node.js将被安装." + if [ "$install_node" = true ]; then + safe_run install_node "Node.js安装失败" + fi + + safe_run permission_barrier "权限验证失败-中止安装" + + safe_run prepare_user "准备用户权限失败。处理步骤." + + safe_run download_mcsm "获取MCSManager源失败。处理步骤" + safe_run mcsm_install_prepare "准备安装时出错" + + safe_run install_mcsm "未能安装 MCSManager" +} +main "$@" From 68995623b48ff92b892620f3140bfc152c624f7d Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Thu, 26 Feb 2026 20:52:13 +0800 Subject: [PATCH 451/463] feat: add test install sh --- setup_cn_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/setup_cn_test.sh b/setup_cn_test.sh index 425d5e2..276e760 100644 --- a/setup_cn_test.sh +++ b/setup_cn_test.sh @@ -1028,6 +1028,7 @@ install_component() { cprint cyan "删除依赖库文件 $target_path/node_modules/" if [[ -d "$target_path/node_modules/" ]]; then rm -rf "$target_path/node_modules/" + fi if cp -a "$source_path"/. "$target_path"; then cprint green "更新的文件 $source_path → $target_path" From ffff3abac45e75fd1030a02260a85e921d22015f Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Thu, 26 Feb 2026 20:57:42 +0800 Subject: [PATCH 452/463] fix: remove node_modules directory before component installation --- setup.sh | 5 +++++ setup_cn.sh | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index d532e13..4201f5e 100644 --- a/setup.sh +++ b/setup.sh @@ -1025,6 +1025,11 @@ install_component() { exit 1 fi + cprint cyan "Removing node_modules folder: $target_path/node_modules/" + if [[ -d "$target_path/node_modules/" ]]; then + rm -rf "$target_path/node_modules/" + fi + if cp -a "$source_path"/. "$target_path"; then cprint green "Updated files from $source_path → $target_path" rm -rf "$source_path" diff --git a/setup_cn.sh b/setup_cn.sh index b3f0c36..68e477d 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -1021,6 +1021,11 @@ install_component() { cleanup_install_tmp exit 1 fi + + cprint cyan "删除依赖库文件 $target_path/node_modules/" + if [[ -d "$target_path/node_modules/" ]]; then + rm -rf "$target_path/node_modules/" + fi if cp -a "$source_path"/. "$target_path"; then cprint green "更新的文件 $source_path → $target_path" @@ -1054,7 +1059,7 @@ install_component() { cleanup_install_tmp exit 1 fi - + popd >/dev/null cprint green bold "组件 '$component' 安装/更新成功." } From 07812cd8958f6065816ab84b11fa1f749b31eab1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 27 Feb 2026 16:47:58 -0500 Subject: [PATCH 453/463] Fix: Node.js exception, using 16.20.2 for CentsOS7 --- setup.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/setup.sh b/setup.sh index d532e13..86a1e94 100644 --- a/setup.sh +++ b/setup.sh @@ -26,6 +26,7 @@ package_name="mcsmanager_linux_release.tar.gz" # Node.js version to be installed # Keep the leading "v" node_version="v20.12.2" +node_version_centos7="v16.20.2" # Node download base URL - primary node_download_url_base="https://nodejs.org/dist/" @@ -483,6 +484,16 @@ detect_os_info() { cprint cyan "Detected Architecture: $arch" } +version_specific_rules() { + # Default: do nothing unless a rule matches + + if [[ "$distro" == "CentOS" && "$version" == "7" ]]; then + cprint yellow "Detected CentOS 7 — overriding Node.js version." + node_version="$node_version_centos7" + required_node_ver="${node_version#v}" + fi +} + # Check if all required commands are available check_required_commands() { local missing=0 @@ -1338,6 +1349,8 @@ main() { safe_run check_root "Script must be run as root" safe_run parse_args "Failed to parse arguments" "$@" safe_run detect_os_info "Failed to detect OS" + safe_run version_specific_rules "Failed to apply distro/version specific rules" + # To be moved to a master pre check function. safe_run resolve_node_arch "Failed to resolve Node.js architecture" From e2a48f376f6b454963b729409e31705f441dab47 Mon Sep 17 00:00:00 2001 From: Yumao Date: Sat, 28 Feb 2026 10:25:00 +0800 Subject: [PATCH 454/463] Update setup_cn.sh --- setup_cn.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/setup_cn.sh b/setup_cn.sh index 68e477d..e47d0e0 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -26,6 +26,7 @@ package_name="mcsmanager_linux_release.tar.gz" # Node.js version to be installed # Keep the leading "v" node_version="v20.12.2" +node_version_centos7="v16.20.2" # Node download base URL - primary node_download_url_base="https://nodejs.org/dist/" @@ -480,6 +481,16 @@ detect_os_info() { cprint cyan "检测到架构: $arch" } +version_specific_rules() { + # Default: do nothing unless a rule matches + + if [[ "$distro" == "CentOS" && "$version" == "7" ]]; then + cprint yellow "Detected CentOS 7 — overriding Node.js version." + node_version="$node_version_centos7" + required_node_ver="${node_version#v}" + fi +} + # Check if all required commands are available check_required_commands() { local missing=0 @@ -1341,6 +1352,8 @@ main() { safe_run check_root "脚本必须以root身份运行" safe_run parse_args "解析参数失败" "$@" safe_run detect_os_info "OS检测失败" + safe_run version_specific_rules "Failed to apply distro/version specific rules" + # To be moved to a master pre check function. safe_run resolve_node_arch "解析Node.js架构失败" From ff01a9e87b0376110715b38e8585b09e58a1bfbf Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sat, 28 Feb 2026 21:35:09 +0800 Subject: [PATCH 455/463] Update Docker configurations in market.json for multiple game servers, including start, stop, and update commands, and standardize the Docker image to githubyumao/steam-game-runtime. --- market-v2.json | 479 +++++++++++++++++++++++++++++++++++++++++++++++++ market.json | 112 ++++++------ 2 files changed, 532 insertions(+), 59 deletions(-) create mode 100644 market-v2.json diff --git a/market-v2.json b/market-v2.json new file mode 100644 index 0000000..d0c2f9e --- /dev/null +++ b/market-v2.json @@ -0,0 +1,479 @@ +[ + { + "title": "Squad Docker Server", + "language": "en_us", + "platform": "Linux", + "description": "use the official Docker image of Squad Server to quickly get started!", + "image": "https://squadovo.cn/img/header.jpg", + "gameType": "Squad", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "Intel Core platform、RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" + ], + "setupInfo": { + "startCommand": "./SquadGameServer.sh", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 403240 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Squad" + ], + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:7787/udp", + "{mcsm_port2}:15000/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } + } + }, + { + "title": "Rust Docker Server", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Rust Dedicated Server.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/rust.jpg", + "gameType": "Rust", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Commercial Use Allowed", + "Docker version" + ], + "setupInfo": { + "startCommand": "./RustDedicated -batchmode -nographics +server.port 28015 +rcon.port 28016", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 258550 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Rust" + ], + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:28015/udp", + "{mcsm_port2}:28016/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } + } + }, + { + "title": "Factorio Docker Server", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Factorio Dedicated Server.", + "image": "https://cdn.factorio.com/assets/img/web/factorio-logo2.png", + "gameType": "Factorio", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "X86_64、RAM 4G+", + "size": "", + "targetLink": "", + "author": "TPing", + "tags": [ + "Docker version" + ], + "setupInfo": { + "startCommand": "./bin/x64/factorio --start-server-load-latest", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 427520 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Factorio" + ], + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:34197/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://hytale.com/static/images/logo.png", + "gameType": "Hytale", + "description": "Use Eclipse Temurin Java Docker image to run Hytale Dedicated Server.", + "title": "Hytale Docker Server", + "category": "hytale", + "runtime": "Linux", + "hardware": "RAM 4G+", + "targetLink": "https://github.com/SkyKingPX/Hytale-Server-Installer/releases/download/1.0.0/hytale-server-installer-linux-mcsm.zip", + "author": "SkyKing_PX", + "tags": [ + "Docker version" + ], + "setupInfo": { + "type": "hytale", + "startCommand": "java -Xms2G -Xmx4G -XX:AOTCache=HytaleServer.aot -jar HytaleServer.jar --assets Assets.zip", + "stopCommand": "stop", + "updateCommand": "./hytale-server-installer-linux", + "ie": "UTF-8", + "oe": "UTF-8", + "processType": "docker", + "docker": { + "image": "eclipse-temurin:25-jdk", + "updateCommandImage": "eclipse-temurin:25-jdk", + "ports": [ + "{mcsm_port1}:5520/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } + } + }, + { + "title": "Terraria Server", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Terraria Dedicated Server.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/terraria.webp", + "gameType": "Terraria", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" + ], + "setupInfo": { + "startCommand": "./TerrariaServer.bin.x86_64 -port 7777 -autocreate 2 -worldname world1", + "stopCommand": "exit", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 105600 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/terraria", + "tag": [ + "terraria" + ], + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:7777/tcp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } + } + }, + { + "title": "Palworld Server", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Palworld Dedicated Server.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", + "gameType": "Palworld", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" + ], + "setupInfo": { + "startCommand": "./PalServer.sh -port=8211 -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 2394010 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Palworld" + ], + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:8211/udp", + "{mcsm_port2}:25575/tcp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } + } + }, + { + "title": "Project Zomboid", + "title-zh": "僵尸毁灭工程", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Project Zomboid Dedicated Server.", + "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行 Project Zomboid 专用服务器。", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/pzomboid.webp", + "gameType": "Zombie Survival", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" + ], + "setupInfo": { + "startCommand": "./start-server.sh", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 380870 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Project Zomboid" + ], + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:16261/udp", + "{mcsm_port2}:16262/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } + } + }, + { + "title": "Satisfactory Docker Server", + "title-zh": "幸福工厂 Docker 服务器", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Satisfactory Dedicated Server.", + "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行幸福工厂专用服务器。", + "image": "https://cdn.cloudflare.steamstatic.com/steam/apps/526870/header.jpg", + "gameType": "Satisfactory", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" + ], + "setupInfo": { + "startCommand": "./FactoryServer.sh", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 1690800 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Satisfactory" + ], + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:7777/udp", + "{mcsm_port2}:15000/udp", + "{mcsm_port3}:15777/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } + } + }, + { + "title": "7 Days to Die Docker Server", + "title-zh": "七日杀 Docker 服务器", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run 7 Days to Die Dedicated Server.", + "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行七日杀专用服务器。", + "image": "https://cdn.cloudflare.steamstatic.com/steam/apps/251570/header.jpg", + "gameType": "7 Days to Die", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 12G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" + ], + "setupInfo": { + "startCommand": "./startserver.sh -configfile=serverconfig.xml", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 294420 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "7 Days to Die" + ], + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:26900/udp", + "{mcsm_port2}:26900/tcp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } + } + }, + { + "title": "Left 4 Dead 2 Docker Server", + "title-zh": "求生之路2 Docker 服务器", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Left 4 Dead 2 Dedicated Server.", + "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行求生之路2专用服务器。", + "image": "https://cdn.cloudflare.steamstatic.com/steam/apps/550/header.jpg", + "gameType": "Left 4 Dead 2", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 4G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" + ], + "setupInfo": { + "startCommand": "./srcds_run -game left4dead2 -port 27015 +maxplayers 8 +map c1m4_atrium", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 222860 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Left 4 Dead 2" + ], + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:27015/udp", + "{mcsm_port2}:27015/tcp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } + } + }, + { + "title": "ARK: Survival Evolved Docker Server", + "title-zh": "方舟:生存进化 Docker 服务器", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run ARK: Survival Evolved Dedicated Server.", + "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行方舟:生存进化专用服务器。", + "image": "https://cdn.cloudflare.steamstatic.com/steam/apps/346110/header.jpg", + "gameType": "ARK: Survival Evolved", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" + ], + "setupInfo": { + "startCommand": "./ShooterGame/Binaries/Linux/ShooterGameServer Ragnarok?listen?Port=7777?QueryPort=27015?MaxPlayers=120?bRawSockets?AllowCrateSpawnsOnTopOfStructures=True -UseBattlEye -nosteamclient -game -server -log", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 376030 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "ARK" + ], + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:7777/udp", + "{mcsm_port2}:7778/udp", + "{mcsm_port3}:27015/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } + } + } +] \ No newline at end of file diff --git a/market.json b/market.json index 88e926c..1735b34 100644 --- a/market.json +++ b/market.json @@ -1713,8 +1713,9 @@ "Docker 版" ], "setupInfo": { - "startCommand": "", - "stopCommand": "docker stop squad-dedicated", + "startCommand": "./SquadGameServer.sh", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 403240 validate\" +quit", "ie": "utf8", "oe": "utf8", "type": "steam/universal", @@ -1723,20 +1724,18 @@ ], "fileCode": "utf8", "processType": "docker", - "updateCommand": "docker restart squad-dedicated", + "runAs": "steam", "docker": { - "image": "cm2network/squad", - "containerName": "squad-dedicated", + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", "ports": [ "{mcsm_port1}:7787/udp", "{mcsm_port2}:15000/udp" ], - "extraVolumes": [ - "{mcsm_workspace}/SquadConfig|/home/steam/squad-dedicated/SquadGame/ServerConfig/" - ], - "workingDir": "", + "changeWorkdir": true, + "workingDir": "/data", "env": [], - "changeWorkdir": false + "extraVolumes": [] } } }, @@ -1758,8 +1757,9 @@ "Docker version" ], "setupInfo": { - "startCommand": "", - "stopCommand": "docker stop squad-dedicated", + "startCommand": "./SquadGameServer.sh", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 403240 validate\" +quit", "ie": "utf8", "oe": "utf8", "type": "steam/universal", @@ -1768,20 +1768,18 @@ ], "fileCode": "utf8", "processType": "docker", - "updateCommand": "docker restart squad-dedicated", + "runAs": "steam", "docker": { - "image": "cm2network/squad", - "containerName": "squad-dedicated", + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", "ports": [ "{mcsm_port1}:7787/udp", "{mcsm_port2}:15000/udp" ], - "extraVolumes": [ - "{mcsm_workspace}/SquadConfig|/home/steam/squad-dedicated/SquadGame/ServerConfig/" - ], - "workingDir": "", + "changeWorkdir": true, + "workingDir": "/data", "env": [], - "changeWorkdir": false + "extraVolumes": [] } } }, @@ -1803,8 +1801,9 @@ "Docker 版" ], "setupInfo": { - "startCommand": "", - "stopCommand": "docker stop rust-server", + "startCommand": "./RustDedicated -batchmode -nographics +server.port 28015 +rcon.port 28016", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 258550 validate\" +quit", "ie": "utf8", "oe": "utf8", "type": "steam/universal", @@ -1813,22 +1812,18 @@ ], "fileCode": "utf8", "processType": "docker", - "updateCommand": "docker restart rust-server", + "runAs": "steam", "docker": { - "image": "didstopia/rust-server", - "containerName": "rust-server", + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", "ports": [ "{mcsm_port1}:28015/udp", "{mcsm_port2}:28016/udp" ], - "extraVolumes": [ - "{mcsm_workspace}/server|/server", - "{mcsm_workspace}/config|/app/.config/unity3d/Facepunch/Rust", - "{mcsm_workspace}/data|/data" - ], - "workingDir": "", + "changeWorkdir": true, + "workingDir": "/data", "env": [], - "changeWorkdir": false + "extraVolumes": [] } } }, @@ -1850,8 +1845,9 @@ "Docker version" ], "setupInfo": { - "startCommand": "", - "stopCommand": "docker stop rust-server", + "startCommand": "./RustDedicated -batchmode -nographics +server.port 28015 +rcon.port 28016", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 258550 validate\" +quit", "ie": "utf8", "oe": "utf8", "type": "steam/universal", @@ -1860,22 +1856,18 @@ ], "fileCode": "utf8", "processType": "docker", - "updateCommand": "docker restart rust-server", + "runAs": "steam", "docker": { - "image": "didstopia/rust-server", - "containerName": "rust-server", + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", "ports": [ "{mcsm_port1}:28015/udp", "{mcsm_port2}:28016/udp" ], - "extraVolumes": [ - "{mcsm_workspace}/server|/server", - "{mcsm_workspace}/config|/app/.config/unity3d/Facepunch/Rust", - "{mcsm_workspace}/data|/data" - ], - "workingDir": "", + "changeWorkdir": true, + "workingDir": "/data", "env": [], - "changeWorkdir": false + "extraVolumes": [] } } }, @@ -1896,8 +1888,9 @@ "Docker 版" ], "setupInfo": { - "startCommand": "", + "startCommand": "./bin/x64/factorio --start-server-load-latest", "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 427520 validate\" +quit", "ie": "utf8", "oe": "utf8", "type": "steam/universal", @@ -1906,17 +1899,17 @@ ], "fileCode": "utf8", "processType": "docker", - "updateCommand": "", + "runAs": "steam", "docker": { - "image": "factoriotools/factorio:latest", - "containerName": "", + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", "ports": [ "{mcsm_port1}:34197/udp" ], - "extraVolumes": [], - "workingDir": "/factorio", + "changeWorkdir": true, + "workingDir": "/data", "env": [], - "changeWorkdir": false + "extraVolumes": [] } } }, @@ -1937,8 +1930,9 @@ "Docker version" ], "setupInfo": { - "startCommand": "", + "startCommand": "./bin/x64/factorio --start-server-load-latest", "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 427520 validate\" +quit", "ie": "utf8", "oe": "utf8", "type": "steam/universal", @@ -1947,17 +1941,17 @@ ], "fileCode": "utf8", "processType": "docker", - "updateCommand": "", + "runAs": "steam", "docker": { - "image": "factoriotools/factorio:latest", - "containerName": "", + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", "ports": [ "{mcsm_port1}:34197/udp" ], - "extraVolumes": [], - "workingDir": "/factorio", + "changeWorkdir": true, + "workingDir": "/data", "env": [], - "changeWorkdir": false + "extraVolumes": [] } } }, @@ -2111,4 +2105,4 @@ } } ] -} +} \ No newline at end of file From ee91e301797bebf9298de4a3b38ae710c8443e20 Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sat, 28 Feb 2026 22:36:46 +0800 Subject: [PATCH 456/463] Refactor market-v2.json structure to include language and package arrays, enhancing organization and clarity for game server configurations. --- market-v2.json | 908 +++++++++++++++++++++++++------------------------ 1 file changed, 461 insertions(+), 447 deletions(-) diff --git a/market-v2.json b/market-v2.json index d0c2f9e..f2780d7 100644 --- a/market-v2.json +++ b/market-v2.json @@ -1,479 +1,493 @@ -[ - { - "title": "Squad Docker Server", - "language": "en_us", - "platform": "Linux", - "description": "use the official Docker image of Squad Server to quickly get started!", - "image": "https://squadovo.cn/img/header.jpg", - "gameType": "Squad", - "category": "Latest Version", - "runtime": "Linux", - "hardware": "Intel Core platform、RAM 8G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": [ - "Docker version" - ], - "setupInfo": { - "startCommand": "./SquadGameServer.sh", - "stopCommand": "^C", - "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 403240 validate\" +quit", - "ie": "utf8", - "oe": "utf8", - "type": "steam/universal", - "tag": [ - "Squad" +{ + "languages": [ + { + "label": "English", + "value": "en_us", + "path": "templates-en.json" + }, + { + "label": "中文", + "value": "zh_cn", + "path": "templates-zh.json" + } + ], + "packages": [ + { + "title": "Squad Docker Server", + "language": "en_us", + "platform": "Linux", + "description": "use the official Docker image of Squad Server to quickly get started!", + "image": "https://squadovo.cn/img/header.jpg", + "gameType": "Squad", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "Intel Core platform、RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" ], - "fileCode": "utf8", - "processType": "docker", - "runAs": "steam", - "docker": { - "image": "githubyumao/steam-game-runtime:latest", - "updateCommandImage": "githubyumao/steam-game-runtime:latest", - "ports": [ - "{mcsm_port1}:7787/udp", - "{mcsm_port2}:15000/udp" + "setupInfo": { + "startCommand": "./SquadGameServer.sh", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 403240 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Squad" ], - "changeWorkdir": true, - "workingDir": "/data", - "env": [], - "extraVolumes": [] + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:7787/udp", + "{mcsm_port2}:15000/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } } - } - }, - { - "title": "Rust Docker Server", - "language": "en_us", - "platform": "Linux", - "description": "Use the steam-game-runtime Docker image and SteamCMD to run Rust Dedicated Server.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/rust.jpg", - "gameType": "Rust", - "category": "Latest Version", - "runtime": "Linux", - "hardware": "", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": [ - "Commercial Use Allowed", - "Docker version" - ], - "setupInfo": { - "startCommand": "./RustDedicated -batchmode -nographics +server.port 28015 +rcon.port 28016", - "stopCommand": "^C", - "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 258550 validate\" +quit", - "ie": "utf8", - "oe": "utf8", - "type": "steam/universal", - "tag": [ - "Rust" + }, + { + "title": "Rust Docker Server", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Rust Dedicated Server.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/rust.jpg", + "gameType": "Rust", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Commercial Use Allowed", + "Docker version" ], - "fileCode": "utf8", - "processType": "docker", - "runAs": "steam", - "docker": { - "image": "githubyumao/steam-game-runtime:latest", - "updateCommandImage": "githubyumao/steam-game-runtime:latest", - "ports": [ - "{mcsm_port1}:28015/udp", - "{mcsm_port2}:28016/udp" + "setupInfo": { + "startCommand": "./RustDedicated -batchmode -nographics +server.port 28015 +rcon.port 28016", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 258550 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Rust" ], - "changeWorkdir": true, - "workingDir": "/data", - "env": [], - "extraVolumes": [] + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:28015/udp", + "{mcsm_port2}:28016/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } } - } - }, - { - "title": "Factorio Docker Server", - "language": "en_us", - "platform": "Linux", - "description": "Use the steam-game-runtime Docker image and SteamCMD to run Factorio Dedicated Server.", - "image": "https://cdn.factorio.com/assets/img/web/factorio-logo2.png", - "gameType": "Factorio", - "category": "Latest Version", - "runtime": "Linux", - "hardware": "X86_64、RAM 4G+", - "size": "", - "targetLink": "", - "author": "TPing", - "tags": [ - "Docker version" - ], - "setupInfo": { - "startCommand": "./bin/x64/factorio --start-server-load-latest", - "stopCommand": "^C", - "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 427520 validate\" +quit", - "ie": "utf8", - "oe": "utf8", - "type": "steam/universal", - "tag": [ - "Factorio" + }, + { + "title": "Factorio Docker Server", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Factorio Dedicated Server.", + "image": "https://cdn.factorio.com/assets/img/web/factorio-logo2.png", + "gameType": "Factorio", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "X86_64、RAM 4G+", + "size": "", + "targetLink": "", + "author": "TPing", + "tags": [ + "Docker version" ], - "fileCode": "utf8", - "processType": "docker", - "runAs": "steam", - "docker": { - "image": "githubyumao/steam-game-runtime:latest", - "updateCommandImage": "githubyumao/steam-game-runtime:latest", - "ports": [ - "{mcsm_port1}:34197/udp" + "setupInfo": { + "startCommand": "./bin/x64/factorio --start-server-load-latest", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 427520 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Factorio" ], - "changeWorkdir": true, - "workingDir": "/data", - "env": [], - "extraVolumes": [] + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:34197/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } } - } - }, - { - "platform": "Linux", - "language": "en_us", - "image": "https://hytale.com/static/images/logo.png", - "gameType": "Hytale", - "description": "Use Eclipse Temurin Java Docker image to run Hytale Dedicated Server.", - "title": "Hytale Docker Server", - "category": "hytale", - "runtime": "Linux", - "hardware": "RAM 4G+", - "targetLink": "https://github.com/SkyKingPX/Hytale-Server-Installer/releases/download/1.0.0/hytale-server-installer-linux-mcsm.zip", - "author": "SkyKing_PX", - "tags": [ - "Docker version" - ], - "setupInfo": { - "type": "hytale", - "startCommand": "java -Xms2G -Xmx4G -XX:AOTCache=HytaleServer.aot -jar HytaleServer.jar --assets Assets.zip", - "stopCommand": "stop", - "updateCommand": "./hytale-server-installer-linux", - "ie": "UTF-8", - "oe": "UTF-8", - "processType": "docker", - "docker": { - "image": "eclipse-temurin:25-jdk", - "updateCommandImage": "eclipse-temurin:25-jdk", - "ports": [ - "{mcsm_port1}:5520/udp" - ], - "changeWorkdir": true, - "workingDir": "/data", - "env": [], - "extraVolumes": [] + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://hytale.com/static/images/logo.png", + "gameType": "Hytale", + "description": "Use Eclipse Temurin Java Docker image to run Hytale Dedicated Server.", + "title": "Hytale Docker Server", + "category": "hytale", + "runtime": "Linux", + "hardware": "RAM 4G+", + "targetLink": "https://github.com/SkyKingPX/Hytale-Server-Installer/releases/download/1.0.0/hytale-server-installer-linux-mcsm.zip", + "author": "SkyKing_PX", + "tags": [ + "Docker version" + ], + "setupInfo": { + "type": "hytale", + "startCommand": "java -Xms2G -Xmx4G -XX:AOTCache=HytaleServer.aot -jar HytaleServer.jar --assets Assets.zip", + "stopCommand": "stop", + "updateCommand": "./hytale-server-installer-linux", + "ie": "UTF-8", + "oe": "UTF-8", + "processType": "docker", + "docker": { + "image": "eclipse-temurin:25-jdk", + "updateCommandImage": "eclipse-temurin:25-jdk", + "ports": [ + "{mcsm_port1}:5520/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } } - } - }, - { - "title": "Terraria Server", - "language": "en_us", - "platform": "Linux", - "description": "Use the steam-game-runtime Docker image and SteamCMD to run Terraria Dedicated Server.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/terraria.webp", - "gameType": "Terraria", - "category": "Latest Version", - "runtime": "Linux", - "hardware": "RAM 8G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": [ - "Docker version" - ], - "setupInfo": { - "startCommand": "./TerrariaServer.bin.x86_64 -port 7777 -autocreate 2 -worldname world1", - "stopCommand": "exit", - "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 105600 validate\" +quit", - "ie": "utf8", - "oe": "utf8", - "type": "steam/terraria", - "tag": [ - "terraria" + }, + { + "title": "Terraria Server", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Terraria Dedicated Server.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/terraria.webp", + "gameType": "Terraria", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" ], - "fileCode": "utf8", - "processType": "docker", - "runAs": "steam", - "docker": { - "image": "githubyumao/steam-game-runtime:latest", - "updateCommandImage": "githubyumao/steam-game-runtime:latest", - "ports": [ - "{mcsm_port1}:7777/tcp" + "setupInfo": { + "startCommand": "./TerrariaServer.bin.x86_64 -port 7777 -autocreate 2 -worldname world1", + "stopCommand": "exit", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 105600 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/terraria", + "tag": [ + "terraria" ], - "changeWorkdir": true, - "workingDir": "/data", - "env": [], - "extraVolumes": [] + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:7777/tcp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } } - } - }, - { - "title": "Palworld Server", - "language": "en_us", - "platform": "Linux", - "description": "Use the steam-game-runtime Docker image and SteamCMD to run Palworld Dedicated Server.", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", - "gameType": "Palworld", - "category": "Latest Version", - "runtime": "Linux", - "hardware": "RAM 8G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": [ - "Docker version" - ], - "setupInfo": { - "startCommand": "./PalServer.sh -port=8211 -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS", - "stopCommand": "^C", - "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 2394010 validate\" +quit", - "ie": "utf8", - "oe": "utf8", - "type": "steam/universal", - "tag": [ - "Palworld" + }, + { + "title": "Palworld Server", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Palworld Dedicated Server.", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/palworld.webp", + "gameType": "Palworld", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" ], - "fileCode": "utf8", - "processType": "docker", - "runAs": "steam", - "docker": { - "image": "githubyumao/steam-game-runtime:latest", - "updateCommandImage": "githubyumao/steam-game-runtime:latest", - "ports": [ - "{mcsm_port1}:8211/udp", - "{mcsm_port2}:25575/tcp" + "setupInfo": { + "startCommand": "./PalServer.sh -port=8211 -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 2394010 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Palworld" ], - "changeWorkdir": true, - "workingDir": "/data", - "env": [], - "extraVolumes": [] + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:8211/udp", + "{mcsm_port2}:25575/tcp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } } - } - }, - { - "title": "Project Zomboid", - "title-zh": "僵尸毁灭工程", - "language": "en_us", - "platform": "Linux", - "description": "Use the steam-game-runtime Docker image and SteamCMD to run Project Zomboid Dedicated Server.", - "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行 Project Zomboid 专用服务器。", - "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/pzomboid.webp", - "gameType": "Zombie Survival", - "category": "Latest Version", - "runtime": "Linux", - "hardware": "RAM 8G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": [ - "Docker version" - ], - "setupInfo": { - "startCommand": "./start-server.sh", - "stopCommand": "^C", - "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 380870 validate\" +quit", - "ie": "utf8", - "oe": "utf8", - "type": "steam/universal", - "tag": [ - "Project Zomboid" + }, + { + "title": "Project Zomboid", + "title-zh": "僵尸毁灭工程", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Project Zomboid Dedicated Server.", + "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行 Project Zomboid 专用服务器。", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/pzomboid.webp", + "gameType": "Zombie Survival", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" ], - "fileCode": "utf8", - "processType": "docker", - "runAs": "steam", - "docker": { - "image": "githubyumao/steam-game-runtime:latest", - "updateCommandImage": "githubyumao/steam-game-runtime:latest", - "ports": [ - "{mcsm_port1}:16261/udp", - "{mcsm_port2}:16262/udp" + "setupInfo": { + "startCommand": "./start-server.sh", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 380870 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Project Zomboid" ], - "changeWorkdir": true, - "workingDir": "/data", - "env": [], - "extraVolumes": [] + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:16261/udp", + "{mcsm_port2}:16262/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } } - } - }, - { - "title": "Satisfactory Docker Server", - "title-zh": "幸福工厂 Docker 服务器", - "language": "en_us", - "platform": "Linux", - "description": "Use the steam-game-runtime Docker image and SteamCMD to run Satisfactory Dedicated Server.", - "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行幸福工厂专用服务器。", - "image": "https://cdn.cloudflare.steamstatic.com/steam/apps/526870/header.jpg", - "gameType": "Satisfactory", - "category": "Latest Version", - "runtime": "Linux", - "hardware": "RAM 8G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": [ - "Docker version" - ], - "setupInfo": { - "startCommand": "./FactoryServer.sh", - "stopCommand": "^C", - "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 1690800 validate\" +quit", - "ie": "utf8", - "oe": "utf8", - "type": "steam/universal", - "tag": [ - "Satisfactory" + }, + { + "title": "Satisfactory Docker Server", + "title-zh": "幸福工厂 Docker 服务器", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Satisfactory Dedicated Server.", + "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行幸福工厂专用服务器。", + "image": "https://cdn.cloudflare.steamstatic.com/steam/apps/526870/header.jpg", + "gameType": "Satisfactory", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" ], - "fileCode": "utf8", - "processType": "docker", - "runAs": "steam", - "docker": { - "image": "githubyumao/steam-game-runtime:latest", - "updateCommandImage": "githubyumao/steam-game-runtime:latest", - "ports": [ - "{mcsm_port1}:7777/udp", - "{mcsm_port2}:15000/udp", - "{mcsm_port3}:15777/udp" + "setupInfo": { + "startCommand": "./FactoryServer.sh", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 1690800 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Satisfactory" ], - "changeWorkdir": true, - "workingDir": "/data", - "env": [], - "extraVolumes": [] + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:7777/udp", + "{mcsm_port2}:15000/udp", + "{mcsm_port3}:15777/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } } - } - }, - { - "title": "7 Days to Die Docker Server", - "title-zh": "七日杀 Docker 服务器", - "language": "en_us", - "platform": "Linux", - "description": "Use the steam-game-runtime Docker image and SteamCMD to run 7 Days to Die Dedicated Server.", - "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行七日杀专用服务器。", - "image": "https://cdn.cloudflare.steamstatic.com/steam/apps/251570/header.jpg", - "gameType": "7 Days to Die", - "category": "Latest Version", - "runtime": "Linux", - "hardware": "RAM 12G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": [ - "Docker version" - ], - "setupInfo": { - "startCommand": "./startserver.sh -configfile=serverconfig.xml", - "stopCommand": "^C", - "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 294420 validate\" +quit", - "ie": "utf8", - "oe": "utf8", - "type": "steam/universal", - "tag": [ - "7 Days to Die" + }, + { + "title": "7 Days to Die Docker Server", + "title-zh": "七日杀 Docker 服务器", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run 7 Days to Die Dedicated Server.", + "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行七日杀专用服务器。", + "image": "https://cdn.cloudflare.steamstatic.com/steam/apps/251570/header.jpg", + "gameType": "7 Days to Die", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 12G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" ], - "fileCode": "utf8", - "processType": "docker", - "runAs": "steam", - "docker": { - "image": "githubyumao/steam-game-runtime:latest", - "updateCommandImage": "githubyumao/steam-game-runtime:latest", - "ports": [ - "{mcsm_port1}:26900/udp", - "{mcsm_port2}:26900/tcp" + "setupInfo": { + "startCommand": "./startserver.sh -configfile=serverconfig.xml", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 294420 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "7 Days to Die" ], - "changeWorkdir": true, - "workingDir": "/data", - "env": [], - "extraVolumes": [] + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:26900/udp", + "{mcsm_port2}:26900/tcp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } } - } - }, - { - "title": "Left 4 Dead 2 Docker Server", - "title-zh": "求生之路2 Docker 服务器", - "language": "en_us", - "platform": "Linux", - "description": "Use the steam-game-runtime Docker image and SteamCMD to run Left 4 Dead 2 Dedicated Server.", - "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行求生之路2专用服务器。", - "image": "https://cdn.cloudflare.steamstatic.com/steam/apps/550/header.jpg", - "gameType": "Left 4 Dead 2", - "category": "Latest Version", - "runtime": "Linux", - "hardware": "RAM 4G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": [ - "Docker version" - ], - "setupInfo": { - "startCommand": "./srcds_run -game left4dead2 -port 27015 +maxplayers 8 +map c1m4_atrium", - "stopCommand": "^C", - "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 222860 validate\" +quit", - "ie": "utf8", - "oe": "utf8", - "type": "steam/universal", - "tag": [ - "Left 4 Dead 2" + }, + { + "title": "Left 4 Dead 2 Docker Server", + "title-zh": "求生之路2 Docker 服务器", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run Left 4 Dead 2 Dedicated Server.", + "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行求生之路2专用服务器。", + "image": "https://cdn.cloudflare.steamstatic.com/steam/apps/550/header.jpg", + "gameType": "Left 4 Dead 2", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 4G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" ], - "fileCode": "utf8", - "processType": "docker", - "runAs": "steam", - "docker": { - "image": "githubyumao/steam-game-runtime:latest", - "updateCommandImage": "githubyumao/steam-game-runtime:latest", - "ports": [ - "{mcsm_port1}:27015/udp", - "{mcsm_port2}:27015/tcp" + "setupInfo": { + "startCommand": "./srcds_run -game left4dead2 -port 27015 +maxplayers 8 +map c1m4_atrium", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 222860 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "Left 4 Dead 2" ], - "changeWorkdir": true, - "workingDir": "/data", - "env": [], - "extraVolumes": [] + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:27015/udp", + "{mcsm_port2}:27015/tcp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } } - } - }, - { - "title": "ARK: Survival Evolved Docker Server", - "title-zh": "方舟:生存进化 Docker 服务器", - "language": "en_us", - "platform": "Linux", - "description": "Use the steam-game-runtime Docker image and SteamCMD to run ARK: Survival Evolved Dedicated Server.", - "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行方舟:生存进化专用服务器。", - "image": "https://cdn.cloudflare.steamstatic.com/steam/apps/346110/header.jpg", - "gameType": "ARK: Survival Evolved", - "category": "Latest Version", - "runtime": "Linux", - "hardware": "RAM 8G+", - "size": "", - "targetLink": "", - "author": "MCSManager", - "tags": [ - "Docker version" - ], - "setupInfo": { - "startCommand": "./ShooterGame/Binaries/Linux/ShooterGameServer Ragnarok?listen?Port=7777?QueryPort=27015?MaxPlayers=120?bRawSockets?AllowCrateSpawnsOnTopOfStructures=True -UseBattlEye -nosteamclient -game -server -log", - "stopCommand": "^C", - "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 376030 validate\" +quit", - "ie": "utf8", - "oe": "utf8", - "type": "steam/universal", - "tag": [ - "ARK" + }, + { + "title": "ARK: Survival Evolved Docker Server", + "title-zh": "方舟:生存进化 Docker 服务器", + "language": "en_us", + "platform": "Linux", + "description": "Use the steam-game-runtime Docker image and SteamCMD to run ARK: Survival Evolved Dedicated Server.", + "description-zh": "使用 steam-game-runtime Docker 镜像和 SteamCMD 运行方舟:生存进化专用服务器。", + "image": "https://cdn.cloudflare.steamstatic.com/steam/apps/346110/header.jpg", + "gameType": "ARK: Survival Evolved", + "category": "Latest Version", + "runtime": "Linux", + "hardware": "RAM 8G+", + "size": "", + "targetLink": "", + "author": "MCSManager", + "tags": [ + "Docker version" ], - "fileCode": "utf8", - "processType": "docker", - "runAs": "steam", - "docker": { - "image": "githubyumao/steam-game-runtime:latest", - "updateCommandImage": "githubyumao/steam-game-runtime:latest", - "ports": [ - "{mcsm_port1}:7777/udp", - "{mcsm_port2}:7778/udp", - "{mcsm_port3}:27015/udp" + "setupInfo": { + "startCommand": "./ShooterGame/Binaries/Linux/ShooterGameServer Ragnarok?listen?Port=7777?QueryPort=27015?MaxPlayers=120?bRawSockets?AllowCrateSpawnsOnTopOfStructures=True -UseBattlEye -nosteamclient -game -server -log", + "stopCommand": "^C", + "updateCommand": "/home/steam/steamcmd/steamcmd.sh -net_ipv4 +force_install_dir \"/data\" +login anonymous \"+app_update 376030 validate\" +quit", + "ie": "utf8", + "oe": "utf8", + "type": "steam/universal", + "tag": [ + "ARK" ], - "changeWorkdir": true, - "workingDir": "/data", - "env": [], - "extraVolumes": [] + "fileCode": "utf8", + "processType": "docker", + "runAs": "steam", + "docker": { + "image": "githubyumao/steam-game-runtime:latest", + "updateCommandImage": "githubyumao/steam-game-runtime:latest", + "ports": [ + "{mcsm_port1}:7777/udp", + "{mcsm_port2}:7778/udp", + "{mcsm_port3}:27015/udp" + ], + "changeWorkdir": true, + "workingDir": "/data", + "env": [], + "extraVolumes": [] + } } } - } -] \ No newline at end of file + ] +} \ No newline at end of file From 05f98482be3824a6aca7bb6257d9c9bc599a1d7f Mon Sep 17 00:00:00 2001 From: YuMao233 Date: Sun, 1 Mar 2026 20:13:40 +0800 Subject: [PATCH 457/463] Add Docker support for Java 25 in market.json, enhancing server configuration options. --- market.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/market.json b/market.json index 1735b34..88a2f8c 100644 --- a/market.json +++ b/market.json @@ -26,6 +26,10 @@ "remark": "包含基础插件,萌新快速开服!低配机器专属!", "targetLink": "https://cloud.alongw.cn/f/DzvHK/Paper-1.21.1-ZH.zip", "author": "alongw.cn", + "dockerSupport": { + "image": "eclipse-temurin:25-jdk", + "updateCommandImage": "eclipse-temurin:25-jdk" + }, "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms4096M -Xmx4096M -jar server.jar nogui", From bc80355ecf4e1f29f496070f9c18d072d9b9eb26 Mon Sep 17 00:00:00 2001 From: Yumao Date: Mon, 2 Mar 2026 14:48:32 +0800 Subject: [PATCH 458/463] Update market.json --- market.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market.json b/market.json index 88a2f8c..4ff7947 100644 --- a/market.json +++ b/market.json @@ -26,7 +26,7 @@ "remark": "包含基础插件,萌新快速开服!低配机器专属!", "targetLink": "https://cloud.alongw.cn/f/DzvHK/Paper-1.21.1-ZH.zip", "author": "alongw.cn", - "dockerSupport": { + "dockerOptional": { "image": "eclipse-temurin:25-jdk", "updateCommandImage": "eclipse-temurin:25-jdk" }, @@ -2109,4 +2109,4 @@ } } ] -} \ No newline at end of file +} From 785b509ca9c41620dbb51af99cb0cf3bbdee8fb4 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Mon, 9 Mar 2026 20:09:46 +0800 Subject: [PATCH 459/463] Update Docker configurations in market.json to use Java 21 and 17 for various Minecraft server setups, enhancing compatibility and performance. --- market.json | 198 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 195 insertions(+), 3 deletions(-) diff --git a/market.json b/market.json index 4ff7947..711c456 100644 --- a/market.json +++ b/market.json @@ -27,8 +27,8 @@ "targetLink": "https://cloud.alongw.cn/f/DzvHK/Paper-1.21.1-ZH.zip", "author": "alongw.cn", "dockerOptional": { - "image": "eclipse-temurin:25-jdk", - "updateCommandImage": "eclipse-temurin:25-jdk" + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" }, "setupInfo": { "type": "minecraft/java", @@ -53,6 +53,10 @@ "remark": "支持插件,最低 8GB 内存要求", "targetLink": "https://url.alww.top/mcsm/paper1.20.4.zip", "author": "alongw.cn", + "dockerOptional": { + "image": "eclipse-temurin:17-jdk", + "updateCommandImage": "eclipse-temurin:17-jdk" + }, "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms6144M -Xmx6144M -jar server.jar nogui", @@ -253,6 +257,10 @@ "remark": "仅包含 Paper 版本", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.10/builds/84/downloads/paper-1.21.10-84.jar", "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.10-84.jar nogui", @@ -276,6 +284,10 @@ "remark": "仅包含 Paper 版本", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/60/downloads/paper-1.21.8-60.jar", "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-60.jar nogui", @@ -299,6 +311,10 @@ "remark": "仅包含 Paper 版本", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/133/downloads/paper-1.21.1-133.jar", "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.1-133.jar nogui", @@ -322,6 +338,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.3.33/forge-1.20.1-47.3.33-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:17-jdk", + "updateCommandImage": "eclipse-temurin:17-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -345,6 +365,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.1-47.3.33/forge-1.20.1-47.3.33-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:17-jdk", + "updateCommandImage": "eclipse-temurin:17-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", @@ -368,6 +392,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.20.6-50.1.48/forge-1.20.6-50.1.48-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", @@ -391,6 +419,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.2-43.4.20/forge-1.19.2-43.4.20-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:17-jdk", + "updateCommandImage": "eclipse-temurin:17-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", @@ -545,6 +577,10 @@ "remark": "Minecraft Paper", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.11/builds/39/downloads/paper-1.21.11-39.jar", "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.11-39.jar nogui", @@ -568,6 +604,10 @@ "remark": "Minecraft Paper", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.10/builds/117/downloads/paper-1.21.10-117.jar", "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.10-117.jar nogui", @@ -591,6 +631,10 @@ "remark": "Minecraft Paper", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/60/downloads/paper-1.21.8-60.jar", "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-60.jar nogui", @@ -614,6 +658,10 @@ "remark": "Minecraft Paper", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-232.jar nogui", @@ -637,6 +685,10 @@ "remark": "Minecraft Paper", "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/133/downloads/paper-1.21.1-133.jar", "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/paper", "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.1-133.jar nogui", @@ -660,6 +712,10 @@ "remark": "Minecraft Purpur", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.11-2538.jar", "author": "purpurmc.org", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.11-2538.jar nogui", @@ -683,6 +739,10 @@ "remark": "Minecraft Purpur", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.10-2535.jar", "author": "purpurmc.org", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.10-2535.jar nogui", @@ -706,6 +766,10 @@ "remark": "Minecraft Purpur", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2497.jar", "author": "purpurmc.org", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2497.jar nogui", @@ -729,6 +793,10 @@ "remark": "Only Purpur included", "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2416.jar", "author": "purpurmc.org", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/purpur", "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2416.jar nogui", @@ -752,6 +820,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.11-61.0.3/forge-1.21.11-61.0.3-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -775,6 +847,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.11-61.0.3/forge-1.21.11-61.0.3-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", @@ -798,6 +874,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.1.5/forge-1.21.10-60.1.5-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -821,6 +901,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.1.5/forge-1.21.10-60.1.5-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", @@ -844,6 +928,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.9/forge-1.21.8-58.1.9-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -867,6 +955,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.9/forge-1.21.8-58.1.9-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", @@ -890,6 +982,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.8/forge-1.21.4-54.1.8-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -913,6 +1009,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.8/forge-1.21.4-54.1.8-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", @@ -936,6 +1036,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.6/forge-1.21.1-52.1.6-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": "sh ./run.sh", @@ -959,6 +1063,10 @@ "remark": "Minecraft Forge", "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.6/forge-1.21.1-52.1.6-installer.jar", "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/forge", "startCommand": ".\\run.bat", @@ -982,6 +1090,10 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.11.8-beta/neoforge-21.11.8-beta-installer.jar", "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": "sh ./run.sh", @@ -1005,6 +1117,10 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.11.8-beta/neoforge-21.11.8-beta-installer.jar", "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": ".\\run.bat", @@ -1028,6 +1144,10 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.10.63/neoforge-21.10.63-installer.jar", "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": "sh ./run.sh", @@ -1051,6 +1171,10 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.10.63/neoforge-21.10.63-installer.jar", "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": ".\\run.bat", @@ -1074,6 +1198,10 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.52/neoforge-21.8.52-installer.jar", "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": "sh ./run.sh", @@ -1097,6 +1225,10 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.52/neoforge-21.8.52-installer.jar", "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": ".\\run.bat", @@ -1120,6 +1252,10 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.155/neoforge-21.4.155-installer.jar", "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": "sh ./run.sh", @@ -1143,6 +1279,10 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.155/neoforge-21.4.155-installer.jar", "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": ".\\run.bat", @@ -1166,6 +1306,10 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.213/neoforge-21.1.213-installer.jar", "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": "sh ./run.sh", @@ -1189,6 +1333,10 @@ "remark": "Minecraft NeoForge", "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.213/neoforge-21.1.213-installer.jar", "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/neoforge", "startCommand": ".\\run.bat", @@ -1212,6 +1360,10 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1235,6 +1387,10 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1258,6 +1414,10 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1281,6 +1441,10 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1304,6 +1468,10 @@ "remark": "Minecraft Fabric", "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", "author": "fabricmc.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/fabric", "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", @@ -1327,6 +1495,10 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/64bb6d763bed0a9f1d632ec347938594144943ed/server.jar", "author": "Mojang Studios", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1350,6 +1522,10 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/95495a7f485eedd84ce928cef5e223b757d2f764/server.jar", "author": "Mojang Studios", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1373,6 +1549,10 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar", "author": "Mojang Studios", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -1396,6 +1576,10 @@ "remark": "Minecraft Java", "targetLink": "https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar", "author": "Mojang Studios", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java", "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", @@ -2076,6 +2260,10 @@ "remark": "Minecraft Folia", "targetLink": "https://fill-data.papermc.io/v1/objects/f4e9c5c374a53d17b6173cac35242c05c12217b656b6cc5dc07354cc37ec4066/folia-1.21.11-11.jar", "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/folia", "startCommand": "java -Xms4096M -Xmx4096M -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:G1MaxNewSizePercent=40 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1NewSizePercent=30 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:MaxGCPauseMillis=200 -XX:MaxTenuringThreshold=1 -XX:SurvivorRatio=32 -jar folia-1.21.11-11.jar nogui", @@ -2099,6 +2287,10 @@ "remark": "Minecraft Folia", "targetLink": "https://fill-data.papermc.io/v1/objects/233843cfd5001b6f658fcab549178d694cc37f0277d004ea295de0a94c57278f/folia-1.21.8-6.jar", "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, "setupInfo": { "type": "minecraft/java/folia", "startCommand": "java -Xms4096M -Xmx4096M -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:G1MaxNewSizePercent=40 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1NewSizePercent=30 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:MaxGCPauseMillis=200 -XX:MaxTenuringThreshold=1 -XX:SurvivorRatio=32 -jar folia-1.21.8-6.jar nogui", @@ -2109,4 +2301,4 @@ } } ] -} +} \ No newline at end of file From c4c93567b9a3f79a17df911b1003745aa1e4e2f2 Mon Sep 17 00:00:00 2001 From: yumao233 Date: Mon, 9 Mar 2026 20:21:35 +0800 Subject: [PATCH 460/463] Add new Minecraft server configurations to market-v2.json, including EndStone MC Server and multiple PaperMC versions (1.21.1, 1.21.4, 1.21.8, 1.21.10, 1.21.11) with updated setup information and Docker support. --- market-v2.json | 1123 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1122 insertions(+), 1 deletion(-) diff --git a/market-v2.json b/market-v2.json index f2780d7..10900d1 100644 --- a/market-v2.json +++ b/market-v2.json @@ -488,6 +488,1127 @@ "extraVolumes": [] } } + }, + { + "title": "EndStone MC Server", + "language": "en_us", + "platform": "Linux", + "description": "For Linux, using the official EndStone MC Docker image, one-click to quickly set up the server!", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/endstone_mc.webp", + "gameType": "Minecraft", + "category": "Latest Version", + "runtime": "Ubuntu/Centos LTS", + "hardware": "RAM 2G+", + "size": "", + "targetLink": "", + "author": "EndStone", + "tags": [ + "Docker version" + ], + "setupInfo": { + "startCommand": "endstone -y -s .", + "stopCommand": "stop", + "ie": "utf8", + "oe": "utf8", + "type": "minecraft/bedrock", + "tag": [ + "bedrock" + ], + "fileCode": "utf8", + "processType": "docker", + "updateCommand": "", + "docker": { + "image": "endstone/endstone:latest", + "containerName": "endstone-server", + "ports": [ + "{mcsm_port1}:19132/udp" + ], + "extraVolumes": [], + "workingDir": "", + "env": [], + "changeWorkdir": true + } + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.11 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PaperMC] Minecraft 1.21.11", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "100MB", + "remark": "Minecraft Paper", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.11/builds/39/downloads/paper-1.21.11-39.jar", + "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.11-39.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.10 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PaperMC] Minecraft 1.21.10", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "100MB", + "remark": "Minecraft Paper", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.10/builds/117/downloads/paper-1.21.10-117.jar", + "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.10-117.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.8 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PaperMC] Minecraft 1.21.8", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "100MB", + "remark": "Minecraft Paper", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.8/builds/60/downloads/paper-1.21.8-60.jar", + "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.8-60.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.4 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PaperMC] Minecraft 1.21.4", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "50MB", + "remark": "Minecraft Paper", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/232/downloads/paper-1.21.4-232.jar", + "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.4-232.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.1 Paper Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PaperMC] Minecraft 1.21.1", + "category": "mc-paper", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "100MB", + "remark": "Minecraft Paper", + "targetLink": "https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/133/downloads/paper-1.21.1-133.jar", + "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/paper", + "startCommand": "java -Xms4096M -Xmx4096M -jar paper-1.21.1-133.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.11", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "55MB", + "remark": "Minecraft Purpur", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.11-2538.jar", + "author": "purpurmc.org", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.11-2538.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.10", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "55MB", + "remark": "Minecraft Purpur", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.10-2535.jar", + "author": "purpurmc.org", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.10-2535.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.8 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.8", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "55MB", + "remark": "Minecraft Purpur", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.8-2497.jar", + "author": "purpurmc.org", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.8-2497.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.4 Purpur Quick Server Setup, High Performance, Low Resource Usage, Plugin Support, No Mod Support", + "title": "[PurpurMC] Minecraft 1.21.4", + "category": "mc-purpur", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "50MB", + "remark": "Only Purpur included", + "targetLink": "https://github.com/SkyKingPX/MCSManagerServerSoftware/releases/download/PurpurMC/purpur-1.21.4-2416.jar", + "author": "purpurmc.org", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/purpur", + "startCommand": "java -Xms4096M -Xmx4096M -jar purpur-1.21.4-2416.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 Forge Quick Server Setup, Mod Support for Linux", + "title": "[Forge] Minecraft 1.21.11", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.11-61.0.3/forge-1.21.11-61.0.3-installer.jar", + "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.11-61.0.3-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 Forge Quick Server Setup, Mod Support for Windows", + "title": "[Forge] Minecraft 1.21.11", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.11-61.0.3/forge-1.21.11-61.0.3-installer.jar", + "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.11-61.0.3-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 Forge Quick Server Setup, Mod Support for Linux", + "title": "[Forge] Minecraft 1.21.10", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.1.5/forge-1.21.10-60.1.5-installer.jar", + "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.10-60.1.5-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 Forge Quick Server Setup, Mod Support for Windows", + "title": "[Forge] Minecraft 1.21.10", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.10-60.1.5/forge-1.21.10-60.1.5-installer.jar", + "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.10-60.1.5-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.8 Forge Quick Server Setup, Mod Support for Linux", + "title": "[Forge] Minecraft 1.21.8", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.9/forge-1.21.8-58.1.9-installer.jar", + "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.8-58.1.9-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.8 Forge Quick Server Setup, Mod Support for Windows", + "title": "[Forge] Minecraft 1.21.8", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.8-58.1.9/forge-1.21.8-58.1.9-installer.jar", + "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.8-58.1.9-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.4 Forge Quick Server Setup, Mod Support for Linux", + "title": "[Forge] Minecraft 1.21.4", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.8/forge-1.21.4-54.1.8-installer.jar", + "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.4-54.1.8-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.4 Forge Quick Server Setup, Mod Support for Windows", + "title": "[Forge] Minecraft 1.21.4", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.4-54.1.8/forge-1.21.4-54.1.8-installer.jar", + "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.4-54.1.8-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.1 Forge Quick Server Setup, Mod Support for Linux", + "title": "[Forge] Minecraft 1.21.1", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.6/forge-1.21.1-52.1.6-installer.jar", + "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.1-52.1.6-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/mc-forge.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.1 Forge Quick Server Setup, Mod Support for Windows", + "title": "[Forge] Minecraft 1.21.1", + "category": "mc-forge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft Forge", + "targetLink": "https://maven.minecraftforge.net/net/minecraftforge/forge/1.21.1-52.1.6/forge-1.21.1-52.1.6-installer.jar", + "author": "minecraftforge.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/forge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar forge-1.21.1-52.1.6-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 NeoForge Quick Server Setup, Mod Support for Linux", + "title": "[NeoForge] Minecraft 1.21.11", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.11.8-beta/neoforge-21.11.8-beta-installer.jar", + "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.11.8-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 NeoForge Quick Server Setup, Mod Support for Windows", + "title": "[NeoForge] Minecraft 1.21.11", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.11.8-beta/neoforge-21.11.8-beta-installer.jar", + "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.11.8-beta-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 NeoForge Quick Server Setup, Mod Support for Linux", + "title": "[NeoForge] Minecraft 1.21.10", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.10.63/neoforge-21.10.63-installer.jar", + "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.10.63-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 NeoForge Quick Server Setup, Mod Support for Windows", + "title": "[NeoForge] Minecraft 1.21.10", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.10.63/neoforge-21.10.63-installer.jar", + "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.10.63-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.8 NeoForge Quick Server Setup, Mod Support for Linux", + "title": "[NeoForge] Minecraft 1.21.8", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.52/neoforge-21.8.52-installer.jar", + "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.8.52-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.8 NeoForge Quick Server Setup, Mod Support for Windows", + "title": "[NeoForge] Minecraft 1.21.8", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.8.52/neoforge-21.8.52-installer.jar", + "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.8.52-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.4 NeoForge Quick Server Setup, Mod Support for Linux", + "title": "[NeoForge] Minecraft 1.21.4", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.155/neoforge-21.4.155-installer.jar", + "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.4.155-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.4 NeoForge Quick Server Setup, Mod Support for Windows", + "title": "[NeoForge] Minecraft 1.21.4", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.4.155/neoforge-21.4.155-installer.jar", + "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.4.155-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Linux", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.1 NeoForge Quick Server Setup, Mod Support for Linux", + "title": "[NeoForge] Minecraft 1.21.1", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.213/neoforge-21.1.213-installer.jar", + "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": "sh ./run.sh", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.1.213-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "Windows", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.1 NeoForge Quick Server Setup, Mod Support for Windows", + "title": "[NeoForge] Minecraft 1.21.1", + "category": "mc-neoforge", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "7MB", + "remark": "Minecraft NeoForge", + "targetLink": "https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.213/neoforge-21.1.213-installer.jar", + "author": "neoforged.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/neoforge", + "startCommand": ".\\run.bat", + "stopCommand": "stop", + "updateCommand": "java -jar neoforge-21.1.213-installer.jar --installServer", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 Fabric Quick Server Setup, Mod Support", + "title": "[FabricMC] Minecraft 1.21.11", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", + "author": "fabricmc.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.11 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.10 Fabric Quick Server Setup, Mod Support", + "title": "[FabricMC] Minecraft 1.21.10", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", + "author": "fabricmc.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.10 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.8 Fabric Quick Server Setup, Mod Support", + "title": "[FabricMC] Minecraft 1.21.8", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", + "author": "fabricmc.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.8 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.4 Fabric Quick Server Setup, Mod Support", + "title": "[FabricMC] Minecraft 1.21.4", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", + "author": "fabricmc.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.4 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Minecraft 1.21.1 Fabric Quick Server Setup, Mod Support", + "title": "[FabricMC] Minecraft 1.21.1", + "category": "mc-fabric", + "runtime": "Java 21+", + "hardware": "RAM 8G+", + "size": "5MB", + "remark": "Minecraft Fabric", + "targetLink": "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.1.0/fabric-installer-1.1.0.jar", + "author": "fabricmc.net", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/fabric", + "startCommand": "java -Xms4096M -Xmx4096M -jar fabric-server-launch.jar nogui", + "stopCommand": "stop", + "updateCommand": "java -jar fabric-installer-1.1.0.jar server -mcversion 1.21.1 -downloadMinecraft -noprofile", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Standard Vanilla Minecraft 1.21.11 Server Setup (Official) - No Mod/Plugin Support", + "title": "[Vanilla] Minecraft 1.21.11", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/64bb6d763bed0a9f1d632ec347938594144943ed/server.jar", + "author": "Mojang Studios", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Standard Vanilla Minecraft 1.21.10 Server Setup (Official) - No Mod/Plugin Support", + "title": "[Vanilla] Minecraft 1.21.10", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/95495a7f485eedd84ce928cef5e223b757d2f764/server.jar", + "author": "Mojang Studios", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Standard Vanilla Minecraft 1.21.8 Server Setup (Official) - No Mod/Plugin Support", + "title": "[Vanilla] Minecraft 1.21.8", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/6bce4ef400e4efaa63a13d5e6f6b500be969ef81/server.jar", + "author": "Mojang Studios", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "gameType": "Minecraft", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "description": "Standard Vanilla Minecraft 1.21.4 Server Setup (Official) - No Mod/Plugin Support", + "title": "[Vanilla] Minecraft 1.21.4", + "category": "mc-vanilla", + "runtime": "Java 21+", + "hardware": "RAM 2G+", + "size": "55MB", + "remark": "Minecraft Java", + "targetLink": "https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar", + "author": "Mojang Studios", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java", + "startCommand": "java -Xms2048M -Xmx2048M -jar server.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.11 Folia Quick Server Setup, Plugin Support", + "title": "[Folia] Minecraft 1.21.11", + "category": "mc-folia", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Minecraft Folia", + "targetLink": "https://fill-data.papermc.io/v1/objects/f4e9c5c374a53d17b6173cac35242c05c12217b656b6cc5dc07354cc37ec4066/folia-1.21.11-11.jar", + "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/folia", + "startCommand": "java -Xms4096M -Xmx4096M -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:G1MaxNewSizePercent=40 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1NewSizePercent=30 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:MaxGCPauseMillis=200 -XX:MaxTenuringThreshold=1 -XX:SurvivorRatio=32 -jar folia-1.21.11-11.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } + }, + { + "platform": "ALL", + "language": "en_us", + "image": "https://mcsmanager.oss-cn-guangzhou.aliyuncs.com/package-images/minecraft.webp", + "gameType": "Minecraft", + "description": "Minecraft 1.21.8 Folia Quick Server Setup, Plugin Support", + "title": "[Folia] Minecraft 1.21.8", + "category": "mc-folia", + "runtime": "Java 21+", + "hardware": "RAM 4G+", + "size": "50MB", + "remark": "Minecraft Folia", + "targetLink": "https://fill-data.papermc.io/v1/objects/233843cfd5001b6f658fcab549178d694cc37f0277d004ea295de0a94c57278f/folia-1.21.8-6.jar", + "author": "papermc.io", + "dockerOptional": { + "image": "eclipse-temurin:21-jdk", + "updateCommandImage": "eclipse-temurin:21-jdk" + }, + "setupInfo": { + "type": "minecraft/java/folia", + "startCommand": "java -Xms4096M -Xmx4096M -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:G1MaxNewSizePercent=40 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1NewSizePercent=30 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:MaxGCPauseMillis=200 -XX:MaxTenuringThreshold=1 -XX:SurvivorRatio=32 -jar folia-1.21.8-6.jar nogui", + "stopCommand": "stop", + "updateCommand": "", + "ie": "utf-8", + "oe": "utf-8" + } } ] -} \ No newline at end of file +} From 68d98bb33c13f90bbe90127edc284c151b4c2919 Mon Sep 17 00:00:00 2001 From: KatyushaScarlet Date: Sat, 14 Mar 2026 19:57:46 +0800 Subject: [PATCH 461/463] feat: add loong64 support --- setup.sh | 8 ++++++++ setup_cn.sh | 8 ++++++++ setup_cn_test.sh | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/setup.sh b/setup.sh index 60897e2..d75b71c 100644 --- a/setup.sh +++ b/setup.sh @@ -31,6 +31,9 @@ node_version_centos7="v16.20.2" # Node download base URL - primary node_download_url_base="https://nodejs.org/dist/" +# Unoffical build of Node.js, for more ISA support +node_unoffical_build_url="https://unofficial-builds.nodejs.org/download/release/" + # Node download URL - fallback. # This is the URL points directly to the file, not the base. This can also be a local absolute path. # Only supports https:// or http:// for web locations. @@ -668,6 +671,11 @@ resolve_node_arch() { armv7l) node_arch="armv7l" ;; + loongarch64) + node_arch="loong64" + # Use unoffical build + node_download_url_base=$node_unoffical_build_url + ;; *) cprint red bold "Unsupported architecture for Node.js: $arch" return 1 diff --git a/setup_cn.sh b/setup_cn.sh index e47d0e0..7450d9b 100644 --- a/setup_cn.sh +++ b/setup_cn.sh @@ -31,6 +31,9 @@ node_version_centos7="v16.20.2" # Node download base URL - primary node_download_url_base="https://nodejs.org/dist/" +# Unoffical build of Node.js, for more ISA support +node_unoffical_build_url="https://unofficial-builds.nodejs.org/download/release/" + # Node download URL - fallback. # This is the URL points directly to the file, not the base. This can also be a local absolute path. # Only supports https:// or http:// for web locations. @@ -665,6 +668,11 @@ resolve_node_arch() { armv7l) node_arch="armv7l" ;; + loongarch64) + node_arch="loong64" + # Use unoffical build + node_download_url_base=$node_unoffical_build_url + ;; *) cprint red bold "Node.js不支持的架构: $arch" return 1 diff --git a/setup_cn_test.sh b/setup_cn_test.sh index 276e760..ffbf7f0 100644 --- a/setup_cn_test.sh +++ b/setup_cn_test.sh @@ -30,6 +30,9 @@ node_version="v20.12.2" # Node download base URL - primary node_download_url_base="https://nodejs.org/dist/" +# Unoffical build of Node.js, for more ISA support +node_unoffical_build_url="https://unofficial-builds.nodejs.org/download/release/" + # Node download URL - fallback. # This is the URL points directly to the file, not the base. This can also be a local absolute path. # Only supports https:// or http:// for web locations. @@ -654,6 +657,11 @@ resolve_node_arch() { armv7l) node_arch="armv7l" ;; + loongarch64) + node_arch="loong64" + # Use unoffical build + node_download_url_base=$node_unoffical_build_url + ;; *) cprint red bold "Node.js不支持的架构: $arch" return 1 From dec69590ef40c5f2fe355ffe35483d100878a4ee Mon Sep 17 00:00:00 2001 From: xkmxz Date: Tue, 17 Mar 2026 17:57:30 +0800 Subject: [PATCH 462/463] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=B9=B8=E7=A6=8F?= =?UTF-8?q?=E5=B7=A5=E5=8E=82=E7=AB=AF=E5=8F=A3=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- market-v2.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market-v2.json b/market-v2.json index 10900d1..23c5448 100644 --- a/market-v2.json +++ b/market-v2.json @@ -343,8 +343,8 @@ "updateCommandImage": "githubyumao/steam-game-runtime:latest", "ports": [ "{mcsm_port1}:7777/udp", - "{mcsm_port2}:15000/udp", - "{mcsm_port3}:15777/udp" + "{mcsm_port2}:7777/udp", + "{mcsm_port3}:8888/udp" ], "changeWorkdir": true, "workingDir": "/data", From fac962c0afcdf9b44481e197ce142e671f9e3d87 Mon Sep 17 00:00:00 2001 From: xkmxz Date: Wed, 18 Mar 2026 10:55:04 +0800 Subject: [PATCH 463/463] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=B9=B8=E7=A6=8F?= =?UTF-8?q?=E5=B7=A5=E5=8E=82=E7=AB=AF=E5=8F=A3=E8=AE=BE=E7=BD=AE-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- market-v2.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/market-v2.json b/market-v2.json index 23c5448..33c22a6 100644 --- a/market-v2.json +++ b/market-v2.json @@ -342,9 +342,9 @@ "image": "githubyumao/steam-game-runtime:latest", "updateCommandImage": "githubyumao/steam-game-runtime:latest", "ports": [ - "{mcsm_port1}:7777/udp", + "{mcsm_port1}:7777/tcp", "{mcsm_port2}:7777/udp", - "{mcsm_port3}:8888/udp" + "{mcsm_port3}:8888/tcp" ], "changeWorkdir": true, "workingDir": "/data",