Skip to content

Commit

Permalink
Update to upstream uptime-kuma 1.23.15 and introduce ntfy.sh integration
Browse files Browse the repository at this point in the history
Signed-off-by: Sid Sun <[email protected]>
  • Loading branch information
Sid-Sun committed Oct 5, 2024
1 parent 5b21b00 commit 3c898de
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM louislam/uptime-kuma:1.23.13
FROM louislam/uptime-kuma:1.23.15
USER root

RUN apt update && \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ However, there have been a few changes which (while won't break your setup) you

1. Backup and Restore time rhythm was changed on 18 August 2024. Backups happen every 5 mins and Restores every 6 mins.
2. If you've used replicator-kuma prior to 22 September 2024, your restic version is very outdated and likely created a v1 format repo; the new image comes with new restic version. v1 repos still work with the new binary but you should migrate to v2 by running `restic migrate upgrade_repo_v2`
3. As of release `1.23.15`, replicator-kuma supports notifying via ntfy.sh when backups are created and restores carried out.


### Contributions
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
- AWS_ACCESS_KEY_ID=AKIAJAJSLTZCAZ4SRI5Q
- AWS_SECRET_ACCESS_KEY=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
- RESTIC_PASSWORD=I9n7G7G0ZpDWA3GOcJbIuwQCGvGUBkU5
- NTFY_URL=ntfy.sh/myreplicatorkuma
replica:
container_name: uptime-kuma-replica
image: realsidsun/replicator-kuma:1.23.13
Expand All @@ -29,6 +30,7 @@ services:
- AWS_ACCESS_KEY_ID=AKIAJAJSLTZCAZ4SRI5Q
- AWS_SECRET_ACCESS_KEY=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
- RESTIC_PASSWORD=I9n7G7G0ZpDWA3GOcJbIuwQCGvGUBkU5
- NTFY_URL=ntfy.sh/myreplicatorkuma

volumes:
uptime-kuma-main:
Expand Down
10 changes: 10 additions & 0 deletions replicator-snapshots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ PID=$!

declare -a tables=("monitor" "monitor_tag" "tag" "monitor_notification" "notification" "monitor_group" "group" "status_page" "monitor_maintenance" "maintenance" "maintenance_status_page" "incident")

function notify_backup {
[ -n "$NTFY_URL" ] && curl -d "[$HOSTNAME] Replicator Kuma Backup Successful. Time: $(date)" $NTFY_URL
}

function notify_restore {
[ -n "$NTFY_URL" ] && curl -d "[$HOSTNAME] Replicator Kuma Restored Successfully. Time: $(date)" $NTFY_URL
}

function dump_tables {
echo 'dump_tables'
# remove previous backup (if any)
Expand Down Expand Up @@ -66,6 +74,7 @@ function restic_restore {
start_kuma
# clone latest to local
cp /backup/{latest.json,local.json}
notify_restore
else
echo 'remote and local are in sync'
fi
Expand All @@ -86,6 +95,7 @@ function restic_backup {
then
echo 'running restic backup'
restic backup $LOCAL_PATH
notify_backup
else
echo 'file is the same - skipping backup'
fi
Expand Down

0 comments on commit 3c898de

Please sign in to comment.