From b02dc50b88402d0aeedaa4f313018de7d24f93ce Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Wed, 22 Jan 2025 19:09:51 -0600 Subject: [PATCH] Add configuration for hiding photo taken at times --- README.md | 17 ++-- src/site/SiteChecklistClient.tsx | 160 ++++++++++++++++++------------- src/site/config.ts | 97 +++++++++++-------- 3 files changed, 160 insertions(+), 114 deletions(-) diff --git a/README.md b/README.md index ff3509ae..4c4018c0 100644 --- a/README.md +++ b/README.md @@ -96,31 +96,34 @@ _⚠️ READ BEFORE PROCEEDING_ Application behavior can be changed by configuring the following environment variables: -#### Site meta +#### Content - `NEXT_PUBLIC_SITE_TITLE` (seen in browser tab) - `NEXT_PUBLIC_SITE_DESCRIPTION` (seen in nav, beneath title) - `NEXT_PUBLIC_SITE_ABOUT` (seen in grid sidebar—accepts rich formatting tags: ``, ``, ``, ``, ``, `
`) -#### Site performance +#### Performance > ⚠️ Enabling may result in increased project usage - `NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTOS = 1` enables static optimization for photo pages (`p/[photoId]`), i.e., renders pages at build time - `NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTO_OG_IMAGES = 1` enables static optimization for OG images, i.e., renders images at build time - `NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTO_CATEGORIES = 1` enables static optimization for photo categories (`tag/[tag]`, `shot-on/[make]/[model]`, etc.), i.e., renders pages at build time - `NEXT_PUBLIC_PRESERVE_ORIGINAL_UPLOADS = 1` prevents photo uploads being compressed before storing -#### Site behavior +#### Display +- `NEXT_PUBLIC_HIDE_EXIF_DATA = 1` hides EXIF data in photo details and OG images (potentially useful for portfolios, which don't focus on photography) +- `NEXT_PUBLIC_HIDE_TAKEN_AT_TIME = 1` hides taken at time from photo meta +- `NEXT_PUBLIC_HIDE_SOCIAL = 1` removes X button from share modal +- `NEXT_PUBLIC_HIDE_FILM_SIMULATIONS = 1` prevents Fujifilm simulations showing up in `/grid` sidebar and CMD-K search results +- `NEXT_PUBLIC_HIDE_REPO_LINK = 1` removes footer link to repo + +#### Settings - `NEXT_PUBLIC_GRID_HOMEPAGE = 1` shows grid layout on homepage - `NEXT_PUBLIC_DEFAULT_THEME = light | dark` sets preferred initial theme (defaults to `system` when not configured) - `NEXT_PUBLIC_MATTE_PHOTOS = 1` constrains the size of each photo, and enables a surrounding border (potentially useful for photos with tall aspect ratios) - `NEXT_PUBLIC_BLUR_DISABLED = 1` prevents image blur data being stored and displayed (potentially useful for limiting Postgres usage) - `NEXT_PUBLIC_GEO_PRIVACY = 1` disables collection/display of location-based data (⚠️ re-compresses uploaded images in order to remove GPS information) -- `NEXT_PUBLIC_HIDE_REPO_LINK = 1` removes footer link to repo - `NEXT_PUBLIC_ALLOW_PUBLIC_DOWNLOADS = 1` enables public photo downloads for all visitors (⚠️ may result in increased bandwidth usage) - `NEXT_PUBLIC_PUBLIC_API = 1` enables public API available at `/api` - `NEXT_PUBLIC_IGNORE_PRIORITY_ORDER = 1` prevents `priority_order` field affecting photo order -- `NEXT_PUBLIC_HIDE_SOCIAL = 1` removes X button from share modal -- `NEXT_PUBLIC_HIDE_FILM_SIMULATIONS = 1` prevents Fujifilm simulations showing up in `/grid` sidebar and CMD-K search results -- `NEXT_PUBLIC_HIDE_EXIF_DATA = 1` hides EXIF data in photo details and OG images (potentially useful for portfolios, which don't focus on photography) - `NEXT_PUBLIC_GRID_ASPECT_RATIO = 1.5` sets aspect ratio for grid tiles (defaults to `1`—setting to `0` removes the constraint) - `NEXT_PUBLIC_SHOW_LARGE_THUMBNAILS = 1` ensures large thumbnails on photo grid views - `NEXT_PUBLIC_OG_TEXT_ALIGNMENT = BOTTOM` keeps OG image text bottom aligned (default is top) diff --git a/src/site/SiteChecklistClient.tsx b/src/site/SiteChecklistClient.tsx index 752db7df..b58ff29d 100644 --- a/src/site/SiteChecklistClient.tsx +++ b/src/site/SiteChecklistClient.tsx @@ -11,6 +11,7 @@ import { BiCog, BiCopy, BiData, + BiHide, BiLockAlt, BiPencil, } from 'react-icons/bi'; @@ -29,7 +30,7 @@ import WarningNote from '@/components/WarningNote'; import { RiSpeedMiniLine } from 'react-icons/ri'; export default function SiteChecklistClient({ - // Config checklist + // Storage hasDatabase, isPostgresSslEnabled, hasVercelPostgres, @@ -40,38 +41,49 @@ export default function SiteChecklistClient({ hasAwsS3Storage, hasMultipleStorageProviders, currentStorage, + // Auth hasAuthSecret, hasAdminUser, + // Content hasDomain, hasTitle, hasDescription, hasAbout, - hasDefaultTheme, - showRepoLink, - showSocial, - showFilmSimulations, - showExifInfo, + // AI + isAiTextGenerationEnabled, + aiTextAutoGeneratedFields, + hasAiTextAutoGeneratedFields, + // Performance isStaticallyOptimized, arePhotosStaticallyOptimized, arePhotoOGImagesStaticallyOptimized, arePhotoCategoriesStaticallyOptimized, areOriginalUploadsPreserved, + // Display + showExifInfo, + showTakenAtTimeHidden, + showSocial, + showFilmSimulations, + showRepoLink, + // Settings isGridHomepageEnabled, + hasDefaultTheme, defaultTheme, arePhotosMatted, isBlurEnabled, isGeoPrivacyEnabled, - isPriorityOrderEnabled, - isAiTextGenerationEnabled, - aiTextAutoGeneratedFields, - hasAiTextAutoGeneratedFields, - isPublicApiEnabled, - arePublicDownloadsEnabled, - isOgTextBottomAligned, gridAspectRatio, hasGridAspectRatio, gridDensity, hasGridDensityPreference, + arePublicDownloadsEnabled, + isPublicApiEnabled, + isPriorityOrderEnabled, + isOgTextBottomAligned, + // Misc + baseUrl, + commitSha, + commitMessage, // Connection status databaseError, storageError, @@ -81,9 +93,6 @@ export default function SiteChecklistClient({ simplifiedView, isTestingConnections, secret, - baseUrl, - commitSha, - commitMessage, }: ConfigChecklistStatus & Partial>> & { simplifiedView?: boolean @@ -473,6 +482,57 @@ export default function SiteChecklistClient({ {renderEnvVars(['NEXT_PUBLIC_PRESERVE_ORIGINAL_UPLOADS'])} + } + optional + > + + Set environment variable to {'"1"'} to hide EXIF data: + {renderEnvVars(['NEXT_PUBLIC_HIDE_EXIF_DATA'])} + + + Set environment variable to {'"1"'} to hide + taken at time from photo meta: + {renderEnvVars(['NEXT_PUBLIC_HIDE_TAKEN_AT_TIME'])} + + + Set environment variable to {'"1"'} to hide + {' '} + X button from share modal: + {renderEnvVars(['NEXT_PUBLIC_HIDE_SOCIAL'])} + + + Set environment variable to {'"1"'} to prevent + simulations showing up in /grid sidebar and + CMD-K results: + {renderEnvVars(['NEXT_PUBLIC_HIDE_FILM_SIMULATIONS'])} + + + Set environment variable to {'"1"'} to hide footer link: + {renderEnvVars(['NEXT_PUBLIC_HIDE_REPO_LINK'])} + + } @@ -528,12 +588,24 @@ export default function SiteChecklistClient({ {renderEnvVars(['NEXT_PUBLIC_GEO_PRIVACY'])} - Set environment variable to {'"1"'} to hide footer link: - {renderEnvVars(['NEXT_PUBLIC_HIDE_REPO_LINK'])} + Set environment variable to any number to enforce aspect ratio + {' '} + (default is {'"1"'}, i.e., square)—set to {'"0"'} to disable: + {renderEnvVars(['NEXT_PUBLIC_GRID_ASPECT_RATIO'])} + + + Set environment variable to {'"1"'} to ensure large thumbnails + on photo grid views (if not configured, density is based on + aspect ratio configuration): + {renderEnvVars(['NEXT_PUBLIC_SHOW_LARGE_THUMBNAILS'])} - - Set environment variable to {'"1"'} to hide - {' '} - X button from share modal: - {renderEnvVars(['NEXT_PUBLIC_HIDE_SOCIAL'])} - - - Set environment variable to {'"1"'} to prevent - simulations showing up in /grid sidebar and - CMD-K results: - {renderEnvVars(['NEXT_PUBLIC_HIDE_FILM_SIMULATIONS'])} - - - Set environment variable to {'"1"'} to hide EXIF data: - {renderEnvVars(['NEXT_PUBLIC_HIDE_EXIF_DATA'])} - - - Set environment variable to any number to enforce aspect ratio - {' '} - (default is {'"1"'}, i.e., square)—set to {'"0"'} to disable: - {renderEnvVars(['NEXT_PUBLIC_GRID_ASPECT_RATIO'])} - - - Set environment variable to {'"1"'} to ensure large thumbnails - on photo grid views (if not configured, density is based on - aspect ratio configuration): - {renderEnvVars(['NEXT_PUBLIC_SHOW_LARGE_THUMBNAILS'])} -