Skip to content

Commit 0b5f42a

Browse files
committed
Bark Server: keep data in the app dir and preserve it on update
Agent: pi (deepseek/deepseek-flash)
1 parent cd2b69c commit 0b5f42a

3 files changed

Lines changed: 7 additions & 12 deletions

File tree

‎ct/bark-server.sh‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ function update_script() {
3737
systemctl stop bark-server
3838
msg_ok "Stopped Bark Server"
3939

40+
create_backup /opt/bark-server/bark.db
41+
4042
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "bark-server" "Finb/bark-server" "singlefile" "latest" "/opt/bark-server" "bark-server_linux_$(arch_resolve "amd64" "armv8")"
4143

44+
restore_backup
45+
4246
msg_info "Starting Bark Server"
4347
systemctl start bark-server
4448
msg_ok "Started Bark Server"

‎install/bark-server-install.sh‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ update_os
1616
fetch_and_deploy_gh_release "bark-server" "Finb/bark-server" "singlefile" "latest" "/opt/bark-server" "bark-server_linux_$(arch_resolve "amd64" "armv8")"
1717

1818
msg_info "Creating Service"
19-
mkdir -p /opt/bark-server_data
2019
cat <<EOF >/etc/systemd/system/bark-server.service
2120
[Unit]
2221
Description=Bark Server
@@ -27,7 +26,7 @@ Type=simple
2726
User=root
2827
WorkingDirectory=/opt/bark-server
2928
Environment=BARK_SERVER_ADDRESS=0.0.0.0:8080
30-
Environment=BARK_SERVER_DATA_DIR=/opt/bark-server_data
29+
Environment=BARK_SERVER_DATA_DIR=/opt/bark-server
3130
ExecStart=/opt/bark-server/bark-server
3231
Restart=on-failure
3332
RestartSec=5

‎json/bark-server.json‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,11 @@
3333
},
3434
"notes": [
3535
{
36-
"text": "Bark Server has no authentication by default: anyone who can reach port 8080 can register a device key and send pushes. Keep it on a private network or behind an auth-protected reverse proxy, and set BARK_SERVER_BASIC_AUTH_USER / BARK_SERVER_BASIC_AUTH_PASSWORD to enable HTTP Basic auth.",
36+
"text": "Bark Server has no authentication by default, set BARK_SERVER_BASIC_AUTH_USER / BARK_SERVER_BASIC_AUTH_PASSWORD to enable HTTP Basic auth.",
3737
"type": "warning"
3838
},
3939
{
40-
"text": "The container needs outbound access to Apple's push service (api.push.apple.com:443).",
41-
"type": "info"
42-
},
43-
{
44-
"text": "Device keys are stored in /opt/bark-server_data, outside the application directory, so they survive updates. Include it in your backups.",
45-
"type": "info"
46-
},
47-
{
48-
"text": "Verify the server with: curl http://<IP>:8080/ping — it returns {\"code\":200,\"message\":\"pong\"}. The web UI itself lives in the Bark iOS app, which is pointed at this URL.",
40+
"text": "Verify the server with: curl http://<IP>:8080/ping — it returns {\"code\":200,\"message\":\"pong\"}.",
4941
"type": "info"
5042
}
5143
]

0 commit comments

Comments
 (0)