├── qinglong ├── npmrc ├── docker-entrypoint.sh ├── Dockerfile └── package.json ├── .gitignore ├── README.md ├── keep_serv00.sh └── LICENSE /qinglong/npmrc: -------------------------------------------------------------------------------- 1 | strict-peer-dependencies=false -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | .DS_Store 4 | 5 | # Log file 6 | *.log 7 | 8 | # BlueJ files 9 | *.ctxt 10 | 11 | # Mobile Tools for Java (J2ME) 12 | .mtj.tmp/ 13 | 14 | # Package Files # 15 | *.jar 16 | *.war 17 | *.nar 18 | *.ear 19 | *.zip 20 | *.tar.gz 21 | *.rar 22 | 23 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 24 | hs_err_pid* 25 | replay_pid* 26 | -------------------------------------------------------------------------------- /qinglong/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dir_shell=/ql/shell 4 | . $dir_shell/share.sh 5 | . $dir_shell/env.sh 6 | 7 | echo -e "======================1. 检测配置文件========================\n" 8 | import_config "$@" 9 | make_dir /etc/nginx/conf.d 10 | make_dir /run/nginx 11 | init_nginx 12 | fix_config 13 | 14 | pm2 l &>/dev/null 15 | 16 | echo -e "======================2. 安装依赖========================\n" 17 | patch_version 18 | 19 | echo -e "======================3. 启动nginx========================\n" 20 | nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf 21 | echo -e "nginx启动成功...\n" 22 | 23 | echo -e "======================4. 启动pm2服务========================\n" 24 | reload_update 25 | reload_pm2 26 | 27 | if [[ $AutoStartBot == true ]]; then 28 | echo -e "======================5. 启动bot========================\n" 29 | nohup ql bot >$dir_log/bot.log 2>&1 & 30 | echo -e "bot后台启动中...\n" 31 | fi 32 | 33 | if [[ $EnableExtraShell == true ]]; then 34 | echo -e "====================6. 执行自定义脚本========================\n" 35 | nohup ql extra >$dir_log/extra.log 2>&1 & 36 | echo -e "自定义脚本后台执行中...\n" 37 | fi 38 | 39 | echo -e "======================7. 写入rclone配置========================\n" 40 | echo "$RCLONE_CONF" > ~/.config/rclone/rclone.conf 41 | 42 | echo -e "############################################################\n" 43 | echo -e "容器启动成功..." 44 | echo -e "############################################################\n" 45 | 46 | 47 | echo -e "##########8. 写入登陆信息 ############" 48 | echo "{ \"username\": \"$USERNAME\", \"password\": \"$PASSWORD\" }" > /ql/data/config/auth.json 49 | 50 | echo -e "##########9. 同步备份信息 ############" 51 | if [ -n "$RCLONE_CONF" ]; then 52 | echo -e "########## Synchronizing Backup ############" 53 | 54 | # Specify the remote folder path in the format remote:path 55 | REMOTE_FOLDER="huggingface:/qinglong" 56 | 57 | # Use rclone ls command to list folder contents, capturing output and errors 58 | OUTPUT=$(rclone ls "$REMOTE_FOLDER" 2>&1) 59 | 60 | # Get the exit status code of the rclone command 61 | EXIT_CODE=$? 62 | 63 | case $EXIT_CODE in 64 | 0) 65 | # rclone command executed successfully, check if the folder is empty 66 | if [ -z "$OUTPUT" ]; then 67 | echo "Initial installation" 68 | #rclone sync /ql/data $REMOTE_FOLDER 69 | else 70 | mkdir -p /ql/.tmp/data 71 | rclone sync "$REMOTE_FOLDER" /ql/.tmp/data && real_time=true ql reload data 72 | fi 73 | ;; 74 | 1) 75 | # Handle other errors, check if it was a directory not found error 76 | if [[ "$OUTPUT" == *"directory not found"* ]]; then 77 | echo "Error: Folder does not exist" 78 | else 79 | echo "Error: $OUTPUT" 80 | fi 81 | ;; 82 | *) 83 | echo "Error: rclone command failed, exit code: $EXIT_CODE" 84 | ;; 85 | esac 86 | else 87 | echo "No Rclone configuration detected" 88 | fi 89 | 90 | 91 | tail -f >/dev/null 92 | 93 | exec "$@" 94 | -------------------------------------------------------------------------------- /qinglong/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20-slim as nodebuilder 2 | 3 | FROM python:3.11-slim-bullseye as builder 4 | ARG QL_MAINTAINER="whyour" 5 | LABEL maintainer="${QL_MAINTAINER}" 6 | ARG QL_URL=https://github.com/${QL_MAINTAINER}/qinglong.git 7 | ARG QL_BRANCH=debian 8 | 9 | ENV QL_DIR=/ql \ 10 | QL_BRANCH=${QL_BRANCH} 11 | 12 | COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/ 13 | COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/ 14 | RUN set -x && \ 15 | ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \ 16 | apt-get update && \ 17 | apt-get install --no-install-recommends -y libatomic1 git && \ 18 | git config --global user.email "qinglong@@users.noreply.github.com" && \ 19 | git config --global user.name "qinglong" && \ 20 | git config --global http.postBuffer 524288000 && \ 21 | git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} 22 | 23 | RUN mkdir /tmp/build 24 | RUN cp ${QL_DIR}/package.json ${QL_DIR}/.npmrc ${QL_DIR}/pnpm-lock.yaml /tmp/build/ 25 | 26 | RUN npm i -g pnpm@8.3.1 && \ 27 | cd /tmp/build && \ 28 | pnpm install --prod 29 | 30 | FROM python:3.11-slim-bullseye 31 | 32 | ARG QL_MAINTAINER="whyour" 33 | LABEL maintainer="${QL_MAINTAINER}" 34 | ARG QL_URL=https://github.com/${QL_MAINTAINER}/qinglong.git 35 | ARG QL_BRANCH=debian 36 | 37 | ENV PNPM_HOME=/root/.local/share/pnpm \ 38 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/share/pnpm:/root/.local/share/pnpm/global/5/node_modules:$PNPM_HOME \ 39 | NODE_PATH=/usr/local/bin:/usr/local/pnpm-global/5/node_modules:/usr/local/lib/node_modules:/root/.local/share/pnpm/global/5/node_modules \ 40 | LANG=C.UTF-8 \ 41 | SHELL=/bin/bash \ 42 | PS1="\u@\h:\w \$ " \ 43 | QL_DIR=/ql \ 44 | QL_BRANCH=${QL_BRANCH} 45 | 46 | COPY --from=nodebuilder /usr/local/bin/node /usr/local/bin/ 47 | COPY --from=nodebuilder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/ 48 | 49 | RUN set -x && \ 50 | ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \ 51 | ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx && \ 52 | apt-get update && \ 53 | apt-get upgrade -y && \ 54 | apt-get install --no-install-recommends -y git \ 55 | curl \ 56 | cron \ 57 | wget \ 58 | tzdata \ 59 | perl \ 60 | openssl \ 61 | openssh-client \ 62 | nginx \ 63 | jq \ 64 | procps \ 65 | netcat \ 66 | sshpass \ 67 | rclone \ 68 | unzip \ 69 | libatomic1 && \ 70 | apt-get clean && \ 71 | ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ 72 | echo "Asia/Shanghai" >/etc/timezone && \ 73 | git config --global user.email "qinglong@@users.noreply.github.com" && \ 74 | git config --global user.name "qinglong" && \ 75 | git config --global http.postBuffer 524288000 && \ 76 | npm install -g pnpm@8.3.1 pm2 ts-node && \ 77 | rm -rf /root/.pnpm-store && \ 78 | rm -rf /root/.local/share/pnpm/store && \ 79 | rm -rf /root/.cache && \ 80 | rm -rf /root/.npm && \ 81 | chmod u+s /usr/sbin/cron && \ 82 | ulimit -c 0 83 | 84 | ARG SOURCE_COMMIT 85 | RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} && \ 86 | cd ${QL_DIR} && \ 87 | cp -f .env.example .env && \ 88 | chmod 777 ${QL_DIR}/shell/*.sh && \ 89 | chmod 777 ${QL_DIR}/docker/*.sh && \ 90 | git clone --depth=1 -b ${QL_BRANCH} https://github.com/${QL_MAINTAINER}/qinglong-static.git /static && \ 91 | mkdir -p ${QL_DIR}/static && \ 92 | cp -rf /static/* ${QL_DIR}/static && \ 93 | rm -rf /static && \ 94 | rm -f ${QL_DIR}/docker/docker-entrypoint.sh 95 | 96 | COPY docker-entrypoint.sh ${QL_DIR}/docker 97 | 98 | RUN mkdir /ql/data && \ 99 | mkdir /ql/data/config && \ 100 | mkdir /ql/data/log && \ 101 | mkdir /ql/data/db && \ 102 | mkdir /ql/data/scripts && \ 103 | mkdir /ql/data/repo && \ 104 | mkdir /ql/data/raw && \ 105 | mkdir /ql/data/deps && \ 106 | chmod -R 777 /ql && \ 107 | chmod -R 777 /var && \ 108 | chmod -R 777 /usr/local && \ 109 | chmod -R 777 /etc/nginx && \ 110 | chmod -R 777 /run && \ 111 | chmod -R 777 /usr && \ 112 | chmod -R 777 /root 113 | 114 | COPY --from=builder /tmp/build/node_modules/. /ql/node_modules/ 115 | 116 | WORKDIR ${QL_DIR} 117 | 118 | 119 | # Set up a new user named "user" with user ID 1000 120 | RUN useradd -m -u 1000 user 121 | 122 | # Switch to the "user" user 123 | USER user 124 | 125 | # Create rclone configuration file 126 | RUN rclone config -h 127 | 128 | HEALTHCHECK --interval=5s --timeout=2s --retries=20 \ 129 | CMD curl -sf --noproxy '*' http://127.0.0.1:5400/api/health || exit 1 130 | 131 | ENTRYPOINT ["./docker/docker-entrypoint.sh"] 132 | 133 | VOLUME /ql/data 134 | 135 | EXPOSE 5700 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [am-serv00-huggingface](https://github.com/amclubs/am-serv00-huggingface) 2 | 通过huggingface部署青龙面板,实现serv00、socks5、vmess节点等在serv00里部署的程序保活 3 | 4 | # 5 | ▶️ **新人[YouTube](https://youtube.com/@am_clubs?sub_confirmation=1)** 需要您的支持,请务必帮我**点赞**、**关注**、**打开小铃铛**,***十分感谢!!!*** ✅ 6 |
🎁请 **follow** 我的[GitHub](https://github.com/amclubs)、给我所有项目一个 **Star** 星星(拜托了)!你的支持是我不断前进的动力! 💖 7 |
✅**解锁更多技能** [加入TG群【am_clubs】](https://t.me/am_clubs)、[YouTube频道【@am_clubs】](https://youtube.com/@am_clubs?sub_confirmation=1)、[【博客(国内)】](https://amclubss.com)、[【博客(国际)】](https://amclubs.blogspot.com) 8 |
✅点击观看教程[CLoudflare免费节点](https://www.youtube.com/playlist?list=PLGVQi7TjHKXbrY0Pk8gm3T7m8MZ-InquF) | [VPS搭建节点](https://www.youtube.com/playlist?list=PLGVQi7TjHKXaVlrHP9Du61CaEThYCQaiY) | [获取免费域名](https://www.youtube.com/playlist?list=PLGVQi7TjHKXZGODTvB8DEervrmHANQ1AR) | [免费VPN](https://www.youtube.com/playlist?list=PLGVQi7TjHKXY7V2JF-ShRSVwGANlZULdk) | [IPTV源](https://www.youtube.com/playlist?list=PLGVQi7TjHKXbkozDYVsDRJhbnNaEOC76w) | [Mac和Win工具](https://www.youtube.com/playlist?list=PLGVQi7TjHKXYBWu65yP8E08HxAu9LbCWm) | [AI分享](https://www.youtube.com/playlist?list=PLGVQi7TjHKXaodkM-mS-2Nwggwc5wRjqY) 9 | 10 | - [点击观看视频教程 ](https://youtu.be/J4lcIwBowmM) 11 | 12 | ## 一、需要准备的前提资料 13 | ### 1、注册**Serv00**账号,建议使用**Gmail**邮箱 14 | - 注册地址:https://serv00.com 15 | [点击观看视频教程] 16 | 17 | ### 2、**SSH**连接工具(可选) 18 | - 加入TG群[AM科技|分享交流群](https://t.me/AM_CLUBS)发送关键字: ssh 19 | 20 | ### 3、注册**huggingface**账号 21 | - 注册地址:https://huggingface.co 22 | 23 | ### 4、注册**onedrive**账号 24 | - 注册地址:[点击进入onedrive官网](https://onedrive.live.com/login) 25 | [点击观看视频教程] 26 | 27 | ## 二、安装青龙面板 28 | 29 | - 1、登录**huggingface** 30 | 31 | - 2、创建**space** 名称如: **qinglong** 32 | 33 | - 3、修改**README.md**文件,增加端口变量**app_port** 34 | ``` 35 | app_port: 5700 36 | ``` 37 | 38 | - 4、在 **settings** 下 **Variables and secrets** 点 **New secret** 增加相关变量 39 | **注意:环境变量是secrets类型,千万不要选错** 40 | 41 | `①` **USERNAME**变量 42 | ``` 43 | admin 44 | ``` 45 | `②` **PASSWORD**变量(自己要设置密码度强一点的) 46 | ``` 47 | 123456 48 | ``` 49 | `③` **RCLONE_CONF**变量 [**点击视频教程获取**](https://youtu.be/ZyGpSRYAr4Q) 50 | 根据上面视频教程获取 51 | ```shell 52 | cat ~/.config/rclone/rclone.conf 53 | ``` 54 | (win系统用不了上面命令,可以使用下面的命令,查看文件路径,然后打开文件) 55 | ```shell 56 | ./rclone config file 57 | ``` 58 | 根据上面命令获取填自己的,下面只是返回信息格式的例子 59 | ``` 60 | [huggingface] 61 | type = onedrive 62 | token = {"access_token":"xxx","token_type":"Bearer","refresh_token":"xxx","expiry":"xxx"} 63 | drive_id = xxx 64 | drive_type = personal 65 | ``` 66 | 67 | - 5、上传部署文件 **docker-entrypoint.sh** 、**Dockerfile** 、**npmrc** 、**package.json** 、**pnpm-lock.yaml** 68 |
[点击下载docker-entrypoint.sh] 69 |
[点击下载Dockerfile] 70 |
[点击下载npmrc] 71 |
[点击下载package.json] 72 |
[点击下载pnpm-lock.yaml] 73 |
项目地址:https://github.com/amclubs/am-serv00-huggingface 74 | 75 | - 6、部署完成后,点击 **settings** 下 **Embed this Space** 找到 **Direct URL** 就是访问地址,如下面 76 | ``` 77 | https://用户名-space名.hf.space 78 | ``` 79 | 80 | 81 | ## 三、青龙保活命令设置 82 | - 1、登录青龙面板后,在 定时任务 -> 创建任务 83 | `①`名称自己定义,如: 84 | ``` 85 | serv00保活 86 | ``` 87 | `②` 创建命令脚本 点击 **脚本管理** -> 右上角点击 **+** 号 创建脚本 -> 选择本地文件 -> 然后上传下载好的**keep_serv00.sh**文件 -> 点 **确认** -> 点 **保存** 88 | [点击下载 keep_serv00.sh] 89 | `③` 命令/脚本 90 | ```shell 91 | bash keep_serv00.sh 92 | ``` 93 | `④` 定时规则(这里第1小时检测一次,可以根据自己情况调整) 94 | ```shell 95 | 0 0 */1 * * 96 | ``` 97 | 98 | - 2、增加手工备份青龙部署文件 **(huggingface有时重启或重置就会重新部署,所以通过备份,重启脚本自动同步数据回来)** 99 | `①`名称自己定义 ,如: 100 | ``` 101 | rclone-onedrive 102 | ``` 103 | `②` 命令/脚本 104 | ```shell 105 | rclone sync /ql/data huggingface:/qinglong 106 | ``` 107 | `③` 定时规则 108 | ```shell 109 | 0 0 1 * * * 110 | ``` 111 | 112 | - 3、增加cloudflare部署uptime监控服务检查huggingface应用 [**点击视频教程**](https://youtu.be/X03S2HxnniM) 113 | 114 |
[**点击观看免费部署socks5视频教程**](https://youtu.be/Bw82BH_ecC4) 115 |
[**点击观看免费部署vmess节点视频教程**](https://youtu.be/6UZXHfc3zEU) 116 |
[**点击观看所有免费节点部署相关视频教程**](https://www.youtube.com/playlist?list=PLGVQi7TjHKXbrY0Pk8gm3T7m8MZ-InquF) 117 | 118 | 119 | # 120 |
121 |
[点击展开] 赞赏支持 ~🧧 122 | *我非常感谢您的赞赏和支持,它们将极大地激励我继续创新,持续产生有价值的工作。* 123 | 124 | - **USDT-TRC20:** `TWTxUyay6QJN3K4fs4kvJTT8Zfa2mWTwDD` 125 | - **TRX-TRC20:** `TWTxUyay6QJN3K4fs4kvJTT8Zfa2mWTwDD` 126 | 127 |
128 |
129 | TRC10/TRC20扫码支付 130 |
131 |
132 |
133 | 134 | # 135 | 免责声明: 136 | - 1、该项目设计和开发仅供学习、研究和安全测试目的。请于下载后 24 小时内删除, 不得用作任何商业用途, 文字、数据及图片均有所属版权, 如转载须注明来源。 137 | - 2、使用本程序必循遵守部署服务器所在地区的法律、所在国家和用户所在国家的法律法规。对任何人或团体使用该项目时产生的任何后果由使用者承担。 138 | - 3、作者不对使用该项目可能引起的任何直接或间接损害负责。作者保留随时更新免责声明的权利,且不另行通知。 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /keep_serv00.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 定义颜色代码 4 | green="\033[32m" 5 | yellow="\033[33m" 6 | red="\033[31m" 7 | purple() { echo -e "\033[35m$1\033[0m"; } 8 | re="\033[0m" 9 | 10 | # 打印欢迎信息 11 | echo "" 12 | purple "=== serv00 | AM科技 一键保活脚本 ===\n" 13 | echo -e "${green}脚本地址:${re}${yellow}https://github.com/amclubs/am-serv00-huggingface${re}\n" 14 | echo -e "${green}个人博客:${re}${yellow}https://am.809098.xyz${re}\n" 15 | echo -e "${green}TG反馈群组:${re}${yellow}https://t.me/AM_CLUBS${re}\n" 16 | purple "=== 转载请著名出处 AM科技,请勿滥用 ===\n" 17 | 18 | base_url="https://raw.githubusercontent.com/amclubs" 19 | 20 | # 配置服务器,格式为:["IP/域名,用户名,密码"]="s5(socket5标识符),端口1;vmess(服务标识符),端口2,Argo隧道域名,Argo隧道token或json;nezha-dashboard(服务标识符),端口3" 21 | declare -A servers=( 22 | ["s8.serv00.com,username1,password1"]="s5,10000" 23 | ["s8.serv00.com,username2,password2"]="s5,20000" 24 | ["s11.serv00.com,username3,password3"]="s5,30000;vmess,40000,vmess.abc.xyz,GN0TldJNU9URXhOV05qWm1NMiJ9" 25 | ) 26 | 27 | # 最大检测失败次数 28 | max_fail=3 29 | 30 | # 获取脚本 URL 31 | get_script_url() { 32 | case $1 in 33 | s5) echo "${base_url}/am-serv00-socks5/main/am_restart_s5.sh" ;; 34 | vmess) echo "${base_url}/am-serv00-vmess/main/am_restart_vmess.sh" ;; 35 | nezha-dashboard) echo "${base_url}/am-serv00-nezha/main/am_restart_dashboard.sh" ;; 36 | nezha-agent) echo "${base_url}/am-serv00-nezha/main/am_restart_agent.sh" ;; 37 | x-ui) echo "${base_url}/am-serv00-x-ui/main/am_restart_x_ui.sh" ;; 38 | *) echo "${base_url}/am-serv00-socks5/main/am_restart_s5.sh" ;; 39 | esac 40 | } 41 | 42 | # 检查端口是否打开 43 | check_port() { 44 | nc -zv "$1" "$2" >/dev/null 2>&1 45 | } 46 | 47 | # 检查 Argo 隧道是否在线 48 | check_argo() { 49 | local http_code 50 | #http_code=$(curl -v -o /dev/null -s -w "%{http_code}" "https://$1") 51 | http_code=$(curl -o /dev/null -s -w "%{http_code}" "https://$1") 52 | 53 | echo "HTTP Code: $http_code" 54 | # 如果返回状态码为404,则视为在线 55 | if [ "$http_code" -eq 404 ]; then 56 | return 0 # 视为在线 57 | else 58 | return 1 # 视为不在线 59 | fi 60 | } 61 | 62 | 63 | # 远程执行脚本 64 | execute_remote_script() { 65 | local script_url token="" 66 | script_url=$(get_script_url "$4") 67 | 68 | # 如果服务类型是 vmess,设置 token 69 | if [[ "$4" == "vmess" ]]; then 70 | token="${5}" # 传递 token 71 | fi 72 | 73 | echo "通过 SSH 连接 $2@$1 并执行下载脚本 bash <(curl -Ls $script_url) $token ..." 74 | sshpass -p "$3" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -tt "$2@$1" "bash <(curl -Ls $script_url) $token" 75 | } 76 | 77 | # 打印状态信息 78 | print_status() { 79 | local color="$1" 80 | local message="$2" 81 | echo -e "${color}${message}${re}" 82 | } 83 | 84 | # 遍历每个服务器和服务 85 | for server_info in "${!servers[@]}"; do 86 | IFS=',' read -r server username password <<< "$server_info" 87 | IFS=';' read -ra services <<< "${servers[$server_info]}" 88 | 89 | for service_info in "${services[@]}"; do 90 | IFS=',' read -ra ports <<< "$service_info" 91 | 92 | if [[ ${#ports[@]} -eq 4 ]]; then 93 | # vmess 服务 94 | service=${ports[0]} 95 | port=${ports[1]} 96 | argo_domain=${ports[2]} 97 | token=${ports[3]} 98 | else 99 | # s5 服务 100 | service=${ports[0]} 101 | port=${ports[1]} 102 | token="" 103 | fi 104 | 105 | print_status "$re" "检测服务器: $server 用户名: $username 端口: $port 服务: $service ..." 106 | 107 | fail_count=0 108 | for attempt in {1..3}; do 109 | if check_port "$server" "$port"; then 110 | print_status "$green" "端口 $port 在 $server 正常" 111 | break 112 | else 113 | fail_count=$((fail_count + 1)) 114 | print_status "$red" "第 $attempt 次检测失败,端口 $port 不通" 115 | sleep 5 116 | fi 117 | done 118 | 119 | # 在遍历服务的循环中 120 | if [[ "$service" == "vmess" ]]; then 121 | argo_fail_count=0 122 | print_status "$re" "开始检测 Argo 隧道..." 123 | for argo_attempt in {1..3}; do 124 | echo "Argo 隧道域名: $argo_domain" 125 | if check_argo "$argo_domain"; then 126 | print_status "$green" "Argo 隧道在线" 127 | break # 成功检测,退出循环 128 | else 129 | argo_fail_count=$((argo_fail_count + 1)) 130 | print_status "$red" "第 $argo_attempt 次检测 Argo 隧道失败" 131 | sleep 5 132 | fi 133 | done 134 | 135 | # 检查 Argo 隧道的失败次数是否达到了最大值 136 | if [[ $argo_fail_count -eq $max_fail ]]; then 137 | print_status "$red" "Argo 隧道状态: 连续 $max_fail 次检测失败" 138 | fi 139 | fi 140 | 141 | # 如果端口检测或 Argo 隧道连续失败,执行远程操作 142 | if [[ $fail_count -eq $max_fail ]] || [[ "$service" == "vmess" && $argo_fail_count -eq $max_fail ]]; then 143 | print_status "$red" "服务器状态: $server 用户名: $username 端口: $port 服务: $service 连续 $max_fail 次检测失败,执行远程操作..." 144 | execute_remote_script "$server" "$username" "$password" "$service" "$token" 145 | print_status "$green" "执行远程操作完毕" 146 | else 147 | print_status "$re" "服务器状态: $server 用户名: $username 端口: $port 服务: $service 检测成功" 148 | fi 149 | 150 | echo "----------------------------" 151 | done 152 | done 153 | 154 | print_status "$re" "所有服务器检测完毕" 155 | -------------------------------------------------------------------------------- /qinglong/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "start": "concurrently -n w: npm:start:*", 5 | "start:update": "ts-node -P tsconfig.back.json ./back/update.ts", 6 | "start:public": "ts-node -P tsconfig.back.json ./back/public.ts", 7 | "start:rpc": "ts-node -P tsconfig.back.json ./back/schedule/index.ts", 8 | "start:back": "nodemon", 9 | "start:front": "max dev", 10 | "build:front": "max build", 11 | "build:back": "tsc -p tsconfig.back.json", 12 | "panel": "npm run build:back && node static/build/app.js", 13 | "schedule": "npm run build:back && node static/build/schedule/index.js", 14 | "public": "npm run build:back && node static/build/public.js", 15 | "update": "npm run build:back && node static/build/update.js", 16 | "gen:proto": "protoc --experimental_allow_proto3_optional --plugin=./node_modules/.bin/protoc-gen-ts_proto ./back/protos/*.proto --ts_proto_out=./ --ts_proto_opt=outputServices=grpc-js,env=node,esModuleInterop=true", 17 | "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'", 18 | "postinstall": "max setup 2>/dev/null || true", 19 | "test": "umi-test", 20 | "test:coverage": "umi-test --coverage" 21 | }, 22 | "gitHooks": { 23 | "pre-commit": "lint-staged" 24 | }, 25 | "lint-staged": { 26 | "*.{js,jsx,less,md,json}": [ 27 | "prettier --write" 28 | ], 29 | "*.ts?(x)": [ 30 | "prettier --parser=typescript --write" 31 | ] 32 | }, 33 | "pnpm": { 34 | "peerDependencyRules": { 35 | "ignoreMissing": [ 36 | "react", 37 | "react-dom", 38 | "antd", 39 | "dva", 40 | "postcss", 41 | "webpack", 42 | "eslint", 43 | "stylelint", 44 | "redux", 45 | "@babel/core", 46 | "monaco-editor", 47 | "rc-field-form", 48 | "@types/lodash.merge", 49 | "rollup", 50 | "styled-components" 51 | ], 52 | "allowedVersions": { 53 | "react": "18", 54 | "react-dom": "18", 55 | "dva-core": "2" 56 | } 57 | } 58 | }, 59 | "dependencies": { 60 | "@grpc/grpc-js": "^1.8.13", 61 | "@otplib/preset-default": "^12.0.1", 62 | "@sentry/node": "^8.26.0", 63 | "body-parser": "^1.19.2", 64 | "celebrate": "^15.0.1", 65 | "chokidar": "^3.5.3", 66 | "cors": "^2.8.5", 67 | "cron-parser": "^4.2.1", 68 | "cross-spawn": "^7.0.3", 69 | "dayjs": "^1.11.2", 70 | "dotenv": "^16.0.0", 71 | "express": "^4.17.3", 72 | "express-jwt": "^6.1.1", 73 | "express-rate-limit": "^7.0.0", 74 | "express-urlrewrite": "^1.4.0", 75 | "form-data": "^4.0.0", 76 | "got": "^11.8.2", 77 | "hpagent": "^1.2.0", 78 | "http-proxy-middleware": "^2.0.6", 79 | "iconv-lite": "^0.6.3", 80 | "js-yaml": "^4.1.0", 81 | "jsonwebtoken": "^8.5.1", 82 | "lodash": "^4.17.21", 83 | "multer": "1.4.5-lts.1", 84 | "nedb": "^1.8.0", 85 | "node-schedule": "^2.1.0", 86 | "nodemailer": "^6.7.2", 87 | "p-queue-cjs": "7.3.4", 88 | "protobufjs": "^7.3.0", 89 | "pstree.remy": "^1.1.8", 90 | "reflect-metadata": "^0.1.13", 91 | "sequelize": "^6.25.5", 92 | "serve-handler": "^6.1.3", 93 | "sockjs": "^0.3.24", 94 | "sqlite3": "git+https://github.com/whyour/node-sqlite3.git#v1.0.3", 95 | "toad-scheduler": "^1.6.0", 96 | "typedi": "^0.10.0", 97 | "uuid": "^8.3.2", 98 | "winston": "^3.6.0", 99 | "winston-daily-rotate-file": "^4.7.1", 100 | "yargs": "^17.3.1", 101 | "tough-cookie": "^4.0.0", 102 | "request-ip": "3.3.0", 103 | "ip2region": "2.3.0" 104 | }, 105 | "devDependencies": { 106 | "moment": "2.30.1", 107 | "@ant-design/icons": "^4.7.0", 108 | "@ant-design/pro-layout": "6.38.22", 109 | "@monaco-editor/react": "4.2.1", 110 | "@react-hook/resize-observer": "^1.2.6", 111 | "react-router-dom": "6.26.1", 112 | "@sentry/react": "^8.26.0", 113 | "@types/body-parser": "^1.19.2", 114 | "@types/cors": "^2.8.12", 115 | "@types/cross-spawn": "^6.0.2", 116 | "@types/express": "^4.17.13", 117 | "@types/express-jwt": "^6.0.4", 118 | "@types/file-saver": "2.0.2", 119 | "@types/js-yaml": "^4.0.5", 120 | "@types/jsonwebtoken": "^8.5.8", 121 | "@types/lodash": "^4.14.185", 122 | "@types/multer": "^1.4.7", 123 | "@types/nedb": "^1.8.12", 124 | "@types/node": "^17.0.21", 125 | "@types/node-schedule": "^1.3.2", 126 | "@types/nodemailer": "^6.4.4", 127 | "@types/qrcode.react": "^1.0.2", 128 | "@types/react": "^18.0.20", 129 | "@types/react-copy-to-clipboard": "^5.0.4", 130 | "@types/react-dom": "^18.0.6", 131 | "@types/serve-handler": "^6.1.1", 132 | "@types/sockjs": "^0.3.33", 133 | "@types/sockjs-client": "^1.5.1", 134 | "@types/uuid": "^8.3.4", 135 | "@types/request-ip": "0.0.41", 136 | "@uiw/codemirror-extensions-langs": "^4.21.9", 137 | "@uiw/react-codemirror": "^4.21.9", 138 | "@umijs/max": "^4.0.72", 139 | "@umijs/ssr-darkreader": "^4.9.45", 140 | "ahooks": "^3.7.8", 141 | "ansi-to-react": "^6.1.6", 142 | "antd": "^4.24.8", 143 | "antd-img-crop": "^4.2.3", 144 | "axios": "^1.4.0", 145 | "compression-webpack-plugin": "9.2.0", 146 | "concurrently": "^7.0.0", 147 | "react-hotkeys-hook": "^4.4.1", 148 | "file-saver": "2.0.2", 149 | "lint-staged": "^13.0.3", 150 | "monaco-editor": "0.33.0", 151 | "nodemon": "^3.0.1", 152 | "prettier": "^2.5.1", 153 | "pretty-bytes": "6.1.1", 154 | "qiniu": "^7.4.0", 155 | "qrcode.react": "^1.0.1", 156 | "query-string": "^7.1.1", 157 | "rc-tween-one": "^3.0.6", 158 | "rc-virtual-list": "3.5.3", 159 | "react": "18.2.0", 160 | "react-copy-to-clipboard": "^5.1.0", 161 | "react-diff-viewer": "^3.1.1", 162 | "react-dnd": "^14.0.2", 163 | "react-dnd-html5-backend": "^14.0.0", 164 | "react-dom": "18.2.0", 165 | "react-intl-universal": "^2.6.21", 166 | "react-split-pane": "^0.1.92", 167 | "sockjs-client": "^1.6.0", 168 | "ts-node": "^10.9.2", 169 | "ts-proto": "^1.146.0", 170 | "tslib": "^2.4.0", 171 | "typescript": "5.2.2", 172 | "vh-check": "^2.0.5", 173 | "virtualizedtableforantd4": "1.3.0", 174 | "webpack": "^5.70.0", 175 | "yorkie": "^2.0.0" 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------