Update automations: 3x daily FreshRSS, remove Mia, add Gotify, remove server monitor
- FreshRSS now runs 3x daily: 6:45 AM, 12 PM, 5 PM
- Removed Mia from birthday tracker 💔
- Removed home stack monitor cron jobs (already have monitoring)
- Added Gotify notifications to FreshRSS and birthday tracker
- Both Telegram and Gotify now receive alerts
This commit is contained in:
@@ -11,6 +11,8 @@ LOG_FILE="$SCRIPT_DIR/reminder-log.json"
|
||||
source "$SCRIPT_DIR/../../.env" 2>/dev/null || true
|
||||
|
||||
TELEGRAM_CHAT="${TELEGRAM_CHAT:-1793951355}"
|
||||
GOTIFY_URL="${GOTIFY_URL:-http://runtipi.kangaroo-eel.ts.net:8129}"
|
||||
GOTIFY_TOKEN="${GOTIFY_TOKEN:-AGKnHafW3FGzBlt}"
|
||||
|
||||
log() {
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1"
|
||||
@@ -165,6 +167,24 @@ send_telegram() {
|
||||
}
|
||||
}
|
||||
|
||||
# Send Gotify message
|
||||
send_gotify() {
|
||||
local title="$1"
|
||||
local message="$2"
|
||||
local priority="${3:-5}"
|
||||
|
||||
curl -s -X POST "${GOTIFY_URL}/message?token=${GOTIFY_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"title\": \"$title\",
|
||||
\"message\": \"$message\",
|
||||
\"priority\": $priority
|
||||
}" > /dev/null || {
|
||||
log "ERROR: Failed to send Gotify message"
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
# Generate gift suggestions text
|
||||
gift_suggestions() {
|
||||
local ideas=$(echo "$1" | jq -r '.gift_ideas | join(", ")')
|
||||
@@ -248,6 +268,14 @@ check_birthdays() {
|
||||
if [[ "$should_remind" == true ]]; then
|
||||
log "Sending $reminder_type reminder for $name"
|
||||
send_telegram "$message"
|
||||
|
||||
# Also send to Gotify (strip markdown for cleaner display)
|
||||
local plain_message
|
||||
plain_message=$(echo -e "$message" | sed 's/\*//g')
|
||||
local priority=5
|
||||
[[ "$reminder_type" == "today" ]] && priority=8
|
||||
send_gotify "Birthday: $name" "$plain_message" "$priority"
|
||||
|
||||
log_reminder "$name" "$reminder_type"
|
||||
((reminders_sent++))
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user