- Automated Backups - Scheduled backups of Docker compose configurations and data
- Easy Restore - Simple restoration from any backup point
- Retention Management - Automatic cleanup of old backups
- Interactive & CLI Modes - Full menu-driven interface or command-line usage
- Automatic Update Detection - Checks Docker registries for new image versions
- Selective Updates - Include/exclude containers, label-based filtering
- Notification System - Multi-channel notifications (Gotify, Discord, Telegram, ntfy, Slack, Email, Apprise)
- Safe Updates - Image backups before updating with configurable retention
- Auto-Prune - Automatic cleanup of dangling images
- Flexible Scheduling - Cron-ready for automated update checks
- Dry-Run Mode - Test updates without making changes
- Clone the repository:
git clone https://github.com/hhftechnology/pangolin-backup-update.git
cd pangolin-backup-update- Make scripts executable:
chmod +x *.sh- Run the interactive menu:
./backup-update-master.sh./backup-update-master.shBackup Operations:
# Create backup
./backup-update-master.sh backup
# Restore from latest backup
./backup-update-master.sh restore
# Delete specific backup
./backup-update-master.sh delete 2Manual Updates:
# Update stack without CrowdSec
./backup-update-master.sh update-basic
# Update stack with CrowdSec
./backup-update-master.sh update-fullAutomated Update Checks:
# Check for available updates
./docker-update-check.sh
# Auto-update all containers
./docker-update-check.sh --auto
# Check and notify only (no updates)
./docker-update-check.sh --notify-only
# Update with backup and prune
./docker-update-check.sh --auto --backup-days 7 --prune
# Exclude specific containers
./docker-update-check.sh --exclude "traefik,crowdsec"
# Include only specific containers
./docker-update-check.sh --include "pangolin,gerbil"
# Update containers with specific label
./docker-update-check.sh --label "auto-update=true" --auto
# Dry run (see what would be updated)
./docker-update-check.sh --dry-run
# Interactive configuration wizard
./docker-update-check.sh --configure
# Test notification setup
./docker-update-check.sh --test-notify- Copy example configuration:
mkdir -p ~/.pangolin
cp update.conf.example ~/.pangolin/update.conf- Edit configuration:
nano ~/.pangolin/update.conf- Or use interactive wizard:
./docker-update-check.sh --configureUPDATE_CHECK_ENABLED- Enable/disable update checkingUPDATE_AUTO_UPDATE- Automatically apply updates without promptingUPDATE_NOTIFY_ONLY- Only check and notify, don't updateUPDATE_USE_COMPOSE- Use docker-compose for container management
UPDATE_INCLUDE_CONTAINERS- Comma-separated list of containers to include (empty = all)UPDATE_EXCLUDE_CONTAINERS- Comma-separated list of containers to excludeUPDATE_LABEL_FILTER- Only update containers with specific label (e.g., "auto-update=true")UPDATE_MIN_AGE- Only update containers older than specified age (e.g., "7d", "2w")
UPDATE_BACKUP_DAYS- Keep image backups for N days (0 = no backup)UPDATE_AUTO_PRUNE- Automatically prune dangling images after updateUPDATE_FORCE_RECREATE- Force recreate containers even if config unchangedUPDATE_REGISTRY_TIMEOUT- Registry query timeout in seconds
UPDATE_NOTIFY_ENABLED- Enable/disable notificationsUPDATE_NOTIFY_CHANNELS- Comma-separated list of notification channels
UPDATE_GOTIFY_URL="https://gotify.example.com"
UPDATE_GOTIFY_TOKEN="your-token"
UPDATE_GOTIFY_PRIORITY=5UPDATE_NTFY_URL="https://ntfy.sh"
UPDATE_NTFY_TOPIC="docker-updates"
UPDATE_NTFY_PRIORITY="high"
UPDATE_NTFY_TOKEN="optional-access-token"UPDATE_DISCORD_WEBHOOK="https://discord.com/api/webhooks/..."
UPDATE_DISCORD_USERNAME="Docker Update Bot"UPDATE_TELEGRAM_BOT_TOKEN="your-bot-token"
UPDATE_TELEGRAM_CHAT_ID="your-chat-id"UPDATE_SLACK_WEBHOOK="https://hooks.slack.com/services/..."
UPDATE_SLACK_USERNAME="Docker Update Bot"UPDATE_EMAIL_SMTP_SERVER="smtp.gmail.com"
UPDATE_EMAIL_SMTP_PORT=587
UPDATE_EMAIL_FROM="sender@example.com"
UPDATE_EMAIL_TO="recipient@example.com"
UPDATE_EMAIL_USERNAME="smtp-username"
UPDATE_EMAIL_PASSWORD="smtp-password"# Install apprise: pip install apprise
UPDATE_APPRISE_URL="discord://webhook_id/token telegram://bot_token/chat_id"UPDATE_CUSTOM_SCRIPT="/path/to/notification-script.sh"
# Script receives JSON via stdin:
# {"title":"...","message":"...","timestamp":"...","updates":{...}}Add labels to your docker-compose.yml:
services:
pangolin:
image: fosrl/pangolin:latest
labels:
- "auto-update=true"
traefik:
image: traefik:latest
labels:
- "auto-update=false"Then use label filtering:
./docker-update-check.sh --label "auto-update=true" --autocrontab -e
# Add:
0 9 * * * /path/to/docker-update-check.sh --notify-only --config ~/.pangolin/update.conf >> /var/log/docker-updates.log 2>&1# Every Sunday at 2 AM
0 2 * * 0 /path/to/docker-update-check.sh --auto --backup-days 7 --prune --config ~/.pangolin/update.conf >> /var/log/docker-updates.log 2>&1# Check only critical services
0 10 * * * /path/to/docker-update-check.sh --include "pangolin,gerbil" --notify-only >> /var/log/docker-updates.log 2>&1When UPDATE_BACKUP_DAYS is set, images are automatically backed up before updates:
# Backups are tagged as: dockcheck/container:YYYY-MM-DD_HHMM_tag
docker images | grep dockcheckTo rollback to a previous image:
# 1. List backup images
./docker-update-check.sh --list-backups
# 2. Stop container
docker-compose stop container-name
# 3. Retag backup as current
docker tag dockcheck/container:2024-01-15_1430_v1.0 original-image:tag
# 4. Restart container
docker-compose up -d container-name# Remove backups older than 30 days
./docker-update-check.sh --cleanup-backups 30# Monitor all containers, notify but don't auto-update
UPDATE_NOTIFY_ONLY=true
UPDATE_NOTIFY_ENABLED=true
UPDATE_NOTIFY_CHANNELS="discord,email"
UPDATE_BACKUP_DAYS=30
UPDATE_EXCLUDE_CONTAINERS="critical-db"
UPDATE_MIN_AGE="7d"# Auto-update everything except critical services
UPDATE_AUTO_UPDATE=true
UPDATE_EXCLUDE_CONTAINERS="database,redis"
UPDATE_BACKUP_DAYS=7
UPDATE_AUTO_PRUNE=true
UPDATE_NOTIFY_ENABLED=true
UPDATE_NOTIFY_CHANNELS="gotify"# Only auto-update containers with auto-update=true label
UPDATE_LABEL_FILTER="auto-update=true"
UPDATE_AUTO_UPDATE=true
UPDATE_BACKUP_DAYS=14
UPDATE_NOTIFY_ENABLED=true
UPDATE_NOTIFY_CHANNELS="telegram"Before relying on notifications, test your setup:
./docker-update-check.sh --test-notifyProblem: Can't detect updates for custom registry
# Check if image digest is available
docker manifest inspect your-image:tag
# Test registry connectivity
curl -I https://your-registry.com/v2/Problem: Rate limiting from Docker Hub
# Login to Docker Hub for higher rate limits
docker login
# Or use regctl (recommended by dockcheck)
# https://github.com/regclient/regclientProblem: Notifications not sending
# Test individual notification service
./docker-update-check.sh --test-notify
# Check logs
tail -f /tmp/docker-update-check.log
# Verify service configuration
grep UPDATE_ ~/.pangolin/update.confProblem: Can't access Docker
# Add user to docker group
sudo usermod -aG docker $USER
newgrp docker
# Or run with sudo
sudo ./docker-update-check.shbackup-update-master.sh- Main entry point with interactive menubackup-ba-up-ma.sh- Backup and restore functionsupdate-ba-up-ma.sh- Manual update functionsdocker-update-check.sh- Automated update detection (NEW!)docker-update-utils.sh- Update utility functions (NEW!)docker-update-config.sh- Configuration management (NEW!)docker-update-notify.sh- Notification system (NEW!)utils-ba-up-ma.sh- Common utility functionsconfig-ba-up-ma.sh- Configuration managementcron-ba-up-ma.sh- Cron job setupupdate.conf.example- Example configuration file (NEW!)
- bash 4.0+
- docker / docker-compose
- tar, grep, awk, sed
- curl (for update detection and notifications)
- jq (for JSON parsing)
- regctl (for better registry queries, respects rate limits)
- apprise (for multi-service notifications)
- sendmail/msmtp (for email notifications)
-
Configuration Files - Store sensitive data securely
chmod 600 ~/.pangolin/update.conf -
Webhook URLs - Keep webhook URLs private, rotate regularly
-
SMTP Passwords - Consider using app-specific passwords
-
Auto-Updates - Test thoroughly before enabling in production
-
Backup Verification - Regularly test restore procedures
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check existing documentation
- Review example configurations
Note: Always test in a non-production environment first. While image backups provide rollback capability, testing is the best way to ensure smooth updates.