Skip to content

Commit 2ab3260

Browse files
committed
Release v0.1.4
1 parent 5f14813 commit 2ab3260

File tree

14 files changed

+61
-552
lines changed

14 files changed

+61
-552
lines changed

.env.dev.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,14 @@ DEV_WEB_LIBRARY_PORT=8281
1616
# Base URL that Web Library should use for opening PDFs via the proxy.
1717
# In local dev this is typically http://localhost:8280/pdf
1818
DEV_PDF_PROXY_BASE_URL=http://localhost:8280/pdf
19+
20+
# Metadata source for Web Library (runtime templating)
21+
# Defaults target zotero.org; set to your account to mirror zotero.org metadata.
22+
ZOTERO_API_KEY=
23+
ZOTERO_API_AUTHORITY_PART=api.zotero.org
24+
ZOTERO_USER_SLUG=changeme-user-slug
25+
ZOTERO_USER_ID=0
26+
ZOTERO_INCLUDE_MY_LIBRARY=true
27+
ZOTERO_INCLUDE_USER_GROUPS=true
28+
# JSON array of extra libraries/groups to include (e.g., [{"key":"g123","name":"Team","isGroupLibrary":true}])
29+
ZOTERO_LIBRARIES_INCLUDE_JSON=[]

.env.portainer.example

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ WEB_LIBRARY_PORT=8281
1414
# Base URL that the Web Library should use when linking to the PDF proxy (update to your staging hostname/IP)
1515
PDF_PROXY_BASE_URL=http://nas.local:8280/pdf
1616

17-
# Metadata source (used at build time for the Web Library image)
17+
# Metadata source (runtime templating for the Web Library)
1818
# If you host metadata on zotero.org (default):
1919
# ZOTERO_API_KEY: your Zotero API key
2020
# ZOTERO_API_AUTHORITY_PART: api.zotero.org
21+
# ZOTERO_INCLUDE_USER_GROUPS: true to show your groups from zotero.org
2122
# If you host metadata on-prem (custom API host):
2223
# ZOTERO_API_KEY: on-prem API token (if required)
2324
# ZOTERO_API_AUTHORITY_PART: e.g., nas.local:8080 (your on-prem metadata host)
25+
# You must set ZOTERO_USER_SLUG and ZOTERO_USER_ID to your account to mirror zotero.org data.
2426
ZOTERO_API_KEY=changeme-zotero-api-key
2527
ZOTERO_API_AUTHORITY_PART=api.zotero.org
2628
ZOTERO_USER_SLUG=changeme-user-slug
2729
ZOTERO_USER_ID=1234567
30+
ZOTERO_INCLUDE_MY_LIBRARY=true
31+
ZOTERO_INCLUDE_USER_GROUPS=true
32+
# JSON array of explicit libraries/groups to include (e.g., [{"key":"g123","name":"Team","isGroupLibrary":true}])
33+
ZOTERO_LIBRARIES_INCLUDE_JSON=[]

.env.stage.example

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ WEB_LIBRARY_PORT=8281
1414
# Base URL that the Web Library should use when linking to the PDF proxy (update to your staging hostname/IP)
1515
PDF_PROXY_BASE_URL=http://nas.local:8280/pdf
1616

17-
# Optional: metadata source (used at build time for the Web Library image)
17+
# Metadata source (runtime templating for the Web Library)
1818
# If you host metadata on zotero.org (default):
1919
# ZOTERO_API_KEY: your Zotero API key
2020
# ZOTERO_API_AUTHORITY_PART: api.zotero.org
21+
# ZOTERO_INCLUDE_USER_GROUPS: true to show your groups from zotero.org
2122
# If you host metadata on-prem (custom API host):
2223
# ZOTERO_API_KEY: on-prem API token (if required)
2324
# ZOTERO_API_AUTHORITY_PART: e.g., nas.local:8080 (your on-prem metadata host)
25+
# You must set ZOTERO_USER_SLUG and ZOTERO_USER_ID to your account to mirror zotero.org data.
2426
ZOTERO_API_KEY=changeme-zotero-api-key
2527
ZOTERO_API_AUTHORITY_PART=api.zotero.org
2628
ZOTERO_USER_SLUG=changeme-user-slug
2729
ZOTERO_USER_ID=1234567
30+
ZOTERO_INCLUDE_MY_LIBRARY=true
31+
ZOTERO_INCLUDE_USER_GROUPS=true
32+
# JSON array of explicit libraries/groups to include (e.g., [{"key":"g123","name":"Team","isGroupLibrary":true}])
33+
ZOTERO_LIBRARIES_INCLUDE_JSON=[]

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

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

