Merge pull request #142 from DDS-Derek/main

feat: add PROXY_HOST to update
This commit is contained in:
jxxghp 2023-08-16 19:02:25 +08:00 committed by GitHub
commit 4669303f9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 10 deletions

View File

@ -8,7 +8,6 @@ ENV LANG="C.UTF-8" \
PGID=0 \
UMASK=000 \
MOVIEPILOT_AUTO_UPDATE=true \
MOVIEPILOT_CN_UPDATE=false \
NGINX_PORT=3000 \
CONFIG_DIR="/config" \
API_TOKEN="moviepilot" \

View File

@ -52,7 +52,6 @@ docker pull jxxghp/moviepilot:latest
- **PGID**:运行程序用户的`gid`,默认`0`
- **UMASK**:掩码权限,默认`000`,可以考虑设置为`022`
- **MOVIEPILOT_AUTO_UPDATE**:重启更新,`true`/`false`,默认`true`
- **MOVIEPILOT_CN_UPDATE**:重启更新是否使用国内加速,`true`/`false`,默认`false `
- **NGINX_PORT** WEB服务端口默认`3000`,可自行修改,但不能为`3001`
- **SUPERUSER** 超级管理员用户名,默认`admin`,安装后使用该用户登录后台管理界面
- **SUPERUSER_PASSWORD** 超级管理员初始密码,默认`password`,建议修改为复杂密码

16
update
View File

@ -1,27 +1,27 @@
#!/bin/bash
if [ "${MOVIEPILOT_CN_UPDATE}" = "true" ]; then
GITHUB_URL="https://ghproxy.com/https://github.com"
GITHUBUSERCONTENT_URL="https://ghproxy.com/https://raw.githubusercontent.com"
if [ -n "${PROXY_HOST}" ]; then
CURL_OPTIONS="-sL -x ${PROXY_HOST}"
echo "使用代理更新程序"
else
GITHUB_URL="https://github.com"
GITHUBUSERCONTENT_URL="https://raw.githubusercontent.com"
CURL_OPTIONS="-sL"
echo "不使用代理更新程序"
fi
old_version=$(cat /app/version.py)
if [[ "${old_version}" == *APP_VERSION* ]]; then
current_version=v$(echo ${old_version} | sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
echo "当前版本号:${current_version}"
new_version=$(curl -s "https://api.github.com/repos/jxxghp/MoviePilot/releases/latest" | jq -r .tag_name)
new_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot/releases/latest" | jq -r .tag_name)
if [[ "${new_version}" == *v* ]]; then
release_version=${new_version}
echo "最新版本号:${release_version}"
if [ "${current_version}" != "${release_version}" ]; then
echo "发现新版本,开始更新程序..."
curl -sL "${GITHUB_URL}/jxxghp/MoviePilot/archive/refs/tags/${release_version}.zip" | busybox unzip -d /tmp -
curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot/archive/refs/tags/${release_version}.zip" | busybox unzip -d /tmp -
if [ $? -eq 0 ]; then
echo "后端下载成功"
curl -sL "${GITHUB_URL}/jxxghp/MoviePilot-Frontend/releases/download/${release_version}/dist.zip" | busybox unzip -d /tmp -
curl ${CURL_OPTIONS} "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${release_version}/dist.zip" | busybox unzip -d /tmp -
if [ $? -eq 0 ]; then
echo "前端下载成功"
rm -rf /app