fix: opening balance direction, safe return paths, backup failure detection, review fixes
- opening balance: "person 2 owes person 1" was stored the wrong way round - retour param: reject backslash/control chars (open redirect) - backup: pipefail + check dump completeness, failed dumps no longer logged OK - deleting a recurring occurrence marks it skipped so sync does not recreate it - editing a charge regenerates future occurrences of incomes allocated to it - settlements (incl. opening balance) listed in settings and deletable Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a0bcea4eb1
commit
5b402691f0
15 files changed
+222
-15
No files matched your search
+3
-2
@@ -1,10 +1,11 @@
|
||||
#!/bin/bash
|
||||
# Sauvegarde quotidienne de la base (03:00, heure de Paris), rétention 30 jours.
|
||||
set -u
|
||||
set -u -o pipefail
|
||||
|
||||
dump() {
|
||||
local file="/backups/finances-$(date +%F_%H%M).sql.gz"
|
||||
if mariadb-dump -h db -u root -p"$MARIADB_ROOT_PASSWORD" --single-transaction --routines finances | gzip > "$file.tmp"; then
|
||||
# pipefail : un échec de mariadb-dump fait échouer le pipeline ; la dernière ligne confirme un dump complet.
|
||||
if mariadb-dump -h db -u root -p"$MARIADB_ROOT_PASSWORD" --single-transaction --routines finances | gzip > "$file.tmp" && gunzip -c "$file.tmp" | tail -n 1 | grep -q "Dump completed"; then
|
||||
mv "$file.tmp" "$file"
|
||||
echo "$(date '+%F %T') sauvegarde OK : $file"
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user