MERLIC Directory Agent Configuration File
MERLIC automatically checks for a configuration file of the Directory Agent when starting any MERLIC application. If no configuration file could be found, usually after installing MERLIC for the first time, it is automatically created. It can be used to adjust the configuration for the Directory Agent, for example, to configure the TCP server or the Transport Layer Security (TLS) for remote connections.
Location
By default, the configuration file for the Directory Agent is created in the same directory as the MERLIC5.ini file.
Windows
On Windows, the configuration file is created in the directory "C:\Users\<username>\AppData\Roaming\MVTec". You can also enter "%APPDATA%\MVTec" into your file explorer to reach that directory.
Linux
On Linux, the configuration file is created in the directory "~/.config/MVTec/".
File Name and Format
The configuration file for the Directory Agent is named "directory_agent_config.jsonc" and is defined in JSONC format by default. Therefore, the non-standard JSON comments (JSONC) extension is allowed. Alternatively, the file can be named "directory_agent_config.json" if the standard JSON format is preferred.
Configuring the MERLIC Directory Agent
If you want to change the configuration for the Directory Agent process, you can use the default configuration file as starting point. It contains default-equivalent contents which include instructions as JSON comments.
{
"$schema": "http://download.mvtec.com/directory-agent-config-v1.0.schema.json",
"Version": "1.0",
// By default, services are not exposed to the network and can only be
// accessed by the local user.
"TCP": null
}
JSON Schema and Editor Support
MVTec hosts JSON schema definitions for the configuration file of the Directory Agent. Using a modern text editor with support for JSONC can simplify the process of authoring the configuration file in various ways:
- Keys and attributes in the configuration file can be auto-completed by the editor according to the schema definition.
- The editor can display descriptions which are given in the schema, for example when hovering over keys and attributes in the configuration file.
- Many common errors when authoring the sequence files can be caught early, for example, missing mandatory keys, invalid values, or wrong data types.
The default configuration file for the Directory Agent includes the following key in the top-level object of configuration file to benefit from the JSON schema:
"$schema": "http://download.mvtec.com/directory-agent-config-v1.0.schema.json",
Available Configuration Settings
In the following sections, you will find information on the configuration settings that can be adjusted via the configuration file.
When specifying file paths and using backslashes as path separator, make sure to escape them (\\). Alternatively, you may use forward slashes (/) as path separator.
Top-Level Settings
|
Key |
Default |
Description |
|---|---|---|
|
Assets |
|
Defines routes to a custom HTML page and its referenced files, which are served by the Directory Agent agent to provide an overview of the available MERLIC instances. For more information, see HTML Overview of MERLIC Instances. |
|
5 |
Defines how long the Directory Agent will idle when there are no active service registrations before shutting down. This also applies immediately after the Directory Agent has been started. The value is defined in seconds but can also be given as a decimal fraction. |
|
|
MaxTTL |
3600 |
Defines the maximum time-to-live (TTL) that can be requested by services with the Directory Agent. When services register themselves at the Directory Agent, they specify a desired TTL. The registration will remain valid for this time and needs to be renewed within it. The value specified for this setting defines the maximum allowed TTL which can be requested. This ensures that clients cannot register services with excessively high TTL, which could lead to stray service registrations. If a registration asks for more time, its TTL is capped at this maximum. The value is defined in seconds. |
|
Threads |
1 |
Defines the number of threads used by the Directory Agent. If needed, you can use this setting to scale the server of the Directory Agent to an arbitrary number of threads to handle more traffic. The Directory Agent can handle more connections concurrently than the number of available threads. |
|
TCP |
null |
Defines settings related to the exposure of the HTTP(S) server on the network over TCP. The value can be set to a JSON object with the keys listed in section TCP Server. By default, the TCP server is disabled. |
|
Logging |
|
Defines settings related to logging information for the Directory Agent. The value can be set to a JSON object with the keys listed in section Logging. |
TCP Server
|
Key |
Description |
|---|---|
|
IP |
Defines the IP address of the network interface on which the HTTP(S) server will listen for incoming connections. It must be specified as IPv4 or IPv6 address. Hostnames are not resolved. You can specify the special address "0.0.0.0" to accept connections over IPv4 and "::" to accept connections over both IPv4 and IPv6 on any network interface, respectively. |
|
Port |
Defines the port number on which the HTTP(S) server will listen for incoming connections. You can choose a port number in the range 1-65535. |
|
TLS |
Defines the configuration group for settings related to the Transport Layer Security (TLS) for the TCP server. It contains the specifications for the certificate file and the private key. The Transport Layer Security can be disabled by setting this option to null. However, this should only be done if you are fully aware of the cybersecurity implications. |
|
CertFile |
Defines the absolute path to the server certificate file, which should be used by the HTTPS server. This file must not be writable by other users. |
|
KeyFile |
Defines the absolute path to the private key corresponding to the server certificate. This file must not be readable or writable by other users. |
Logging
The log files of the Directory Agent are named "merlic_directory_agent.*.log" and are written to the same folder as other MERLIC log files by default.
|
Key |
Default |
Description |
|---|---|---|
|
Directory |
Windows: %LOCALAPPDATA%\MVTec\MERLIC Linux: $HOME/.local/share/MVTec/MERLIC |
Defines the directory for the log files. The default location is the same as for other MERLIC programs such as MERLIC Creator or MERLIC RTE. If necessary, you can use this setting to override the default directory for the log files. Any custom logging settings defined in the MERLIC INI file will have no effect for the Directory Agent because the Directory Agent is user-specific and does not read the INI file. |
|
Threshold |
Console: info Log file: debug |
Defines the log level for the Directory Agent. By default, the Directory Agent logs to console with log level "info" and to file with log level "debug". If this option is used to specify a log level, it will be applied to both the console and the log file. Available log levels: critical, error, warning, info, debug, trace. |
Changing the Configuration Directory
If you want to use a different location for the configuration file for the Directory Agent, you can change the configuration directory using the environment variable MERLIC_DIRECTORY_AGENT_CONFIG_DIR. The configuration file for the Directory Agent will then be expected in the specified location.