.. index:: Configure Server
################
Configure Server
################
These settings define the server configuration, this includes UPnP behavior, selection of database, accounts for the UI as well as installation locations of shared data.
.. contents::
:backlinks: entry
.. sectnum::
:start: 1
.. _server:
******
Server
******
.. confval:: server
:type: :confval:`Section`
:required: true
.. code-block:: xml
...
This section defines the server configuration parameters.
Server Attributes
=================
.. confval:: debug-mode
:type: enum
:required: false
:default: unset
.. versionadded:: 2.0.0
.. versionchanged:: 2.6.1 new option ``inotify``
.. versionchanged:: 3.0.0 new option ``thumbnailer``
.. versionchanged:: 3.0.0 new option ``postgres``
Activate debugging messages only for certain subsystems.
The following subsystems are available:
``thread``, ``sqlite3``, ``cds``, ``server``, ``config``,
``content``, ``update``, ``mysql``,
``sql``, ``proc``, ``autoscan``, ``script``, ``web``, ``layout``,
``exif``, ``exiv2``, ``transcoding``, ``taglib``, ``ffmpeg``, ``wavpack``,
``requests``, ``device``, ``connmgr``, ``mrregistrar``, ``xml``,
``clients``, ``iohandler``, ``online``, ``metadata``, ``matroska``,
``curl``, ``util``, ``inotify``, ``thumbnailer``, ``postgres`` and ``verbose``.
Multiple subsystems can be combined with a ``|``. Names are not case
sensitive. ``verbose`` turns on even more messages for the subsystem.
This is for developers and testers mostly and has to be
activted in cmake options at compile time (``-DWITH_DEBUG_OPTIONS=YES``).
* Example: ``debug-mode="Cds|Content|Web"`` for messages when accessing the server via upnp or web.
.. confval:: upnp-max-jobs
:type: :confval:`Integer`
:required: false
:default: ``500``
.. versionadded:: 2.4.0
Set maximum number of jobs in libpupnp internal threadpool.
Allows pending requests to be handled.
Server Items
============
Port
----
.. confval:: port
:type: :confval:`Integer`
:required: false
:default: ``0`` `(automatic)`
.. code-block:: xml
0
Specifies the port where the server will be listening for HTTP requests. Note, that because of the implementation in the UPnP SDK
only ports above 49152 are supported. The value of zero means, that a port will be automatically selected by the SDK.
IP Address
----------
.. confval:: ip
:type: :confval:`String`
:required: false
:default: ip of the first available network interface
.. code-block:: xml
192.168.0.23
Specifies the IP address to bind to, by default one of the available interfaces will be selected.
Network interface
-----------------
.. confval:: interface
:type: :confval:`String`
:required: false
:default: first available network interface
.. code-block:: xml
eth0
Specifies the interface to bind to, by default one of the available interfaces will be selected.
Name
----
.. confval:: server name
:type: :confval:`String`
:required: true
:default: ``Gerbera``
.. code-block:: xml
Gerbera
Server's friendly name, you will see this on your devices that you use to access the server.
Manufacturer
------------
.. confval:: manufacturer
:type: :confval:`String`
:required: false
:default: empty
.. code-block:: xml
Gerbera Developers
This tag sets the manufacturer name of a UPnP device.
Manufacturer Url
----------------
.. confval:: manufacturerURL
:type: :confval:`String`
:required: false
:default: ``https://gerbera.io/``
.. code-block:: xml
https://gerbera.io/
This tag sets the manufacturer URL of a UPnP device, a custom setting may be necessary to trick some renderers in order
to enable special features that otherwise are only active with the vendor implemented server.
Virtual Url
-----------
.. confval:: virtualURL
:type: :confval:`String`
:required: false
:default: unset
.. code-block:: xml
https://gerbera.io/
This tag sets the virtual URL of Gerbera content which is part of the browse response.
The value defaults to `http://:`.
External Url
------------
.. confval:: externalURL
:type: :confval:`String`
:required: false
:default: unset
.. versionadded:: 2.0.0
.. code-block:: xml
https://gerbera.io/
This tag sets the external URL of Gerbera web UI, a custom setting may be necessary if you want to access the web page via a reverse proxy.
The value defaults to virtualURL or `http://:` if virtualURL is not set.
Model Name
----------
.. confval:: modelName
:type: :confval:`String`
:required: false
:default: ``Gerbera``
.. code-block:: xml
Gerbera
This tag sets the model name of a UPnP device, a custom setting may be necessary to trick some renderers in order to
enable special features that otherwise are only active with the vendor implemented server.
Model Number
------------
.. confval:: modelNumber
:type: :confval:`String`
:required: false
:default: Gerbera version
.. code-block:: xml
42.7.0
This tag sets the model number of a UPnP device, a custom setting may be necessary to trick some renderers in order
to enable special features that otherwise are only active with the vendor implemented server.
Model Url
---------
.. confval:: modelURL
:type: :confval:`String`
:required: false
:default: empty
.. code-block:: xml
http://example.org/product-23
This tag sets the model URL (homepage) of a UPnP device.
Serial Number
-------------
.. confval:: serialNumber
:type: :confval:`String`
:required: false
:default: ``1``
.. code-block:: xml
42
This tag sets the serial number of a UPnP device.
Presentation Url
----------------
.. confval:: presentationURL
:type: :confval:`String`
:required: false
:default: ``/``
.. code-block:: xml
80/index.html
The presentation URL defines the location of the servers user interface, usually you do not need to change this
however, vendors who want to ship our server along with their NAS devices may want to point to the main configuration
page of the device.
Attributes
.. confval:: append-to
:type: enum
:required: false
:default: ``none``
.. code-block:: xml
append-to="ip"
The append-to attribute defines how the text in the presentationURL tag should be treated.
The allowed values are:
+-------+--------------------------------------------------------------------------------------------+
| Value | Meaning |
+=======+============================================================================================+
| none | Use the string exactly as it appears in the presentationURL tag. |
+-------+--------------------------------------------------------------------------------------------+
| ip | | Append the string specified in the presentationURL tag to the ip address of the server, |
| | | this is useful in a dynamic ip environment where you do not know the ip |
| | | but want to point the URL to the port of your web server. |
+-------+--------------------------------------------------------------------------------------------+
| port | | Append the string specified in the presentationURL tag to the serverip and port, |
| | | this may be useful if you want to serve some static pages using the built in web server. |
+-------+--------------------------------------------------------------------------------------------+
UDN
---
.. confval:: udn
:type: :confval:`String`
:required: true
:default: none
.. code-block:: xml
uuid:[generated-uuid]
Unique Device Name, according to the UPnP spec it must be consistent throughout reboots. You can fill in something
yourself. Review the :ref:`Generating Configuration ` section of the documentation to see how to use
``gerbera`` to create a default configuration file.
Home Directory
--------------
.. confval:: home
:type: :confval:`Path`
:required: true
:default: ``~`` `- the HOME directory of the user running gerbera.`
.. code-block:: xml
/home/your_user_name/gerbera
Server home - the server will search for the data that it needs relative to this directory -
basically for the sqlite database file.
The gerbera.html bookmark file will also be generated in that directory.
The home directory is only relevant if the config file or the config dir was specified
in the command line. Otherwise it defaults to the ``HOME`` path of the user runnung
Gerbera. The environment variable ``GERBERA_HOME`` can be used to point to another directory,
in which case the config file is expected as ``${GERBERA_HOME}/.config/gerbera``.
Attributes:
.. confval:: override
:type: :confval:`Boolean`
:required: false
:default: ``no``
.. code-block:: xml
override="yes"
Force all relative paths to base on the home directory of the config file even
if it was read relative to the environment variables or from command line. This
means that Gerbara changes its home during startup.
Temporary Directory
-------------------
.. confval:: tmpdir
:type: :confval:`Path`
:required: true
:default: ``/tmp/``
.. code-block:: xml
/tmp/
Selects the temporary directory that will be used by the server.
Web Directory
-------------
.. confval:: webroot
:type: :confval:`Path`
:required: true
:default: `depends on the installation prefix that is passed to the configure script.`
.. code-block:: xml
/usr/share/gerbera/web
Root directory for the web server, this is the location where device description documents,
UI html and js files, icons, etc. are stored.
Alive Interval
--------------
.. confval:: alive
:type: :confval:`Integer`
:required: false
:default: ``180``, (Results in alive messages every 60s, see below) `this is according to the UPnP specification.`
.. code-block:: xml
180
* Min: 62 (A message sent every 1s, see below)
Interval for broadcasting SSDP:alive messages
An advertisement will be sent by LibUPnP every (this value/2)-30 seconds, and will have a cache-control max-age of this value.
Example:
A value of 62 will result in an SSDP advertisement being sent every second. ``(62 / 2 = 31) - 30 = 1``.
The default value of 180 results results in alive messages every 60s. ``(180 / 2 = 90) - 30 = 60``.
Note:
If you experience disconnection problems from your device, e.g. Playstation 4, when streaming videos after about 5 minutes,
you can try changing the alive value to 86400 (which is 24 hours).
PC Directory
------------
.. confval:: pc-directory
:type: :confval:`Section`
:required: false
.. code-block:: xml
Tweak visibility of PC directory, i.e. root entry for physical structure.
Attributes
^^^^^^^^^^
.. confval:: upnp-hide
:type: :confval:`Boolean`
:required: false
:default: ``no``
.. code-block:: xml
upnp-hide="yes"
Enabling this option will make the PC-Directory container invisible for UPnP devices.
.. confval:: web-hide
:type: :confval:`Boolean`
:required: false
:default: ``no``
..
.. versionadded:: 2.6.0
.. code-block:: xml
web-hide="yes"
Enabling this option will make the PC-Directory container invisible in the web UI.
Bookmark File
-------------
.. confval:: bookmark
:type: :confval:`String`
:required: false
:default: ``gerbera.html``
.. code-block:: xml
gerbera.html
The bookmark file offers an easy way to access the user interface, it is especially helpful when the server is
not configured to run on a fixed port. Each time the server is started, the bookmark file will be filled in with a
redirect to the servers current IP address and port. To use it, simply bookmark this file in your browser,
the default location is ``~/.config/gerbera/gerbera.html``
UPnP String Limit
-----------------
.. confval:: upnp-string-limit
:type: :confval:`Integer`
:required: false
:default: ``-1`` (`disabled`)
.. code-block:: xml
100
This will limit title and description length of containers and items in UPnP browse replies, this feature was added
as a workaround for the TG100 bug which can only handle titles no longer than 100 characters.
A negative value will disable this feature, the minimum allowed value is "4" because three dots will be appended
to the string if it has been cut off to indicate that limiting took place.
.. _logging:
Logging
-------
.. confval:: logging
:type: :confval:`Section`
:required: false
.. versionadded:: 2.2.0
.. code-block:: xml
This section defines various logging settings.
Attributes
^^^^^^^^^^
.. confval:: rotate-file-size
:type: :confval:`Integer`
:required: false
:default: ``5242880`` (5 MB)
.. code-block:: xml
rotate-file-size="1024000"
When using command line option ``--rotatelog`` this value defines the maximum size of the log file before rotating.
.. confval:: rotate-file-count
:type: :confval:`Integer`
:required: false
:default: ``10``
.. code-block:: xml
rotate-file-count="5"
When using command line option ``--rotatelog`` this value defines the number of files in the log rotation.
.. _ui:
*************
Web Interface
*************
.. confval:: ui
:type: :confval:`Section`
:required: false
.. code-block:: xml
This section defines various user interface settings.
**WARNING!**
The server has an integrated filesystem browser, that means that anyone who has access to the UI can browse
your filesystem (with user permissions under which the server is running) and also download your data!
If you want maximum security - disable the UI completely! Account authentication offers simple protection that
might hold back your kids, but it is not secure enough for use in an untrusted environment!
Note:
since the server is meant to be used in a home LAN environment the UI is enabled by default and accounts are
deactivated, thus allowing anyone on your network to connect to the user interface.
Web Interface Attributes
========================
.. confval:: ui enabled
:type: :confval:`Boolean`
:required: false
:default: ``yes``
.. code-block:: xml
enabled="no"
Enables (``yes``) or disables (``no``) the web user interface.
.. confval:: show-tooltips
:type: :confval:`Boolean`
:required: false
:default: ``yes``
.. code-block:: xml
show-tooltips="no"
This setting specifies if icon tooltips should be shown in the web UI.
.. confval:: show-numbering
:type: :confval:`Boolean`
:required: false
:default: ``yes``
.. code-block:: xml
show-numbering="no"
Set track number to be shown in the web UI.
.. confval:: show-thumbnail
:type: :confval:`Boolean`
:required: false
:default: ``yes``
.. code-block:: xml
show-thumbnail="no"
This setting specifies if thumbnails or cover art should be shown in the web UI.
.. confval:: enable-video
:type: :confval:`Boolean`
:required: false
:default: ``no``
.. code-block:: xml
enable-video="no"
Enable video preview in web ui.
.. confval:: poll-interval
:type: :confval:`Integer`
:required: false
:default: ``2``
.. code-block:: xml
poll-interval="10"
The poll-interval is an integer value which specifies how often the UI will poll for tasks. The interval is
specified in seconds, only values greater than zero are allowed. The value can be given in a valid time format.
.. confval:: fs-add-item
:type: :confval:`Boolean`
:required: false
:default: ``no``
.. versionadded:: 2.5.0
.. code-block:: xml
fs-add-item="yes"
Show the (deprecated) option to add items without autoscan functionality.
.. confval:: edit-sortkey
:type: :confval:`Boolean`
:required: false
:default: ``no``
.. versionadded:: 2.6.0
.. code-block:: xml
edit-sortkey="yes"
Show the edit field ``sortKey`` for objects.
.. confval:: poll-when-idle
:type: :confval:`Boolean`
:required: false
:default: ``no``
.. code-block:: xml
poll-when-idle="yes"
The poll-when-idle attribute influences the behavior of displaying current tasks: - when the user does something
in the UI (i.e. clicks around) we always poll for the current task and will display it - if a task is active,
we will continue polling in the background and update the current task view accordingly - when there is no
active task (i.e. the server is currently idle) we will stop the background polling and only request updates
upon user actions, but not when the user is idle (i.e. does not click around in the UI)
Setting poll-when-idle to "yes" will do background polling even when there are no current tasks; this may be
useful if you defined multiple users and want to see the tasks the other user is queuing on the server while
you are actually idle.
The tasks that are monitored are:
- adding files or directories
- removing items or containers
- automatic rescans
Source Documentation Url
========================
.. confval:: source-docs-link
:type: :confval:`String`
:required: false
:default: empty
.. versionadded:: 2.4.0
.. code-block:: xml
./dev/index.html
Add link to some source documentation which can be generated by ``make doc``. If it is empty the link in the web UI will be hidden.
User Documentation Url
======================
.. confval:: user-docs-link
:type: :confval:`String`
:required: false
:default: for release builts: "https://docs.gerbera.io/en/stable/", for test builts: "https://docs.gerbera.io/en/latest/"
.. versionadded:: 2.4.0
.. code-block:: xml
./doc/index.html
Add link to the user documentation if you want it locally hosted or make sure the version is matching you installation.
Content Security Policy
=======================
.. confval:: content-security-policy
:type: :confval:`String`
:required: false
:default: ``default-src %HOSTS% 'unsafe-eval' 'unsafe-inline'; img-src *; media-src *; child-src 'none';``
.. versionadded:: 2.4.0
.. code-block:: xml
default-src %HOSTS% 'unsafe-eval' 'unsafe-inline'; img-src *; media-src *; child-src 'none';
Define the "Content-Security-Policy" string for the web ui. The string ``%HOHSTS%`` will be replaced by the IP
address and known server names.
Newlines will automatically be replaced by ``;``.
Example:
Content security policy to host source documentation
.. code-block:: xml
font-src %HOSTS% https://fonts.gstatic.com/
style-src %HOSTS% https://fonts.googleapis.com 'unsafe-inline'
img-src *
media-src *
child-src 'none'
default-src %HOSTS% 'unsafe-eval' 'unsafe-inline'
Extension Mimetype Mapping
==========================
.. confval:: ui extension-mimetype
:type: :confval:`Section`
:required: false
:default: Extensible default see above, see :confval:`extend`
.. code-block:: xml
For description see :ref:`Import Extension Mimetype Mapping `.
Attributes
.. confval:: ui extension-mimetype default
:type: :confval:`String`
:required: false
:default: ``application/octet-stream``
.. code-block:: xml
default="application/octet-stream"
Accounts
========
.. confval:: accounts
:type: :confval:`Section`
:required: false
.. code-block:: xml
This section holds various account settings.
Attributes
----------
.. confval:: accounts enabled
:type: :confval:`Boolean`
:required: false
:default: ``yes``
.. code-block:: xml
enabled="no"
Specifies if accounts are enabled ``yes`` or disabled ``no``.
.. confval:: session-timeout
:type: :confval:`Integer`
:required: false
:default: ``30``
.. code-block:: xml
session-timeout="120"
The session-timeout attribute specifies the timeout interval in minutes. The server checks every
five minutes for sessions that have timed out, therefore in the worst case the session times out
after session-timeout + 5 minutes. The value can be given in a valid time format.
Account Settings
----------------
There can be multiple users, however this is mainly a feature for the future. Right now there are
no per-user permissions.
.. confval:: account
:type: :confval:`Section`
:required: false
.. code-block:: xml
.. confval:: account user
:type: :confval:`String`
:required: false
:default: `empty`
.. code-block:: xml
user="admin"
.. confval:: account password
:type: :confval:`String`
:required: false
:default: `empty`
.. code-block:: xml
password="secret"
Items Per Page
==============
.. confval:: items-per-page
:type: :confval:`Section`
:required: false
.. code-block:: xml
Attributes
----------
.. confval:: items-per-page default
:type: :confval:`Integer`
:required: false
:default: ``25``
.. code-block:: xml
default="50"
This sets the default number of items per page that will be shown when browsing the database in the web UI.
The values for the items per page drop down menu can be defined in the following manner:
Items
-----
.. confval:: items-per-page option
:type: :confval:`Integer`
:required: false
:default: Extensible Default: ``10, 25, 50, 100``, see :confval:`extend`
.. code-block:: xml
Note:
this list must contain the default value, i.e. if you define a default value of 25, then one of the
``