Skip to content

Configuration

Shreekantha Devasya edited this page May 18, 2020 · 12 revisions

LinkSmart Thing Directory is configured using a JSON configuration file, path to which is provided via --conf flag. By default, the server looks for a configuration file at: conf/thing-directory.json

All configuration fields (except for arrays of objects) can be overridden using environment variables. Below are few examples:

  • TD_BINDPORT=8081
  • TD_STORAGE_TYPE=leveldb
  • ❌TD_AUTH_AUTHORIZATION_RULES --> setting array of objects is not possible with env var

Configuration File

A sample configuration file is available at thing-directory.json.

where

  • description is a human-readable description for the TD
  • dnssdEnabled is a flag enabling DNS-SD advertisement of the catalog on the network
  • bindAddr is the HTTP bind address which the server listens on
  • bindPort is the HTTP bind port
  • storage is the configuration of the storage backend
    • type is the type of the backend (i.e. currently only leveldb)
    • dsn is the Data Source Name for storage backend (for leveldb, the dsn may be relative or absolute directory path)
  • serviceCatalog is the optional server information for a Service Catalog
    • discover is a flag enabling automatic discovery of the Service Catalog
    • endpoint is the URL of the Service Catalog HTTP API
    • ttl is the TTL for the service registration
  • auth is the Authentication configuration
    • enabled is a boolean flag enabling/disabling the authentication
    • provider is the name of a supported auth provider (i.e. currently only keycloak)
    • providerURL is the URL of the auth provider endpoint
    • serviceID is the ID of the service in the authentication provider (used for validating auth tokens provided by the clients)
    • basicEnabled is a boolean flag enabling/disabling Basic Authentication
    • authorization - optional, see authorization configuration
Clone this wiki locally