Skip to content
On this page

Pusher

Push Registration

The QD framework provides various [push methods](#push methods), and you can register different push tools in Toolbox->Push Registration to push notifications to you when specific events occur (e.g. timed task execution failure).

TIP

The parameters filled in when registering the push are separated and connected by ;. If the parameter value is empty, please be sure to keep the ; after the parameter position, otherwise it may cause parameter parsing error.

Push Registration Test

After registering the push method in Toolbox->Push Registration, you can click the Test button to test whether the push method is available.

If the push method is available, you will receive a push message, otherwise you will be prompted that the push failed.

TIP

When testing the push registration, please make sure that the following conditions are met:

  • The correct parameters are filled in;

  • The email and password are filled in with the user's email and password of the QD framework.

Push Registration Former value

After registering the push method in Toolbox->Push Registration, you can click the Former value button to view the former value of the push registration.

TIP

When viewing the former value of the push registration, please make sure that the email and password are filled in with the user's email and password of the QD framework.

Push Methods

The QD framework provides the following push methods:

E-mail Push

E-mail push does not need to set parameters in Toolbox->Push Registration, you need to configure the following parameters in the environment variables:

Variable nameRequiredDefaultDescription
MAIL_SMTPTrue""Email SMTP server
MAIL_PORTFalse465Email SMTP server port
MAIL_SSLFalseTrueWhether to use SSL
MAIL_STARTTLSFalseFalseWhether to use TLS
MAIL_USERTrue""Email username
MAIL_PASSWORDTrue""Email password
MAIL_FROMFalseMAIL_USERThe Email used when sending, the default is the same as MAIL_USER
MAIL_DOMAIN_HTTPSFalseFalseWhether to use HTTPS for email domain name.
Not the framework itself HTTPS configuration.
If you need HTTPS, please use an external reverse proxy

If you are using the following email, refer to the SMTP enable method and configuration method below to get your SMTP server address and port.

EmailSMTP enable methodSMTP configuration methodOther instructions
Tencent Enterprise MailHow to enable Tencent Enterprise Mail POP/SMTP/IMAP service?Common mail client software settingsHow do members bind/associate WeChat and enable secure login to get client-specific passwords?
QQ MailHow to enable QQ Mail POP3/SMTP/IMAP service?How to turn on POP3/SMTP/IMAP?Why do I need to set a separate password to enable POP3/SMTP/IMAP?
Netease Enterprise Mail-Enterprise Mail POP, SMTP, IMAP server address settings.What is a client authorization code and how do I use it?
Netease MailWhat is POP3, SMTP and IMAP?How to enable client protocol?-
Gmail-How to use POP3/SMTP/IMAP service?Sign in with app passwords
Outlook-POP, IMAP and SMTP settingsUse app passwords with apps that don't support two-step verification

MailGun

If you have configured MailGun, please configure the following parameters in the environment variables:

Variable nameRequiredDefaultDescription
MAILGUN_KEYTrue""MailGun API Key
MAILGUN_DOMAINTrueDOMAINMailGun Domain,
The default is the value of the DOMAIN in the environment variables,
Please configure the value of DOMAIN in the environment variables,
and set the corresponding Domain in the MailGun console,
otherwise MailGun cannot be used

Bark Push

Bark push needs to set parameters in Toolbox->Push Registration:

Parameter nameRequiredDefaultDescription
BarkUrlTrue""Bark push address,
The format is https://api.day.app/push_key,
The push_key can be obtained in the Bark client,
If you are using a self-built Bark service,
please replace https://api.day.app/ with your Bark service address.
For example: http://bark.example.com/push_key

Server Chan Push

Server Chan push needs to set parameters in Toolbox->Push Registration:

Parameter nameRequiredDefaultDescription
skeyTrue""Server Chan push sendkey,
Can be obtained in Server Chan

Telegram Bot Push

Telegram Bot push needs to set parameters in Toolbox->Push Registration:

Parameter nameRequiredDefaultDescription
TG_TOKENTrue""Telegram Bot Token,
Can be obtained in BotFather,
Should be a combination of Bot ID and corresponding Key, but not including bot,
That is, the token form: 1111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
TG_USERIDTrue""Telegram Chat ID,
Can be obtained in Telegram API,
The chat_id field in the Telegram API, such as 222222222
TG_HOSTFalse""Telegram API Host,
Can be a domain name or IP address,
For example, tg.mydomain.com,
You can also add the http:// or https:// prefix,
If left blank, the default value api.telegram.org is used
PROXY_URLFalse""Proxy address,
The format is scheme://username:password@host:port,
For example, http://user:password@host:port,
If left blank, the Proxy is not used
PUSH_PIC_URLFalse""Custom push picture address,
If left blank, the environment variable PUSH_PIC_URL value is used
Example

Assume that you have created a Telegram Bot API with a custom domain name:

https://tg.mydomain.com/bot1111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/sendMessage?chat_id=222222222&text=HelloWorld

The above request will send a HelloWorld message to the chat 222222222, then when registering the Telegram Bot as a push method:

  • TG_TOKEN is 1111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  • TG_USERID is 222222222
  • TG_HOST is tg.mydomain.com

Therefore, the final form is as follows:

Text
1111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;222222222;tg.mydomain.com

DingTalk Push

DingTalk push needs to set parameters in Toolbox->Push Registration:

Parameter nameRequiredDefaultDescription
DINGDING_TOKENTrue""DingTalk push Token,
Can be obtained in Custom Robot Access,
If you set the IP address range in Security Settings,
Please add the IP address of the QD server to IP address range,
Otherwise, you will not be able to receive push messages;
If you set the Custom Keywords in Security Settings,
Please add QD/Push/Test to Custom Keywords,
Otherwise, you will not be able to receive push messages;
Please do not enable Signature in Security Settings, QD framework does not support DingTalk Signature push for the time being.
PUSH_PIC_URLFalse""Custom push picture address,
If left blank, the environment variable PUSH_PIC_URL value is used

WXPusher Push

WXPusher push needs to set parameters in Toolbox->Push Registration:

Parameter nameRequiredDefaultDescription
APPTOKENTrue""WXPusher push Token,
Can be obtained in WXPusher
WxPusher_UIDTrue""WXPusher push UID,
Can be obtained in WXPusher

WeCom Application Push

WeCom application push needs to set parameters in Toolbox->Push Registration:

Parameter nameRequiredDefaultDescription
CorpIDTrue""WeCom CorpID,
Can be obtained in WeCom
AgentIDTrue""WeCom application AgentID,
Can be obtained in WeCom
AgentSecretTrue""WeCom application Secret,
Can be obtained in WeCom
PUSH_PIC_URL_or_Media_idFalse""Custom push picture address or Media_id,
Media_id can be obtained through WeCom interface,
If left blank, the environment variable PUSH_PIC_URL value is used
QYWX_PROXY_HOSTFalse""WeCom Host,
Can be a domain name or IP address,
For example, qywx.mydomain.com,
You can also add the http:// or https:// prefix,
If left blank, the default value https://qyapi.weixin.qq.com/ is used

QYWX_PROXY_HOST

If you use Nginx to proxy the WeCom application push, the following is an example of Nginx configuration:

Nginx
server {
    listen 443 ssl;
    server_name qywx.mydomain.com;
    ssl_certificate /etc/nginx/ssl/qywx.mydomain.com.crt;
    ssl_certificate_key /etc/nginx/ssl/qywx.mydomain.com.key;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;
    location / {
        proxy_pass https://qyapi.weixin.qq.com/;
    }
}

WeCom Webhook Push

WeCom Webhook push needs to set parameters in Toolbox->Push Registration:

Parameter nameRequiredDefaultDescription
QYWX_WebHook_KeyTrue""WeCom Webhook Key,
Can be obtained in WeCom

Custom Push

Custom push supports GET and POST push methods, using {log} and {t} to represent the log and title to be replaced.

Custom push needs to set parameters in Toolbox->Push Registration:

Custom Get Push

Parameter nameRequiredDefaultDescription
URLTrue""Custom Get push address,
For example, https://example.com/push?log={log}&t={t}
GET_HeaderFalse""Custom Get push Header,
Use json format (double quotes), the format is { "key1": "value1", "key2": "value2" },
If left blank, the Header is not set

Custom Post Push

Parameter nameRequiredDefaultDescription
URLTrue""Custom Post push address,
For example, https://example.com/push
POST_HeaderFalse""Custom Post push Header,
Use json format (double quotes), the format is { "key1": "value1", "key2": "value2" },
For example, { "key1": "{log}", "key2": "{t}" },
If left blank, the Header is not set
POST_DataFalse""Custom Post push Body,
Use json format (double quotes),
For example, { "key1": "{log}", "key2": "{t}" },
If left blank, the Body is not set

Push Settings

After registering the push method in Toolbox->Push Registration, you can set the trigger conditions of the push method in Toolbox->Push Settings.

In Push Settings, you can set the push switch of each task, the task result push channel, the task result notification selection, and the task result batch push.

Task Result Push Channel

The task result push channel is used to set the task result push channel. The task result push channel includes the following:

Task Result Notification Selection

The task result notification selection is used to set when to push the task result. The task result notification selection includes the following:

  • Manual execution success notification
  • Manual execution failure notification
  • Automatic execution success notification
  • Automatic execution failure notification

Notify after automatic error can be set to push notifications after automatic execution fails several times. For example, if set to 3, the notification will be pushed after automatic execution fails 3 times.

Task Result Batch Push

The task result batch push is used to set the batch push of the task result. When Enable batch push is turned on, the task result within the specified time interval before the current push time will be batch pushed according to the Batch push time setting and Batch push time interval when the task result is pushed.

  • Batch push time setting: The initial batch push time setting, for example, set to 12:00:00, then a batch push will be made at 12:00:00 on the same day.

  • Batch push time interval: Set how many seconds to push the task result once. The default is 86400 seconds, that is, the task result within 86400 seconds before the current push time will be batch pushed every day.

Released under the MIT License.