Scheduled task management platform QingLong

1. About QingLong

1.1 QingLong Introduction

Qinglong Panel is a multi-language scheduled task management platform that supports Python3, JavaScript, Shell, Typescript, and supports online management of scripts and logs. It is rich in functions and can meet most demand scenarios, so it is worth a try.

The main function

  • Supports multiple scripting languages ​​(python3, javaScript, shell, typescript)
  • Support online management of scripts, environment variables, and configuration files
  • Support online viewing of task logs
  • Supports second-level task settings
  • Support system level notifications
  • Support dark mode
  • Support mobile operation

Official website

  • Github:https://github.com//whyour/qinglong

1.2 QingLong deployment

  • Download image

Pull the QingLong image from docker hub, address: https://hub.docker.com/r/whyour/qinglong:debian. The latest image is built based on alpine, and the debian image is built based on debian-slim. We use the debian image here.

root@hcss-ecs-f632:~# docker pull whyour/qinglong:debian
debian: Pulling from whyour/qinglong
7dbc1adf280e: Pull complete
4171d440ff02: Pull complete
726c5fb7508b: Pull complete
379fa4960c82: Pull complete
2f8a564c8167: Pull complete
8fa76ed50e52: Pull complete
c2f831f6682a: Pull complete
9f3ce2a7a342: Pull complete
4c53dfc2225f: Pull complete
e2cc0890f949: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:6e7e533d6212c86448fa9c0171373a095b76102bb5096c68aebfb85d04f0a06a
Status: Downloaded newer image for whyour/qinglong:debian
docker.io/whyour/qinglong:debian
  • Start service

docker-composeStart by method, the configuration file docker-compose.ymlis obtained directly from the official

mkdir qinglong
wget https://raw.githubusercontent.com/whyour/qinglong/master/docker/docker-compose.yml

docker-compose.ymlThe file is as follows

version: '2'
services:
 web:
   # debian-slim
   image: whyour/qinglong:debian
   volumes:
     - ./data:/ql/data
   ports:
     - "0.0.0.0:5700:5700"
   environment:
     QlBaseUrl: '/'
   restart: unless-stopped

# 启动
root@hcss-ecs-f632:~/qinglong# docker-compose up -d
Creating network "qinglong_default" with the default driver
Creating qinglong_web_1 ... done
# 停止
root@hcss-ecs-f632:~/qinglong# docker-compose down
  • Check container status

Check qinglongthe container status to ensure that the container starts normally

root@hcss-ecs-f632:~/qinglong# docker ps
CONTAINER ID   IMAGE                        COMMAND                  CREATED      STATUS                 PORTS                                                 NAMES
b905dc7ef47c   whyour/qinglong:debian       "./docker/docker-ent…"   2 days ago   Up 2 hours (healthy)   0.0.0.0:5700->5700/tcp                                qinglong_web_1
  • address

Intranet: http://localhost:5700
External network: http://Public IP:5700

  • Access results

Insert image description here
If this page appears, the Qinglong panel is deployed successfully.

1.3 QingLong use

  • Basic setup and configuration

Account settings: Set username and password for subsequent access
Insert image description here

Notification settings: used to obtain script running status, supports multiple notification methods, such as DingTalk robot, enterprise WeChat robot, etc.
Insert image description here

finish installation
Insert image description here

Login: Enter your username and password to log in to the Qinglong panel
Insert image description here

  • Dependency management: install nodejs, python, linux dependencies

Create dependencies, select 依赖类型and dependencies 名称to install automatically
Insert image description here

nodejs common dependencies ,
axios, request, cheerio, js-base64, dotenv, magic, , tough-cookie, [email protected], , require, requests, date-fns, , ts-md5, typescript, json5, [email protected], crypto-js, @types/node, png-js, node-telegram-bot-api, fs, jsdom, form-data, , , , , , ,jiebatslibdsjsdom -gprettytableqlcommonnode-jsencryptjuejin-helpermomentglobal-agent

python common dependencies
rsa, bs4, telethon, cacheout, jieba, PyExecJS, ping3, canvas, Crypto, ds, requests,pycryptodome

Commonly used dependencies in linux
libc-dev, gcc, g++, libffi-dev,python3-dev

