photoprism/internal/config
Michael Mayer dc19035d8f Metrics: Add file system and account usage info #5355
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-11-30 10:43:58 +01:00
..
customize Settings: Use PHOTOPRISM_DISABLE_FEATURES to initialize default features 2025-11-21 15:19:15 +01:00
feat AI: Generate Captions & Labels using the OpenAI Responses API #5322 2025-11-14 11:10:40 +01:00
pwa CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
testdata Auth: Refactor cluster configuration and provisioning API endpoints #98 2025-09-24 08:28:38 +02:00
ttl CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
cli_context.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
cli_context_test.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
cli_flag.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
cli_flag_test.go CLI: Add RunWithTestContext function for command tests #3168 2024-12-06 09:08:38 +01:00
cli_flags.go Config: Refactor options and command flags 2025-09-01 10:04:05 +02:00
cli_flags_report.go Commands: Fix config options report in config/cli_flags_report.go 2025-01-17 00:20:05 +01:00
cli_flags_test.go Config: Refactor options and command flags 2025-09-01 10:04:05 +02:00
client_assets.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
client_assets_test.go PWA: Add fs constants for "assets.json" and "manifest.json" #5274 2025-10-18 09:23:53 +02:00
client_config.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
client_config_test.go UX: Add batch edit dialog and API endpoints #271 #5324 2025-11-19 11:20:34 +01:00
client_ext.go Pkg: Move /service/http/... to /http/... and add package /http/dns 2025-10-19 21:08:48 +02:00
config.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_app.go API: Add GET /cluster/theme endpoint and refactor config package #98 2025-09-11 06:47:45 +02:00
config_app_test.go Config: Update Progressive Web App (PWA) flag usage and defaults 2025-09-07 22:03:05 +02:00
config_auth.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_auth_test.go Auth: Extend user accounts with custom scope setting 2025-10-22 19:58:56 +02:00
config_backup.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_backup_test.go Auth: Refactor cluster configuration and provisioning API endpoints #98 2025-09-24 08:28:38 +02:00
config_cache.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_cdn.go Config: Refactor initialization of settings and database connection 2024-07-07 17:00:38 +02:00
config_cdn_test.go Pkg: Move /service/http/... to /http/... and add package /http/dns 2025-10-19 21:08:48 +02:00
config_cluster.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_cluster_test.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_const.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_customize.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_customize_test.go Metadata: Update tests after changing Local timezone identifier #4946 2025-04-16 17:36:25 +02:00
config_db.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_db_test.go Config: Auto-add required DSN params, mask passwords in reports #5285 2025-11-03 09:12:45 +01:00
config_faces.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_faces_test.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_features.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_features_test.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_ffmpeg.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_ffmpeg_test.go Tests: Add unit tests #4969 2025-05-07 12:03:50 +02:00
config_media.go Import: Add ytdl package for downloading videos from URLs #4982 2025-05-02 10:04:34 +02:00
config_media_raw.go Import: Add ytdl package for downloading videos from URLs #4982 2025-05-02 10:04:34 +02:00
config_media_raw_test.go Config: Change test path in config_media_raw_test.go 2025-01-08 14:16:11 +01:00
config_media_test.go Upload: Allow to limit the types of files users can upload #4895 2025-03-25 06:32:01 +01:00
config_metadata.go Import: Add ytdl package for downloading videos from URLs #4982 2025-05-02 10:04:34 +02:00
config_metadata_test.go Backups: Refactor config and add "sidecar-yaml" config option #4243 2024-05-13 09:21:34 +02:00
config_oidc.go OIDC: Add support for Microsoft Entra ID security groups #5334 2025-11-23 16:04:25 +01:00
config_oidc_test.go OIDC: Add support for Microsoft Entra ID security groups #5334 2025-11-23 16:04:25 +01:00
config_places.go Places: Add config option to specify location details locale #465 #883 2025-07-03 12:58:20 +02:00
config_places_test.go Places: Add config option to specify location details locale #465 #883 2025-07-03 12:58:20 +02:00
config_proxy.go Config: Add option to set a proxy for outgoing connections #3132 2023-01-19 20:46:27 +01:00
config_proxy_test.go Config: Add option to set a proxy for outgoing connections #3132 2023-01-19 20:46:27 +01:00
config_server.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_server_test.go Pkg: Move /service/http/... to /http/... and add package /http/dns 2025-10-19 21:08:48 +02:00
config_site.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_site_test.go Config: Refactor command flags, reports, and client options 2025-04-15 15:42:03 +02:00
config_storage.go Config: Fix fallback that loads defaults from config/defaults.yml #5325 2025-11-20 18:42:06 +01:00
config_storage_test.go Config: Fix fallback that loads defaults from config/defaults.yml #5325 2025-11-20 18:42:06 +01:00
config_test.go TestMain: Handle "defer" before os.Exit #5330 2025-11-21 18:58:36 +01:00
config_thumb.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_thumb_test.go Auth: Refactor cluster configuration and provisioning API endpoints #98 2025-09-24 08:28:38 +02:00
config_tls.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_tls_test.go Develop: Change default Site URL to use HTTPS as required for OIDC #782 2024-06-28 00:21:19 +02:00
config_upload.go Config: Add upload-limit flag to limit total upload size #4929 #4895 2025-04-05 15:44:13 +02:00
config_upload_test.go Upload: Allow to limit the types of files users can upload #4895 2025-03-25 06:32:01 +01:00
config_usage.go Metrics: Add file system and account usage info #5355 2025-11-30 10:43:58 +01:00
config_usage_test.go Metrics: Add file system and account usage info #5355 2025-11-30 10:43:58 +01:00
config_vision.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
config_vision_test.go Config: Enhance tests for configuration and database file names #5304 2025-11-02 11:49:00 +01:00
develop.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
develop_test.go Config: Add "develop" feature flag to disable new viewer sidebar #3168 2025-02-03 12:29:02 +01:00
env.go Security: Improve credential handling across the cluster tooling #98 2025-10-20 00:06:17 +02:00
env_test.go Config: Read admin and database password from file #2302 2025-03-28 21:00:56 +01:00
err.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
error.go Config: Refactor directory initialization and improve inline docs 2023-06-14 16:44:45 +02:00
expand.go Auth: Refactor cluster configuration and provisioning API endpoints #98 2025-09-24 08:28:38 +02:00
expand_test.go Auth: Refactor cluster configuration and provisioning API endpoints #98 2025-09-24 08:28:38 +02:00
extensions.go Pkg: Move /service/http/... to /http/... and add package /http/dns 2025-10-19 21:08:48 +02:00
extensions_test.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
flags.go OIDC: Add support for Microsoft Entra ID security groups #5334 2025-11-23 16:04:25 +01:00
logs.go Config: Set SystemLog level based on application log level #5167 2025-10-07 21:30:19 +02:00
messages.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
options.go OIDC: Add support for Microsoft Entra ID security groups #5334 2025-11-23 16:04:25 +01:00
options_report.go Config: Retain support for DatabaseDsn in YAML files #5279 2025-10-21 16:22:06 +02:00
options_report_test.go Tests: Add unit tests 2023-08-30 16:30:06 +02:00
options_test.go Config: Enhance tests for configuration and database file names #5304 2025-11-02 11:49:00 +01:00
README.md Settings: Use PHOTOPRISM_DISABLE_FEATURES to initialize default features 2025-11-21 15:19:15 +01:00
report.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
report_sections.go AI: Update face flag notes in internal/config/report_sections.go #5167 2025-11-16 10:57:45 +01:00
report_test.go Config: Auto-add required DSN params, mask passwords in reports #5285 2025-11-03 09:12:45 +01:00
robots.txt Config: Serve "robots.txt" file to control how site is indexed #4574 2024-11-07 19:09:43 +01:00
schedule.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
schedule_test.go Config: Add “daily” and “weekly” backup schedule options #4243 2024-05-19 14:17:01 +02:00
settings.go Config: Move Portal flag to ClientConfig struct 2025-10-15 23:32:54 +02:00
test.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00
test_test.go Videos: Refactor codec, content and file type specifications #4770 2025-02-05 00:30:45 +01:00
thumbnails.go Video: Refactor FFmpeg Transcoding Size Limit #3466 #3498 #3549 2023-07-18 15:15:04 +02:00
var.go CI: Apply Go linter recommendations to "internal/config" packages #5330 2025-11-22 20:00:53 +01:00

