new: Added support for ntfy.sh

This commit is contained in:
Sayantan Santra 2023-06-23 19:51:02 -05:00
parent 53c430d75a
commit d72ce0ea51
2 changed files with 21 additions and 0 deletions

View file

@ -277,6 +277,20 @@ if $GOTIFY_NOTIFICATIONS; then
-F "title=⚙⚙⚙ Build Details ⚙⚙⚙" -F "message=$MESSAGE" -F "priority=5"
fi
if $NTFY_NOTIFICATIONS; then
echo "Sending messages to ntfy.sh"
MESSAGE="$msg"$'\n'"Timestamp: $timestamp"
curl -H "Icon: https://upload.wikimedia.org/wikipedia/commons/thumb/4/40/Revanced-logo-round.svg/240px-Revanced-logo-round.svg.png" \
-H "Title: ⚙⚙⚙ ReVanced Build ⚙⚙⚙" \
-d "$MESSAGE" \
"$NTFY_URL/$NTFY_TOPIC"
MESSAGE="An update of microg was published."
[ $microg_updated ] && curl -H "Icon: https://upload.wikimedia.org/wikipedia/commons/thumb/4/40/Revanced-logo-round.svg/240px-Revanced-logo-round.svg.png" \
-H "Title: ⚙⚙⚙ ReVanced Build ⚙⚙⚙" \
-d "$MESSAGE" \
"$NTFY_URL/$NTFY_TOPIC"
fi
# Do some cleanup, keep only the last 3 build's worth of files and a week worth of logs
mkdir -p archive
mv *ReVanced_*_$timestamp.apk archive/

View file

@ -28,3 +28,10 @@ CHANNEL_ADDRESS=""
GOTIFY_NOTIFICATIONS=false
GOTIFY_URL="https://push.example.com"
GOTIFY_TOKEN=""
# Settings for sending ntfy.sh notifications
# In case you decide to use it, please put valid config in the
# URL and TOPIC fields
NTFY_NOTIFICATIONS=false
NTFY_URL="https://ntfy.sh"
NTFY_TOPIC=""