photoprism/internal/config/customize
Michael Mayer 9d86b2a512 Settings: Use PHOTOPRISM_DISABLE_FEATURES to initialize default features
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-11-21 15:19:15 +01:00
..
testdata UX: Add batch edit dialog and API endpoints #271 #5324 2025-11-19 11:20:34 +01:00
acl.go UX: Add batch edit dialog and API endpoints #271 #5324 2025-11-19 11:20:34 +01:00
acl_test.go UX: Add batch edit dialog and API endpoints #271 #5324 2025-11-19 11:20:34 +01:00
album.go Config: Change the order of options in settings.yml 2025-04-12 17:53:46 +02:00
customize.go FFmpeg: Refactor extraction of JPEG and PNG images from videos #4604 2025-01-09 10:24:53 +01:00
defaults.go Config: Apply "golangci-lint" recommendation to customize package #5330 2025-11-21 14:16:03 +01:00
download.go Config: Apply "golangci-lint" recommendation to customize package #5330 2025-11-21 14:16:03 +01:00
feature.go UX: Add batch edit dialog and API endpoints #271 #5324 2025-11-19 11:20:34 +01:00
features_default.go Settings: Use PHOTOPRISM_DISABLE_FEATURES to initialize default features 2025-11-21 15:19:15 +01:00
features_default_test.go Settings: Use PHOTOPRISM_DISABLE_FEATURES to initialize default features 2025-11-21 15:19:15 +01:00
import.go Config: Apply "golangci-lint" recommendation to customize package #5330 2025-11-21 14:16:03 +01:00
import_test.go Import: Allow configuration of the destination file path #4666 2024-12-15 17:26:00 +01:00
index.go
maps.go
README.md Settings: Use PHOTOPRISM_DISABLE_FEATURES to initialize default features 2025-11-21 15:19:15 +01:00
scope.go UX: Add batch edit dialog and API endpoints #271 #5324 2025-11-19 11:20:34 +01:00
scope_test.go UX: Add batch edit dialog and API endpoints #271 #5324 2025-11-19 11:20:34 +01:00
search.go UX: Make information shown on cards view configurable #1164 2025-03-14 16:01:05 +01:00
settings.go Settings: Use PHOTOPRISM_DISABLE_FEATURES to initialize default features 2025-11-21 15:19:15 +01:00
settings_test.go Test: Use PascalCase names for all Go subtests in /internal 2025-10-02 14:50:02 +02:00
share.go
stack.go
template.go
ui.go UX: Add UI settings for selecting start page and time zone #577 2025-03-15 14:51:44 +01:00

PhotoPrism — Customize Package

Last Updated: November 21, 2025

Overview

The customize package defines user-facing configuration defaults for PhotoPrisms Web UI, search, maps, imports, indexing, and feature flags. The settings are assembled by NewDefaultSettings() / NewSettings() and serialized through YAML so they can be stored or loaded at runtime.

Feature Defaults

  • Feature flags live in FeatureSettings and are initialized via the new DefaultFeatures variable.
  • NewFeatures() returns a copy of DefaultFeatures, letting callers mutate per-request or per-user state without modifying the shared defaults.

Environment Overrides

  • Set PHOTOPRISM_DISABLE_FEATURES to disable specific features at startup.
  • The value may be comma- or space-separated (case-insensitive); hyphens/underscores are ignored.
  • Tokens are inflected so singular/plural variants match (for example, albums, album, or Album all disable the Albums flag).

Settings Lifecycle

  • NewDefaultSettings() seeds UI, search, maps, imports, indexing, templates, downloads, and features from the defaults in this package.
  • Settings.Load() / Save() round-trip YAML configuration files.
  • Settings.Propagate() ensures required defaults (language, timezone, start page, map style) remain populated after loading.

Testing

  • Unit tests cover feature default copying, environment-based disabling, scope application, and ACL interactions.
  • Run go test ./internal/config/customize/... or the lints via golangci-lint run ./internal/config/customize/....