PhotoPrism — Config Package

Last Updated: November 21, 2025

Overview

PhotoPrisms runtime configuration is managed by this package. Fields are defined in options.go and then initialized with values from command-line flags, environment variables, and optional YAML files (storage/config/*.yml).

Sources and Precedence

PhotoPrism loads configuration in the following order:

  1. Built-in defaults defined in this package.
  2. defaults.yml — optional configuration defaults. PhotoPrism first checks /etc/photoprism/defaults.yml (or .yaml). If that file is missing or empty, it automatically falls back to storage/config/defaults.yml (respecting .yml / .yaml as well) under PHOTOPRISM_CONFIG_PATH. See defaults.yml if you package PhotoPrism for other environments and need to override the compiled defaults.
  3. Environment variables prefixed with PHOTOPRISM_… and specified in flags.go along with the CLI flags. This is the primary override mechanism in container environments.
  4. options.yml — user-level configuration stored under storage/config/options.yml (or another directory controlled by PHOTOPRISM_CONFIG_PATH). Values here override both defaults and environment variables, see options.yml.
  5. CLI flags (for example photoprism --cache-path=/tmp/cache). Flags always win when a conflict exists.

The PHOTOPRISM_CONFIG_PATH variable controls where PhotoPrism looks for YAML files (defaults to storage/config).

Any change to configuration (flags, env vars, YAML files) requires a restart. The Go process reads options during startup and does not watch for changes.

Inspect Before Editing

Before changing environment variables or YAML files, run photoprism config | grep -i <flag> to confirm the current value of a flag, such as site-url, or site to show all related values:

photoprism config | grep -i site

Example output:

Name Value
site-url https://app.localssl.dev/
site-https true
site-domain app.localssl.dev
site-author @photoprism_app
site-title PhotoPrism

CLI Reference

  • photoprism help (or photoprism --help) lists all subcommands and global flags.
  • photoprism show config (alias photoprism config) renders every active option along with its current value. Pass --json, --md, --tsv, or --csv to change the output format.
  • photoprism show config-options prints the description and default value for each option. Use this when updating flags.go.
  • photoprism show config-yaml displays the configuration keys and their expected types in the same structure that the YAML files use. It is a read-only helper meant to guide you when editing files under storage/config.
  • Additional show subcommands document search filters, metadata tags, and supported thumbnail sizes; see internal/commands/show.go for the complete list.