Fix Seafile MySQL dump authentication by using root user
Some checks failed
Deploy Borgmatic Configuration / Deploy to Production Server (push) Has been cancelled
Some checks failed
Deploy Borgmatic Configuration / Deploy to Production Server (push) Has been cancelled
Update the Seafile MySQL dump hook to use the root user by default instead of seafile user, which resolves authentication issues. Add SEAFILE_MYSQL_USER environment variable for user customization. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,11 +22,15 @@ else
|
||||
echo "⚠️ /etc/borgmatic/.env non trouvé"
|
||||
fi
|
||||
|
||||
# Utilisateur MySQL (par défaut root, configurable via .env)
|
||||
MYSQL_USER="${SEAFILE_MYSQL_USER:-root}"
|
||||
|
||||
# Vérifier que le mot de passe est défini
|
||||
if [ -z "$SEAFILE_DB_PASSWORD" ]; then
|
||||
echo "❌ SEAFILE_DB_PASSWORD n'est pas défini dans /etc/borgmatic/.env"
|
||||
exit 1
|
||||
fi
|
||||
echo "✓ Utilisateur MySQL: $MYSQL_USER"
|
||||
echo "✓ Mot de passe MySQL défini"
|
||||
|
||||
# Vérifier que le conteneur existe et tourne
|
||||
@@ -41,7 +45,7 @@ echo "✓ Conteneur $MYSQL_CONTAINER trouvé"
|
||||
# Dump unique avec toutes les bases
|
||||
echo "→ Dump des bases Seafile..."
|
||||
if timeout 300 docker exec "$MYSQL_CONTAINER" mysqldump \
|
||||
-u seafile -p"${SEAFILE_DB_PASSWORD}" \
|
||||
-u "$MYSQL_USER" -p"${SEAFILE_DB_PASSWORD}" \
|
||||
--single-transaction --quick --databases \
|
||||
ccnet_db seafile_db seahub_db > "$BACKUP_DIR/seafile-all-$DATE.sql" 2>&1; then
|
||||
|
||||
|
||||
Reference in New Issue
Block a user