finb / bark-server Goto Github PK
View Code? Open in Web Editor NEWBackend of Bark
Home Page: https://bark.day.app
License: MIT License
Backend of Bark
Home Page: https://bark.day.app
License: MIT License
Post https://api.push.apple.com/3/device/a1abbcefa6bb21c56520422cf0a7929283c9456b9c13967e2cf5b23dd9ae5476: remote error: tls: expired certificate"
目前的Get和Post请求都是将title/body/category等内容放在URL里面,我感觉对于Post请求,将它们封装为json payload更为合适
curl -d '{"title":"123", "body": "hello world"}' -H "Content-Type: application/json" -X POST https://api.day.app/:key/
Hi all, I made a Node.js version of the bark server:
Please offer a deocker version !
增加isArchive=1参数 也不能保存,但是通过本项目的服务端推送,就能保存,
请问这是什么原因?
用的最新版的docker
使用时碰到提示,一直是这个提示。没有发送成功过。麻烦帮忙看一下。
{ "code": 400, "message": "device key is empty", "timestamp": 1614612016 }
命令:
curl -X "POST" "http://*****/push" \ -H 'Content-Type: application/json; charset=utf-8' \ -u ':' \ -d $'{ "body": "te", "device_key": "vysnnvzowlzekezu", "title": "bleem", "category": "category" }'
日志:
`
┌───────────────────────────────────────────────────┐
│ Fiber v2.5.0 │
│ http://127.0.0.1:8080 │
│ │
│ Handlers ............ 24 Processes ........... 1 │
│ Prefork ....... Disabled PID ................. 1 │
└───────────────────────────────────────────────────┘
2021-03-01 15:20:15 INFO 10.39.1.141 -> [400] POST 330.801µs /push => /push {
"body": "te",
"device_key": "vysnnvzowlzekezu",
"title": "bleem",
"category": "category"
}`
level=error msg="Error:%!(EXTRA *url.Error=Post "https://api.push.apple.com/3/device/32b4cfcd**4270a8d325ec56fa2c\": dial tcp: lookup api.push.apple.com on 127.0.0.11:53: read udp 127.0.0.1:55741->127.0.0.11:53: i/o timeout)"
Hi,
I made a python version of bark server:
https://github.com/billzhong/py-bark
Currently, it should work like a drop-in replacement.
I will keep working on it when I have time.
已经更新到最新版本v1.0.2,还是提示:
{"code":400,"data":null,"message":"与苹果推送服务器传输数据失败: Post "https://api.push.apple.com/3/device/59bb9d89c76709bbdad15d1401c83a2cd7b4ff3589334363410fe67018a07be2\": x509: certificate signed by unknown authority"}
教程里说到:
`当你需要集成Bark到自己的系统或重新实现后端代码时可能需要推送证书
有效期到: 永久
Key ID: LH4T9V5U4R
TeamID: 5U8LBRXG3A
AuthKey_LH4T9V5U4R_5U8LBRXG3A.p8`
这个该怎么用啊?
有知道的吗?
谢谢。
当 content中带%号的时候,会出现400 Bad Request⏎
{"code":400,"data":null,"message":"找不到 Key 对应的 DeviceToken, 请确保 Key 正确! Key 可在 App 端注册获得。"}
信息如上 直接打开机器的8080端口没问题
咋处理呢 已有自带的证书
As the title.
(Solved)
如题
For the log output of the server app, one or multiple log lines will be generated for single request. It's really confusing when multiple requests reach the server at the same.
Have you ever considered about merging them into one, or give them a request ID?
What about modern logger like uber/zap?
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0x60d073]
goroutine 1 [running]:
crypto/x509.(*CertPool).addCertFunc(...)
crypto/x509/cert_pool.go:188
crypto/x509.(*CertPool).AppendCertsFromPEM(0x0, 0xc000131800,
d)
crypto/x509/cert_pool.go:226 +0x2f3
github.com/finb/bark-server/v2/apns.init.0()
github.com/finb/bark-server/v2/apns/apns.go:45 +0x1e5
windows部署的时候,报异常,不知道为什么?
请求
register?devicetoken=bdfd19d89e66d7d1e265f2c240b68894326e37d1534735c6ec834af037d5ba87
返回:
{
"code": 400,
"message": "failed to get device token: failed to get [register] device token from database",
"timestamp": 1614847171
}
用的客户端不支持p8证书
----这是路由器插件的推送代码-----
serverchan_send_title="${send_title} 路由器状态信息" serverchan_send_content=$(cat ${serverchan_info_text}) sckey_nu=$(dbus list serverchan_config_sckey | sort -n -t "_" -k 4 | cut -d "=" -f 1 | cut -d "_" -f 4) for nu in ${sckey_nu}; do serverchan_config_sckey=$(dbus get serverchan_config_sckey_${nu}) url="https://www.baidu.comz:8087/${serverchan_config_sckey}/" result=$(wget --no-check-certificate --post-data "title=${serverchan_send_title}&body=${serverchan_send_content}" -qO- ${url}) if [ -n $(echo $result | grep "success") ]; then [ "${serverchan_info_logger}" == "1" ] && logger "[ServerChan]: 路由器状态信息推送到 SCKEY No.${nu} 成功!" else [ "${serverchan_info_logger}" == "1" ] && logger "[ServerChan]: 路由器状态信息推送到 SCKEY No.${nu} 失败,请检查网络及配置!" fi done
failed to run docker-compose with latest docker image, it outputs:
Starting bark-server ... done
Attaching to bark-server
bark-server | standard_init_linux.go:211: exec user process caused "exec format error"
arm64 on ubuntu
与苹果推送服务器传输数据失败docker搭建的server
推送提示:与苹果推送服务器传输数据失败
希望支持webdav保存日志,程序直接加载证书支持https。
when i try to start bark-server,it return
flag provided but not defined: -p
Usage of ./bark:
-dev
develop推送,请忽略此参数,设置此参数为True会导致推送失败
-ip string
http listen ip (default "0.0.0.0")
-port int
http listen port (default 8080)
here is my start bash:
nohup /root/barkServer/bark -l 0.0.0.0 -p 81 -d /root/barkServer > /root/barkServer/bark.log &
can you help me to fix this problem,thx!
搭建环境:群辉docker,反向代理开启https,端口转发到外网
通过 curl https://ip:port/ping 测试成功
{
"code": 200,
"message": "pong",
"timestamp": 1614750513
}
在iOS app里添加服务器成功,不过不能获取到key
https://ip:端口/Your Key/这里改成你自己的推送内容
app提示服务器错误,不能使用推送服务
下面是docker容器的log
2021-03-03 05:58:14 stdout 2021-03-03 05:58:14 INFO 172.17.0.1 -> [400] GET 38.411µs /:device_key => /register?devicetoken=46f32b2b7710db1f8cc255ca1cbf68b2e020923618784db9d25b6ff8557a3ec1
2021-03-03 05:48:34 stdout 2021-03-03 05:48:33 INFO 172.17.0.1 -> [400] GET 31.416µs /:device_key => /favicon.ico
2021-03-03 05:48:33 stdout 2021-03-03 05:48:33 INFO 172.17.0.1 -> [200] GET 27.83µs /ping => /ping
2021-03-03 05:45:10 stdout 2021-03-03 05:45:10 INFO 172.17.0.1 -> [200] GET 32.742µs /ping => /ping
2021-03-03 05:43:58 stdout 2021-03-03 05:43:58 INFO 172.17.0.1 -> [400] GET 60.598µs /:device_key => /register?devicetoken=46f32b2b7710db1f8cc255ca1cbf68b2e020923618784db9d25b6ff8557a3ec1
2021-03-03 05:43:55 stdout 2021-03-03 05:43:55 INFO 172.17.0.1 -> [200] GET 9.492µs /ping => /ping
2021-03-03 05:43:54 stdout 2021-03-03 05:43:54 INFO 172.17.0.1 -> [200] GET 25.558µs /ping => /ping
2021-03-03 05:43:05 stdout 2021-03-03 05:43:05 INFO 172.17.0.1 -> [200] GET 134.216µs /ping => /ping
2021-03-03 05:41:22 stdout
2021-03-03 05:41:22 stdout �[90m └───────────────────────────────────────────────────┘�[0m
2021-03-03 05:41:22 stdout �[90m │ Prefork ....... Disabled PID ................. �[96m1�[90m │
2021-03-03 05:41:22 stdout �[90m │ Handlers ............ �[96m26�[90m Processes ........... �[96m1�[90m │
2021-03-03 05:41:22 stdout �[90m │ │
2021-03-03 05:41:22 stdout �[90m │ http://127.0.0.1:8080 │
2021-03-03 05:41:22 stdout �[90m │ �[96m Fiber v2.5.0�[90m │
2021-03-03 05:41:22 stdout �[90m�[90m ┌───────────────────────────────────────────────────┐
2021-03-03 05:41:22 stdout
2021-03-03 05:41:22 stdout 2021-03-03 05:41:22 INFO Bark Server Listen at: 0.0.0.0:8080
2021-03-03 05:41:21 stdout 2021-03-03 05:41:21 INFO init database [/data]...
2021-03-03 05:41:21 stdout 2021-03-03 05:41:21 INFO load route [register_compat] success...
2021-03-03 05:41:21 stdout 2021-03-03 05:41:21 INFO load route [push_compat] success...
2021-03-03 05:41:21 stdout 2021-03-03 05:41:21 INFO load route [register] success...
2021-03-03 05:41:21 stdout 2021-03-03 05:41:21 INFO load route [push] success...
2021-03-03 05:41:21 stdout 2021-03-03 05:41:21 INFO load route [misc] success...
2021-03-03 05:41:21 stdout 2021-03-03 05:41:21 INFO init apns client success...
报错:
Invalid server! please try again!
当Server Address 为 https://ip 时会报如上错误
当使用 https://ip:443 格式时可以正常添加。
不知道哪里出了问题
nginx配置文件与Readme推荐格式一致
谢谢!
最新的链接在手机打开只会下载。不会提示安装证书,系统是iOS 13。
将bark server直接部署到树莓派执行后,手机端发送消息测试 树莓派提示certificate signed by unknow authority
特殊符号%,出现在内容里会报错
{ "code": 500, "message": "invalid URL escape \"%\"", "timestamp": 1622448460 }
docker方式自建 总是提示 403 ExpiredProviderToken 不知道为什么 看服务端接收到请求了 日志显示也是 403 ExpiredProviderToken
老哥知道为啥嘛?
我通过 https://github.com/Finb/bark-server/releases 下载了 Linux 的 releases 版本,也运行成功了,我想通过读取 .db 文件的方式添加一些管理功能,请教一下 .db 文件的默认密码是什么呢?我在源代码里面没找到(go 也基本不会😭),谢谢大佬。
目前在写一个bark-server的Node.js版本,方便其他写前端比较顺手的朋友集成bark推送到自己的项目中。
看到Finb提供的还是p12的证书,好像没有使用「新」的APNs Provider API。因为我这边用到的APNs包都只支持了APNs Provider API,老的cert-key模式已经完全移除...所以请问是否考虑换用新的APNs协议?
切换应该没有什么特别要处理的地方,bark-server使用的apns2包已经支持,只需要到苹果开发者网站申请.p8证书,再在初始化apns2时提供下keyId和teamId即可。
换到新的协议最大的好处是不用再定期更新证书了。
希望能进一步支持以下3个已有的实用参数:
"automaticallyCopy": 1,
"copy": "复制内容",
"isArchive": 1,
请问下大佬,自己搭建的文字可以推,网址就不能推。
带“/”符号的推送什么自己换行,如home/test,会变成一行home,一行test。只能复制到test
听说要转换字符吗?请问下怎么设置?
谢谢
bark server用的是313
我是想把443的转到313上
但是试了很多方法都不成功
web服务器是Nginx
想问下作者是用的什么办法转发请求的
访问http://0.0.0.0:8080/ping 返回以下信息
{"code":200,"message":"pong","timestamp":1614696249}
访问http://0.0.0.0:8080 返回以下信息
Cannot GET /
app里添加服务器也提示填写的服务器无效,网络链接中断
{"code":400,"data":null,"message":"与苹果推送服务器传输数据失败: Post "https://api.push.apple.com/3/device/de48279c61d2dd9bca3b8aaf5d416cf68293cf39b*******e7edded992386015\": x509: certificate signed by unknown authority"}
What about the three types of delay message:
Can bark-server deploy to aws lambda or other severless fuction sevices which has golang runtime.
是否可部署在 AWS lambda 或其他支持 go 运行时的云函数计算服务上
hi, the certificate has expired, please update, thanks in advance.
Version: Bump v1.0.2
Linux amd64
curl -iv https://api.push.apple.com
场景描述:
I use self-hosted bark server, and sometimes I received some strange notifications after I sent single one. And I didn't know who did this or watched on my network traffic.
Can you please add IP address of the requests in logging, so everyone can get more details about the requester/device sent the request?
INFO[2021-02-07 03:23:04] 200 AE11B12A-D229-D4BC-2E26-CD8E591D37A9
INFO[2021-02-07 03:23:08] ==========================
INFO[2021-02-07 03:23:08] key: XXXXXXXXXXXXXX
INFO[2021-02-07 03:23:08] category:
INFO[2021-02-07 03:23:08] title:
INFO[2021-02-07 03:23:08] body: 无推送文字内容
INFO[2021-02-07 03:23:08] params: map[automaticallycopy:* copy:* sound:*]
INFO[2021-02-07 03:23:08] ==========================
404 page not found
is so awkwark and confusing --- I couldn't tell if it's deployed successfully or not.
Hi,
Could you please let us know (or write it down in README.md) how to compile the binary from source?
Thank you very much!
1、/register获取的device_key有效期是多久?
2、/push时一直提示"device key is empty"这是哪里出问题了?
{ "body": "Test Bark Server", "device_key": "lfcepdbexuhyqapx", "title": "bleem", "ext_params": { "url": "https://mritd.com" }, "category": "category", "sound": "minuet.caf" }
{ "code": 400, "message": "device key is empty", "timestamp": 1614328454 }
3、API_V2.md 中 /push 的java示例 addHeader("Authorization", "Basic Og==") 这个值是哪里来的?
https://github.com/Finb/bark-server/blob/master/docs/API_V2.md
我在安卓用Tasker转发短信到Bark,但是短信内容有网址的时候推送就失效了,估计是多了"/"的事。怎么能规避这个情况呢?
能否忽略推送内容中的“/”呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.