👷 更新部署文档

This commit is contained in:
chaos-zhu 2024-07-29 15:00:10 +08:00
parent 43f477a0cc
commit 79ebd30fbc
2 changed files with 12 additions and 92 deletions

View File

@ -43,18 +43,21 @@ docker run -d --net=host --name=easynode-server -v $PWD/easynode/db:/easynode/se
```
访问http://yourip:8082
#### 一键脚本
#### 手动部署
- **依赖Linux基础命令工具curl wget git zip tar如未安装请先安装**
> ubuntu/debian: `apt install curl wget git zip tar -y`
>
> centos: `yum install curl wget git zip tar -y`
- 运行环境:[Node.js](https://nodejs.org/en/download/) **v20+**
依赖Nodejs版本 > 20+
```shell
wget -qO- --no-check-certificate https://raw.githubusercontent.com/chaos-zhu/easynode/v1.2/easynode-server-install.sh | bash
git clone https://github.com/chaos-zhu/easynode
cd easynode
yarn
cd web
yarn build
mv dist/* ../server/app/static
cd ../server
yarn start
# 后台运行需安装pm2
pm2 start index.js --name easynode-server
```
访问http://yourip:8082

View File

@ -1,83 +0,0 @@
#!/bin/bash
if [ "$(id -u)" != "0" ] ; then
echo "***********************请切换到root再尝试执行***********************"
exit 1
fi
echo "***********************检测node环境***********************"
node -v
if [ $? != 0 ]
then
echo "未安装node运行环境"
exit 1
fi
echo "已安装"
echo "***********************检测node版本***********************"
NODE_VERSION=$(node -v)
NODE_VERSION=${NODE_VERSION//v}
VERSION_MAJOR=${NODE_VERSION%%.*}
if [ $VERSION_MAJOR -lt 20 ]
then
echo "Node版本低于20,退出安装,推荐使用nvm安装nodejs: https://github.com/nvm-sh/nvm#installing-and-updating"
exit 1
fi
echo "已安装nodejs - $NODE_VERSION"
echo "***********************检测pm2守护进程***********************"
pm2 list
if [ $? != 0 ]
then
echo "未安装pm2,正在安装..."
npm i -g pm2
fi
echo "已安装"
echo "***********************开始下载EasyNode***********************"
DOWNLOAD_FILE_URL="https://mirror.ghproxy.com/https://github.com/chaos-zhu/easynode/releases/download/v2.0.0/easynode-server.zip"
SERVER_NAME=easynode-server
SERVER_ZIP=easynode-server.zip
FILE_PATH=/root
wget -O ${FILE_PATH}/${SERVER_ZIP} --no-check-certificate --no-cache ${DOWNLOAD_FILE_URL}
if [ $? != 0 ]
then
echo "下载EasyNode.zip失败,请检查网络环境或稍后再试"
exit 1
fi
echo "下载成功"
echo '***********************开始解压***********************'
unzip -o -d ${FILE_PATH}/${SERVER_NAME} ${SERVER_ZIP}
if [ $? != 0 ]
then
echo "解压失败, 请确保已安装zip、tar基础工具"
exit 1
fi
echo "解压成功"
cd ${FILE_PATH}/${SERVER_NAME} || exit
# echo '***********************开始安装依赖***********************'
# yarn -v
# if [ $? != 0 ]
# then
# echo "未安装yarn管理工具,正在安装..."
# npm i -g yarn
# fi
# yarn
# if [ $? != 0 ]
# then
# echo "yarn安装失败请检测网络环境. 使用大陆vps请执行以下命令设置镜像源再重新运行该脚本npm config set registry https://registry.npm.taobao.org
# "
# fi
# echo "依赖安装成功"
echo '启动服务'
pm2 start ${FILE_PATH}/${SERVER_NAME}/index.js --name easynode-server
echo '查看日志请输入: pm2 log easynode-server'