ci: update Node.js requirement and improve code consistency

Updated the README to require Node.js 18+ and added Docker usage instructions. Refactored util/client-sign.js for consistent code style and improved variable naming. Fixed the login_cellphone module to use 'weapi' in createOption. Removed deprecated code from server.js and improved CORS header formatting. Minor fix in util/request.js for user agent selection.

Co-Authored-By: binaryify <[email protected]>
This commit is contained in:
MoeFurina
2026-01-16 22:35:16 +08:00
co-authored by binaryify
parent 5fc9346e0e
commit 805d0bccc5
6 changed files with 213 additions and 180 deletions
+40 -1
View File
@@ -22,7 +22,7 @@
## 环境要求
需要 NodeJS 14+ 环境
需要 NodeJS 18+ 环境
## 安装
@@ -70,6 +70,45 @@ npx NeteaseCloudMusicApi@latest
使用此命令,可直接启动服务,无需下载或者 clone 项目
## Docker 容器运行
> 注意: 在 docker 中运行的时候, 由于使用了 request 来发请求, 所以会检查几个 proxy 相关的环境变量(如下所列), 这些环境变量 会影响到 request 的代理, 详情请参考[request 的文档](https://github.com/request/request#proxies), 如果这些环境变量 指向的代理不可用, 那么就会造成错误, 所以在使用 docker 的时候一定要注意这些环境变量. 不过, 要是你在 query 中加上了 proxy 参数, 那么环境变量会被覆盖, 就会用你通过 proxy 参数提供的代理了.
request 相关的环境变量
1. http_proxy
2. https_proxy
3. HTTP_PROXY
4. HTTPS_PROXY
5. no_proxy
6. NO_PROXY
```shell
docker pull binaryify/netease_cloud_music_api
docker run -d -p 3000:3000 --name netease_cloud_music_api binaryify/netease_cloud_music_api
// 或者
docker run -d -p 3000:3000 binaryify/netease_cloud_music_api
// 去掉或者设置相关的环境变量
docker run -d -p 3000:3000 --name netease_cloud_music_api -e http_proxy= -e https_proxy= -e no_proxy= -e HTTP_PROXY= -e HTTPS_PROXY= -e NO_PROXY= binaryify/netease_cloud_music_api
// 或者
docker run -d -p 3000:3000 -e http_proxy= -e https_proxy= -e no_proxy= -e HTTP_PROXY= -e HTTPS_PROXY= -e NO_PROXY= binaryify/netease_cloud_music_api
```
> 以下是自行 build docker 镜像方式
```
$ git clone https://gitlab.com/Binaryify/neteasecloudmusicapi.git && cd NeteaseCloudMusicApi
$ sudo docker build . -t netease-music-api
$ sudo docker run -d -p 3000:3000 netease-music-api
## Vercel 部署
v4.0.8 加入了 Vercel 配置文件,可以直接在 Vercel 下部署了,不需要自己的服务器