Coder Social home page Coder Social logo

songquanpeng / message-pusher Goto Github PK

View Code? Open in Web Editor NEW
1.8K 19.0 325.0 556 KB

搭建专属于你的消息推送服务,支持多种消息推送方式,支持 Markdown,基于 Golang 仅单可执行文件,开箱即用

Home Page: https://msgpusher.com

License: MIT License

JavaScript 50.03% CSS 2.07% Go 45.78% Dockerfile 0.21% HTML 0.45% Python 1.47%
wechat dingtalk lark bark email message-pusher websocket discord telegram

message-pusher's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

message-pusher's Issues

请问多用户如何实现?

尤其是heroku,我看到前缀和openid是写死的,不会是开多个APP吧?
再就是我想单独针对关注了测试公众号的用户进行特定用户发送特定消息,这个得增加用户管理功能吧?

配置无法保存

admin登录后修改密码等配置操作点击提交没反应无法保存到data.db里去

信息如何换行

使用\n不能换行,如果强行换行,第2行的信息就不能发出去了。

字数限制

IMG_0051
发送的消息,如果超出字数限制就会不显示了。

使用微信测试号报错:access_token is invalid or not latest

正常使用一段时间后就会无法推送错误信息如下

  data: {
    message: 'invalid credential, access_token is invalid or not latest, could get access_token by getStableAccessToken, more details at https://mmbizurl.cn/s/JtxxFh33r rid: 642bce46-663ec3de-44b496d3',
    success: false
  }

容器是按照文档的命令启动

docker run -d --restart always --name message-pusher -p 3000:3000 -e TZ=Asia/Shanghai -v /home/ubuntu/data/message-pusher:/data justsong/message-pusher

然后过段时间又可以推送了

Post请求无法正常处理

不管是根据readme.md的示例Python代码,还是使用工具发出的post请求,收到服务器的回复都是
{"message":"无法解析请求体,请检查其是否为合法 JSON","success":false}

Python代码的 json 请求体仔细过没有任何问题,包括将json复制到json.cn上检测。

为了验证不是我部署的服务的问题,特地使用开发者提供的实例上进行验证,得到的结果一样。

完整代码如下:

import requests

# GET 方式
# res = requests.get("https://your.domain.com/push/username?title={}&description={}&token={}".format("标题", "描述", "666"))

# POST 方式
res = requests.post("https://msgpusher.com/push/chen", data={
    "title": "标题",
    "description": "描述",
    "content": "**Markdown 内容**",
    "token": "zzss"
})

print(res.text)
# 输出为:{"success":true,"message":"ok"}

PyCharm:
image

GET请求没有任何问题,无法处理post请求。

image

增加消息分组功能

建议:每个分组可选择或指定对应的推送规则。推送URL增加group字段,然后消息根据指定的推送规则分发。

企业微信应用消息无法发送

企业微信应用消息配置正常,无法测试发送消息,报错:错误:access_token missing, hint: [1670371158347280850760093], from ip: x.xx.xxx.xx, more info at https://open.work.weixin.qq.com/devtool/query?e=41001 ,测试使用相同的配置其他开源项目可以正常发送通知

Docker 版使用企业微信应用号测试出错:dial tcp: lookup qyapi.weixin.qq.com: device or resource busy

提示
failed to refresh access token: Get "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ww2a8xxxxxxxx378&corpsecret=JyU4HIdpqxxxxxxxxxxxxxdB4_u2sZxxxxxxxxxxx": dial tcp: lookup qyapi.weixin.qq.com: device or resource busy
已加入可信ip和域名,使用腾讯云服务器,同服务器使用其他推送没有问题,推送成功,使用本docker版v0.3.0提示以上错误,重启也不行

支持异步推送

后续有计划实现异步推送吗 接口提交推送任务 后台处理并推送 并提供接口查看推送结果

单用户支持多个同类型的推送方式

我的使用场景是有多个钉钉群机器人,不同的事件需要调用不同的机器人。

现在单用户只能填写一个钉钉群机器人,所以我只能通过多个用户去实现这个需求。如果单用户支持多个钉钉群机器人,就会更加方便一点。

可信任IP配置

企业微信尝试发送test的时候返回,more info at https://open.work.weixin.qq.com/devtool/query?e=60020
需要配置可信任IP,又要求先完成配置可信任域名。
配置可信域名需完成域名归属认证
1. Download "WW_verify_*****.txt
2.将此文件放到www根目录

卡在了第二步,docker exec 进入后,直接放到根目录不对,想问下这个www根目录的docker路径是?

access_token missing

宝塔安装,后台设置成功。运行测试出错:http//www.xxxx.com:3000/admin/hi
未设置token,出现:
{"success":false,"message":"access_token missing, hint: [1629155382_210_3befab32bc7561313a552e71de432623], from ip: 1xx.1xx.1xx.2, more info at https://open.work.weixin.qq.com/devtool/query?e=41001"}
如果设置了token,运行
http//www.xxxx.com:3000/admin/hi&token=xxxxxxxxxxxx
,则出现:
{"success":false,"message":"无效的 access token"}
无论设置token与否都出错。请问是什么原因?

新功能请求:支持 Web 端查看推送的消息

是否可以增加一个功能:任何通过本项目接口发出的通知可以在Web端翻阅查看,可以由超级管理员选择是否开启。应用场景为将本项目自身打造成一个可以接收推送的接口。我想这个功能实现起来最麻烦的地方是通知太多了sqlite是否能满足性能要求,其他的应该不算难。

微信测试公告号模式,无法显示详情和content内容

安装使用方法 - Python 示例, Get方式和Pose方式,在使用微信测试公告号推送时候,能收到推送消息,但是只能显示description内容,无法点击,无法显示详情和content内容。
测试的版本:
1.docker amd64:V3.0 V3.1 V3.2
2.docker arm64 V3.1
以上均出现这个现象;

使用node.js版本的 docker v0.2.3 能正常显示详情和content内容

测试URL:
https://xxx/push/name?title={122}&description={122}&content=**{123}**&token=xxx
测试Pose:
res = requests.post("http://IP/push/name", json={
"title": title,
"description" : description,
"content": content,
"token": "xxx"
})

无效的 access token

按照文档配置好所有的内容,去验证是否可以收到 Hi 信息时,返回 无效的 access token。
1、自己的服务器
2、已开启 https,其实 http 也是一样的错误
3、修改代码,输出具体的错误,common/message.js 里 message.token 输出是 undefined。
4、无论是测试号还是企业号均是该错误
5、访问服务器的 verify 地址,输出 verification failed。修改代码打印详细错误,发现是 const { signature, timestamp, nonce, echostr } = req.query; 里 signature 输出是 undefined
6、文档里说是要在微信测试号里输入信息后,点击验证按钮,但是实际上我发现这块并不是显示验证按钮,而是提交按钮

求大佬帮忙分析下是怎么回事

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.