From 7e6b45d6a1446be19d05b3bfe9699d082613ddcc Mon Sep 17 00:00:00 2001 From: orfelorfel23 Date: Thu, 1 Oct 2026 17:46:57 +0200 Subject: [PATCH] Add ntfy push notifications to deploy script, including bootstrap URL --- deploy_script.sh | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/deploy_script.sh b/deploy_script.sh index 85f95ff..0d6e6fd 100644 --- a/deploy_script.sh +++ b/deploy_script.sh @@ -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 "$@"