Add ntfy push notifications to deploy script, including bootstrap URL
This commit is contained in:
1 parent
f4b8e6dda3
commit
7e6b45d6a1
1 file changed
+30
-1
+30
-1
@@ -21,6 +21,22 @@ INFRA_SERVICES=("caddy")
|
||||
ACTIVE_SERVICES=()
|
||||
SKIPPED_SERVICES=()
|
||||
|
||||
NTFY_URL="https://ntfy.orfel.de/Jannik-Cloud-Deploy-Trigger"
|
||||
|
||||
# Send a push notification via ntfy (non-blocking, fails silently)
|
||||
notify() {
|
||||
local title="$1"
|
||||
local message="$2"
|
||||
local priority="${3:-default}"
|
||||
local tags="${4:-}"
|
||||
curl -s -o /dev/null -w "" \
|
||||
-H "Title: ${title}" \
|
||||
-H "Priority: ${priority}" \
|
||||
-H "Tags: ${tags}" \
|
||||
-d "${message}" \
|
||||
"${NTFY_URL}" 2>/dev/null || true
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Helpers
|
||||
###############################################################################
|
||||
@@ -31,6 +47,7 @@ die() { err "$@"; exit 1; }
|
||||
|
||||
on_deploy_failure() {
|
||||
err "Deployment GEFEHLT. Prüfe die Server-Logs."
|
||||
notify "PaperClip Deploy FEHLGESCHLAGEN" "Deployment von PaperClip ist fehlgeschlagen. Prüfe die Server-Logs." "urgent" "x,rotating_light"
|
||||
disable_maintenance_mode 2>/dev/null || true
|
||||
}
|
||||
|
||||
@@ -366,6 +383,8 @@ main() {
|
||||
|
||||
trap on_deploy_failure ERR
|
||||
|
||||
notify "PaperClip Deploy Start" "Deploy-Skript gestartet. System wird überprüft..." "default" "gear"
|
||||
|
||||
install_packages
|
||||
configure_system
|
||||
handle_age_key
|
||||
@@ -389,12 +408,22 @@ main() {
|
||||
log "========================================================="
|
||||
log " PAPERCLIP BOOTSTRAP INVITE URL:"
|
||||
log "========================================================="
|
||||
docker exec paperclip_app npx paperclipai auth bootstrap-ceo || warn "Failed to generate bootstrap URL. Check container logs."
|
||||
local bootstrap_url
|
||||
bootstrap_url=$(docker exec paperclip_app npx paperclipai auth bootstrap-ceo 2>/dev/null || echo "")
|
||||
|
||||
if [[ -n "${bootstrap_url}" ]]; then
|
||||
echo "${bootstrap_url}"
|
||||
notify "PaperClip Setup" "Paperclip wartet auf den Admin! Klicke hier, um dich einzurichten:\n\n${bootstrap_url}" "high" "paperclip,sparkles"
|
||||
else
|
||||
warn "Failed to generate bootstrap URL. Check container logs."
|
||||
notify "PaperClip Setup Fehler" "Konnte die Bootstrap-URL nicht generieren. Paperclip läuft ggf. noch nicht." "high" "warning"
|
||||
fi
|
||||
log "========================================================="
|
||||
fi
|
||||
|
||||
trap - ERR
|
||||
log "Deployment complete! Active services: ${ACTIVE_SERVICES[*]}"
|
||||
notify "PaperClip Deploy ERFOLGREICH" "Deployment abgeschlossen! Services: ${ACTIVE_SERVICES[*]}" "default" "white_check_mark"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in new issue
Block a user