From 940523a7c0c729a094ddd82a187c83a73ca29e47 Mon Sep 17 00:00:00 2001 From: Alan Grainger <16197738+alangrainger@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:01:54 +1300 Subject: [PATCH] Match existing env variable --- docker-compose.yml | 2 +- docs/config/upload-service.md | 11 ++++++----- docs/upgrading.md | 2 +- docs/visitor-uploads.md | 7 +++---- upload-app/src/config.ts | 8 ++++++-- upload-app/src/view/upload.tsx | 2 +- 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 379fd55..a208cf7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,7 @@ services: # - "3001:3000" # environment: # IMMICH_URL: http://your-internal-immich-server:2283 - # GALLERY_URL: https://your-proxy-url.com + # PUBLIC_BASE_URL: https://your-proxy-url.com # healthcheck: # test: curl -sf -m 4 http://localhost:3000/healthcheck -o /dev/null || exit 1 # start_period: 10s diff --git a/docs/config/upload-service.md b/docs/config/upload-service.md index ee4a15d..9ae42ec 100644 --- a/docs/config/upload-service.md +++ b/docs/config/upload-service.md @@ -25,15 +25,16 @@ Accept files up to 2 GB, and send a notification to a Gotify server for each sto ## Environment variables -`IMMICH_URL`, `IPP_PORT`, `IPP_CONFIG` and `CONFIG` mean the same as for IPP; see -[Environment variables](/config/environment-variables). `IMMICH_URL` is required. The service has one more: +`IMMICH_URL`, `PUBLIC_BASE_URL`, `IPP_PORT`, `IPP_CONFIG` and `CONFIG` mean the same as for IPP; see +[Environment variables](/config/environment-variables). `IMMICH_URL` is required, and the `environment` block from the +IPP container can be copied across as is. -### `GALLERY_URL` +### `PUBLIC_BASE_URL` **Optional** -The public URL of IPP, for example `https://photos.example.com`. When set, the upload page has a back button to the -share's gallery. +The public URL of IPP, for example `https://photos.example.com`, the same value as on the IPP container. When set, +the upload page has a back button to the share's gallery. The service has no setting for its own public URL. It serves its pages both under `/upload` and at the root, so the reverse proxy decides where it lives: a path on the IPP hostname (`photos.example.com/upload`) or a hostname of its diff --git a/docs/upgrading.md b/docs/upgrading.md index 4c9bf42..f02467d 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -61,7 +61,7 @@ services: - "3001:3000" environment: IMMICH_URL: http://your-internal-immich-server:2283 - GALLERY_URL: https://your-proxy-url.com + PUBLIC_BASE_URL: https://your-proxy-url.com healthcheck: test: curl -sf -m 4 http://localhost:3000/healthcheck -o /dev/null || exit 1 start_period: 10s diff --git a/docs/visitor-uploads.md b/docs/visitor-uploads.md index b987da7..66695cf 100644 --- a/docs/visitor-uploads.md +++ b/docs/visitor-uploads.md @@ -70,16 +70,15 @@ services: - "3001:3000" environment: IMMICH_URL: http://your-internal-immich-server:2283 - GALLERY_URL: https://photos.example.com + PUBLIC_BASE_URL: https://photos.example.com healthcheck: test: curl -sf -m 4 http://localhost:3000/healthcheck -o /dev/null || exit 1 start_period: 10s timeout: 5s ``` -- `IMMICH_URL` is the same local Immich address that IPP uses. -- `GALLERY_URL` is the public URL of IPP, the same value as IPP's `PUBLIC_BASE_URL`. It gives the upload page a back - button to the gallery. +- `IMMICH_URL` and `PUBLIC_BASE_URL` mean the same as on the IPP container, so you can copy the `environment` block + across. `PUBLIC_BASE_URL` is IPP's public URL; it gives the upload page a back button to the gallery. The service has no setting for its own public URL. Your reverse proxy decides that in the next step. diff --git a/upload-app/src/config.ts b/upload-app/src/config.ts index 8e4bcc3..f0a3552 100644 --- a/upload-app/src/config.ts +++ b/upload-app/src/config.ts @@ -2,9 +2,13 @@ import { getConfigOption, getNumericConfigOption } from '@ipp/core' const MB = 1024 * 1024 -/** IPP's public URL from `GALLERY_URL`, without a trailing slash, or undefined when unset. */ +/** + * IPP's public URL from `PUBLIC_BASE_URL`, without a trailing slash, or + * undefined when unset. The same name and value as on the IPP container, so + * the two environment blocks in a compose file match. + */ export function galleryUrl (): string | undefined { - return (process.env.GALLERY_URL || '').replace(/\/+$/, '') || undefined + return (process.env.PUBLIC_BASE_URL || '').replace(/\/+$/, '') || undefined } /** Largest single file accepted, in bytes, from `ipp.upload.maxFileSize` (MB). */ diff --git a/upload-app/src/view/upload.tsx b/upload-app/src/view/upload.tsx index aeeff58..c76ed3a 100644 --- a/upload-app/src/view/upload.tsx +++ b/upload-app/src/view/upload.tsx @@ -7,7 +7,7 @@ export interface UploadPageProps { config: UploadPageConfig /** Path prefix the app is mounted under, without a trailing slash. Empty at the root. */ basePath: string - /** This share's gallery on IPP, when `GALLERY_URL` is set. */ + /** This share's gallery on IPP, when `PUBLIC_BASE_URL` is set. */ galleryLink?: string }