Check for upload service before by status 204

This commit is contained in:
Alan Grainger
2026-10-07 15:50:34 +13:00
parent 5f2edc5f74
commit 3bade3c34b
11 changed files with 178 additions and 25 deletions
+5 -3
View File
@@ -106,11 +106,13 @@ The bulk-zip and per-asset buttons can be toggled independently once downloads a
## `uploadUrl`
**Type:** `string` · **Default:** `""`
**Type:** `string` · **Default:** `"/upload"`
The public URL of the optional upload service (the `immich-public-proxy-upload` container), for example `https://photos.example.com/upload`. When it is set, a share whose "Allow public user to upload" option is on in Immich shows an "Add photos" button in the gallery header. The button opens that share's page on the upload service. Leave it empty to show no button.
Where the optional upload service (the `immich-public-proxy-upload` container) is served. A share whose "Allow public user to upload" option is on in Immich then shows an "Add photos" button in the gallery header, which opens that share's page on the upload service. To set up the service, see [Let visitors send photos back](/visitor-uploads).
The value is wherever your reverse proxy serves the upload service, with the path if it has one. To set up the service, see [Let visitors send photos back](/visitor-uploads).
- **A path**, such as the default `/upload`, means the service is on IPP's own hostname under that path. Before showing the button, the gallery page checks that something answers at `<path>/healthcheck`, so an install without the upload container never shows a dead button.
- **An absolute URL**, such as `https://upload.example.com`, means the service has a hostname of its own. It is trusted without a check. The URL may include a path, such as `https://photos.example.com/upload`, which points at the same place as the default but without the check.
- **An empty string** never shows the button.
## `allowSlugLinks`
+2 -1
View File
@@ -26,7 +26,8 @@ version. Breaking changes and renamed config keys land in major versions and are
- **A custom `invalidRequestHandler.js` must be copied again from the 4.0 image.** A copy taken from 3.x fails to
load. See [Custom function](/config/error-responses#custom-function).
Visitor uploads are new in 4.0. An existing install is not affected until you add the upload service; see
Visitor uploads are new in 4.0. An existing install is not affected until you add the upload service: IPP looks for
it at `/upload` on its own hostname and shows the "Add photos" button only when something answers there. See
[Let visitors send photos back](/visitor-uploads).
### Compose file
+12 -7
View File
@@ -162,18 +162,23 @@ it cannot.
## Show the button in IPP
Set [`uploadUrl`](/config/ipp-options#uploadurl) in IPP's config to the public URL you routed in the previous step:
With the upload service on a path on the IPP hostname, there is nothing to set. IPP assumes the service is at
`/upload` on its own hostname, and the gallery shows the button once `/upload/healthcheck` answers.
With a hostname of its own, set [`uploadUrl`](/config/ipp-options#uploadurl) in IPP's config to that URL and restart
IPP:
```json
{
"ipp": {
"uploadUrl": "https://photos.example.com/upload"
"uploadUrl": "https://upload.example.com"
}
}
```
Restart IPP. One `config.json` can serve both containers: IPP ignores the `ipp.upload.*` keys, and the upload service
reads only those and [two shared options](/config/upload-service#shared-options).
IPP reads its config from a `config.json` mounted at `/app/config.json`, or inline from the `CONFIG` environment
variable; see [Configuration](/config/). One `config.json` can serve both containers: IPP ignores the `ipp.upload.*`
keys, and the upload service reads only those and [two shared options](/config/upload-service#shared-options).
## Turn on uploads for a share
@@ -187,7 +192,7 @@ separate from IPP's, and the password never passes between the two.
> [!NOTE]
> A share with one photo opens as the image file itself, so there is no header and no button. Set
> [`gallery.singleImage`](/config/gallery#singleimage) to `true` to show a gallery page instead, or give visitors the
> upload page's own link: the share's path on the upload URL, such as `https://upload.example.com/share/<key>`.
> upload page's own link: the share's path on the upload URL, such as `https://photos.example.com/upload/share/<key>`.
## Set a storage quota
@@ -267,5 +272,5 @@ visitor separately, set a rate limit in your reverse proxy.
### How do I turn uploads off
For one share, turn off **Allow public user to upload** in Immich. Immich refuses new uploads at once, and the button
leaves the gallery on the same cache times as a new photo takes to appear. For all shares, remove `uploadUrl` from
IPP's config and stop the upload container.
leaves the gallery on the same cache times as a new photo takes to appear. For all shares, stop the upload container; with the
default `uploadUrl` the button goes with it. To make sure, set [`uploadUrl`](/config/ipp-options#uploadurl) to `""`.