5+
## It is PoC
6+
It(v0.1.3) is still fully not properly works, please keep on watching to be ready for production.
7+
58
---
69

710
## 🚀 Overview
@@ -38,7 +41,7 @@ You get:
3841

3942
---
4043
## Screenshot
41-
[WebUI](./docs/assets/screenshot.png)
44+
![WebUI](./docs/assets/screenshot.png)
4245

4346
## 🧩 Architecture
4447

@@ -180,8 +183,14 @@ The sample data generator creates keys like `SAMPLE1` and `SAMPLE2` under `sampl
180183
- `.env.stage.example``.env.stage`: staging/NAS stack via `docker compose --env-file .env.stage up -d` (defaults to GHCR `:main` tags).
181184
- `.env.portainer.example``.env.portainer`: Portainer stack env file (same vars as staging) when deploying through the UI.
182185
- `.env` remains ignored; keep real secrets/paths out of the repo.
183-
- Metadata config (build-time for Web Library): optional `ZOTERO_API_KEY`, `ZOTERO_API_AUTHORITY_PART`, `ZOTERO_USER_SLUG`, `ZOTERO_USER_ID` to point the Web Library at zotero.org or an on-prem metadata source. Set in your env file before building the Web Library image.
186+
- Metadata config (runtime templating for Web Library): `ZOTERO_API_KEY`, `ZOTERO_API_AUTHORITY_PART`, `ZOTERO_USER_SLUG`, `ZOTERO_USER_ID`, `ZOTERO_INCLUDE_MY_LIBRARY`, `ZOTERO_INCLUDE_USER_GROUPS`, and `ZOTERO_LIBRARIES_INCLUDE_JSON` let you point at zotero.org or an on-prem metadata source. Set these in your env file so the container renders `index.html` with the correct API host/user/groups.
187+
188+
### Metadata configuration & troubleshooting
184189

190+
- Set `ZOTERO_USER_SLUG`/`ZOTERO_USER_ID` and `ZOTERO_API_AUTHORITY_PART` to the metadata host you want (defaults to zotero.org).
191+
- Control which libraries load with `ZOTERO_INCLUDE_MY_LIBRARY`, `ZOTERO_INCLUDE_USER_GROUPS`, and `ZOTERO_LIBRARIES_INCLUDE_JSON` (JSON array of `{ "key": "g123", "name": "Team", "isGroupLibrary": true }`).
192+
- Validate templating by viewing page source for `zotero-web-library-config`; wrong host/key/ID typically shows up as `Failed to fetch` in the browser console.
193+
- For on-prem hosts, ensure the metadata API is reachable from inside the container and that CORS allows the Web Library origin.
185194
---
186195

187196
## 🛠 Components

app/web-library-overlay/scripts/entrypoint.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ set -e
66
: "${ZOTERO_API_AUTHORITY_PART:=api.zotero.org}"
77
: "${ZOTERO_USER_SLUG:=zotero-user}"
88
: "${ZOTERO_USER_ID:=0}"
9+
: "${ZOTERO_INCLUDE_MY_LIBRARY:=true}"
10+
: "${ZOTERO_INCLUDE_USER_GROUPS:=true}"
11+
: "${ZOTERO_LIBRARIES_INCLUDE_JSON:=[]}"
912
: "${PDF_PROXY_BASE_URL:=http://localhost:8280/pdf}"
1013

1114
# Render index.html with current env vars (placeholders remain if empty)
1215
if [ -f /usr/share/nginx/html/index.html ]; then
1316
envsubst \
14-
'$ZOTERO_API_KEY $ZOTERO_API_AUTHORITY_PART $ZOTERO_USER_SLUG $ZOTERO_USER_ID $PDF_PROXY_BASE_URL' \
17+
'$ZOTERO_API_KEY $ZOTERO_API_AUTHORITY_PART $ZOTERO_USER_SLUG $ZOTERO_USER_ID $ZOTERO_INCLUDE_MY_LIBRARY $ZOTERO_INCLUDE_USER_GROUPS $ZOTERO_LIBRARIES_INCLUDE_JSON $PDF_PROXY_BASE_URL' \
1518
< /usr/share/nginx/html/index.html \
1619
> /usr/share/nginx/html/index.html.rendered
1720
mv /usr/share/nginx/html/index.html.rendered /usr/share/nginx/html/index.html

app/web-library-overlay/src/html/index.html

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,9 @@
2323
},
2424
"pdfProxyBaseUrl": "$PDF_PROXY_BASE_URL",
2525
"libraries": {
26-
"include": [
27-
{
28-
"key": "g729",
29-
"name": "All Things Zotero",
30-
"isGroupLibrary": true
31-
}
32-
],
33-
"includeMyLibrary": true,
34-
"includeUserGroups": false
26+
"include": $ZOTERO_LIBRARIES_INCLUDE_JSON,
27+
"includeMyLibrary": $ZOTERO_INCLUDE_MY_LIBRARY,
28+
"includeUserGroups": $ZOTERO_INCLUDE_USER_GROUPS
3529
}
3630
}
3731
</script>

docker-compose.dev.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ services:
1919
build:
2020
context: .
2121
dockerfile: Dockerfile.web-library
22+
environment:
23+
- PDF_PROXY_BASE_URL=${DEV_PDF_PROXY_BASE_URL:-http://localhost:8280/pdf}
24+
- ZOTERO_API_KEY=${ZOTERO_API_KEY:-}
25+
- ZOTERO_API_AUTHORITY_PART=${ZOTERO_API_AUTHORITY_PART:-api.zotero.org}
26+
- ZOTERO_USER_SLUG=${ZOTERO_USER_SLUG:-zotero-user}
27+
- ZOTERO_USER_ID=${ZOTERO_USER_ID:-0}
28+
- ZOTERO_INCLUDE_MY_LIBRARY=${ZOTERO_INCLUDE_MY_LIBRARY:-true}
29+
- ZOTERO_INCLUDE_USER_GROUPS=${ZOTERO_INCLUDE_USER_GROUPS:-true}
30+
- ZOTERO_LIBRARIES_INCLUDE_JSON=${ZOTERO_LIBRARIES_INCLUDE_JSON:-[]}
2231
ports:
2332
- "${DEV_WEB_LIBRARY_PORT:-8281}:80"
2433
depends_on:

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ services:
1313

1414
web-library:
1515
image: ${WEB_LIBRARY_IMAGE:-ghcr.io/joonsoome/on-prem-zotero-webui/web-library:main}
16+
environment:
17+
- PDF_PROXY_BASE_URL=${PDF_PROXY_BASE_URL:-http://localhost:8280/pdf}
18+
- ZOTERO_API_KEY=${ZOTERO_API_KEY:-}
19+
- ZOTERO_API_AUTHORITY_PART=${ZOTERO_API_AUTHORITY_PART:-api.zotero.org}
20+
- ZOTERO_USER_SLUG=${ZOTERO_USER_SLUG:-zotero-user}
21+
- ZOTERO_USER_ID=${ZOTERO_USER_ID:-0}
22+
- ZOTERO_INCLUDE_MY_LIBRARY=${ZOTERO_INCLUDE_MY_LIBRARY:-true}
23+
- ZOTERO_INCLUDE_USER_GROUPS=${ZOTERO_INCLUDE_USER_GROUPS:-true}
24+
- ZOTERO_LIBRARIES_INCLUDE_JSON=${ZOTERO_LIBRARIES_INCLUDE_JSON:-[]}
1625
ports:
1726
- "${WEB_LIBRARY_PORT:-8281}:80"
1827
depends_on:

0 commit comments

Comments
 (0)