Skip to content

Configuration

Farshid Tavakolizadeh edited this page Jun 16, 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_HTTP_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

  • 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)
  • dnssd is the configuration of DNS-SD

    • publish is the configuration of the DNS-SD publisher. The service type is _wot._tcp, subtype is _directory.
      • enabled is a boolean flag to enable the DNS-SD service registration
      • instance is the instance portion of the Service Instance Name
      • domain is the domain portion of the Service Instance Name
      • interfaces is to limit the networking interfaces on which the service is announced. When empty, the service is announced to all interfaces.
  • serviceCatalog is the optional server information for a Service Catalog

    • discover is a flag to enable automatic discovery of the Service Catalog
    • endpoint is the URL of the Service Catalog HTTP API
    • ttl is the TTL for the service registration
  • http is the configuration of the HTTP server

    • publicEndpoint is the fully qualified domain name (FQDN)
    • bindAddr is the HTTP bind address which the server listens on
    • bindPort is the HTTP bind port
      • auth is the Authentication configuration
        • enabled is a boolean flag to enable 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
        • clientID is the ID of the client in the authentication provider
        • basicEnabled is a boolean flag to enable Basic Authentication. This allows the server to exchange credentials (provided as basic auth header) with the authentication provider for a token on behalf of the user. Note: This should be enabled only if the requests are served over TLS. More info.
        • authorization - optional, see authorization configuration
Clone this wiki locally