[PR #4257] [MERGED] fix: pdf gen static path resolution #8227

Closed
opened 2025-11-11 17:48:13 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/4257
Author: @thearyadev
Created: 8/1/2024
Status: Merged
Merged: 8/1/2024
Merged by: @tjbck

Base: devHead: fix/pdf-gen-static-path


📝 Commits (1)

  • b7ad470 fix: static dir path resolution

📊 Changes

1 file changed (+15 additions, -2 deletions)

View changed files

📝 backend/apps/webui/routers/utils.py (+15 -2)

📄 Description

Changelog Entry

Description

when running in different environments, the static_path is different. This path is now 'determined' at runtime

Changed

  • in the pdf creation endpoint, the static path is determined at runtime by checking if the file exists, and getting the environments site packages directory.

Fixed

#4236

pdf gen fails because it cant find the static/fonts directory when installed using any method outside of docker (including in dev)


Additional Information

  • probably works fine on windows. (if someone would like to test this for me, that would be awesome)
  • since the static path resolution can vary, including in dev, it may be better to use a cli arg or environment variable to override the docker behaviour instead of trying to find this directory at runtime.

verified in:

  • linux pip install
  • linux pip install -e . (dev)
  • linux docker
  • windows pip install/pip install -e .

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/4257 **Author:** [@thearyadev](https://github.com/thearyadev) **Created:** 8/1/2024 **Status:** ✅ Merged **Merged:** 8/1/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix/pdf-gen-static-path` --- ### 📝 Commits (1) - [`b7ad470`](https://github.com/open-webui/open-webui/commit/b7ad47017d131c4c9b28e7b255a5c231afdcf05b) fix: static dir path resolution ### 📊 Changes **1 file changed** (+15 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `backend/apps/webui/routers/utils.py` (+15 -2) </details> ### 📄 Description # Changelog Entry ## Description when running in different environments, the static_path is different. This path is now 'determined' at runtime ## Changed - in the pdf creation endpoint, the static path is determined at runtime by checking if the file exists, and getting the environments site packages directory. ## Fixed #4236 pdf gen fails because it cant find the static/fonts directory when installed using any method outside of docker (including in dev) --- # Additional Information - probably works fine on windows. (if someone would like to test this for me, that would be awesome) - since the static path resolution can vary, including in dev, it may be better to use a cli arg or environment variable to override the docker behaviour instead of trying to find this directory at runtime. ## verified in: - [x] linux `pip install` - [x] linux `pip install -e .` (dev) - [x] linux docker - [ ] **windows** `pip install`/`pip install -e .` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-11 17:48:13 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#8227