Skip to content

Onepush configuration [CN]

Xm798 edited this page Aug 19, 2022 · 13 revisions

错误推送设置

Alas 使用 Onepush 提供消息推送。可接入各种消息平台,例如 Bark, ServerChan, Discord, 邮件等。 支持列表见 Onepush providers

获取推送参数

请推送配置部分中的各服务文档获取需要的推送参数。

没写到的欢迎补充

推送配置

配置为 json 格式,顶层为字典,需要提供 推送服务名 provider 和对应的 参数字典 params

Bark

文档

{
    "provider": "bark",
    "params": {
        "key": "Vg*******************"
    }
}

更多参数,例如添加 sound

{
    "provider": "bark",
    "params": {
        "key": "Vg*******************",
+        "sound": "alarm"
    }
}
Key 的详细获取方式

Bark 为例,在 Onepush 仓库中,查看 providers/bark.py

    _params = {
        'required': ['key'],

表示该推送方法需要填写参数 key

使用默认服务器时,在服务器列表中可以找到 key (红框标示处)

展开图片

image

Vg*******************

如果你有自己的 bark 服务器,需要将完整链接作为 key

https://bark.xxx.xxx/Fkq5***************

邮件

{
    "provider":"smtp",
    "params":{
        "host": "smtp.qq.com",         // smtp 服务器地址
        "user": "[email protected]",    // 用户名,通常是你的邮箱。
        "password": "Passw0rd!",       // 登录密码,一般为需要单独申请的授权码。
        "port": "465",                 // smtp 服务器端口,如果有提供ssl端口(465)建议使用。
        // "ssl": "true"              // 显式指定使用ssl连接,端口是465时不要填写此项。
    }
}
{
    "provider": "smtp",
    "params": {
        "host": "smtp.gmail.com",
        "port": 587,
+        "ssl": true,
        "user": "[email protected]",
        "password": "abcdefghijklmnopq"
    }
}
常见邮箱

Pushplus

官网

{
    "provider": "pushplus", 
    "params": {
        "token": "xxxxxxxxxxxxxxxxxx"
    }
}

Pushdeer

官网

{
    "provider": "pushdeer", 
    "params": {
        "pushkey": "xxxxxxxxxxxxxxxxxx"
    }
}

Server 酱 Turbo 版

官网

Server 酱已停止运行,需使用 Turbo 版,免费版每天限制五条。

{
    "provider": "serverchanturbo", 
    "params": {
        "sctkey": "SCT16*************************"
    }
}

Discord Webhook

Document

{
    "provider": "discord", 
    "params": {
        "webhook": "https://discord.com/api/webhooks/12345678912345678900/verylongstring_veryveryverylongrandomstring"
    }
}

Telegram Bot

Document

{
    "notifier": "telegram",
    "params": {
      "token": "16xxxxxxx:xxxxxxxxxxx",      // 从 @BotFather 获取
      "userid": "10000000",                  // 从 @userinfobot 获取
      "api_url": "api.telegram.org"          // 国内需使用反代 API 或网络代理
    }
  }

企业微信应用

文档

{
    "provider": "pushdeer", 
    "params": {
        "corpid": "xxxxxxxx", 
        "corpsecret": "xxxxxxxx", 
        "agentid": "10001"
    }
}

企业微信机器人

文档

{
    "provider": "pushdeer", 
    "params": {
        "key": "xxxxxxxx"
    }
}

钉钉群机器人

文档

{
    "provider": "pushdeer", 
    "params": {
        "token": "xxxxxxxx"
    }
}

go-cqhttp

文档

{
    "notifier": "gocqhttp",
    "params": {
      "endpoint": "http://cqhttp.example.com:5700",
      "access_token": "YOUR_TOKEN", // 设置了 access_token 时需要
      "message_type": "private",    // private 为私聊消息,group 为群聊消息
      "user_id": "12345678",        // message_type 为 private 时需要
      "group_id": "12345678"        // message_type 为 group 时需要
    }
 }

最后将得到的 json 填入 Alas 设置 -> 调试设置 -> 错误推送设置 即可

Clone this wiki locally