Skip to content

Commit 62fbd7d

Browse files
committed
overlay: use proxy URL for export annotations; bump v0.1.13
1 parent 2377ef2 commit 62fbd7d

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

.env.portainer.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Portainer stack environment (example values). Copy to `.env.portainer` for Portainer UI deployment.
22

33
# GHCR images to deploy (choose tags built by CI) — default to a pinned release tag
4-
PDF_PROXY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/pdf-proxy:v0.1.12
5-
WEB_LIBRARY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/web-library:v0.1.12
4+
PDF_PROXY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/pdf-proxy:v0.1.13
5+
WEB_LIBRARY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/web-library:v0.1.13
66

77
# Host path for Zotero WebDAV data mounted into the proxy container
88
ZOTERO_ROOT_HOST_PATH=/volume1/Reference/zotero

.env.stage.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Staging/NAS environment configuration (example values). Copy to `.env.stage` on the staging host.
22

33
# GHCR images to deploy (choose tags built by CI) — default to a pinned release tag
4-
PDF_PROXY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/pdf-proxy:v0.1.12
5-
WEB_LIBRARY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/web-library:v0.1.12
4+
PDF_PROXY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/pdf-proxy:v0.1.13
5+
WEB_LIBRARY_IMAGE=ghcr.io/joonsoome/on-prem-zotero-webui/web-library:v0.1.13
66

77
# Host path for Zotero WebDAV data mounted into the proxy container
88
ZOTERO_ROOT_HOST_PATH=/volume1/Reference/zotero

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**Self-hosted Zotero WebUI Opensource Library + WebDAV-based PDF viewer **Avoid storage fees, keep privacy, and still enjoy a full browser-based Zotero library.
44

55
## It is PoC
6-
It(v0.1.12) is still fully not properly works, please keep on watching to be ready for production.
6+
It(v0.1.13) is still fully not properly works, please keep on watching to be ready for production.
77

88
---
99

app/web-library-overlay/src/js/actions/attachments.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,20 @@ const exportAttachmentWithAnnotations = itemKey => {
200200
if (attachmentItem.contentType !== 'application/pdf') {
201201
throw new Error("Attachment is not a PDF");
202202
}
203+
const proxyUrl = getProxyPdfUrl(state, itemKey);
204+
const fetchUrl = proxyUrl || attachmentURL;
205+
if (proxyUrl) {
206+
console.log('[proxy-debug] exportAttachmentWithAnnotations -> proxy fetch', {
207+
itemKey,
208+
proxyUrl,
209+
});
210+
}
203211
const annotations = childItems
204212
.map(childItemKey => allItems[childItemKey])
205213
.filter(item => !item.deleted && item.itemType === 'annotation');
206214

207215
const pdfWorker = new PDFWorker({ pdfWorkerURL, pdfReaderCMapsURL, pdfReaderStandardFontsURL });
208-
const data = await (await fetch(attachmentURL)).arrayBuffer();
216+
const data = await (await fetch(fetchUrl)).arrayBuffer();
209217
const buf = await pdfWorker.export(data, annotations);
210218
const blob = new Blob([buf], { type: 'application/pdf' });
211219
const fileName = attachmentItem?.filename || 'file.pdf';

0 commit comments

Comments
 (0)