Compare commits

...

18 Commits

Author SHA1 Message Date
Aiirondev_dev 3e993f65e6 Fix of the endpoint name 2026-07-19 21:07:30 +02:00
Aiirondev_dev 3cffa4f601 slight changes 2026-07-19 21:00:56 +02:00
Aiirondev_dev adc484cc26 slight changes in hopes of debugging 2026-07-19 20:47:06 +02:00
Aiirondev_dev c99e61ac45 debugging fot the damaged view 2026-07-19 20:27:58 +02:00
Aiirondev_dev e1e488f723 changes to incorperate the Encryption frokm the borrower name correctly 2026-07-19 20:20:41 +02:00
Aiirondev_dev 0562aee04b changes to the decryption of the payloads from the audit event report download 2026-07-19 20:02:17 +02:00
Aiirondev_dev b1c104f36c changes to the processing of the decryption process 2026-07-19 19:53:44 +02:00
Aiirondev_dev 5afe05b2d2 changes to the Library Items Types wich caused some Issues with the right displayment 2026-07-18 12:20:20 +02:00
Aiirondev_dev 7207fef0d4 Chnages to the Items being shown to the Library User 2026-07-18 12:18:12 +02:00
Aiirondev_dev 3f9fae10af changes to the bakcup 2026-07-17 15:46:42 +02:00
Aiirondev_dev f45988d0e7 changes to the backlupo 2026-07-17 15:06:45 +02:00
Aiirondev_dev 32f39223f4 changes to the backup system 2026-07-17 14:36:59 +02:00
Aiirondev_dev 20528b60c5 changes 2026-07-16 14:53:27 +02:00
Aiirondev_dev c610c06a0e changes for the backup process 2026-07-16 14:40:06 +02:00
Aiirondev_dev 2cef1672d2 changes to the backup 2026-07-16 14:12:54 +02:00
Aiirondev_dev eb8542c410 changes to the backup.sh 2026-07-16 13:49:19 +02:00
Aiirondev_dev 1ebd83ec2c changes to the backup.sh 2026-07-16 13:41:39 +02:00
Aiirondev_dev e80bf946c0 changes to the ussage of backup.sh 2026-07-16 13:39:21 +02:00
7 changed files with 184 additions and 199 deletions
-11
View File
@@ -1,11 +0,0 @@
NUITKA_BUILD=0
INVENTAR_HTTP_PORT=10000
INVENTAR_HTTP_PORTS=10000
INVENTAR_APP_IMAGE=ghcr.io/aiirondev/legendary-octo-garbanzo:v0.7.42
INVENTAR_APP_CPUS=1.0
INVENTAR_APP_MEM_LIMIT=384m
INVENTAR_APP_MEM_SWAP_LIMIT=768m
INVENTAR_WORKERS=4
INVENTAR_THREADS=2
INVENTAR_WORKER_TIMEOUT=30
INVENTAR_WORKER_CONNECTIONS=100
+1 -1
View File
@@ -256,7 +256,7 @@ jobs:
EOF EOF
# Copy runtime scripts and config if present # Copy runtime scripts and config if present
for f in start.sh stop.sh restart.sh backup.sh config.json update.sh; do for f in start.sh stop.sh restart.sh backup.sh restore.sh config.json update.sh; do
if [ -f "$f" ]; then if [ -f "$f" ]; then
cp "$f" "release-bundle/$(basename "$f")" cp "$f" "release-bundle/$(basename "$f")"
fi fi
+69 -76
View File
@@ -289,7 +289,7 @@ SCHEDULER_INTERVAL = cfg.SCHEDULER_INTERVAL_MIN
SSL_CERT = cfg.SSL_CERT SSL_CERT = cfg.SSL_CERT
SSL_KEY = cfg.SSL_KEY SSL_KEY = cfg.SSL_KEY
LIBRARY_ITEM_TYPES = ('book', 'cd', 'dvd', 'other', 'schoolbook', 'Buch', 'Schulbuch', 'schulbuch') LIBRARY_ITEM_TYPES = ('book', 'cd', 'dvd', 'schoolbook', 'Buch', 'Schulbuch', 'schulbuch')
INVOICE_CURRENCY = 'EUR' INVOICE_CURRENCY = 'EUR'
NOTIFICATION_STATUS_CACHE_TTL = max(3, int(os.getenv('INVENTAR_NOTIFICATION_STATUS_CACHE_TTL', '8'))) NOTIFICATION_STATUS_CACHE_TTL = max(3, int(os.getenv('INVENTAR_NOTIFICATION_STATUS_CACHE_TTL', '8')))
@@ -3212,7 +3212,7 @@ def api_library_items():
ausleihungen_db = db['ausleihungen'] ausleihungen_db = db['ausleihungen']
query = { query = {
'ItemType': {'$in': ['book', 'cd', 'dvd', 'other', 'schoolbook', 'schulbuch', 'Buch', 'Schulbuch']}, 'ItemType': {'$in': ['book', 'cd', 'dvd', 'schoolbook', 'schulbuch', 'Buch', 'Schulbuch']},
'IsGroupedSubItem': {'$ne': True}, 'IsGroupedSubItem': {'$ne': True},
'Deleted': {'$ne': True} 'Deleted': {'$ne': True}
} }
@@ -3338,7 +3338,7 @@ def api_library_items():
client = MongoClient(cfg.MONGODB_HOST, cfg.MONGODB_PORT) client = MongoClient(cfg.MONGODB_HOST, cfg.MONGODB_PORT)
db = client[cfg.MONGODB_DB] db = client[cfg.MONGODB_DB]
student_cards = db['student_cards'] student_cards = db['student_cards']
card = student_cards.find_one({'_id': ObjectId(borrow_id)}) card = student_cards.find_one({'_id': ObjectId(borrower)}) if borrower else None
card = _decrypt_student_card_doc(card) card = _decrypt_student_card_doc(card)
client.close() client.close()
borrower = card['SchülerName'] borrower = card['SchülerName']
@@ -8154,10 +8154,26 @@ def admin_audit_dashboard():
# DEC_START: Decrypt the sensitive fields for display # DEC_START: Decrypt the sensitive fields for display
for row in audit_rows: for row in audit_rows:
if "payload" in row: payload_raw = row.get("payload")
# decrypt_document_fields acts in-place
decrypt_document_fields(row["payload"], SENSITIVE_AUDIT_FIELDS) if payload_raw and isinstance(payload_raw, str):
# DEC_END try:
# Safely evaluate the python-like dict string, providing context for ObjectId
safe_context = {"ObjectId": ObjectId, "None": None, "True": True, "False": False}
payload_dict = eval(payload_raw, {"__builtins__": {}}, safe_context)
if isinstance(payload_dict, dict):
# Decrypt the sensitive keys inside the extracted dictionary
decrypt_document_fields(payload_dict, SENSITIVE_AUDIT_FIELDS)
# Replace the raw string with the clean dictionary for the Jinja template
row["payload"] = payload_dict
except Exception as parse_err:
app.logger.error(f"Failed to parse audit payload string for index {row.get('chain_index')}: {parse_err}")
elif payload_raw and isinstance(payload_raw, dict):
# Fallback in case some newer log rows are already stored as proper dictionaries
decrypt_document_fields(payload_raw, SENSITIVE_AUDIT_FIELDS)
return render_template( return render_template(
'admin_audit.html', 'admin_audit.html',
@@ -8204,11 +8220,26 @@ def admin_audit_export_pdf_official():
audit_rows = list(db['audit_log'].find({}).sort('chain_index', -1).limit(limit)) audit_rows = list(db['audit_log'].find({}).sort('chain_index', -1).limit(limit))
# DEC_START: Decrypt sensitive fields for the PDF report
for row in audit_rows: for row in audit_rows:
if "payload" in row: payload_raw = row.get("payload")
decrypt_document_fields(row["payload"], SENSITIVE_AUDIT_FIELDS)
# DEC_END if payload_raw and isinstance(payload_raw, str):
try:
# Safely evaluate the python-like dict string with custom token support
safe_context = {"ObjectId": ObjectId, "None": None, "True": True, "False": False}
payload_dict = eval(payload_raw, {"__builtins__": {}}, safe_context)
if isinstance(payload_dict, dict):
# Decrypt the dictionary fields in-place
decrypt_document_fields(payload_dict, SENSITIVE_AUDIT_FIELDS)
# Replace string with the clean dictionary so the PDF generator can read it
row["payload"] = payload_dict
except Exception as parse_err:
app.logger.error(f"Failed to parse audit payload string for PDF export at index {row.get('chain_index')}: {parse_err}")
elif payload_raw and isinstance(payload_raw, dict):
# Fallback for standard dict payloads
decrypt_document_fields(payload_raw, SENSITIVE_AUDIT_FIELDS)
# Get school information from settings or use defaults # Get school information from settings or use defaults
school_info = _get_school_info_for_export() school_info = _get_school_info_for_export()
@@ -10366,91 +10397,53 @@ def notifications_unread_status():
client.close() client.close()
@app.route('/admin/damaged_items') @app.route('/admin/damaged_items')
def admin_damaged_items(): def admin_damaged_items():
"""Dedicated admin management window for damaged items.""" """Admin-Übersicht aller aktiven und vergangenen Ausleihen."""
if 'username' not in session: if 'username' not in session:
flash('Administratorrechte erforderlich.', 'error') flash('Administratorrechte erforderlich.', 'error')
return redirect(url_for('login')) return redirect(url_for('login'))
''' from modules.inventarsystem.data_protection import decrypt_text
permissions = _get_current_user_permissions() from bson.objectid import ObjectId
if not _action_access_allowed(permissions, 'can_manage_settings'):
flash('Sie haben keine Berechtigung, die Schulstammdaten zu ändern.', 'error')
if cfg.MODULES.is_enabled('library'):
return redirect(url_for('library_admin'))
'''
client = None client = None
try: try:
client = MongoClient(MONGODB_HOST, MONGODB_PORT) client = MongoClient(MONGODB_HOST, MONGODB_PORT)
db = client[MONGODB_DB] db = client[MONGODB_DB]
items_col = db['items']
ausleihungen_col = db['ausleihungen'] ausleihungen_col = db['ausleihungen']
items_col = db['items']
items = list(items_col.find( ausleihungen = list(ausleihungen_col.find().sort('Start', -1))
{
'Deleted': {'$ne': True},
'$or': [
{'HasDamage': True},
{'Condition': 'destroyed'},
{'DamageReports.0': {'$exists': True}},
]
},
{
'Name': 1,
'Code_4': 1,
'ItemType': 1,
'Author': 1,
'ISBN': 1,
'Condition': 1,
'DamageReports': 1,
'DamageRepairs': 1,
'Verfuegbar': 1,
'User': 1,
'LastUpdated': 1,
}
).sort('LastUpdated', -1))
damaged_rows = [] for record in ausleihungen:
for item_doc in items: raw_user = record.get('User', '')
item_id = str(item_doc.get('_id')) if raw_user:
active_borrow = ausleihungen_col.find_one( record['User'] = decrypt_text(raw_user)
{'Item': item_id, 'Status': {'$in': ['active', 'planned']}},
{'_id': 1, 'User': 1, 'Status': 1, 'End': 1}
)
reports = item_doc.get('DamageReports', []) or []
latest_report = reports[0] if reports else {}
damaged_rows.append({ item_id = record.get('Item')
'id': item_id, if item_id:
'name': item_doc.get('Name', ''), try:
'code': item_doc.get('Code_4', ''), item_doc = items_col.find_one({'_id': ObjectId(item_id)})
'item_type': item_doc.get('ItemType', ''), if item_doc:
'author': item_doc.get('Author', ''), if item_doc.get('User'):
'isbn': item_doc.get('ISBN', ''), item_doc['User'] = decrypt_text(item_doc['User'])
'condition': item_doc.get('Condition', ''),
'available': bool(item_doc.get('Verfuegbar', False)), record['ItemDetails'] = item_doc
'borrow_user': item_doc.get('User', ''), except Exception as e:
'damage_count': len(reports), app.logger.warning(f"Konnte Item {item_id} für Ausleihe {record.get('_id')} nicht laden: {e}")
'damage_reports': reports,
'latest_damage_description': latest_report.get('description', ''),
'latest_damage_by': latest_report.get('reported_by', ''),
'latest_damage_at': latest_report.get('reported_at'),
'active_borrow': active_borrow,
'last_updated': item_doc.get('LastUpdated'),
})
return render_template( return render_template(
'admin_damaged_items.html', 'admin_damaged_items.html',
damaged_items=damaged_rows, ausleihungen=ausleihungen,
library_module_enabled=cfg.MODULES.is_enabled('library'), library_module_enabled=cfg.MODULES.is_enabled('library'),
student_cards_module_enabled=cfg.MODULES.is_enabled('student_cards'), student_cards_module_enabled=cfg.MODULES.is_enabled('student_cards'),
mail_module_enabled=cfg.MODULES.is_enabled('mail') mail_module_enabled=cfg.MODULES.is_enabled('mail')
) )
except Exception as exc: except Exception as exc:
app.logger.error(f"Error loading damaged-items admin view: {exc}") app.logger.error(f"Fehler beim Laden der Ausleihen-Verwaltung: {exc}")
flash('Fehler beim Laden der Defekte-Items-Verwaltung.', 'error') flash('Fehler beim Laden der Ausleihen-Übersicht.', 'error')
return redirect(url_for('home_admin')) return redirect(url_for('home_admin'))
finally: finally:
if client: if client:
+52 -107
View File
@@ -3,7 +3,12 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
COMPOSE_FILE="docker-compose-multitenant.yml" COMPOSE_FILE="docker-compose-multitenant.yml"
# Directories
INVOICE_ARCHIVE_DIR="${INVOICE_ARCHIVE_DIR:-/var/backups/invoice-archive}" INVOICE_ARCHIVE_DIR="${INVOICE_ARCHIVE_DIR:-/var/backups/invoice-archive}"
FULL_BACKUP_DIR="${FULL_BACKUP_DIR:-/var/backups/inventarsystem}"
LOG_DIR="$SCRIPT_DIR/logs"
KEEP_DAYS="${INVOICE_KEEP_DAYS:-3650}" KEEP_DAYS="${INVOICE_KEEP_DAYS:-3650}"
MODE="auto" MODE="auto"
BASE_NAME="" BASE_NAME=""
@@ -14,9 +19,7 @@ Usage: $0 [options]
Options: Options:
--invoice-archive-dir DIR Directory for invoice archive files --invoice-archive-dir DIR Directory for invoice archive files
(default: $INVOICE_ARCHIVE_DIR) --invoice-keep-days N Remove archived files older than N days
--invoice-keep-days N Remove archived invoice files older than N days
(default: $KEEP_DAYS)
--mode auto|docker|host Backup mode (default: auto) --mode auto|docker|host Backup mode (default: auto)
--base-name NAME Base filename prefix for archive files --base-name NAME Base filename prefix for archive files
-h, --help Show this help message -h, --help Show this help message
@@ -26,135 +29,78 @@ EOF
parse_args() { parse_args() {
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
--invoice-archive-dir) --invoice-archive-dir) INVOICE_ARCHIVE_DIR="$2"; shift 2 ;;
INVOICE_ARCHIVE_DIR="$2" --invoice-keep-days) KEEP_DAYS="$2"; shift 2 ;;
shift 2 --mode) MODE="$2"; shift 2 ;;
;; --base-name) BASE_NAME="$2"; shift 2 ;;
--invoice-keep-days) -h|--help) usage; exit 0 ;;
KEEP_DAYS="$2" *) echo "Error: unknown option '$1'" >&2; usage; exit 2 ;;
shift 2
;;
--mode)
MODE="$2"
shift 2
;;
--base-name)
BASE_NAME="$2"
shift 2
;;
-h|--help)
usage
exit 0
;;
*)
echo "Error: unknown option '$1'" >&2
usage
exit 2
;;
esac esac
done done
} }
ensure_directory() { ensure_directory() {
mkdir -p "$INVOICE_ARCHIVE_DIR" mkdir -p "$INVOICE_ARCHIVE_DIR"
mkdir -p "$FULL_BACKUP_DIR"
} }
cleanup_old_archives() { cleanup_old_archives() {
if [[ -n "$KEEP_DAYS" ]]; then if [[ -n "$KEEP_DAYS" ]]; then
find "$INVOICE_ARCHIVE_DIR" -maxdepth 1 -type f \( -name 'invoices-*.jsonl' -o -name 'invoices-*.csv' -o -name 'invoices-*.meta.json' \) -mtime +"$KEEP_DAYS" -print -delete || true find "$INVOICE_ARCHIVE_DIR" -maxdepth 1 -type f -mtime +"$KEEP_DAYS" -print -delete 2>/dev/null || true
fi fi
} # Cleanup old bundled backups (older than 30 days)
find "$FULL_BACKUP_DIR" -maxdepth 1 -type f -name "full_backup_*.tar.gz" -mtime +30 -print -delete 2>/dev/null || true
host_backup() {
if ! command -v python3 >/dev/null 2>&1; then
return 1
fi
if ! python3 -c 'import pymongo' >/dev/null 2>&1; then
return 1
fi
python3 "$SCRIPT_DIR/Web/backup_invoices.py" \
--archive-dir "$INVOICE_ARCHIVE_DIR" \
--base-name "$BASE_NAME"
} }
docker_backup() { docker_backup() {
if ! command -v docker >/dev/null 2>&1; then if ! command -v docker >/dev/null 2>&1; then return 1; fi
return 1
fi
if ! docker compose -f "$COMPOSE_FILE" ps -q app >/dev/null 2>&1; then
return 1
fi
local app_container
app_container="$(docker compose -f "$COMPOSE_FILE" ps -q app | tr -d '[:space:]')"
if [[ -z "$app_container" ]]; then
return 1
fi
local timestamp
timestamp="$(date +'%Y-%m-%d_%H-%M-%S')"
local output_dir
local remote_base
output_dir="/tmp/invoice_archive_${timestamp}"
remote_base="${output_dir}/${BASE_NAME}"
# Wir verketten die kritischen Schritte mit &&.
# Falls der Pfad doch '/app/Web/...' sein sollte, passe ihn hier einfach wieder an.
docker compose -f "$COMPOSE_FILE" exec -T app mkdir -p "$output_dir" && \
docker compose -f "$COMPOSE_FILE" exec -T app python3 /app/backup_invoices.py \
--archive-dir "$output_dir" \
--base-name "$BASE_NAME" && \
mkdir -p "$INVOICE_ARCHIVE_DIR" && \
docker cp "$app_container":"${remote_base}.jsonl" "$INVOICE_ARCHIVE_DIR/" && \
docker cp "$app_container":"${remote_base}.csv" "$INVOICE_ARCHIVE_DIR/" && \
docker cp "$app_container":"${remote_base}.meta.json" "$INVOICE_ARCHIVE_DIR/"
# Hier fangen wir den Exit-Code der gesamten Kette ab local timestamp="$(date +'%Y-%m-%d_%H-%M-%S')"
local backup_status=$? local staging_dir="/tmp/backup_stage_$timestamp"
echo "[$(date +'%T')] Starting unified system backup..."
mkdir -p "$staging_dir"
# Dieser Befehl läuft immer (Aufräumen im Container), verändert aber nicht unseren Rückgabetatbestand # 1. MongoDB Dump (into staging)
docker compose -f "$COMPOSE_FILE" exec -T app rm -rf "$output_dir" if docker compose -f "$COMPOSE_FILE" ps -q mongodb >/dev/null 2>&1; then
echo "[$(date +'%T')] Dumping Database..."
docker compose -f "$COMPOSE_FILE" exec -T mongodb mongodump --archive --gzip > "$staging_dir/db.archive.gz"
fi
# Jetzt geben wir den echten Status der Backup-Kette zurück # 2. Archive Assets (into staging)
return $backup_status if [ -d "./Web/uploads" ]; then
echo "[$(date +'%T')] Archiving assets..."
tar -czf "$staging_dir/assets.tar.gz" -C . Web/uploads Web/thumbnails Web/previews 2>/dev/null || true
fi
# 3. Archive Logs (into staging)
if [ -d "$LOG_DIR" ]; then
echo "[$(date +'%T')] Archiving logs..."
tar -czf "$staging_dir/logs.tar.gz" -C "$(dirname "$LOG_DIR")" "$(basename "$LOG_DIR")"
fi
# 4. Bundle everything into one file
echo "[$(date +'%T')] Bundling archive..."
tar -czf "$FULL_BACKUP_DIR/full_backup_$timestamp.tar.gz" -C "$staging_dir" .
# 5. Cleanup staging
rm -rf "$staging_dir"
echo "[$(date +'%T')] Backup complete: $FULL_BACKUP_DIR/full_backup_$timestamp.tar.gz"
return 0
} }
main() { main() {
if [[ -z "$BASE_NAME" ]]; then parse_args "$@"
BASE_NAME="invoices-$(date +'%Y-%m-%d_%H-%M-%S')"
fi
ensure_directory ensure_directory
case "$MODE" in case "$MODE" in
auto) auto|docker)
if docker_backup; then if docker_backup; then
cleanup_old_archives cleanup_old_archives
return 0 return 0
fi fi
if host_backup; then echo "Error: Docker backup failed." >&2
cleanup_old_archives
return 0
fi
echo "Error: could not perform invoice backup in auto mode. Docker or host Python with pymongo is required." >&2
return 1
;;
docker)
if docker_backup; then
cleanup_old_archives
return 0
fi
echo "Error: docker backup failed or app container is unavailable." >&2
return 1
;;
host)
if host_backup; then
cleanup_old_archives
return 0
fi
echo "Error: host backup failed. Ensure python3 and pymongo are installed." >&2
return 1 return 1
;; ;;
*) *)
@@ -165,5 +111,4 @@ main() {
esac esac
} }
parse_args "$@" main "$@"
main
+1 -1
View File
@@ -27,7 +27,7 @@
"username": "", "username": "",
"password": "", "password": "",
"from_address": "", "from_address": "",
"default_sender_name": "Invario Inventurprogramm", "default_sender_name": "Invario Inventarprogramm",
"timeout_seconds": 30 "timeout_seconds": 30
}, },
"images": { "images": {
Executable
+58
View File
@@ -0,0 +1,58 @@
#!/usr/bin/env bash
set -euo pipefail
BACKUP_DIR="/var/backups/inventarsystem"
COMPOSE_FILE="docker-compose-multitenant.yml"
# 1. Find the latest backup bundle
LATEST_BACKUP=$(ls -t "$BACKUP_DIR"/full_backup_*.tar.gz | head -n1 2>/dev/null || true)
if [[ -z "$LATEST_BACKUP" ]]; then
echo "Error: No backup bundle found in $BACKUP_DIR"
exit 1
fi
echo "--- RESTORE PROCEDURE ---"
echo "Found latest bundle: $(basename "$LATEST_BACKUP")"
read -p "WARNING: This will OVERWRITE your current database and assets! Continue? (y/N) " confirm
[[ "$confirm" != "y" ]] && exit 1
# 2. Extract the bundle to a temporary location
RESTORE_TMP="/tmp/restore_$(date +%s)"
mkdir -p "$RESTORE_TMP"
echo "Extracting bundle..."
tar -xzf "$LATEST_BACKUP" -C "$RESTORE_TMP"
# 3. Stop application
echo "Stopping application..."
docker compose -f "$COMPOSE_FILE" stop app
# 4. Restore Database
if [ -f "$RESTORE_TMP/db.archive.gz" ]; then
echo "Restoring MongoDB..."
zcat "$RESTORE_TMP/db.archive.gz" | docker compose -f "$COMPOSE_FILE" exec -T mongodb mongorestore --archive --gzip --drop
else
echo "Warning: Database archive not found in bundle."
fi
# 5. Restore Assets
if [ -f "$RESTORE_TMP/assets.tar.gz" ]; then
echo "Restoring Assets (Uploads/Thumbnails/Previews)..."
tar -xzf "$RESTORE_TMP/assets.tar.gz" -C .
else
echo "Warning: Asset archive not found in bundle."
fi
# 6. Restore Logs (Optional)
if [ -f "$RESTORE_TMP/logs.tar.gz" ]; then
echo "Restoring Logs..."
tar -xzf "$RESTORE_TMP/logs.tar.gz" -C .
fi
# 7. Start application
echo "Restarting application..."
docker compose -f "$COMPOSE_FILE" start app
# 8. Cleanup
rm -rf "$RESTORE_TMP"
echo "Restore complete!"
+3 -3
View File
@@ -204,14 +204,14 @@ create_backup() {
fi fi
fi fi
if [ -x "$PROJECT_DIR/run-backup.sh" ]; then if [ -x "$PROJECT_DIR/backup.sh" ]; then
if "$PROJECT_DIR/run-backup.sh" >> "$LOG_FILE" 2>&1; then if "$PROJECT_DIR/backup.sh" --mode auto >> "$LOG_FILE" 2>&1; then
log_message "Backup completed" log_message "Backup completed"
else else
log_message "WARNING: Backup failed; continuing with release update" log_message "WARNING: Backup failed; continuing with release update"
fi fi
else else
log_message "WARNING: run-backup.sh not found; skipping backup" log_message "WARNING: backup.sh not found; skipping backup"
fi fi
} }