homarr: fetch versions dynamically from source repo (#4409)

* pull homarr version dynamically from source repo

* fix homarr install to directly fetch pnpm and node version
This commit is contained in:
Tobias 2025-05-12 20:22:48 +02:00 committed by GitHub
parent 35c0d269ac
commit 38cf296a4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 22 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 tteck
# Author: tteck (tteckster) | Co-Author: MickLesk (Canbiz) | Co-Author: CrazyWolf13
# Copyright (c) 2021-2025 community-scripts ORG
# Author: CrazyWolf13
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://homarr.dev/
@ -117,11 +117,12 @@ node apps/nextjs/server.js & PID=$!
wait $PID
EOF
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")
unzip -q v${RELEASE}.zip
rm -rf v${RELEASE}.zip
$STD command -v jq || $STD apt-get update && $STD apt-get install -y jq
NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.engines.node | split(">=")[1] | split(".")[0]')
NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.packageManager | split("@")[1]')"
install_node_and_modules
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
cd /opt/homarr
$STD pnpm install
@ -167,4 +168,4 @@ description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7575${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7575${CL}"

View File

@ -23,27 +23,17 @@ $STD apt-get install -y \
build-essential \
nginx \
gettext \
jq \
openssl
msg_ok "Installed Dependencies"
msg_info "Setting up Node.js Repository"
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
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
msg_ok "Set up Node.js Repository"
msg_info "Installing Node.js/pnpm"
$STD apt-get update
$STD apt-get install -y nodejs
$STD npm install -g pnpm@latest
msg_ok "Installed Node.js/pnpm"
NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.engines.node | split(">=")[1] | split(".")[0]')
NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.packageManager | split("@")[1]')"
install_node_and_modules
fetch_and_deploy_gh_release "homarr-labs/homarr"
msg_info "Installing Homarr (Patience)"
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
touch /opt/homarr_db/db.sqlite
SECRET_ENCRYPTION_KEY="$(openssl rand -hex 32)"