Include an External Configuration File

You can share configuration sections or parameters between ACI server configuration files. The following sections describe different ways to include content from an external configuration file.

You can include a configuration file in its entirety, specified configuration sections, or a single parameter.

When you include content from an external configuration file, the GetConfig and ValidateConfig actions operate on the combined configuration, after any external content is merged in.

In the procedures in the following sections, you can specify external configuration file locations by using absolute paths, relative paths, and network locations. For example:

../sharedconfig.cfg
K:\sharedconfig\sharedsettings.cfg
\\example.com\shared\aciserver.cfg
file://example.com/shared/aciserver.cfg

Relative paths are relative to the primary configuration file.

NOTE: You can use nested inclusions, for example, you can refer to a shared configuration file that references a third file. However, the external configuration files must not refer back to your original configuration file. These circular references result in an error, and Telegram Connector does not start.

Similarly, you cannot use any of these methods to refer to a different section in your primary configuration file.

Include the Whole External Configuration File

This method allows you to import the whole external configuration file at a specified point in your configuration file.

To include the whole external configuration file

  1. Open your configuration file in a text editor.
  2. Find the place in the configuration file where you want to add the external configuration file.
  3. On a new line, type a left angle bracket (<), followed by the path to and name of the external configuration file, in quotation marks (""). You can use relative paths and network locations. For example:

    < "K:\sharedconfig\sharedsettings.cfg"
  4. Save and close the configuration file.

Include Sections of an External Configuration File

This method allows you to import one or more configuration sections (including the section headings) from an external configuration file at a specified point in your configuration file. You can include a whole configuration section in this way, but the configuration section name in the external file must exactly match what you want to use in your file. If you want to use a configuration section from the external file with a different name, see Merge a Section from an External Configuration File.

To include sections of an external configuration file

  1. Open your configuration file in a text editor.
  2. Find the place in the configuration file where you want to add the external configuration file section.
  3. On a new line, type a left angle bracket (<), followed by the path of the external configuration file, in quotation marks (""). You can use relative paths and network locations. After the configuration file path, add the configuration section name that you want to include. For example:

    < "K:\sharedconfig\extrasettings.cfg" [License]

    NOTE: You cannot include a section that already exists in your configuration file.

  4. Save and close the configuration file.

Include Parameters from an External Configuration File

This method allows you to import one or more parameters from an external configuration file at a specified point in your configuration file. You can import a single parameter or use wildcards to specify multiple parameters. The parameter values in the external file must match what you want to use in your file. This method does not import the section heading, such as [License] in the following examples.

To include parameters from an external configuration file

  1. Open your configuration file in a text editor.
  2. Find the place in the configuration file where you want to add the parameters from the external configuration file.
  3. On a new line, type a left angle bracket (<), followed by the path of the external configuration file, in quotation marks (""). You can use relative paths and network locations. After the configuration file path, add the name of the section that contains the parameter, followed by the parameter name. For example:

    < "license.cfg" [License] LicenseServerHost

    To specify a default value for the parameter, in case it does not exist in the external configuration file, specify the configuration section, parameter name, and then an equals sign (=) followed by the default value. For example:

    < "license.cfg" [License] LicenseServerHost=localhost

    You can use wildcards to import multiple parameters, but this method does not support default values. The * wildcard matches zero or more characters. The ? wildcard matches any single character. Use the pipe character | as a separator between wildcard strings. For example:

    < "license.cfg" [License] LicenseServer*

    You can also include a parameter from another configuration file using a different name, with an optional default value:

    < "license.cfg" [License] KDLicenseHost : LicenseServerHost=localhost

    This example uses the value of KDLicenseHost in the external configuration file as the value of LicenseServerHost.

  4. Save and close the configuration file.

Merge a Section from an External Configuration File

