Giter VIP home page Giter VIP logo

wepush's Introduction

wepush

利用企业微信应用消息向微信发送通知,server酱的golang版本实现。(server酱每次有5条消息的限制)

  • 不需要企业微信,微信即可接收到消息
  • 一键部署,方便简单

1. 部署

部署之前需要先创建企业微信和企业微信应用详细过程可以参考server酱教程

git clone https://github.com/saucer-man/wepush
cd wepush
vim wepush.env  # 填写企业微信应用信息
docker-compose build && docker-compose up -d

其中主要需要填写的有:

  • AuthToken 此api接口的认证token
  • CorpSecret 企业应用secret
  • CorpId 企业ID
  • AgentId 企业应用ID
  • LogLevel 日志详细级别(可以选debug/info/warn)

默认端口为8001,日志目录为./log,可以从docker-compose.yml中修改

2. 使用

部署完毕后,直接请求接口即可发送消息。

curl http://localhost:8001/wepush -H "Content-Type:application/json" -H "token:123" -X POST -d '{"type": "text","touser": "@all","msg": "hello\nworld"}'

其中参数:

  • token:此api接口认证token,可以放在header中,也可以放在url的query中
  • type:发送的消息类型,支持text和markdown(不填的话默认为markdown)
  • touser:成员ID列表,即消息接收者,多个接收者用‘|’分隔,最多支持1000个。(不填的话默认为@all)
  • msg:需要发送的消息内容

效果:

wepush's People

Contributors

saucer-man avatar

Stargazers

 avatar yuju avatar 极客青年 avatar RabBit avatar llussy avatar lixiyu avatar S5248 avatar  avatar m1nt avatar  avatar shaozhong avatar me7ell avatar  avatar mingyunyuziyou avatar masx200 avatar  avatar Zzzzz. avatar  avatar Pony avatar 二丫讲梵 avatar  avatar 9r0k avatar cleviry avatar Keifer Gu avatar Ethan avatar  avatar  avatar  avatar

Watchers

 avatar

wepush's Issues

无法部署

在执行docker-compose build && docker-compose up -d的时候返回

Building wepush
Sending build context to Docker daemon 487.9kB
Step 1/9 : FROM golang:1.16.4-alpine3.13 AS builder
---> cd061e3733f3
Step 2/9 : WORKDIR /src/wepush
---> Using cache
---> 61459517bc34
Step 3/9 : ENV GOPROXY="https://goproxy.cn"
---> Using cache
---> 106ed6ca5266
Step 4/9 : COPY src .
---> Using cache
---> ddf3e116cf97
Step 5/9 : RUN go build -ldflags '-w -s' -o wepush
---> Running in 6bce3b1e371d
go: github.com/antonfisher/[email protected]: Get "https://goproxy.cn/github.com/antonfisher/nested-logrus-formatter/@v/v1.3.1.mod": dial tcp 117.25.133.174:443: connect: connection refused
The command '/bin/sh -c go build -ldflags '-w -s' -o wepush' returned a non-zero code: 1
ERROR: Service 'wepush' failed to build : Build failed

我是想部署在路由器的docker上 发现即时挂了代理也连不上这个IP 请问有解决办法吗

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.