Compare commits

5 Commits

Author SHA1 Message Date
Nick Stokoe
4fddb06060 templates/docker-compose/upmpdcli/ - bump alpine to 3.21 2025-05-28 12:22:32 +01:00
Nick Stokoe
c0b289d2bc templates/docker-compose/proxy/Dockerfile - bump to alpine-0.7 2025-05-28 12:22:32 +01:00
Nick Stokoe
ce18785ccb templates/docker-compose/navidrome/Dockerfile - bump to 55.2 2025-05-28 12:22:32 +01:00
Nick Stokoe
ca24f7dae7 templates/docker-compose/ - update Borgmatics image
It's necessary to update to the `latest` image because the
`latest-msmtp` image is now unmaintained and doesn't support postgres
17.

However, this means we need to adjust things (the backup script and
the environment variable config) because we need to use the latest
notification mechanism, `apprise` instead of msmtp.

Tested, seems to be working.
2025-05-28 12:22:32 +01:00
Nick Stokoe
5ca9ecfe2a templates/docker-compose/borgmatic/ - avoid losing STDERR lines
use stdbuf to change the buffereing mode to be linewise
2025-05-28 12:22:32 +01:00
7 changed files with 24 additions and 22 deletions

View File

@@ -1,2 +1,3 @@
POSTGRES_PASSWORD={{ nextcloud_db_password }} POSTGRES_PASSWORD={{ nextcloud_db_password }}
BORG_PASSPHRASE={{ borg_passphrase }} BORG_PASSPHRASE={{ borg_passphrase }}
SMTP_PASSWORD={{ smtp_password }}

View File

@@ -1,4 +1,11 @@
FROM b3vis/borgmatic:latest-msmtp FROM b3vis/borgmatic:latest
# Install stdbuf, used by backup.sh
RUN \
echo "* Installing Runtime Packages" \
&& apk upgrade --no-cache \
&& echo "* Installing Runtime Packages" \
&& apk add -U --no-cache \
coreutils
COPY --chmod=755 backup.sh /backup.sh COPY --chmod=755 backup.sh /backup.sh

View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# Run the backup and mail the logs: # Run the backup and mail the logs:
# Depending on parameter 1: # Depending on parameter 1:
# - test-smtp: just send a test email to $MAIL_TO # - test-smtp: just send a test email using $APPRISE_URI
# - run: create the backup, no checks # - run: create the backup, no checks
# - check: prune, compact and check the backup # - check: prune, compact and check the backup
# Anything else is an error. # Anything else is an error.
@@ -9,8 +9,6 @@
set -o pipefail set -o pipefail
# Set up environment # Set up environment
/bin/sh /scripts/msmtprc.sh
/bin/sh /scripts/env.sh
RUN_COMMAND="borgmatic --stats -v 2 create" RUN_COMMAND="borgmatic --stats -v 2 create"
CHECK_COMMAND="borgmatic --stats -v 1 prune compact check" CHECK_COMMAND="borgmatic --stats -v 1 prune compact check"
LOGFILE="/tmp/backup_run_$(date +%s).log" LOGFILE="/tmp/backup_run_$(date +%s).log"
@@ -31,7 +29,7 @@ indent() {
log() { log() {
# Adapted from https://stackoverflow.com/a/31151808 # Adapted from https://stackoverflow.com/a/31151808
{ {
"$@" 2>&1 1>&3 3>&- | indent " ! " stdbuf -oL -eL "$@" 2>&1 1>&3 3>&- | indent " ! "
} 3>&1 1>&2 | indent " | " | tee -a "$LOGFILE" } 3>&1 1>&2 | indent " | " | tee -a "$LOGFILE"
} }
@@ -43,14 +41,12 @@ report() {
log echo "FAILED: $RESULT" log echo "FAILED: $RESULT"
PREFIX="$FAILED_PREFIX" PREFIX="$FAILED_PREFIX"
fi fi
printf "Subject: %s: '%s'\n\n%s\n" "$PREFIX" "$PARAM" "$(cat $LOGFILE)" | apprise -vv -t "$PREFIX: '$PARAM'" -b "$(cat $LOGFILE)" "$APPRISE_URI&pass=$SMTP_PASSWORD"
sendmail -t "$MAIL_TO"
log echo "Report sent." log echo "Report sent."
} }
testmail() { testmail() {
echo -e "Subject: TESTING!\n\ntest mail, please ignore\n" | apprise -vv -t "TESTING!" -b "test mail, please ignore." "$APPRISE_URI&pass=$SMTP_PASSWORD"
sendmail -t "$MAIL_TO"
} }
failed() { failed() {
@@ -72,7 +68,7 @@ trap cleanup EXIT
case "$PARAM" in case "$PARAM" in
test-smtp) test-smtp)
echo "Testing mail to $MAIL_TO" echo "Testing mail to via Apprise ($APPRISE_URI)"
testmail testmail
echo "Done." echo "Done."
;; ;;

View File

@@ -260,20 +260,18 @@ services:
- ./volumes/borg-ssh-config:/root/.ssh/ # ssh keys; sshd writes knownhosts etc here - ./volumes/borg-ssh-config:/root/.ssh/ # ssh keys; sshd writes knownhosts etc here
environment: environment:
# Work around the use of a fancy init system s6:
# https://github.com/borgmatic-collective/docker-borgmatic/issues/320#issuecomment-2089003361
S6_KEEP_ENV: 1
POSTGRES_USER: nextcloud POSTGRES_USER: nextcloud
POSTGRES_DB: nextcloud POSTGRES_DB: nextcloud
POSTGRES_HOST: postgres POSTGRES_HOST: postgres
BORG_ARCHIVE: nick BORG_ARCHIVE: nick
BORG_ARCHIVE_LABEL: snackpot BORG_ARCHIVE_LABEL: snackpot
MAIL_RELAY_HOST: mail.noodlefactory.co.uk APPRISE_URI: "mailtos://mail.noodlefactory.co.uk:25?user=nc.noodlefactory.co.uk&from=borgmatic@snackpot.noodlefactory.co.uk&to=nick@noodlefactory.co.uk"
MAIL_PORT: 25 # SMTP_PASSWORD is set via borgmatic.env, created via ansible,
MAIL_AUTH_METHOD: login # and appended to APPRISE_URL by borgmatic/backup.sh script
MAIL_STARTTLS: 'on'
MAIL_USER: nc.noodlefactory.co.uk
MAIL_FROM: borgmatic@snackpot.noodlefactory.co.uk
MAIL_TO: nick@noodlefactory.co.uk
MAIL_SUBJECT: Borgmatic Backup
# MAIL_PASSWORD is set via volumes/borgmatic-config/msmtp.env, created via ansible
# Test SMTP auth on the server https://doc.dovecot.org/admin_manual/debugging/debugging_authentication/ # Test SMTP auth on the server https://doc.dovecot.org/admin_manual/debugging/debugging_authentication/
env_file: env_file:
- ./borgmatic.env - ./borgmatic.env

View File

@@ -1,4 +1,4 @@
FROM deluan/navidrome:0.54.4 FROM deluan/navidrome:0.55.2
RUN apk add --no-cache mpv RUN apk add --no-cache mpv
# Ensure that navidrome has access to these directories # Ensure that navidrome has access to these directories

View File

@@ -1,3 +1,3 @@
FROM jwilder/nginx-proxy:alpine-0.7.0 FROM jwilder/nginx-proxy:1.7-alpine
COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf

View File

@@ -1,4 +1,4 @@
FROM alpine:3.19 FROM alpine:3.21
RUN apk update \ RUN apk update \
&& apk upgrade \ && apk upgrade \