Skip to content

Commit

Permalink
feat: 🎸 支持pikpak认证
Browse files Browse the repository at this point in the history
  • Loading branch information
monlor committed May 29, 2024
1 parent 3055397 commit b9887df
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
6 changes: 6 additions & 0 deletions alist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ docker run -d -p 5678:80 -p 2345:2345 -p 2346:2346 --restart=unless-stopped --na

`ALIYUN_FOLDER_ID`: 阿里云小雅文件夹id,转存以下文件到你的云盘,获取文件夹id,共享链接:https://www.aliyundrive.com/s/rP9gP3h9asE

`PIKPAK_LIST`: pikpak 账号列表,格式:`[email protected]:aaadds,+8613111111111:dasf`,密码中不支持符号,:

`FORCE_LOGIN`: 开启登陆功能,true/false

`WEBDAV_PASSWORD`: webdav用户名为dav,设置密码,默认密码:guest_Api789

`AUTO_UPDATE_ENABLED`: 自动更新小雅的文件,true/false

`AUTO_CLEAR_ENABLED`: 自动清理阿里云云盘的文件,true/false
32 changes: 31 additions & 1 deletion alist/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,36 @@ else
echo "${ALIYUN_FOLDER_ID}" > /data/temp_transfer_folder_id.txt
fi

# 设置pikpak用户
if [ -n "${PIKPAK_LIST:-}" ]; then
echo "设置PIKPAK用户密码..."
rm -rf /data/pikpak_list.txt
echo ${PIKPAK_LIST} | tr ',' '\n' | while read line; do
user=$(echo $line | cut -d':' -f1)
pass=$(echo $line | cut -d':' -f2-)
echo "\"${user}\" \"${pass}\"" >> /data/pikpak_list.txt
done
fi

# 开启强制登陆
if [ "${FORCE_LOGIN}" = "true" ]; then
echo "已开启强制登陆..."
if [ ! -f /data/guestlogin.txt ]; then
touch /data/guestlogin.txt
fi
else
echo "已关闭强制登陆..."
rm -rf /data/guestlogin.txt
fi

# 设置webdav密码
if [ -n "${WEBDAV_PASSWORD}" ]; then
echo "设置webdav密码..."
echo "${WEBDAV_PASSWORD}" > /data/guestpass.txt
else
rm -rf /data/guestpass.txt
fi

crond

crontabs=""
Expand All @@ -49,7 +79,7 @@ fi

if [ "${AUTO_CLEAR_ENABLED:=true}" = "true" ]; then
echo "启动定时清理定时任务..."
crontabs="${crontabs}\n*/${AUTO_CLEAR_INTERVAL:=10} * * * * /clear.sh"
crontabs="${crontabs}\n*/${AUTO_CLEAR_INTERVAL:=180} * * * * /clear.sh"
fi

echo -e "$crontabs" | crontab -
Expand Down

0 comments on commit b9887df

Please sign in to comment.