Roadmap 0.13, Fixes

FX.783 Private file exchange: one link to download our files and upload yours (/exchange)

  • Fix
  • Built · in the lab

A private two-way file exchange for one outside person (first use: a Revit user who re-saves and exports test files for our Revit reader). We put files on /exchange/<token>; he opens that one link, downloads them, reads the instructions and uploads his results on the same page. No account. Unlisted: noindex, no-referrer, no-store, not in the sitemap; an unknown, expired or closed token is the normal 404, with a per-network throttle on wrong tokens. The token is 32 random bytes, shown once, never stored (only its sha256).

Built: FileExchange service (migration 179 file_exchanges + file_exchange_files), page exchange.php with core/components/exchange/*.inc, download route exchange-file.php (virus-checked copy served as an attachment, like admin/drop-file), upload endpoint api/exchange-upload.php (thin), CLI bin/file-exchange.php (create, add, list, fetch, set-instructions, close). Files go to dropai.zone's private bucket through RevitShare (virus scan + FileScans record on every upload), 30 days, up to 500 MB, 40 uploads a day per exchange. Staff get a plain notice mail per upload.

Upload limit fix: under PHP-FPM, api/.user.ini capped every api handler at 160M post / 55M file (the 520M / 510M lines for /api/revit-share, /suggest, /suggest-more were dead in .htaccess); raised api/.user.ini to 520M / 510M, execution 1800 s. This also restores 500 MB for /api/revit-share and /api/suggest*.

Tested: bin/test-file-exchange.php 40 passed 0 failed (token never stored, wrong/expired/closed token null, other exchange's file refused, bad type and oversize refused, EICAR refused and never reaches the store, daily cap, instructions and file names with script tags inert); bin/test-revit-share.php 20/0. Live: a test exchange, 200 MB .zip uploaded through https://getcadcraft.com/api/exchange-upload (second try; the first was refused by dropai.zone with 'Storage upload failed', not retried by our code), downloaded back with the same sha256; small file via a real browser (desktop, mobile, dark screenshots in docs/file-exchange/shots); outbound file downloaded with the same sha256; exchange closed, link then 404.

Not tested: the real exchange for the Revit user (not created), the staff notice through the real mailer, a download of an infected file on the way out (covered by the shared RevitShare::fetchScanned path, not exercised here), uploads on a slow connection (Apache's default request-read timeout), the progress bar is the shared static one, and /api/suggest* at 500 MB over HTTP. Log: docs/file-exchange/build.md.

From: Owner

Add a comment

Community comments

No comments yet

Add detail as we go: how you would use it, files or steps that show the problem, what other programs do. The team reads every comment.

Sign in or create a free account to add a comment.