upgrade homarr to auto-fetch pinned version

This commit is contained in:
CrazyWolf13 2025-05-08 18:02:13 +02:00
parent e828a503d3
commit 81bbdb1bab
2 changed files with 10 additions and 20 deletions

View File

@ -117,11 +117,11 @@ node apps/nextjs/server.js & PID=$!
wait $PID wait $PID
EOF EOF
chmod +x /opt/run_homarr.sh chmod +x /opt/run_homarr.sh
curl -fsSL "https://github.com/homarr-labs/homarr/archive/refs/tags/v${RELEASE}.zip" -o $(basename "https://github.com/homarr-labs/homarr/archive/refs/tags/v${RELEASE}.zip") NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.engines.node | split(">=")[1] | split(".")[0]')
unzip -q v${RELEASE}.zip NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.packageManager | split("@")[1]')"
rm -rf v${RELEASE}.zip install_node_and_modules
rm -rf /opt/homarr rm -rf /opt/homarr
mv homarr-${RELEASE} /opt/homarr fetch_and_deploy_gh_release "homarr-labs/homarr"
mv /opt/homarr-data-backup/.env /opt/homarr/.env mv /opt/homarr-data-backup/.env /opt/homarr/.env
cd /opt/homarr cd /opt/homarr
$STD pnpm install $STD pnpm install

View File

@ -23,27 +23,17 @@ $STD apt-get install -y \
build-essential \ build-essential \
nginx \ nginx \
gettext \ gettext \
jq \
openssl openssl
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
msg_info "Setting up Node.js Repository" NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.engines.node | split(">=")[1] | split(".")[0]')
mkdir -p /etc/apt/keyrings NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.packageManager | split("@")[1]')"
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg install_node_and_modules
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list fetch_and_deploy_gh_release "homarr-labs/homarr"
msg_ok "Set up Node.js Repository"
msg_info "Installing Node.js/pnpm" msg_info "Installing Homarr"
$STD apt-get update
$STD apt-get install -y nodejs
$STD npm install -g pnpm@latest
msg_ok "Installed Node.js/pnpm"
msg_info "Installing Homarr (Patience)"
cd /opt cd /opt
RELEASE=$(curl -fsSL https://api.github.com/repos/homarr-labs/homarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
curl -fsSL "https://github.com/homarr-labs/homarr/archive/refs/tags/v${RELEASE}.zip" -o $(basename "https://github.com/homarr-labs/homarr/archive/refs/tags/v${RELEASE}.zip")
unzip -q v${RELEASE}.zip
mv homarr-${RELEASE} /opt/homarr
mkdir -p /opt/homarr_db mkdir -p /opt/homarr_db
touch /opt/homarr_db/db.sqlite touch /opt/homarr_db/db.sqlite
SECRET_ENCRYPTION_KEY="$(openssl rand -hex 32)" SECRET_ENCRYPTION_KEY="$(openssl rand -hex 32)"