This method allows you to include a configuration section from an external configuration file as part of your Telegram Connector configuration file. For example, you might want to specify a standard SSL configuration section in an external file and share it between several servers. You can use this method if the configuration section that you want to import has a different name to the one you want to use.

To merge a configuration section from an external configuration file

  1. Open your configuration file in a text editor.
  2. Find or create the configuration section that you want to include from an external file. For example:

    [SSLOptions1]
  3. After the configuration section name, type a left angle bracket (<), followed by the path to and name of the external configuration file, in quotation marks (""). You can use relative paths and network locations. For example:

    [SSLOptions1] < "../sharedconfig/ssloptions.cfg"

    If the configuration section name in the external configuration file does not match the name that you want to use in your configuration file, specify the section to import after the configuration file name. For example:

    [SSLOptions1] < "../sharedconfig/ssloptions.cfg" [SharedSSLOptions]

    In this example, Telegram Connector uses the values in the [SharedSSLOptions] section of the external configuration file as the values in the [SSLOptions1] section of the Telegram Connector configuration file.

    NOTE: You can include additional configuration parameters in the section in your file. If these parameters also exist in the imported external configuration file, Telegram Connector uses the values in the local configuration file. For example:

    [SSLOptions1] < "ssloptions.cfg" [SharedSSLOptions]
    SSLCACertificatesPath=C:\OpenText\HTTPConnector\CACERTS\
  4. Save and close the configuration file.

Include a Value from an Environment Variable

You can include sensitive settings from an environment variable, to avoid storing the values directly in the configuration file.

To include a value from an environment value in your configuration file

  1. Open your configuration file in a text editor.
  2. Find or create the configuration section that must include the environment variable value. For example:

    [SSLOption1]

  3. After the configuration section name, type a left angle bracket (<), followed by :ENV and the name of the environment variable to use for the parameter. Next include the name of the parameter that must use this value. You can optionally also add a default value. For example:

    < :ENV SSL_PRIVATE_KEY_PASSWORD : SSLPrivateKeyPassword=Password123
  4. Save and close the configuration file.

Import a Value from an External Source

You can use a shared library to import a value from an external source. Your Telegram Connector installation directory includes a secretsdlls directory, which includes shared libraries that you can use to connect to an external source.

The following libraries are available:

  • HashiCorp® Vault. hashicorpvaultsecrets.dll or libhashicorpvaultsecrets.so

To import a value from HashiCorp Vault

  1. Open your configuration file in a text editor.
  2. Create a configuration section to define how to connect to your HashiCorp Vault. For example:

    [VaultSettings]
  3. Add parameters to define how to connect to the Vault.

    SecretPath (Required) The path to the secret data. This path takes the form :secret-mount-path/data/:path
    VaultURL The address of the Vault instance. The default value is http://localhost:8200/. You can use this default value in a Kubernetes environment with an Agent sidecar injector.
    VaultToken

    A Vault authentication token.

    AuthPath

    The path of the Vault auth method to use, as an alternative to supplying a authentication token directly. This option supports methods that authenticate with a JSON Web Token. If you set AuthPath, you must also set AuthRole and JWT or JWTPath.

    AuthRole The role to use when authenticating.
    JWT or JWTPath

    The JSON Web Token, or the path to a file that the component can read the JSON Web Token from.

    For example:

    [VaultSettings]
    SecretPath=secret/data/myapp/config
    VaultURL=https://myvault.example.com/
    VaultToken=xxxx
    
  4. Find or create the configuration section that must include the external value. For example:

    [SSLOption1]

  5. After the configuration section name, type a left angle bracket (<), followed by :HASHICORPVAULT. Next include the name of the configuration section where you defined how to connect to the Vault, followed by the name of the key to retrieve from the vault, then a colon (:) and the name of the the parameter that must use this value. You can optionally also add a default value. For example:

    < :HASHICORPVAULT [VaultSettings] KDSSLPrivateKeyPassword : SSLPrivateKeyPassword
  6. Save and close the configuration file.