2024-01-15 11:41:24 -05:00
|
|
|
#!/usr/bin/env bash
|
2026-08-18 12:38:22 +02:00
|
|
|
_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")
|
2026-01-06 13:28:12 +01:00
|
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
2025-09-25 11:06:39 +02:00
|
|
|
# Author: CrazyWolf13
|
2024-12-16 12:42:51 +01:00
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
|
|
|
# Source: https://ntfy.sh/
|
2024-01-15 11:41:24 -05:00
|
|
|
|
|
|
|
|
APP="ntfy"
|
2025-04-10 11:56:52 +02:00
|
|
|
var_tags="${var_tags:-notification}"
|
|
|
|
|
var_cpu="${var_cpu:-1}"
|
2026-06-12 00:16:15 +10:00
|
|
|
var_arm64="${var_arm64:-yes}"
|
2025-04-10 11:56:52 +02:00
|
|
|
var_unprivileged="${var_unprivileged:-1}"
|
2026-08-18 12:38:22 +02:00
|
|
|
if [[ -z "${var_os:-}" ]] && command -v pveversion >/dev/null 2>&1; then
|
|
|
|
|
var_os=$(msg_menu "Choose the container OS" \
|
|
|
|
|
"debian" "Debian 13" \
|
|
|
|
|
"alpine" "Alpine (smaller footprint)")
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ "${var_os:-}" == "alpine" ]]; then
|
|
|
|
|
var_ram="${var_ram:-256}"
|
|
|
|
|
var_disk="${var_disk:-2}"
|
|
|
|
|
var_version="${var_version:-3.24}"
|
|
|
|
|
else
|
|
|
|
|
var_ram="${var_ram:-512}"
|
|
|
|
|
var_disk="${var_disk:-2}"
|
|
|
|
|
var_version="${var_version:-13}"
|
|
|
|
|
fi
|
2024-12-16 12:42:51 +01:00
|
|
|
|
|
|
|
|
header_info "$APP"
|
2024-01-15 11:41:24 -05:00
|
|
|
variables
|
|
|
|
|
color
|
|
|
|
|
catch_errors
|
|
|
|
|
|
2026-08-18 12:38:22 +02:00
|
|
|
update_deb_based() {
|
2025-10-30 09:24:16 -07:00
|
|
|
if [[ ! -d /etc/ntfy ]]; then
|
|
|
|
|
msg_error "No ${APP} Installation Found!"
|
|
|
|
|
exit
|
|
|
|
|
fi
|
2025-09-25 11:06:39 +02:00
|
|
|
|
2025-10-30 09:24:16 -07:00
|
|
|
if [ -f /etc/apt/keyrings/archive.heckel.io.gpg ]; then
|
|
|
|
|
msg_info "Correcting old Ntfy Repository"
|
|
|
|
|
rm -f /etc/apt/keyrings/archive.heckel.io.gpg
|
|
|
|
|
rm -f /etc/apt/sources.list.d/archive.heckel.io.list
|
|
|
|
|
rm -f /etc/apt/sources.list.d/archive.heckel.io.list.bak
|
|
|
|
|
rm -f /etc/apt/sources.list.d/archive.heckel.io.sources
|
2025-12-25 15:21:20 +01:00
|
|
|
setup_deb822_repo \
|
|
|
|
|
"ntfy" \
|
|
|
|
|
"https://archive.ntfy.sh/apt/keyring.gpg" \
|
|
|
|
|
"https://archive.ntfy.sh/apt/" \
|
|
|
|
|
"stable"
|
2025-10-30 09:24:16 -07:00
|
|
|
msg_ok "Corrected old Ntfy Repository"
|
|
|
|
|
fi
|
|
|
|
|
|
2025-12-25 15:21:20 +01:00
|
|
|
msg_info "Updating ntfy"
|
2026-09-24 08:06:49 +02:00
|
|
|
apt_update_safe
|
2025-12-25 15:21:20 +01:00
|
|
|
$STD apt upgrade -y
|
|
|
|
|
msg_ok "Updated ntfy"
|
2025-10-30 09:24:16 -07:00
|
|
|
msg_ok "Updated successfully!"
|
2026-08-18 12:38:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
update_alpine() {
|
|
|
|
|
if [[ ! -d /etc/ntfy ]]; then
|
|
|
|
|
msg_error "No ${APP} Installation Found!"
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
msg_info "Updating ntfy LXC"
|
|
|
|
|
$STD apk -U upgrade
|
|
|
|
|
setcap 'cap_net_bind_service=+ep' /usr/bin/ntfy
|
|
|
|
|
msg_ok "Updated ntfy LXC"
|
|
|
|
|
|
|
|
|
|
msg_info "Restarting ntfy"
|
|
|
|
|
rc-service ntfy restart
|
|
|
|
|
msg_ok "Restarted ntfy"
|
|
|
|
|
msg_ok "Updated successfully!"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function update_script() {
|
|
|
|
|
header_info
|
|
|
|
|
check_container_storage
|
|
|
|
|
check_container_resources
|
|
|
|
|
run_os_update
|
2024-01-15 11:41:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
start
|
|
|
|
|
build_container
|
|
|
|
|
description
|
|
|
|
|
|
2026-01-06 22:57:40 +01:00
|
|
|
msg_ok "Completed successfully!\n"
|
2024-12-16 12:42:51 +01:00
|
|
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
2026-06-03 11:03:13 +02:00
|
|
|
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
|
|
|
|
|
echo -e "${GATEWAY}${BGN}http://${IP}${CL}"
|