EMIR-SERP Configuration
-----------------------
anchor:anchor-emir-serpd-config[]

The configuration of EMIR-SERP can be performed by editing its configuration
file or files. The configuration can be found basically in one file
that default location is +/etc/emi/emir-serp/emir-serp.ini+.

This file contains every configuration options that can be the EMIR-SERP daemon
control by, like _service url_, _logging verbosity_, _credential
location_, etc.

The advanced service entries to be propagated can be described in
separated configuration files preferably also under this directory and
use to have +.json+ extension.

The main configuration file has INI format. The +emir-serp+ section contains
the daemon scoped options while the others are to describe the different
service entries to be registered. In these cases the exact name is
indifferent, they just have to differ from each other and must avoid the
+emir-serp+ name as well.

Configuration options
~~~~~~~~~~~~~~~~~~~~~

[NOTE]
========
The names of options are case-insensitive.
========

url
^^^

+Location:+ +emir-serp+ section

+Default value:+ _No default value_

+Mandatory:+ Yes

+Description:+

URL of the EMIR service to connect in a protocol://domain:port format.

If protocol is missing default +https+ is used.
If port is missing default +54321+ is used.
The domain part is mandatory.

.Examples
-----------------
url = emiregistry2.grid.niif.hu
url = https://emiregistry2.grid.niif.hu
url = https://emiregistry2.grid.niif.hu:54321
-----------------

period
^^^^^^

+Location:+ +emir-serp+ section

+Default value:+ _No default value_

+Mandatory:+ Yes

+Description:+

The period of the registration/update messages. Its value is given in
hours.

validity
^^^^^^^^

+Location:+ +emir-serp+ section

+Default value:+ _No default value_

+Mandatory:+ Yes

+Description:+

The validity of the registration entries. Its value is given in hours.

cert
^^^^

+Location:+ +emir-serp+ section

+Default value:+ /etc/grid-security/hostcert.pem

+Mandatory:+ No

+Description:+

User certificate file location in PEM format. Only used and checked if the protocol in
the url option is 'https'.

key
^^^

+Location:+ +emir-serp+ section

+Default value:+ /etc/grid-security/hostkey.pem

+Mandatory:+ No

+Description:+

User key file location in PEM format. Only used and checked if the protocol in
the url option is 'https'.

cadir
^^^^^

+Location:+ +emir-serp+ section

+Default value:+ /etc/grid-security/certificates

+Mandatory:+ No

+Description:+

A path pointing to the store where the PEM certificate of the trusted
Certificate Authorities can be found. Only used and checked if the protocol in
the url option is 'https'.

verbosity
^^^^^^^^^

+Location:+ +emir-serp+ section

+Default value:+ error

+Mandatory:+ No

+Description:+

Logging verbosity. The parameter is optional. If missing or an invalid
value is given, the default value will be used. The logs are written
into the log file that can be found in the _/var/log/emi/emir-serp_
directory by default.

[NOTE]
========
The service entries can be defined in separated ini sections. The name
of the section is irrelevant but must be different in every cases!

Any of 'json_file_location', 'json_dir_location' or 'resource_bdii_url'
must be present in a section to enable EMIR-SERP registration otherwise
section is going to be skipped.
========


json_file_location
^^^^^^^^^^^^^^^^^^

+Location:+ service related section

+Default value:+ _No default value_

+Mandatory:+ Yes

+Description:+

The service entry can be defined in a single external json formatted file
per service. Any allowed json attributes are allowed in this way. The
location of this file must be defined in the 'json_file_location' ini
variable.

The value of +json_file_location+ is used only if no +resource_bdii_url+ or
+json_dir_location+ are present in the same section.

json_dir_location
^^^^^^^^^^^^^^^^^

+Location:+ service related section

+Default value:+ _No default value_

+Mandatory:+ Yes

+Description:+

Multiple entries belonging to a service can be put into separated json
files in a common directory. The script periodically scan the content
of the directory setted up with this attribute and the content of the
found json files will be propagated to the EMIR service.

The value of +json_dir_location+ is used  only if no +resource_bdii_url+ is
present.

resource_bdii_url
^^^^^^^^^^^^^^^^^

+Location:+ service related section

+Default value:+ _No default value_

+Mandatory:+ Yes

+Description:+

The service information to be registered can be harvested from directly
from resource BDII LDAP servers. EMIR-SERP periodically queries the
remote database, converts the result, and publish the service information
to the previously configured EMIR service.

If 'resource_bdii_url' attribute is present both 'json_dir_location' and
'json_file_location' are ignored.

If port is missing default 2170 is used.
If LDAP base is missing default 'o=glue' is used.
Only 'ldap' scheme is accepted in the URL.

