Bark is an iOS App which allows you to push customed notifications to your iPhone.

Bark

Bark is an iOS App which allows you to push customed notifications to your iPhone.

Table of Contents

Installation

For Docker User

Docker Automated build MicroBadger Size MicroBadger Layers

The docker image is already available, you can use the following command to run the bark server:

docker run -dt --name bark -p 8080:8080 -v `pwd`/bark-data:/data finab/bark-server

If you use the docker-compose tool, you can copy docker-copose.yaml under this project to any directory and run it:

mkdir bark-server && cd bark-server
curl -sL https://git.io/JvSRl > docker-compose.yaml
docker-compose up -d

For General User

  • 1、Download precompiled binaries from the releases page
  • 2、Add executable permissions to the bark-server binary: chmod +x bark-server
  • 3、Start bark-server: ./bark-server --addr 0.0.0.0:8080 --data ./bark-data
  • 4、Test the server: curl localhost:8080/ping

Note: Bark-server uses the /data directory to store data by default. Make sure that bark-server has permission to write to the /data directory, otherwise use the -d option to change the directory.

For Developer

Developers can compile this project by themselves, and the dependencies required for compilation:

  • Golang 1.16+
  • Go Mod Enabled(env GO111MODULE=on)
  • Go Mod Proxy Enabled(env GOPROXY=https://goproxy.cn)
  • make Installed

Run the following command to compile this project:

# Cross compile all platforms
make

# Or install into the local GOPATH
make install

Nginx Proxy

Most users want to deploy the bark server on the intranet server, and then use Nginx to reverse proxy the bark server; here is a simple Nginx configuration example (we assume that the bark server is listening at 192.168.1.123:8080)

# generated 2020-03-26, Mozilla Guideline v5.4, nginx 1.17.7, OpenSSL 1.1.1d, modern configuration
# https://ssl-config.mozilla.org/#server=nginx&version=1.17.7&config=modern&openssl=1.1.1d&guideline=5.4
server {
    listen 80;
    listen [::]:80;
    # Replace bark.app.dev with your real domain name.
    server_name bark.app.dev;

    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    # Replace bark.app.dev with your real domain name.
    server_name bark.app.dev;

    ssl_certificate /path/to/signed_cert_plus_intermediates;
    ssl_certificate_key /path/to/private_key;
    ssl_session_timeout 1d;
    ssl_session_cache shared:MozSSL:10m;  # about 40000 sessions
    ssl_session_tickets off;

    # modern configuration
    ssl_protocols TLSv1.3;
    ssl_prefer_server_ciphers off;

    # HSTS (ngx_http_headers_module is required) (63072000 seconds)
    add_header Strict-Transport-Security "max-age=63072000" always;

    # OCSP stapling
    ssl_stapling on;
    ssl_stapling_verify on;

    # verify chain of trust of OCSP response using Root CA and Intermediate certs
    ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;

    # replace with the IP address of your resolver
    #resolver 127.0.0.1;

    location / {

        log_not_found on;
        # Replace http://192.168.1.123:8080 with the listening address of the bark server.
        proxy_pass http://192.168.1.123:8080;

        proxy_read_timeout 300;
        proxy_connect_timeout 300;
        proxy_redirect off;

        proxy_set_header Host              $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP         $remote_addr;

    }
}

Use MySQL instead of Bbolt

Just run the server with -dsn=user:pass@tcp(mysql_host)/bark, it will use MySQL instead of file database Bbolt

API V2

Please read API_V2.md.

Other Docs

中文:

Contributing to bark-server

Development environment

This project requires at least the golang 1.12 version to compile and requires Go mod support.

  • Golang 1.16
  • GoLand 2020.3 or other Go IDE
  • Docker(Optional)

Update

Now the push certificate embedded in the program will never expire. You only need to update the program if the push fails due to the expired certificate.

Owner
Feng
iOS Developer from China.
Feng
Comments
  • 与苹果推送服务器传输数据失败【非dock方式自建】

    与苹果推送服务器传输数据失败【非dock方式自建】

    {"code":400,"data":null,"message":"与苹果推送服务器传输数据失败: Post "https://api.push.apple.com/3/device/de48279c61d2dd9bca3b8aaf5d416cf68293cf39b*******e7edded992386015": x509: certificate signed by unknown authority"}

  • 运行后无法访问

    运行后无法访问

    访问http://0.0.0.0:8080/ping 返回以下信息

    {"code":200,"message":"pong","timestamp":1614696249}

    访问http://0.0.0.0:8080 返回以下信息

    Cannot GET /

    1

    app里添加服务器也提示填写的服务器无效,网络链接中断

  • 在现有的nginx下新建 location 通过nginx的默认端口访问报错

    在现有的nginx下新建 location 通过nginx的默认端口访问报错

    {"code":400,"data":null,"message":"找不到 Key 对应的 DeviceToken, 请确保 Key 正确! Key 可在 App 端注册获得。"}

    信息如上 直接打开机器的8080端口没问题 咋处理呢 已有自带的证书

  • 请教一下服务端的db文件打开密码是什么呢?

    请教一下服务端的db文件打开密码是什么呢?

    我通过 https://github.com/Finb/bark-server/releases 下载了 Linux 的 releases 版本,也运行成功了,我想通过读取 .db 文件的方式添加一些管理功能,请教一下 .db 文件的默认密码是什么呢?我在源代码里面没找到(go 也基本不会😭),谢谢大佬。

  • window服务端部署,运行问题

    window服务端部署,运行问题

    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部署的时候,报异常,不知道为什么?

  • 关于API V2的几点疑问

    关于API V2的几点疑问

    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

  • 关于Post请求

    关于Post请求

    目前的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/
    
  • Problems when using reverse proxy to enable HTTPS

    Problems when using reverse proxy to enable HTTPS

    Hi, I met a problem when deploying by docker and reverse proxy to provide HTTPS support.

    The app returned with an error code 0 when adding by https, but no problem when adding by http.

    Maybe there's something wrong with the configuration of nginx, may you help me fix it? Many thanks. {3713834C-46DB-4213-B804-E78FBCCB5965} png

  • POST请求 body 有限制

    POST请求 body 有限制

    response Status : 500 Internal Server Error response Headers : map[Content-Length:[94] Content-Type:[application/json] Date:[Sun, 20 Mar 2022 07:17:44 GMT] Server:[Bark]] response Body : {"code":500,"message":"push failed: APNS push failed: PayloadTooLarge","timestamp":1647760664}

  • 内容有emoji时发送会返回431

    内容有emoji时发送会返回431

    Hi,我在使用docker自建时,推送内容有emoji文字就会返回下面的信息,需要怎么更改配置? {"code":431,"message":"Request Header Fields Too Large","timestamp":1632886021}

  • 与苹果推送服务器传输数据失败【dock方式自建】

    与苹果推送服务器传输数据失败【dock方式自建】

    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)"

  • [Feature Request] 支持端到端加密

    [Feature Request] 支持端到端加密

    非常感谢作者的 bark 应用,重度使用中。

    我注意到在 https://github.com/Finb/Bark/issues/86 有过类似讨论,不过他没有详细阐述,也并非一定要非对称加密。

    端到端加密可以极大程度地解决传输过程中的信任问题,从原本的信任 [客户端,服务器,传输过程(https),苹果服务器,手机],变成了信任 [客户端,苹果服务器,手机]


  • 写了一个通过docker-comose.yml来自动搭建bark-server环境的工具及详细教程,希望能帮助到需要自己搭建bark-server的朋友

    写了一个通过docker-comose.yml来自动搭建bark-server环境的工具及详细教程,希望能帮助到需要自己搭建bark-server的朋友

    文章:自动转发安卓机短信到iPhone 工具&教程:https://github.com/xiebruce/bark-server-docker

    • 1、自动安装bark-server、nginx、acme.sh容器;
    • 2、已写好nginx转发配置文件,改成自己的域名,直接启用即可;
    • 3、有详细的通过acme.sh申请证书的教程,首次申请证书后,以后都会自动续期。
  • 使用数据库连接时提示如下错误,请问是我的参数吗

    使用数据库连接时提示如下错误,请问是我的参数吗

    如下 2022-10-11 17:51:59 INFO init apns client success... 2022-10-11 17:51:59 INFO load route [register_compat] success... 2022-10-11 17:51:59 INFO load route [misc] success... 2022-10-11 17:51:59 INFO load route [push] success... 2022-10-11 17:51:59 INFO load route [register] success... 2022-10-11 17:51:59 INFO load route [push_compat] success... 2022-10-11 17:51:59 FATAL failed to open database connection (bark-server:[email protected]/bark-server): default addr for network '127.0.0.1' unknown github.com/finb/bark-server/v2/database.NewMySQL github.com/finb/bark-server/v2/database/mysql.go:30 main.main.func1 github.com/finb/bark-server/v2/main.go:180 github.com/urfave/cli/v2.(*App).RunContext github.com/urfave/cli/[email protected]/app.go:386 github.com/urfave/cli/v2.(*App).Run github.com/urfave/cli/[email protected]/app.go:251 main.main github.com/finb/bark-server/v2/main.go:207 runtime.main runtime/proc.go:250

cisasntyi: check iphone stock and send notification to your iphone

for buy iphone 13 notification cisasntyi: check iphone stock and send notification to your iphone install Bark app in your iphone first before you run

Aug 3, 2022
May 11, 2023
The Xiaomi message push service is a system-level channel on MIUI and is universal across the platform, which can provide developers with stable, reliable, and efficient push services.

Go-Push-API MiPush、JiPush、UMeng MiPush The Xiaomi message push service is a system-level channel on MIUI and is universal across the platform, which c

Oct 20, 2022
ntfy is a super simple pub-sub notification service. It allows you to send desktop notifications via scripts.

ntfy ntfy (pronounce: notify) is a super simple pub-sub notification service. It allows you to send desktop and (soon) phone notifications via scripts

Jan 9, 2023
Github-notifications - Small script to alert me when I have notifications on Github. I use it in my Polybar conf

Github notification polybar widget This tool is meant to be used with Polybar, in order to let the user know when they have notifications on Github. R

Jan 26, 2022
Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.

Homepage Download Blog/News @uniqush Introduction Uniqush (\ˈyü-nə-ku̇sh\ "uni" pronounced as in "unified", and "qush" pronounced as in "cushion") is

Jan 9, 2023
A simple microservice which accepts incoming notifications
A simple microservice which accepts incoming notifications

Notifier A simple microservice which accepts incoming notifications, and questions and redirects them to notification sinks such as Telegram, Email et

May 21, 2022
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.

Beaver A Real Time Messaging Server. Beaver is a real-time messaging server. With beaver you can easily build scalable in-app notifications, realtime

Jan 1, 2023
Golang tool to send notifications to LINE app
Golang tool to send notifications to LINE app

Golang tool to send notifications to LINE app

Nov 9, 2022
Golang push server cluster
Golang push server cluster

gopush-cluster gopush-cluster is a go push server cluster. Features light weight high performance pure golang implementation message expired offline m

Dec 28, 2022
A push notification server written in Go (Golang).
A push notification server written in Go (Golang).

gorush A push notification micro server using Gin framework written in Go (Golang) and see the demo app. Contents gorush Contents Support Platform Fea

Jan 8, 2023
Simple push notification system (android/fcm, apns/slideshow) written by Golang

Golang Push Notification Simple system push notification for android/fcm and apn

Dec 20, 2021
Sending line notifications using a binary, docker or Drone CI.
Sending line notifications using a binary, docker or Drone CI.

drone-line Sending line notifications using a binary, docker or Drone CI. Register Line BOT API Trial Please refer to LINE Business Center. Feature Se

Sep 27, 2022
Package notify provides an implementation of the Gnome DBus Notifications Specification.

go-notify Package notify provides an implementation of the Gnome DBus Notifications Specification. Examples Display a simple notification. ntf := noti

Dec 27, 2022
A dead simple Go library for sending notifications to various messaging services.
A dead simple Go library for sending notifications to various messaging services.

A dead simple Go library for sending notifications to various messaging services. About Notify arose from my own need for one of my api server running

Jan 7, 2023
Send slack notifications using Github action

Slack notification This is a simple Slack notification action which runs using a Bot token. Example Action A simple example on how to use this action:

Aug 9, 2021
An opinionated package that helps you print user-friendly output messages from your Go command line applications.

github.com/eth-p/clout (Command Line Output) clout is a package that helps you print user-friendly output messages from your Go command line applicati

Jan 15, 2022
stratus is a cross-cloud identity broker that allows workloads with an identity issued by one cloud provider to exchange this identity for a workload identity issued by another cloud provider.
stratus is a cross-cloud identity broker that allows workloads with an identity issued by one cloud provider to exchange this identity for a workload identity issued by another cloud provider.

stratus stratus is a cross-cloud identity broker that allows workloads with an identity issued by one cloud provider to exchange this identity for a w

Dec 26, 2021
Putcallback: a program which handles callback from Put.io

putcallback putcallback is a program which handles callback from Put.io. It will

Nov 18, 2022