From af1a7d64c34668e063329e2ae5ff64934a4f6623 Mon Sep 17 00:00:00 2001 From: Alan Grainger <16197738+alangrainger@users.noreply.github.com> Date: Fri, 24 Jul 2026 10:27:46 +1200 Subject: [PATCH] #254 #257 add config option to allow single image downloads but deny zip downloads Co-authored-by: Tim Orme --- app/config.json | 1 + app/src/gallery/builder.ts | 2 +- app/src/view/gallery.tsx | 8 ++++---- docs/configuration.md | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/config.json b/app/config.json index d8ec2e5..5bf6631 100644 --- a/app/config.json +++ b/app/config.json @@ -47,6 +47,7 @@ "expiryDateFormat": "YYYY-MM-DD", "expiryDateLocale": "", "groupByDate": false, + "showDownloadZip": true, "cacheTime": 300 }, "lightbox": { diff --git a/app/src/gallery/builder.ts b/app/src/gallery/builder.ts index c173551..95568eb 100644 --- a/app/src/gallery/builder.ts +++ b/app/src/gallery/builder.ts @@ -140,7 +140,7 @@ export async function gallery (res: Response, share: SharedLink, openItem?: numb description: getConfigOption('ipp.gallery.showDescription', false) ? description(share) : '', publicBaseUrl: toString(publicBaseUrl), path: '/share/' + share.key, - showDownload: downloadAllowed, + showDownloadZip: downloadAllowed && !!getConfigOption('ipp.gallery.showDownloadZip', true), showTitle: !!getConfigOption('ipp.gallery.showTitle', true), expiryDate: expiryDate(share), openItem, diff --git a/app/src/view/gallery.tsx b/app/src/view/gallery.tsx index 5e1ff37..c849b3e 100644 --- a/app/src/view/gallery.tsx +++ b/app/src/view/gallery.tsx @@ -11,7 +11,7 @@ export interface GalleryProps { description: string publicBaseUrl: string path: string - showDownload: boolean + showDownloadZip: boolean showTitle: boolean // Formatted "available until" date shown in the subtitle, or undefined when // ipp.gallery.showExpiryDate is off or the share never expires. @@ -69,7 +69,7 @@ export function Gallery (props: GalleryProps) { - {(showHeaderText || props.showDownload) && ( + {(showHeaderText || props.showDownloadZip) && (