Fix nextcloudfix

This commit is contained in:
2026-05-19 23:51:21 +01:00
parent 312356488a
commit ce30ad937b

View File

@@ -1,6 +1,19 @@
#!/bin/bash #!/bin/bash
# ============================================= # =============================================
# restore-myapps.sh — Complete Restore Script # restore-myapps.sh — Smart Restore Script
#
# Can run:
# - Locally on the server/vm:
# ./restore-myapps.sh
#
# - Remotely (from VM targeting the main server, or vice versa):
# ./restore-myapps.sh --remote <IP> <USER> [--key /path/to/key | --password]
#
# Features:
# - Skips containers that are already healthy/running
# - Applies all known post-restore fixes per app
# - Detects target IP automatically or uses provided one
# - Works whether run locally or proxied over SSH
# ============================================= # =============================================
set -uo pipefail set -uo pipefail
@@ -12,8 +25,8 @@ REMOTE_MODE=false
REMOTE_IP="" REMOTE_IP=""
REMOTE_USER="root" REMOTE_USER="root"
SSH_KEY="" SSH_KEY=""
SSH_PASSWORD=""
USE_PASSWORD=false USE_PASSWORD=false
SSH_PASS=""
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
@@ -38,91 +51,153 @@ while [[ $# -gt 0 ]]; do
done done
# -------------------------------------------------- # --------------------------------------------------
# If remote mode # If remote mode: copy this script + backup to target and run it there
# -------------------------------------------------- # --------------------------------------------------
if [ "$REMOTE_MODE" = true ]; then if [ "$REMOTE_MODE" = true ]; then
if [ -z "$REMOTE_IP" ]; then if [ -z "$REMOTE_IP" ]; then
echo "❌ --remote requires an IP address." echo "❌ --remote requires an IP address."
echo " Usage: $0 --remote <IP> [USER] [--key /path/key]"
exit 1 exit 1
fi fi
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REMOTE_DEST="/tmp/restore-session-$(date +%s)" REMOTE_DEST="/tmp/restore-session-$(date +%s)"
# Build SSH/SCP options
SSH_OPTS="-o StrictHostKeyChecking=no -o ConnectTimeout=15" SSH_OPTS="-o StrictHostKeyChecking=no -o ConnectTimeout=15"
if [ -n "$SSH_KEY" ]; then if [ -n "$SSH_KEY" ]; then
SSH_OPTS="$SSH_OPTS -i $SSH_KEY" SSH_OPTS="$SSH_OPTS -i $SSH_KEY"
fi SCP_OPTS="$SSH_OPTS"
elif [ "$USE_PASSWORD" = true ]; then
if [ "$USE_PASSWORD" = true ]; then
if ! command -v sshpass &>/dev/null; then if ! command -v sshpass &>/dev/null; then
apt install sshpass -y echo "❌ sshpass not installed. Install it with: apt install sshpass"
exit 1
fi fi
read -s -p "SSH password for ${REMOTE_USER}@${REMOTE_IP}: " SSH_PASS read -s -p "SSH password for ${REMOTE_USER}@${REMOTE_IP}: " SSH_PASS
echo "" echo ""
SSH_CMD="sshpass -p '$SSH_PASS' ssh $SSH_OPTS ${REMOTE_USER}@${REMOTE_IP}" SSH_CMD="sshpass -p '$SSH_PASS' ssh $SSH_OPTS"
SCP_CMD="sshpass -p '$SSH_PASS' scp $SSH_OPTS" SCP_CMD="sshpass -p '$SSH_PASS' scp $SSH_OPTS"
else fi
SSH_CMD="ssh $SSH_OPTS ${REMOTE_USER}@${REMOTE_IP}"
SCP_CMD="scp $SSH_OPTS" SSH_CMD="ssh $SSH_OPTS ${REMOTE_USER}@${REMOTE_IP}"
SCP_CMD="scp $SSH_OPTS"
if [ -n "$SSH_KEY" ]; then
SCP_CMD="scp -i $SSH_KEY $SSH_OPTS"
fi fi
echo "=========================================" echo "========================================="
echo "📡 REMOTE RESTORE to ${REMOTE_USER}@${REMOTE_IP}" echo "📡 REMOTE RESTORE MODE"
echo " Target: ${REMOTE_USER}@${REMOTE_IP}"
echo " Backup: $SCRIPT_DIR"
echo "=========================================" echo "========================================="
echo ""
echo "📤 Copying backup to remote server..."
$SSH_CMD "mkdir -p $REMOTE_DEST" $SSH_CMD "mkdir -p $REMOTE_DEST"
$SCP_CMD -r "$SCRIPT_DIR/." "${REMOTE_USER}@${REMOTE_IP}:${REMOTE_DEST}/" $SCP_CMD -r "$SCRIPT_DIR/." "${REMOTE_USER}@${REMOTE_IP}:${REMOTE_DEST}/"
if [ $? -ne 0 ]; then
echo "❌ Failed to copy backup to remote server."
exit 1
fi
echo "✅ Backup copied."
echo ""
echo "🚀 Running restore on remote server..."
$SSH_CMD "chmod +x $REMOTE_DEST/restore-myapps.sh && cd $REMOTE_DEST && bash restore-myapps.sh" $SSH_CMD "chmod +x $REMOTE_DEST/restore-myapps.sh && cd $REMOTE_DEST && bash restore-myapps.sh"
echo ""
echo "🧹 Cleaning up remote temp files..."
$SSH_CMD "rm -rf $REMOTE_DEST" $SSH_CMD "rm -rf $REMOTE_DEST"
echo "✅ Remote restore complete" echo "========================================="
echo "✅ Remote restore complete on $REMOTE_IP"
echo "========================================="
exit 0 exit 0
fi fi
# =================================================== # ===================================================
# LOCAL RESTORE # LOCAL RESTORE (runs directly on the target machine)
# =================================================== # ===================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR" cd "$SCRIPT_DIR"
# Detect IP of this machine
VM_IP=$(ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v 127.0.0.1 | head -1) VM_IP=$(ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v 127.0.0.1 | head -1)
echo "=========================================" echo "========================================="
echo "🔄 FULL RESTORE — LOCAL MODE" echo "🔄 Smart Restore — LOCAL MODE"
echo " Machine IP: $VM_IP" echo " Machine IP: $VM_IP"
echo " Backup dir: $SCRIPT_DIR" echo " Backup dir: $SCRIPT_DIR"
echo "=========================================" echo "========================================="
# -------------------------------------------------- # --------------------------------------------------
# STEP 1: Restore Volumes # Helper: check if a container is healthy/running
# Returns 0 (true) if container should be skipped
# --------------------------------------------------
container_is_healthy() {
local name="$1"
local status
status=$(docker inspect --format='{{.State.Status}}' "$name" 2>/dev/null || echo "missing")
local health
health=$(docker inspect --format='{{if .State.Health}}{{.State.Health.Status}}{{else}}none{{end}}' "$name" 2>/dev/null || echo "none")
if [ "$status" = "running" ] && { [ "$health" = "healthy" ] || [ "$health" = "none" ]; }; then
return 0 # healthy → skip
fi
return 1 # not healthy → restore
}
# --------------------------------------------------
# 1. Restore volumes — skip if container using it is healthy
# -------------------------------------------------- # --------------------------------------------------
echo "" echo ""
echo "========================================="
echo "📦 STEP 1 — Restoring Volumes" echo "📦 STEP 1 — Restoring Volumes"
echo "=========================================" echo "========================================="
if [ -d "$SCRIPT_DIR/volumes" ]; then declare -A VOLUME_OWNERS=(
cd "$SCRIPT_DIR/volumes" ["frappe-setup_frappe-sites"]="frappe-erpnext"
for backup in *.tar.gz; do ["frappe-setup_mariadb-data"]="frappe-mariadb"
[ -f "$backup" ] || continue ["nextcloud-setup_nextcloud-data"]="nextcloud-app"
volume=$(basename "$backup" .tar.gz) ["nextcloud-setup_nextcloud-db-data"]="nextcloud-postgres"
echo -n " 📁 Restoring $volume ... " ["mautic-setup_mautic-data"]="mautic-app"
docker volume create "$volume" &>/dev/null || true ["mautic-setup_mautic-db-data"]="mautic-mariadb"
docker run --rm \ ["n8n-setup_n8n-data"]="n8n-app"
-v "${volume}:/target" \ ["n8n-setup_n8n-db-data"]="n8n-db"
-v "$(pwd):/backup" \ ["odoo-clean_db-data"]="odoo-clean-db-1"
alpine \ ["odoo-clean_odoo-etc"]="odoo-clean-odoo-1"
sh -c "cd /target && tar xzf /backup/$backup" \ )
&& echo "✅" || echo "⚠️ FAILED"
done cd "$SCRIPT_DIR/volumes"
cd "$SCRIPT_DIR" for backup in *.tar.gz; do
fi [ -f "$backup" ] || continue
volume=$(basename "$backup" .tar.gz)
owner="${VOLUME_OWNERS[$volume]:-}"
# If the owning container is healthy, skip this volume
if [ -n "$owner" ] && container_is_healthy "$owner"; then
echo " ⏭️ $volume — container '$owner' is healthy, skipping"
continue
fi
echo -n " 📁 Restoring $volume ... "
docker volume create "$volume" &>/dev/null || true
docker run --rm \
-v "${volume}:/target" \
-v "$(pwd):/backup" \
alpine \
sh -c "cd /target && tar xzf /backup/$backup" \
&& echo "✅" || echo "⚠️ FAILED"
done
cd "$SCRIPT_DIR"
# -------------------------------------------------- # --------------------------------------------------
# STEP 2: Start Containers # 2. Start containers — skip healthy ones
# -------------------------------------------------- # --------------------------------------------------
echo "" echo ""
echo "========================================="
echo "🚀 STEP 2 — Starting Containers" echo "🚀 STEP 2 — Starting Containers"
echo "=========================================" echo "========================================="
@@ -134,139 +209,190 @@ declare -A APP_DIRS=(
["n8n"]="n8n-setup" ["n8n"]="n8n-setup"
) )
if [ -d "$SCRIPT_DIR/compose-files" ]; then declare -A APP_MAIN_CONTAINER=(
cd "$SCRIPT_DIR/compose-files" ["Frappe"]="frappe-erpnext"
for app in Frappe Odoo Nextcloud Mautic n8n; do ["Odoo"]="odoo-clean-odoo-1"
dir="${APP_DIRS[$app]}" ["Nextcloud"]="nextcloud-app"
if [ -d "$dir" ]; then ["Mautic"]="mautic-app"
echo " 🚀 Starting $app..." ["n8n"]="n8n-app"
cd "$dir" )
docker-compose up -d 2>&1 | tail -3
cd .. cd "$SCRIPT_DIR/compose-files"
fi for app in Frappe Odoo Nextcloud Mautic n8n; do
done dir="${APP_DIRS[$app]}"
cd "$SCRIPT_DIR" main_ctr="${APP_MAIN_CONTAINER[$app]}"
fi
if container_is_healthy "$main_ctr"; then
echo " ⏭️ $app — already running and healthy, skipping"
continue
fi
if [ -d "$dir" ]; then
echo " 🚀 Starting $app..."
cd "$dir"
docker-compose up -d 2>&1 | tail -3
cd ..
else
echo " ⏭️ $app compose dir '$dir' not found, skipping"
fi
done
cd "$SCRIPT_DIR"
echo "" echo ""
echo "⏳ Waiting 60s for containers to initialize..." echo "⏳ Waiting 60s for containers to initialize..."
sleep 60 sleep 60
# -------------------------------------------------- # --------------------------------------------------
# STEP 3: Post-Restore Fixes # 3. Post-restore fixes
# -------------------------------------------------- # --------------------------------------------------
echo "" echo ""
echo "========================================="
echo "🔧 STEP 3 — Applying Post-Restore Fixes" echo "🔧 STEP 3 — Applying Post-Restore Fixes"
echo "=========================================" echo "========================================="
# ---- NEXTCLOUD ---- # ---- NEXTCLOUD ----
echo "" echo ""
echo "📌 Nextcloud — Trusted domains..." echo "📌 Nextcloud — Trusted domains..."
if docker ps | grep -q nextcloud-app; then if container_is_healthy nextcloud-app; then
docker exec nextcloud-app php /var/www/html/occ config:system:delete trusted_domains 1 2>/dev/null || true echo " ⏭️ Nextcloud is healthy, skipping fix"
docker exec nextcloud-app php /var/www/html/occ config:system:delete trusted_domains 2 2>/dev/null || true else
docker exec nextcloud-app php /var/www/html/occ config:system:set trusted_domains 0 --value="localhost" if docker ps | grep -q nextcloud-app; then
docker exec nextcloud-app php /var/www/html/occ config:system:set trusted_domains 1 --value="$VM_IP" docker exec nextcloud-app php /var/www/html/occ config:system:delete trusted_domains 1 2>/dev/null || true
docker exec nextcloud-app php /var/www/html/occ config:system:set trusted_domains 2 --value="${VM_IP}:8082" docker exec nextcloud-app php /var/www/html/occ config:system:delete trusted_domains 2 2>/dev/null || true
docker exec nextcloud-app php /var/www/html/occ config:system:set trusted_domains 3 --value="localhost:8082" docker exec nextcloud-app php /var/www/html/occ config:system:set trusted_domains 0 --value="localhost"
docker restart nextcloud-app docker exec nextcloud-app php /var/www/html/occ config:system:set trusted_domains 1 --value="$VM_IP"
echo " ✅ Nextcloud fixed" docker exec nextcloud-app php /var/www/html/occ config:system:set trusted_domains 2 --value="${VM_IP}:8082"
docker exec nextcloud-app php /var/www/html/occ config:system:set trusted_domains 3 --value="localhost:8082"
docker restart nextcloud-app
# Fix permissions for oc_admin on nextcloud tables
docker exec nextcloud-postgres psql -U nextcloud -d nextcloud -c "
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO oc_admin;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO oc_admin;
" 2>/dev/null || true
docker restart nextcloud-app
echo " ✅ Nextcloud trusted domains fixed"
else
echo " ⚠️ nextcloud-app not running"
fi
fi fi
# ---- MAUTIC ---- # ---- MAUTIC ----
echo "" echo ""
echo "📌 Mautic — Config + admin password..." echo "📌 Mautic — Config + admin password..."
if docker ps | grep -q mautic-app; then if container_is_healthy mautic-app; then
# Create config file echo " ⏭️ Mautic is healthy, skipping fix"
cat > /tmp/local.php << EOF else
if docker ps | grep -q mautic-app; then
cat > /tmp/mautic-local.php << EOF
<?php <?php
\$parameters = array( \$parameters = array(
'db_driver' => 'pdo_mysql', 'db_driver' => 'pdo_mysql',
'db_host' => 'mautic-mariadb', 'db_host' => 'mautic-mariadb',
'db_port' => '3306', 'db_port' => '3306',
'db_name' => 'mautic', 'db_name' => 'mautic',
'db_user' => 'mautic', 'db_user' => 'mautic',
'db_password' => 'mautic123', 'db_password' => 'mautic123',
'site_url' => 'http://${VM_IP}:8081' 'db_table_prefix' => '',
'site_url' => 'http://${VM_IP}:8081'
); );
EOF EOF
docker cp /tmp/local.php mautic-app:/var/www/html/config/local.php 2>/dev/null docker cp /tmp/mautic-local.php mautic-app:/var/www/html/config/local.php
docker exec mautic-app touch /var/www/html/var/.installed 2>/dev/null docker exec mautic-app touch /var/www/html/var/.installed 2>/dev/null || true
docker exec mautic-app chown -R www-data:www-data /var/www/html/var 2>/dev/null docker exec mautic-app chown -R www-data:www-data /var/www/html/var /var/www/html/config 2>/dev/null || true
docker exec mautic-app chown -R www-data:www-data /var/www/html/config 2>/dev/null docker restart mautic-app
docker restart mautic-app sleep 10
sleep 10
HASH=$(docker exec mautic-app php -r "echo password_hash('Admin!Password123', PASSWORD_BCRYPT);" 2>/dev/null) HASH=$(docker exec mautic-app php -r "echo password_hash('Admin!Password123', PASSWORD_BCRYPT);" 2>/dev/null || true)
if [ ! -z "$HASH" ]; then if [ -n "$HASH" ]; then
docker exec mautic-mariadb mysql -uroot -pmautic_root_password -e "USE mautic; UPDATE users SET password = '$HASH' WHERE username = 'admin';" 2>/dev/null docker exec mautic-mariadb mysql -uroot -pmautic_root_password \
echo " ✅ Admin password reset to: Admin!Password123" -e "USE mautic; UPDATE users SET password = '$HASH' WHERE username = 'admin';" 2>/dev/null || true
echo " ✅ Admin password → Admin!Password123"
fi
docker restart mautic-app
echo " ✅ Mautic fixed → http://${VM_IP}:8081/s/login"
else
echo " ⚠️ mautic-app not running"
fi fi
docker restart mautic-app
echo " ✅ Mautic fixed → http://${VM_IP}:8081 (admin/Admin!Password123)"
else
echo " ⚠️ mautic-app not running"
fi fi
# ---- ODOO ---- # ---- ODOO ----
echo "" echo ""
echo "📌 Odoo — Assets + DB user..." echo "📌 Odoo — Assets + DB user..."
if docker ps | grep -q odoo-clean-db-1; then if container_is_healthy odoo-clean-odoo-1; then
docker exec odoo-clean-db-1 psql -U odoo -d odoo -c "DELETE FROM ir_attachment WHERE url LIKE '/web/assets/%';" 2>/dev/null echo " ⏭️ Odoo is healthy, skipping fix"
docker exec odoo-clean-db-1 psql -U odoo -c "ALTER USER odoo WITH PASSWORD 'odoo';" 2>/dev/null else
docker exec odoo-clean-odoo-1 bash -c "grep -q 'filestore_check_missing' /etc/odoo/odoo.conf || echo 'filestore_check_missing = False' >> /etc/odoo/odoo.conf" 2>/dev/null if docker ps | grep -q odoo-clean-db-1; then
docker restart odoo-clean-odoo-1 docker exec odoo-clean-db-1 psql -U odoo -d odoo \
echo " ✅ Odoo fixed → http://${VM_IP}:8069/web" -c "DELETE FROM ir_attachment WHERE url LIKE '/web/assets/%';" 2>/dev/null || true
docker exec odoo-clean-db-1 psql -U odoo \
-c "ALTER USER odoo WITH PASSWORD 'odoo';" 2>/dev/null || true
docker exec odoo-clean-odoo-1 bash -c \
"grep -q 'filestore_check_missing' /etc/odoo/odoo.conf || echo 'filestore_check_missing = False' >> /etc/odoo/odoo.conf" 2>/dev/null || true
docker restart odoo-clean-odoo-1
echo " ✅ Odoo fixed → http://${VM_IP}:8069/web"
else
echo " ⚠️ odoo-clean-db-1 not running"
fi
fi fi
# ---- FRAPPE ---- # ---- FRAPPE ----
echo "" echo ""
echo "📌 Frappe — Full fix..." echo "📌 Frappe — DB permissions + cache + URL..."
if docker ps | grep -q frappe-erpnext && docker ps | grep -q frappe-mariadb; then if container_is_healthy frappe-erpnext; then
DB_NAME=$(docker exec frappe-erpnext cat /home/frappe/frappe-bench/sites/erpnext.navitrends.ovh/site_config.json 2>/dev/null | grep -o '"db_name": *"[^"]*"' | cut -d'"' -f4) echo " ⏭️ Frappe is healthy, skipping fix"
DB_PASS=$(docker exec frappe-erpnext cat /home/frappe/frappe-bench/sites/erpnext.navitrends.ovh/site_config.json 2>/dev/null | grep -o '"db_password": *"[^"]*"' | cut -d'"' -f4) else
if docker ps | grep -q frappe-erpnext && docker ps | grep -q frappe-mariadb; then
SITE_CONFIG="/home/frappe/frappe-bench/sites/erpnext.navitrends.ovh/site_config.json"
DB_NAME=$(docker exec frappe-erpnext cat "$SITE_CONFIG" 2>/dev/null \
| grep -o '"db_name": *"[^"]*"' | cut -d'"' -f4)
DB_PASS=$(docker exec frappe-erpnext cat "$SITE_CONFIG" 2>/dev/null \
| grep -o '"db_password": *"[^"]*"' | cut -d'"' -f4)
if [ -n "$DB_NAME" ] && [ -n "$DB_PASS" ]; then if [ -n "$DB_NAME" ] && [ -n "$DB_PASS" ]; then
echo " DB: $DB_NAME" echo " DB: $DB_NAME"
docker exec frappe-mariadb mysql -uroot -p123 -e "
GRANT ALL PRIVILEGES ON *.* TO '${DB_NAME}'@'%' IDENTIFIED BY '${DB_PASS}' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO '${DB_NAME}'@'172.%' IDENTIFIED BY '${DB_PASS}' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO '${DB_NAME}'@'localhost' IDENTIFIED BY '${DB_PASS}' WITH GRANT OPTION;
FLUSH PRIVILEGES;
" 2>/dev/null && echo " ✅ DB permissions fixed"
docker exec frappe-erpnext bash -c " docker exec frappe-mariadb mysql -uroot -p123 -e "
cd /home/frappe/frappe-bench GRANT ALL PRIVILEGES ON *.* TO '${DB_NAME}'@'%' IDENTIFIED BY '${DB_PASS}' WITH GRANT OPTION;
if [ ! -d 'apps/hrms' ]; then GRANT ALL PRIVILEGES ON *.* TO '${DB_NAME}'@'172.%' IDENTIFIED BY '${DB_PASS}' WITH GRANT OPTION;
bench get-app --branch version-15 https://github.com/frappe/hrms FLUSH PRIVILEGES;
fi " 2>/dev/null && echo " ✅ DB permissions fixed" || echo " ⚠️ DB grant failed"
bench --site erpnext.navitrends.ovh install-app hrms
" 2>/dev/null && echo " ✅ HRMS installed"
docker exec frappe-erpnext bash -c " docker exec frappe-erpnext bash -c "
cd /home/frappe/frappe-bench cd /home/frappe/frappe-bench
bench --site erpnext.navitrends.ovh set-config redis_cache 'redis://frappe-redis:6379' bench --site erpnext.navitrends.ovh set-config redis_cache 'redis://frappe-redis:6379'
bench --site erpnext.navitrends.ovh set-config redis_queue 'redis://frappe-redis:6379' bench --site erpnext.navitrends.ovh set-config redis_queue 'redis://frappe-redis:6379'
bench --site erpnext.navitrends.ovh set-config enable_scheduler 1 bench --site erpnext.navitrends.ovh set-config enable_scheduler 1
bench --site erpnext.navitrends.ovh set-config site_url 'http://${VM_IP}:8080' bench --site erpnext.navitrends.ovh set-config site_url 'http://${VM_IP}:8080'
bench --site erpnext.navitrends.ovh migrate bench --site erpnext.navitrends.ovh migrate
bench --site erpnext.navitrends.ovh clear-cache bench --site erpnext.navitrends.ovh clear-cache
bench use erpnext.navitrends.ovh " 2>/dev/null && echo " ✅ Frappe configured" || echo " ⚠️ Frappe config step had errors"
" 2>/dev/null && echo " ✅ Frappe configured"
# Start bench serve in background inside container docker restart frappe-erpnext
docker exec -d frappe-erpnext bash -c "cd /home/frappe/frappe-bench && nohup bench serve --port 8000 > /tmp/bench.log 2>&1 &" echo " ✅ Frappe fixed → http://${VM_IP}:8080"
docker restart frappe-erpnext else
echo " ✅ Frappe fixed → http://${VM_IP}:8080" echo " ⚠️ Could not read Frappe DB credentials"
fi
else else
echo " ⚠️ Could not get Frappe credentials" echo " ⚠️ Frappe containers not running"
fi fi
fi fi
# ---- N8N ---- # ---- N8N ----
echo "" echo ""
echo "📌 n8n — Network check..." echo "📌 n8n — Network check..."
docker network inspect integration-network &>/dev/null || docker network create integration-network if container_is_healthy n8n-app; then
echo " n8n → http://${VM_IP}:5678" echo " ⏭️ n8n is healthy, skipping fix"
else
docker network inspect integration-network &>/dev/null \
|| docker network create integration-network && echo " ✅ Created integration-network"
if ! docker ps | grep -q n8n-app; then
cd "$SCRIPT_DIR/compose-files/n8n-setup" && docker-compose up -d && cd "$SCRIPT_DIR"
fi
echo " ✅ n8n → http://${VM_IP}:5678"
fi
# -------------------------------------------------- # --------------------------------------------------
# Summary # Summary
@@ -276,7 +402,7 @@ echo "========================================="
echo "✅ RESTORE COMPLETE" echo "✅ RESTORE COMPLETE"
echo "=========================================" echo "========================================="
echo " Nextcloud → http://${VM_IP}:8082" echo " Nextcloud → http://${VM_IP}:8082"
echo " Mautic → http://${VM_IP}:8081 (admin/Admin!Password123)" echo " Mautic → http://${VM_IP}:8081/s/login (admin / Admin!Password123)"
echo " Odoo → http://${VM_IP}:8069/web" echo " Odoo → http://${VM_IP}:8069/web"
echo " n8n → http://${VM_IP}:5678" echo " n8n → http://${VM_IP}:5678"
echo " Frappe → http://${VM_IP}:8080" echo " Frappe → http://${VM_IP}:8080"