diff --git a/ct/bark-server.sh b/ct/bark-server.sh new file mode 100644 index 0000000000..e9e75efdf6 --- /dev/null +++ b/ct/bark-server.sh @@ -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}" diff --git a/install/bark-server-install.sh b/install/bark-server-install.sh new file mode 100644 index 0000000000..1b9003f70e --- /dev/null +++ b/install/bark-server-install.sh @@ -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 </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 diff --git a/json/bark-server.json b/json/bark-server.json new file mode 100644 index 0000000000..4f772ccf30 --- /dev/null +++ b/json/bark-server.json @@ -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" + }, + { + "text": "Device keys are stored in /opt/bark-server_data, outside the application directory, so they survive updates. Include it in your backups.", + "type": "info" + }, + { + "text": "Verify the server with: curl http://:8080/ping — it returns {\"code\":200,\"message\":\"pong\"}. The web UI itself lives in the Bark iOS app, which is pointed at this URL.", + "type": "info" + } + ] +}