bark 自建服务器,GitHub - Finb/bark-server: Backend of Bark

Bark

eded213ad3478dd8ac7193e0736f5fbe.png

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

Table of Contents

Installation

For Docker User

68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f6175746f6d617465642f66696e61622f6261726b2d7365727665722e73766768747470733a2f2f696d672e736869656c64732e696f2f6d6963726f6261646765722f696d6167652d73697a652f66696e61622f6261726b2d7365727665722e73766768747470733a2f2f696d672e736869656c64732e696f2f6d6963726f6261646765722f6c61796572732f66696e61622f6261726b2d7365727665722e737667

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;

}

}

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值