Skip to content

Commit 38cf296

Browse files
authored
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
1 parent 35c0d26 commit 38cf296

File tree

2 files changed

+13
-22
lines changed

2 files changed

+13
-22
lines changed

ct/homarr.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3-
# Copyright (c) 2021-2025 tteck
4-
# Author: tteck (tteckster) | Co-Author: MickLesk (Canbiz) | Co-Author: CrazyWolf13
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: CrazyWolf13
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://homarr.dev/
77

@@ -117,11 +117,12 @@ node apps/nextjs/server.js & PID=$!
117117
wait $PID
118118
EOF
119119
chmod +x /opt/run_homarr.sh
120-
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")
121-
unzip -q v${RELEASE}.zip
122-
rm -rf v${RELEASE}.zip
120+
$STD command -v jq || $STD apt-get update && $STD apt-get install -y jq
121+
NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.engines.node | split(">=")[1] | split(".")[0]')
122+
NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.packageManager | split("@")[1]')"
123+
install_node_and_modules
123124
rm -rf /opt/homarr
124-
mv homarr-${RELEASE} /opt/homarr
125+
fetch_and_deploy_gh_release "homarr-labs/homarr"
125126
mv /opt/homarr-data-backup/.env /opt/homarr/.env
126127
cd /opt/homarr
127128
$STD pnpm install
@@ -167,4 +168,4 @@ description
167168
msg_ok "Completed Successfully!\n"
168169
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
169170
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
170-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7575${CL}"
171+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7575${CL}"

install/homarr-install.sh

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,17 @@ $STD apt-get install -y \
2323
build-essential \
2424
nginx \
2525
gettext \
26+
jq \
2627
openssl
2728
msg_ok "Installed Dependencies"
2829

29-
msg_info "Setting up Node.js Repository"
30-
mkdir -p /etc/apt/keyrings
31-
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
32-
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
33-
msg_ok "Set up Node.js Repository"
34-
35-
msg_info "Installing Node.js/pnpm"
36-
$STD apt-get update
37-
$STD apt-get install -y nodejs
38-
$STD npm install -g pnpm@latest
39-
msg_ok "Installed Node.js/pnpm"
30+
NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.engines.node | split(">=")[1] | split(".")[0]')
31+
NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/package.json | jq -r '.packageManager | split("@")[1]')"
32+
install_node_and_modules
33+
fetch_and_deploy_gh_release "homarr-labs/homarr"
4034

4135
msg_info "Installing Homarr (Patience)"
4236
cd /opt
43-
RELEASE=$(curl -fsSL https://api.github.com/repos/homarr-labs/homarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
44-
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")
45-
unzip -q v${RELEASE}.zip
46-
mv homarr-${RELEASE} /opt/homarr
4737
mkdir -p /opt/homarr_db
4838
touch /opt/homarr_db/db.sqlite
4939
SECRET_ENCRYPTION_KEY="$(openssl rand -hex 32)"

0 commit comments

Comments
 (0)