[Feature] Configurable upload URL — send asset uploads to a different host than browsing #31570
Closed
olragon
started this conversation in
Feature Request
Replies: 1 comment
|
This discussion has automatically been closed as it is likely a duplicate. We get a lot of duplicate threads each day, which is why we ask you in the template to confirm that you searched for duplicates before opening one. If you're sure this is not a duplicate, please leave a comment and we will reopen the thread if necessary. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
[Feature] Configurable upload URL — send asset uploads to a different host than browsing
Problem
Immich uploads each asset as a single, non-resumable
POST /api/assets. When theserver is reached through a proxy or tunnel that caps request-body size, any file
above that cap fails with
413and there is no client-side workaround. The mostcommon case is Cloudflare's 100 MB body limit on the Free/Pro plans (and via
Cloudflare Tunnel), which blocks large videos. This is already reported and
discussed:
Chunked/resumable upload (#1674) would solve the root cause but is a large piece
of work. This proposal is a small, orthogonal improvement that helps today
without touching the transfer protocol.
Why the existing endpoint switching doesn't cover it
The app's Automatic URL Switching swaps the single server endpoint (browse
and upload together) based on a matched Wi-Fi SSID. That is network-based and
local-only — it can't route just uploads to a different host, and it does
nothing on cellular / away from the configured SSID. The related requests are
about multiplying SSID→endpoint mappings, not a per-traffic-type endpoint:
Proposal
Add an optional, admin-set
uploadUrlto the server config that is pushed toclients via
ServerConfigDto. When it is non-empty, clients send asset uploadsto that base URL instead of the main endpoint; everything else (browsing,
thumbnails, playback, websocket) keeps using the normal endpoint. Empty by
default → no behaviour change.
This lets an operator point uploads at a host that isn't behind the size-capping
proxy (e.g. a direct/grey-cloud hostname), while keeping the main URL on the
proxied/CDN path for browsing. It's a few small changes and is fully backward
compatible.
Reference implementation (for discussion, not a PR)
I put a working reference on a fork so the shape is concrete:
https://github.com/olragon/immich/tree/feat/configurable-upload-url
uploadUrlon the admin server config +ServerConfigDto(validated as empty-or-URL; the path is preserved so it can include
/api),regenerated OpenAPI spec + TypeScript SDK. Existing server unit tests updated
and passing (55 tests across the touched suites).
uploadUrlfrom the server config, persists it, and uses itas the base URL for the foreground and background upload paths only (they are
already hand-rolled and independent of the shared API client, so no other call
is affected). I have not been able to build/run the Flutter app locally, so
the mobile side is unverified beyond the source change.
Before I open a PR
Per CONTRIBUTING I'm raising this first rather than dropping a PR. Two questions:
distinct from chunked upload and from SSID switching)? Or would you rather
keep everything behind [Feature]: Upload large files in chunks #1674?
uploadUrlvs a nestedupload.url, required vs optional inServerConfigDto, and whether the webuploader should honour it too — currently it does not).
Disclosure
The reference implementation and this write-up were prepared with AI
assistance. I understand the change and will own, verify, and (if you're open to
it) rework it to your guidance before any PR — I'm not asking anyone to review
AI output as-is; I'm asking whether the approach is welcome.
All reactions