Fix ntfy notification hooks to use Borgmatic 2.0 environment variables
Some checks failed
Deploy Borgmatic Configuration / Deploy to Production Server (push) Has been cancelled

Replace deprecated argument-based parameter passing with environment variables
and dynamic data retrieval for archive names and error messages.

Changes:
- Remove "{archive_name}" and "{error}" placeholders from config.yaml
- Update ntfy-success.sh to retrieve archive name via borgmatic list
- Update ntfy-error.sh to extract error messages from systemd logs
- Add repository information to both notification types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
BeauTroll
2025-12-17 06:42:14 +01:00
parent 25b0a2fcfa
commit b2beeb3334
3 changed files with 19 additions and 12 deletions

View File

@@ -75,12 +75,12 @@ commands:
when: [create]
run:
- echo "Exécution hook de succès"
- /etc/borgmatic/hooks/ntfy-success.sh "{archive_name}" "{stats}"
- /etc/borgmatic/hooks/ntfy-success.sh
- after: error
run:
- echo "Exécution hook d'erreur"
- /etc/borgmatic/hooks/ntfy-error.sh "{error}"
- /etc/borgmatic/hooks/ntfy-error.sh
# Commandes PostgreSQL/MySQL si nécessaire
# postgresql_databases: