Update xiaoya-all.sh
This commit is contained in:
parent
f19b0eae67
commit
bad71f9cd0
|
@ -12,67 +12,21 @@ sedsh() {
|
|||
fi
|
||||
}
|
||||
|
||||
# 格式https://xxx.com/
|
||||
GH_PROXY="${GH_PROXY:=}"
|
||||
|
||||
# 格式xxx.com
|
||||
IMAGE_PROXY="${IMAGE_PROXY:=}"
|
||||
|
||||
# 服务镜像
|
||||
IMAGE_TAG="${VERSION:-latest}"
|
||||
# 服务下载地址
|
||||
DOWNLOAD_URL="${GH_PROXY}https://raw.githubusercontent.com/monlor/docker-xiaoya/${VERSION:-main}"
|
||||
|
||||
|
||||
# 欢迎信息
|
||||
echo "欢迎使用xiaoya服务部署脚本"
|
||||
echo "项目地址:https://github.com/monlor/docker-xiaoya"
|
||||
echo "作者:monlor (https://link.monlor.com)"
|
||||
echo "原作者:monlor (https://link.monlor.com)"
|
||||
echo
|
||||
|
||||
# 检查docker服务是否存在,不存在则询问用户是否安装,不安装退出脚本
|
||||
if ! command -v docker &> /dev/null; then
|
||||
if [ "$(uname -o)" = "Darwin" ]; then
|
||||
echo "Docker 未安装,请安装docker后再运行脚本,推荐OrbStack:https://orbstack.dev/"
|
||||
exit 1
|
||||
fi
|
||||
read -rp "Docker 未安装,是否安装?(y/n): " install
|
||||
if [ "$install" = "y" ]; then
|
||||
echo "安装docker..."
|
||||
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
|
||||
systemctl enable docker
|
||||
systemctl start docker
|
||||
else
|
||||
echo "退出安装"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
DOCKER_COMPOSE="docker compose"
|
||||
|
||||
# 检查是否安装了compose插件,docker compose 命令
|
||||
if ! docker compose &> /dev/null && ! which docker-compose &> /dev/null; then
|
||||
read -rp "Docker Compose 未安装,是否安装?(y/n): " install
|
||||
if [ "$install" = "y" ]; then
|
||||
echo "安装docker compose..."
|
||||
# 判断系统是x86还是arm,arm有很多种类,都要判断
|
||||
if [ "$(uname -m)" = "aarch64" ]; then
|
||||
file=docker-compose-linux-aarch64
|
||||
elif [ "$(uname -m)" = "x86_64" ]; then
|
||||
file=docker-compose-linux-x86_64
|
||||
else
|
||||
echo "不支持的系统架构$(uname -m), 请自行安装docker compose(https://docs.docker.com/compose/install/linux/#install-using-the-repository)"
|
||||
exit 1
|
||||
fi
|
||||
curl -SL "${GH_PROXY}https://github.com/docker/compose/releases/download/v2.27.1/$file" -o /usr/local/bin/docker-compose
|
||||
chmod +x /usr/local/bin/docker-compose
|
||||
else
|
||||
echo "退出安装"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! docker compose &> /dev/null; then
|
||||
DOCKER_COMPOSE="docker-compose"
|
||||
fi
|
||||
|
||||
# 让用户输入服务部署目录,默认/opt/xiaoya
|
||||
read -rp "请输入服务部署目录(默认/opt/xiaoya): " install_path
|
||||
|
@ -134,21 +88,17 @@ fi
|
|||
echo
|
||||
echo "部署类型:"
|
||||
echo "1. alist + emby (默认)"
|
||||
echo "2. alist"
|
||||
echo "3. alist + jellyfin"
|
||||
echo "4. alist + emby + jellyfin"
|
||||
echo "2. alist + jellyfin"
|
||||
echo "3. alist + emby + jellyfin"
|
||||
read -rp "请选择部署服务类型: " service_type
|
||||
case $service_type in
|
||||
1)
|
||||
service_type=""
|
||||
;;
|
||||
2)
|
||||
service_type="-alist"
|
||||
;;
|
||||
3)
|
||||
service_type="-jellyfin"
|
||||
;;
|
||||
4)
|
||||
3)
|
||||
service_type="-all"
|
||||
;;
|
||||
*)
|
||||
|
@ -165,7 +115,7 @@ fi
|
|||
cd "$install_path"
|
||||
|
||||
echo "开始生成配置文件docker-compose${service_type}.yml..."
|
||||
curl -#Lo "$install_path/docker-compose.yml" "${DOWNLOAD_URL}/docker-compose${service_type}.yml"
|
||||
curl -#Lo "$install_path/docker-compose.yml" "https://cafe.cpolar.cn/wkdaily/zero3/raw/branch/main/xiaoya/docker-compose${service_type}.yml"
|
||||
if [ ! -f "$install_path/env" ]; then
|
||||
curl -#Lo "$install_path/env" "${DOWNLOAD_URL}/env"
|
||||
fi
|
||||
|
@ -181,6 +131,7 @@ fi
|
|||
sedsh "s#:latest#:$IMAGE_TAG#g" docker-compose.yml
|
||||
|
||||
echo "开始部署服务..."
|
||||
DOCKER_COMPOSE="docker compose"
|
||||
$DOCKER_COMPOSE -f docker-compose.yml up --remove-orphans --pull=always -d
|
||||
|
||||
echo "服务开始部署,如果部署emby/jellyfin,下载并解压60G元数据需要一段时间,请耐心等待..."
|
||||
|
@ -212,11 +163,11 @@ fi
|
|||
|
||||
echo
|
||||
echo "> 服务正在部署,请查看日志等待部署成功后,尝试访问下面的地址"
|
||||
echo "alist:https://api.linkopenai.com/topup地址: http://$local_ip:5678, http://$ip:5678"
|
||||
echo "webdav: http://$local_ip:5678/dav, http://$ip:5678/dav, 默认用户密码: guest/guest_Api789"
|
||||
echo "tvbox: http://$local_ip:5678/tvbox/my_ext.json, http://$ip:5678/tvbox/my_ext.json"
|
||||
echo "emby: http://$local_ip:6908, http://$ip:6908, 默认用户密码: xiaoya/1234"
|
||||
echo "jellyfin: http://$local_ip:8096, http://$ip:8096,默认用户密码:ailg/5678"
|
||||
echo "alist:https://api.linkopenai.com/topup地址: http://$local_ip:5678"
|
||||
echo "webdav: http://$local_ip:5678/dav, 默认用户密码: guest/guest_Api789"
|
||||
echo "tvbox: http://$local_ip:5678/tvbox/my_ext.json"
|
||||
echo "emby: http://$local_ip:6908, 默认用户密码: xiaoya/1234"
|
||||
echo "jellyfin: http://$local_ip:8096,默认用户密码:ailg/5678"
|
||||
|
||||
echo
|
||||
echo "还没有部署完,执行这个命令查看日志:$install_path/manage.sh logs"
|
||||
|
|
Loading…
Reference in New Issue