seafile: enable Metadata management + Views (Pro)

ENABLE_METADATA_MANAGEMENT=True + METADATA_SERVER_URL=http://seafile-md-server:8084 in seahub_settings.py. Library owners can now toggle metadata per library and create table/gallery/kanban Views over their files.
This commit is contained in:
Claudio on hubris
2026-05-12 19:25:14 +02:00
parent dc0780bcaf
commit 1ad56435e5

View File

@@ -42,6 +42,25 @@ Compose layout:
- `/mnt/library/seafile/data/` — bind-mounted to `/shared` in the seafile container. Holds config (`seafile/conf/`), logs (`seafile/logs/`), and the heavy block/fs/commit trees (`seafile/seafile-data/storage/`). Group-owned `:media` 2775. - `/mnt/library/seafile/data/` — bind-mounted to `/shared` in the seafile container. Holds config (`seafile/conf/`), logs (`seafile/logs/`), and the heavy block/fs/commit trees (`seafile/seafile-data/storage/`). Group-owned `:media` 2775.
- `/opt/seafile/mysql/` — mariadb data (small, stays on rootfs). - `/opt/seafile/mysql/` — mariadb data (small, stays on rootfs).
## Metadata / Views
Pro's per-library extended metadata (file tags, custom columns, table/gallery/kanban **Views**) is wired up:
- `seahub_settings.py` between `# BEGIN-HUBRIS-METADATA` / `# END-HUBRIS-METADATA`:
```python
ENABLE_METADATA_MANAGEMENT = True
METADATA_SERVER_URL = 'http://seafile-md-server:8084'
```
- The `seafile-md-server` container (see Stack table above) does the indexing; Seahub calls it via the docker-bridge DNS name `seafile-md-server`.
**Per-library activation:** owner of a library opens it in the web UI → top-right menu → **Metadata management** → toggle on. The first PUT to `/api/v2.1/repos/<id>/metadata/` causes the md-server to index the library (see `seaf-md-server.log`: "start initializing the metadata of the repo …"). Once enabled, the library sidebar shows "Views" where the user can create table / gallery / kanban views.
Pure-API enable for testing:
```
curl -X PUT -H "Authorization: Token <token>" https://files.hubris.network/api/v2.1/repos/<repo_id>/metadata/
# GET the same path returns: {"enabled":true, "tags_enabled":true, "show_view":true, ...}
```
## Auth ## Auth
Native OAuth2/OIDC against [authentik (124)](124-authentik.md). Configuration in `/mnt/library/seafile/data/seafile/conf/seahub_settings.py` between the `# BEGIN-HUBRIS-OAUTH` / `# END-HUBRIS-OAUTH` markers. Native OAuth2/OIDC against [authentik (124)](124-authentik.md). Configuration in `/mnt/library/seafile/data/seafile/conf/seahub_settings.py` between the `# BEGIN-HUBRIS-OAUTH` / `# END-HUBRIS-OAUTH` markers.
@@ -142,6 +161,9 @@ For now: stand up Seafile, kick the tires, decide later whether to:
## Changelog ## Changelog
### 2026-05-12 — enable Metadata management + Views
Added `ENABLE_METADATA_MANAGEMENT = True` and `METADATA_SERVER_URL = 'http://seafile-md-server:8084'` to `seahub_settings.py` (between BEGIN-HUBRIS-METADATA / END-HUBRIS-METADATA markers), restarted the `seafile` container. Library owners can now enable metadata per-library and create table/gallery/kanban Views. Verified end-to-end by enabling metadata on a throwaway admin-owned library — `GET /api/v2.1/repos/<id>/metadata/` returns `{"enabled":true, "show_view":true, ...}` and `seaf-md-server.log` shows the indexer ran.
### 2026-05-12 — add metadata + thumbnail servers ### 2026-05-12 — add metadata + thumbnail servers
Two more Pro services online: `seafile-md-server` (extended metadata, internal-only on :8084 over the docker bridge, no host port — enabled per-library from the Seahub UI) and `thumbnail-server` (offload thumbnail generation from Seahub, host-bound to `192.168.8.185:8081`). Caddy now splits `/thumbnail/*` → :8081 and everything else → :80; both blocks keep the resumable-upload header strip + 1 h transport timeouts. `INNER_SEAHUB_SERVICE_URL=http://seafile` in `.env` so the thumbnail server can call the Seahub container by DNS name for per-request permission checks (verified end-to-end: admin token → 403 for dtoro's repo via `POST /api/v2.1/internal/repos/.../check-thumbnail/user-token/`, i.e. routing works and perms are enforced). Two more Pro services online: `seafile-md-server` (extended metadata, internal-only on :8084 over the docker bridge, no host port — enabled per-library from the Seahub UI) and `thumbnail-server` (offload thumbnail generation from Seahub, host-bound to `192.168.8.185:8081`). Caddy now splits `/thumbnail/*` → :8081 and everything else → :80; both blocks keep the resumable-upload header strip + 1 h transport timeouts. `INNER_SEAHUB_SERVICE_URL=http://seafile` in `.env` so the thumbnail server can call the Seahub container by DNS name for per-request permission checks (verified end-to-end: admin token → 403 for dtoro's repo via `POST /api/v2.1/internal/repos/.../check-thumbnail/user-token/`, i.e. routing works and perms are enforced).