.
This commit is contained in:
@@ -74,6 +74,7 @@ NTFY_ENABLED=true
|
|||||||
NTFY_TITLE="Docker Update ($(hostname))"
|
NTFY_TITLE="Docker Update ($(hostname))"
|
||||||
NTFY_TOKEN="DEIN_TOKEN"
|
NTFY_TOKEN="DEIN_TOKEN"
|
||||||
NTFY_URL="https://ntfy.example.com/topic"
|
NTFY_URL="https://ntfy.example.com/topic"
|
||||||
|
NTFY_IMAGE_URL="http://dein-server/host-icon.png"
|
||||||
NTFY_TAGS="docker,update"
|
NTFY_TAGS="docker,update"
|
||||||
NTFY_ONLY_ON_CHANGES=false
|
NTFY_ONLY_ON_CHANGES=false
|
||||||
# Versions Nr. anzeigen (true/false)
|
# Versions Nr. anzeigen (true/false)
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ NTFY_ENABLED=true
|
|||||||
NTFY_TITLE="Docker Update ($(hostname))"
|
NTFY_TITLE="Docker Update ($(hostname))"
|
||||||
NTFY_TOKEN="DEIN_TOKEN"
|
NTFY_TOKEN="DEIN_TOKEN"
|
||||||
NTFY_URL="https://ntfy.example.com/topic"
|
NTFY_URL="https://ntfy.example.com/topic"
|
||||||
|
NTFY_IMAGE_URL="http://dein-server/host-icon.png"
|
||||||
NTFY_TAGS="docker,update"
|
NTFY_TAGS="docker,update"
|
||||||
NTFY_ONLY_ON_CHANGES=false
|
NTFY_ONLY_ON_CHANGES=false
|
||||||
# Versions Nr. anzeigen (true/false)
|
# Versions Nr. anzeigen (true/false)
|
||||||
|
|||||||
87
config.conf_
Normal file
87
config.conf_
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
# =============================
|
||||||
|
# =============================
|
||||||
|
# Pfade
|
||||||
|
# =============================
|
||||||
|
|
||||||
|
# Pfad zu deinen Compose-Files
|
||||||
|
COMPOSE_DIR="/pfad/zu/deinen/stacks"
|
||||||
|
# Logging
|
||||||
|
LOG_FILE="/pfad/zum/log/update.log"
|
||||||
|
LOG_LEVEL="INFO" # DEBUG=sehr detailliert, INFO=Standard, WARN=nur wichtige Hinweise/Updates, ERROR=nur Fehler
|
||||||
|
|
||||||
|
# Dateimuster
|
||||||
|
COMPOSE_PATTERN="docker-compose.yml"
|
||||||
|
|
||||||
|
# =============================
|
||||||
|
# =============================
|
||||||
|
# Allgemein Einstellungen
|
||||||
|
# =============================
|
||||||
|
|
||||||
|
# Verhalten bei gestoppten Containern
|
||||||
|
UPDATE_STOPPED=true # Image aktualisieren
|
||||||
|
START_STOPPED=false # danach NICHT starten
|
||||||
|
|
||||||
|
# Dry Run (true/false)
|
||||||
|
DRY_RUN=false
|
||||||
|
|
||||||
|
# =============================
|
||||||
|
# =============================
|
||||||
|
# Exclude
|
||||||
|
# =============================
|
||||||
|
|
||||||
|
# Exclude Container
|
||||||
|
EXCLUDE_SERVICES=(
|
||||||
|
"example_container_1"
|
||||||
|
"example_container_2"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Exclude Stack
|
||||||
|
EXCLUDE_STACKS=(
|
||||||
|
"example_stack_1"
|
||||||
|
"example_stack_2"
|
||||||
|
)
|
||||||
|
|
||||||
|
# =============================
|
||||||
|
# =============================
|
||||||
|
# NTFY
|
||||||
|
# =============================
|
||||||
|
NTFY_ENABLED=true
|
||||||
|
NTFY_TITLE="Docker Update ($(hostname))"
|
||||||
|
NTFY_TOKEN="DEIN_TOKEN"
|
||||||
|
NTFY_URL="https://ntfy.example.com/topic"
|
||||||
|
NTFY_IMAGE_URL="http://dein-server/composeupdater.png"
|
||||||
|
NTFY_TAGS="docker,update"
|
||||||
|
NTFY_ONLY_ON_CHANGES=false
|
||||||
|
# Versions Nr. anzeigen (true/false)
|
||||||
|
SHOW_VERSIONS=true
|
||||||
|
|
||||||
|
# =============================
|
||||||
|
# =============================
|
||||||
|
# Docker Cleanup
|
||||||
|
# =============================
|
||||||
|
|
||||||
|
ENABLE_CLEANUP=true
|
||||||
|
CLEANUP_ONLY_ON_UPDATE=true
|
||||||
|
|
||||||
|
# Images:
|
||||||
|
# 🟢 dangling → docker image prune (nur <none> Images)
|
||||||
|
# 🟢 unused → docker image prune -a (alle ungenutzten Images)
|
||||||
|
CLEANUP_IMAGES=true
|
||||||
|
CLEANUP_IMAGES_MODE="unused" # dangling | unused
|
||||||
|
|
||||||
|
# Container:
|
||||||
|
# entfernt gestoppte Container
|
||||||
|
# 🟢 docker container prune
|
||||||
|
CLEANUP_CONTAINERS=true
|
||||||
|
|
||||||
|
# Volume:
|
||||||
|
# entfernt ungenutzte Volumes
|
||||||
|
# ⚠️ kann Daten löschen
|
||||||
|
CLEANUP_VOLUMES=false
|
||||||
|
|
||||||
|
# Networks:
|
||||||
|
# entfernt ungenutzte Netzwerke
|
||||||
|
# 🟢 meist unkritisch
|
||||||
|
CLEANUP_NETWORKS=true
|
||||||
|
|
||||||
|
# =============================
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
BASE_DIR="$(dirname "$0")"
|
BASE_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
source "$BASE_DIR/config.conf"
|
source "$BASE_DIR/config.conf"
|
||||||
|
|
||||||
mkdir -p "$(dirname "$LOG_FILE")"
|
mkdir -p "$(dirname "$LOG_FILE")"
|
||||||
@@ -120,14 +120,26 @@ run_cmd() {
|
|||||||
send_ntfy() {
|
send_ntfy() {
|
||||||
local msg="$1"
|
local msg="$1"
|
||||||
local prio="$2"
|
local prio="$2"
|
||||||
|
local image_url="${NTFY_IMAGE_URL:-}"
|
||||||
|
|
||||||
curl -s \
|
if [ -n "$image_url" ]; then
|
||||||
-H "Authorization: Bearer $NTFY_TOKEN" \
|
curl -s \
|
||||||
-H "Title: $NTFY_TITLE" \
|
-H "Authorization: Bearer $NTFY_TOKEN" \
|
||||||
-H "Priority: $prio" \
|
-H "Title: $NTFY_TITLE" \
|
||||||
-H "Tags: $NTFY_TAGS" \
|
-H "Priority: $prio" \
|
||||||
-d "$msg" \
|
-H "Tags: $NTFY_TAGS" \
|
||||||
"$NTFY_URL" > /dev/null || true
|
-H "Icon: $image_url" \
|
||||||
|
-d "$msg" \
|
||||||
|
"$NTFY_URL" > /dev/null || true
|
||||||
|
else
|
||||||
|
curl -s \
|
||||||
|
-H "Authorization: Bearer $NTFY_TOKEN" \
|
||||||
|
-H "Title: $NTFY_TITLE" \
|
||||||
|
-H "Priority: $prio" \
|
||||||
|
-H "Tags: $NTFY_TAGS" \
|
||||||
|
-d "$msg" \
|
||||||
|
"$NTFY_URL" > /dev/null || true
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
get_docker_disk_usage() {
|
get_docker_disk_usage() {
|
||||||
|
|||||||
Reference in New Issue
Block a user