Hoplet configuration

Configure how a device connects to Hop, enrolls and reports changes.

Configuration file⁠

Hoplet's main configuration file is /etc/hop/hoplet/config.yaml.

/etc/hop/hoplet/config.yaml
server:
  url: https://devices.factory.example.com

trust:
  root_pin: sha256/UNhY4JhezH9gQYqvDMWrWH9CwlcKiECVqejMrND2VFw=

identity:
  bootstrap_certificate: /etc/hop/hoplet/bootstrap.pem
  bootstrap_key: /etc/hop/hoplet/bootstrap.key
  key_provider: file

device:
  id: line-3-press-7
  vendor: Acme
  model_number: PX-7
  serial_number_from: certificate
  labels:
    example.com/site: plant-1

capabilities:
  refresh_interval: 30m

log:
  level: info
  format: json

state_dir: /var/lib/hop/hoplet

Use a different configuration file

To select a different main file, pass --config /path/to/config.yaml to a Hoplet command or set HOPLET_CONFIG to its path.

Settings reference⁠

The tabs below describe each setting and its environment variable. File paths must be absolute, and required settings are marked with an asterisk ().

Set the address Hoplet connects to and the root that Hoplet trusts.

SettingPurpose
server.urlHOPLET_SERVER_URL
The Hop device API address. It must use HTTPS.
  • No default. Set the address of your Hop server.
trust.root_pinHOPLET_TRUST_ROOT_PIN
The pin of the Hop trust domain root: sha256/ and the Base64 SHA-256 of its public key. Hoplet accepts the first trust bundle only if it holds this root. See Get the trust root pin.
  • No default.

Configuration order⁠

Hoplet reads settings in the order below. Each source can replace values supplied by an earlier source:

  1. Built-in defaults.
  2. The main configuration file, normally /etc/hop/hoplet/config.yaml.
  3. Additional config.d/*.yaml files next to the main file, in filename order.
  4. HOPLET_* environment variables.
  5. Explicit command-line options.

Environment variables⁠

Each setting has a HOPLET_ variable with its name in uppercase and dots replaced by underscores. For example, server.url becomes HOPLET_SERVER_URL, and log.level becomes HOPLET_LOG_LEVEL.

The Hoplet service also reads variables from /etc/hop/hoplet/environment. List all available variables with:

hoplet config env

Check and apply changes⁠

Use config check to validate settings and config print to inspect the combined result:

sudo hoplet config check
sudo hoplet config print

Unknown setting names and HOPLET_* variables are rejected. The check identifies each problem so it can be corrected before changes are applied.

A reload updates device and observability settings and checks capabilities again:

sudo systemctl reload hoplet

For changes to other settings, restart the service:

sudo systemctl restart hoplet

Check systemd credentials in the service context

If the bootstrap certificate or key uses credential://, configuration checks need the service's credentials directory. See Protect the bootstrap key for that setup.