项目介绍:QD 是 一个 基于 HAR 编辑器和 Tornado 服务端的 HTTP 定时任务自动执行 Web 框架。
项目地址:https://github.com/qd-today/qd
公共har模板库:https://github.com/qd-today/templates
宝塔安装:
compose:https://fastly.jsdelivr.net/gh/qd-today/qd@master/docker-compose.yml
version: "3"
services:
qd:
image: qdtoday/qd:latest
# image: qdtoday/qd:lite-latest # 精简版
# image: qdtoday/qd:dev # 开发版
container_name: qd
depends_on:
- redis
ports:
- "8923:80"
volumes:
- "./config:/usr/src/app/config"
environment:
# - QD_DEBUG=False
# - BIND=0.0.0.0
# - PORT=80
# - MULTI_PROCESS=False
# - AUTO_RELOAD=False
# - GZIP=True
# - ACCESS_LOG=True
# - DISPLAY_IMPORT_WARNING=True
# - USER0ISADMIN=True
# - STATIC_URL_PREFIX=/static/
- DOMAIN=
# - COOKIE_DAY=5
# - COOKIE_SECURE_MODE=False
- COOKIE_SECRET=binux
- PBKDF2_ITERATIONS=400
- AES_KEY=binux
# - DB_TYPE=sqlite3
# - JAWSDB_MARIA_URL=mysql://user:pass@localhost:3306/dbname?auth_plugin=
# - QD_SQL_LOGGING_NAME=QD.sql
# - QD_SQL_LOGGING_LEVEL=WARNING
# - QD_SQL_POOL_LOGGING_NAME=QD.sql.pool
# - QD_SQL_POOL_LOGGING_LEVEL=WARNING
# - QD_SQL_POOL_SIZE=5
# - QD_SQL_MAX_OVERFLOW=10
# - QD_SQL_POOL_PRE_PING=True
# - QD_SQL_POOL_RECYCLE=3600
# - QD_SQL_POOL_TIMEOUT=30
# - QD_SQL_POOL_USE_LIFO=True
- REDISCLOUD_URL=redis://redis:6379
# - REDIS_DB_INDEX=1
# - QD_EVIL=1000
# - EVIL_PASS_LAN_IP=True
# - WORKER_METHOD=Queue
# - QUEUE_NUM=50
# - CHECK_TASK_LOOP=500
# - TASK_MAX_RETRY_COUNT=8
# - NEW_TASK_DELAY=1
# - TASK_WHILE_LOOP_TIMEOUT=900
# - TASK_REQUEST_LIMIT=1500
# - DOWNLOAD_SIZE_LIMIT=5242880
# - REQUEST_TIMEOUT=30.0
# - CONNECT_TIMEOUT=30.0
# - DELAY_MAX_TIMEOUT=29.9
# - UNSAFE_EVAL_TIMEOUT=3.0
# - USE_PYCURL=True
# - ALLOW_RETRY=True
# - DNS_SERVER=
# - CURL_ENCODING=True
# - CURL_CONTENT_LENGTH=True
# - NOT_RETRY_CODE=301|302|303|304|305|307|400|401|403|404|405|407|408|409|410|412|415|413|414|500|501|502|503|504|599
# - EMPTY_RETRY=True
# - TRACEBACK_PRINT=False
# - PUSH_PIC_URL=https://gitee.com/qd-today/qd/raw/master/web/static/img/push_pic.png
# - PUSH_BATCH_SW=True
# - PUSH_BATCH_DELTA=60
# - WS_PING_INTERVAL=5
# - WS_PING_TIMEOUT=30
# - WS_MAX_MESSAGE_SIZE=10485760
# - WS_MAX_QUEUE_SIZE=100
# - WS_MAX_CONNECTIONS_SUBSCRIBE=30
# - SUBSCRIBE_ACCELERATE_URL=jsdelivr_cdn
# - PROXIES=
# - PROXY_DIRECT_MODE=regexp
# - PROXY_DIRECT=(?xi)\A([a-z][a-z0-9+\-.]*://)?(0(.0){3}|127(.0){2}.1|localhost|\[::([\d]+)?\])(:[0-9]+)?
# - EXTRA_ONNX_NAME=
# - EXTRA_CHARSETS_NAME=
# - MAIL_SMTP=
# - MAIL_PORT=465
# - MAIL_SSL=True
# - MAIL_USER=
# - MAIL_PASSWORD=
# - MAIL_FROM=${MAIL_USER}
# - MAIL_DOMAIN_HTTPS=False
# - MAILGUN_KEY=
# - MAILGUN_DOMAIN=${DOMAIN}
# - GA_KEY=
redis:
image: redis:alpine
container_name: redis
command: ["--loglevel warning"]
# command: redis-server /usr/local/etc/redis/redis.conf
volumes:
# - ./redis/redis.conf:/usr/local/etc/redis/redis.conf:rw
- ./redis/data:/data:rw
常见问题:
1.如果后台无法订阅,请先退订仓库,重新添加注册
仓库名:default
仓库URL:https://github.com/qd-today/templates
仓库分支:master
2.ngix反向代理配置
server {
listen 80;
# 自行修改 server_name
server_name qd.example.com;
location / {
proxy_pass http://ip:port;
# WebSocket 关键配置 开始
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# WebSocket 关键配置 结束
# 其他可选配置 开始
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# 其他可选配置 结束
}
}