Skip to content

青龙

docker 部署

拉取镜像/更新镜像

sh
docker pull whyour/qinglong:latest

启动容器

sh
docker run -dit \
  -v $PWD/ql/data:/ql/data \
  -p 5700:5700 \
  --name qinglong \
  --hostname qinglong \
  --restart unless-stopped \
  whyour/qinglong:latest
yml
version: '3'

services:
  qinglong:
    image: whyour/qinglong:latest
    container_name: qinglong
    restart: unless-stopped
    ports:
      - 5700:5700
    environment:
      QlBaseUrl: /
    volumes:
      - /root/ql/data:/ql/data

基本命令

更新脚本

sh
docker exec -it qinglong git_pull

拉取自定义仓库

sh
docker exec -it qinglong diy i-chenzhe qx

重新 build 面板

sh
docker exec -it qinglong rebuild

通知测试

sh
docker exec -it qinglong notify test test

执行脚本

sh
docker exec -it qinglong js jd_bean_change now

查看密码

sh
docker exec -it qinglong bash cat /ql/config/auth.json

拉取仓库脚本

sh
ql repo <repo_url> <whitelist> <blacklist> <dependence> <branch> <extensions>
  • repo_url: 仓库地址
  • whitelist: 拉取仓库时的白名单,即就是需要拉取的脚本的路径包含的字符串,多个竖线分割
  • blacklist: 拉取仓库时的黑名单,即就是需要拉取的脚本的路径不包含的字符串,多个竖线分割
  • dependence: 拉取仓库需要的依赖文件,会直接从仓库拷贝到 scripts 下的仓库目录,不受黑名单影响,多个竖线分割
  • extensions: 拉取仓库的文件后缀,多个竖线分割
  • branch: 拉取仓库的分支

公开仓库

sh
ql repo https://github.com/KingRan/KR.git "jd_|jx_|jdCookie" "activity|backUp" "^jd[^_]|USER|utils|function|sign|sendNotify|ql|sign_graphics_validate|JDJR"

ql repo https://github.com/zero205/JD_tencent_scf.git "jd_|jx_|getJDCookie" "backUp|icon" "^jd[^_]|USER|sendNotify|sign_graphics_validate|JDJR|JDSign" "main"

私有仓库

  1. 获取 GitHub token
sh
# 链接 https链接
https://github.com/KingRan/KR.git

# 白名单
pupu_

# 黑名单
backup|.vscode

# 依赖文件
pupu[^_]||function|sendNotify

定时任务

*    *    *    *    *    *
┬    ┬    ┬    ┬    ┬    ┬
│    │    │    │    │    │
│    │    │    │    │    └ day of week (0 - 7) (0 or 7 is Sun)
│    │    │    │    └───── month (1 - 12)
│    │    │    └────────── day of month (1 - 31)
│    │    └─────────────── hour (0 - 23)
│    └──────────────────── minute (0 - 59)
└───────────────────────── second (0 - 59, OPTIONAL)

6 个占位符分别标识 :秒 分 时 日 月 周几

  • *: 表示通配符,匹配该域的任意值,假如在 Minutes 域使用 * 表示每分钟都会触发事件
  • -: 表示范围,例如 在 5-20 * * * *,表示从 5 分到 20 分钟每分钟触发一次
  • /: 表示起始时间开始触发,然后每隔固定时间触发一次,如 5/20 * * * * 表示 5 分钟触发一次,而 25,45 等分别触发一次
  • ,: 表示枚举值,如 5,20 * * * * ,表示在 5 和 20 分每分钟触发一次
  • ?: 只能用在 DayofMonth 和 DayofWeek 两个域,它也匹配域的任意值,但实际不会。因为 DayofMonth 和 DayofWeek 会相互影响。例如想在每月的 20 日触发调度,不管 20 日到底是星期几,则只能使用如下写法: 13 13 15 20 * ?, 其中最后一位只能用 ,而不能使用 *,如果使用 * 表示不管星期几都会触发,实际上并不是这样。
  • 由于月份中的日期和星期中的日期这两个元素互斥,必须要对其中一个设置 ?
当分钟是 42 时,执行任务 (e.g. 19:42, 20:42, etc.)
42 * * * *

每 5 分钟执行一次任务
*/5 * * * *

0 17 ? * 0,4-6

订阅

公开仓库

https://github.com/KingRan/KR.git

main

39 20 * * *

jd_|jx_|jdCookie
activity|backUp

依赖文件
^jd[^_]|USER|utils|function|sign|sendNotify|ql|sign_graphics_validate|JDJR

js ts py

执行后
cp -rf /ql/data/scripts/sendNotify.js /ql/data/scripts/KingRan_KR_main/sendNotify.js
sh
https://github.com/jolylai/scripts.git
master
# token
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
# corn
2 0 0 * * 5
pupu_|didi_|xtep_|deploy_

backup|.vscode
pupu[^_]|didi[^_]|xtep[^_]|function|sendNotify
ts

Reference