General Configuration and Usage

Installations

Package install/uninstall

Using RPMs file

  • Installing the package

yum install horizon-cli-<version>-1.x86_64.rpm
  • Uninstalling the package

yum remove horizon-cli

Using MSI file:

To install the package, double click on the MSI file and follow the instructions. To uninstall the package, simply browse to the Applications & program menu and uninstall the program.

Using binary file:

The linux binary file is usable on any linux distribution, to install it follow the steps below :

  • Add the binary file to the "PATH", in order to easily launch it on your shell.

  • Apply the executable permission on the binary file

chmod +x horizon-cli.bin

Command line installation & initialization

Use the command below to install the client and generate interactively your configuration file:

horizon-cli install

The configuration file can also be created using command line parameters:

horizon-cli install --endpoint https://horizon-test.com

Use the help to get the full list of available parameters.

If you did not use an installer, this command should always be run first to ensure everything is set up correctly.

Configuration Location

General parameters of Horizon Client are configured through a file placed in one of the following locations:

Global configuration :

  • /opt/horizon/etc/horizon-cli.conf

  • [C|D]:\ProgramData\EverTrust\Horizon\horizon-cli.conf

Per-user configuration :

  • ~/.horizon-cli/etc/horizon-cli.conf

  • [C|D]:\Users\<username>\AppData\Local\horizon-cli\horizon-cli.conf

In case the user running the Horizon Client is an administrator and the global configuration file is present and accessible by the user, the global configuration file will be used. Otherwise, the per-user configuration file will be used.

If the per-user configuration file is not present and the global configuration file is not accessible, the client will throw an error.

Configuration Content

Since version 1.10, the configuration was migrated from JSON to YAML, if you are upgrading from an earlier version, the configuration migration will be done automatically and should be seamless.

The configuration file is in YAML format and contains the following:

  api_id: API-ID
  api_key: API-Key
  endpoint: endpoint url. e.g. https://horizon-test.evertrust.fr
  debug: false
  timeout: 2
  proxy: proxy. e.g. http://myproxy.corp.local:3128
  root_ca: Root CA PEM Certificate(s).
  log_file: The log file of Horizon.

These parameters may be instead specified or overridden using environment variables, as detailed in the table below.

Table 1. General configuration parameters
Parameter Environment variable Description

api_id

HRZ_APIID

The API ID: the identifier of a local account user defined in Horizon. Used for discovery, import modes and for the revocation in the EST module

api_key

HRZ_APIKEY

The API Key. Used together with API ID

endpoint

HRZ_ENDPOINT

The URL of the Horizon instance, starting with http or https and without trailing "/"

debug

HRZ_DEBUG

Set to true to enable debug mode of the Horizon Client, defaults to false if unspecified.

timeout

Connection timeout in seconds, defaults to 2 seconds if unspecified.

proxy

HRZ_HTTPS_PROXY

HTTPS proxy used to reach Horizon (if any), in URL form which can contain login and password if needed.

root_ca

PEM chain of CA certificates that issued the TLS certificate exposed by Horizon. This parameter is optional, as preferred way is to put these CA certificates in the machine trust store.

log_file

HRZ_LOGFILE

Log file of horizon. This parameter is optional, but a default value is set as the Horizon Client displays useful messages on STDOUT and logs should always be kept.

In case you want to change the whole configuration file, the HRZ_CONFIG environment variable can contain an absolute path to the configuration file and will try to read it before defaulting to the standard configuration as detailed above.
In order to keep backward compatibility, legacy environment variables are still available and are the same as the one above without the HRZ_ prefix. These should not be used and should be migrated to HRZ-prefixed one.

You can use the “--help” parameter to get command line help on any command or sub-command.

horizon-cli <command> <subcommand> --help