mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-05-15 16:20:25 +00:00
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:
parent
35c0d269ac
commit
38cf296a4c
15
ct/homarr.sh
15
ct/homarr.sh
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||||
# Copyright (c) 2021-2025 tteck
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
# Author: tteck (tteckster) | Co-Author: MickLesk (Canbiz) | Co-Author: CrazyWolf13
|
# Author: CrazyWolf13
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
# Source: https://homarr.dev/
|
# Source: https://homarr.dev/
|
||||||
|
|
||||||
@ -117,11 +117,12 @@ 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")
|
$STD command -v jq || $STD apt-get update && $STD apt-get install -y jq
|
||||||
unzip -q 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]')
|
||||||
rm -rf v${RELEASE}.zip
|
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
|
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
|
||||||
@ -167,4 +168,4 @@ description
|
|||||||
msg_ok "Completed Successfully!\n"
|
msg_ok "Completed Successfully!\n"
|
||||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||||
echo -e "${INFO}${YW} Access it using the following URL:${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}"
|
||||||
|
@ -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"
|
|
||||||
$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)"
|
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)"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user