Add environment configuration for GEO privacy
This commit is contained in:
parent
8acd425dc7
commit
ac002a0cf7
@ -63,6 +63,7 @@ Installation
|
||||
### 6. Optional configuration
|
||||
|
||||
- `NEXT_PUBLIC_PRO_MODE = 1` enables higher quality image storage
|
||||
- `NEXT_PUBLIC_GEO_PRIVACY = 1` disables collection/display of location-based data
|
||||
- `NEXT_PUBLIC_PUBLIC_API = 1` enables public API available at `/api`
|
||||
- `NEXT_PUBLIC_HIDE_REPO_LINK = 1` removes footer link to repo
|
||||
- `NEXT_PUBLIC_HIDE_FILM_SIMULATIONS = 1` prevents Fujifilm simulations showing up in `/grid` sidebar
|
||||
|
||||
@ -13,6 +13,7 @@ import {
|
||||
MAKE_FUJIFILM,
|
||||
} from '@/vendors/fujifilm';
|
||||
import { FilmSimulation } from '@/simulation';
|
||||
import { GEO_PRIVACY_ENABLED } from '@/site/config';
|
||||
|
||||
export type PhotoFormData = Record<keyof PhotoDbInsert, string>;
|
||||
|
||||
@ -106,8 +107,10 @@ export const convertExifToFormData = (
|
||||
iso: data.tags?.ISO?.toString(),
|
||||
exposureTime: data.tags?.ExposureTime?.toString(),
|
||||
exposureCompensation: data.tags?.ExposureCompensation?.toString(),
|
||||
latitude: data.tags?.GPSLatitude?.toString(),
|
||||
longitude: data.tags?.GPSLongitude?.toString(),
|
||||
latitude:
|
||||
!GEO_PRIVACY_ENABLED ? data.tags?.GPSLatitude?.toString() : undefined,
|
||||
longitude:
|
||||
!GEO_PRIVACY_ENABLED ? data.tags?.GPSLongitude?.toString() : undefined,
|
||||
filmSimulation,
|
||||
takenAt: data.tags?.DateTimeOriginal
|
||||
? convertTimestampWithOffsetToPostgresString(
|
||||
|
||||
@ -32,6 +32,7 @@ export default function SiteChecklistClient({
|
||||
showRepoLink,
|
||||
showFilmSimulations,
|
||||
isProModeEnabled,
|
||||
isGeoPrivacyEnabled,
|
||||
isPublicApiEnabled,
|
||||
isOgTextBottomAligned,
|
||||
showRefreshButton,
|
||||
@ -245,6 +246,16 @@ export default function SiteChecklistClient({
|
||||
higher quality image storage:
|
||||
{renderEnvVars(['NEXT_PUBLIC_PRO_MODE'])}
|
||||
</ChecklistRow>
|
||||
<ChecklistRow
|
||||
title="Geo Privacy"
|
||||
status={isGeoPrivacyEnabled}
|
||||
isPending={isPendingPage}
|
||||
optional
|
||||
>
|
||||
Set environment variable to {'"1"'} to disable
|
||||
collection/display of location-based data
|
||||
{renderEnvVars(['NEXT_PUBLIC_GEO_PRIVACY'])}
|
||||
</ChecklistRow>
|
||||
<ChecklistRow
|
||||
title="Public API"
|
||||
status={isPublicApiEnabled}
|
||||
|
||||
@ -48,6 +48,7 @@ export const HAS_AWS_S3_STORAGE =
|
||||
// SETTINGS
|
||||
|
||||
export const PRO_MODE_ENABLED = process.env.NEXT_PUBLIC_PRO_MODE === '1';
|
||||
export const GEO_PRIVACY_ENABLED = process.env.NEXT_PUBLIC_GEO_PRIVACY === '1';
|
||||
export const PUBLIC_API_ENABLED = process.env.NEXT_PUBLIC_PUBLIC_API === '1';
|
||||
export const SHOW_REPO_LINK = process.env.NEXT_PUBLIC_HIDE_REPO_LINK !== '1';
|
||||
export const SHOW_FILM_SIMULATIONS =
|
||||
@ -73,6 +74,7 @@ export const CONFIG_CHECKLIST_STATUS = {
|
||||
showRepoLink: SHOW_REPO_LINK,
|
||||
showFilmSimulations: SHOW_FILM_SIMULATIONS,
|
||||
isProModeEnabled: PRO_MODE_ENABLED,
|
||||
isGeoPrivacyEnabled: GEO_PRIVACY_ENABLED,
|
||||
isPublicApiEnabled: PUBLIC_API_ENABLED,
|
||||
isOgTextBottomAligned: OG_TEXT_BOTTOM_ALIGNMENT,
|
||||
gridAspectRatio: GRID_ASPECT_RATIO,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user