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.
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
windowspip 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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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:
dev← Head:fix/pdf-gen-static-path📝 Commits (1)
b7ad470fix: 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
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
verified in:
pip installpip install -e .(dev)pip install/pip install -e .🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.