Configuration

HomeGallery has serveral modules/parts which can be configured through the gallery.config.yml file. It is loaded on the start of the CLI and is created if not found. It comes with a well selected preset of settings.

In a bare minimum configuration you need to define your media directories:

1sources:
2  - ~/Pictures

By default the configuration files are stored to ~/.config/home-gallery and the previews are stored in ~/.cache/home-gallery/storage.

It is advisable to initialize the configuration through the run init command:

gallery run init --source ~/Pictures /mnt/media

Full configuration

The full configuration contains valuable details to some settings

  1#
  2# HomeGallery configuration file
  3#
  4#
  5# Default configuration file is gallery.config.yml. JSON format is
  6# also supported (gallery.config.json)
  7#
  8# This is a comment, starting with hash tag and space ('# ')
  9# A default value starting with hash tag and variable ('#baseDir...')
 10#
 11# Directory value examples:
 12# - /absolute/directory
 13# - relative/directory/to/current/working/dir
 14# - ~/directory/in/your/home
 15# - ./relative/directory/to/configuration/file
 16#
 17# Variable replacements
 18#   baseDir: '~'
 19#   configDir: '{baseDir}/.config/home-gallery'
 20# configDir is replaced to '~/.config/home-gallery' and than to '$HOME/.config/home-gallery'
 21#
 22# Variables are baseDir, configDir, configPrefix, cacheDir and dir in sources
 23#
 24# Variables baseDir, configDir, configPrefix and cacheDir are overwritten by environment
 25# variables GALLERY_BASE_DIR, GALLERY_CONFIG_DIR, GALLERY_CONFIG_PREFIX, GALLERY_CACHE_DIR
 26
 27#
 28# General
 29#
 30#baseDir: '~'
 31#configDir: '{baseDir}/.config/home-gallery'
 32# file prefix for index, database and events
 33#configPrefix: ''
 34#cacheDir: '{baseDir}/.cache/home-gallery'
 35
 36#
 37# Sources
 38#
 39# List of media source directories. These can be read only.
 40#
 41# All sources are used to build the gallery database. If you need
 42# different databases or gallery instances use different gallery
 43# configurations
 44sources:
 45  - dir: '{baseDir}/Pictures'
 46    #index: '{configDir}/{configPrefix}{basename(dir)}.idx'
 47    # excludes are using gitignore patterns
 48    #excludes:
 49      #- .DS_Store
 50      #- ._*
 51      #- '*.tmp'
 52      #- '*cache*'
 53    #excludeIfPresent: .galleryignore
 54    # excludeFromFile: '{configDir}/excludes'
 55    # If source directory/disk is offline/unmounted set it to true.
 56    # Offline sources require an index file. Previews and meta data
 57    # should be extracted first before marking a source offline
 58    #offline: false
 59    # Filename matcher for checksum recalculation
 60    # size-ctime-inode: this matcher should be used if possible, might
 61    #                   not work on windows
 62    # size-ctime: this matcher should be used if stable fs inodes are
 63    #             not available and might not work for fuse shares
 64    # size: this matcher should be used if you know what you are doing
 65    #matcher: size-ctime-inode
 66
 67#
 68# Extractor settings
 69#
 70#extractor:
 71  #apiServer: https://api.home-gallery.org
 72  # Preffered address language of geo code reverse lookups
 73  # geoAddressLanguage: [de, en-US] # for multiple languages
 74  #geoAddressLanguage: en
 75  # excludes are using gitignore patterns
 76  #excludes: []
 77
 78#
 79# Storage and files configuration
 80#
 81#storage:
 82  #dir: '{cacheDir}/storage'
 83#database:
 84  #file: '{configDir}/{configPrefix}database.db'
 85#events:
 86  #file: '{configDir}/{configPrefix}events.db'
 87
 88#
 89# Server configuration
 90#
 91#server:
 92  #port: 3000
 93  #host: '0.0.0.0'
 94  # security configuration for https
 95  # key: '{configDir}/server.key'
 96  # cert: '{configDir}/server.crt'
 97  # Open browser when server starts
 98  # openBrowser: false
 99
100logger:
101  # Currently console and file loggers are available
102  - type: console
103    # Log level could be one of trace, debug, info, warn, error, fatal, silent
104    level: info
105  # File logger format is in newline delimited JSON. See http://ndjson.org
106  - type: file
107    # Log level could be one of trace, debug, info, warn, error, fatal, silent
108    level: debug
109    file: '{configDir}/{configPrefix}gallery.log'