codgician 2025-08-12 23:35:39 +08:00
parent e9cf094eb4
commit 9a10f0dc0e
No known key found for this signature in database
2 changed files with 17 additions and 5 deletions

View File

@ -9,13 +9,13 @@
}:
let
pname = "open-webui";
version = "0.6.18";
version = "0.6.22";
src = fetchFromGitHub {
owner = "open-webui";
repo = "open-webui";
tag = "v${version}";
hash = "sha256-1V9mOhO8jpr0HU0djLjKw6xDQMBmqie6Gte4xfg9PfQ=";
hash = "sha256-SX2uLmDZu1TW45A6F5mSXVtSqv5rbNKuVw8sWj8tEb4=";
};
frontend = buildNpmPackage rec {
@ -32,7 +32,7 @@ let
url = "https://github.com/pyodide/pyodide/releases/download/${pyodideVersion}/pyodide-${pyodideVersion}.tar.bz2";
};
npmDepsHash = "sha256-bMqK9NvuTwqnhflGDfZTEkaFG8y34Qf94SgR0HMClrQ=";
npmDepsHash = "sha256-mMnDYMy1/7gW6XVaWVct9BuxDP78XX5u46lGBWjUvOQ=";
# See https://github.com/open-webui/open-webui/issues/15880
npmFlags = [
@ -161,6 +161,7 @@ python3Packages.buildPythonApplication rec {
opentelemetry-instrumentation-logging
opentelemetry-instrumentation-httpx
opentelemetry-instrumentation-aiohttp-client
oracledb
pandas
passlib
peewee
@ -172,6 +173,7 @@ python3Packages.buildPythonApplication rec {
posthog
psutil
psycopg2-binary
pyarrow
pycrdt
pydub
pyjwt

View File

@ -11,12 +11,22 @@ update-source-version open-webui "${version:1}" --file="$path"
# Fetch npm deps and pyodide
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT
curl -O --output-dir $tmpdir "https://raw.githubusercontent.com/open-webui/open-webui/refs/tags/${version}/package-lock.json"
curl -O --output-dir $tmpdir "https://raw.githubusercontent.com/open-webui/open-webui/refs/tags/${version}/package.json"
pushd $tmpdir
# Prefetch the npm dependencies hash
npm_hash=$(prefetch-npm-deps package-lock.json)
sed -i 's#npmDepsHash = "[^"]*"#npmDepsHash = "'"$npm_hash"'"#' "$path"
# Extract pyodide version
pyodide_version=$(sed -rn 's/^.*pyodide.*\^([0-9.]*)\".*$/\1/p' package.json)
popd
update-source-version open-webui.frontend "${pyodide_version}" --file="$path" --version-key=pyodideVersion --source-key=pyodide
rm -rf $tmpdir
# Update the pyodide version if necessary
current_pyodide_version=$(nix eval --raw -f . open-webui.frontend.pyodideVersion)
if [ "$current_pyodide_version" < "$pyodide_version" ]; then
update-source-version open-webui.frontend "${pyodide_version}" --file="$path" --version-key=pyodideVersion --source-key=pyodide
fi