Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Configuration

Farshid Tavakolizadeh edited this page May 27, 2020 · 11 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.
  • 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
        • 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 to enable Basic Authentication and exchange credentials with the authentication provider using OAuth2 Client Credentials grant type.
        • authorization - optional, see authorization configuration
Clone this wiki locally