mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-11 21:32:11 +02:00
Homarr: replace the musl better-sqlite3 that v2.3.0 ships for Debian (#17789)
The build-debian tarballs of v2.3.0 carry the Alpine build of better_sqlite3.node, so the DB migration dies with ERR_DLOPEN_FAILED on libc.musl and Homarr no longer starts after an update (#17783, homarr-labs/homarr#7097). When the bundled module is musl, swap in better-sqlite3's own glibc prebuild for the running Node ABI. The update runs the check outside the release check, so containers already on 2.3.0 are repaired too; it does nothing once upstream ships a correct tarball.
This commit is contained in:
committed by
GitHub
parent
8befe84437
commit
bb1ec9e608
@@ -85,6 +85,18 @@ EOF
|
|||||||
msg_ok "Started Services"
|
msg_ok "Started Services"
|
||||||
msg_ok "Updated successfully!"
|
msg_ok "Updated successfully!"
|
||||||
fi
|
fi
|
||||||
|
# v2.3.0's Debian build ships a musl better-sqlite3 (homarr-labs/homarr#7097).
|
||||||
|
mapfile -t MUSL_MODULES < <(find /opt/homarr -name better_sqlite3.node -exec grep -aqE "ld-musl|libc\.musl" {} \; -print)
|
||||||
|
if ((${#MUSL_MODULES[@]})); then
|
||||||
|
msg_info "Replacing musl better-sqlite3 build"
|
||||||
|
BSQ_VERSION=$(jq -r .version /opt/homarr/node_modules/better-sqlite3/package.json)
|
||||||
|
curl_with_retry "https://github.com/WiseLibs/better-sqlite3/releases/download/v${BSQ_VERSION}/better-sqlite3-v${BSQ_VERSION}-node-v$(node -p process.versions.modules)-linux-$(arch_resolve "x64" "arm64").tar.gz" /tmp/better-sqlite3.tar.gz
|
||||||
|
tar -xzf /tmp/better-sqlite3.tar.gz -C /tmp build/Release/better_sqlite3.node
|
||||||
|
for module in "${MUSL_MODULES[@]}"; do cp /tmp/build/Release/better_sqlite3.node "$module"; done
|
||||||
|
rm -rf /tmp/better-sqlite3.tar.gz /tmp/build
|
||||||
|
systemctl restart homarr
|
||||||
|
msg_ok "Replaced musl better-sqlite3 build"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,18 @@ NODE_VERSION=$(curl -s https://raw.githubusercontent.com/homarr-labs/homarr/dev/
|
|||||||
setup_nodejs
|
setup_nodejs
|
||||||
fetch_and_deploy_gh_release "homarr" "homarr-labs/homarr" "prebuild" "latest" "/opt/homarr" "build-debian-$(arch_resolve).tar.gz"
|
fetch_and_deploy_gh_release "homarr" "homarr-labs/homarr" "prebuild" "latest" "/opt/homarr" "build-debian-$(arch_resolve).tar.gz"
|
||||||
|
|
||||||
|
# v2.3.0's Debian build ships a musl better-sqlite3 (homarr-labs/homarr#7097).
|
||||||
|
mapfile -t MUSL_MODULES < <(find /opt/homarr -name better_sqlite3.node -exec grep -aqE "ld-musl|libc\.musl" {} \; -print)
|
||||||
|
if ((${#MUSL_MODULES[@]})); then
|
||||||
|
msg_info "Replacing musl better-sqlite3 build"
|
||||||
|
BSQ_VERSION=$(jq -r .version /opt/homarr/node_modules/better-sqlite3/package.json)
|
||||||
|
curl_with_retry "https://github.com/WiseLibs/better-sqlite3/releases/download/v${BSQ_VERSION}/better-sqlite3-v${BSQ_VERSION}-node-v$(node -p process.versions.modules)-linux-$(arch_resolve "x64" "arm64").tar.gz" /tmp/better-sqlite3.tar.gz
|
||||||
|
tar -xzf /tmp/better-sqlite3.tar.gz -C /tmp build/Release/better_sqlite3.node
|
||||||
|
for module in "${MUSL_MODULES[@]}"; do cp /tmp/build/Release/better_sqlite3.node "$module"; done
|
||||||
|
rm -rf /tmp/better-sqlite3.tar.gz /tmp/build
|
||||||
|
msg_ok "Replaced musl better-sqlite3 build"
|
||||||
|
fi
|
||||||
|
|
||||||
msg_info "Installing Homarr"
|
msg_info "Installing Homarr"
|
||||||
mkdir -p /opt/homarr_db
|
mkdir -p /opt/homarr_db
|
||||||
touch /opt/homarr_db/db.sqlite
|
touch /opt/homarr_db/db.sqlite
|
||||||
|
|||||||
Reference in New Issue
Block a user