Insert image description here

  • Advanced gameplay settings

Get the JD script library command line (the script library comes from: https://github.com/shufflewzc/faker2)

ql repo https://ghproxy.com/https://github.com/shufflewzc/faker2.git "jd_|jx_|getJDCookie" "activity|backUp" "^jd[^_]|USER|ZooFaker_Necklace"

Create a task and 命令/脚本fill in the appeal command line. 定时规则If 分 时 天 月 周entered , it means automatically running the script 1 0 * * *every day .00:01
Insert image description here

Of course, you can also manually 运行script, and you can also view the script running log. Running this faker集合仓库will download many JD-related scripts, such as Jingdou sign-in, Jingdou sign-in and other tasks.
Insert image description here
To use Jingdong related scripts, you need to configure environment variables, 名称fill in JD_COOKIE, fill inpt_koken=xxx;pt_key=xxx;pt_pin=xxx;

Insert image description here

Regarding the acquisition of values: Enter in the browser m.jd.com, complete the login, Cookiesearch for keywords in pt_, you will get three values, just fill in according to the appeal format.
(Note: This value cannot be leaked)
Insert image description here
After completing the above configuration, you can try to run some scripts, such as signing in with Jingdou. You need to explore more ways to play by yourself!
Insert image description here

  • Custom script development

Built-in commands

# 更新并重启青龙
ql update                                                    
# 运行自定义脚本extra.sh
ql extra                                                     
# 添加单个脚本文件
ql raw <file_url>                                             
# 添加单个仓库的指定脚本
ql repo <repo_url> <whitelist> <blacklist> <dependence> <branch> <extensions>
# 删除旧日志
ql rmlog <days>                                              
# 启动tg-bot
ql bot                                                       
# 检测青龙环境并修复
ql check                                                     
# 重置登录错误次数
ql resetlet                                                  
# 禁用两步登录
ql resettfa                                                  

# 依次执行,如果设置了随机延迟,将随机延迟一定秒数
task <file_path>                                             
# 依次执行,无论是否设置了随机延迟,均立即运行,前台会输出日,同时记录在日志文件中
task <file_path> now                                         
# 并发执行,无论是否设置了随机延迟,均立即运行,前台不产生日,直接记录在日志文件中,且可指定账号执行
task <file_path> conc <env_name> <account_number>(可选的) 
# 指定账号执行,无论是否设置了随机延迟,均立即运行 
task <file_path> desi <env_name> <account_number>      
# 设置任务超时时间   
task -m <max_time> <file_path>
# 实时打印任务日志,创建定时任务时,不用携带此参数
task -l <file_path>

Parameter Description

  • file_url: script address
  • repo_url: warehouse address
  • whitelist: The whitelist when pulling the warehouse, that is, the string contained in the path of the script that needs to be pulled, separated by multiple vertical bars
  • blacklist: The blacklist when pulling the warehouse, that is, the string that is not included in the path of the script that needs to be pulled, separated by multiple vertical bars
  • dependence: Pulling the dependency files required by the warehouse will be copied directly from the warehouse to the warehouse directory under scripts. It is not affected by the blacklist and is divided by multiple vertical lines.
  • extensions: Pull the file suffix of the warehouse, separated by multiple vertical lines
  • branch: pull the branch of the warehouse
  • days: Number of days to keep logs
  • file_path: file path when the task is executed
  • env_name: The name of the environment variable when concurrency is required or specified when executing a task
  • account_number: Specify the account number that an environment variable needs to execute when executing the task.
  • max_time: timeout, suffix "s" represents seconds (default value), "m" represents minutes, "h" represents hours, "d" represents days

Related references
https://zhuanlan.zhihu.com/p/651405749?utm_id=0
https://www.cnblogs.com/xingxia/p/crontab_qinglong.html
https://www.cnblogs.com/coderxx/archive/ 2021/12/03/15636214.html
https://www.loncons.com/116520.html
Qinglong panel warehouse collection (continuously updated)
https://blog.csdn.net/liu52365/article/details/121233533
http:/ /blog.02868.cn/?id=37962&eqid=c6a499f10015f070000000046471fd08

Guess you like

Origin blog.csdn.net/weixin_44008788/article/details/133279510