Share files and folders by link, to look at or to download, and turn a link off any time #148
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #148"
general
weight: 0.35
ethanteng
Why
There was no way to show somebody outside the household a folder of photos or a file without giving them an account. This adds links anyone can open without signing in: view only, or view and download. A link can be changed or turned off at any time, and stops working at once.
What changed
For the person sharing
PublicUrland no tunnel), the dialog and the page say nobody else can open links yet. Admins get a way into Settings.For whoever has the link (
/s/<token>, no account)Server
share_linkstable inhomebase.db, andShareLinksinHomebase.Core/Sharing. A link is found by the SHA-256 of a 32-byte random token, as sessions are. The token is also kept sealed underhost.key(AES-GCM, bound to owner and link id), only so its owner can copy it again.GET/POST /api/shares,PATCH/DELETE /api/shares/{id}. Another account gets404for links that aren't theirs./api/shared/{token}plus/files,/size,/file(inline preview),/downloadand/zip. The last two are refused with403on a view-only link./api/files/moveand/renamecarry links along with what moved./deletedrops whatever is gone from links, checked per path after the delete, so a delete that stops partway still lets go of what went. A link left with nothing is removed.LibraryService.ZipAsync). .NET 10'sZipArchivestill writes its data descriptors and central directory synchronously, which Kestrel refuses. A smallDeferredWritesstream holds those bytes and sends them ahead of the next async write. I measured at most 207 bytes held while zipping a 5 MB file, so the file data itself streams.For reviewers
SharePreview). It's servedinlinewithnosniffand a CSP ofdefault-src 'none'plussandbox. PDFs have nosandbox, because Chrome's viewer won't open under it; they getframe-ancestors 'self'so the page's iframe works. HTML, SVG and everything else get415from/fileand are only ever downloaded. That keeps the existing rule that nothing anybody stores runs on Uncloud's origin, which matters because a visitor may be signed in to this Uncloud in the same browser.PathPolicyunder that item, so.., hidden names and links are refused. Tests try a list of escapes against all four file endpoints.404. Deleting an account cascades its links away.PublicUrlor the tunnel, falling back to the address the page was opened at.reachable: falsedrives the "nobody else can open links yet" note.#toolbar=0for Chrome's PDF viewer. Anything shown can still be kept, with a screenshot say./sand/api/sharedresponses carryX-Robots-Tag: noindex.Referrer-Policy: no-referrerwas already global.Tests
./scripts/check.shpassed: web 190 (7 new), .NET 519 (9 new), plus the node and Swift suites. Go isn't on PATH on this machine, so the tunnel build was skipped; this PR doesn't touch it.ShareTests.cs:- A view-only folder shows to an anonymous client with nothing downloadable. A picture comes back inline with
sandbox, and HTML gets415.- No path reaches beside, above, hidden or through a link.
- Zips include nested folders and empty ones, and leave out hidden entries and links.
- Only the owner can list, change or turn off a link, and nothing works without a session.
- Sharing the same set twice returns one link.
- Links follow rename and move, drop what's deleted, and don't come back on restore.
- A disabled owner turns links off and re-enabling turns them back on. A deleted account removes them.
- The link uses
PublicUrlwhen set, and reportsreachablefalse without it.sharing.test.tsxcovers:- Creating a link (view only by default), copying it, and the shared mark appearing.
- Changing access and stopping a link.
- The note when nothing outside can reach the host.
- The delete warning when something inside a folder is shared.
- The visitor page in view-only and download modes.
- The visitor's page for a link that doesn't work.
- Folder, several-item and single-file links.
- Photos, the PDF, text, refused HTML and audio in the viewer.
- Switching to view and download, then a real zip and download through Kestrel.
- Stopping a link, then the visitor's page saying it doesn't work.
- Dark mode.
🤖 Generated with Claude Code