Skip to content

Commit dba9a6e

Browse files
Merge pull request #1 from adams549659584/my-markdown-web
feat: add markdown web
2 parents 1eec16f + 9d43352 commit dba9a6e

File tree

20 files changed

+506
-36
lines changed

20 files changed

+506
-36
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ jobs:
3838
linux/arm64
3939
linux/amd64
4040
tags: |
41-
finab/bark-server:latest
42-
finab/bark-server:${{ steps.vars.outputs.build_version }}
41+
adams549659584/bark-server:latest
42+
adams549659584/bark-server:${{ steps.vars.outputs.build_version }}
4343
push: true
4444
-
4545
name: Image digest

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// 使用 IntelliSense 了解相关属性。
3+
// 悬停以查看现有属性的描述。
4+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "bark-server 调试",
9+
"type": "go",
10+
"request": "launch",
11+
"mode": "auto",
12+
"program": "${workspaceFolder}"
13+
}
14+
]
15+
}

README.md

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,56 @@
22

33
<img src="https://wx3.sinaimg.cn/mw690/0060lm7Tly1g0nfnjjxbbj30sg0sg757.jpg" width=200px height=200px />
44

5-
[Bark](https://github.com/Finb/Bark) is an iOS App which allows you to push customed notifications to your iPhone.
6-
7-
8-
## Table of Contents
9-
10-
* [Bark](#bark)
11-
* [Installation](#installation)
12-
* [For Docker User](#for-docker-user)
13-
* [For General User](#for-general-user)
14-
* [For Developer](#for-developer)
15-
* [Nginx Proxy](#nginx-proxy)
16-
* [API V2](#api-v2)
17-
* [Other Docs](#other-docs)
18-
* [中文:](#中文)
19-
* [Contributing to bark-server](#contributing-to-bark-server)
20-
* [Development environment](#development-environment)
21-
* [Update](#update)
5+
这是个人修改版,支持 markdown 推送,适用于私有服务器搭建,原版请查看 [https://github.com/Finb/Bark](https://github.com/Finb/Bark)
6+
7+
8+
## Push
9+
10+
| Field | Type | Description |
11+
| ----- | ---- | ----------- |
12+
| title | string | Notification title (font size would be larger than the body) |
13+
| body | string | Notification content |
14+
| category | string | Reserved field, no use yet |
15+
| device_key | string | The key for each device |
16+
| level (optional) | string | `'active'`, `'timeSensitive'`, or `'passive'` |
17+
| badge (optional) | integer | The number displayed next to App icon ([Apple Developer](https://developer.apple.com/documentation/usernotifications/unnotificationcontent/1649864-badge)) |
18+
| automaticallyCopy (optional) | string | Must be `1` |
19+
| copy (optional) | string | The value to be copied |
20+
| sound (optional) | string | Value from [here](https://github.com/Finb/Bark/tree/master/Sounds) |
21+
| icon (optional) | string | An url to the icon, available only on iOS 15 or later |
22+
| group (optional) | string | The group of the notification |
23+
| isArchive (optional) | string | Value must be `1`. Whether or not should be archived by the app |
24+
| url (optional) | string | Url that will jump when click notification |
25+
| **markdown** (optional) | string | will create markdown url and replace url |
26+
27+
### curl
2228

29+
```sh
30+
curl -X "POST" "http://127.0.0.1:8080/push" \
31+
-H 'Content-Type: application/json; charset=utf-8' \
32+
-d $'{
33+
"body": "Test Bark Server",
34+
"device_key": "ynJ5Ft4atkMkWeo2PAvFhF",
35+
"title": "bleem",
36+
"badge": 1,
37+
"category": "category",
38+
"sound": "minuet.caf",
39+
"icon": "https://day.app/assets/images/avatar.jpg",
40+
"group": "test",
41+
"markdown": "# Bark\\n\\n[Bark](https://github.com/Finb/Bark) is an iOS App which allows you to push customed notifications to your iPhone.\\n\\n\\n## Push\\n\\n| Field | Type | Description |\\n| ----- | ---- | ----------- |\\n| title | string | Notification title (font size would be larger than the body) |\\n| body | string | Notification content |\\n| category | string | Reserved field, no use yet |\\n| device_key | string | The key for each device |\\n| level (optional) | string | `\'active\'`, `\'timeSensitive\'`, or `\'passive\'` |\\n| badge (optional) | integer | The number displayed next to App icon ([Apple Developer](https://developer.apple.com/documentation/usernotifications/unnotificationcontent/1649864-badge)) |\\n| automaticallyCopy (optional) | string | Must be `1` |\\n| copy (optional) | string | The value to be copied |\\n| sound (optional) | string | Value from [here](https://github.com/Finb/Bark/tree/master/Sounds) |\\n| icon (optional) | string | An url to the icon, available only on iOS 15 or later |\\n| group (optional) | string | The group of the notification |\\n| isArchive (optional) | string | Value must be `1`. Whether or not should be archived by the app |\\n| url (optional) | string | Url that will jump when click notification |\\n| **markdown** (optional) | string | will create markdown url and replace url |"
42+
}'
43+
```
2344

2445
## Installation
2546

2647
### For Docker User
2748

28-
![Docker Automated build](https://img.shields.io/docker/automated/finab/bark-server.svg) ![Image Size](https://img.shields.io/docker/image-size/finab/bark-server?sort=date) ![License](https://img.shields.io/github/license/finb/bark-server)
49+
![Docker Automated build](https://img.shields.io/docker/automated/adams549659584/bark-server.svg) ![Image Size](https://img.shields.io/docker/image-size/adams549659584/bark-server?sort=date) ![License](https://img.shields.io/github/license/adams549659584/bark-server)
2950

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

3253
``` sh
33-
docker run -dt --name bark -p 8080:8080 -v `pwd`/bark-data:/data finab/bark-server
54+
docker run -dt --name bark -p 8080:8080 -v `pwd`/bark-data:/data adams549659584/bark-server
3455
```
3556

3657
If you use the docker-compose tool, you can copy docker-copose.yaml under this project to any directory and run it:
@@ -43,7 +64,7 @@ docker-compose up -d
4364

4465
### For General User
4566

46-
- 1、Download precompiled binaries from the [releases](https://github.com/Finb/bark-server/releases) page
67+
- 1、Download precompiled binaries from the [releases](https://github.com/adams549659584/bark-server/releases) page
4768
- 2、Add executable permissions to the bark-server binary: `chmod +x bark-server`
4869
- 3、Start bark-server: `./bark-server --addr 0.0.0.0:8080 --data ./bark-data`
4970
- 4、Test the server: `curl localhost:8080/ping`

Taskfile.win.yaml

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
version: '3'
2+
3+
vars:
4+
BUILD_VERSION:
5+
sh: git describe --tags
6+
BUILD_DATE:
7+
sh: wsl date "+%F %T"
8+
COMMIT_ID:
9+
sh: git rev-parse HEAD
10+
11+
tasks:
12+
clean:
13+
cmds:
14+
- wsl rm -rf dist
15+
- wsl mkdir dist
16+
copy-resource:
17+
cmds:
18+
- wsl cp "deploy/*" dist
19+
- wsl cp -r web dist/web
20+
build-tpl:
21+
label: build-{{.TASK}}
22+
cmds:
23+
- |
24+
GOOS={{.GOOS}} GOARCH={{.GOARCH}} GOARM={{.GOARM}} GOMIPS={{.GOMIPS}} GOAMD64={{.GOAMD64}} \
25+
go build -trimpath -o dist/bark-server_{{.TASK}} -ldflags \
26+
"-w -s -X 'main.version={{.BUILD_VERSION}}' -X 'main.buildDate={{.BUILD_DATE}}' -X 'main.commitID={{.COMMIT_ID}}'"
27+
linux_386:
28+
cmds:
29+
- task: build-tpl
30+
vars: {
31+
TASK: "{{.TASK}}",
32+
GOOS: linux,
33+
GOARCH: 386
34+
}
35+
linux_amd64:
36+
cmds:
37+
- task: build-tpl
38+
vars: {
39+
TASK: "{{.TASK}}",
40+
GOOS: linux,
41+
GOARCH: amd64
42+
}
43+
linux_amd64_v2:
44+
cmds:
45+
- task: build-tpl
46+
vars: {
47+
TASK: "{{.TASK}}",
48+
GOOS: linux,
49+
GOARCH: amd64,
50+
GOAMD64: v2
51+
}
52+
linux_amd64_v3:
53+
cmds:
54+
- task: build-tpl
55+
vars: {
56+
TASK: "{{.TASK}}",
57+
GOOS: linux,
58+
GOARCH: amd64,
59+
GOAMD64: v3
60+
}
61+
linux_amd64_v4:
62+
cmds:
63+
- task: build-tpl
64+
vars: {
65+
TASK: "{{.TASK}}",
66+
GOOS: linux,
67+
GOARCH: amd64,
68+
GOAMD64: v4
69+
}
70+
linux_armv5:
71+
cmds:
72+
- task: build-tpl
73+
vars: {
74+
TASK: "{{.TASK}}",
75+
GOOS: linux,
76+
GOARCH: arm,
77+
GOARM: 5
78+
}
79+
linux_armv6:
80+
cmds:
81+
- task: build-tpl
82+
vars: {
83+
TASK: "{{.TASK}}",
84+
GOOS: linux,
85+
GOARCH: arm,
86+
GOARM: 6
87+
}
88+
linux_armv7:
89+
cmds:
90+
- task: build-tpl
91+
vars: {
92+
TASK: "{{.TASK}}",
93+
GOOS: linux,
94+
GOARCH: arm,
95+
GOARM: 7
96+
}
97+
linux_armv8:
98+
cmds:
99+
- task: build-tpl
100+
vars: {
101+
TASK: "{{.TASK}}",
102+
GOOS: linux,
103+
GOARCH: arm64
104+
}
105+
linux_mips_hardfloat:
106+
cmds:
107+
- task: build-tpl
108+
vars: {
109+
TASK: "{{.TASK}}",
110+
GOOS: linux,
111+
GOARCH: mips,
112+
GOMIPS: hardfloat
113+
}
114+
linux_mipsle_softfloat:
115+
cmds:
116+
- task: build-tpl
117+
vars: {
118+
TASK: "{{.TASK}}",
119+
GOOS: linux,
120+
GOARCH: mipsle,
121+
GOMIPS: softfloat
122+
}
123+
linux_mipsle_hardfloat:
124+
cmds:
125+
- task: build-tpl
126+
vars: {
127+
TASK: "{{.TASK}}",
128+
GOOS: linux,
129+
GOARCH: mipsle,
130+
GOMIPS: hardfloat
131+
}
132+
linux_mips64:
133+
cmds:
134+
- task: build-tpl
135+
vars: {
136+
TASK: "{{.TASK}}",
137+
GOOS: linux,
138+
GOARCH: mips64
139+
}
140+
linux_mips64le:
141+
cmds:
142+
- task: build-tpl
143+
vars: {
144+
TASK: "{{.TASK}}",
145+
GOOS: linux,
146+
GOARCH: mips64le
147+
}
148+
windows_386.exe:
149+
cmds:
150+
- task: build-tpl
151+
vars: {
152+
TASK: "{{.TASK}}",
153+
GOOS: windows,
154+
GOARCH: 386
155+
}
156+
windows_amd64.exe:
157+
cmds:
158+
- task: build-tpl
159+
vars: {
160+
TASK: "{{.TASK}}",
161+
GOOS: windows,
162+
GOARCH: amd64
163+
}
164+
windows_amd64_v2.exe:
165+
cmds:
166+
- task: build-tpl
167+
vars: {
168+
TASK: "{{.TASK}}",
169+
GOOS: windows,
170+
GOARCH: amd64,
171+
GOAMD64: v2
172+
}
173+
windows_amd64_v3.exe:
174+
cmds:
175+
- task: build-tpl
176+
vars: {
177+
TASK: "{{.TASK}}",
178+
GOOS: windows,
179+
GOARCH: amd64,
180+
GOAMD64: v3
181+
}
182+
windows_amd64_v4.exe:
183+
cmds:
184+
- task: build-tpl
185+
vars: {
186+
TASK: "{{.TASK}}",
187+
GOOS: windows,
188+
GOARCH: amd64,
189+
GOAMD64: v4
190+
}
191+
docker:
192+
cmds:
193+
- docker build -t adams549659584/bark-server:{{.BUILD_VERSION}} -f deploy/Dockerfile .
194+
- docker tag adams549659584/bark-server:{{.BUILD_VERSION}} adams549659584/bark-server
195+
docker-buildx:
196+
vars:
197+
PLATFORM: linux/amd64,linux/arm/v7,linux/arm64
198+
cmds:
199+
- docker run -dt --name dind -v {{.DOCKER_SOCK}}:/var/run/docker.sock -v $(pwd):/bark-server docker
200+
- defer: docker rm -f dind
201+
#- docker exec -w /bark-server -it dind docker run --privileged --rm tonistiigi/binfmt --install all
202+
- docker exec -w /bark-server -it dind docker buildx create --name builder --driver docker-container --bootstrap --use
203+
- docker exec -w /bark-server -it dind docker buildx build --platform {{.PLATFORM}} -t adams549659584/bark-server:{{.BUILD_VERSION}} -f deploy/Dockerfile --push .
204+
default:
205+
cmds:
206+
- task: clean
207+
- task: copy-resource
208+
- task: linux_386
209+
- task: linux_amd64
210+
- task: linux_amd64_v2
211+
- task: linux_amd64_v3
212+
- task: linux_amd64_v4
213+
- task: linux_armv5
214+
- task: linux_armv6
215+
- task: linux_armv7
216+
- task: linux_armv8
217+
- task: linux_mips_hardfloat
218+
- task: linux_mipsle_softfloat
219+
- task: linux_mipsle_hardfloat
220+
- task: linux_mips64
221+
- task: linux_mips64le
222+
- task: windows_386.exe
223+
- task: windows_amd64.exe
224+
- task: windows_amd64_v2.exe
225+
- task: windows_amd64_v3.exe
226+
- task: windows_amd64_v4.exe
227+
release:
228+
cmds:
229+
- task: default
230+
- ghr -u adams549659584 -t $GITHUB_TOKEN -replace -recreate -name "Bump {{.BUILD_VERSION}}" --debug {{.BUILD_VERSION}} dist
231+
232+
# depends on wsl, ghr(https://github.com/tcnksm/ghr/releases)
233+
# task -t Taskfile.win.yaml release

Taskfile.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ tasks:
1616
copy-resource:
1717
cmds:
1818
- cp deploy/* dist
19+
- cp -r web dist/web
1920
build-tpl:
2021
label: build-{{.TASK}}
2122
cmds:
@@ -189,8 +190,8 @@ tasks:
189190
}
190191
docker:
191192
cmds:
192-
- docker build -t finab/bark-server:{{.BUILD_VERSION}} -f deploy/Dockerfile .
193-
- docker tag finab/bark-server:{{.BUILD_VERSION}} finab/bark-server
193+
- docker build -t adams549659584/bark-server:{{.BUILD_VERSION}} -f deploy/Dockerfile .
194+
- docker tag adams549659584/bark-server:{{.BUILD_VERSION}} adams549659584/bark-server
194195
docker-buildx:
195196
vars:
196197
PLATFORM: linux/amd64,linux/arm/v7,linux/arm64
@@ -199,7 +200,7 @@ tasks:
199200
- defer: docker rm -f dind
200201
#- docker exec -w /bark-server -it dind docker run --privileged --rm tonistiigi/binfmt --install all
201202
- docker exec -w /bark-server -it dind docker buildx create --name builder --driver docker-container --bootstrap --use
202-
- docker exec -w /bark-server -it dind docker buildx build --platform {{.PLATFORM}} -t finab/bark-server:{{.BUILD_VERSION}} -f deploy/Dockerfile --push .
203+
- docker exec -w /bark-server -it dind docker buildx build --platform {{.PLATFORM}} -t adams549659584/bark-server:{{.BUILD_VERSION}} -f deploy/Dockerfile --push .
203204
default:
204205
cmds:
205206
- task: clean
@@ -226,4 +227,4 @@ tasks:
226227
release:
227228
cmds:
228229
- task: default
229-
- ghr -u finb -t $GITHUB_TOKEN -replace -recreate -name "Bump {{.BUILD_VERSION}}" --debug {{.BUILD_VERSION}} dist
230+
- ghr -u adams549659584 -t $GITHUB_TOKEN -replace -recreate -name "Bump {{.BUILD_VERSION}}" --debug {{.BUILD_VERSION}} dist

0 commit comments

Comments
 (0)