mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-24 16:40:07 +00:00
🔖 Update to v1.2.10
This commit is contained in:
parent
10af236f01
commit
9de5f56cf1
28
Dockerfile
28
Dockerfile
@ -1,16 +1,12 @@
|
|||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
ARG S6_VERSION=v2.2.0.3
|
|
||||||
ARG S6_ARCH=amd64
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
|
||||||
ARG USER_NAME=pagermaid
|
|
||||||
ARG WORK_DIR=/pagermaid/workdir
|
|
||||||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
|
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
|
||||||
SHELL=/bin/bash \
|
|
||||||
LANG=zh_CN.UTF-8 \
|
LANG=zh_CN.UTF-8 \
|
||||||
|
SHELL=/bin/bash \
|
||||||
PS1="\u@\h:\w \$ " \
|
PS1="\u@\h:\w \$ " \
|
||||||
RUN_AS_ROOT=true
|
PAGERMAID_DIR=/pagermaid \
|
||||||
|
DEBIAN_FRONTEND=noninteractive
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
WORKDIR $WORK_DIR
|
WORKDIR /pagermaid/workdir
|
||||||
RUN source ~/.bashrc \
|
RUN source ~/.bashrc \
|
||||||
## 安装运行环境依赖,自编译建议修改为国内镜像源
|
## 安装运行环境依赖,自编译建议修改为国内镜像源
|
||||||
# && sed -i 's/archive.ubuntu.com/mirrors.bfsu.edu.cn/g' /etc/apt/sources.list \
|
# && sed -i 's/archive.ubuntu.com/mirrors.bfsu.edu.cn/g' /etc/apt/sources.list \
|
||||||
@ -38,10 +34,6 @@ RUN source ~/.bashrc \
|
|||||||
libmagic1 \
|
libmagic1 \
|
||||||
libzbar0 \
|
libzbar0 \
|
||||||
iputils-ping \
|
iputils-ping \
|
||||||
## 安装s6
|
|
||||||
&& curl -L -o /tmp/s6-overlay-installer https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-${S6_ARCH}-installer \
|
|
||||||
&& chmod +x /tmp/s6-overlay-installer \
|
|
||||||
&& /tmp/s6-overlay-installer / \
|
|
||||||
## 安装编译依赖
|
## 安装编译依赖
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get install --no-install-recommends -y \
|
&& apt-get install --no-install-recommends -y \
|
||||||
@ -78,14 +70,12 @@ RUN source ~/.bashrc \
|
|||||||
# && pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
|
# && pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
|
||||||
&& python -m pip install --upgrade pip \
|
&& python -m pip install --upgrade pip \
|
||||||
## 添加用户
|
## 添加用户
|
||||||
&& useradd $USER_NAME -u 917 -U -r -m -d /$USER_NAME -s /bin/bash \
|
&& echo "pagermaid ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/pagermaid \
|
||||||
&& usermod -aG sudo,users $USER_NAME \
|
&& useradd pagermaid -r -m -d /pagermaid -s /bin/bash \
|
||||||
&& echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USER_NAME \
|
&& usermod -aG sudo,users pagermaid \
|
||||||
## 克隆仓库
|
## 克隆仓库
|
||||||
&& git clone -b master https://github.com/TeamPGM/PagerMaid-Pyro.git $WORK_DIR \
|
&& git clone -b master https://github.com/TeamPGM/PagerMaid-Pyro.git /pagermaid/workdir \
|
||||||
&& git config --global pull.ff only \
|
&& git config --global pull.ff only \
|
||||||
## 复制s6启动脚本
|
|
||||||
&& cp -r s6/* / \
|
|
||||||
## pip install
|
## pip install
|
||||||
&& pip install -r requirements.txt \
|
&& pip install -r requirements.txt \
|
||||||
## 卸载编译依赖,清理安装缓存
|
## 卸载编译依赖,清理安装缓存
|
||||||
@ -120,4 +110,4 @@ RUN source ~/.bashrc \
|
|||||||
/var/lib/apt/lists/* \
|
/var/lib/apt/lists/* \
|
||||||
/var/tmp/* \
|
/var/tmp/* \
|
||||||
~/.cache
|
~/.cache
|
||||||
ENTRYPOINT ["/init"]
|
ENTRYPOINT ["sh","utils/docker-config.sh"]
|
||||||
|
@ -13,7 +13,7 @@ from pagermaid.scheduler import scheduler
|
|||||||
import pyromod.listen
|
import pyromod.listen
|
||||||
from pyrogram import Client
|
from pyrogram import Client
|
||||||
|
|
||||||
pgm_version = "1.2.9"
|
pgm_version = "1.2.10"
|
||||||
CMD_LIST = {}
|
CMD_LIST = {}
|
||||||
module_dir = __path__[0]
|
module_dir = __path__[0]
|
||||||
working_dir = getcwd()
|
working_dir = getcwd()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
pyrogram==2.0.44
|
pyrogram==2.0.50
|
||||||
TgCrypto>=1.2.3
|
TgCrypto>=1.2.3
|
||||||
Pillow>=8.4.0
|
Pillow>=8.4.0
|
||||||
pytz>=2021.3
|
pytz>=2021.3
|
||||||
@ -11,4 +11,4 @@ sqlitedict
|
|||||||
casbin==1.17.1
|
casbin==1.17.1
|
||||||
mixpanel==4.10.0
|
mixpanel==4.10.0
|
||||||
mixpanel-py-async
|
mixpanel-py-async
|
||||||
sentry-sdk==1.9.7
|
sentry-sdk==1.9.8
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
|
||||||
|
|
||||||
if [[ $RUN_AS_ROOT != true ]]; then
|
|
||||||
PUID=${PUID:-917}
|
|
||||||
PGID=${PGID:-917}
|
|
||||||
groupmod -o -g "$PGID" pagermaid
|
|
||||||
usermod -o -u "$PUID" pagermaid
|
|
||||||
fi
|
|
@ -1,11 +0,0 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
|
||||||
|
|
||||||
cd /pagermaid/workdir
|
|
||||||
git remote set-url origin https://github.com/TeamPGM/PagerMaid-Pyro.git
|
|
||||||
git pull
|
|
||||||
|
|
||||||
pip install -r requirements.txt
|
|
||||||
if [ -s requirements2.txt ]; then
|
|
||||||
pip install -r requirements2.txt
|
|
||||||
fi
|
|
||||||
exit 0
|
|
@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
|
||||||
|
|
||||||
if [[ $RUN_AS_ROOT != true ]]; then
|
|
||||||
chown -R pagermaid:pagermaid /pagermaid
|
|
||||||
fi
|
|
@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
|
||||||
|
|
||||||
cd /pagermaid/workdir
|
|
||||||
if [[ $RUN_AS_ROOT != true ]]; then
|
|
||||||
exec s6-setuidgid pagermaid python -m pagermaid
|
|
||||||
else
|
|
||||||
exec s6-setuidgid root python -m pagermaid
|
|
||||||
fi
|
|
||||||
|
|
@ -44,28 +44,6 @@ configure () {
|
|||||||
else
|
else
|
||||||
sed -i "s/zh-CN/$application_tts/" $config_file
|
sed -i "s/zh-CN/$application_tts/" $config_file
|
||||||
fi
|
fi
|
||||||
printf "启用日志记录? [Y/n]"
|
|
||||||
read -r logging_confirmation <&1
|
|
||||||
case $logging_confirmation in
|
|
||||||
[yY][eE][sS] | [yY])
|
|
||||||
printf "请输入您的日志记录群组/频道的 ChatID (如果要发送给 原 PagerMaid 作者 ,请按Enter):"
|
|
||||||
read -r log_chatid <&1
|
|
||||||
if [ -z "$log_chatid" ]
|
|
||||||
then
|
|
||||||
echo "LOG 将发送到 原 PagerMaid 作者."
|
|
||||||
else
|
|
||||||
sed -i "s/503691334/$log_chatid/" $config_file
|
|
||||||
fi
|
|
||||||
sed -i "s/log: False/log: True/" $config_file
|
|
||||||
;;
|
|
||||||
[nN][oO] | [nN])
|
|
||||||
echo "安装过程继续 . . ."
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "输入错误 . . ."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
login () {
|
login () {
|
||||||
@ -87,8 +65,10 @@ main () {
|
|||||||
login
|
login
|
||||||
else
|
else
|
||||||
if [ ! -f "/pagermaid/workdir/pagermaid.session" ]; then
|
if [ ! -f "/pagermaid/workdir/pagermaid.session" ]; then
|
||||||
login
|
welcome
|
||||||
|
configure
|
||||||
fi
|
fi
|
||||||
|
login
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +64,10 @@ start_docker () {
|
|||||||
sleep 3
|
sleep 3
|
||||||
docker exec -it $container_name bash utils/docker-config.sh
|
docker exec -it $container_name bash utils/docker-config.sh
|
||||||
echo
|
echo
|
||||||
|
echo "Docker 重启中,如果失败,请手动重启容器。"
|
||||||
|
echo
|
||||||
|
docker restart $container_name
|
||||||
|
echo
|
||||||
echo "Docker 创建完毕。"
|
echo "Docker 创建完毕。"
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
@ -203,7 +207,7 @@ shon_online () {
|
|||||||
echo " 7) 将 PagerMaid 数据持久化"
|
echo " 7) 将 PagerMaid 数据持久化"
|
||||||
echo " 8) 退出脚本"
|
echo " 8) 退出脚本"
|
||||||
echo
|
echo
|
||||||
echo " Version:1.0.1"
|
echo " Version:2.0.0"
|
||||||
echo
|
echo
|
||||||
echo -n "请输入编号: "
|
echo -n "请输入编号: "
|
||||||
read N
|
read N
|
||||||
|
Loading…
Reference in New Issue
Block a user