diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 5727e9e..1c480f2 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -30,6 +30,51 @@ different message that names the size. See [Request size limits](/visitor-uploads#request-size-limits). +## The "Add photos" button does not appear + +The upload service runs and its `/healthcheck` answers `ok`, but a share with **Allow public user to upload** turned +on shows no button in the gallery. View the gallery page's source and look for `id="upload-link"`: + +- **The page source has no `upload-link`, and the script URL is `/share/static/3.x.x/...`.** IPP is still 3.x, which + has no upload button. Restarting a container does not update it. Run `docker compose pull` and then + `docker compose up -d` (in Dockge, use **Update**, not **Restart**). See [Updating IPP](/upgrading#updating-ipp). +- **No `upload-link`, and the version is 4.0 or newer.** IPP sees no upload service to link to: either the share's + upload option is off in Immich, or [`uploadUrl`](/config/ipp-options#uploadurl) is set to an empty string or + something other than a path or an absolute URL. A changed `config.json` or `CONFIG` needs a restart. +- **`upload-link` is there with a `hidden` attribute.** IPP assumed the service at `/upload` on its own hostname and + the browser's check of `/upload/healthcheck` there did not answer `ok`. Open that URL on the **gallery** hostname, + for example `https://photos.example.com/upload/healthcheck`. An empty page means the reverse proxy sent the + request to IPP rather than to the upload service, so add or fix the `/upload` route. If the upload service has its + own hostname, set [`uploadUrl`](/config/ipp-options#uploadurl) to it in IPP's config; a setting elsewhere in the + compose file does nothing. + +See [Let visitors send photos back](/visitor-uploads#check-the-route) and +[issue #300](https://github.com/alangrainger/immich-public-proxy/issues/300). + +## The upload page asks for the password again, or its script is a 404 + +The upload page opens from the gallery's **Add photos** button, but a password-protected share asks for its +password again and refuses the right one, or the browser's network tab shows a 404 for +`/share/static//js/client/upload.js` on the gallery hostname. + +The reverse proxy is stripping `/upload` from the path before it reaches the upload service. The service then writes +its links without that prefix, so the page's script and its password form go to IPP instead of back to the upload +service. The password is accepted by IPP, which the gallery had already unlocked, and the upload service never +sees it. + +In nginx the cause is a trailing slash on the upload `proxy_pass`: `proxy_pass http://ipp-upload:3000/;` replaces +the matched `/upload/` with that `/`. Remove the slash so the path is passed as is: + +```nginx +location /upload/ { + proxy_pass http://ipp-upload:3000; +} +``` + +In Caddy, use `handle /upload/*`, not `handle_path`, which strips the prefix. See +[Route it through your reverse proxy](/visitor-uploads#route-it-through-your-reverse-proxy) and +[issue #301](https://github.com/alangrainger/immich-public-proxy/issues/301). + ## Link previews show `http://` or a private IP The gallery itself uses relative URLs, so it works behind any reverse proxy. The one place IPP needs a fully qualified diff --git a/docs/visitor-uploads.md b/docs/visitor-uploads.md index 98cc813..5227fe6 100644 --- a/docs/visitor-uploads.md +++ b/docs/visitor-uploads.md @@ -55,7 +55,9 @@ Other visitors see the new photos in the gallery within a few minutes. See ## What you need -- IPP 4.0 or newer and Immich 3.0.0 or newer. +- IPP 4.0 or newer and Immich 3.0.0 or newer. Restarting the IPP container does not update it: run + `docker compose pull` first (see [Updating IPP](/upgrading#updating-ipp)). A 3.x IPP serves the gallery as before + and never shows the button, whatever the upload service does. - A public route to the upload service, either: - a path on the IPP hostname, such as `photos.example.com/upload`, or - its own hostname, such as `upload.example.com`. Use this if a tunnel points straight at IPP with no reverse @@ -127,6 +129,11 @@ photos.example.com { #### nginx +No trailing slash on the upload `proxy_pass`. With `proxy_pass http://ipp-upload:3000/;`, nginx replaces the +`/upload/` prefix with that `/` and the service receives `/share/` instead of `/upload/share/`. It then +writes every link on its pages without `/upload`, so the browser sends them to IPP instead: the page's script is a +404 and the password form posts to the wrong service, which asks for the password again. + ```nginx server { listen 443 ssl; @@ -195,6 +202,16 @@ Open `/healthcheck` on the upload URL: `https://photos.example.com/upload/health it cannot. With the upload service on a path on the IPP hostname, IPP shows the **Add photos** button only while this answers `ok`. With its own hostname, IPP shows the button whenever `uploadUrl` is set. +An empty page at `https://photos.example.com/upload/healthcheck` means the request reached IPP, not the upload +service: IPP answers its own hostname's `/upload/healthcheck` with nothing when the route is missing. Check the +`/upload` route in the reverse proxy. + +Then open `https://photos.example.com/upload/share/` for a share that allows uploads. The upload page should +load with its styling, and a password-protected share should accept its password once. See +[The "Add photos" button does not appear](/troubleshooting#the-add-photos-button-does-not-appear) and +[The upload page asks for the password again](/troubleshooting#the-upload-page-asks-for-the-password-again-or-its-script-is-a-404) +if not. + ## Turn on uploads for a share In Immich, turn on **Allow public user to upload** for the shared link. The option is in the dialog that creates a