Skip to content
Snippets Groups Projects
config.sample.yaml 28.47 KiB
# General repo configuration
repo:
  bindAddress: '127.0.0.1'
  port: 8000

  # Where to store the logs, relative to where the repo is started from. Logs will be automatically
  # rotated every day and held for 14 days. To disable the repo logging to files, set this to
  # "-" (including quotation marks).
  #
  # Note: to change the log directory you'll have to restart the repository. This setting cannot be
  # live reloaded.
  logDirectory: logs

  # Set to true to enable color coding in your logs. Note that this may cause escape sequences to
  # appear in logs which render them unreadable, which is why colors are disabled by default.
  logColors: false

  # Set to true to enable JSON logging for consumption by things like logstash. Note that this is
  # incompatible with the log color option and will always render without colors.
  jsonLogs: false

  # The log level to log at. Note that this will need to be at least "info" to receive support.
  #
  # Values (in increasing spam): panic | fatal | error | warn | info | debug | trace
  logLevel: "info"

  # If true, the media repo will accept any X-Forwarded-For header without validation. In most cases
  # this option should be left as "false". Note that the media repo already expects an X-Forwarded-For
  # header, but validates it to ensure the IP being given makes sense.
  trustAnyForwardedAddress: false

  # If false, the media repo will not use the X-Forwarded-Host header commonly added by reverse proxies.
  # Typically this should remain as true, though in some circumstances it may need to be disabled.
  # See https://github.com/turt2live/matrix-media-repo/issues/202 for more information.
  useForwardedHost: true

# Options for dealing with federation
federation:
  # On a per-host basis, the number of consecutive failures in calling the host before the
  # media repo will back off. This defaults to 20 if not given. Note that 404 errors from
  # the remote server do not count towards this.
  backoffAt: 20

  # The domains the media repo should never serve media for. Existing media already stored from
  # these domains will remain, however will not be downloadable without a data export. Media
  # repo administrators will bypass this check. Admin APIs will still work for media on these
  # domains.
  #
  # This will not prevent the listed domains from accessing media on this media repo - it only
  # stops users on *this* media repo from accessing media originally uploaded to the listed domains.
  #
  # Note: Adding domains controlled by the media repo itself to this list is not advisable.
  ignoredHosts:
    - example.org

# The database configuration for the media repository
# Do NOT put your homeserver's existing database credentials here. Create a new database and
# user instead. Using the same server is fine, just not the same username and database.
database:
  # Currently only "postgres" is supported.
  postgres: "postgres://your_username:your_password@localhost/database_name?sslmode=require"

  # The database pooling options
  pool:
    # The maximum number of connects to hold open. More of these allow for more concurrent
    # processes to happen.
    maxConnections: 25

    # The maximum number of connects to leave idle. More of these reduces the time it takes
    # to serve requests in low-traffic scenarios.