Repository navigation
feat: add Bark-Server LXC script #2432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| #!/usr/bin/env bash | ||
| _CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main" | ||
| _cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" | ||
| source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") | ||
| # Copyright (c) 2021-2026 community-scripts ORG | ||
| # Author: Charlie Smith (chazkii) | ||
| # License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE | ||
| # Source: https://github.com/Finb/bark-server | ||
|
|
||
| APP="Bark-Server" | ||
| var_tags="${var_tags:-notification}" | ||
| var_cpu="${var_cpu:-1}" | ||
| var_ram="${var_ram:-256}" | ||
| var_disk="${var_disk:-2}" | ||
| var_os="${var_os:-debian}" | ||
| var_version="${var_version:-13}" | ||
| #var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified | ||
| var_unprivileged="${var_unprivileged:-1}" | ||
|
|
||
| header_info "$APP" | ||
| variables | ||
| color | ||
| catch_errors | ||
|
|
||
| function update_script() { | ||
| header_info | ||
| check_container_storage | ||
| check_container_resources | ||
|
|
||
| if [[ ! -d /opt/bark-server ]]; then | ||
| msg_error "No Bark Server Installation Found!" | ||
| exit | ||
| fi | ||
|
|
||
| if check_for_gh_release "bark-server" "Finb/bark-server"; then | ||
| msg_info "Stopping Bark Server" | ||
| systemctl stop bark-server | ||
| msg_ok "Stopped Bark Server" | ||
|
|
||
| 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")" | ||
|
|
||
| msg_info "Starting Bark Server" | ||
| systemctl start bark-server | ||
| msg_ok "Started Bark Server" | ||
| msg_ok "Updated successfully!" | ||
| fi | ||
| exit | ||
| } | ||
|
|
||
| start | ||
| build_container | ||
| description | ||
|
|
||
| msg_ok "Completed Successfully!\n" | ||
| echo -e "${CREATING}${GN}Bark Server setup has been successfully initialized!${CL}" | ||
| echo -e "${INFO}${YW}Access it using the following URL:${CL}" | ||
| echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8080/ping${CL}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Copyright (c) 2021-2026 community-scripts ORG | ||
| # Author: Charlie Smith (chazkii) | ||
| # License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE | ||
| # Source: https://github.com/Finb/bark-server | ||
|
|
||
| source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" | ||
| color | ||
| verb_ip6 | ||
| catch_errors | ||
| setting_up_container | ||
| network_check | ||
| update_os | ||
|
|
||
| fetch_and_deploy_gh_release "bark-server" "Finb/bark-server" "singlefile" "latest" "/opt/bark-server" "bark-server_linux_$(arch_resolve "amd64" "armv8")" | ||
|
|
||
| msg_info "Creating Service" | ||
| mkdir -p /opt/bark-server_data | ||
| cat <<EOF >/etc/systemd/system/bark-server.service | ||
| [Unit] | ||
| Description=Bark Server | ||
| After=network.target | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| User=root | ||
| WorkingDirectory=/opt/bark-server | ||
| Environment=BARK_SERVER_ADDRESS=0.0.0.0:8080 | ||
| Environment=BARK_SERVER_DATA_DIR=/opt/bark-server_data | ||
| ExecStart=/opt/bark-server/bark-server | ||
| Restart=on-failure | ||
| RestartSec=5 | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
| EOF | ||
| systemctl enable -q --now bark-server | ||
| msg_ok "Created Service" | ||
|
|
||
| motd_ssh | ||
| customize | ||
| cleanup_lxc |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||||||
| { | ||||||||||
| "name": "Bark Server", | ||||||||||
| "slug": "bark-server", | ||||||||||
| "categories": [ | ||||||||||
| 18 | ||||||||||
| ], | ||||||||||
| "date_created": "2026-10-14", | ||||||||||
| "type": "ct", | ||||||||||
| "updateable": true, | ||||||||||
| "privileged": false, | ||||||||||
| "interface_port": 8080, | ||||||||||
| "documentation": "https://bark.day.app/", | ||||||||||
| "website": "https://bark.day.app/", | ||||||||||
| "repository": "https://github.com/Finb/bark-server", | ||||||||||
| "logo": "https://bark.day.app/logo.png", | ||||||||||
| "description": "Bark Server is the self-hosted backend for the Bark iOS app. It receives push requests over a simple HTTP API and forwards them to Apple's APNs, so scripts and home-automation flows can send custom notifications to your own iPhone. Device keys are stored locally in an embedded key-value database, so no external database is required.", | ||||||||||
| "install_methods": [ | ||||||||||
| { | ||||||||||
| "type": "default", | ||||||||||
| "script": "ct/bark-server.sh", | ||||||||||
| "resources": { | ||||||||||
| "cpu": 1, | ||||||||||
| "ram": 256, | ||||||||||
| "hdd": 2, | ||||||||||
| "os": "Debian", | ||||||||||
| "version": "13" | ||||||||||
| } | ||||||||||
| } | ||||||||||
| ], | ||||||||||
| "default_credentials": { | ||||||||||
| "username": null, | ||||||||||
| "password": null | ||||||||||
| }, | ||||||||||
| "notes": [ | ||||||||||
| { | ||||||||||
| "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.", | ||||||||||
| "type": "warning" | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| "text": "The container needs outbound access to Apple's push service (api.push.apple.com:443).", | ||||||||||
| "type": "info" | ||||||||||
| }, | ||||||||||
|
Comment on lines
+39
to
+42
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
obvious |
||||||||||
| { | ||||||||||
| "text": "Device keys are stored in /opt/bark-server_data, outside the application directory, so they survive updates. Include it in your backups.", | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. store it in the same dir and use create_backup restore_backup instead of a data folder |
||||||||||
| "type": "info" | ||||||||||
| }, | ||||||||||
| { | ||||||||||
| "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.", | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| "type": "info" | ||||||||||
| } | ||||||||||
| ] | ||||||||||
| } | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.