Browse Source

Merge pull request #5159 from drupol/let-customize-pip-install

feat: add `OVERRIDE_PIP_INSTALL` env. variable
Timothy Jaeryang Baek 8 tháng trước cách đây
mục cha
commit
83574ccf6c

+ 3 - 3
.github/workflows/integration-test.yml

@@ -157,7 +157,7 @@ jobs:
           GLOBAL_LOG_LEVEL: debug
         run: |
           cd backend
-          uvicorn main:app --port "8080" --forwarded-allow-ips '*' &
+          uvicorn open_webui.main:app --port "8080" --forwarded-allow-ips '*' &
           UVICORN_PID=$!
           # Wait up to 40 seconds for the server to start
           for i in {1..40}; do
@@ -184,7 +184,7 @@ jobs:
           DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres
         run: |
           cd backend
-          uvicorn main:app --port "8081" --forwarded-allow-ips '*' &
+          uvicorn open_webui.main:app --port "8081" --forwarded-allow-ips '*' &
           UVICORN_PID=$!
           # Wait up to 20 seconds for the server to start
           for i in {1..20}; do
@@ -230,7 +230,7 @@ jobs:
 #          DATABASE_URL: mysql://root:mysql@localhost:3306/mysql
 #        run: |
 #          cd backend
-#          uvicorn main:app --port "8083" --forwarded-allow-ips '*' &
+#          uvicorn open_webui.main:app --port "8083" --forwarded-allow-ips '*' &
 #          UVICORN_PID=$!
 #          # Wait up to 20 seconds for the server to start
 #          for i in {1..20}; do

+ 4 - 0
backend/open_webui/env.py

@@ -96,6 +96,10 @@ except importlib.metadata.PackageNotFoundError:
     pass
 
 
+PIP_INSTALL = (
+    os.environ.get("PIP_INSTALL") if os.environ.get("PIP_INSTALL") else PIP_INSTALL
+)
+
 if PIP_INSTALL:
     PACKAGE_DATA = {"version": importlib.metadata.version("open-webui")}
 else:

+ 1 - 1
backend/start_windows.bat

@@ -30,4 +30,4 @@ IF "%WEBUI_SECRET_KEY%%WEBUI_JWT_SECRET_KEY%" == " " (
 
 :: Execute uvicorn
 SET "WEBUI_SECRET_KEY=%WEBUI_SECRET_KEY%"
-uvicorn main:app --host "%HOST%" --port "%PORT%" --forwarded-allow-ips '*'
+uvicorn open_webui.main:app --host "%HOST%" --port "%PORT%" --forwarded-allow-ips '*'