feat: add public share page with download support (#253)

Share links now point to /s/{token} (was /api/s/{token}) and render a
proper HTML page instead of raw JSON.

Changes:
- static/share.html: standalone public share page
- static/css/views/share-public.css: share page styles
- static/js/views/public/publicShare.js: client-side logic that fetches
  share metadata via /api/s/{token}, handles password-protected shares,
  and renders file download / folder info
- build.rs: include share.html in the HTML embed pipeline
- web/mod.rs: serve /s/{token} route (unauthenticated)
- share_dto.rs: generate URLs as /s/{token} instead of /api/s/{token}
- share_handler.rs: new download_shared_file() handler that validates the
  share token and streams file content without requiring authentication
- routes.rs: mount GET /api/s/{token}/download (public, uses AppState)
This commit is contained in:
Diocrafts
2026-04-12 01:51:30 +02:00
parent c512534bfa
commit edf1e66989
9 changed files with 449 additions and 6 deletions
+1
View File
@@ -24,6 +24,7 @@ const HTML_INCLUDE: &[&str] = &[
"admin.html",
"device-verify.html",
"nextcloud-login.html",
"share.html",
];
// ─── View CSS files linked directly in index.html (not via @import) ──────────