Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
9744032f93
14
Dockerfile
14
Dockerfile
@ -11,8 +11,7 @@ ENV LANG="C.UTF-8" \
|
|||||||
PORT=3001 \
|
PORT=3001 \
|
||||||
NGINX_PORT=3000 \
|
NGINX_PORT=3000 \
|
||||||
PROXY_HOST="" \
|
PROXY_HOST="" \
|
||||||
MOVIEPILOT_AUTO_UPDATE=true \
|
MOVIEPILOT_AUTO_UPDATE=release \
|
||||||
MOVIEPILOT_AUTO_UPDATE_DEV=false \
|
|
||||||
AUTH_SITE="iyuu" \
|
AUTH_SITE="iyuu" \
|
||||||
IYUU_SIGN=""
|
IYUU_SIGN=""
|
||||||
WORKDIR "/app"
|
WORKDIR "/app"
|
||||||
@ -78,12 +77,11 @@ RUN cp -f /app/nginx.conf /etc/nginx/nginx.template.conf \
|
|||||||
&& FRONTEND_VERSION=$(curl -sL "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name) \
|
&& FRONTEND_VERSION=$(curl -sL "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" | jq -r .tag_name) \
|
||||||
&& curl -sL "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${FRONTEND_VERSION}/dist.zip" | busybox unzip -d / - \
|
&& curl -sL "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${FRONTEND_VERSION}/dist.zip" | busybox unzip -d / - \
|
||||||
&& mv /dist /public \
|
&& mv /dist /public \
|
||||||
&& curl -sL "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" | busybox unzip -d / - \
|
&& curl -sL "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" | busybox unzip -d /tmp - \
|
||||||
&& mv -f /MoviePilot-Plugins-main/plugins/* /app/app/plugins/ \
|
&& mv -f /tmp/MoviePilot-Plugins-main/plugins/* /app/app/plugins/ \
|
||||||
&& rm -rf /MoviePilot-Plugins-main \
|
&& curl -sL "https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip" | busybox unzip -d /tmp - \
|
||||||
&& curl -sL "https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip" | busybox unzip -d / - \
|
&& mv -f /tmp/MoviePilot-Resources-main/resources/* /app/app/helper/ \
|
||||||
&& mv -f /MoviePilot-Resources-main/resources/* /app/app/helper/ \
|
&& rm -rf /tmp/*
|
||||||
&& rm -rf /MoviePilot-Resources-main
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
VOLUME [ "/config" ]
|
VOLUME [ "/config" ]
|
||||||
ENTRYPOINT [ "/entrypoint" ]
|
ENTRYPOINT [ "/entrypoint" ]
|
||||||
|
@ -70,8 +70,7 @@ MoviePilot需要配套下载器和媒体服务器配合使用。
|
|||||||
- **PGID**:运行程序用户的`gid`,默认`0`(仅支持环境变量配置)
|
- **PGID**:运行程序用户的`gid`,默认`0`(仅支持环境变量配置)
|
||||||
- **UMASK**:掩码权限,默认`000`,可以考虑设置为`022`(仅支持环境变量配置)
|
- **UMASK**:掩码权限,默认`000`,可以考虑设置为`022`(仅支持环境变量配置)
|
||||||
- **PROXY_HOST:** 网络代理,访问themoviedb或者重启更新需要使用代理访问,格式为`http(s)://ip:port`、`socks5://user:pass@host:port`(仅支持环境变量配置)
|
- **PROXY_HOST:** 网络代理,访问themoviedb或者重启更新需要使用代理访问,格式为`http(s)://ip:port`、`socks5://user:pass@host:port`(仅支持环境变量配置)
|
||||||
- **MOVIEPILOT_AUTO_UPDATE**:重启更新,`true`/`false`,默认`true` **注意:如果出现网络问题可以配置`PROXY_HOST`**(仅支持环境变量配置)
|
- **MOVIEPILOT_AUTO_UPDATE**:重启更新,`true`/`release`/`dev`/`false`,默认`release` **注意:如果出现网络问题可以配置`PROXY_HOST`**(仅支持环境变量配置)
|
||||||
- **MOVIEPILOT_AUTO_UPDATE_DEV**:重启时更新到未发布的开发版本代码,`true`/`false`,默认`false`(仅支持环境变量配置)
|
|
||||||
---
|
---
|
||||||
- **❗SUPERUSER:** 超级管理员用户名,默认`admin`,安装后使用该用户登录后台管理界面
|
- **❗SUPERUSER:** 超级管理员用户名,默认`admin`,安装后使用该用户登录后台管理界面
|
||||||
- **❗SUPERUSER_PASSWORD:** 超级管理员初始密码,默认`password`,建议修改为复杂密码
|
- **❗SUPERUSER_PASSWORD:** 超级管理员初始密码,默认`password`,建议修改为复杂密码
|
||||||
|
@ -372,6 +372,7 @@ class ChainBase(metaclass=ABCMeta):
|
|||||||
self.eventmanager.send_event(etype=EventType.NoticeMessage,
|
self.eventmanager.send_event(etype=EventType.NoticeMessage,
|
||||||
data={
|
data={
|
||||||
"channel": message.channel,
|
"channel": message.channel,
|
||||||
|
"type": message.mtype,
|
||||||
"title": message.title,
|
"title": message.title,
|
||||||
"text": message.text,
|
"text": message.text,
|
||||||
"image": message.image,
|
"image": message.image,
|
||||||
|
@ -229,7 +229,12 @@ class PluginManager(metaclass=Singleton):
|
|||||||
conf.update({"has_update": True})
|
conf.update({"has_update": True})
|
||||||
# 运行状态
|
# 运行状态
|
||||||
if plugin_obj and hasattr(plugin_obj, "get_state"):
|
if plugin_obj and hasattr(plugin_obj, "get_state"):
|
||||||
conf.update({"state": plugin_obj.get_state()})
|
try:
|
||||||
|
state = plugin_obj.get_state()
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"获取插件 {pid} 状态出错:{str(e)}")
|
||||||
|
state = False
|
||||||
|
conf.update({"state": state})
|
||||||
else:
|
else:
|
||||||
conf.update({"state": False})
|
conf.update({"state": False})
|
||||||
# 是否有详情页面
|
# 是否有详情页面
|
||||||
@ -293,7 +298,12 @@ class PluginManager(metaclass=Singleton):
|
|||||||
conf.update({"installed": False})
|
conf.update({"installed": False})
|
||||||
# 运行状态
|
# 运行状态
|
||||||
if plugin_obj and hasattr(plugin_obj, "get_state"):
|
if plugin_obj and hasattr(plugin_obj, "get_state"):
|
||||||
conf.update({"state": plugin_obj.get_state()})
|
try:
|
||||||
|
state = plugin_obj.get_state()
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"获取插件 {pid} 状态出错:{str(e)}")
|
||||||
|
state = False
|
||||||
|
conf.update({"state": state})
|
||||||
else:
|
else:
|
||||||
conf.update({"state": False})
|
conf.update({"state": False})
|
||||||
# 是否有详情页面
|
# 是否有详情页面
|
||||||
|
@ -120,4 +120,8 @@ class PluginHelper(metaclass=Singleton):
|
|||||||
shutil.rmtree(plugin_dir, ignore_errors=True)
|
shutil.rmtree(plugin_dir, ignore_errors=True)
|
||||||
# 下载所有文件
|
# 下载所有文件
|
||||||
__download_files(pid.lower(), file_list)
|
__download_files(pid.lower(), file_list)
|
||||||
|
# 插件目录下如有requirements.txt则安装依赖
|
||||||
|
requirements_file = plugin_dir / "requirements.txt"
|
||||||
|
if requirements_file.exists():
|
||||||
|
SystemUtils.execute(f"pip install -r {requirements_file}")
|
||||||
return True, ""
|
return True, ""
|
||||||
|
@ -86,6 +86,7 @@ class _PluginBase(metaclass=ABCMeta):
|
|||||||
def get_form(self) -> Tuple[List[dict], Dict[str, Any]]:
|
def get_form(self) -> Tuple[List[dict], Dict[str, Any]]:
|
||||||
"""
|
"""
|
||||||
拼装插件配置页面,需要返回两块数据:1、页面配置;2、数据结构
|
拼装插件配置页面,需要返回两块数据:1、页面配置;2、数据结构
|
||||||
|
插件配置页面使用Vuetify组件拼装,参考:https://vuetifyjs.com/
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -93,6 +94,7 @@ class _PluginBase(metaclass=ABCMeta):
|
|||||||
def get_page(self) -> List[dict]:
|
def get_page(self) -> List[dict]:
|
||||||
"""
|
"""
|
||||||
拼装插件详情页面,需要返回页面配置,同时附带数据
|
拼装插件详情页面,需要返回页面配置,同时附带数据
|
||||||
|
插件详情页面使用Vuetify组件拼装,参考:https://vuetifyjs.com/
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
10
entrypoint
10
entrypoint
@ -3,13 +3,9 @@
|
|||||||
# 使用 `envsubst` 将模板文件中的 ${NGINX_PORT} 替换为实际的环境变量值
|
# 使用 `envsubst` 将模板文件中的 ${NGINX_PORT} 替换为实际的环境变量值
|
||||||
envsubst '${NGINX_PORT}${PORT}' < /etc/nginx/nginx.template.conf > /etc/nginx/nginx.conf
|
envsubst '${NGINX_PORT}${PORT}' < /etc/nginx/nginx.template.conf > /etc/nginx/nginx.conf
|
||||||
# 自动更新
|
# 自动更新
|
||||||
if [ "${MOVIEPILOT_AUTO_UPDATE}" = "true" ]; then
|
cd /
|
||||||
cd /
|
/usr/local/bin/mp_update
|
||||||
/usr/local/bin/mp_update
|
cd /app
|
||||||
cd /app
|
|
||||||
else
|
|
||||||
echo "程序自动升级已关闭,如需自动升级请在创建容器时设置环境变量:MOVIEPILOT_AUTO_UPDATE=true"
|
|
||||||
fi
|
|
||||||
# 更改 moviepilot userid 和 groupid
|
# 更改 moviepilot userid 和 groupid
|
||||||
groupmod -o -g ${PGID} moviepilot
|
groupmod -o -g ${PGID} moviepilot
|
||||||
usermod -o -u ${PUID} moviepilot
|
usermod -o -u ${PUID} moviepilot
|
||||||
|
@ -54,4 +54,5 @@ parse~=1.19.0
|
|||||||
docker~=6.1.3
|
docker~=6.1.3
|
||||||
cachetools~=5.3.1
|
cachetools~=5.3.1
|
||||||
fast-bencode~=1.1.3
|
fast-bencode~=1.1.3
|
||||||
pystray~=0.19.5
|
pystray~=0.19.5
|
||||||
|
pypushdeer~=0.0.3
|
66
update
66
update
@ -41,7 +41,7 @@ install_backend_and_download_resources() {
|
|||||||
# 清空目录
|
# 清空目录
|
||||||
rm -rf /app
|
rm -rf /app
|
||||||
# 后端程序
|
# 后端程序
|
||||||
mv -f /tmp/App /app
|
mv /tmp/App /app
|
||||||
# 恢复插件目录
|
# 恢复插件目录
|
||||||
mv -f /plugins/* /app/app/plugins/
|
mv -f /plugins/* /app/app/plugins/
|
||||||
# 插件仓库
|
# 插件仓库
|
||||||
@ -74,39 +74,43 @@ install_backend_and_download_resources() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ...
|
if [[ "${MOVIEPILOT_AUTO_UPDATE}" = "true" ]] || [[ "${MOVIEPILOT_AUTO_UPDATE}" = "release" ]] || elif [[ "${MOVIEPILOT_AUTO_UPDATE}" = "dev" ]]; then
|
||||||
|
if [ -n "${PROXY_HOST}" ]; then
|
||||||
if [ -n "${PROXY_HOST}" ]; then
|
CURL_OPTIONS="-sL -x ${PROXY_HOST}"
|
||||||
CURL_OPTIONS="-sL -x ${PROXY_HOST}"
|
PIP_OPTIONS="--proxy=${PROXY_HOST}"
|
||||||
PIP_OPTIONS="--proxy=${PROXY_HOST}"
|
echo "使用代理更新程序"
|
||||||
echo "使用代理更新程序"
|
else
|
||||||
else
|
CURL_OPTIONS="-sL"
|
||||||
CURL_OPTIONS="-sL"
|
echo "不使用代理更新程序"
|
||||||
echo "不使用代理更新程序"
|
fi
|
||||||
fi
|
if [ "${MOVIEPILOT_AUTO_UPDATE}" = "dev" ]; then
|
||||||
|
echo "Dev 更新模式"
|
||||||
if [ "${MOVIEPILOT_AUTO_UPDATE_DEV}" = "true" ]; then
|
install_backend_and_download_resources "heads/main.zip"
|
||||||
echo "Dev 更新模式"
|
else
|
||||||
install_backend_and_download_resources "heads/main.zip"
|
echo "Release 更新模式"
|
||||||
else
|
old_version=$(cat /app/version.py)
|
||||||
old_version=$(cat /app/version.py)
|
if [[ "${old_version}" == *APP_VERSION* ]]; then
|
||||||
if [[ "${old_version}" == *APP_VERSION* ]]; then
|
current_version=v$(echo ${old_version} | sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
|
||||||
current_version=v$(echo ${old_version} | sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
|
echo "当前版本号:${current_version}"
|
||||||
echo "当前版本号:${current_version}"
|
new_version=$(curl ${CURL_OPTIONS} "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
|
||||||
if [[ "${new_version}" == *v* ]]; then
|
release_version=${new_version}
|
||||||
release_version=${new_version}
|
echo "最新版本号:${release_version}"
|
||||||
echo "最新版本号:${release_version}"
|
if [ "${current_version}" != "${release_version}" ]; then
|
||||||
if [ "${current_version}" != "${release_version}" ]; then
|
echo "发现新版本,开始自动升级..."
|
||||||
echo "发现新版本,开始自动升级..."
|
install_backend_and_download_resources "tags/${release_version}.zip"
|
||||||
install_backend_and_download_resources "tags/${release_version}.zip"
|
else
|
||||||
|
echo "未发现新版本,跳过更新步骤..."
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "未发现新版本,跳过更新步骤..."
|
echo "最新版本号获取失败,继续启动..."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "最新版本号获取失败,继续启动..."
|
echo "当前版本号获取失败,继续启动..."
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo "当前版本号获取失败,继续启动..."
|
|
||||||
fi
|
fi
|
||||||
|
elif [[ "${MOVIEPILOT_AUTO_UPDATE}" = "false" ]]; then
|
||||||
|
echo "程序自动升级已关闭,如需自动升级请在创建容器时设置环境变量:MOVIEPILOT_AUTO_UPDATE=release"
|
||||||
|
else
|
||||||
|
echo "MOVIEPILOT_AUTO_UPDATE 变量设置错误"
|
||||||
fi
|
fi
|
Loading…
x
Reference in New Issue
Block a user