conkw documentation - Configure your instance

The config file can be found in $CONKW_HOME/config/config.jsonc. The file format is jsonc, meaning json with comments. Lots of comments are already in the default config file, to help you figure out what is possible. Keep it around so that you can refer to it.

We will show you the basics in here:

General structure

{
  "instanceName": "_default_",
  "grabbers":[],
  "apiAuth":{},
  "httpPort": 12789,
  "enableApiCompression":true, 
  "disableDefaultUI":false,
  "disableCustomUI":false,
  "disableApi":false,
  "disableEmi":false
}

Note that if the last four flags are set to true, the internal Apache Tomcat instance won't be started and conkw will act as an agent. This will save a bit of memory and a tiny bit of CPU on startup.

The grabbers

The grabbers section of the config file is an array. It contains one entry per grabber you want configured. They all share a few properties. Let's look at an example:

{
  "implementation":"net.pieroxy.conkw.webapp.grabbers.openweathermap.OpenWeatherMapGrabber",
  "logLevel":"FINE",
  "name":"paris_weather",
  "config": {
    "toExtract":["minute","hour","day","current"],
    "token":"abcdef1234567890",
    "lat":48.8534,
    "lon":2.3488,
    "ttl":"1m",
    "errorTtl":"10s"
  }
},

Here is the meaning of these parameters:

Note: Some grabbers extend the TimeThrottledGrabber class and can define two extra properties in their config:

The API authentication

This section of the configuration file allows you to setup authentication for the API. The API is the endpoint mapped to /api that delivers the actual data to your UI.

"apiAuth":{
  "auth":false,
  "sessionLifetime":"1y",
  "sessionInactivityTimeout":"30d",
  "users":[
    {
      "credentialsRef":"testuser"
    }
  ]
},

Duration format

Have a look at the duration concept here