From 9c59bdaea124c2a64e0fadc63ab97178239adaf7 Mon Sep 17 00:00:00 2001 From: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Date: Wed, 26 Feb 2025 23:23:03 +0100 Subject: [PATCH] Fix: Homarr - Manually correct db-migration wrong-folder (#2676) * Update homarr-install.sh * Update homarr.sh --- ct/homarr.sh | 10 ++++++++++ install/homarr-install.sh | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/ct/homarr.sh b/ct/homarr.sh index b24891889..6f88bd938 100644 --- a/ct/homarr.sh +++ b/ct/homarr.sh @@ -49,6 +49,11 @@ set +a export DB_DIALECT='sqlite' export AUTH_SECRET=$(openssl rand -base64 32) node /opt/homarr_db/migrations/$DB_DIALECT/migrate.cjs /opt/homarr_db/migrations/$DB_DIALECT +for dir in $(find /opt/homarr_db/migrations/migrations -mindepth 1 -maxdepth 1 -type d); do + dirname=$(basename "$dir") + mkdir -p "/opt/homarr_db/migrations/$dirname" + cp -r "$dir"/* "/opt/homarr_db/migrations/$dirname/" 2>/dev/null || true +done export HOSTNAME=$(ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+') envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf nginx -g 'daemon off;' & @@ -97,6 +102,11 @@ set +a export DB_DIALECT='sqlite' export AUTH_SECRET=$(openssl rand -base64 32) node /opt/homarr_db/migrations/$DB_DIALECT/migrate.cjs /opt/homarr_db/migrations/$DB_DIALECT +for dir in $(find /opt/homarr_db/migrations/migrations -mindepth 1 -maxdepth 1 -type d); do + dirname=$(basename "$dir") + mkdir -p "/opt/homarr_db/migrations/$dirname" + cp -r "$dir"/* "/opt/homarr_db/migrations/$dirname/" 2>/dev/null || true +done export HOSTNAME=$(ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+') envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf nginx -g 'daemon off;' & diff --git a/install/homarr-install.sh b/install/homarr-install.sh index d7f49bfac..2335133eb 100644 --- a/install/homarr-install.sh +++ b/install/homarr-install.sh @@ -92,6 +92,11 @@ set +a export DB_DIALECT='sqlite' export AUTH_SECRET=$(openssl rand -base64 32) node /opt/homarr_db/migrations/$DB_DIALECT/migrate.cjs /opt/homarr_db/migrations/$DB_DIALECT +for dir in $(find /opt/homarr_db/migrations/migrations -mindepth 1 -maxdepth 1 -type d); do + dirname=$(basename "$dir") + mkdir -p "/opt/homarr_db/migrations/$dirname" + cp -r "$dir"/* "/opt/homarr_db/migrations/$dirname/" 2>/dev/null || true +done export HOSTNAME=$(ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+') envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf nginx -g 'daemon off;' &