feat: add support for font management - #41
Conversation
4ed53bd to
db1c9d9
Compare
TL;DRThe CRUD parts (list/upload/delete fonts) are solid — proper magic-byte validation, extension whitelist, symlink-safe listing, and filename sanitisation that genuinely blocks path traversal. That part's fine. The Findings, ranked1. Blocker — the service-restart step can never succeed. 2. Blocker — the upstream failure detection is dead code, so "done" can't be trusted either. 3. High — 4. High — security: bearer-auth reuses the shared integration JWT secret with no tenant scoping, and has no producer or consumer anywhere in the ecosystem. Verifies bearer tokens against 5. Medium — missing 6. Medium — 7. Low — the route-ordering comment is fabricated reasoning. "Registered BEFORE DELETE /:name so Express doesn't treat 'regenerate' as a name param" — verified empirically with both orderings: identical behaviour, because 8. Low — cleanup. Already fine — not re-raising: path traversal is genuinely blocked ( Bottom line: the CRUD half is solid. The regeneration half guessed at infrastructure behaviour (privilege model, process management, cache invalidation) instead of checking the sudoers file, supervisor config, and nginx cache setup that actually define it — and got each one wrong in a different way. Please rework that part against |
f9c53eb to
57710f7
Compare
Re-review of the force-push (db1c9d9 → 5771075)Re-verified finding by finding against the packaging repos, not just the diff. Short version: the regenerate pipeline is now architecturally correct — generate via the sudoers grant, restart via the new Finding-by-finding status1. Restart step — fixed, with a shipping dependency. The 2. Upstream failure detection — documented, not fixed. The status comment now says plainly that 3. nginx reload — fixed properly. 4. Bearer auth — partially fixed. A finite 5. Missing sudo — fixed. Now invoked through the grant. (This does mean uploaded-font parsing runs as root again — same as the documented manual procedure, so not a regression introduced here, but it stays on the radar.) 6. EO_ROOT / LD_LIBRARY_PATH — fixed. Dead env override removed; each script resolves its own paths. 7. Fabricated route-ordering comments — removed. 8. Cleanup — mostly fixed. Output capping is now actually correct (buffer accumulation, single UTF-8 decode, real 4 KB cap), and Not previously raised, worth a check before merge:
Bottom line: with #14 merged and shipped first, the regeneration design is sound. Remaining asks before merge: resolve the #39/#41 duplication, and preferably turn the single-tenant comment into an actual multitenant guard on the bearer path. |
Addendum — findings from the adversarial verification passAn independent cold review of the current head completed after the re-review above; it confirmed all of its conclusions and surfaced the following new items, each re-verified against source before posting. None block the architecture — the merge-order and #39 asks above stand unchanged — but several are worth fixing while the file is open. New findings, ranked1. The #14 dependency fails half-applied, not cleanly. Sharpening the point above: when regenerate runs against a package without #14, step 1 ( 2. Upload write follows symlinks, isn't atomic, and silently overwrites. 3. Non-ASCII font names are mangled into colliding underscores. Node decodes header bytes as latin1, so 4. Oversized uploads return 500, not 413. body-parser throws with 5. 6. Listing 500s on a concurrent delete. The filter guards 7. Output capping applied to one child, forgotten for two. 8. Bearer secret doesn't follow runtime config rotation. 9. Hardening: no Origin check anywhere on the API. 10. Small stuff. |
57710f7 to
6a48f12
Compare
|
WOFF/WOFF2 are supported by allfontsgen |
0a2a092 to
ea076b6
Compare
|
TL;DR: Prior review's asks (atomicity, non-ASCII filenames, CSRF/Origin, output capping, timeouts, race conditions) are genuinely fixed — nice work. Two new findings before merge, both in explanatory comments rather than logic, plus one still-open cross-PR item:
Detail1. Multitenant "fallback" doesn't restore tenant isolation ( The comment blocks bearer auth in multitenant mode and tells operators to use the cookie path (admin browser login) instead, on the basis that the bearer path's shared secret + unpartitioned font directory would allow cross-tenant access. But the cookie path doesn't fix that: Suggested fix: either drop the "use cookie path instead" claim and document that multitenant + NC-admin font management isn't supported yet, or actually tenant-scope 2. Bearer-secret-rotation comment is incorrect ( Claims the secret is "read per-request so runtime config rotation (PATCH /admin/api/v1/config) is reflected without an AdminPanel restart." Traced: Suggested fix: delete the false claim, or actually wire this router through 3. server#39 duplication still unresolved Verified via |
ea076b6 to
238f1a9
Compare
|
TL;DR: Both previously-flagged comments are fixed — the false secret-rotation claim is replaced with an honest note, and the misleading "use the cookie path instead" advice is gone. On re-verifying against the current head ( DetailFixed — confirmed against source, not just the comment text:
Still open — the residual gap the new comment doesn't cover:
Suggested fix: either extend the Minor, carried forward unfixed:
New minor findings:
|
238f1a9 to
2f14cbf
Compare
added routing for the admin panel Signed-off-by: dsyzov <dmytro.syzov@nextcloud.com>
2f14cbf to
94ce11e
Compare
moodyjmz
left a comment
There was a problem hiding this comment.
Multitenant cookie-path gap is fixed — the check moved to a single router-level router.use() gate that runs before either auth branch, closing the hole where cookie-login sessions bypassed tenant isolation. DELETE double-decode and the unmounted-volume mkdir issue are both fixed too. Remaining two items (SIGTERM can't kill a sudo child on timeout; dropped filename charset whitelist) are now honestly documented as accepted trade-offs rather than silently wrong — not blocking, worth a follow-up issue if regen usage patterns change. Approving.
|
All three PRs in this chain are approved now — #14, #41, and this one. Every substantive finding across the rounds got a real fix rather than a cosmetic one (the multitenant gate, the demo-mode guard, the font-name encoding contract), which isn't the default outcome for a fast-turnaround fix cycle, so — well done. #39 stays out of scope per your note; that's a separate call for whoever owns that decision, not a blocker on any of these three. |
Added routing for the admin panel.
Details
REST API mounted at /admin/api/v1/fonts:
GET @ / - List installed custom fonts
POST @ / - Upload a font (application/octet-stream, X-Font-Name header)
DELETE @ /:name - Delete a font by filename
POST @ /regenerate - Start async font cache regeneration
Files
AdminPanel/server/sources/routes/fonts/router.js - new file - the fonts router
AdminPanel/server/sources/server.js - mounts the fonts router at /admin/api/v1/fonts
Notes
Euro-Office/document-server-package#14 is to be merged first.
Assisted-by: Claude Code (Opus-4.8)